]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
16 years ago[POWERPC] spusched: Fix timeslice calculations
Jeremy Kerr [Fri, 29 Jun 2007 00:57:53 +0000 (10:57 +1000)]
[POWERPC] spusched: Fix timeslice calculations

The current timeslice code mixes 'jiffies' up with 'spesched ticks'. This
change correctly defines the number of time slices each SPE contexts is
given, and clarifies the comment.

This brings the default timeslice for SPE contexts into a reasonable
range.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] spusched: Dynamic timeslicing for SCHED_OTHER
Christoph Hellwig [Fri, 29 Jun 2007 00:57:52 +0000 (10:57 +1000)]
[POWERPC] spusched: Dynamic timeslicing for SCHED_OTHER

Enable preemptive scheduling for non-RT contexts.

We use the same algorithms as the CPU scheduler to calculate the time
slice length, and for now we also use the same timeslice length as the
CPU scheduler. This might be not enough for good performance and can be
changed after some benchmarking.

Note that currently we do not boost the priority for contexts waiting
on the runqueue for a long time, so contexts with a higher nice value
could starve ones with less priority.  This could easily be fixed once
the rework of the spu lists that Luke and I discussed is done.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] spusched: Switch from workqueues to kthread + timer tick
Christoph Hellwig [Fri, 29 Jun 2007 00:57:51 +0000 (10:57 +1000)]
[POWERPC] spusched: Switch from workqueues to kthread + timer tick

Get rid of the scheduler workqueues that complicated things a lot to
a dedicated spu scheduler thread that gets woken by a traditional
scheduler tick.  By default this scheduler tick runs a HZ * 10, aka
one spu scheduler tick for every 10 cpu ticks.

Currently the tick is not disabled when we have less context than
available spus, but I will implement this later.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] spufs: Add bit definition
Sebastian Siewior [Fri, 29 Jun 2007 00:57:50 +0000 (10:57 +1000)]
[POWERPC] spufs: Add bit definition

Add a bit define from book, and replace one hex number with a
symbol, for clarity.

Signed-off-by: Sebastian Siewior <bigeasy@linux.vnet.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] spufs: fix building spufs/spu_save_dump.h
Sebastian Siewior [Fri, 29 Jun 2007 00:57:49 +0000 (10:57 +1000)]
[POWERPC] spufs: fix building spufs/spu_save_dump.h

Currently it fails with gcc from sdk 2.1 because of a spec change [1].
Maybe we should start using the definitions from spu_mfcio.h.

[1] http://gcc.gnu.org/ml/gcc-patches/2006-11/msg01598.html

Signed-off-by: Sebastian Siewior <bigeasy@linux.vnet.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Add copyright header to pci-common.c based on pci_{32,64}.c
Kumar Gala [Fri, 29 Jun 2007 03:56:24 +0000 (22:56 -0500)]
[POWERPC] Add copyright header to pci-common.c based on pci_{32,64}.c

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Use ppc64 style list management for pci_controller on ppc32
Kumar Gala [Wed, 27 Jun 2007 18:09:43 +0000 (13:09 -0500)]
[POWERPC] Use ppc64 style list management for pci_controller on ppc32

Use the ppc64 style list management and allocation functions for
pci_controllers.  This makes the pci_controller structs just a bit more
common between ppc32 & ppc64.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Move common PCI code out of pci_32/pci_64
Kumar Gala [Wed, 27 Jun 2007 16:07:51 +0000 (11:07 -0500)]
[POWERPC] Move common PCI code out of pci_32/pci_64

Moved the low hanging fruit that was either identical or close
to it between ppc32 & ppc64 for PCI into pci-common.c

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Move pci_bus_to_hose users to pci_bus_to_host
Kumar Gala [Wed, 27 Jun 2007 15:27:33 +0000 (10:27 -0500)]
[POWERPC] Move pci_bus_to_hose users to pci_bus_to_host

In the places we can move to using pci_bus_to_host, this allows us
to make pci_bus_to_host static and remove its export.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Merge ppc32 and ppc64 pcibios_alloc_controller() prototypes
Kumar Gala [Wed, 27 Jun 2007 06:56:50 +0000 (01:56 -0500)]
[POWERPC] Merge ppc32 and ppc64 pcibios_alloc_controller() prototypes

Make the ppc32 pcibios_alloc_controller take a device node to match
the ppc64 prototypes and have it set arch_data.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Use global_number in ppc32 pci_controller
Kumar Gala [Wed, 27 Jun 2007 06:17:57 +0000 (01:17 -0500)]
[POWERPC] Use global_number in ppc32 pci_controller

Make the pci_controller struct use global_number for the PHB domain number
instead of index to match what ppc64 does and reuse its pci_domain_nr code.

Introduced a pci-common.c to handle shared code between ppc32 & ppc64.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Removed dead code related to PCI on ppc32
Kumar Gala [Wed, 27 Jun 2007 06:14:04 +0000 (01:14 -0500)]
[POWERPC] Removed dead code related to PCI on ppc32

There are no in kernel users of any off these functions and some of
them were not even EXPORT_SYMBOL:

- pci_bus_io_base()
- pci_bus_io_base_phys()
- pci_bus_mem_base_phys()
- pci_resource_to_bus()
- phys_to_bus()
- pci_phys_to_bus()
- pci_bus_to_phys()
- pci_init_resource()
- resource_fixup()

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Remove local_number from pci_controller
Kumar Gala [Wed, 27 Jun 2007 05:19:08 +0000 (00:19 -0500)]
[POWERPC] Remove local_number from pci_controller

We never actually read local_number so lets just remove it.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Merge asm-ppc/pci-bridge.h into asm-power/pci-bridge.h
Kumar Gala [Wed, 27 Jun 2007 05:16:25 +0000 (00:16 -0500)]
[POWERPC] Merge asm-ppc/pci-bridge.h into asm-power/pci-bridge.h

Moved bits need for ppc32 from asm-ppc/pci-bridge.h into
asm-powerpc/pci-bridge.h.

