aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/drivers
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-09-20 03:12:58 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-09-20 03:12:58 -0400
commitbd792aea441a3dcdede462486ab8c63045803844 (patch)
tree3b109a3c504cf3b994d3936a6a85145cc59bc631 /arch/sh/drivers
parentbeb54ad9c6fb60901d9445056d40bdaccdc3e819 (diff)
sh: pci: Support ports with disabled links on SH7786 PCIe.
Presently we error out if a link is disabled and simply drop the port registration outright. This follows the PPC changes and simply reports on the link state on boot, leaving the port registered, in order to more easily deal with hotplug on future parts. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/drivers')
-rw-r--r--arch/sh/drivers/pci/pcie-sh7786.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/arch/sh/drivers/pci/pcie-sh7786.c b/arch/sh/drivers/pci/pcie-sh7786.c
index 21854ebbaa7c..aacd0fc4cdd5 100644
--- a/arch/sh/drivers/pci/pcie-sh7786.c
+++ b/arch/sh/drivers/pci/pcie-sh7786.c
@@ -341,9 +341,12 @@ static int pcie_init(struct sh7786_pcie_port *port)
341 data |= PCIEMACCTLR_SCR_DIS | (0xff << 16); 341 data |= PCIEMACCTLR_SCR_DIS | (0xff << 16);
342 pci_write_reg(chan, data, SH4A_PCIEMACCTLR); 342 pci_write_reg(chan, data, SH4A_PCIEMACCTLR);
343 343
344 /*
345 * This will timeout if we don't have a link, but we permit the
346 * port to register anyways in order to support hotplug on future
347 * hardware.
348 */
344 ret = pci_wait_for_irq(chan, MASK_INT_TX_CTRL); 349 ret = pci_wait_for_irq(chan, MASK_INT_TX_CTRL);
345 if (unlikely(ret != 0))
346 return -ENODEV;
347 350
348 data = pci_read_reg(chan, SH4A_PCIEPCICONF1); 351 data = pci_read_reg(chan, SH4A_PCIEPCICONF1);
349 data &= ~(PCI_STATUS_DEVSEL_MASK << 16); 352 data &= ~(PCI_STATUS_DEVSEL_MASK << 16);
@@ -356,9 +359,13 @@ static int pcie_init(struct sh7786_pcie_port *port)
356 359
357 wmb(); 360 wmb();
358 361
359 data = pci_read_reg(chan, SH4A_PCIEMACSR); 362 if (ret == 0) {
360 printk(KERN_NOTICE "PCI: PCIe#%d link width %d\n", 363 data = pci_read_reg(chan, SH4A_PCIEMACSR);
361 port->index, (data >> 20) & 0x3f); 364 printk(KERN_NOTICE "PCI: PCIe#%d x%d link detected\n",
365 port->index, (data >> 20) & 0x3f);
366 } else
367 printk(KERN_NOTICE "PCI: PCIe#%d link down\n",
368 port->index);
362 369
363 for (i = win = 0; i < chan->nr_resources; i++) { 370 for (i = win = 0; i < chan->nr_resources; i++) {
364 struct resource *res = chan->resources + i; 371 struct resource *res = chan->resources + i;