1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
3 @@ -723,10 +723,20 @@ void __init board_prom_init(void)
6 cfe = boot_addr + BCM963XX_CFE_VERSION_OFFSET;
7 - if (!memcmp(cfe, "cfe-v", 5))
8 - snprintf(cfe_version, sizeof(cfe_version), "%u.%u.%u-%u.%u",
9 - cfe[5], cfe[6], cfe[7], cfe[8], cfe[9]);
11 + if (strstarts(cfe, "cfe-")) {
14 + snprintf(cfe_version, 11, "%s", (char *) &cfe[5]);
15 + else if (cfe[10] > 0)
16 + snprintf(cfe_version, sizeof(cfe_version), "%u.%u.%u-%u.%u-%u",
17 + cfe[5], cfe[6], cfe[7], cfe[8], cfe[9], cfe[10]);
19 + snprintf(cfe_version, sizeof(cfe_version), "%u.%u.%u-%u.%u",
20 + cfe[5], cfe[6], cfe[7], cfe[8], cfe[9]);
22 + snprintf(cfe_version, 12, "%s", (char *) &cfe[4]);
25 strcpy(cfe_version, "unknown");
26 pr_info("CFE version: %s\n", cfe_version);