Removed ARCH=powerpc specific bits (and comments related to ARCH=ppc)
from asm-ppc/pci-bridge.h as its only used on ARCH=ppc.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] 86xx: Created quirk_fsl_pcie_transparent() to initialize bridge resources.
Zhang Wei [Tue, 26 Jun 2007 23:22:40 +0000 (18:22 -0500)]
[POWERPC] 86xx: Created quirk_fsl_pcie_transparent() to initialize bridge resources.

The Freescale PCI-e RC poses as a transparent bridge, but does not
implement the IO_BASE or IO_LIMIT registers in the config space.  This
means that the code which initializes the bridge resources ends up
setting the IO resources erroneously.  Add quick_fsl_pcie_transparent()
to handle this.

This change sets RC of mpc8641 to be a transparent bridge
for legacy I/O access and initializes the RC bridge resources
from the device tree.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Let subordinate transparent bridges be transparent.
York Sun [Mon, 4 Jun 2007 16:56:42 +0000 (11:56 -0500)]
[POWERPC] Let subordinate transparent bridges be transparent.

In pcibios_fixup_bus(), bridges that are subordinate
to transparent bridges were still relocating their
IORESOURCE_IO and IO_RESOURCE_MEM start and end values.

Fix this by preventing the transparent bridge from
relocating the start and end values, thus allowing the
subordinate non-transparent bridge full molestation rights.

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] MPC8641HPCN: Set IDE in ULI1575 to not native mode.
Zhang Wei [Tue, 22 May 2007 03:38:30 +0000 (11:38 +0800)]
[POWERPC] MPC8641HPCN: Set IDE in ULI1575 to not native mode.

Set IDE in ULI1575 to not 100% native mode, which forces
the IDE driver to probe the irq itself.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] 86xx: Workaround PCI_PRIMARY_BUS usage
Kumar Gala [Tue, 26 Jun 2007 17:12:55 +0000 (12:12 -0500)]
[POWERPC] 86xx: Workaround PCI_PRIMARY_BUS usage

The Freescale PCI-e controllers have an issue in that they use the
PCI_PRIMARY_BUS register in the virtual P2P bridge to determine which
bus number to match on when generating a type 0 config cycle.  The
issue is if we are renumbering bus numbers to match Linux we will try
setting the PCI_PRIMARY_BUS and will not know which bus number to use
for generating type 0 config cycles.  We surpress writing the register
in the P2P bridge and always keep it at zero.

In the future when proper PCI domain support is working we should be
able to remove this.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] 86xx: Avoid system halt if link training isn't at least L0.
Zhang Wei [Mon, 25 Jun 2007 20:21:10 +0000 (15:21 -0500)]
[POWERPC] 86xx: Avoid system halt if link training isn't at least L0.

We check the Link Training and State Status register to make sure we
are at least at the L0 state.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Acked-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Added indirect_type to handle variants of PCI ops
Kumar Gala [Mon, 25 Jun 2007 20:19:48 +0000 (15:19 -0500)]
[POWERPC] Added indirect_type to handle variants of PCI ops

The generic PCI config ops indirect support for ppc32 covers only two
cases (implicit vs explicit) type 0/1 config cycles via set_cfg_type.
Added a indirect_type bit mask to handle other variants.

Added support for PCI-e extended registers and moved the cfg_type
handling into the bit mask for ARCH=powerpc.  We can also use this to
handle indirect quirks.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] 86xx: Add uli1575 pci-bridge sector to MPC8641HPCN dts file.
Wade Farnsworth [Mon, 4 Jun 2007 20:24:47 +0000 (13:24 -0700)]
[POWERPC] 86xx: Add uli1575 pci-bridge sector to MPC8641HPCN dts file.

This adds device nodes for the PCI bridges as well as the ISA devices on
the newer revision MPC8641HPCN.  It also adds the PCI ranges to the soc
node so that address translation for the ISA devices works properly.

Signed-off-by: Wade Farnsworth <wfarnsworth@mvista.com>
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Remove PCI-e errata for MPC8641 silicon ver 1.0
Zhang Wei [Tue, 22 May 2007 03:38:26 +0000 (11:38 +0800)]
[POWERPC] Remove PCI-e errata for MPC8641 silicon ver 1.0

Remove errata for PCI-e support of Rev 1.0 of MPC8641 since its considered
obselete and is not production level silicon from Freescale.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Acked-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Removed remnants of bus_offset
Kumar Gala [Mon, 25 Jun 2007 18:32:48 +0000 (13:32 -0500)]
[POWERPC] Removed remnants of bus_offset

Removed the remants of bus_offset and use self_busno in the mv64x60 case
and use pci_assign_all_buses on 83xx/85xx.

83xx/85xx have multiple PHBs and the firmwares on these devices tend not
to handle topologies with P2P bridges well so we let Linux just reassign
the bus numbers to match.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Added self_busno to indicate which bus number the PHB is
Kumar Gala [Mon, 25 Jun 2007 18:09:42 +0000 (13:09 -0500)]
[POWERPC] Added self_busno to indicate which bus number the PHB is

Added self_busno to pci_controller and indirect PCI ops to be set by
board code to indicate which bus number to use when talking to the PHB.
By default we use zero since the majority of controllers that have
implicit mechanisms to talk to the PHBs use a bus number of zero.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Remove bus_offset in places its not really used
Kumar Gala [Mon, 25 Jun 2007 17:53:51 +0000 (12:53 -0500)]
[POWERPC] Remove bus_offset in places its not really used

The user of the fsl_pcie code doesn't set bus_offset and 82xx doesn't
require it either.  Remove the places in the code that reference it so
we can remove it all together.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Remove hack to determine the 2nd PHBs bus number
Kumar Gala [Fri, 22 Jun 2007 05:29:46 +0000 (00:29 -0500)]
[POWERPC] Remove hack to determine the 2nd PHBs bus number

Now that we have the pci_controller in the exclude function we can easy
figure out if the bus number is the PHB or not.  The old style of using a
variable setup at init time was actually broken and would only work in
specific cases.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Pass the pci_controller into pci_exclude_device
Kumar Gala [Fri, 22 Jun 2007 05:23:57 +0000 (00:23 -0500)]
[POWERPC] Pass the pci_controller into pci_exclude_device

