linux-2.6-microblaze.git
16 years agopowerpc/chrp: Fix detection of Python PCI host bridge on IBM CHRPs
Benjamin Herrenschmidt [Mon, 13 Oct 2008 20:14:09 +0000 (20:14 +0000)]
powerpc/chrp: Fix detection of Python PCI host bridge on IBM CHRPs

The detection of the IBM "Python" PCI host bridge on IBM CHRP
machines such as old RS6000 was broken when we changed
of_device_is_compatible() from strncasecmp to strcasecmp (dropped
the "n" variant) due to the way IBM encodes the chip version.

We fix that by instead doing a match on the model property like
we do for others bridges in that file. It should be good enough
for those machines. If yours is still broken, let me know.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Fix 32-bit SMP boot on CHRP
Benjamin Herrenschmidt [Mon, 13 Oct 2008 18:38:48 +0000 (18:38 +0000)]
powerpc: Fix 32-bit SMP boot on CHRP

prom_init was changed to take a new argument, the address
where the kernel is loaded, which is now used to copy the
SMP spin loop down before use.

However, only head_64.S was adapted to pass this new value,
not head_32.S, thus breaking SMP boot on 32-bit SMP CHRP
machines.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Fix link errors on 32-bit machines using legacy DMA
Benjamin Herrenschmidt [Mon, 13 Oct 2008 17:51:46 +0000 (17:51 +0000)]
powerpc: Fix link errors on 32-bit machines using legacy DMA

The new merged DMA code will try to access isa_bridge_pcidev when
trying to DMA to/from legacy devices. This is however only defined
on 64-bit. Fixes this for now by adding the variable, even if it
stays NULL. In the long run, we'll make isa-bridge.c common to
32 and 64-bit.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/pci: Improve detection of unassigned bridge resources
Benjamin Herrenschmidt [Mon, 13 Oct 2008 13:56:31 +0000 (13:56 +0000)]
powerpc/pci: Improve detection of unassigned bridge resources

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: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agohvc_console: Fix free_irq in spinlocked section
Christian Borntraeger [Sun, 12 Oct 2008 21:51:31 +0000 (21:51 +0000)]
hvc_console: Fix free_irq in spinlocked section

    commit 611e097d7707741a336a0677d9d69bec40f29f3d
    Author: Christian Borntraeger <borntraeger@de.ibm.com>
    hvc_console: rework setup to replace irq functions with callbacks
    introduced a spinlock recursion problem. The notifier_del is
    called with a lock held, and in turns calls free_irq which then
    complains when manipulating procfs. This fixes it by moving the
    call to the notifier to outside of the locked section.

Signed-off-by: Christian Borntraeger<borntraeger@de.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Get USE_STRICT_MM_TYPECHECKS working again
David Gibson [Sun, 12 Oct 2008 17:54:24 +0000 (17:54 +0000)]
powerpc: Get USE_STRICT_MM_TYPECHECKS working again

The typesafe version of the powerpc pagetable handling (with
USE_STRICT_MM_TYPECHECKS defined) has bitrotted again.  This patch
makes a bunch of small fixes to get it back to building status.

It's still not enabled by default as gcc still generates worse
code with it for some reason.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Reflect the used arguments in machine_init() prototype
Sebastian Andrzej Siewior [Sun, 12 Oct 2008 04:08:14 +0000 (04:08 +0000)]
powerpc: Reflect the used arguments in machine_init() prototype

The "phys" argument to machine_init() isn't used and isn't likely to
ever be so let's remove it.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Fix DMA offset for non-coherent DMA
Benjamin Herrenschmidt [Thu, 9 Oct 2008 17:06:24 +0000 (17:06 +0000)]
powerpc: Fix DMA offset for non-coherent DMA

After Becky's work we can almost have different DMA offsets
between on-chip devices and PCI. Almost because there's a
problem with the non-coherent DMA code that basically ignores
the programmed offset to use the global one for everything.
This fixes it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agoMerge commit 'kumar/kumar-next'
Benjamin Herrenschmidt [Mon, 13 Oct 2008 23:11:38 +0000 (10:11 +1100)]
Merge commit 'kumar/kumar-next'

16 years agoMerge commit 'gcl/gcl-next'
Benjamin Herrenschmidt [Mon, 13 Oct 2008 23:11:27 +0000 (10:11 +1100)]
Merge commit 'gcl/gcl-next'

16 years agopowerpc: fix fsl_upm nand driver modular build
Anton Vorontsov [Thu, 9 Oct 2008 00:32:59 +0000 (04:32 +0400)]
powerpc: fix fsl_upm nand driver modular build

The fsl_upm nand driver fails to build because fsl_lbc_lock isn't
exported, the lock is needed by the inlined fsl_upm_run_pattern()
function:

ERROR: "fsl_lbc_lock" [drivers/mtd/nand/fsl_upm.ko] undefined!

Dave Jones purposed to export the lock, but it is better to just uninline
the fsl_upm_run_pattern().

When uninlined we also no longer need the exported fsl_lbc_regs, and
both fsl_lbc_lock and fsl_lbc_regs could be marked static.

While at it, also add some missing includes that we should have included
explicitly.

Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/83xx: add NAND support for the MPC8360E-RDK boards
Anton Vorontsov [Fri, 10 Oct 2008 18:05:12 +0000 (22:05 +0400)]
powerpc/83xx: add NAND support for the MPC8360E-RDK boards

The StMicro NAND chip (512Mbit, 64MB) is connected to the local bus,
the first local bus' user-programmable machine is configured by the
firmware to work with NAND chips.

QE GPIO pin is used to poll the NAND's Ready-Not-Busy signal.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: FPGA support for GE Fanuc SBC610
Martyn Welch [Mon, 13 Oct 2008 15:16:45 +0000 (16:16 +0100)]
powerpc: FPGA support for GE Fanuc SBC610

Support for the SBC610 VPX Single Board Computer from GE Fanuc (PowerPC
MPC8641D).

This patch adds support for the registers held in the devices main FPGA,
exposing extra information about the revision of the board through cpuinfo.

Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agoi2c: MPC8349E-mITX Power Management and GPIO expander driver
Anton Vorontsov [Tue, 23 Sep 2008 14:13:00 +0000 (18:13 +0400)]
i2c: MPC8349E-mITX Power Management and GPIO expander driver

On MPC8349E-mITX, MPC8315E-RDB and MPC837x-RDB boards there is a
Freescale MC9S08QG8 (MCU) chip with the custom firmware
pre-programmed. The chip is used to power-off the board by the
software, and to control some GPIO pins.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: reserve two DMA channels for audio in MPC8610 HPCD device tree
Timur Tabi [Fri, 10 Oct 2008 16:52:32 +0000 (11:52 -0500)]
powerpc: reserve two DMA channels for audio in MPC8610 HPCD device tree

