1. 11 6月, 2014 1 次提交
  2. 30 4月, 2014 2 次提交
  3. 24 4月, 2014 2 次提交
  4. 19 2月, 2014 1 次提交
  5. 15 2月, 2014 1 次提交
  6. 13 2月, 2014 2 次提交
  7. 03 1月, 2014 2 次提交
    • J
      PCI: mvebu: Use max_t() instead of max(resource_size_t,) · 06489002
      Jingoo Han 提交于
      Use max_t() instead of max(resource_size_t,) in order to fix
      the following checkpatch warning.
      
        WARNING: max() should probably be max_t(resource_size_t, SZ_64K, size)
        WARNING: max() should probably be max_t(resource_size_t, SZ_1M, size)
      Signed-off-by: NJingoo Han <jg1.han@samsung.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NJason Cooper <jason@lakedaemon.net>
      06489002
    • T
      PCI: mvebu: Call pci_ioremap_io() at startup instead of dynamically · 31e45ec3
      Thomas Petazzoni 提交于
      The mvebu PCI host controller driver uses an emulated PCI-to-PCI bridge to
      leverage the core PCI kernel enumeration logic to dynamically create and
      remove the MBus windows needed to access the memory and I/O regions of each
      PCI interface.
      
      In the context of this PCI-to-PCI bridge emulation, the driver emulates
      all reads and writes to the PCI bridge registers.  Upon a write to the
      registers configuring the I/O base and limit, the driver was creating the
      MBus window and calling pci_ioremap_io() to setup the mapping.
      
      However, it turns out that accesses to these registers are made in an IRQ
      disabled context, while pci_ioremap_io() is a potentially sleeping
      function.  Not only this is wrong, but it is causing fairly loud warnings
      at boot time when the appropriate kernel hacking options are enabled.
      
      This patch solves this by moving the pci_ioremap_io() call to the startup
      of the driver.  At this point, we don't know how many PCI interfaces will
      be enabled, so we are simply remapping the entire PCI I/O space to virtual
      addresses.  This is reasonable since this I/O space is limited to 1 MB in
      size, and also because the MBus windows continue to be created in a dynamic
      fashion only when devices need them.
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      31e45ec3
  8. 20 12月, 2013 1 次提交
  9. 10 12月, 2013 1 次提交
  10. 27 11月, 2013 4 次提交
  11. 24 10月, 2013 4 次提交
  12. 09 10月, 2013 3 次提交
  13. 30 9月, 2013 6 次提交
  14. 07 8月, 2013 1 次提交
  15. 06 8月, 2013 2 次提交
  16. 02 8月, 2013 1 次提交
    • T
      PCI: mvebu: Disable prefetchable memory support in PCI-to-PCI bridge · 36dd1f3e
      Thomas Petazzoni 提交于
      The Marvell PCIe driver uses an emulated PCI-to-PCI bridge to be able
      to dynamically set up MBus address decoding windows for PCI I/O and
      memory regions depending on the PCI devices enumerated by Linux.
      
      However, this emulated PCI-to-PCI bridge logic makes the Linux PCI
      core believe that prefetchable memory regions are supported (because
      the registers are read/write), while in fact no adress decoding window
      is ever created for such regions. Since the Marvell MBus address
      decoding windows do not distinguish memory regions and prefetchable
      memory regions, this patch takes a simple approach: change the
      PCI-to-PCI bridge emulation to let the Linux PCI core know that we
      don't support prefetchable memory regions.
      
      To achieve this, we simply make the prefetchable memory base a
      read-only register that always returns 0. Reading/writing all the
      other prefetchable memory related registers has no effect.
      
      This problem was originally reported by Finn Hoffmann
      <finn@uni-bremen.de>, who couldn't get a RTL8111/8168B PCI NIC working
      on the NSA310 Kirkwood platform after updating to 3.11-rc. The problem
      was that the PCI-to-PCI bridge emulation was making the Linux PCI core
      believe that we support prefetchable memory, so the Linux PCI core was
      only filling the prefetchable memory base and limit registers, which
      does not lead to a MBus window being created. The below patch has been
      confirmed by Finn Hoffmann to fix his problem on Kirkwood, and has
      otherwise been successfully tested on the Armada XP GP platform with a
      e1000e PCIe NIC and a Marvell SATA PCIe card.
      Reported-by: NFinn Hoffmann <finn@uni-bremen.de>
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      36dd1f3e
  17. 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
  18. 27 5月, 2013 1 次提交
  19. 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