There are times that we need to know which controller we are on to decide
how to exclude devices properly.  We now pass the pci_controller that we
are going to use down to the pci_exclude_device function. This will
greatly simplify being able to exclude the PHBs in multiple controller
setups.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] 52xx: Remove support for PCI bus_offset
Kumar Gala [Thu, 21 Jun 2007 16:32:38 +0000 (11:32 -0500)]
[POWERPC] 52xx: Remove support for PCI bus_offset

The hose->bus_offset is only used for PCI config cycles and the 52xx PCI
config code doesn't actually ever set bus_offset to a non-zero value.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Remove set_cfg_type for PCI indirect users that don't need it
Kumar Gala [Thu, 21 Jun 2007 16:22:47 +0000 (11:22 -0500)]
[POWERPC] Remove set_cfg_type for PCI indirect users that don't need it

The Freescale and Marvell PCI controllers dont require explicit setting for
type 1 config cycles.  They handle producing them by implicitly looking at the
bus, devfn.

The TSI108 and 52xx don't use the generic PCI indirect code and thus don't
bother with set_cfg_type.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] disallow building powermac and tsi108 without PCI
Arnd Bergmann [Sun, 17 Jun 2007 23:06:58 +0000 (01:06 +0200)]
[POWERPC] disallow building powermac and tsi108 without PCI

The TSI108 code and the 32 bit powermac and chrp platforms
have dependency on PCI that is not easy or desirable to get rid
of.

The easiest fix is to always select CONFIG_PCI if one of those
platforms is enabled.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
16 years ago[POWERPC] fix building without PCI
Arnd Bergmann [Sun, 17 Jun 2007 23:06:57 +0000 (01:06 +0200)]
[POWERPC] fix building without PCI

Some code looks can be configured to be built without
PCI support, but does not work properly.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
16 years ago[POWERPC] kill isa_{io,mem}_base definitions for !PCI
Arnd Bergmann [Sun, 17 Jun 2007 23:06:56 +0000 (01:06 +0200)]
[POWERPC] kill isa_{io,mem}_base definitions for !PCI

When CONFIG_PCI is disabled, the definitions for isa_io_base,
isa_mem_base and pci_dram_offset are entirely unused, but they
can result in link failure because they are defined in multiple
places.

The easiest fix is to just remove all these definitions.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
16 years ago[POWERPC] mpc82xx_ads build fix
Arnd Bergmann [Sun, 17 Jun 2007 23:06:55 +0000 (01:06 +0200)]
[POWERPC] mpc82xx_ads build fix

needed for 6xx allyesconfig

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
16 years ago[POWERPC] rename add_bridge to avoid namespace clashes
Arnd Bergmann [Sun, 17 Jun 2007 23:06:54 +0000 (01:06 +0200)]
[POWERPC] rename add_bridge to avoid namespace clashes

Many platforms currently define their own add_bridge function, some
of them globally. This breaks some multiplatform configurations.
Prefixing each of these functions with the platform name avoids
this problem.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
16 years ago[POWERPC] move 82xx/83xx/86xx Kconfig options to platform selection
Arnd Bergmann [Sun, 17 Jun 2007 23:06:52 +0000 (01:06 +0200)]
[POWERPC] move 82xx/83xx/86xx Kconfig options to platform selection

The cores used in the MPC82xx/83xx/86xx embedded controllers are very similar
to those in the 32 bit general-purpose processors, so it makes sense to
treat them as the same CPU family.

Choosing between the embedded platforms and the multiplatform code is
now done in the platform menu, but functionally everything stays the
same.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
16 years ago[POWERPC] In booting-without-of.txt, clarify that properties must precede subnodes
David Gibson [Thu, 28 Jun 2007 05:56:26 +0000 (15:56 +1000)]
[POWERPC] In booting-without-of.txt, clarify that properties must precede subnodes

A strict reading of the flattened device tree format defined in
booting-without-of.txt does in fact require that all the tags defining
properties for a node go before any definitions of subnodes, however
it's not particularly emphasised.  Although allowing intermingled
properties and subnodes would not be ambiguous in meaning, the kernel
parser does currently require that properties precede subnodes.
Furthermore, keeping this constraint makes life easier for various
device tree scanning tools.

Therefore, re-emphasise in booting-without-of.txt that this is a
strict requirement of the flattened device tree format.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Abolish unused ucBoardRev variables
David Gibson [Wed, 27 Jun 2007 06:54:58 +0000 (16:54 +1000)]
[POWERPC] Abolish unused ucBoardRev variables

asm-powerpc/processor.h declares, and arch/ppc/platforms/prep_setup.c
defines variables ucBoardRev, ucBoardRevMaj and ucBoardRevMin which
are used nowhere in the current kernel (neither in arch/ppc nor
arch/powerpc).  This removes them.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Make more OF-related bootwrapper functions available to non-OF platforms
David Gibson [Wed, 27 Jun 2007 06:54:58 +0000 (16:54 +1000)]
[POWERPC] Make more OF-related bootwrapper functions available to non-OF platforms

Commit 2e6016133755eb3cc44e8efab92573d23ed75888 split up
arch/powerpc/boot/of.c so that some OF functions can be used on
platforms that don't want to use the overall OF platform boot code.
This is useful on things like PReP which can have an OF implementation
which is useful for debugging output, but inadequate for booting.

However, that commit didn't export quite enough things to make a
usable OF console on a non-OF system.  In particular, the device tree
manipulation performed to initialize the OF console code must
explicitly use the OF device tree, rather than the flattened device
tree, even if the system is otherwise booting using a flattened device
tree.  This makes it so.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Turn off debugging in arch/powerpc/kernel/pci_64.c
Michael Ellerman [Wed, 27 Jun 2007 06:02:55 +0000 (16:02 +1000)]
[POWERPC] Turn off debugging in arch/powerpc/kernel/pci_64.c

Commit 3d5134ee8341bffc4f539049abb9e90d469b448d left debugging turned on
in arch/powerpc/kernel/pci_64.c.  This turns it off again.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Move iSeries_tb_recal into its own late_initcall.
Tony Breeds [Fri, 22 Jun 2007 06:54:30 +0000 (16:54 +1000)]
[POWERPC] Move iSeries_tb_recal into its own late_initcall.

