1. 24 2月, 2012 1 次提交
  2. 07 1月, 2012 1 次提交
  3. 07 12月, 2011 1 次提交
  4. 12 7月, 2011 1 次提交
  5. 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
  6. 05 2月, 2011 1 次提交
    • G
      powerpc/pci: Make both ppc32 and ppc64 use sysdata for pci_controller · b5d937de
      Grant Likely 提交于
      Currently, ppc32 uses sysdata for the pci_controller pointer, and
      ppc64 uses it to hold the device_node pointer.  This patch moves the
      of_node pointer into (struct pci_bus*)->dev.of_node and
      (struct pci_dev*)->dev.of_node so that sysdata can be converted to always
      use the pci_controller pointer instead.  It also fixes up the
      allocating of pci devices so that the of_node pointer gets assigned
      consistently and increments the ref count.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      b5d937de
  7. 13 3月, 2010 2 次提交
  8. 10 9月, 2009 1 次提交
  9. 02 9月, 2009 1 次提交
  10. 28 8月, 2009 2 次提交
  11. 18 6月, 2009 1 次提交
  12. 20 3月, 2009 1 次提交
    • M
      PCI/MSI: Use #ifdefs instead of weak functions · 11df1f05
      Michael Ellerman 提交于
      Weak functions aren't all they're cracked up to be. They lead to
      incorrect binaries with some toolchains, they require us to have empty
      functions we otherwise wouldn't, and the unused code is not elided
      (as of gcc 4.3.2 anyway).
      
      So replace the weak MSI arch hooks with the #define foo foo idiom. We no
      longer need empty versions of arch_setup/teardown_msi_irq().
      
      This is less source (by 1 line!), and results in smaller binaries too:
      
         text	   data	    bss	    dec	    hex	filename
      9354300	1693916	 678424	11726640 b2ef30	build/powerpc/vmlinux-before
      9354052	1693852	 678424	11726328 b2edf8	build/powerpc/vmlinux-after
      
      Also smaller on x86_64 and arm (iop13xx).
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      11df1f05
  13. 16 12月, 2008 1 次提交
  14. 06 11月, 2008 2 次提交
    • B
      powerpc/pci: Fix various pseries PCI hotplug issues · fd6852c8
      Benjamin Herrenschmidt 提交于
      The pseries PCI hotplug code has a number of issues, ranging from
      incorrect resource setup to crashes, depending on what is added,
      when, whether it contains a bridge, etc etc....
      
      This fixes a whole bunch of these, while actually simplifying the code
      a bit, using more generic code in the process and factoring out common
      code between adding of a PHB, a slot or a device.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      fd6852c8
    • B
      powerpc/pci: Split pcibios_fixup_bus() into bus setup and device setup · 8b8da358
      Benjamin Herrenschmidt 提交于
      Currently, our PCI code uses the pcibios_fixup_bus() callback, which
      is called by the generic code when probing PCI buses, for two
      different things.
      
      One is to set up things related to the bus itself, such as reading
      bridge resources for P2P bridges, fixing them up, or setting up the
      iommu's associated with bridges on some platforms.
      
      The other is some setup for each individual device under that bridge,
      mostly setting up DMA mappings and interrupts.
      
      The problem is that this approach doesn't work well with PCI hotplug
      when an existing bus is re-probed for new children.  We fix this
      problem by splitting pcibios_fixup_bus into two routines:
      
      	pcibios_setup_bus_self() is now called to setup the bus itself
      
      	pcibios_setup_bus_devices() is now called to setup devices
      
      pcibios_fixup_bus() is then modified to call these two after reading the
      bridge bases, and the OF based PCI probe is modified to avoid calling
      into the first one when rescanning an existing bridge.
      
      [paulus@samba.org - fixed eeh.h for 32-bit compile now that pci-common.c
      is including it unconditionally.]
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      8b8da358
  15. 05 11月, 2008 1 次提交
  16. 31 10月, 2008 1 次提交
  17. 21 10月, 2008 1 次提交
  18. 25 9月, 2008 1 次提交
    • B
      powerpc: Merge 32 and 64-bit dma code · 4fc665b8
      Becky Bruce 提交于
      We essentially adopt the 64-bit dma code, with some changes to support
      32-bit systems, including HIGHMEM.  dma functions on 32-bit are now
      invoked via accessor functions which call the correct op for a device based
      on archdata dma_ops.  If there is no archdata dma_ops, this defaults
      to dma_direct_ops.
      
      In addition, the dma_map/unmap_page functions are added to dma_ops
      because we can't just fall back on map/unmap_single when HIGHMEM is
      enabled. In the case of dma_direct_*, we stop using map/unmap_single
      and just use the page version - this saves a lot of ugly
      ifdeffing.  We leave map/unmap_single in the dma_ops definition,
      though, because they are needed by the iommu code, which does not
      implement map/unmap_page.  Ideally, going forward, we will completely
      eliminate map/unmap_single and just have map/unmap_page, if it's
      workable for 64-bit.
      Signed-off-by: NBecky Bruce <becky.bruce@freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      4fc665b8
  19. 04 8月, 2008 1 次提交
  20. 20 12月, 2007 4 次提交
  21. 12 7月, 2007 2 次提交
  22. 29 6月, 2007 1 次提交
  23. 14 6月, 2007 1 次提交
    • B
      [POWERPC] Rewrite IO allocation & mapping on powerpc64 · 3d5134ee
      Benjamin Herrenschmidt 提交于
      This rewrites pretty much from scratch the handling of MMIO and PIO
      space allocations on powerpc64.  The main goals are:
      
       - Get rid of imalloc and use more common code where possible
       - Simplify the current mess so that PIO space is allocated and
         mapped in a single place for PCI bridges
       - Handle allocation constraints of PIO for all bridges including
         hot plugged ones within the 2GB space reserved for IO ports,
         so that devices on hotplugged busses will now work with drivers
         that assume IO ports fit in an int.
       - Cleanup and separate tracking of the ISA space in the reserved
         low 64K of IO space. No ISA -> Nothing mapped there.
      
      I booted a cell blade with IDE on PIO and MMIO and a dual G5 so
      far, that's it :-)
      
      With this patch, all allocations are done using the code in
      mm/vmalloc.c, though we use the low level __get_vm_area with
      explicit start/stop constraints in order to manage separate
      areas for vmalloc/vmap, ioremap, and PCI IOs.
      
      This greatly simplifies a lot of things, as you can see in the
      diffstat of that patch :-)
      
      A new pair of functions pcibios_map/unmap_io_space() now replace
      all of the previous code that used to manipulate PCI IOs space.
      The allocation is done at mapping time, which is now called from
      scan_phb's, just before the devices are probed (instead of after,
      which is by itself a bug fix). The only other caller is the PCI
      hotplug code for hot adding PCI-PCI bridges (slots).
      
      imalloc is gone, as is the "sub-allocation" thing, but I do beleive
      that hotplug should still work in the sense that the space allocation
      is always done by the PHB, but if you unmap a child bus of this PHB
      (which seems to be possible), then the code should properly tear
      down all the HPTE mappings for that area of the PHB allocated IO space.
      
      I now always reserve the first 64K of IO space for the bridge with
      the ISA bus on it. I have moved the code for tracking ISA in a separate
      file which should also make it smarter if we ever are capable of
      hot unplugging or re-plugging an ISA bridge.
      
      This should have a side effect on platforms like powermac where VGA IOs
      will no longer work. This is done on purpose though as they would have
      worked semi-randomly before. The idea at this point is to isolate drivers
      that might need to access those and fix them by providing a proper
      function to obtain an offset to the legacy IOs of a given bus.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      3d5134ee
  24. 09 3月, 2007 2 次提交
  25. 08 12月, 2006 1 次提交
    • R
      [POWERPC] Define pci_unmap_addr() et al. when CONFIG_NOT_COHERENT_CACHE=y · 1d4454e7
      Roland Dreier 提交于
      The current PowerPC code makes pci_unmap_addr(), pci_unmap_addr_set(),
      and friends trivial for all 32-bit kernels.  This is reasonable, since
      for those kernels it is true that pci_unmap_single() does not need the
      DMA address from the original DMA mapping -- in fact, it is a NOP.
      
      However, I recently tried the tg3 driver on a PowerPC 440SPe machine,
      which runs a 32-bit kernel and has non-cache-coherent PCI DMA.  I
      found that the tg3 driver crashed in pci_dma_sync_single_for_cpu(),
      since for non-coherent systems, that function must invalidate the
      cache for the DMA address range requested, and therefore it does use
      the address passed in.  tg3 uses a DMA address it stashes away with
      pci_unmap_addr_set() and retrieves with pci_unmap_addr().  Of course,
      since pci_unmap_addr() is defined to (0) right now, this doesn't work.
      
      It seems to me that the tg3 driver is using pci_unmap_addr() in a
      legitimate way -- I wouldn't want to have to teach all drivers that
      they should use pci_unmap_addr() if they only need the address for
      unmapping functions, but if they want the pci_dma_sync functions, then
      they have to store the DMA address without the helper macros.
      The right fix therefore seems to be in the definition of the macros in
      <asm/pci.h> -- we should use the trivial versions only for 32-bit
      kernels for coherent systems, and the real versions for both 64-bit
      kernels and non-coherent systems.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      1d4454e7
  26. 04 12月, 2006 1 次提交
    • B
      [POWERPC] Refactor 64 bits DMA operations · 12d04eef
      Benjamin Herrenschmidt 提交于
      This patch completely refactors DMA operations for 64 bits powerpc. 32 bits
      is untouched for now.
      
      We use the new dev_archdata structure to add the dma operations pointer
      and associated data to struct device. While at it, we also add the OF node
      pointer and numa node. In the future, we might want to look into merging
      that with pci_dn as well.
      
      The old vio, pci-iommu and pci-direct DMA ops are gone. They are now replaced
      by a set of generic iommu and direct DMA ops (non PCI specific) that can be
      used by bus types. The toplevel implementation is now inline.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      12d04eef
  27. 02 12月, 2006 1 次提交
  28. 13 11月, 2006 1 次提交
  29. 28 6月, 2006 1 次提交
  30. 09 1月, 2006 1 次提交
  31. 19 11月, 2005 1 次提交
    • P
      powerpc: Merge pci.h · f8ef2705
      Paul Mackerras 提交于
      This involves some minor changes: a few unused functions that the
      ppc32 pci.c provides are no longer declared here or exported;
      pcibios_assign_all_busses now just refers to the pci_assign_all_buses
      variable on both 32-bit and 64-bit; pcibios_scan_all_fns is now
      just 0 instead of a function that always returns 0 on 64-bit.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      f8ef2705
  32. 07 11月, 2005 1 次提交