diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c index dcc983196aa2..a782e5e5ad2b 100644 --- a/arch/arm64/kernel/cpuinfo.c +++ b/arch/arm64/kernel/cpuinfo.c @@ -37,6 +37,9 @@ #include #endif +#ifdef CONFIG_ARCH_MESON64_ODROID_COMMON +#include +#endif /* * In case the boot CPU is hotpluggable, we record its initial state and @@ -164,12 +167,42 @@ static int c_show(struct seq_file *m, void *v) seq_printf(m, "CPU part\t: 0x%03x\n", MIDR_PARTNUM(midr)); seq_printf(m, "CPU revision\t: %d\n\n", MIDR_REVISION(midr)); } +#ifdef CONFIG_ARCH_MESON64_ODROID_COMMON +#ifdef CONFIG_AMLOGIC_CPU_INFO + cpuinfo_get_chipid(chipid, CHIPID_LEN); + seq_puts(m, "CPU info\t: "); + for (i = 0; i < 16; i++) + seq_printf(m, "%02x", chipid[i]); + seq_puts(m, "\n"); +#endif + { + int ret; + char uuid[32]; + char *p = uuid; + loff_t pos = 0; + + seq_puts(m, "Serial\t\t: "); + + ret = efuse_read_usr(uuid, sizeof(uuid), &pos); + if ((ret < 0) || (ret != sizeof(uuid))) { + seq_puts(m, "Unknown\n"); + } else { + for (i = 0; i < sizeof(uuid); i++) { + if ((i == 8) || (i == 12) || (i == 16) || (i == 20)) + seq_putc(m, '-'); + seq_printf(m, "%c", uuid[i]); + } + seq_putc(m, '\n'); + } + } +#else #ifdef CONFIG_AMLOGIC_CPU_INFO cpuinfo_get_chipid(chipid, CHIPID_LEN); seq_puts(m, "Serial\t\t: "); for (i = 0; i < 16; i++) seq_printf(m, "%02x", chipid[i]); seq_puts(m, "\n"); +#endif #endif system_rev = 0x0400; seq_printf(m, "Hardware\t: %s\n", machine_name); diff --git a/include/linux/amlogic/efuse.h b/include/linux/amlogic/efuse.h index 4e51fd6852c3..5fa2252e0b7d 100644 --- a/include/linux/amlogic/efuse.h +++ b/include/linux/amlogic/efuse.h @@ -34,4 +34,7 @@ ssize_t efuse_user_attr_read(char *name, char *buf); #else int efuse_read_intlItem(char *intl_item, char *buf, int size); #endif + +ssize_t efuse_read_usr(char *buf, size_t count, loff_t *ppos); + #endif