diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2012-11-18 21:27:00 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2012-11-18 21:27:00 +0000 |
commit | 86cc79ac985ffd954d26c88d144b82063a714636 (patch) | |
tree | d750f1c9a309e6ff92cdd4233d6b9749ce2bc996 /target/linux/brcm47xx/patches-3.6/193-MIPS-BCM47xx-read-out-full-board-data.patch | |
parent | d648dad7fa7708a1879579ac6a6e87825eccd028 (diff) | |
download | upstream-86cc79ac985ffd954d26c88d144b82063a714636.tar.gz upstream-86cc79ac985ffd954d26c88d144b82063a714636.tar.bz2 upstream-86cc79ac985ffd954d26c88d144b82063a714636.zip |
brcm47xx: add support for kernel 3.6
This is based on the patch by Peter Wagner.
SVN-Revision: 34252
Diffstat (limited to 'target/linux/brcm47xx/patches-3.6/193-MIPS-BCM47xx-read-out-full-board-data.patch')
-rw-r--r-- | target/linux/brcm47xx/patches-3.6/193-MIPS-BCM47xx-read-out-full-board-data.patch | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-3.6/193-MIPS-BCM47xx-read-out-full-board-data.patch b/target/linux/brcm47xx/patches-3.6/193-MIPS-BCM47xx-read-out-full-board-data.patch new file mode 100644 index 0000000000..bdfc348cc7 --- /dev/null +++ b/target/linux/brcm47xx/patches-3.6/193-MIPS-BCM47xx-read-out-full-board-data.patch @@ -0,0 +1,81 @@ +--- a/arch/mips/bcm47xx/sprom.c ++++ b/arch/mips/bcm47xx/sprom.c +@@ -164,10 +164,6 @@ static void nvram_read_alpha2(const char + 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); + nvram_read_u8(prefix, NULL, "ledbh2", &sprom->gpio2, 0xff); +@@ -214,13 +210,6 @@ static void bcm47xx_fill_sprom_r2389(str + nvram_read_u8(prefix, NULL, "pa1himaxpwr", &sprom->maxpwr_ah, 0); + } + +-static void bcm47xx_fill_sprom_r2(struct ssb_sprom *sprom, const char *prefix) +-{ +- nvram_read_u32_2(prefix, "boardflags", &sprom->boardflags_lo, +- &sprom->boardflags_hi); +- nvram_read_u16(prefix, NULL, "boardtype", &sprom->board_type, 0); +-} +- + static void bcm47xx_fill_sprom_r389(struct ssb_sprom *sprom, const char *prefix) + { + nvram_read_u8(prefix, NULL, "bxa2g", &sprom->bxa2g, 0); +@@ -241,9 +230,6 @@ static void bcm47xx_fill_sprom_r389(stru + + static void bcm47xx_fill_sprom_r3(struct ssb_sprom *sprom, const char *prefix) + { +- nvram_read_u32_2(prefix, "boardflags", &sprom->boardflags_lo, +- &sprom->boardflags_hi); +- nvram_read_u16(prefix, NULL, "boardtype", &sprom->board_type, 0); + nvram_read_u8(prefix, NULL, "regrev", &sprom->regrev, 0); + nvram_read_leddc(prefix, "leddc", &sprom->leddc_on_time, + &sprom->leddc_off_time); +@@ -252,11 +238,6 @@ static void bcm47xx_fill_sprom_r3(struct + static void bcm47xx_fill_sprom_r4589(struct ssb_sprom *sprom, + const char *prefix) + { +- nvram_read_u32_2(prefix, "boardflags", &sprom->boardflags_lo, +- &sprom->boardflags_hi); +- nvram_read_u32_2(prefix, "boardflags2", &sprom->boardflags2_lo, +- &sprom->boardflags2_hi); +- nvram_read_u16(prefix, NULL, "boardtype", &sprom->board_type, 0); + nvram_read_u8(prefix, NULL, "regrev", &sprom->regrev, 0); + nvram_read_s8(prefix, NULL, "ag2", &sprom->antenna_gain.a2, 0); + nvram_read_s8(prefix, NULL, "ag3", &sprom->antenna_gain.a3, 0); +@@ -555,9 +536,23 @@ void bcm47xx_fill_sprom_ethernet(struct + nvram_read_macaddr(prefix, "il0macaddr", &sprom->il0mac); + } + ++static void bcm47xx_fill_board_data(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_u16(prefix, NULL, "boardtype", &sprom->board_type, 0); ++ nvram_read_u32_2(prefix, "boardflags", &sprom->boardflags_lo, ++ &sprom->boardflags_hi); ++ nvram_read_u32_2(prefix, "boardflags2", &sprom->boardflags2_lo, ++ &sprom->boardflags2_hi); ++} ++ + void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix) + { + bcm47xx_fill_sprom_ethernet(sprom, prefix); ++ bcm47xx_fill_board_data(sprom, prefix); + + nvram_read_u8(prefix, NULL, "sromrev", &sprom->revision, 0); + +@@ -571,7 +566,6 @@ void bcm47xx_fill_sprom(struct ssb_sprom + bcm47xx_fill_sprom_r1234589(sprom, prefix); + bcm47xx_fill_sprom_r12389(sprom, prefix); + bcm47xx_fill_sprom_r2389(sprom, prefix); +- bcm47xx_fill_sprom_r2(sprom, prefix); + break; + case 3: + bcm47xx_fill_sprom_r1234589(sprom, prefix); |