The Freescale Elo DMA driver binds to all DMA channels in the device tree that
are compatible with "fsl,eloplus-dma-channel".  This conflicts with the sound
drivers for the MPC8610 HPCD.  On this board, the SSI uses two DMA channels and
therefore those channels are not available for general purpose use.  We
change the compatible properties for these channels "fsl,ssi-dma-channel".
This works because the sound drivers don't actually check the compatible
property when it grabs channels.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: document the "fsl,ssi-dma-channel" compatible property
Timur Tabi [Fri, 10 Oct 2008 16:52:31 +0000 (11:52 -0500)]
powerpc: document the "fsl,ssi-dma-channel" compatible property

The "fsl,ssi-dma-channel" compatible property is used to specify a DMA channel
on the Freescale Elo DMA controller that should be used exclusively by the
Freescale SSI audio controller.  When a property is marked as such, the Elo
DMA driver will ignore it, and so it will be available for the sound drivers.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: disable CHRP and PMAC support in various defconfigs
Timur Tabi [Fri, 10 Oct 2008 15:35:50 +0000 (10:35 -0500)]
powerpc: disable CHRP and PMAC support in various defconfigs

Because CHRP and PMAC are by default enabled, several non-CHRP and non-PMAC
PowerPC defconfigs will have these Kconfig options set erroneously.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agoOF: add fsl,mcu-mpc8349emitx to the exception list
Anton Vorontsov [Tue, 23 Sep 2008 14:12:19 +0000 (18:12 +0400)]
OF: add fsl,mcu-mpc8349emitx to the exception list

of/base.c matches on the first (most specific) entries, which isn't
quite practical but it was discussed[1] that this won't change.

The bindings specifies verbose information for the devices, but
it doesn't fit in the I2C ID's 20 characters limit. The limit won't
change[2], and the bindings won't change either as they're correct.

So we have to put an exception for the MPC8349E-mITX-compatible
MCUs.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/83xx: add DS1374 RTC support for the MPC837xE-MDS boards
Anton Vorontsov [Wed, 8 Oct 2008 18:16:05 +0000 (22:16 +0400)]
powerpc/83xx: add DS1374 RTC support for the MPC837xE-MDS boards

The RTC is sitting on the I2C1 bus at address 0x68. RTC interrupt signal
is connected to the IPIC's EXT3 interrupt line.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: remove support for bootmem-allocated memory for the DIU driver
Timur Tabi [Tue, 23 Sep 2008 14:47:01 +0000 (09:47 -0500)]
powerpc: remove support for bootmem-allocated memory for the DIU driver

Early versions of the Freescale DIU framebuffer driver depended on a bootmem
allocation of memory for the video buffer.  The need for this feature was
removed in commit 6b51d51a, so now we can remove the platform-specific code
that allocated that memory.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: remove non-dependent load fsl_booke PTE_64BIT
Milton Miller [Fri, 10 Oct 2008 11:56:52 +0000 (06:56 -0500)]
powerpc: remove non-dependent load fsl_booke PTE_64BIT

b38fd42ff46a4a31dced8533e8a6e549693500b6 added false dependencys
to order the load of upper and lower halfs of the pte, but only
adjusted whitespace instead of deleting the old load in the iside
handler, letting the hardware see the non-dependent load.

This patch removes the extra load.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/5121: Add PCI support.
John Rigby [Tue, 7 Oct 2008 21:13:18 +0000 (15:13 -0600)]
powerpc/5121: Add PCI support.

Uses mpc83xx_add_bridge in fsl_pci.c

Adds second register tuple to pci node register property
as done for 83xx device trees in a previous patch.

Signed-off-by: John Rigby <jrigby@freescale.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: 83xx: pci: Remove need for get_immrbase from mpc83xx_add_bridge.
John Rigby [Tue, 7 Oct 2008 19:00:18 +0000 (13:00 -0600)]
powerpc: 83xx: pci: Remove need for get_immrbase from mpc83xx_add_bridge.

Modify mpc83xx_add_bridge to get config space register base address from
the device tree instead of immr + hardcoded offset.

83xx pci nodes have this change:
    register properties now contain two address length tuples:
First is the pci bridge register base, this has always been there.
Second is the config base, this is new.

This is documented in dts-bindings/fsl/83xx-512x-pci.txt

The changes accomplish these things:
    mpc83xx_add_bridge no longer needs to call get_immrbase
    it uses hard coded addresses if the second register value is missing

Signed-off-by: John Rigby <jrigby@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/fsl: Hide MPC5121 pci bridge.
John Rigby [Tue, 7 Oct 2008 19:00:20 +0000 (13:00 -0600)]
powerpc/fsl: Hide MPC5121 pci bridge.

The class of the MPC5121 pci host bridge is PCI_CLASS_BRIDGE_OTHER
while other freescale host bridges have class set to
PCI_CLASS_PROCESSOR_POWERPC.

This patch makes fixup_hide_host_resource_fsl match
PCI_CLASS_BRIDGE_OTHER in addition to PCI_CLASS_PROCESSOR_POWERPC.

Signed-off-by: John Rigby <jrigby@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/83xx: don't probe broken PCI on mpc837x_mds boards
Anton Vorontsov [Mon, 6 Oct 2008 17:08:39 +0000 (21:08 +0400)]
powerpc/83xx: don't probe broken PCI on mpc837x_mds boards

In the standalone setup the board's CPLD disables the PCI internal
arbiter, thus any access to the PCI bus will hang the board.

The common way to disable particular devices in the device tree is to
put the "status" property with any value other than "ok" or "okay"
into the device node we want to disable.

So, when there is no PCI arbiter on the bus the u-boot adds status =
"broken (no arbiter)" property into the PCI controller's node, and so
marks the PCI controller as unavailable.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/QE: move QE_GPIO Kconfig symbol into the platforms/Kconfig
Anton Vorontsov [Fri, 3 Oct 2008 19:40:36 +0000 (23:40 +0400)]
powerpc/QE: move QE_GPIO Kconfig symbol into the platforms/Kconfig

Specifying user-selectable option in the qe_lib/Kconfig was a bad idea
because the qe_lib/Kconfig is included into the top level Kconfig, and
thus the QE_GPIO option appears at the top level menu.

