1. 27 6月, 2013 1 次提交
  2. 28 5月, 2013 4 次提交
    • T
      pci: mvebu: enable driver usage on Kirkwood · 005625fc
      Thomas Petazzoni 提交于
      We allow the pci-mvebu driver to be compiled on the Kirkwood platform,
      and add the 'marvell,kirkwood-pcie' as a compatible string supported
      by the driver.
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Tested-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NJason Cooper <jason@lakedaemon.net>
      005625fc
    • T
      pci: mvebu: fix the emulation of the status register · 6eb237c4
      Thomas Petazzoni 提交于
      The status register of the PCI configuration space of PCI-to-PCI
      bridges contain some read-only bits, and so write-1-to-clear bits. So,
      the Linux PCI core sometimes writes 0xffff to this status register,
      and in the current PCI-to-PCI bridge emulation code of the Marvell
      driver, we do take all those 1s being written. Even the read-only bits
      are being overwritten.
      
      For now, all the read-only bits should be emulated to have the zero
      value.
      
      The other bits, that are write-1-to-clear bits are used to report
      various kind of errors, and are never set by the emulated bridge, so
      there is no need to support this write-1-to-clear bits mechanism.
      
      As a conclusion, the easiest solution is to simply emulate this status
      register by returning zero when read, and ignore the writes to it.
      
      This has two visible effects:
      
       * The devsel is no longer 'unknown' in, i.e
      
         Flags: bus master, 66MHz, user-definable features, ?? devsel, latency 0
      
         becomes:
      
         Flags: bus master, 66MHz, user-definable features, fast devsel, latency 0
      
         in lspci -v.
      
         This was caused by a value of 11b being read for devsel, which is
         an invalid value. This 11b value being read was due to a previous
         write of 0xffff into the status register.
      
       * The capability list is no longer broken, because we indicate to the
         Linux PCI core that we don't have a Capabilities Pointer in the PCI
         configuration space of this bridge. The following message is
         therefore no longer visible in lspci -v:
      
         Capabilities: [fc] <chain broken>
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NJason Cooper <jason@lakedaemon.net>
      6eb237c4
    • T
      pci: mvebu: allow the enumeration of devices beyond physical bridges · 197fc226
      Thomas Petazzoni 提交于
      Until now, the Marvell PCIe driver was only allowing the enumeration
      of the devices in the secondary bus of the emulated PCI-to-PCI
      bridge. This works fine when a PCIe device is directly connected into
      a PCIe slot of the Marvell board.
      
      However, when the device connected in the PCIe slot is a physical PCIe
      bridge, beyond which a real PCIe device is connected, it no longer
      worked, as the driver was preventing the Linux PCI core from seeing
      such devices.
      
      This commit fixes that by ensuring that configuration transactions on
      subordinate busses are properly forwarded on the right PCIe interface.
      
      Thanks to this patch, a PCIe card beyond a PCIe bridge, itself beyond
      the emulated PCI-to-PCI bridge is properly detected, with the
      following layout:
      
      -[0000:00]-+-01.0-[01]----00.0
                 +-09.0-[02-07]----00.0-[03-07]--+-01.0-[04]--
                 |                               +-05.0-[05]--
                 |                               +-07.0-[06]--
                 |                               \-09.0-[07]----00.0
                 \-0a.0-[08]----00.0
      
      Where the PCIe interface that sits beyond the emulated PCI-to-PCI
      bridge at 09.0 allows to access the secondary bus 02, on which there
      is a PCIe bridge that allows to access the 3 to 7 busses, that are
      subordinates to this bridge. And on one of this bus (bus 7), there is
      one real PCIe device connected.
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NJason Cooper <jason@lakedaemon.net>
      197fc226
    • T
      pci: mvebu: no longer fake the slot location of downstream devices · f4ac9901
      Thomas Petazzoni 提交于
      By default, the Marvell hardware, for each PCIe interface, exhibits
      the following devices:
      
       * On slot 0, a "Marvell Memory controller", identical on all PCIe
         interfaces, and which isn't useful when the Marvell SoC is the PCIe
         root complex (i.e, the normal case when we run Linux on the Marvell
         SoC).
      
       * On slot 1, the real PCIe card connected into the PCIe slot of the
         board.
      
      So, what the Marvell PCIe driver was doing in its PCI-to-PCI bridge
      emulation is that when the Linux PCI core was trying to access the
      device in slot 0, we were in fact forwarding the configuration
      transaction to the device in slot 1. For all other slots, we were
      telling the Linux PCI core that there was no device connected.
      
      However, new versions of bootloaders from Marvell change the default
      PCIe configuration, and make the real device appear in slot 0, and the
      "Marvell Memory controller" in slot 1.
      
      Therefore, this commit modifies the Marvell PCIe driver to adjust the
      PCIe hardware configuration to make sure that this behavior (real
      device in slot 0, "Marvell Memory controller" in slot 1) is the one
      we'll see regardless of what the bootloader has done. It allows to
      remove the little hack that was forwarding configuration transactions
      on slot 0 to slot 1, which is nice.
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NJason Cooper <jason@lakedaemon.net>
      f4ac9901
  3. 27 5月, 2013 1 次提交
  4. 21 5月, 2013 1 次提交
    • T
      pci: PCIe driver for Marvell Armada 370/XP systems · 45361a4f
      Thomas Petazzoni 提交于
      This driver implements the support for the PCIe interfaces on the
      Marvell Armada 370/XP ARM SoCs. In the future, it might be extended to
      cover earlier families of Marvell SoCs, such as Dove, Orion and
      Kirkwood.
      
      The driver implements the hw_pci operations needed by the core ARM PCI
      code to setup PCI devices and get their corresponding IRQs, and the
      pci_ops operations that are used by the PCI core to read/write the
      configuration space of PCI devices.
      
      Since the PCIe interfaces of Marvell SoCs are completely separate and
      not linked together in a bus, this driver sets up an emulated PCI host
      bridge, with one PCI-to-PCI bridge as child for each hardware PCIe
      interface.
      
      In addition, this driver enumerates the different PCIe slots, and for
      those having a device plugged in, it sets up the necessary address
      decoding windows, using the mvebu-mbus driver.
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NJason Cooper <jason@lakedaemon.net>
      45361a4f