Stephen Rothwell [Wed, 22 Aug 2007 03:46:44 +0000 (13:46 +1000)]
[POWERPC] Move the exception macros into a header file
It makes head_64.S a bit more readable and will allow us to move the
iSeries exceptions elsewhere.
This also removes the last line of the comment:
* The following macros define the code that appears as
* the prologue to each of the exception handlers. They
* are split into two parts to allow a single kernel binary
* to be used for pSeries and iSeries.
* LOL. One day... - paulus
Anything is possible. :-)
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Olof Johansson [Wed, 22 Aug 2007 02:26:43 +0000 (12:26 +1000)]
[POWERPC] Rework SMP timebase handoff for pasemi
Rework timebase handoff to play nice with configurations with more than
2 cores, as well as with CPU hotplug.
Previous scheme just pushed out the current timebase from the giving
core to all cores without caring if they wanted it or not, nor checking
if they'd taken it. The taking side didn't make sure the giving side
had provided a value yet either. In other words, it was completely broken.
Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
Scott Wood [Mon, 20 Aug 2007 17:40:02 +0000 (03:40 +1000)]
[POWERPC] bootwrapper: Add PowerQUICC II (82xx with CPM) cuboot support
This allows booting on legacy, non-device-tree aware versions of U-boot.
It also fixes up the hardware to match the PCI and chipselect information
in the device tree, as u-boot is inconsistent in setting these up
correctly (or at all).
Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Scott Wood [Mon, 20 Aug 2007 17:40:01 +0000 (03:40 +1000)]
[POWERPC] bootwrapper: Add 8xx cuboot support
This allows booting on legacy, non-device-tree aware versions of U-boot.
Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Scott Wood [Mon, 20 Aug 2007 17:39:57 +0000 (03:39 +1000)]
[POWERPC] bootwrapper: Add CPM serial driver
This serial port is used on all 8xx, many 82xx, and some 85xx chips.
The driver requires that the port has already been set up by the firmware
and/or platform code.
Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
1. Search the entire compatible list for serial devices.
The serial code previously did a simple strcmp on the compatible
node; this fails when the match string is not the first compatible
listed. Use dt_is_compatible() instead.
2. Don't call serial_edit_cmdline if getc isn't defined.
Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Scott Wood [Mon, 20 Aug 2007 17:39:52 +0000 (03:39 +1000)]
[POWERPC] bootwrapper: Add TARGET_HAS_ETHn tests to ppcboot.h
U-boots more recent than when ppcboot.h was forked allow the board config
file to enable additional ethernet ports explicitly, rather than
using a hardcoded list of targets. This allows bootwrapper platform
files to do the same.
Fortunately, nothing after the ethernet addresses is of interest to
cuboot platforms, so the inevitable mismatches won't be too catastrophic.
Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Scott Wood [Mon, 20 Aug 2007 17:39:51 +0000 (03:39 +1000)]
[POWERPC] bootwrapper: Add 16-bit I/O, sync(), eieio(), and barrier()
Also, include types.h from io.h, so callers don't have to.
Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Scott Wood [Mon, 20 Aug 2007 17:39:48 +0000 (03:39 +1000)]
[POWERPC] bootwrapper: Add dt_is_compatible()
This can be used rather than doing a simple strcmp, which will fail to
handle multiple compatible entries.
Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Scott Wood [Mon, 20 Aug 2007 17:39:46 +0000 (03:39 +1000)]
[POWERPC] bootwrapper: dt_xlate_range() bugfixes
1. The check whether ranges fits in the buffer was using elements rather
than bytes.
2. Empty ranges were not properly treated as transparent, and missing
ranges were treated as transparent.
3. The loop terminated when translating from the root rather than to. Once
bug #2 was fixed, it failed due to a missing ranges in the root node.
4. In decoding the ranges property, the #size-cells used was that of
the parent, not the child.
Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Scott Wood [Mon, 20 Aug 2007 17:39:45 +0000 (03:39 +1000)]
[POWERPC] bootwrapper: Set timebase_period_ns from dt_fixup_cpu_clocks
This lets udelay() work properly on platforms which use dt_fixup_cpu_clocks.
Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Scott Wood [Mon, 20 Aug 2007 17:39:20 +0000 (03:39 +1000)]
[POWERPC] bootwrapper: Update .gitignore
All cuImage types are ignored, as well as preprocessed .lds files,
and the forthcoming zImage.bin files and embedded planet board images.
Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Scott Wood [Mon, 20 Aug 2007 16:36:59 +0000 (02:36 +1000)]
[POWERPC] Use strcasecmp() rather than strncasecmp() when determining device node compatibility
The current code assumes "foo-bar" must always be compatible with a node
compatible with "foo", which breaks device trees where this is not so.
The "case" part is also wrong according to Open Firmware, but it's more
likely to have drivers and/or device trees depending on it, and thus
needs to be handled more carefully.
Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Stephen Rothwell [Mon, 20 Aug 2007 04:58:36 +0000 (14:58 +1000)]
[POWERPC] iSeries: Clean up lparmap mess
We need to have xLparMap in head_64.S so that it is at a fixed address
(because the linker will not resolve (address & 0xffffffff) for us).
But the assembler miscalculates the KERNEL_VSID() expressions. So put
the confusing expressions into asm-offsets.c.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Olaf Hering [Fri, 17 Aug 2007 18:27:17 +0000 (04:27 +1000)]
[POWERPC] Advertise correct IDE mode on Pegasos2
The built-in IDE controller is configured in legacy mode, but the PCI
registers advertise native mode. Force the PCI class into legacy
mode. This allows pata_via to access two drives.
The Pegasos specific irq enforcement in the via82cxxx driver must stay
because there is apparently no generic way to setup irq per channel.
Tested on Pegasos2 with firmware version 20040810, and two IDE disks.
Signed-off-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
Josh Boyer [Mon, 20 Aug 2007 12:29:11 +0000 (07:29 -0500)]
[POWERPC] 40x decrementer fixes
Allow generic_calibrate_decr to work for 40x platforms. Given that the hardware
behavior is identical, this also changes the set_dec function to reload the PIT
on 40x to match the behavior 44x currently has.
Josh Boyer [Mon, 20 Aug 2007 12:28:30 +0000 (07:28 -0500)]
[POWERPC] 4xx bootwrapper reworks
Make the fixup_memsize function common for all of 4xx as several chips share
the same SDRAM controller. Also add functions to reset 40x chips and quiesce
the ethernet.
David Gibson [Tue, 14 Aug 2007 03:52:42 +0000 (13:52 +1000)]
[POWERPC] Improve robustness of the UIC cascade handler
At present the cascade interrupt handler for the UIC (interrupt
controller on 4xx embedded chips) will misbehave badly if it is called
spuriously - that is if the handler is invoked when no interrupts are
asserted in the child UIC.
Although spurious interrupts shouldn't happen, it's good to behave
robustly if they do. This patch does so by checking for and ignoring
spurious interrupts.
Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Acked-by: Josh Boyer <jwboyer@linux.vnet.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
David Gibson [Tue, 14 Aug 2007 03:52:42 +0000 (13:52 +1000)]
[POWERPC] Fix irq flow handler for 4xx UIC
At present the driver for the UIC (the embedded interrupt controller
in 4xx chips) uses the handle_level_irq() flow handler. It turns out
this does not correctly handle level triggered interrupts on the UIC.
Specifically, acknowledging an irq on the UIC (i.e. clearing the
relevant bit in UIC_SR) will have no effect for a level interrupt
which is still asserted by the external device, even if the irq is
already masked. Therefore, unlike handle_level_irq() we must ack the
interrupt after invoking the ISR (which should cause the device to
stop asserting the irq) instead of acking it when we mask it, before
the ISR.
This patch implements this change, in a new handle_uic_irq(), a
customised irq flow handler for the UIC. For edge triggered
interrupts, handle_uic_irq() still uses the old flow - we must ack
edge triggered interrupt before the ISR not after, or we could miss a
second event which occurred between invoking the ISR and acking the
irq.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Acked-by: Josh Boyer <jwboyer@linux.vnet.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
David Gibson [Tue, 14 Aug 2007 03:52:42 +0000 (13:52 +1000)]
[POWERPC] Fix setting of irq trigger type in UIC driver
The UIC (interrupt controller in 4xx embedded CPUs) driver currently
missets the IRQ_lEVEL flag in desc->status, due to a thinko. This
patch fixes the bug.
Currently this is only a cosmetic problem (affects the output in
/proc/interrupts), however subsequent patches will use the IRQ_LEVEL
flag to affect flow handling.
Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Acked-by: Josh Boyer <jwboyer@linux.vnet.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Stephen Rothwell [Wed, 15 Aug 2007 06:45:15 +0000 (16:45 +1000)]
[POWERPC] Remove get_property and device_is_compatible
They were only needed for backwards compatibility and all in tree uses
have now been changed.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
Michael Buesch [Sun, 12 Aug 2007 20:38:34 +0000 (06:38 +1000)]
[POWERPC] via-pmu: Fix typo in printk
This fixes a typo in a printk message.
Signed-off-by: Michael Buesch <mb@bu3sch.de> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
[POWERPC] Implement atomic{, 64}_{read, write}() without volatile
Instead, use asm() like all other atomic operations already do.
Also use inline functions instead of macros; this actually
improves code generation (some code becomes a little smaller,
probably because of improved alias information -- just a few
hundred bytes total on a default kernel build, nothing shocking).
Signed-off-by: Segher Boessenkool <segher@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Paul Mackerras [Fri, 10 Aug 2007 04:07:38 +0000 (14:07 +1000)]
[POWERPC] Handle alignment faults on new FP load/store instructions
This adds code to handle alignment traps generated by the following
new floating-point load/store instructions, by emulating the
instruction in the kernel (as is done for other instructions that
generate alignment traps):
lfiwax load floating-point as integer word algebraic indexed
stfiwx store floating-point as integer word indexed
lfdp load floating-point double pair
lfdpx load floating-point double pair indexed
stfdp store floating-point double pair
stfdpx store floating-point double pair indexed
All these except stfiwx are new in POWER6.
lfdp/lfdpx/stfdp/stfdpx load and store 16 bytes of memory into an
even/odd FP register pair. In little-endian mode each 8-byte value is
byte-reversed separately (i.e. not as a 16-byte unit). lfiwax/stfiwx
load or store the lower 4 bytes of a floating-point register from/to
memory; lfiwax sets the upper 4 bytes of the FP register to the sign
extension of the value loaded.
Linas Vepstas [Thu, 9 Aug 2007 23:28:11 +0000 (09:28 +1000)]
[POWERPC] pseries: Remove dead EEH video code
Remove dead code, and a misleading comment about EEH checking
for video devices. The removed code is a left-over from the
olden days where there was concern over how video devices
worked in Linux. We are never going to go that way again,
so kill this.
Nathan Lynch [Thu, 9 Aug 2007 21:43:28 +0000 (07:43 +1000)]
[POWERPC] Remove gratuitous reads from powermac pci config space methods
The powermac pci configuration space write methods read the written
location immediately after the write is performed, presumably in order
to flush the write. However, configuration space writes are not
allowed to be posted, making these reads gratuitous. Furthermore,
this behavior potentially causes us to violate the PCI PM spec when
changing between e.g. D0 and D3 states, because a delay of up to 10ms
may be required before the OS accesses configuration space after the
write which initiates the transition.
Remove the unnecessary reads from macrisc_write_config,
u3_ht_write_config, and u4_pcie_write_config.
Signed-off-by: Nathan Lynch <ntl@pobox.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Nathan Lynch [Thu, 9 Aug 2007 21:37:27 +0000 (07:37 +1000)]
[POWERPC] Remove gratuitous reads from pasemi pci config space methods
The pasemi pci configuration space write method reads the written
location immediately after the write is performed, presumably in order
to flush the write. However, configuration space writes are not
allowed to be posted, making these reads gratuitous. Furthermore,
this behavior potentially causes us to violate the PCI PM spec when
changing between e.g. D0 and D3 states, because a delay of up to 10ms
may be required before the OS accesses configuration space after the
write which initiates the transition.
Remove the unnecessary reads from pa_pxp_write_config.
Signed-off-by: Nathan Lynch <ntl@pobox.com> Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
Nathan Lynch [Thu, 9 Aug 2007 00:50:44 +0000 (10:50 +1000)]
[POWERPC] Remove gratuitous reads from maple PCI config space methods
The maple PCI configuration space write methods read the written
location immediately after the write is performed, presumably in order
to flush the write. However, configuration space writes are not
allowed to be posted, making these reads gratuitous. Furthermore,
this behavior potentially causes us to violate the PCI PM spec when
changing between e.g. D0 and D3 states, because a delay of up to 10ms
may be required before the OS accesses configuration space after the
write which initiates the transition. It definitely causes a system
hang for me with a Broadcom 5721 PCIE network adapter, which is fixed
by this change.
Therefore this removes the gratuitous reads from u3_agp_write_config,
u3_ht_write_config, and u4_pcie_write_config.
Signed-off-by: Nathan Lynch <ntl@pobox.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Murali Iyer [Wed, 8 Aug 2007 21:46:49 +0000 (07:46 +1000)]
[POWERPC] Export DCR symbols for modules
In order to compile drivers as modules that uses some of the
DCR functions, we need to export the symbols. Example, EMAC
driver and other drivers that are under development use these
functions.
Linas Vepstas [Wed, 8 Aug 2007 20:06:15 +0000 (06:06 +1000)]
[POWERPC] pseries: Fix jumbled no_logging flag
Get rid of the jumbled usage of the no_logging flag. Its use
spans several directories, and is incorrectly/misleadingly
documented. Instead, two changes:
1) nvram will accept error log as soon as its ready.
2) logging to nvram stops on the first fatal error reported.
Linas Vepstas [Thu, 9 Aug 2007 21:01:50 +0000 (07:01 +1000)]
[POWERPC] pseries: Avoid excess rtas_token calls
We don't need to look up the rtas event token once per
cpu per second. This avoids some misc device-tree lookups
and string ops and so provides some minor performance
improvement.
David Gibson [Mon, 30 Jul 2007 05:55:02 +0000 (15:55 +1000)]
[POWERPC] Fixes to allow use of Ebony's flash chips through physmap_of
This patch contains a handful of small fixes to allow the Ebony's
flash to be exposed as MTD devices via the physmap_of driver.
Specifically it:
- Makes a small addition to the device tree and zImage wrapper
to record the correct address for the flash in the device tree based
on the board switches as reported via an FPGA register.
- Prohibits building the old hard-coded "Ebony" flash map on
arch/powerpc kernels, in favour of using physmap_of's device tree
based approach.
- Enables MTD and physmap_of in the Ebony defconfig.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
The EEH code needs to ignore PCI bridges; sort-of. It was ignoring
them in the wrong place, and thus failing to set up the
PCI_DN(dn)->pcidev pointer. Imprudent dereferencing of this pointer
would lead to a crash on cards with bridges.
There are some variables and functions that we should place in init
section. And this patch changes some '__devinit' to '__init', because
the device is platform device and not hot-pluggable.
Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp> Signed-off-by: Paul Mackerras <paulus@samba.org>
Fix following warning:
WARNING: vmlinux.o(.text+0x45fd4): Section mismatch: reference to .init.text:.early_serial_txx9_setup (between '.txx9_serial_init' and '.txx9_serial_config')
Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp> Signed-off-by: Paul Mackerras <paulus@samba.org>
Fix following warnings:
WARNING: vmlinux.o(.text+0x44ad0): Section mismatch: reference to .init.text:.__alloc_bootmem (between '.celleb_setup_phb' and '.celleb_fake_pci_write_config')
WARNING: vmlinux.o(.text+0x44dd8): Section mismatch: reference to .init.text:.free_bootmem (between '.celleb_setup_phb' and '.celleb_fake_pci_write_config')
Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp> Signed-off-by: Paul Mackerras <paulus@samba.org>
Ilpo Järvinen [Wed, 15 Aug 2007 22:03:35 +0000 (08:03 +1000)]
[POWERPC] Fix invalid semicolon after if statement
A similar fix to netfilter from Eric Dumazet inspired me to
look around a bit by using some grep/sed stuff as looking for
this kind of bugs seemed easy to automate. This is one of them
I found where it looks like this semicolon is not valid.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Roland McGrath [Fri, 10 Aug 2007 23:03:11 +0000 (09:03 +1000)]
[POWERPC] Fix for assembler -g
ppc64 does the unusual thing of using #include on a compiler-generated
assembly file (lparmap.s) from an assembly source file (head_64.S).
This runs afoul of my recent patch to pass -gdwarf2 to the assembler
under CONFIG_DEBUG_INFO. This patch avoids the problem by disabling
DWARF generation (-g0) when producing lparmap.s.
Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
David Gibson [Tue, 7 Aug 2007 04:20:50 +0000 (14:20 +1000)]
[POWERPC] Fix small race in 44x tlbie function
The 440 family of processors don't have a tlbie instruction. So, we
implement TLB invalidates by explicitly searching the TLB with tlbsx.,
then clobbering the relevant entry, if any. Unfortunately the PID for
the search needs to be stored in the MMUCR register, which is also
used by the TLB miss handler. Interrupts were enabled in _tlbie(), so
an interrupt between loading the MMUCR and the tlbsx could cause
incorrect search results, and thus a failure to invalide TLB entries
which needed to be invalidated.
This fixes the problem in both arch/ppc and arch/powerpc by inhibiting
interrupts (even critical and debug interrupts) across the relevant
instructions.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Acked-by: Josh Boyer <jwboyer@linux.vnet.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Becky Bruce [Fri, 11 May 2007 17:49:39 +0000 (03:49 +1000)]
[POWERPC] Remove unused code causing a compile warning
AFAICT, nobody is using ft_ordered(), and it causes a build warning
to be generated. This patch cleans that up by removing the function
and the commented-out code that calls it.
Signed-off-by: Becky Bruce <becky.bruce@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes:
[GFS2] Revert remounting w/o acl option leaves acls enabled
[GFS2] Fix setting of inherit jdata attr
[GFS2] Fix incorrect error path in prepare_write()
[GFS2] Fix incorrect return code in rgrp.c
[GFS2] soft lockup in rgblk_search
[GFS2] soft lockup detected in databuf_lo_before_commit
[DLM] fix basts for granted PR waiting CW
[DLM] More othercon fixes
[DLM] Fix memory leak in dlm_add_member() when dlm_node_weight() returns less than zero
[DLM] zero unused parts of sockaddr_storage
[DLM] fix NULL ls usage
[DLM] Clear othercon pointers when a connection is closed
Linus Torvalds [Tue, 14 Aug 2007 16:52:12 +0000 (09:52 -0700)]
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
i2c-s3c2410: Build fix
i2c/menelaus: Build fix
i2c-mv64xxx: Reinitialize hw and driver on I2C bus hang
i2c-mpc: Don't disable I2C module on stop condition
i2c-iop3xx: Set I2C_CLASS_HWMON to adapter class
i2c/isp1301_omap: Build fixes, whitespace
i2c-mpc: Pass correct dev_id to free_irq on error path
i2c-i801: Typo: erroneous
Dale Farnsworth [Tue, 14 Aug 2007 16:37:14 +0000 (18:37 +0200)]
i2c-mv64xxx: Reinitialize hw and driver on I2C bus hang
Under certain conditions, the mv64xxx I2C bus can hang preventing
further operation. To make the driver more robust, we now reset
the I2C hardware and the driver state machine when such hangs are
detected.
Signed-off-by: Dale Farnsworth <dale@farnsworth.org> Acked-by: Mark A. Greer <mgreer@mvista.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>