
Dear Sanjeev Premi,
In message 1260902266-26009-4-git-send-email-premi@ti.com you wrote:
The function is updated to make use of the cpu related information extracted in arch_cpu_init().
Signed-off-by: Sanjeev Premi premi@ti.com
cpu/arm_cortexa8/omap3/sys_info.c | 45 ++++++++++++++++++++++++------------ 1 files changed, 30 insertions(+), 15 deletions(-)
diff --git a/cpu/arm_cortexa8/omap3/sys_info.c b/cpu/arm_cortexa8/omap3/sys_info.c index 3544d26..1228f5f 100644 --- a/cpu/arm_cortexa8/omap3/sys_info.c +++ b/cpu/arm_cortexa8/omap3/sys_info.c @@ -364,45 +364,60 @@ u32 get_device_type(void) */ int print_cpuinfo (void) {
- char *cpu_s, *sec_s;
- char cpu_s[16], sec_s[4];
- switch (get_cpu_type()) {
- switch (cpu_id) { case OMAP3503:
cpu_s = "3503";
break; case OMAP3515:strcpy(cpu_s, "OMAP3503");
cpu_s = "3515";
break; case OMAP3525:strcpy(cpu_s, "OMAP3515");
cpu_s = "3525";
break;strcpy(cpu_s, "OMAP3503");
- case OMAP3430: case OMAP3530:
cpu_s = "3530";
break;strcpy(cpu_s, "OMAP3430/3530");
- default:
cpu_s = "35XX";
case CTRL_AM3505:
strcpy(cpu_s, "AM3505");
break;
case CTRL_AM3517:
strcpy(cpu_s, "AM3517");
break;
default:
if (cpu_family == CPU_AM35XX)
strcpy(cpu_s, "AM35xx");
else
strcpy(cpu_s, "OMAP34xx/35xx");
}
switch (get_device_type()) { case TST_DEVICE:
sec_s = "TST";
break; case EMU_DEVICE:strcpy(sec_s, "TST");
sec_s = "EMU";
break; case HS_DEVICE:strcpy(sec_s, "EMU");
sec_s = "HS";
break; case GP_DEVICE:strcpy(sec_s, "HS");
sec_s = "GP";
break; default:strcpy(sec_s, "GP");
sec_s = "?";
}strcpy(sec_s, "?");
- printf("OMAP%s-%s ES%s, CPU-OPP2 L3-165MHz\n",
cpu_s, sec_s, rev_s[get_cpu_rev()]);
- /*
* TBD: Revision numbers for AM35x may not be same as OMAP35x.
* Will need to re-look sometime later.
*/
- printf("%s-%s ES%s,%s L3-165MHz\n",
cpu_s, sec_s, rev_s[get_cpu_rev()],
(cpu_family == CPU_AM35XX) ? "" : " CPU-OPP2");
Changing pointers to constant strings into using an array with lots of function calls (strcpy()) makes no sense to me. I think the resulting code is just bigger and slower.
Or am I overlooking something?
Best regards,
Wolfgang Denk