1. 23 2月, 2010 1 次提交
  2. 17 12月, 2009 1 次提交
    • B
      PCI/cardbus: Add a fixup hook and fix powerpc · 2d1c8618
      Benjamin Herrenschmidt 提交于
      The cardbus code creates PCI devices without ever going through the
      necessary fixup bits and pieces that normal PCI devices go through.
      
      There's in fact a commented out call to pcibios_fixup_bus() in there,
      it's commented because ... it doesn't work.
      
      I could make pcibios_fixup_bus() do the right thing on powerpc easily
      but I felt it cleaner instead to provide a specific hook pci_fixup_cardbus
      for which a weak empty implementation is provided by the PCI core.
      
      This fixes cardbus on powerbooks and probably all other PowerPC
      platforms which was broken completely for ever on some platforms and
      since 2.6.31 on others such as PowerBooks when we made the DMA ops
      mandatory (since those are setup by the fixups).
      Acked-by: NDominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      2d1c8618
  3. 14 10月, 2009 1 次提交
    • H
      powerpc/pci: Fix MODPOST warning · 0f6023d5
      Heiko Schocher 提交于
      making a powerpc target with PCI support, shows the
      following warning:
      
        MODPOST vmlinux.o
      WARNING: vmlinux.o(.text+0x10430): Section mismatch in reference from the
      function pcibios_allocate_bus_resources() to the function .init.text:reparent_resources()
      
      The function pcibios_allocate_bus_resources() references
      the function __init reparent_resources().
      
      This is often because pcibios_allocate_bus_resources lacks a __init
      annotation or the annotation of reparent_resources is wrong.
      
      This patch fix this warning by removing the __init
      annotation before reparent_resources.
      Signed-off-by: NHeiko Schocher <hs@denx.de>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      0f6023d5
  4. 24 9月, 2009 1 次提交
  5. 02 9月, 2009 1 次提交
  6. 28 8月, 2009 4 次提交
  7. 02 6月, 2009 1 次提交
    • S
      powerpc/pci: Fix annotation of pcibios_claim_one_bus · baf75b0a
      Stephen Rothwell 提交于
      It was __devinit, but it is also within a CONFIG_HOTPLUG guarded section
      of code, so the __devinit does nothing but cause the following warning:
      
      WARNING: vmlinux.o(.text+0x107a8): Section mismatch in reference from the function pcibios_finish_adding_to_bus() to the function .devinit.text:pcibios_claim_one_bus()
      The function pcibios_finish_adding_to_bus() references
      the function __devinit pcibios_claim_one_bus().
      This is often because pcibios_finish_adding_to_bus lacks a __devinit
      annotation or the annotation of pcibios_claim_one_bus is wrong.
      
      It is also only (externally) used in arch/powerpc/kernel/of_platform.c
      which cannot be built as a module so don't export it.
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      baf75b0a
  8. 15 5月, 2009 1 次提交
    • B
      powerpc: Fix PCI ROM access · ad892a63
      Benjamin Herrenschmidt 提交于
      A couple of issues crept in since about 2.6.27 related to accessing PCI
      device ROMs on various powerpc machines.
      
      First, historically, we don't allocate the ROM resource in the resource
      tree. I'm not entirely certain of why, I susepct they often contained
      garbage on x86 but it's hard to tell. This causes the current generic
      code to always call pci_assign_resource() when trying to access the said
      ROM from sysfs, which will try to re-assign some new address regardless
      of what the ROM BAR was already set to at boot time. This can be a
      problem on hypervisor platforms like pSeries where we aren't supposed
      to move PCI devices around (and in fact probably can't).
      
      Second, our code that generates the PCI tree from the OF device-tree
      (instead of doing config space probing) which we mostly use on pseries
      at the moment, didn't set the (new) flag IORESOURCE_SIZEALIGN on any
      resource. That means that any attempt at re-assigning such a resource
      with pci_assign_resource() would fail due to resource_alignment()
      returning 0.
      
      This fixes this by doing these two things:
      
       - The code that calculates resource flags based on the OF device-node
      is improved to set IORESOURCE_SIZEALIGN on any valid BAR, and while at
      it also set IORESOURCE_READONLY for ROMs since we were lacking that too
      
       - We now allocate ROM resources as part of the resource tree. However
      to limit the chances of nasty conflicts due to busted firmwares, we
      only do it on the second pass of our two-passes allocation scheme,
      so that all valid and enabled BARs get precedence.
      
      This brings pSeries back the ability to access PCI ROMs via sysfs (and
      thus initialize various video cards from X etc...).
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      ad892a63
  9. 24 3月, 2009 1 次提交
  10. 11 3月, 2009 1 次提交
  11. 11 2月, 2009 1 次提交
  12. 10 2月, 2009 1 次提交
    • B
      powerpc/pci: mmap anonymous memory when legacy_mem doesn't exist · 5b11abfd
      Benjamin Herrenschmidt 提交于
      The new legacy_mem file in sysfs is causing problems with X on machines
      that don't support legacy memory access. The way I initially implemented
      it, we would fail with -ENXIO when trying to mmap it, thus exposing to
      X that we do support the API but there is no legacy memory.
      
      Unfortunately, X poor error handling is causing it to fail to start when
      it gets this error.
      
      This implements a workaround hack that instead maps anonymous memory
      instead (using shmem if VM_SHARED is set, just like /dev/zero does).
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      5b11abfd
  13. 02 2月, 2009 1 次提交
  14. 08 1月, 2009 1 次提交
    • B
      powerpc/pci: Reserve legacy regions on PCI · c1f34302
      Benjamin Herrenschmidt 提交于
      There's a problem on some embedded platforms when we re-assign
      everything on PCI, such as 44x. The generic code tries to avoid
      assigning devices to addresses overlapping the low legacy
      addresses such as VGA hard decoded areas using constants that
      are unfortunately no good for us, as they don't take into account
      the address translation we do to access PCI busses.
      
      Thus we end up allocating things like IO BARs to 0, which is
      technically legal, but will shadow hard decoded ports for use
      by things like VGA cards.
      
      This works around it by attempting to reserve legacy regions
      before we try to assign addresses.
      
      NOTE: This may have nasty side effects in cases I haven't tested
      yet:
      
       - We try to use FW mappings (ie. powermac) and the FW has allocated
      a conflicting address over those legacy regions. This will typically
      happen. I would expect the new code to just fail with an informative
      message without harm but I haven't had a chance to test that scenario
      yet.
      
       - A device with fixed BARs overlapping those legacy addresses such
      as an IDE controller in legacy mode is in the system. I don't know
      for sure yet what will happen there, I have to test :-)
      
      Ideally, we should change PCIBIOS_MIN_IO/MIN_MEM accross the board
      to take a bus pointer so they can provide appropriate per-bus translated
      values to the generic code but that's a more invasive patch. I will
      do that in the future, but in the meantime, this fixes the problem
      locally
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      c1f34302
  15. 21 12月, 2008 1 次提交
    • B
      powerpc/mm: Rework usage of _PAGE_COHERENT/NO_CACHE/GUARDED · 64b3d0e8
      Benjamin Herrenschmidt 提交于
      Currently, we never set _PAGE_COHERENT in the PTEs, we just OR it in
      in the hash code based on some CPU feature bit.  We also manipulate
      _PAGE_NO_CACHE and _PAGE_GUARDED by hand in all sorts of places.
      
      This changes the logic so that instead, the PTE now contains
      _PAGE_COHERENT for all normal RAM pages thay have I = 0 on platforms
      that need it.  The hash code clears it if the feature bit is not set.
      
      It also adds some clean accessors to setup various valid combinations
      of access flags and change various bits of code to use them instead.
      
      This should help having the PTE actually containing the bit
      combinations that we really want.
      
      I also removed _PAGE_GUARDED from _PAGE_BASE on 44x and instead
      set it explicitely from the TLB miss.  I will ultimately remove it
      completely as it appears that it might not be needed after all
      but in the meantime, having it in the TLB miss makes things a
      lot easier.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NKumar Gala <galak@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      64b3d0e8
  16. 16 12月, 2008 1 次提交
  17. 06 11月, 2008 4 次提交
  18. 05 11月, 2008 4 次提交
  19. 31 10月, 2008 1 次提交
  20. 22 10月, 2008 1 次提交
  21. 21 10月, 2008 1 次提交
  22. 15 10月, 2008 1 次提交
    • B
      powerpc/pci: Improve detection of unassigned bridge resources · b5561511
      Benjamin Herrenschmidt 提交于
      When the powerpc PCI layer is not configured to re-assign everything,
      it currently fails to detect that a PCI to PCI bridge has been left
      unassigned by the firmware and tries to allocate resource for the
      default window values in the bridge (0...X) (with the notable exception
      of a hack we have in there that detects some Apple firmware unassigned
      bridge resources).
      
      This results in resource allocation failures, which are generally
      fixed up later on but it causes scary warnings in the logs and we
      have seen the fixup code fall over in some circumstances (a different
      issue to fix as well).
      
      This code improves that by providing a more complete & useful function
      to intuit that a bridge was left unassigned by the firmware, and thus
      force a full re-allocation by the PCI code without trying to allocate
      the existing useless resources first.
      
      The algorithm we use basically considers unassigned a window that
      starts at 0 (PCI address) if the corresponding address space enable
      bit is not set. In addition, for memory space, it considers such a
      resource unassigned also if the host bridge isn't configured to
      forward cycles to address 0 (ie, the resource basically overlaps
      main memory).
      
      This fixes a range of problems with things like Bare-Metal support
      on pSeries machines, or attempt to use partial firmware PCI setup.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      b5561511
  23. 07 10月, 2008 1 次提交
  24. 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
  25. 11 8月, 2008 1 次提交
  26. 22 7月, 2008 1 次提交
  27. 21 4月, 2008 1 次提交
  28. 13 3月, 2008 1 次提交
  29. 24 1月, 2008 2 次提交
  30. 31 12月, 2007 1 次提交