Skip to content

Commit

Permalink
ssb: add delay after PCI reset to fix SoC reboots
Browse files Browse the repository at this point in the history
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  • Loading branch information
Rafał Miłecki authored and Kalle Valo committed Apr 7, 2015
1 parent 61b559d commit f56d9e2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/ssb/driver_pcicore.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,15 @@ static void ssb_pcicore_init_hostmode(struct ssb_pcicore *pc)
pcicore_write32(pc, SSB_PCICORE_SBTOPCI2,
SSB_PCICORE_SBTOPCI_MEM | SSB_PCI_DMA);

/*
* Accessing PCI config without a proper delay after devices reset (not
* GPIO reset) was causing reboots on WRT300N v1.0.
* Tested delay 850 us lowered reboot chance to 50-80%, 1000 us fixed it
* completely. Flushing all writes was also tested but with no luck.
*/
if (pc->dev->bus->chip_id == 0x4704)
usleep_range(1000, 2000);

/* Enable PCI bridge BAR0 prefetch and burst */
val = PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY;
ssb_extpci_write_config(pc, 0, 0, 0, PCI_COMMAND, &val, 2);
Expand Down

0 comments on commit f56d9e2

Please sign in to comment.