diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2015-08-27 19:37:13 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-10-22 14:18:30 -0400 |
commit | 679f82c349473c894159795c14a7fc0a8db0cd43 (patch) | |
tree | e80d31f3c6dab9fad904bfc0524cb3058aaccf9b /arch/arm/cpu | |
parent | 07815eb9f3f742237085e3eda947e095926212b0 (diff) |
omap-common: Common function to display die id, replacing omap3-specific version
This introduces omap_die_id_display to display the full die id.
There is no need to store it in an environment variable, that no boot script
is using anyway.
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r-- | arch/arm/cpu/armv7/omap-common/utils.c | 10 | ||||
-rw-r--r-- | arch/arm/cpu/armv7/omap3/board.c | 2 | ||||
-rw-r--r-- | arch/arm/cpu/armv7/omap3/sys_info.c | 22 |
3 files changed, 11 insertions, 23 deletions
diff --git a/arch/arm/cpu/armv7/omap-common/utils.c b/arch/arm/cpu/armv7/omap-common/utils.c index 28d0f86251..dc5a169f9a 100644 --- a/arch/arm/cpu/armv7/omap-common/utils.c +++ b/arch/arm/cpu/armv7/omap-common/utils.c @@ -83,3 +83,13 @@ void omap_die_id_usbethaddr(void) eth_setenv_enetaddr("usbethaddr", mac); } } + +void omap_die_id_display(void) +{ + unsigned int die_id[4] = { 0 }; + + omap_die_id(die_id); + + printf("OMAP die ID: %08x%08x%08x%08x", die_id[0], die_id[1], die_id[2], + die_id[3]); +} diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c index 8252b322f6..0c44ea53e1 100644 --- a/arch/arm/cpu/armv7/omap3/board.c +++ b/arch/arm/cpu/armv7/omap3/board.c @@ -214,7 +214,7 @@ void board_init_f(ulong dummy) */ int __weak misc_init_r(void) { - dieid_num_r(); + omap_die_id_display(); return 0; } diff --git a/arch/arm/cpu/armv7/omap3/sys_info.c b/arch/arm/cpu/armv7/omap3/sys_info.c index 497dc1392a..6818fab253 100644 --- a/arch/arm/cpu/armv7/omap3/sys_info.c +++ b/arch/arm/cpu/armv7/omap3/sys_info.c @@ -52,28 +52,6 @@ void omap_die_id(unsigned int *die_id) die_id[3] = readl(&id_base->die_id_3); } -/***************************************************************** - * dieid_num_r(void) - read and set die ID - *****************************************************************/ -void dieid_num_r(void) -{ - char *uid_s, die_id[34]; - u32 id[4]; - - memset(die_id, 0, sizeof(die_id)); - - uid_s = getenv("dieid#"); - - if (uid_s == NULL) { - omap_die_id(id); - sprintf(die_id, "%08x%08x%08x%08x", id[0], id[1], id[2], id[3]); - setenv("dieid#", die_id); - uid_s = die_id; - } - - printf("Die ID #%s\n", uid_s); -} - /****************************************** * get_cpu_type(void) - extract cpu info ******************************************/ |