Currently iSeries will recalibrate the cputime_factors in the first
settimeofday() call.

It seems the reason for doing this is to ensure a resaonable time delta after
time_init().  On current kernels (with udev), this call is made 40-60 seconds
into the boot process, by moving it to a late initcall it is called
approximately 5 seconds after time_init() is called.  This is sufficient to
recalibrate the timebase.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
CC: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Storage device registration routines
Geert Uytterhoeven [Thu, 21 Jun 2007 14:14:22 +0000 (00:14 +1000)]
[POWERPC] PS3: Storage device registration routines

Add support for storage devices to the device probe code.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Storage Driver Core
Geert Uytterhoeven [Thu, 21 Jun 2007 14:14:21 +0000 (00:14 +1000)]
[POWERPC] PS3: Storage Driver Core

Add storage driver core support for the PS3.
PS3 storage devices are a special kind of PS3 system bus device.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Preallocate bootmem memory for the PS3 FLASH ROM storage driver
Geert Uytterhoeven [Thu, 21 Jun 2007 14:14:20 +0000 (00:14 +1000)]
[POWERPC] PS3: Preallocate bootmem memory for the PS3 FLASH ROM storage driver

Preallocate 256 KiB of bootmem memory for the PS3 FLASH ROM storage driver.
This can be disabled by passing `ps3flash=off' on the kernel command line.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Update ps3_defconfig
Geoff Levand [Fri, 15 Jun 2007 22:07:30 +0000 (08:07 +1000)]
[POWERPC] PS3: Update ps3_defconfig

Update ps3_defconfig.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Fix more sparse warnings
Geert Uytterhoeven [Fri, 15 Jun 2007 22:07:23 +0000 (08:07 +1000)]
[POWERPC] PS3: Fix more sparse warnings

Fix some PS3 build warnings reported by `make C=1'.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Select MEMORY_HOTPLUG
Geoff Levand [Fri, 15 Jun 2007 22:07:16 +0000 (08:07 +1000)]
[POWERPC] PS3: Select MEMORY_HOTPLUG

The PS3 uses the kernel's hotplug memory support, so make sure it is
always enabled when building for PS3.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Device tree source
Geoff Levand [Fri, 15 Jun 2007 22:06:51 +0000 (08:06 +1000)]
[POWERPC] PS3: Device tree source

The PS3 device tree source.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Acked-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Make kernel_entry_t have global scope in bootwrapper
Geoff Levand [Fri, 15 Jun 2007 22:06:44 +0000 (08:06 +1000)]
[POWERPC] Make kernel_entry_t have global scope in bootwrapper

For the convenience of custom platform code make the powerpc
bootwrapper typdef kernel_entry_t global in scope.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Fix constantness of bootwrapper arg
Geoff Levand [Fri, 15 Jun 2007 22:06:40 +0000 (08:06 +1000)]
[POWERPC] Fix constantness of bootwrapper arg

Fixes the constantness of the powerpc bootwrapper's console_ops.write
routine.  Allows printing of constant strings.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Add u64 printf to bootwrapper
Geoff Levand [Fri, 15 Jun 2007 22:06:36 +0000 (08:06 +1000)]
[POWERPC] Add u64 printf to bootwrapper

Add support for the 'll' (long long) printf qualifier in the powerpc zImage
bootwrapper.  This is useful for bootwrapper debugging on 64 bit platforms.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Add signed types to bootwrapper
Geoff Levand [Fri, 15 Jun 2007 22:06:28 +0000 (08:06 +1000)]
[POWERPC] Add signed types to bootwrapper

Add signed types to the powerpc zImage bootwrapper. These are needed by the
PS3 hcall interface.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Correct __secondary_hold comment
Geoff Levand [Fri, 15 Jun 2007 22:06:23 +0000 (08:06 +1000)]
[POWERPC] Correct __secondary_hold comment

Remove references to pSeries and OpenFirmware in the __secondary_hold
usage comment.  __secondary_hold is a generic routine and can be used
by other platforms.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Output params value in early_init_devtree
Geoff Levand [Fri, 15 Jun 2007 22:06:14 +0000 (08:06 +1000)]
[POWERPC] Output params value in early_init_devtree

Add a printout of the params value to early_init_devtree.
This value is handy to have for comparison when debugging the
bootwrapper code.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Use clear_bit
Geoff Levand [Fri, 15 Jun 2007 22:06:09 +0000 (08:06 +1000)]
[POWERPC] PS3: Use clear_bit

Replace the inline asm with bitops in the PS3 interrupt
chip mask routines.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Rename processor id symbols
Geoff Levand [Fri, 15 Jun 2007 22:06:04 +0000 (08:06 +1000)]
[POWERPC] PS3: Rename processor id symbols

Rename the PS3 static symbols node to ppe_id and cpu to thread_id
to clarify usage.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Device registration routines.
Geoff Levand [Fri, 15 Jun 2007 22:05:53 +0000 (08:05 +1000)]
[POWERPC] PS3: Device registration routines.

Add routines to probe devices present on the system
and to register those devices with the LDM.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Frame buffer system-bus rework
Geert Uytterhoeven [Fri, 15 Jun 2007 22:05:38 +0000 (08:05 +1000)]
[POWERPC] PS3: Frame buffer system-bus rework

Convert the ps3fb device from a platform device to a PS3 system bus device.
Fix the remove and shutdown methods to support kexec and to make ps3fb a
loadable module.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Rework AV settings driver
Geoff Levand [Fri, 15 Jun 2007 22:05:01 +0000 (08:05 +1000)]
[POWERPC] PS3: Rework AV settings driver

Make the PS3 ps3av driver a loadable module.
  - Replace static data with kmalloc()'ed.
      o Allocate struct ps3av dynamically, as it contains data used as vuart
        receive/transmit buffers
      o Move static recv_buf from ps3av_do_pkt() to struct ps3av
  - Move ps3av_vuart_{read,write}() from drivers/ps3/ps3av_cmd.c to
    drivers/ps3/ps3av.c and make them static as they're used in that file only.
  - Make device a PS3 system-bus device.
  - Update copyright formatting.
  - Make two new routines ps3av_register_flip_ctl() and ps3av_flip_ctl() to
    support late binding of the frame buffer flip control routine.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: System manager re-work
