aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ssb
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2011-04-27 11:39:48 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-28 14:53:22 -0400
commit5890a3ca34aae94dd736557ad8cb898ac2802aa0 (patch)
treeff230ba6d9a1fa2d9ee24c573d005976677a0ffd /drivers/ssb
parent6e914101d47c76e09b0568d094ef44257dd3d6e9 (diff)
ssb: pci: update PCIe workarounds
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.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/drivers/ssb/driver_pcicore.c b/drivers/ssb/driver_pcicore.c
index adde4f060fd8..32a9b61f008d 100644
--- a/drivers/ssb/driver_pcicore.c
+++ b/drivers/ssb/driver_pcicore.c
@@ -460,16 +460,23 @@ static void ssb_pcicore_pci_setup_workarounds(struct ssb_pcicore *pc)
460 460
461static void ssb_pcicore_pcie_setup_workarounds(struct ssb_pcicore *pc) 461static void ssb_pcicore_pcie_setup_workarounds(struct ssb_pcicore *pc)
462{ 462{
463 struct ssb_device *pdev = pc->dev;
464 u32 tmp; 463 u32 tmp;
464 u8 rev = pc->dev->id.revision;
465 465
466 if ((pdev->id.revision == 0) || (pdev->id.revision == 1)) { 466 if (rev == 0 || rev == 1) {
467 /* TLP Workaround register. */ 467 /* TLP Workaround register. */
468 tmp = ssb_pcie_read(pc, 0x4); 468 tmp = ssb_pcie_read(pc, 0x4);
469 tmp |= 0x8; 469 tmp |= 0x8;
470 ssb_pcie_write(pc, 0x4, tmp); 470 ssb_pcie_write(pc, 0x4, tmp);
471 } 471 }
472 if (pdev->id.revision == 0) { 472 if (rev == 1) {
473 /* DLLP Link Control register. */
474 tmp = ssb_pcie_read(pc, 0x100);
475 tmp |= 0x40;
476 ssb_pcie_write(pc, 0x100, tmp);
477 }
478
479 if (rev == 0) {
473 const u8 serdes_rx_device = 0x1F; 480 const u8 serdes_rx_device = 0x1F;
474 481
475 ssb_pcie_mdio_write(pc, serdes_rx_device, 482 ssb_pcie_mdio_write(pc, serdes_rx_device,
@@ -478,11 +485,20 @@ static void ssb_pcicore_pcie_setup_workarounds(struct ssb_pcicore *pc)
478 6 /* CDR */, 0x0100); 485 6 /* CDR */, 0x0100);
479 ssb_pcie_mdio_write(pc, serdes_rx_device, 486 ssb_pcie_mdio_write(pc, serdes_rx_device,
480 7 /* CDR BW */, 0x1466); 487 7 /* CDR BW */, 0x1466);
481 } else if (pdev->id.revision == 1) { 488 } else if (rev == 3 || rev == 4 || rev == 5) {
482 /* DLLP Link Control register. */ 489 /* TODO: DLLP Power Management Threshold */
483 tmp = ssb_pcie_read(pc, 0x100); 490 ssb_pcicore_serdes_workaround(pc);
484 tmp |= 0x40; 491 /* TODO: ASPM */
485 ssb_pcie_write(pc, 0x100, tmp); 492 } else if (rev == 7) {
493 /* TODO: No PLL down */
494 }
495
496 if (rev >= 6) {
497 /* Miscellaneous Configuration Fixup */
498 tmp = pcicore_read16(pc, SSB_PCICORE_SPROM(5));
499 if (!(tmp & 0x8000))
500 pcicore_write16(pc, SSB_PCICORE_SPROM(5),
501 tmp | 0x8000);
486 } 502 }
487} 503}
488 504
@@ -513,7 +529,10 @@ void ssb_pcicore_init(struct ssb_pcicore *pc)
513 if (!pc->hostmode) 529 if (!pc->hostmode)
514 ssb_pcicore_init_clientmode(pc); 530 ssb_pcicore_init_clientmode(pc);
515 531
532 /* Additional always once-executed workarounds */
516 ssb_pcicore_serdes_workaround(pc); 533 ssb_pcicore_serdes_workaround(pc);
534 /* TODO: ASPM */
535 /* TODO: Clock Request Update */
517} 536}
518 537
519static u32 ssb_pcie_read(struct ssb_pcicore *pc, u32 address) 538static u32 ssb_pcie_read(struct ssb_pcicore *pc, u32 address)