1. 08 Mar, 2016 4 commits
    • Thierry Reding's avatar
      PCI: tegra: Track bus -> CPU mapping · 56e75e2a
      Thierry Reding authored
      Track the offsets of the bus -> CPU mapping for I/O and memory.  This is
      cosmetic for current Tegra chips because the offset is always 0.  But to
      properly support legacy use-cases, like VGA, this would be needed so that
      PCI bus addresses can be relocated.
      
      While at it, also request the I/O resource both in physical memory and I/O
      space to make /proc/iomem consistent, as well as add the I/O region to the
      list of host bridge resources.
      Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      56e75e2a
    • Thierry Reding's avatar
      PCI: tegra: Remove unused struct tegra_pcie.num_ports field · 8493a952
      Thierry Reding authored
      The num_ports field of the tegra_pcie structure is never used so remove it.
      Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      8493a952
    • Thierry Reding's avatar
      PCI: tegra: Implement ->{add,remove}_bus() callbacks · b4d18d71
      Thierry Reding authored
      The configuration space mapping on Tegra is somewhat special, and in order
      to avoid wasting virtual address space the configuration space for each bus
      needs to be stitched together from several blocks which form a single
      continuous virtual address range for accessors.
      
      Currently the configuration space is mapped upon the first access to one of
      its registers.  However, the mapping operation may sleep under certain
      circumstances, so doing it from the configuration space accessors (they are
      protected by a spin lock) will trigger a warning.
      
      To avoid the warning, use the ->add_bus() callback to perform the mapping
      at enumeration time when the operation is allowed to sleep.  Also add an
      implementation of ->remove_bus() that undoes the mapping established by the
      ->add_bus() callback.  While it isn't currently possible to unload the
      module, there is work underway to remedy this, and this code will come in
      handy when that happens.
      Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      b4d18d71
    • Thierry Reding's avatar
      PCI: Add pci_ops.{add,remove}_bus() callbacks · 057bd2e0
      Thierry Reding authored
      Add pci_ops.{add,remove}_bus() callbacks, which will be called on every
      newly created bus and when a bus is being removed, respectively.  This can
      be used by drivers to implement driver-specific initialization and teardown
      of the bus, in addition to the architecture-specifics implemented by the
      pcibios_add_bus() and the pcibios_remove_bus() functions.
      Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      057bd2e0
  2. 24 Jan, 2016 36 commits