Geoff Levand [Fri, 15 Jun 2007 22:03:54 +0000 (08:03 +1000)]
[POWERPC] PS3: System manager re-work

PS3 sys-manager updates to reflect the new PS3 unifed device support.
Fixups to the PS3 sys-manager driver to properly support sys_reboot().
 - Add varable request_tag to struct ps3_sys_manager_header.
 - Move ctrl_alt_del from PS3_SM_EVENT_POWER_RELEASED to
   PS3_SM_EVENT_POWER_PRESSED.
 - Make the PS3 sys-manager driver a loadable module.
 - Add new file sys-manager-core.c.
 - Add new struct ps3_sys_manager_ops for dynamic binding.
 - Put data sent to device on stack.
 - Add support for PS3_SM_SERVICE_ID_REQUEST_ERROR.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Vuart rework
Geoff Levand [Fri, 15 Jun 2007 22:01:06 +0000 (08:01 +1000)]
[POWERPC] PS3: Vuart rework

PS3 vuart updates to reflect the new PS3 unified device support.
 - Move vuart devices to the PS3 system bus.
 - Replace use of ps3_vuart_port_device with ps3_system_bus_device.
 - Make the PS3 vuart bus driver a loadable module.
 - Add remove() and shutdown() routines.
 - Move ps3_vuart_work into ps3_vuart_port_priv.tx_list.
 - Remove redundant spinlock ps3_vuart_work.lock.
 - No longer free ps3_vuart_port_device.priv on shutdown.
 - Cleanup Kconfig defs.
 - Export symbols needed for modular port drivers.
 - Arrange to use port numbers found in repository.
 - Fix bugs in ps3_vuart_read_async() and polled reading
 - Cleanup handling of shared interrupt with ps3_vuart_bus_interrupt_get()
   and ps3_vuart_bus_interrupt_put()
 - Add more comments to vuart.c.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Repository probe cleanups
Geoff Levand [Fri, 15 Jun 2007 21:55:58 +0000 (07:55 +1000)]
[POWERPC] PS3: Repository probe cleanups

Repository updates:
  - Extract ps3_repository_find_bus() from ps3_repository_find_device(), as the
    storage driver needs it.
  - Make ps3_repository_find_device() return -ENODEV if a device is not found,
    just like if a bus is not found.
  - Add ps3_repository_read_vuart_sysmgr_port() and
    ps3_repository_read_vuart_av_port() to get vuart port info.
  - Add device enumeration routines ps3_repository_find_device() and
    ps3_repository_find_devices().
  - Cleanup debug routines.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: System-bus modinfo attribute
David Woodhouse [Fri, 15 Jun 2007 21:55:20 +0000 (07:55 +1000)]
[POWERPC] PS3: System-bus modinfo attribute

Add modinfo attribute to ps3_system_bus devices.  Also make them all
children of the same ps3_system_bus 'device' so they appear in a
corresponding subdirectory under /sys/devices.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: System-bus uevent
David Woodhouse [Fri, 15 Jun 2007 21:55:14 +0000 (07:55 +1000)]
[POWERPC] PS3: System-bus uevent

To allow userspace to automatically load modules, we need to hook up
uevent for ps3_system_bus devices.  I've used the form 'ps3:%d' with
the ps3_match_id, since that's what we use for matching drivers.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: System-bus rework
Geoff Levand [Fri, 15 Jun 2007 21:52:02 +0000 (07:52 +1000)]
[POWERPC] PS3: System-bus rework

