ARC: Allow per-board more precise CPU identification
cover ARC: Allow per-board more precise CPU identification
Some of ARC boards do sport real silicon and given how flexible ARC cores might be configured it's hard to tell what "template" was used initially.
For FPGA-based boards we're left with basic info derived from IDENTITY register but for real silicon we may know more details so let's print them then.
Alexey Brodkin (2):
ARC: make generic print_cpuinfo() weak
iot_dk/hsdk: Implement its own print_cpuinfo()
arch/arc/lib/cpu.c | 2 +- board/synopsys/hsdk/hsdk.c | 8 ++++++++ board/synopsys/iot_devkit/iot_devkit.c | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-)
Signature · 1 line
2.7.4
PATCH 1/2 ARC: make generic print_cpuinfo() weak
This allows board to override print_cpuinfo() because they might know better which ARChitect template was used. This way we may not only derive base architecture type and version but more meaningful things like "ARC EM7D" instead of simple "ARC EM", "ARC HS36" instead of "ARC HS".
--- arch/arc/lib/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arc/lib/cpu.c +1 -1
@@ -60,7 +60,7 @@ const char *decode_identity(void) } } -int print_cpuinfo (void ) +__weak int print_cpuinfo (void ) {printf ("CPU: %s\n" ,decode_identity ());return 0 ;
Signature · 1 line
2.7.4
PATCH 2/2 iot_dk/hsdk: Implement its own print_cpuinfo()
In reply to Alexey BrodkinARC IDENTITY register only encodes major architecture type and version while for a particular board/silicon we may know better which template was used and so we may identify CPU more precise, which exactly we do here.
--- board/synopsys/hsdk/hsdk.c | 8 ++++++++ board/synopsys/iot_devkit/iot_devkit.c | 8 ++++++++ 2 files changed, 16 insertions(+)
board/synopsys/hsdk/hsdk.c +8 -0
@@ -1046,3 +1046,11 @@ int board_mmc_init(bd_t *bis)return 0 ; } + +#ifdef CONFIG_DISPLAY_CPUINFO +int print_cpuinfo (void ) +{ +printf ("CPU: ARC HS38 v2.1c\n" ); +return 0 ; +} +#endif /* CONFIG_DISPLAY_CPUINFO */
board/synopsys/iot_devkit/iot_devkit.c +8 -0
@@ -166,3 +166,11 @@ int checkboard(void)puts ("Board: Synopsys IoT Development Kit\n" );return 0 ; }; + +#ifdef CONFIG_DISPLAY_CPUINFO +int print_cpuinfo (void ) +{ +printf ("CPU: ARC EM9D\n" ); +return 0 ; +} +#endif /* CONFIG_DISPLAY_CPUINFO */
Signature · 1 line
2.7.4