This patch effectively moves the QE_GPIO option under the platform menu
instead.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: make Freescale QE support a selectable Kconfig option
Timur Tabi [Fri, 3 Oct 2008 16:14:10 +0000 (11:14 -0500)]
powerpc: make Freescale QE support a selectable Kconfig option

Modify the Kconfig so that Freescale QUICC Engine (QE) support is a selectable
option, thereby allowing users to compile kernels without any QE support.

The drawback is that QE support is now disabled by default on platforms that
have a QE, and so a defconfig is needed to enable QE and QE devices (like
UCC GETH).  Fortunately, all the current relevant defconfigs do that already.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: GE Fanuc's FPGA based PIC controller on the SBC610
Martyn Welch [Wed, 1 Oct 2008 08:32:39 +0000 (09:32 +0100)]
powerpc: GE Fanuc's FPGA based PIC controller on the SBC610

Support for the SBC610 VPX Single Board Computer from GE Fanuc (PowerPC MPC8641D).

A number of MPC8641D based route interrupts for on-board interrupts through
a FPGA based interrupt controller, which is chained with the
MPC8641D's mpic. This patch provides a basic driver to allow basic routing
of interrupts to the mpic.

Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/85xx: Wire up RTC interrupt on MPC8536DS
Kumar Gala [Thu, 2 Oct 2008 08:58:08 +0000 (03:58 -0500)]
powerpc/85xx: Wire up RTC interrupt on MPC8536DS

Add interrupt info to the MPC8536DS .dts for the RTC

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/smp: No need to set_need_resched when getting a resched IPI
Milton Miller [Fri, 10 Oct 2008 01:56:45 +0000 (01:56 +0000)]
powerpc/smp: No need to set_need_resched when getting a resched IPI

The comment in the code was asking "Do we have to do this?", and according
to x86 and s390 the answer is no, the scheduler will do it before calling
the arch hook.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/xics: Reduce and comment xics IPI use of memory barriers
Milton Miller [Fri, 10 Oct 2008 01:56:44 +0000 (01:56 +0000)]
powerpc/xics: Reduce and comment xics IPI use of memory barriers

A single full sync (mb()) is requrired to order the mmio to the qirr reg
with the set or clear of the message word.  However, test_and_clear_bit
has the effect of smp_mb() and we are not doing any other io from here,
so we don't need a mb per bit processed.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/xics: Make printk format strings fit on one line
Milton Miller [Fri, 10 Oct 2008 01:56:39 +0000 (01:56 +0000)]
powerpc/xics: Make printk format strings fit on one line

Several printks were broken at word boundaries for line length.   Some
even referred to old function names.   Using __func__ and changing the
text slightly for the format allows these printk formats to fit on one
line.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/xics: Mark xics IPI interrupt as per-cpu
Milton Miller [Fri, 10 Oct 2008 01:56:39 +0000 (01:56 +0000)]
powerpc/xics: Mark xics IPI interrupt as per-cpu

It is physically per-cpu, and we want the irq layer to treat it that way.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/xics: EOI xics ipi by hand in kexec
Milton Miller [Fri, 10 Oct 2008 01:56:35 +0000 (01:56 +0000)]
powerpc/xics: EOI xics ipi by hand in kexec

EOI normally has the side effect of returning the cpu to the base
priority to recieve the next interrupt.  This is actually controlled
by the top byte of the xirr register.   When we are exiting the
kernel in kexec we must eoi the ipi for the next kernel because we
never return from the handler, but we want to leave interrupt
delivery blocked until the next kernel takes action.

Since the hardware ipi vector is fixed, its easiest to just do the
eoi explicitly.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/xics: Factor out cpu joining/unjoining the GIQ
Milton Miller [Fri, 10 Oct 2008 01:56:34 +0000 (01:56 +0000)]
powerpc/xics: Factor out cpu joining/unjoining the GIQ

This factors out processors joining and unjoining the Global Interrupt
Queue into a separate function.

There is a bit of math to calculate the arguments to rtas to join
or leave the global interrupt queue, and a warning on failure
afterwards.  Make a helper for the 3 callers.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/xics: Initialization code cleanups
Milton Miller [Fri, 10 Oct 2008 01:56:33 +0000 (01:56 +0000)]
powerpc/xics: Initialization code cleanups

We only need to check the ibm,interrupt-server#-size property once, not
once per global server and thread.

We can use !CONFIG_SMP cpu masks and hard_smp_processor_id() to avoid an ifdef.
Put the node when breaking out of the loop on lpar systems.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/xics: Trim #include list
Milton Miller [Fri, 10 Oct 2008 01:56:33 +0000 (01:56 +0000)]
powerpc/xics: Trim #include list

Trim unneeded includes from xics.c.  We don't use signals or gfp
flags, we use only OF functions and don't need prom, and the 8259
is now handled by our caller.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/xics: Change *_xirr_info_set() prototype to avoid casts
Milton Miller [Fri, 10 Oct 2008 01:56:32 +0000 (01:56 +0000)]
powerpc/xics: Change *_xirr_info_set() prototype to avoid casts

The xirr is 32 bits in hardware, but the hypervisor requries the upper
bits of the register to be clear on the hcall.  By changing the type
from signed to unsigned int we can drop masking it back to 32 bits.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/xics: Rearrange file to group code by function
Milton Miller [Fri, 10 Oct 2008 01:56:30 +0000 (01:56 +0000)]
powerpc/xics: Rearrange file to group code by function

Now that xics_update_irq_servers is called only from init and hotplug
code, it becomes possible to clean up the ordering of functions in the
file, grouping them but the interfaces they implement.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/xics: Consolidate ipi message encode and decode
Milton Miller [Fri, 10 Oct 2008 01:56:29 +0000 (01:56 +0000)]
powerpc/xics: Consolidate ipi message encode and decode

xics supports only one ipi per cpu, and expects software to use some
queue to know why the interrupt was sent.  In Linux, we use a an array
of bitmaps indexed by cpu to identify the message.  Currently the bits
are set in smp.c and decoded in xics.c, with the data structure in a
header file.   Consolidate the code in xics.c similar to mpic and other
interrupt controllers.

Also, while making the the array static, the message word doesn't need
to be volatile as set_bit and test_clear_bit take care of it for us, and
put it under ifdef smp.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Make ppc32 respect the boot cpu id for !CONFIG_SMP
Kumar Gala [Fri, 10 Oct 2008 09:44:33 +0000 (09:44 +0000)]
powerpc: Make ppc32 respect the boot cpu id for !CONFIG_SMP