Rework the PS3 system bus to unify device support.
 - DMA region sizes must be a power of two
 - storage bus DMA updates:
  - Small fixes for the PS3 DMA core:
      o fix alignment bug
      o kill superfluous test
      o indentation
      o spelling
      o export ps3_dma_region_{create,free}()
  - ps3_dma_region_init():
      o Add `addr' and `len' parameters, so you can create a DMA region that
        does not cover all memory (use `NULL' and `0' to cover all memory).
This is needed because there are not sufficient IOMMU resources to have
all DMA regions cover all memory.
      o Uninline
  - Added remove and shutdown routines to all drivers.
  - Added loadable module support to all drivers.
  - Added HV calls for iopte management (needed by sound driver).

Signed-off-by: MOKUNO Masakazu <mokuno@sm.sony.co.jp>
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Kexec support
Geoff Levand [Fri, 15 Jun 2007 21:19:32 +0000 (07:19 +1000)]
[POWERPC] PS3: Kexec support

Fixup the core platform parts needed for kexec to work on the PS3.
 - Setup ps3_hpte_clear correctly.
 - Mask interrupts on irq removal.
 - Release all hypervisor resources.
 - Create new routine ps3_shutdown_IRQ()

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Simplify definition of DBG
Geert Uytterhoeven [Fri, 15 Jun 2007 21:19:23 +0000 (07:19 +1000)]
[POWERPC] PS3: Simplify definition of DBG

Simplify the PS3 definition of DBG.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Move chip mask defs up
Geoff Levand [Fri, 15 Jun 2007 21:19:18 +0000 (07:19 +1000)]
[POWERPC] PS3: Move chip mask defs up

This just moves the definitions of the PS3 chip_mask routines up
above the irq setup routines.  This change is needed for the
kexec updates that follow.  Also adds some inline documentation
to the routines.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Add support for HDMI RGB Full Range mode
Masashi Kimoto [Fri, 15 Jun 2007 21:19:10 +0000 (07:19 +1000)]
[POWERPC] PS3: Add support for HDMI RGB Full Range mode

Add support for HDMI RGB Full Range mode, which is available on system
software 1.80 or newer.

CC: Masashi Kimoto <Masashi_Kimoto@hq.scei.sony.co.jp>
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Fix sparse warnings
Geert Uytterhoeven [Fri, 15 Jun 2007 21:19:04 +0000 (07:19 +1000)]
[POWERPC] PS3: Fix sparse warnings

Fix some PS3 build warnings reported by `make C=1'.  You need to
install sparse:
  git://git.kernel.org/pub/scm/devel/sparse/sparse.git

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Map SPU regions as non-guarded
Geoff Levand [Fri, 15 Jun 2007 21:18:56 +0000 (07:18 +1000)]
[POWERPC] PS3: Map SPU regions as non-guarded

Use ioremap_flags() to map SPU regions as non-guarded.
Change the use of _ioremap() to ioremap_flags().

CC: Arnd Bergmann <arnd.bergmann@de.ibm.com>
CC: Masato Noguchi <Masato.Noguchi@jp.sony.com>
CC: Takao Shinohara <shin@sm.sony.co.jp>
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Compare firmware version
Masakazu Mokuno [Fri, 15 Jun 2007 21:18:48 +0000 (07:18 +1000)]
[POWERPC] PS3: Compare firmware version

Add a utility routine ps3_compare_firmware_version() to compare system
firmware versions.  Uses the existing ps3_get_firmware_version() routine.

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Use __maybe_unused
Geoff Levand [Fri, 15 Jun 2007 21:18:14 +0000 (07:18 +1000)]
[POWERPC] PS3: Use __maybe_unused

Change the PS3 debug routines from using the GCC specific
'__attribute__ ((unused))' to the preprocessor macro
__maybe_unused.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Rename IPI symbols
Geoff Levand [Fri, 15 Jun 2007 21:17:42 +0000 (07:17 +1000)]
[POWERPC] PS3: Rename IPI symbols

Rename the PS3 static symbol virqs to ps3_ipi_virqs to aid in
debugging.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] cell: Add spu shutdown method
Geoff Levand [Fri, 15 Jun 2007 21:17:32 +0000 (07:17 +1000)]
[POWERPC] cell: Add spu shutdown method

Add a shutdown method to spu_sysdev_class to allow proper spu resource
cleanup on system shutdown.  This is needed to support kexec on the PS3
platform.

Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Fix Kexec/Kdump for power6
Sachin P. Sant [Thu, 14 Jun 2007 05:31:34 +0000 (15:31 +1000)]
[POWERPC] Fix Kexec/Kdump for power6

On Power machines supporting VRMA, Kexec/Kdump does not work.
VRMA (virtual real-mode area) means that accesses with IR/DR = 0
(i.e. the MMU "off") actually still go through the hash table,
using entries put there by the hypervisor.

This means that when we clear out the hash table on kexec, we need to
make sure these entries are left untouched.

This also adds plpar_pte_read_raw() on the lines of
plpar_pte_remove_raw().

Signed-off-by : Sachin Sant <sachinp@in.ibm.com>
Signed-off-by : Mohan Kumar M <mohan@in.ibm.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Fix interrupt distribution in ppc970
Mohan Kumar M [Tue, 12 Jun 2007 14:51:57 +0000 (00:51 +1000)]
[POWERPC] Fix interrupt distribution in ppc970

In some of the PPC970 based systems, interrupt would be distributed to
offline cpus also even when booted with "maxcpus=1".  So check whether
cpu online map and cpu present map are equal or not.  If they are equal
default_distrib_server is used as interrupt server otherwise boot cpu
(default_server) used as interrupt server.

In addition to this, if an interrupt is assigned to a specific cpu (ie
smp affinity) and if that cpu is not online, the earlier code used to
return the default_distrib_server as interrupt server.  This
introduces an additional parameter to the get_irq function, called
strict_check.  Based on this parameter, if the cpu is not online
either default_distrib_server or -1 is returned.

Signed-off-by: Mohan Kumar M <mohan@in.ibm.com>
Cc: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Do firmware feature fixups after features are initialised
Michael Neuling [Fri, 8 Jun 2007 04:00:35 +0000 (14:00 +1000)]
[POWERPC] Do firmware feature fixups after features are initialised

On pSeries the firmware features are not setup until ppc_md.init_early,
so we can't do the firmware feature sections fixups till after this.

Currently firmware feature sections is only used on iSeries which inits
the firmware features much earlier.  This is a bug in waiting on
pSeries.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Fix stolen time for SMT without LPAR
Michael Neuling [Fri, 8 Jun 2007 03:18:50 +0000 (13:18 +1000)]
[POWERPC] Fix stolen time for SMT without LPAR

For POWERPC, stolen time accounts for cycles lost to the hypervisor or
PURR cycles attributed to the other SMT thread.  Hence, when a PURR is
available, we should still calculate stolen time, irrespective of being
virtualised.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Remove 'console=' from cmdline on prpmc2800
Mark A. Greer [Thu, 7 Jun 2007 00:42:28 +0000 (10:42 +1000)]
[POWERPC] Remove 'console=' from cmdline on prpmc2800

Specifying 'console=ttyMM0' on the cmdline for the prmpc2800 is no
longer necessary.

Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Call add_preferred_console when MPSC is console
Mark A. Greer [Thu, 7 Jun 2007 00:38:00 +0000 (10:38 +1000)]
[POWERPC] Call add_preferred_console when MPSC is console

When a Marvell MPSC (serial controller) port is the specified
/chosen/stdout-path device, call 'add_preferred_console()' so the user
doesn't have to specify a 'console=ttyMMx' cmdline argument.

Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Acked-by: Dale Farnsworth <dale@farnsworth.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Add for_each_compatible_node()
Michael Ellerman [Mon, 4 Jun 2007 13:00:02 +0000 (23:00 +1000)]
[POWERPC] Add for_each_compatible_node()

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Add irq_create_direct_mapping()
Michael Ellerman [Mon, 4 Jun 2007 13:00:00 +0000 (23:00 +1000)]
[POWERPC] Add irq_create_direct_mapping()

This patch adds irq_create_direct_mapping().  This routine is
an alternative to irq_create_mapping(), for irq controllers that
can use linux virq numbers directly as hardware numbers.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Split virq setup logic out into irq_setup_virq()
Michael Ellerman [Mon, 4 Jun 2007 12:59:59 +0000 (22:59 +1000)]
[POWERPC] Split virq setup logic out into irq_setup_virq()

A future patch will need the logic at the end of irq_create_mapping()
which setups a virq and installs it in the irq_map. So split it out
into a new function irq_setup_virq().

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Uninline and export virq_to_hw()
Olof Johansson [Mon, 4 Jun 2007 04:47:04 +0000 (14:47 +1000)]
[POWERPC] Uninline and export virq_to_hw()

Uninline virq_to_hw and export it so modules can use it.  The alternative
would be to export the irq_map array instead, but it's an infrequently
called function, and keeping the array unexported seems considerably
cleaner.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Update holly to use new dts wrapping feature
Mark A. Greer [Thu, 31 May 2007 19:56:15 +0000 (05:56 +1000)]
[POWERPC] Update holly to use new dts wrapping feature

The holly support currently has separate rules to wrap its device tree
with its zImage.  This can now be done automatically without the extra
rules so update holly support to use the automatic feature.

Signed-off-by: Mark A. Greer <mgreer@mista.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] When appropriate, wrap device tree with zImage
Mark A. Greer [Thu, 31 May 2007 19:55:35 +0000 (05:55 +1000)]
[POWERPC] When appropriate, wrap device tree with zImage

There are 2 config options that indicate whether the platform being built
has a device tree source file associated with it.  Namely,
CONFIG_WANT_DEVICE_TREE and CONFIG_DEVICE_TREE.  When CONFIG_WANT_DEVICE_TREE
is 'y' and CONFIG_DEVICE_TREE isn't an empty string, automatically wrap
the specified device tree with the zImage being built.

To achieve this, the 'dts' variable will only be set when the conditions
above are true.  The changes to the zImage.initrd.% and zImage.% rules
cause the device tree to be wrapped when 'dts' is set; otherwise, they
will work as they previosly did (i.e., build a zImage with no device tree).

Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Remove 'make zImage.dts' feature
Mark A. Greer [Thu, 31 May 2007 19:54:39 +0000 (05:54 +1000)]
[POWERPC] Remove 'make zImage.dts' feature

Being able to selectively wrap a device tree with the zIimage at build
time has been deemed unnecessary, so this removes Makefile support for
that feature.

Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Remove spinlock from struct cpu_purr_data
Nathan Lynch [Wed, 23 May 2007 00:51:25 +0000 (10:51 +1000)]
[POWERPC] Remove spinlock from struct cpu_purr_data

cpu_purr_data is a per-cpu array used to account for stolen time on
partitioned systems.  It used to be the case that cpus accessed each
others' cpu_purr_data, so each entry was protected by a spinlock.

However, the code was reworked ("Simplify stolen time calculation")
with the result that each cpu accesses its own cpu_purr_data and not
those of other cpus.  This means we can get rid of the spinlock as
long as we're careful to disable interrupts when accessing
cpu_purr_data in process context.

Signed-off-by: Nathan Lynch <ntl@pobox.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Don't link timer.o for powerpc systems using generic rtc
Guennadi Liakhovetski [Thu, 17 May 2007 08:56:32 +0000 (18:56 +1000)]
[POWERPC] Don't link timer.o for powerpc systems using generic rtc

With both generic rtc and powerpc timer suspend / resume code now in the
(powerpc.git) tree, powerpc platforms using the generic timer and enabling
power management will have timer.o linked in the kernel, which they don't
need. Moreover, it will likely WARN_ON(!ppc_md.get_rtc_time), save
zero-time and return no error on suspend...

As a possible solution we can choose not to build timer.o when RTC_CLASS
is enabled.  However, I can imagine systems with 2 rtc's, one served by the
ppc-rtc, another one generic built as a module, in which case using the
ppc-rtc for suspend / resume will be impossible.  Not to say, that such a
configuration would be ugly...

Signed-off-by: G. Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] pasemi: Electra IDE/pata_platform glue
Olof Johansson [Sat, 12 May 2007 14:50:41 +0000 (00:50 +1000)]
[POWERPC] pasemi: Electra IDE/pata_platform glue

Glue code to hook up the pata_platform on the PA Semi Electra eval board.
CFE sets up device tree entries for the IDE interface, with device type
'ide' and compatible field 'electra-ide'.

We unfortunately need to modify the resources before calling the generic
platform driver, since the device tree only has one register window in
it and the driver expects two.  Adding this as an of_platform driver
instead doesn't give us any benefit, it just adds one more layer of
register/probe functions.

Since CONFIG_PATA_PLATFORM depends on CONFIG_EMBEDDED, add that as a
default for PPC_PASEMI.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Use mktime in timer sysdev
Johannes Berg [Wed, 2 May 2007 14:25:42 +0000 (00:25 +1000)]
[POWERPC] Use mktime in timer sysdev

This makes the timer sysdev use mktime instead of rtc_tm_to_time,
since rtc_tm_to_time just calls mktime anyway, and this means we
don't have a dependency on rtc-lib.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] kexec: Send slaves to new kernel earlier
Milton Miller [Wed, 11 Apr 2007 08:32:17 +0000 (18:32 +1000)]
[POWERPC] kexec: Send slaves to new kernel earlier

With this, when kexec-ing, we copy the code and start the slaves on
their journey to the next kernel's spin loop as soon as we copy the
kexec image into place.

The kernel doesn't know exactly which slaves are spinning in
kexec_wait.  This allows us to pass more than max-cpus to the
next kernel.  But it also means that we might leave some behind.

Moving the code here means they have the time it takes us to
clear the hash table to wake up and move on.  Moving the code
any earlier would reuqire walking the image description to
search for the code, which could span multiple pages.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Fix problems with device tree representation of TSI-1xx bridges
David Gibson [Wed, 13 Jun 2007 04:53:00 +0000 (14:53 +1000)]
[POWERPC] Fix problems with device tree representation of TSI-1xx bridges

This fixes some problems with the way the some things
represented in the device tree for the Holly and Taiga boards.  This
means changes both to the dts files, and to the code which
instantiates the tsi108 ethernet platform devices based on the device
tree.

- First, and most importantly, the ethernet PHYs are given
with an identical 'reg' property.  This reg currently encodes the
accessible register used to initiate mdio interaction with the PHYs,
rather than a meaningful address on the parent bus (mdio in this
case), which is incorrect.  Instead we give the address of these
registers as 'reg' in the mdio node itself, and encode the ID of each
phy in their 'reg' propertyies.
- Currently the platform device constructor enables a
workaround in the tsi108 ethernet driver based on the compatible
property of the PHY.  This is incorrect, because the workaround in
question is necessary due to the board's wiring of the PHY, not the
model of PHY itself.  This patch alters the constructor to instead
enable the workaround based on a new special property in the PHY node.
- The compatible properties on a number of nodes in the device
tree are insufficiently precise.  In particular the PHYs give only
"bcm54xx", which is broken, since there are many bcm54xx PHY models,
and they have differences which matter.  The mdio had a compatible
property of "tsi-ethernet" identical to the ethernet MAC nodes, which
doesn't make sense.  The ethernet, i2c, bridge and PCI nodes were
given only as "tsi-*" which is somewhat inprecise, we replace with
"tsi108-*" in the case of Taiga (which has a TSI108 bridge), and
"tsi109-*", "tsi108-*" in the case of Holly (which has a TSI109
bridge).
- We remove some "model" properties from the ethernets on
Taiga board which were neither useful nor adequately precise.
- On Holly we change to using a dtc label instead of a full
path to reference the MPIC node, which makes the dts a little more
readable.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Don't store a command line in the Holly device tree
David Gibson [Wed, 13 Jun 2007 04:53:00 +0000 (14:53 +1000)]
[POWERPC] Don't store a command line in the Holly device tree

Currently, the Holly device tree includes a bootargs property in
/chosen, which gives a commandline.  This is somewhat inconvenient,
because it means an alternative default command line can't be given in
the kernel config - the value obtained from the dts via the
bootwrapper will always override CONFIG_CMDLINE.

This removes the command line from the dts, and instead puts the
same command line as a default in holly_defconfig.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Consolidate cuboot initialization code
David Gibson [Wed, 13 Jun 2007 04:53:00 +0000 (14:53 +1000)]
[POWERPC] Consolidate cuboot initialization code

The various cuboot platforms (i.e. pre-device tree aware u-boot for
83xx, 85xx and Ebony) share a certain amount of code for parsing the
boot parameters.  To a certain extent that's inevitable, since they
platforms have different definitions of the bd_t structure.  However,
with some macro work and a helper function, this patch improves the
situation a bit.

In the process, this fixes a bug on Ebony, which was incorrectly
handling the parameters passed form u-boot for the command line (the
bug was copied from 83xx and 85xx which have subsequently been fixed).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Derive ebc ranges property from EBC registers
David Gibson [Wed, 13 Jun 2007 04:52:59 +0000 (14:52 +1000)]
[POWERPC] Derive ebc ranges property from EBC registers

In the device tree for Ebony, the 'ranges' property in the node for
the EBC bridge shows the mappings from the chip select / address lines
actually used for the EBC peripherals into the address space of the
OPB.  At present, these mappings are hardcoded in ebony.dts for the
mappings set up by the OpenBIOS firmware when it configures the EBC
bridge.

This replaces the hardcoded mappings with code in the zImage to
read the EBC configuration registers and create an appropriate ranges
property based on them.  This should make the zImage and kernel more
robust to changes in firmware configuration.  In particular, some of
the Ebony's DIP switches can change the effective address of the Flash
and other peripherals in OPB space.  With this patch, the kernel will
be able to cope with at least some of the possible variations.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Factor zImage's 44x reset code out of ebony.c
David Gibson [Wed, 13 Jun 2007 04:52:58 +0000 (14:52 +1000)]
[POWERPC] Factor zImage's 44x reset code out of ebony.c

The ebony_exit() function which resets the Ebony board should in fact
be common to most if not all 44x boards.  This moves the function out
into 44x.c, renaming it, so it can be used by other 44x platforms.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Merge CPU features pertaining to icache coherency
David Gibson [Wed, 13 Jun 2007 04:52:57 +0000 (14:52 +1000)]
[POWERPC] Merge CPU features pertaining to icache coherency

Currently the powerpc kernel has a 64-bit only feature,
COHERENT_ICACHE used for those CPUS which maintain icache/dcache
coherency in hardware (POWER5, essentially).  It also has a feature,
SPLIT_ID_CACHE, which is used on CPUs which have separate i and
d-caches, which is to say everything except 601 and Freescale E200.

In nearly all the places we check the SPLIT_ID_CACHE, what we actually
care about is whether the i and d-caches are coherent (which they will
be, trivially, if they're the same cache).

This tries to clarify the situation a little.  The COHERENT_ICACHE
feature becomes availble on 32-bit and is set for all CPUs where i and
d-cache are effectively coherent, whether this is due to special logic
(POWER5) or because they're unified.  We check this, instead of
SPLIT_ID_CACHE nearly everywhere.

The SPLIT_ID_CACHE feature itself is replaced by a UNIFIED_ID_CACHE
feature with reversed sense, set only on 601 and Freescale E200.  In
the two places (one Freescale BookE specific) where we really care
whether it's a unified cache, not whether they're coherent, we check
this feature.  The CPUs with unified cache are so few, we could
consider replacing this feature bit with explicit checks against the
PVR.

This will make unifying the 32-bit and 64-bit cache flush code a
little more straightforward.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Kill typedef-ed structs for hash PTEs and BATs
David Gibson [Wed, 13 Jun 2007 04:52:56 +0000 (14:52 +1000)]
[POWERPC] Kill typedef-ed structs for hash PTEs and BATs

Using typedefs to rename structure types if frowned on by CodingStyle.
However, we do so for the hash PTE structure on both ppc32 (where it's
called "PTE") and ppc64 (where it's called "hpte_t").  On ppc32 we
also have such a typedef for the BATs ("BAT").

This removes this unhelpful use of typedefs, in the process
bringing ppc32 and ppc64 closer together, by using the name "struct
hash_pte" in both cases.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Start factoring pgtable-ppc32.h and pgtable-ppc64.h
David Gibson [Wed, 13 Jun 2007 04:52:56 +0000 (14:52 +1000)]
[POWERPC] Start factoring pgtable-ppc32.h and pgtable-ppc64.h

This factors some things defined in both pgtable-ppc32.h and
pgtable-ppc64.h into the common part of asm-powerpc/pgtable.h.  These
are all things which have essentially identical definitions, and which
by their nature are very unlikely ever to need different definitions
in the two cases.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>