ODROID-COMMON:Add device information to /proc/cpuinfo

Change-Id: I1148522b11733bfa05a1f74ecb756cf78a0b4fe4
This commit is contained in:
Kevin Kim
2018-11-29 18:38:05 +09:00
committed by Chris KIM
parent d5fe8b7858
commit f095c3ba4e
3 changed files with 20 additions and 3 deletions

View File

@@ -171,8 +171,9 @@ static int c_show(struct seq_file *m, void *v)
seq_printf(m, "%02x", chipid[i]);
seq_puts(m, "\n");
#endif
seq_printf(m, "Hardware\t: %s\n\n", "Amlogic");
system_rev = 0x0400;
seq_printf(m, "Hardware\t: %s\n", machine_name);
seq_printf(m, "Revision\t: %04x\n\n", system_rev);
return 0;
}

View File

@@ -66,6 +66,12 @@
phys_addr_t __fdt_pointer __initdata;
const char *machine_name;
EXPORT_SYMBOL(machine_name);
unsigned int system_rev;
EXPORT_SYMBOL(system_rev);
/*
* Standard memory resources
*/
@@ -180,6 +186,7 @@ static void __init smp_build_mpidr_hash(void)
static void __init setup_machine_fdt(phys_addr_t dt_phys)
{
void *dt_virt = fixmap_remap_fdt(dt_phys);
const char *name;
if (!dt_virt || !early_init_dt_scan(dt_virt)) {
pr_crit("\n"
@@ -192,7 +199,13 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys)
cpu_relax();
}
dump_stack_set_arch_desc("%s (DT)", of_flat_dt_get_machine_name());
name = of_flat_dt_get_machine_name();
if (!name)
return;
machine_name = name;
pr_info("Machine model: %s\n", name);
dump_stack_set_arch_desc("%s (DT)", name);
}
static void __init request_standard_resources(void)

View File

@@ -45,6 +45,9 @@
#define MESON_CPU_VERSION_LVL_MISC 3
#define MESON_CPU_VERSION_LVL_MAX MESON_CPU_VERSION_LVL_MISC
extern const char *machine_name;
extern unsigned int system_rev;
#define CHIPID_LEN 16
void cpuinfo_get_chipid(unsigned char *cid, unsigned int size);
int meson_cpu_version_init(void);