MIPS: bcm47xx: read baordrev without prefix from sprom
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 29 Apr 2012 00:04:09 +0000 (02:04 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 16 May 2012 16:45:21 +0000 (12:45 -0400)
When the boardrev with a prefix is not available, try to read it
without a prefix. This is based on code from the Broadcom SDK.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
arch/mips/bcm47xx/sprom.c

index a29d20743039e6270cb7ea1a847b47312fa07415..17282e0d7835f3208049f219d37f66de1de28b6a 100644 (file)
@@ -165,6 +165,8 @@ static void bcm47xx_fill_sprom_r1234589(struct ssb_sprom *sprom,
                                        const char *prefix)
 {
        nvram_read_u16(prefix, NULL, "boardrev", &sprom->board_rev, 0);
+       if (!sprom->board_rev)
+               nvram_read_u16(NULL, NULL, "boardrev", &sprom->board_rev, 0);
        nvram_read_u16(prefix, NULL, "boardnum", &sprom->board_num, 0);
        nvram_read_u8(prefix, NULL, "ledbh0", &sprom->gpio0, 0xff);
        nvram_read_u8(prefix, NULL, "ledbh1", &sprom->gpio1, 0xff);