Previously the FDT header field boot_cpuid_phys wasn't actually used
on ppc32.  Instead the physical boot cpuid was assumed to be 0 for
!CONFIG_SMP.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Remove old Makefile workaround for arch/ppc
Josh Boyer [Fri, 10 Oct 2008 08:53:21 +0000 (08:53 +0000)]
powerpc: Remove old Makefile workaround for arch/ppc

There is an old workaround in the sysdev/Makefile for dealing
with arch/ppc vs. arch/powerpc compiles.  This is no longer
needed as arch/ppc is dead.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agoof: Add new helper of_parse_phandles_with_args()
Anton Vorontsov [Fri, 10 Oct 2008 04:43:17 +0000 (04:43 +0000)]
of: Add new helper of_parse_phandles_with_args()

The helper is factored out of of_get_gpio(). Will be used by the QE
pin multiplexing functions (they need to parse the gpios = <> too).

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/xics: Update default_server during migrate_irqs_away
Milton Miller [Fri, 10 Oct 2008 01:56:28 +0000 (01:56 +0000)]
powerpc/xics: Update default_server during migrate_irqs_away

Currently, every time we determine which irq server to use, we check if
default_server, which is the id of the bootcpu, is still online.  But
default_server is a hardware cpu, not the logical cpu id needed to index
cpu_online_map.

Since the default server can only go offline during a cpu hotplug event,
explicitly check the default server and choose the new one when we move
irqs away from the cpu being offlined.

This has the added benefit of only needing the boot_cpuid to be updated
and not relying on the cpu being marked offline during migrate_irqs_away.

Also, since xics_update_irq_servers only reads device tree information, we
can call it before xics_init_host in xics_init_IRQ and then default_server
will always be valid when we can reach get_irq_server via the host ops.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/xics: EOI unmapped irqs after disabling them
Milton Miller [Fri, 10 Oct 2008 01:56:23 +0000 (01:56 +0000)]
powerpc/xics: EOI unmapped irqs after disabling them

When reciving an irq vector that does not have a linux mapping, the kernel
prints a message and calls RTAS to disable the irq source.   Previously
the kernel did not EOI the interrupt, causing the source to think it is
still being processed by software.  While this does add an additional
layer of protection against interrupt storms had RTAS failed to disable
the source, it also prevents the interrupt from working when a driver
later enables it.  (We could alternatively send an EOI on startup, but
that strategy would likely fail on an emulated xics.)

All interrupts should be disabled when the kernel starts, but this can
be observed if a driver does not shutdown an interrupt in its reboot
hook before starting a new kernel with kexec.

Michael reports this can be reproduced trivially by banging the keyboard
while kexec'ing on a P5 LPAR: even though the hvc_console driver request's
the console irq later in boot, the console is non-functional because
we're receiving no console interrupts.

Reported-By: Michael Ellerman
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agoMerge commit 'jk/jk-merge'
Benjamin Herrenschmidt [Fri, 10 Oct 2008 04:56:16 +0000 (15:56 +1100)]
Merge commit 'jk/jk-merge'

16 years agopowerpc: Reserve in bootmem lmb reserved regions that cross NUMA nodes
Jon Tollefson [Thu, 9 Oct 2008 10:18:40 +0000 (10:18 +0000)]
powerpc: Reserve in bootmem lmb reserved regions that cross NUMA nodes

If there are multiple reserved memory blocks via lmb_reserve() that are
contiguous addresses and on different NUMA nodes we are losing track of which
address ranges to reserve in bootmem on which node.  I discovered this
when I recently got to try 16GB huge pages on a system with more then 2 nodes.

When scanning the device tree in early boot we call lmb_reserve() with
the addresses of the 16G pages that we find so that the memory doesn't
get used for something else.  For example the addresses for the pages
could be 4000000000440000000048000000004C00000000, etc - 8 pages,
one on each of eight nodes.  In the lmb after all the pages have been
reserved it will look something like the following:

lmb_dump_all:
    memory.cnt            = 0x2
    memory.size           = 0x3e80000000
    memory.region[0x0].base       = 0x0
                      .size     = 0x1e80000000
    memory.region[0x1].base       = 0x4000000000
                      .size     = 0x2000000000
    reserved.cnt          = 0x5
    reserved.size         = 0x3e80000000
    reserved.region[0x0].base       = 0x0
                      .size     = 0x7b5000
    reserved.region[0x1].base       = 0x2a00000
                      .size     = 0x78c000
    reserved.region[0x2].base       = 0x328c000
                      .size     = 0x43000
    reserved.region[0x3].base       = 0xf4e8000
                      .size     = 0xb18000
    reserved.region[0x4].base       = 0x4000000000
                      .size     = 0x2000000000

The reserved.region[0x4] contains the 16G pages.  In
arch/powerpc/mm/num.c: do_init_bootmem() we loop through each of the
node numbers looking for the reserved regions that belong to the
particular node.  It is not able to identify region 0x4 as being a part
of each of the 8 nodes.  It is assuming that a reserved region is only
on a single node.

This patch takes out the reserved region loop from inside
the loop that goes over each node.  It looks up the active region containing
the start of the reserved region.  If it extends past that active region then
it adjusts the size and gets the next active region containing it.

Signed-off-by: Jon Tollefson <kniht@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Sync RPA note in zImage with kernel's RPA note
Paul Mackerras [Wed, 8 Oct 2008 14:03:29 +0000 (14:03 +0000)]
powerpc: Sync RPA note in zImage with kernel's RPA note

Commit 9b09c6d909dfd8de96b99b9b9c808b94b0a71614 ("powerpc: Change the
default link address for pSeries zImage kernels") changed the
real-base value in the CHRP note added by the addnote program from
12MB to 32MB to give more space for Open Firmware to load the zImage.
(The real-base value says where we want OF to position itself in
memory.)  However, this change was ineffective on most pSeries
machines, because the RPA note added by addnote has the "ignore me"
flag set to 1.  This was intended to tell OF to ignore just the RPA
note, but has the side effect of also making OF ignore the CHRP note
(at least on most pSeries machines).

To solve this we have to set the "ignore me" flag to 0 in the RPA
note.  (We can't just omit the RPA note because that is equivalent to
having an RPA note with default values, and the default values are not
what we want.)  However, then we have to make sure the values in the
zImage's RPA note match up with the values that the kernel supplies
later in prom_init.c with either the ibm,client-architecture-support
call or the process-elf-header call in prom_send_capabilities().

So this sets the "ignore me" flag in the RPA note in addnote to 0, and
adjusts the RPA note values in addnote.c and in prom_init.c to be
consistent with each other and with the values in ibm_architecture_vec.

However, since the wrapper is independent of the kernel, this doesn't
ensure that the notes will stay consistent.  To ensure that, this adds
code to addnote.c so that it can extract the kernel's RPA note from
the kernel binary and put that in the zImage.  To that end, we put the
kernel's fake ELF header (which contains the kernel's RPA note) into
its own section, and arrange for wrapper to pull out that section with
objcopy and pass it to addnote, which then extracts the RPA note from
it and transfers it to the zImage.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/of-bindings: Don't support linux,<modalias> "compatible" values
Grant Likely [Wed, 8 Oct 2008 05:05:29 +0000 (05:05 +0000)]
powerpc/of-bindings: Don't support linux,<modalias> "compatible" values

