Commit d8e23522 authored by Martin Fuzzey's avatar Martin Fuzzey Committed by John W. Linville

ssb-pcmcia: Fix 32bit register access in early bus scanning

The scan function was using 32 bit access which does not
work on 16bit CF cards.

This patch corrects this by doing two 16 bit reads like
ssb_pcmcia_read32 already does.

mb -- Removed locking. That early in init there's no need for locking.
Signed-off-by: default avatarMartin Fuzzey <mfuzzey@gmail.com>
Signed-off-by: default avatarMichael Buesch <mb@bu3sch.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 26062897
...@@ -162,6 +162,8 @@ static u8 chipid_to_nrcores(u16 chipid) ...@@ -162,6 +162,8 @@ static u8 chipid_to_nrcores(u16 chipid)
static u32 scan_read32(struct ssb_bus *bus, u8 current_coreidx, static u32 scan_read32(struct ssb_bus *bus, u8 current_coreidx,
u16 offset) u16 offset)
{ {
u32 lo, hi;
switch (bus->bustype) { switch (bus->bustype) {
case SSB_BUSTYPE_SSB: case SSB_BUSTYPE_SSB:
offset += current_coreidx * SSB_CORE_SIZE; offset += current_coreidx * SSB_CORE_SIZE;
...@@ -174,7 +176,9 @@ static u32 scan_read32(struct ssb_bus *bus, u8 current_coreidx, ...@@ -174,7 +176,9 @@ static u32 scan_read32(struct ssb_bus *bus, u8 current_coreidx,
offset -= 0x800; offset -= 0x800;
} else } else
ssb_pcmcia_switch_segment(bus, 0); ssb_pcmcia_switch_segment(bus, 0);
break; lo = readw(bus->mmio + offset);
hi = readw(bus->mmio + offset + 2);
return lo | (hi << 16);
case SSB_BUSTYPE_SDIO: case SSB_BUSTYPE_SDIO:
offset += current_coreidx * SSB_CORE_SIZE; offset += current_coreidx * SSB_CORE_SIZE;
return ssb_sdio_scan_read32(bus, offset); return ssb_sdio_scan_read32(bus, offset);
......
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