1. 11 2月, 2009 1 次提交
  2. 13 1月, 2009 1 次提交
  3. 08 1月, 2009 1 次提交
    • P
      powerpc: Fix pciconfig_iobase system call on PCI-Express powermac · 16124f10
      Paul Mackerras 提交于
      X has been failing to start on my quad G5 powermac since commit
      1fd0f525 ("powerpc: Fix domain numbers
      in /proc on 64-bit") went in.  The reason is that the change allows X
      to see the PCI-PCI bridge above the video card (previously it was
      obscured by the fact that there were two "00" directories in
      /proc/bus/pci), and the pciconfig_iobase system call on the bridge is
      failing because of a hack that we have to return information about the
      AGP bus when X asks about bus 0.  This machine doesn't have an AGP bus
      (it has PCI Express) and so the pciconfig_iobase call is returning -1,
      which ultimately causes X to fail to start.
      
      This fixes it by checking that we have an AGP bridge before
      redirecting the pciconfig_iobase call to return information about the
      AGP bus.  With this, X starts successfully both on a quad G5 with
      PCI Express and on an older dual G5 with AGP.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      16124f10
  4. 06 11月, 2008 1 次提交
    • 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
  5. 05 11月, 2008 4 次提交
  6. 31 10月, 2008 1 次提交
  7. 25 9月, 2008 2 次提交
    • 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
    • B
      powerpc: Drop archdata numa_node · 8fae0353
      Becky Bruce 提交于
      Use the struct device's numa_node instead; use accessor functions
      to get/set numa_node.
      Signed-off-by: NBecky Bruce <becky.bruce@freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      8fae0353
  8. 09 6月, 2008 1 次提交
    • S
      [POWERPC] Use dev_set_name in pci_64.c · 420b5eea
      Stephen Rothwell 提交于
      During the next merge window, pci_name()'s return value will become
      const, so use the new dev_set_name() instead to avoid the warning (from
      linux-next):
      
      arch/powerpc/kernel/pci_64.c: In function 'of_create_pci_dev':
      arch/powerpc/kernel/pci_64.c:193: warning: passing argument 1 of 'sprintf' discards qualifiers from pointer target type
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      420b5eea
  9. 25 1月, 2008 1 次提交
  10. 17 1月, 2008 1 次提交
  11. 20 12月, 2007 8 次提交
  12. 11 12月, 2007 5 次提交
  13. 03 10月, 2007 1 次提交
  14. 10 8月, 2007 1 次提交
  15. 12 7月, 2007 2 次提交
    • A
      PCI: read revision ID by default · b8a3a521
      Auke Kok 提交于
      Currently there are 97 occurrences where drivers need the pci
      revision ID. We can do this once for all devices. Even the pci
      subsystem needs the revision several times for quirks. The extra
      u8 member pads out nicely in the pci_dev struct.
      Signed-off-by: NAuke Kok <auke-jan.h.kok@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      b8a3a521
    • M
      PCI: Make pcibios_add_platform_entries() return errors · a2cd52ca
      Michael Ellerman 提交于
      Currently pcibios_add_platform_entries() returns void, but could fail,
      so instead have it return an int and propagate errors up to
      pci_create_sysfs_dev_files().
      
      Fixes:
      arch/powerpc/kernel/pci_64.c: In function 'pcibios_add_platform_entries':
      arch/powerpc/kernel/pci_64.c:878: warning: ignoring return value of
      	'device_create_file', declared with attribute warn_unused_result
      arch/powerpc/kernel/pci_32.c: In function 'pcibios_add_platform_entries':
        arch/powerpc/kernel/pci_32.c:1043: warning: ignoring return value of
      	'device_create_file', declared with attribute warn_unused_result
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      a2cd52ca
  16. 03 7月, 2007 1 次提交
  17. 29 6月, 2007 3 次提交
  18. 28 6月, 2007 1 次提交
  19. 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
  20. 17 5月, 2007 1 次提交
  21. 10 5月, 2007 1 次提交
    • P
      [POWERPC] Fix incorrect calculation of I/O window addresses · 31e92e0a
      Paul Mackerras 提交于
      My patch "Cope with PCI host bridge I/O window not starting at 0"
      introduced a bug in the calculation of the virtual addresses for the
      I/O windows of PCI host bridges other than the first, because it
      didn't account for the fact that hose->io_resource gets offset so that
      it reflects the range of global I/O port numbers assigned to the
      bridge.  This fixes it and simplifies get_bus_io_range() in the
      process.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      31e92e0a
  22. 08 5月, 2007 1 次提交
    • P
      [POWERPC] Cope with PCI host bridge I/O window not starting at 0 · 11fbb00c
      Paul Mackerras 提交于
      Currently our code to set up the data structures for a PCI host bridge
      and create the mapping for its I/O window assumes that the window
      starts at I/O port 0 on the PCI side.  If this is not true, we can end
      up with I/O port numbers in the resources for PCI devices which will
      cause an oops if a driver tries to access them via inb/outb etc.,
      because there is no mapping for the corresponding addresses.
      
      Normally the I/O window starts at 0, but there are some situations on
      partitioned machines with a hypervisor where the window may not start
      at 0.
      
      This fixes the problem by allocating space for the range from 0 to the
      end of the I/O window.  That is, hose->io_base_virt contains the
      virtual address for I/O port 0 on the PCI bus, and thus the assumption
      that hose->io_base_virt - pci_io_base is the offset between the
      "global" I/O port numbers (those in the PCI device resources) and the
      I/O port numbers on the PCI bus is maintained.
      
      For PCI host bridges that are present at boot, we only map the portion
      of that range that correspond to the bridge's I/O window.  For bridges
      added after boot we ioremap the range from 0 to the end of the I/O
      window, for now; in fact hot-added bridges should be using
      reserve_phb_iospace() and __ioremap_explicit (so they get sensible
      global port numbers), but we don't have the infrastructure yet to do
      that (basically a free_phb_iospace() routine plus appropriate
      locking).
      
      Interestingly, this makes the two arms of the if statement in
      get_bus_io_range do almost exactly the same thing; that function could
      now be simplified in a further patch.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      11fbb00c