Compatible property values in the form linux,<modalias> is not documented
anywhere and using it leaks Linux implementation details into the device
tree data (which is bad).  Remove support for compatible values of this
form.

If any platforms exist which depended on this code (and I don't know of
any), then they can be fixed up by adding legacy translations to the
lookup table in this file.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Fix error path in kernel_thread function
Josh Poimboeuf [Tue, 7 Oct 2008 06:10:03 +0000 (06:10 +0000)]
powerpc: Fix error path in kernel_thread function

The powerpc 32-bit and 64-bit kernel_thread functions don't properly
propagate errors being returned by the clone syscall.  (In the case of
error, the syscall exit code returns a positive errno in r3 and sets
the CR0[SO] bit.)

This patch fixes that by negating r3 if CR0[SO] is set after the syscall.

Signed-off-by: Josh Poimboeuf <jpoimboe@us.ibm.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/cell/oprofile: Fix test on overlay_tbl_offset in vma_map
Roel Kluin [Mon, 6 Oct 2008 22:38:33 +0000 (22:38 +0000)]
powerpc/cell/oprofile: Fix test on overlay_tbl_offset in vma_map

Offset is unsigned and when an address isn't found in the vma map
vma_map_lookup() returns the vma physical address + 0x10000000.

vma_map_lookup used to return 0xffffffff on a failed lookup, but
a change was made to return the vma physical address + 0x10000000
There are two callers of vam_map_lookup: one of them correctly
deals with this new return value, but the other (below) did not.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Acked-by: Maynard Johnson <maynardj@us.ibm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Fix no interrupt handling in pata_of_platform
Anton Vorontsov [Mon, 6 Oct 2008 07:26:54 +0000 (07:26 +0000)]
powerpc: Fix no interrupt handling in pata_of_platform

When no interrupt is specified the pata_of_platform fills the irq_res
resource with -1, which is wrong to do for two reasons:

