aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ssb
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2011-04-27 12:21:34 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-28 14:53:22 -0400
commitaf335a6cbc3dfcba64ad31561c0da563d1c43a2d (patch)
tree034220351ca40fbae0a87ac9a501f79aa0869efe /drivers/ssb
parent5890a3ca34aae94dd736557ad8cb898ac2802aa0 (diff)
ssb: pci: early fix for SPROM core index
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/ssb')
-rw-r--r--drivers/ssb/driver_pcicore.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/ssb/driver_pcicore.c b/drivers/ssb/driver_pcicore.c
index 32a9b61f008d..8fde1220bc89 100644
--- a/drivers/ssb/driver_pcicore.c
+++ b/drivers/ssb/driver_pcicore.c
@@ -414,6 +414,16 @@ static int pcicore_is_in_hostmode(struct ssb_pcicore *pc)
414 * Workarounds. 414 * Workarounds.
415 **************************************************/ 415 **************************************************/
416 416
417static void ssb_pcicore_fix_sprom_core_index(struct ssb_pcicore *pc)
418{
419 u16 tmp = pcicore_read16(pc, SSB_PCICORE_SPROM(0));
420 if (((tmp & 0xF000) >> 12) != pc->dev->core_index) {
421 tmp &= ~0xF000;
422 tmp |= (pc->dev->core_index << 12);
423 pcicore_write16(pc, SSB_PCICORE_SPROM(0), tmp);
424 }
425}
426
417static u8 ssb_pcicore_polarity_workaround(struct ssb_pcicore *pc) 427static u8 ssb_pcicore_polarity_workaround(struct ssb_pcicore *pc)
418{ 428{
419 return (ssb_pcie_read(pc, 0x204) & 0x10) ? 0xC0 : 0x80; 429 return (ssb_pcie_read(pc, 0x204) & 0x10) ? 0xC0 : 0x80;
@@ -521,6 +531,8 @@ void ssb_pcicore_init(struct ssb_pcicore *pc)
521 if (!ssb_device_is_enabled(dev)) 531 if (!ssb_device_is_enabled(dev))
522 ssb_device_enable(dev, 0); 532 ssb_device_enable(dev, 0);
523 533
534 ssb_pcicore_fix_sprom_core_index(pc);
535
524#ifdef CONFIG_SSB_PCICORE_HOSTMODE 536#ifdef CONFIG_SSB_PCICORE_HOSTMODE
525 pc->hostmode = pcicore_is_in_hostmode(pc); 537 pc->hostmode = pcicore_is_in_hostmode(pc);
526 if (pc->hostmode) 538 if (pc->hostmode)