1. 01 10月, 2014 1 次提交
    • L
      of/pci: Add pci_get_new_domain_nr() and of_get_pci_domain_nr() · 41e5c0f8
      Liviu Dudau 提交于
      Add pci_get_new_domain_nr() to allocate a new domain number and
      of_get_pci_domain_nr() to retrieve the PCI domain number of a given device
      from DT.  Host bridge drivers or architecture-specific code can choose to
      implement their PCI domain number policy using these two functions.
      
      Using of_get_pci_domain_nr() guarantees a stable PCI domain number on every
      boot provided that all host bridge controllers are assigned a number in the
      device tree using "linux,pci-domain" property.  Mixing use of
      pci_get_new_domain_nr() and of_get_pci_domain_nr() is not recommended as it
      can lead to potentially conflicting domain numbers being assigned to root
      buses behind different host bridges.
      Signed-off-by: NLiviu Dudau <Liviu.Dudau@arm.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      CC: Arnd Bergmann <arnd@arndb.de>
      CC: Grant Likely <grant.likely@linaro.org>
      CC: Rob Herring <robh+dt@kernel.org>
      CC: Catalin Marinas <catalin.marinas@arm.com>
      41e5c0f8
  2. 04 6月, 2014 1 次提交
    • A
      of/irq: provide more wrappers for !CONFIG_OF · 64c5c759
      Arnd Bergmann 提交于
      The pci-rcar driver is enabled for compile tests, and this has
      now shown that the driver cannot build without CONFIG_OF,
      following the inclusion of f8f2fe73 "PCI: rcar: Use new OF
      interrupt mapping when possible":
      
      drivers/built-in.o: In function `rcar_pci_map_irq':
      :(.text+0x1cc7c): undefined reference to `of_irq_parse_and_map_pci'
      pci/host/pcie-rcar.c: In function 'pci_dma_range_parser_init':
      pci/host/pcie-rcar.c:875:2: error: implicit declaration of function 'of_n_addr_cells' [-Werror=implicit-function-declaration]
      
      As pointed out by Ben Dooks and Geert Uytterhoeven, this is actually
      supposed to build fine, which we can achieve if we make the
      declaration of of_irq_parse_and_map_pci conditional on CONFIG_OF
      and provide an empty inline function otherwise, as we do for
      a lot of other of interfaces.
      
      This lets us build the rcar_pci driver again without CONFIG_OF
      for build testing. All platforms using this driver select OF,
      so this doesn't change anything for the users.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: devicetree@vger.kernel.org
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Lucas Stach <l.stach@pengutronix.de>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Magnus Damm <damm@opensource.se>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Ben Dooks <ben.dooks@codethink.co.uk>
      Cc: linux-pci@vger.kernel.org
      Cc: linux-sh@vger.kernel.org
      [robh: drop wrappers for of_n_addr_cells and of_n_size_cells which are
      low-level functions that should not be used for !OF]
      Signed-off-by: NRob Herring <robh@kernel.org>
      64c5c759
  3. 24 10月, 2013 3 次提交
  4. 12 8月, 2013 1 次提交
  5. 20 5月, 2013 2 次提交
  6. 21 5月, 2012 1 次提交
  7. 08 6月, 2011 1 次提交
    • B
      pci/of: Match PCI devices to OF nodes dynamically · 98d9f30c
      Benjamin Herrenschmidt 提交于
      powerpc has two different ways of matching PCI devices to their
      corresponding OF node (if any) for historical reasons. The ppc64 one
      does a scan looking for matching bus/dev/fn, while the ppc32 one does a
      scan looking only for matching dev/fn on each level in order to be
      agnostic to busses being renumbered (which Linux does on some
      platforms).
      
      This removes both and instead moves the matching code to the PCI core
      itself. It's the most logical place to do it: when a pci_dev is created,
      we know the parent and thus can do a single level scan for the matching
      device_node (if any).
      
      The benefit is that all archs now get the matching for free. There's one
      hook the arch might want to provide to match a PHB bus to its device
      node. A default weak implementation is provided that looks for the
      parent device device node, but it's not entirely reliable on powerpc for
      various reasons so powerpc provides its own.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NMichal Simek <monstr@monstr.eu>
      Acked-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      98d9f30c
  8. 05 2月, 2011 1 次提交