Commit 54435f9e authored by Rafał Miłecki's avatar Rafał Miłecki Committed by John W. Linville

ssb: workarounds: be verbose about hacking SPROM revision, don't duplicate code

Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d1f9e41d
...@@ -573,17 +573,19 @@ static int sprom_extract(struct ssb_bus *bus, struct ssb_sprom *out, ...@@ -573,17 +573,19 @@ static int sprom_extract(struct ssb_bus *bus, struct ssb_sprom *out,
ssb_dprintk(KERN_DEBUG PFX "SPROM revision %d detected.\n", out->revision); ssb_dprintk(KERN_DEBUG PFX "SPROM revision %d detected.\n", out->revision);
memset(out->et0mac, 0xFF, 6); /* preset et0 and et1 mac */ memset(out->et0mac, 0xFF, 6); /* preset et0 and et1 mac */
memset(out->et1mac, 0xFF, 6); memset(out->et1mac, 0xFF, 6);
if ((bus->chip_id & 0xFF00) == 0x4400) { if ((bus->chip_id & 0xFF00) == 0x4400) {
/* Workaround: The BCM44XX chip has a stupid revision /* Workaround: The BCM44XX chip has a stupid revision
* number stored in the SPROM. * number stored in the SPROM.
* Always extract r1. */ * Always extract r1. */
out->revision = 1; out->revision = 1;
sprom_extract_r123(out, in); ssb_dprintk(KERN_DEBUG PFX "SPROM treated as revision %d\n", out->revision);
} else if (bus->chip_id == 0x4321) { } else if (bus->chip_id == 0x4321) {
/* the BCM4328 has a chipid == 0x4321 and a rev 4 SPROM */ /* the BCM4328 has a chipid == 0x4321 and a rev 4 SPROM */
out->revision = 4; out->revision = 4;
sprom_extract_r45(out, in); ssb_dprintk(KERN_DEBUG PFX "SPROM treated as revision %d\n", out->revision);
} else { }
switch (out->revision) { switch (out->revision) {
case 1: case 1:
case 2: case 2:
...@@ -604,7 +606,6 @@ static int sprom_extract(struct ssb_bus *bus, struct ssb_sprom *out, ...@@ -604,7 +606,6 @@ static int sprom_extract(struct ssb_bus *bus, struct ssb_sprom *out,
out->revision = 1; out->revision = 1;
sprom_extract_r123(out, in); sprom_extract_r123(out, in);
} }
}
if (out->boardflags_lo == 0xFFFF) if (out->boardflags_lo == 0xFFFF)
out->boardflags_lo = 0; /* per specs */ out->boardflags_lo = 0; /* per specs */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment