ssb: use u16 for storing board rev
Rafał Miłecki
maintainerPATCH 1/2 ssb: use u16 for storing board rev
Specs say about size 2 (u16) and my 14e4:4727 has board rev 0x1211.
--- include/linux/ssb/ssb.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/ssb/ssb.h +1 -1
@@ -25,7 +25,7 @@ struct ssb_sprom {u8 et1phyaddr;/* MII address for enet1 */ u8 et0mdcport;/* MDIO for enet0 */ u8 et1mdcport;/* MDIO for enet1 */ -u8 board_rev;/* Board revision number from SPROM. */ +u16 board_rev;/* Board revision number from SPROM. */ u8 country_code;/* Country Code */ u16 leddc_on_time;/* LED Powersave Duty Cycle On Count */ u16 leddc_off_time;/* LED Powersave Duty Cycle Off Count */
Signature · 1 line
1.7.3.4
Rafał Miłecki
maintainerPATCH 2/2 bcma: extract some basic info about board from SPROM
--- drivers/bcma/sprom.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/bcma/sprom.c +9 -0
@@ -133,6 +133,15 @@ static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom) v = sprom[SPOFF (SSB_SPROM8_IL0MAC ) + i]; *(((__be16 *)bus->sprom.il0mac) + i) =cpu_to_be16 (v); } + + bus->sprom.board_rev = sprom[SPOFF (SSB_SPROM8_BOARDREV )]; + + bus->sprom.boardflags_lo = sprom[SPOFF (SSB_SPROM8_BFLLO )]; + bus->sprom.boardflags_hi = sprom[SPOFF (SSB_SPROM8_BFLHI )]; + bus->sprom.boardflags2_lo = sprom[SPOFF (SSB_SPROM8_BFL2LO )]; + bus->sprom.boardflags2_hi = sprom[SPOFF (SSB_SPROM8_BFL2HI )]; + + bus->sprom.country_code = sprom[SPOFF (SSB_SPROM8_CCODE )]; }int bcma_sprom_get (struct bcma_bus *bus)
Signature · 1 line
1.7.3.4
PATCH 2/2 bcma: extract some basic info about board from SPROM
Quoted 16 lines · Rafa? Mi?ecki
Signed-off-by Rafa? Mi?ecki<[email protected]>--- drivers/bcma/sprom.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)drivers/bcma/sprom.c +2
-0@@ -133,6 +133,15 @@ static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom) v = sprom[SPOFF (SSB_SPROM8_IL0MAC ) + i]; *(((__be16 *)bus->sprom.il0mac) + i) =cpu_to_be16 (v); } + + bus->sprom.board_rev = sprom[SPOFF (SSB_SPROM8_BOARDREV )];
drivers/bcma/sprom.c static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom) · line 147
Quoted 10 lines
drivers/bcma/sprom.c +7
-0+ + bus->sprom.boardflags_lo = sprom[SPOFF (SSB_SPROM8_BFLLO )]; + bus->sprom.boardflags_hi = sprom[SPOFF (SSB_SPROM8_BFLHI )]; + bus->sprom.boardflags2_lo = sprom[SPOFF (SSB_SPROM8_BFL2LO )]; + bus->sprom.boardflags2_hi = sprom[SPOFF (SSB_SPROM8_BFL2HI )]; + + bus->sprom.country_code = sprom[SPOFF (SSB_SPROM8_CCODE )]; }int bcma_sprom_get (struct bcma_bus *bus)
Does the card in question not need any other info from the SPROM, or is this just a first step? Is the usual SPROM Rev 8 code part of ssb, and is that the reason you don't use it here?
Larry
Rafał Miłecki
maintainerPATCH 2/2 bcma: extract some basic info about board from SPROM
W dniu 28 sierpnia 2011 19:03 u?ytkownik Larry Finger <[email protected]> napisa?:
Quoted 27 lines · Rafa? Mi?ecki
Quoted 26 lines
Signed-off-by Rafa? Mi?ecki<[email protected]>---
?drivers/bcma/sprom.c | ? ?9 +++++++++
?1 files changed, 9 insertions(+), 0 deletions(-)drivers/bcma/sprom.c +9
-0@@ -133,6 +133,15 @@ static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom) ? ? ? ? ? ? ? ?v = sprom[SPOFF(SSB_SPROM8_IL0MAC) + i]; ? ? ? ? ? ? ? ?*(((__be16 *)bus->sprom.il0mac) + i) = cpu_to_be16(v); ? ? ? ?} + + ? ? ? bus->sprom.board_rev = sprom[SPOFF(SSB_SPROM8_BOARDREV)]; + + ? ? ? bus->sprom.boardflags_lo = sprom[SPOFF(SSB_SPROM8_BFLLO)]; + ? ? ? bus->sprom.boardflags_hi = sprom[SPOFF(SSB_SPROM8_BFLHI)]; + ? ? ? bus->sprom.boardflags2_lo = sprom[SPOFF(SSB_SPROM8_BFL2LO)]; + ? ? ? bus->sprom.boardflags2_hi = sprom[SPOFF(SSB_SPROM8_BFL2HI)]; + + ? ? ? bus->sprom.country_code = sprom[SPOFF(SSB_SPROM8_CCODE)]; ?}
Quoted 5 lines
Quoted 1 line
?int
bcma_sprom_get(struct bcma_bus *bus)Does the card in question not need any other info from the SPROM, or is this just a first step? Is the usual SPROM Rev 8 code part of ssb, and is that the reason you don't use it here?
It will need more info, I just didn't add everything yet. I think we should review ssb's code anyway, so I didn't copy&paste it. For example ssb doesn't read board_rev at the moment for SPROM rev 8.
Signature · 1 line
Rafa?
PATCH 1/2 ssb: use u16 for storing board rev
In reply to Rafał MiłeckiQuoted 4 lines · Rafa? Mi?ecki
Specs say about size 2 (u16) and my 14e4:4727 has board rev
0x1211.Signed-off-by Rafa? Mi?ecki<[email protected]>---
Quoted 16 lines
include/linux/ssb/ssb.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)include/linux/ssb/ssb.h +1
-1@@ -25,7 +25,7 @@ struct ssb_sprom {u8 et1phyaddr;/* MII address for enet1 */ u8 et0mdcport;/* MDIO for enet0 */ u8 et1mdcport;/* MDIO for enet1 */ -u8 board_rev;/* Board revision number from SPROM. */ +u16 board_rev;/* Board revision number from SPROM. */ u8 country_code;/* Country Code */ u16 leddc_on_time;/* LED Powersave Duty Cycle On Count */ u16 leddc_off_time;/* LED Powersave Duty Cycle Off Count */