MIPS: bcm47xx: read baordrev without prefix from sprom

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>
This commit is contained in:
Hauke Mehrtens 2012-04-29 02:04:09 +02:00 committed by John W. Linville
parent 0a2fcaa70c
commit a255955622
1 changed files with 2 additions and 0 deletions

View File

@ -165,6 +165,8 @@ static void bcm47xx_fill_sprom_r1234589(struct ssb_sprom *sprom,
const char *prefix) const char *prefix)
{ {
nvram_read_u16(prefix, NULL, "boardrev", &sprom->board_rev, 0); 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_u16(prefix, NULL, "boardnum", &sprom->board_num, 0);
nvram_read_u8(prefix, NULL, "ledbh0", &sprom->gpio0, 0xff); nvram_read_u8(prefix, NULL, "ledbh0", &sprom->gpio0, 0xff);
nvram_read_u8(prefix, NULL, "ledbh1", &sprom->gpio1, 0xff); nvram_read_u8(prefix, NULL, "ledbh1", &sprom->gpio1, 0xff);