1. 04 12月, 2006 23 次提交
    • P
      [POWERPC] Distinguish POWER6 partition modes and tell userspace · 974a76f5
      Paul Mackerras 提交于
      This adds code to look at the properties firmware puts in the device
      tree to determine what compatibility mode the partition is in on
      POWER6 machines, and set the ELF aux vector AT_HWCAP and AT_PLATFORM
      entries appropriately.
      
      Specifically, we look at the cpu-version property in the cpu node(s).
      If that contains a "logical" PVR value (of the form 0x0f00000x), we
      call identify_cpu again with this PVR value.  A value of 0x0f000001
      indicates the partition is in POWER5+ compatibility mode, and a value
      of 0x0f000002 indicates "POWER6 architected" mode, with various
      extensions disabled.  We also look for various other properties:
      ibm,dfp, ibm,purr and ibm,spurr.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      974a76f5
    • M
      [POWERPC] cell: Add oprofile support · 18f2190d
      Maynard Johnson 提交于
      Add PPU event-based and cycle-based profiling support to Oprofile for Cell.
      
      Oprofile is expected to collect data on all CPUs simultaneously.
      However, there is one set of performance counters per node.  There are
      two hardware threads or virtual CPUs on each node.  Hence, OProfile must
      multiplex in time the performance counter collection on the two virtual
      CPUs.
      
      The multiplexing of the performance counters is done by a virtual
      counter routine.  Initially, the counters are configured to collect data
      on the even CPUs in the system, one CPU per node.  In order to capture
      the PC for the virtual CPU when the performance counter interrupt occurs
      (the specified number of events between samples has occurred), the even
      processors are configured to handle the performance counter interrupts
      for their node.  The virtual counter routine is called via a kernel
      timer after the virtual sample time.  The routine stops the counters,
      saves the current counts, loads the last counts for the other virtual
      CPU on the node, sets interrupts to be handled by the other virtual CPU
      and restarts the counters, the virtual timer routine is scheduled to run
      again.  The virtual sample time is kept relatively small to make sure
      sampling occurs on both CPUs on the node with a relatively small
      granularity.  Whenever the counters overflow, the performance counter
      interrupt is called to collect the PC for the CPU where data is being
      collected.
      
      The oprofile driver relies on a firmware RTAS call to setup the debug bus
      to route the desired signals to the performance counter hardware to be
      counted.  The RTAS call must set the routing registers appropriately in
      each of the islands to pass the signals down the debug bus as well as
      routing the signals from a particular island onto the bus.  There is a
      second firmware RTAS call to reset the debug bus to the non pass thru
      state when the counters are not in use.
      Signed-off-by: NCarl Love <carll@us.ibm.com>
      Signed-off-by: NMaynard Johnson <mpjohn@us.ibm.com>
      Signed-off-by: NArnd Bergmann <arnd.bergmann@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      18f2190d
    • K
      [POWERPC] cell: Add routines for managing PMU interrupts · 0443bbd3
      Kevin Corry 提交于
      The following routines are added to arch/powerpc/platforms/cell/pmu.c:
       cbe_clear_pm_interrupts()
       cbe_enable_pm_interrupts()
       cbe_disable_pm_interrupts()
       cbe_query_pm_interrupts()
       cbe_pm_irq()
       cbe_init_pm_irq()
      
      This also adds a routine in arch/powerpc/platforms/cell/interrupt.c and
      some macros in cbe_regs.h to manipulate the IIC_IR register:
       iic_set_interrupt_routing()
      Signed-off-by: NKevin Corry <kevcorry@us.ibm.com>
      Signed-off-by: NCarl Love <carll@us.ibm.com>
      Signed-off-by: NArnd Bergmann <arnd.bergmann@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      0443bbd3
    • K
      [POWERPC] cell: Move PMU-related stuff to include/asm-powerpc/cell-pmu.h · e4f6948c
      Kevin Corry 提交于
      Move some PMU-related macros and function prototypes from cbe_regs.h
      and pmu.h in arch/powerpc/platforms/cell/ to a new header at
      include/asm-powerpc/cell-pmu.h
      
      This is cleaner to use from the oprofile code, since that sits in
      arch/powerpc/oprofile, not in the cell platform directory.
      Signed-off-by: NKevin Corry <kevcorry@us.ibm.com>
      Signed-off-by: NArnd Bergmann <arnd.bergmann@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      e4f6948c
    • D
      [POWERPC] spufs: Add /lslr, /dma_info and /proxydma files · b9e3bd77
      Dwayne Grant McConnell 提交于
      The /lslr file gives read access to the SPU_LSLR register in hex; 0x3fff
      for example The /dma_info file provides read access to the SPU Command
      Queue in a binary format. The /proxydma_info files provides read access
      access to the Proxy Command Queue in a binary format. The spu_info.h
      file provides data structures for interpreting the binary format of
      /dma_info and /proxydma_info.
      Signed-off-by: NDwayne Grant McConnell <decimal@us.ibm.com>
      Signed-off-by: NArnd Bergmann <arnd.bergmann@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      b9e3bd77
    • G
      [POWERPC] Change ppc_rtas declaration to weak · 8dc86ab9
      Geoff Levand 提交于
      Change the definition of powerpc's cond_syscall() to use the standard gcc
      weak attribute specifier which provides proper support for C linkage as
      needed by spu_syscall_table[].
      
      Fixes this powerpc build error with CONFIG_SPU_FS=y, CONFIG_PPC_RTAS=n:
      
       arch/powerpc/platforms/built-in.o: undefined reference to `ppc_rtas'
      Signed-off-by: NGeoff Levand <geoffrey.levand@am.sony.com>
      Signed-off-by: NArnd Bergmann <arnd.bergmann@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      8dc86ab9
    • B
      [POWERPC] Xserve cpu-meter driver · 3e00a5ae
      Benjamin Herrenschmidt 提交于
      This is a small driver for the Xserve G5 CPU-meter blue LEDs on the
      front-panel. It might work on the Xserve G4 as well though that was
      not tested. It's pretty basic and could use some improvements if
      somebody cares doing them. :)
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      3e00a5ae
    • L
      [POWERPC] Wrap cpu_die() with CONFIG_HOTPLUG_CPU · 088df4d2
      Linas Vepstas 提交于
      Per email discussion, it appears that rtas_stop_self()
      and pSeries_mach_cpu_die() should not be compiled if
      CONFIG_HOTPLUG_CPU is not defined. This patch adds
      #ifdefs around these bits of code.
      Signed-off-by: NLinas Vepstas <linas@austin.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      088df4d2
    • H
      [POWERPC] Make soft_enabled irqs preempt safe · ef2b343e
      Hugh Dickins 提交于
      Rewrite local_get_flags and local_irq_disable to use r13 explicitly,
      to avoid the risk that gcc will split get_paca()->soft_enabled into a
      sequence unsafe against preemption.  Similar care in local_irq_restore.
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      ef2b343e
    • B
      [POWERPC] Fix __raw* accessors · 757db1ed
      Benjamin Herrenschmidt 提交于
      The new IO accessor code allows to stick a token in the top bit of MMIO
      addresses which gets masked out during actual accesses. However, the
      __raw_* accessors forgot to mask it out. This fixes it.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      757db1ed
    • B
      [POWERPC] Merge 32 and 64 bits asm-powerpc/io.h · 68a64357
      Benjamin Herrenschmidt 提交于
      powerpc: Merge 32 and 64 bits asm-powerpc/io.h
      
      The rework on io.h done for the new hookable accessors made it easier,
      so I just finished the work and merged 32 and 64 bits io.h for arch/powerpc.
      
      arch/ppc still uses the old version in asm-ppc, there is just too much gunk
      in there that I really can't be bothered trying to cleanup.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      68a64357
    • J
      [POWERPC] Cell iommu support · 165785e5
      Jeremy Kerr 提交于
      This patch adds full cell iommu support (and iommu disabled mode).
      
      It implements mapping/unmapping of iommu pages on demand using the
      standard powerpc iommu framework.  It also supports running with
      iommu disabled for machines with less than 2GB of memory.  (The
      default is off in that case, though it can be forced on with the
      kernel command line option iommu=force).
      Signed-off-by: NJeremy Kerr <jk@ozlabs.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      165785e5
    • B
      [POWERPC] Add an optional offset to direct DMA on 64 bits · 92b20c40
      Benjamin Herrenschmidt 提交于
      This patch adds an optional global offset that can be added to DMA addresses
      when using the direct DMA operations.
      
      That brings it a step closer to the 32 bits direct DMA operations, and makes
      it useable on Cell when the MMU is disabled and we are using a spider
      southbridge.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      92b20c40
    • B
      [POWERPC] Allow hooking of PCI MMIO & PIO accessors on 64 bits · 4cb3cee0
      Benjamin Herrenschmidt 提交于
      This patch reworks the way iSeries hooks on PCI IO operations (both MMIO
      and PIO) and provides a generic way for other platforms to do so (we
      have need to do that for various other platforms).
      
      While reworking the IO ops, I ended up doing some spring cleaning in
      io.h and eeh.h which I might want to split into 2 or 3 patches (among
      others, eeh.h had a lot of useless stuff in it).
      
      A side effect is that EEH for PIO should work now (it used to pass IO
      ports down to the eeh address check functions which is bogus).
      
      Also, new are MMIO "repeat" ops, which other archs like ARM already had,
      and that we have too now: readsb, readsw, readsl, writesb, writesw,
      writesl.
      
      In the long run, I might also make EEH use the hooks instead
      of wrapping at the toplevel, which would make things even cleaner and
      relegate EEH completely in platforms/iseries, but we have to measure the
      performance impact there (though it's really only on MMIO reads)
      
      Since I also need to hook on ioremap, I shuffled the functions a bit
      there. I introduced ioremap_flags() to use by drivers who want to pass
      explicit flags to ioremap (and it can be hooked). The old __ioremap() is
      still there as a low level and cannot be hooked, thus drivers who use it
      should migrate unless they know they want the low level version.
      
      The patch "arch provides generic iomap missing accessors" (should be
      number 4 in this series) is a pre-requisite to provide full iomap
      API support with this patch.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      4cb3cee0
    • B
      [POWERPC] Generic OF platform driver for PCI host bridges. · 4c9d2800
      Benjamin Herrenschmidt 提交于
      When enabled in Kconfig, it will pick up any of_platform_device
      matching it's match list (currently type "pci", "pcix", "pcie",
      or "ht" and setup a PHB for it.
      
      Platform must provide a ppc_md.pci_setup_phb() for it to work
      (for doing the necessary initialisations specific to a given PHB
      like setting up the config space ops).
      
      It's currently only available on 64 bits as the 32 bits PCI code
      can't quite cope with it in it's current form. I will fix that
      later.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      4c9d2800
    • B
      [POWERPC] Add "parent" struct device for PCI host bridges · 803d4573
      Benjamin Herrenschmidt 提交于
      Add a "parent" struct device to our PCI host bridge data structure so that
      PCI can be rooted off another device in sysfs.
      
      Note that arch/ppc doesn't use it, only arch/powerpc, though it's available
      for both 32 and 64 bits.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      803d4573
    • 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
    • B
      [POWERPC] Souped-up of_platform_device support · 7eebde70
      Benjamin Herrenschmidt 提交于
      This patch first splits of_device.c and of_platform.c, the later containing
      the bits relative to of_platform_device's. On the "breaks" side of things,
      drivers uisng of_platform_device(s) need to include asm/of_platform.h now
      and of_(un)register_driver is now of_(un)register_platform_driver.
      
      In addition to a few utility functions to locate of_platform_device(s),
      the main new addition is of_platform_bus_probe() which allows the platform
      code to trigger an automatic creation of of_platform_devices for a whole
      tree of devices.
      
      The function acts based on the type of the various "parent" devices encountered
      from a provided root, using either a default known list of bus types that can be
      "probed" or a passed-in list. It will only register devices on busses matching
      that list, which mean that typically, it will not register PCI devices, as
      expected (since they will be picked up by the PCI layer).
      
      This will be used by Cell platforms using 4xx-type IOs in the Axon bridge
      and can be used by any embedded-type device as well.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      7eebde70
    • B
      [POWERPC] Improve MPIC driver auto-configuration from DT · a959ff56
      Benjamin Herrenschmidt 提交于
      This patch applies on top of the MPIC DCR support. It makes the MPIC
      driver capable of a lot more auto-configuration based on the device-tree,
      for example, it can retreive it's own physical address if not passed as
      an argument, find out if it's DCR or MMIO mapped, and set the BIG_ENDIAN
      flag automatically in the presence of a "big-endian" property in the
      device-tree node.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      a959ff56
    • B
      [POWERPC] Support for DCR based MPIC · fbf0274e
      Benjamin Herrenschmidt 提交于
      This patch implements support for DCR based MPIC implementations. Such
      implementations have the MPIC_USES_DCR flag set and don't use the phys_addr
      argument of mpic_alloc (they require a valid dcr mapping in the device node)
      
      This version of the patch can use a little bif of cleanup still (I can
      probably consolidate rb->dbase/doff, at least once I'm sure on how the
      hardware is actually supposed to work vs. possible simulator issues) and
      it should be possible to build a DCR-only version of the driver. I need
      to cleanup a bit the CONFIG_* handling for that and probably introduce
      CONFIG_MPIC_MMIO and CONFIG_MPIC_DCR.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      fbf0274e
    • B
      [POWERPC] Generic DCR infrastructure · 4c75a6f4
      Benjamin Herrenschmidt 提交于
      This patch adds new dcr_map/dcr_read/dcr_write accessors for DCRs that
      can be used by drivers to transparently address either native DCRs or
      memory mapped DCRs. The implementation for memory mapped DCRs is done
      after the binding being currently worked on for SLOF and the Axon
      chipset. This patch enables it for the cell native platform
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      4c75a6f4
    • B
      [POWERPC] Remove ppc_md.pci_map_irq & ppc_swizzle for ARCH=powerpc · 69108cf0
      Benjamin Herrenschmidt 提交于
      These were inherited from ARCH=ppc, but are not needed since parsing of interrupts
      should be done via the of_* functions (who can do swizzling). If we ever need to
      do non-standard swizzling on bridges without a device-node, then we might add
      back a slightly different version of ppc_md.pci_swizzle but for now, that is not
      the case.
      
      I removed the couple of calls for these in 83xx. If that breaks something, then
      there is a problem with the device-tree on these.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      69108cf0
    • B
      [POWERPC] Make pci_read_irq_line the default · f90bb153
      Benjamin Herrenschmidt 提交于
      This patch reworks the way IRQs are fixed up on PCI for arch powerpc.
      
      It makes pci_read_irq_line() called by default in the PCI code for
      devices that are probed, and add an optional per-device fixup in
      ppc_md for platforms that really need to correct what they obtain
      from pci_read_irq_line().
      
      It also removes ppc_md.irq_bus_setup which was only used by pSeries
      and should not be needed anymore.
      
      I've also removed the pSeries s7a workaround as it can't work with
      the current interrupt code anyway. I'm trying to get one of these
      machines working so I can test a proper fix for that problem.
      
      I also haven't updated the old-style fixup code from 85xx_cds.c
      because it's actually buggy :) It assigns pci_dev->irq hard coded
      numbers which is no good with the new IRQ mapping code. It should
      at least use irq_create_mapping(NULL, hard_coded_number); and possibly
      also set_irq_type() to set them as level low.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      f90bb153
  2. 03 12月, 2006 1 次提交
  3. 02 12月, 2006 2 次提交
  4. 22 11月, 2006 1 次提交
  5. 16 11月, 2006 2 次提交
  6. 13 11月, 2006 8 次提交
  7. 04 11月, 2006 1 次提交
  8. 01 11月, 2006 2 次提交
    • H
      [POWERPC] Make mmiowb's io_sync preempt safe · 292f86f0
      Hugh Dickins 提交于
      If mmiowb() is always used prior to releasing spinlock as Doc suggests,
      then it's safe against preemption; but I'm not convinced that's always
      the case.  If preemption occurs between sync and get_paca()->io_sync = 0,
      I believe there's no problem.  But in the unlikely event that gcc does
      the store relative to another register than r13 (as it did with current),
      then there's a small danger of setting another cpu's io_sync to 0, after
      it had just set it to 1.  Rewrite ppc64 mmiowb to prevent that.
      
      The remaining io_sync assignments in io.h all get_paca()->io_sync = 1,
      which is harmless even if preempted to the wrong cpu (the context switch
      itself syncs); and those in spinlock.h are while preemption is disabled.
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      292f86f0
    • H
      [POWERPC] Make current preempt-safe · 5fe8e8b8
      Hugh Dickins 提交于
      Repeated -j20 kernel builds on a G5 Quad running an SMP PREEMPT kernel
      would often collapse within a day, some exec failing with "Bad address".
      In each case examined, load_elf_binary was doing a kernel_read, but
      generic_file_aio_read's access_ok saw current->thread.fs.seg as USER_DS
      instead of KERNEL_DS.
      
      objdump of filemap.o shows gcc 4.1.0 emitting "mr r5,r13 ... ld r9,416(r5)"
      here for get_paca()->__current, instead of the expected and much more usual
      "ld r9,416(r13)"; I've seen other gcc4s do the same, but perhaps not gcc3s.
      
      So, if the task is preempted and rescheduled on a different cpu in between
      the mr and the ld, r5 will be looking at a different paca_struct from the
      one it's now on, pick up the wrong __current, and perhaps the wrong seg.
      Presumably much worse could happen elsewhere, though that split is rare.
      
      Other architectures appear to be safe (x86_64's read_pda is more limiting
      than get_paca), but ppc64 needs to force "current" into one instruction.
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      5fe8e8b8