1. By definition, 'no irq' should be IRQ 0, not some negative integer;
2. pata_platform checks for irq_res.start > 0, but since irq_res.start
   is unsigned type, the check will be true for `-1'.

Reported-by: Steven A. Falco <sfalco@harris.com>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Oops in pseries_lmb_remove()
Nathan Fontenot [Wed, 1 Oct 2008 09:44:02 +0000 (09:44 +0000)]
powerpc: Oops in pseries_lmb_remove()

Testing hotplug memory remove has revealed that we can oops in
pseries_lmb_remove().  The incorrect shift causes a NULL pointer
dereference in the page_zone() inline routine.

I have only been able to reproduce the oops on kernels with large pages
enabled.

Tested on Power5 and Power6 with and without large pages enabled.

Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/spufs: add a missing mutex_unlock
Kou Ishizaki [Wed, 8 Oct 2008 23:45:49 +0000 (10:45 +1100)]
powerpc/spufs: add a missing mutex_unlock

A mutex_unlock(&gang->aff_mutex) in spufs_create_context() is missing
in case spufs_context_open() fails.  As a result, spu_create syscall
and spu_get_idle() may block.

This patch adds the mutex_unlock.

Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Acked-by: Andre Detsch <adetsch@br.ibm.com>
16 years agopowerpc/spufs: use inc_nlink
Jeremy Kerr [Wed, 8 Oct 2008 23:39:21 +0000 (10:39 +1100)]
powerpc/spufs: use inc_nlink

Style change: use inc_nlink instead of incrementing i_nlink directly

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
16 years agopowerpc/spufs: set nlink count for spufs root correctly
Jeremy Kerr [Tue, 7 Oct 2008 07:26:55 +0000 (18:26 +1100)]
powerpc/spufs: set nlink count for spufs root correctly

Currently, an empty spufs root inode has nlink count of 1. However,
the directory has two links; / -> spu and /spu/ -> .

This change increments the link count of the root inode in spufs.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
16 years agoOF: add fsl,mcu-mpc8349emitx to the exception list
Anton Vorontsov [Tue, 23 Sep 2008 10:12:19 +0000 (14:12 +0400)]
OF: add fsl,mcu-mpc8349emitx to the exception list

of/base.c matches on the first (most specific) entries, which isn't
quite practical but it was discussed[1] that this won't change.

The bindings specifies verbose information for the devices, but
it doesn't fit in the I2C ID's 20 characters limit. The limit won't
change[2], and the bindings won't change either as they're correct.

So we have to put an exception for the MPC8349E-mITX-compatible
MCUs.

[1] http://www.mail-archive.com/linuxppc-dev@ozlabs.org/msg21196.html
[2] http://www.nabble.com/-PATCH-1-2--i2c:-expand-I2C's-id.name-to-23-characters-td19577063.html

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
16 years agopowerpc/mpc5200: Silence warnings in arch/powerpc/platforms/52xx/mpc52xx_pci.c
Tony Breeds [Wed, 8 Oct 2008 17:36:57 +0000 (11:36 -0600)]
powerpc/mpc5200: Silence warnings in arch/powerpc/platforms/52xx/mpc52xx_pci.c

Explicitly cast resource fields to unsigned long long, and match format
specifier.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
16 years agoi2c-mpc: suppress I2C device probing
Wolfgang Grandegger [Wed, 8 Oct 2008 17:36:42 +0000 (11:36 -0600)]
i2c-mpc: suppress I2C device probing

This patch suppresses I2C device probing by clearing the class field
of the "struct i2c_adapter" for the MPC I2C bus adapters. Some board
configurations which rely on probing must be fixed up by adding a
proper I2C device node to the DTS file, like the TQM85xx modules.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
16 years agopowerpc/mpc5200: trivial printk-fixes in mpc52xx_common
Wolfram Sang [Wed, 8 Oct 2008 17:36:21 +0000 (11:36 -0600)]
powerpc/mpc5200: trivial printk-fixes in mpc52xx_common

- one printk was missing a loglevel
- remove double space while we are here

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
16 years agopowerpc/mpc5200: fix build warnings on mpc52xx_psc_spi driver
Grant Likely [Wed, 8 Oct 2008 15:02:11 +0000 (09:02 -0600)]
powerpc/mpc5200: fix build warnings on mpc52xx_psc_spi driver

The register definitions have been changed for the mpc5200 PSC ports
to cover some of the changes in the mpc5200b.  One change is that the
ccr register is now a u32 instead of a u16.  However, for the purposes
of this driver we want to continue to use 16 bit access to avoid
changing the existing (working) behaviour.

This patch allows the driver to continue to do 16 bit accesses without
the compiler complaining about it.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
16 years agopowerpc: Fix sysfs pci mmap on 32-bit machines with 64-bit PCI
Benjamin Herrenschmidt [Wed, 1 Oct 2008 15:30:04 +0000 (15:30 +0000)]
powerpc: Fix sysfs pci mmap on 32-bit machines with 64-bit PCI

When manipulating 64-bit PCI addresses, the code would lose the
top 32-bit in a couple of places when shifting a pfn due to missing
type casting from the 32-bit pfn to a 64-bit resource before the
shift.

This breaks using newer X servers for example on 440 machines
with the PCI bus above 32-bit.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Honor O_NONBLOCK flag when reading RTAS log
Vitaly Mayatskikh [Sun, 28 Sep 2008 23:24:33 +0000 (23:24 +0000)]
powerpc: Honor O_NONBLOCK flag when reading RTAS log

rtas_log_read() doesn't check file flags for O_NONBLOCK and blocks
non-blocking readers of /proc/ppc64/rtas/error_log when there is
no data available. This fixes it.

Also rtas_log_read() returns now with ENODATA to prevent suspending of
process in wait_event_interruptible() when logging facility was
switched off and log is already empty.

Signed-off-by: Vitaly Mayatskikh <v.mayatskih@gmail.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Remove CHRP and PMAC support from FSL defconfigs
Timur Tabi [Fri, 26 Sep 2008 07:19:46 +0000 (07:19 +0000)]
powerpc: Remove CHRP and PMAC support from FSL defconfigs

Fix various defconfigs for Freescale chip based boards to remove
CONFIG_PPC_PMAC or CONFIG_PPC_CHRP which crept in due to those
being default y

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Enforce sane MAX_ORDER
Johannes Berg [Wed, 24 Sep 2008 04:29:08 +0000 (04:29 +0000)]
powerpc: Enforce sane MAX_ORDER

powerpc uses CONFIG_FORCE_MAX_ZONEORDER, and some things depend on it
being at least 10 when 64k pages are not configured (notably the dart
iommu code with CONFIG_PM). The defaults are fine, but when going from a
64K pages config to one without 64K pages, MAX_ORDER stays at 9 which is
too low for 4K pages.

This patch makes the Kconfig enforce at least the defaults.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Fix 64-bit hibernation with 64k pages
Johannes Berg [Wed, 24 Sep 2008 04:01:09 +0000 (04:01 +0000)]
powerpc: Fix 64-bit hibernation with 64k pages

A bug in my initial 64-bit hibernation code breaks it when using
page sizes that aren't 4K.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/iseries: Remove unused variable in viodasd.c
Johann Felix Soden [Sun, 21 Sep 2008 09:02:36 +0000 (09:02 +0000)]
powerpc/iseries: Remove unused variable in viodasd.c

The variable statindex in send_request is never read, so remove it.

Signed-off-by: Johann Felix Soden <johfel@users.sourceforge.net>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Remove outdated Documentation/powerpc/smp.txt
Geert Uytterhoeven [Mon, 15 Sep 2008 23:10:54 +0000 (23:10 +0000)]
powerpc: Remove outdated Documentation/powerpc/smp.txt

Documentation/powerpc/smp.txt is so outdated that it makes sense to just
remove it.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Remove remains of /proc/ppc_htab
Geert Uytterhoeven [Mon, 15 Sep 2008 23:09:08 +0000 (23:09 +0000)]
powerpc: Remove remains of /proc/ppc_htab

commit 14cf11af6cf608eb8c23e989ddb17a715ddce109 ("powerpc: Merge enough to
start building in arch/powerpc.") unwired /proc/ppc_htab, and commit
917f0af9e5a9ceecf9e72537fabb501254ba321d ("powerpc: Remove arch/ppc and
include/asm-ppc") removed the rest of the /proc/ppc_htab support, but there are
still a few references left. Kill them for good.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Avoid integer overflow in page_is_ram()
Roland Dreier [Mon, 15 Sep 2008 10:43:35 +0000 (10:43 +0000)]
powerpc: Avoid integer overflow in page_is_ram()

Commit 8b150478 ("ppc: make phys_mem_access_prot() work with pfns
instead of addresses") fixed page_is_ram() in arch/ppc to avoid overflow
for addresses above 4G on 32-bit kernels.  However arch/powerpc's
page_is_ram() is missing the same fix -- it computes a physical address
by doing pfn << PAGE_SHIFT, which overflows if pfn corresponds to a page
above 4G.

In particular this causes pages above 4G to be mapped with the wrong
caching attribute; for example many ppc440-based SoCs have PCI space
above 4G, and mmap()ing MMIO space may end up with a mapping that has
caching enabled.

Fix this by working with the pfn and avoiding the conversion to
physical address that causes the overflow.  This patch compares the
pfn to max_pfn, which is a semantic change from the old code -- that
code compared the physical address to high_memory, which corresponds
to max_low_pfn.  However, I think that was is another bug, since
highmem pages are still RAM.

Reported-by: vb <vb@vsbe.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Ignore generated vmlinux.lds in git
Sebastien Dugue [Sun, 14 Sep 2008 21:50:18 +0000 (21:50 +0000)]
powerpc: Ignore generated vmlinux.lds in git

Add a .gitignore in arch/powerpc/kernel to ignore the generated
vmlinux.lds.

Signed-off-by: Sebastien Dugue <sebastien.dugue@bull.net>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agoMerge commit 'jwb/jwb-next'
Benjamin Herrenschmidt [Tue, 7 Oct 2008 00:15:07 +0000 (11:15 +1100)]
Merge commit 'jwb/jwb-next'

16 years agopowerpc/44x: Add AMCC Arches defconfig file
Victor Gallardo [Thu, 2 Oct 2008 06:29:26 +0000 (23:29 -0700)]
powerpc/44x: Add AMCC Arches defconfig file

Add a defconfig for the AMCC Arches evaluation board

Signed-off-by: Victor Gallardo <vgallardo@amcc.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
16 years agopowerpc/44x: Add AMCC Arches DTS
Victor Gallardo [Thu, 2 Oct 2008 06:29:16 +0000 (23:29 -0700)]
powerpc/44x: Add AMCC Arches DTS

Basic functionality for the AMCC Arches eval Board.

Signed-off-by: Victor Gallardo <vgallardo@amcc.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
16 years agopowerpc/44x: Add AMCC Arches eval board support
Victor Gallardo [Thu, 2 Oct 2008 06:29:06 +0000 (23:29 -0700)]
powerpc/44x: Add AMCC Arches eval board support

The Arches Evaluation board is based on the AMCC 460GT SoC chip.
This board is a dual processor board with each processor providing
independent resources for Rapid IO, Gigabit Ethernet, and serial
communications.  Each 460GT has it's own 512MB DDR2 memory, 32MB NOR FLASH,
UART, EEPROM and temperature sensor, along with a shared debug port.
The two 460GT's will communicate with each other via shared memory,
Gigabit Ethernet and x1 PCI-Express.

Signed-off-by: Victor Gallardo <vgallardo@amcc.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
16 years agoibm_newemac: Add support for GPCS, SGMII and M88E1112 PHY
Victor Gallardo [Thu, 2 Oct 2008 06:37:57 +0000 (23:37 -0700)]
ibm_newemac: Add support for GPCS, SGMII and M88E1112 PHY

Add support for the phy types found on the Arches and other
PowerPC 460 based boards.

Signed-off-by: Victor Gallardo <vgallardo@amcc.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
16 years agopowerpc/4xx: Allow 4xx PCI bridge to be disabled via device tree
Matthias Fuchs [Wed, 10 Sep 2008 05:55:46 +0000 (05:55 +0000)]
powerpc/4xx: Allow 4xx PCI bridge to be disabled via device tree

This patch allows the 4xx (conventional) PCI bridge to be disabled
via the device tree. This is needed for 4xx PCI adapter hardware.

Use the PCI node's status property to disable the PCI bridge.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
16 years agoMerge commit 'kumar/kumar-mmu'
Benjamin Herrenschmidt [Thu, 2 Oct 2008 06:11:49 +0000 (16:11 +1000)]
Merge commit 'kumar/kumar-mmu'

16 years agoMerge commit 'kumar/kumar-dma'
Benjamin Herrenschmidt [Thu, 2 Oct 2008 06:11:44 +0000 (16:11 +1000)]
Merge commit 'kumar/kumar-dma'

16 years agopowerpc/math-emu: Use kernel generic math-emu code
Kumar Gala [Wed, 4 Jun 2008 07:59:29 +0000 (02:59 -0500)]
powerpc/math-emu: Use kernel generic math-emu code

The math emulation code is centered around a set of generic macros that
provide the core of the emulation that are shared by the various
architectures and other projects (like glibc).  Each arch implements its
own sfp-machine.h to specific various arch specific details.

For historic reasons that are now lost the powerpc math-emu code had
its own version of the common headers.  This moves us to using the
kernel generic version and thus getting fixes when those are updated.

Also cleaned up exception/error reporting from the FP emulation functions.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agoibm_newemac: MAL support for PowerPC 405EZ
Josh Boyer [Thu, 4 Sep 2008 04:08:20 +0000 (04:08 +0000)]
ibm_newemac: MAL support for PowerPC 405EZ

The PowerPC 405EZ SoC has some differences in the interrupt layout and
handling for the MAL.  The SERR, TXDE, and RXDE interrupts are OR'd into
a single interrupt.  Also, due to the possibility for interrupt coalescing,
the TXEOB and RXEOB interrupts require an interrupt bit to be cleared in
the ICINTSTAT SDR.

This sets the proper MAL feature bits for 405EZ boards, and adds a common
shared handler for SERR, TXDE, and RXDE.  The defines for the ICINTSTAT DCR
are added to the proper header file as well.

This has been adapted from code originally written by Stefan Roese.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
16 years agoibm_newemac: Introduce mal_has_feature
Josh Boyer [Thu, 4 Sep 2008 04:03:45 +0000 (04:03 +0000)]
ibm_newemac: Introduce mal_has_feature

There are some PowerPC SoCs that do odd things with the MAL handling.  In
order to accommodate them, we need to introduce a feature mechanism that is
similar to the existing emac_has_feature function.

This adds a feature variable to the mal_instance structure, and adds a
mal_has_feature function.  Two features are defined and are guarded
by Kconfig options that are selected by the affected platforms.

MAL_FTR_CLEAR_ICINSTAT is used for platforms that need to clear the
interrupt bits in the ICINTSTAT SDR for txeob/rxeob.  This is common
on MAL implementations that have interrupt coalescing.

MAL_FTR_COMMON_ERR_INT is used for platforms that have SERR, TXDE,
and RXDE OR'd into a single interrupt bit.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
16 years agoibm_newemac: Allow the "no flow control" EMAC feature to work
Josh Boyer [Thu, 4 Sep 2008 02:57:57 +0000 (02:57 +0000)]
ibm_newemac: Allow the "no flow control" EMAC feature to work

Some PowerPC 40x chips have errata that force us not to use the integrated
flow control.  We have the feature defined, but it currently can't be used
because it is never added to EMAC_FTRS_POSSIBLE.

This adds a Kconfig option for affected platforms to select and puts the
feature in the EMAC_FTRS_POSSIBLE list.  This is set for PowerPC 405EZ
platforms as well.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
16 years agopowerpc: Correct USB support for GE Fanuc SBC610
Martyn Welch [Mon, 29 Sep 2008 12:35:15 +0000 (13:35 +0100)]
powerpc: Correct USB support for GE Fanuc SBC610

Support for the SBC610 VPX Single Board Computer from GE Fanuc (PowerPC
MPC8641D).

Fixup to correctly reconfigure USB, provided by an NEC uPD720101, after
device is reset. This requires a set of chip specific registers in the
devices configuration space to be correctly written, enabling all ports
and switching the device to use an external 48-MHz Oscillator.

Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: Drop redundant machine type print in show_cpuinfo
Becky Bruce [Wed, 24 Sep 2008 21:53:34 +0000 (16:53 -0500)]
powerpc: Drop redundant machine type print in show_cpuinfo

For many of the embedded boards, "model" and "Machine" are printing
the same thing; remove the redundant code and allow the generic
show_cpuinfo to print the model information.

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Acked-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Martyn Welch <martyn.welch@gefanuc.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/fsl_soc: remove mpc83xx_wdt code
Anton Vorontsov [Mon, 29 Sep 2008 13:56:03 +0000 (17:56 +0400)]
powerpc/fsl_soc: remove mpc83xx_wdt code

mpc83xx_wdt is the OF driver now, so we don't need fsl_soc constructor.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agoserial/mpc52xx_uart: remove code associated with !CONFIG_PPC_MERGE
Kumar Gala [Fri, 1 Aug 2008 16:09:34 +0000 (11:09 -0500)]
serial/mpc52xx_uart: remove code associated with !CONFIG_PPC_MERGE

Now that arch/ppc is gone we don't need CONFIG_PPC_MERGE anymore
remove the dead code associated with !CONFIG_PPC_MERGE.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agoPOWERPC: Allow 32-bit hashed pgtable code to support 36-bit physical
Becky Bruce [Wed, 24 Sep 2008 16:01:24 +0000 (11:01 -0500)]
POWERPC: Allow 32-bit hashed pgtable code to support 36-bit physical

This rearranges a bit of code, and adds support for
36-bit physical addressing for configs that use a
hashed page table.  The 36b physical support is not
enabled by default on any config - it must be
explicitly enabled via the config system.

This patch *only* expands the page table code to accomodate
large physical addresses on 32-bit systems and enables the
PHYS_64BIT config option for 86xx.  It does *not*
allow you to boot a board with more than about 3.5GB of
RAM - for that, SWIOTLB support is also required (and
coming soon).

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/mm: Implement _PAGE_SPECIAL & pte_special() for 32-bit
Kumar Gala [Thu, 31 Jul 2008 13:41:10 +0000 (08:41 -0500)]
powerpc/mm: Implement _PAGE_SPECIAL & pte_special() for 32-bit

Implement _PAGE_SPECIAL and pte_special() for 32-bit powerpc. This bit will
be used by the fast get_user_pages() to differenciate PTEs that correspond
to a valid struct page from special mappings that don't such as IO mappings
obtained via io_remap_pfn_ranges().

We currently only implement this on sub-arch that support SMP or will so
in the future (6xx, 44x, FSL-BookE) and not (8xx, 40x).

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Fixes for CONFIG_PTE_64BIT for SMP support
Kumar Gala [Wed, 16 Jul 2008 20:54:21 +0000 (15:54 -0500)]
powerpc: Fixes for CONFIG_PTE_64BIT for SMP support

There are some minor issues with support 64-bit PTEs on a 32-bit processor
when dealing with SMP.

* We need to order the stores in set_pte_at to make sure the flag word
  is set second.
* Change pte_clear to use pte_update so only the flag word is cleared
* Added a WARN_ON to set_pte_at to ensure the pte isn't present for
  the 64-bit pte/SMP case (to ensure our assumption of this fact).

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Becky Bruce <becky.bruce@freescale.com>
16 years agopowerpc: Introduce local (non-broadcast) forms of tlb invalidates
Kumar Gala [Tue, 15 Jul 2008 21:12:25 +0000 (16:12 -0500)]
powerpc: Introduce local (non-broadcast) forms of tlb invalidates

Introduced a new set of low level tlb invalidate functions that do not
broadcast invalidates on the bus:

_tlbil_all - invalidate all
_tlbil_pid - invalidate based on process id (or mm context)
_tlbil_va  - invalidate based on virtual address (ea + pid)

On non-SMP configs _tlbil_all should be functionally equivalent to _tlbia and
_tlbil_va should be functionally equivalent to _tlbie.

The intent of this change is to handle SMP based invalidates via IPIs instead
of broadcasts as the mechanism scales better for larger number of cores.

On e500 (fsl-booke mmu) based cores move to using MMUCSR for invalidate alls
and tlbsx/tlbwe for invalidate virtual address.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: Make dma_addr_t a u64 if CONFIG_PHYS_64BIT is set
Becky Bruce [Fri, 12 Sep 2008 10:53:43 +0000 (10:53 +0000)]
powerpc: Make dma_addr_t a u64 if CONFIG_PHYS_64BIT is set

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: Merge 32 and 64-bit dma code
Becky Bruce [Fri, 12 Sep 2008 10:34:46 +0000 (10:34 +0000)]
powerpc: Merge 32 and 64-bit dma code

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: Becky Bruce <becky.bruce@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: Drop archdata numa_node
Becky Bruce [Mon, 8 Sep 2008 09:09:54 +0000 (09:09 +0000)]
powerpc: Drop archdata numa_node

Use the struct device's numa_node instead; use accessor functions
to get/set numa_node.

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: Move iommu dma ops from dma.c to dma-iommu.c
Becky Bruce [Mon, 8 Sep 2008 09:09:53 +0000 (09:09 +0000)]
powerpc: Move iommu dma ops from dma.c to dma-iommu.c

32-bit platforms are about to start using dma.c; move the iommu
dma ops into their own file to make this a bit cleaner.

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: Rename dma_64.c to dma.c
Becky Bruce [Mon, 8 Sep 2008 09:09:52 +0000 (09:09 +0000)]
powerpc: Rename dma_64.c to dma.c

This is in preparation for the merge of the 32 and 64-bit
dma code in arch/powerpc.

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: Move 8xxx GPIO Kconfig under the platform menu
Kumar Gala [Wed, 24 Sep 2008 04:36:32 +0000 (23:36 -0500)]
powerpc: Move 8xxx GPIO Kconfig under the platform menu

The initial patch had the option at the top level which wasn't
quite right.  Moving under the platform options is a bit better.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/86xx: Introduce a generic mpc86xx_defconfig
Kumar Gala [Wed, 24 Sep 2008 04:32:32 +0000 (23:32 -0500)]
powerpc/86xx: Introduce a generic mpc86xx_defconfig

Introduced a mpc86xx_defconfig that enables all 86xx boards and moved
all other 86xx related defconfigs under configs/86xx to match 83xx
and 85xx.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/83xx: Add missing cell-index to dma-channel device nodes
Kumar Gala [Wed, 24 Sep 2008 03:05:10 +0000 (22:05 -0500)]
powerpc/83xx: Add missing cell-index to dma-channel device nodes

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: convert CONFIG_PPC_MERGE to CONFIG_PPC for legacy io checks
Kumar Gala [Mon, 22 Sep 2008 21:41:31 +0000 (14:41 -0700)]
powerpc: convert CONFIG_PPC_MERGE to CONFIG_PPC for legacy io checks

Now that arch/ppc is dead CONFIG_PPC_MERGE is always defined for all
powerpc platforms and we want to get rid of CONFIG_PPC_MERGE use
CONFIG_PPC instead.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>