History log of /arch/powerpc/kernel/legacy_serial.c
Revision Date Author Comments
3493c85366ba09c9d0972c919e7123367a39982a 25-Jan-2012 Benjamin Herrenschmidt <benh@kernel.crashing.org> powerpc: Fix build on some non-freescale platforms

Commit 9deaa53ac7fa373623123aa4f18828dd62292b1a broke build
on platforms that use legacy_serial.c without also having
CONFIG_SERIAL_8250_FSL enabled due to an unconditional code
to a routine in that module.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9deaa53ac7fa373623123aa4f18828dd62292b1a 05-Dec-2011 Paul Gortmaker <paul.gortmaker@windriver.com> serial: add irq handler for Freescale 16550 errata.

Sending a break on the SOC UARTs found in some MPC83xx/85xx/86xx
chips seems to cause a short lived IRQ storm (/proc/interrupts
typically shows somewhere between 300 and 1500 events). Unfortunately
this renders SysRQ over the serial console completely inoperable.

The suggested workaround in the errata is to read the Rx register,
wait one character period, and then read the Rx register again.
We achieve this by tracking the old LSR value, and on the subsequent
interrupt event after a break, we don't read LSR, instead we just
read the RBR again and return immediately.

The "fsl,ns16550" is used in the compatible field of the serial
device to mark UARTs known to have this issue.

Thanks to Scott Wood for providing the errata data which led to
a much cleaner fix.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
7df5659eefad9b6d457ccdee016bd78bd064cfc0 27-Jun-2011 Arnd Bergmann <arnd@arndb.de> serial/8250: Move UPIO_TSI to powerpc

This iotype is only used by the legacy_serial code in powerpc, so the
code should live there, rather than be compiled in for every 8250
driver.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: linux-serial@vger.kernel.org
Acked-by: David Daney <david.daney@cavium.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
07d9fce24d871785dbd25458469032fea73f17b8 05-Apr-2011 Prabhakar Kushwaha <prabhakar@freescale.com> powerpc: Check device status before adding serial device

serial port nodes with the property status="disabled" are not usable and so
avoid adding "disabled" port with the system.

Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
f14362d1fe81cece6f1d78483e5bbfcf8cc497bf 01-Oct-2010 Ian Munsie <imunsie@au1.ibm.com> powerpc, of_serial: Endianness issues setting up the serial ports

The speed and clock of the serial ports is retrieved from the device
tree in both the PowerPC legacy serial code and the Open Firmware serial
driver, therefore they need to handle the fact that the device tree is
always big endian, while the CPU may not be.

Also fix other device tree references in the legacy serial code.

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
22ae782f86b726f9cea752c0f269ff6dcdf2f6e1 29-Jul-2010 Grant Likely <grant.likely@secretlab.ca> of/address: Clean up function declarations

This patch moves the declaration of of_get_address(), of_get_pci_address(),
and of_pci_address_to_resource() out of arch code and into the common
linux/of_address header file.

This patch also fixes some of the asm/prom.h ordering issues. It still
includes some header files that it ideally shouldn't be, but at least the
ordering is consistent now so that of_* overrides work.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
947af2943576400628bba085eaa6b85143526133 07-Jan-2010 Stefan Weil <weil@mail.berlios.de> Fix spelling of 'platform' in comments and doc

Replace platfrom -> platform.

This is a frequent spelling bug.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
025d7917a5ede982a5669c6735ef73a227b9827e 28-Jul-2008 Benjamin Herrenschmidt <benh@kernel.crashing.org> powerpc/powermac: Fixup default serial port device for pmac_zilog

This removes the non-working code in legacy_serial that tried to handle
the powermac SCC ports, and instead add a (now working) function to the
powermac platform code to find the default serial console if any.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
3bc5ab9b7f2760d2892fd0a0589e1077e869d4f5 07-Jul-2008 Benjamin Herrenschmidt <benh@kernel.crashing.org> powerpc: Fix unterminated of_device_id array in legacy_serial.c

A recent patch to legacy_serial.c factored out some code by
using the of_match_node() facility to match a node against
an array of possible matches. However, the patch didn't properly
terminate the array causing potential crashes in cases where no
match is found. In addition, the name of the array was poorly
chosen for a static symbol making debugging harder.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1e6d1f260611387a7b4e6eae4d1dd6f62e53714d 01-Jul-2008 John Linn <john.linn@xilinx.com> powerpc/legacy_serial: Bail if reg-offset/shift properties are present

The legacy serial driver does not work with an 8250 type UART that is
described in the device tree with the reg-offset and reg-shift
properties. This change makes legacy_serial ignore these devices.

Signed-off-by: John Linn <john.linn@xilinx.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
f5903ede0015db5b53458092b6ae2af074fa49d4 05-Feb-2008 Michael Ellerman <michael@ellerman.id.au> [POWERPC] Fix legacy serial search for opb bus ports

The patch to legacy_serial.c (1a7507c7da2df6856e085e0fbb0c9ea8c12ac4e,
Reduce code duplication in legacy_serial, add UART parent types) changed
the semantics for opb ports from type = "opb" || compatible = "ibm,opb"
to type = "opb" && compatible = "ibm,opb".

The result is serial ports on our QS21s (Cell blades) don't get found,
and for some reason the machine doesn't boot at all - possibly it's
panicking due to lack of a console?

The fix is to add two entries to the of_device_id table, one that looks
for type = "opb" and the other compatible = "ibm,opb".

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
1a7507c7da2df6856e085e0fbb0c9ea8c12ac4e2 24-Jan-2008 Paul Gortmaker <paul.gortmaker@windriver.com> [POWERPC] Reduce code duplication in legacy_serial, add UART parent types

The legacy_serial was treating each UART parent in a separate code block.
Rather than continue this trend for the new parent IDs, this condenses
all (soc, tsi, opb, plus two more new types) into one of_device_id array.
The new types are wrs,epld-localbus for the Wind River sbc8560, and a
more generic "simple-bus" as requested by Scott Wood.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
3329c0d1b2de2eb9e156aa8c13ad639f54791f24 29-Nov-2007 Cyrill Gorcunov <gorcunov@gmail.com> [POWERPC] Use for_each macros in arch/powerpc/kernel

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
00d70419fc8f86db94f56e0191be392c4a57f244 17-Dec-2007 joe@perches.com <joe@perches.com> [POWERPC] arch/powerpc/: Spelling fixes

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
b63db45ca44a805ef21eb10a3750e88419156423 11-Oct-2007 Valentine Barshak <vbarshak@ru.mvista.com> [POWERPC] Add legacy serial support for OPB with flattened device tree

Currently find_legacy_serial_ports() can find no serial ports on the
OPB with flattened device tree. Thus no legacy boot console can be
initialized. Just the early udbg console works, which is initialized
with udbg_init_44x_as1 on the UART's physical address specified in
kernel config. This happens because we look for ns16750 serial
devices only and expect opb node to have a device type property. This
patch makes it look for ns16550-compatible devices and use
of_device_is_compatible() for opb in case device type is not
specified.

Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
ee56c47440ab04c6a35c835a9bcc4193304adf93 23-Aug-2007 Olof Johansson <olof@lixom.net> [POWERPC] Move serial_dev_init to device_initcall()

With the I/O space rewrite by BenH, the legacy_serial serial_dev_init()
initcall is now called before I/O space is setup, but it's dependent on
it being available.

Since there's no way to make dependencies between initcalls, we'll just
have to move it to device_initcall(). Yes, it's suboptimal but I'm not
aware of any better solution at this time, and it fixes a regression
from 2.6.22.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
abb4a2390737867353ebafc012d45f2b03f3f944 06-May-2007 David Gibson <david@gibson.dropbear.id.au> serial: define FIXED_PORT flag for serial_core

At present, the serial core always allows setserial in userspace to change the
port address, irq and base clock of any serial port. That makes sense for
legacy ISA ports, but not for (say) embedded ns16550 compatible serial ports
at peculiar addresses. In these cases, the kernel code configuring the ports
must know exactly where they are, and their clocking arrangements (which can
be unusual on embedded boards). It doesn't make sense for userspace to change
these settings.

Therefore, this patch defines a UPF_FIXED_PORT flag for the uart_port
structure. If this flag is set when the serial port is configured, any
attempts to alter the port's type, io address, irq or base clock with
setserial are ignored.

In addition this patch uses the new flag for on-chip serial ports probed in
arch/powerpc/kernel/legacy_serial.c, and for other hard-wired serial ports
probed by drivers/serial/of_serial.c.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
55b61fec22caa3e7872caea6c4100fc75cb8f49b 03-May-2007 Stephen Rothwell <sfr@canb.auug.org.au> [POWERPC] Rename device_is_compatible to of_device_is_compatible

for consistency with other Open Firmware interfaces (and Sparc).

This is just a straight replacement.

This leaves the compatibility define in place.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
e2eb63927bfcb54232163bfec32440246fd44457 03-Apr-2007 Stephen Rothwell <sfr@canb.auug.org.au> [POWERPC] Rename get_property to of_get_property: arch/powerpc

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
8d38a5b2fab1397d35ba1c92828a91b77ce9f865 13-Feb-2007 Arnd Bergmann <arnd@arndb.de> [POWERPC] Open Firmware serial port driver

This can be used for serial ports that are connected to an
OF platform bus but are not autodetected by the lecacy
serial support.
It will automatically take over devices that come from the
legacy serial detection, which usually is only one device.

In some cases, rtas may be set up to use the serial port
in the firmware, which allows easier debugging before probing
the serial ports. In this case, the "used-by-rtas" property
must be set by the firmware. This patch also adds code to the
legacy serial driver to check for this.

Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
b8757b21f7628c57cb20e55be324fdef283a56e9 12-Feb-2007 Alon Bar-Lev <alon.barlev@gmail.com> [PATCH] Dynamic kernel command-line: powerpc

Rename saved_command_line into boot_command_line.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
be9633e96a9e33ab97776bb6874244fa4db6987d 23-Aug-2006 Zang Roy-r61911 <tie-fei.zang@freescale.com> [POWERPC] Pass UPIO_TSI flag to 8259 serial driver

The patch passes the UPIO_TSI flag to general 8259 serial driver

Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
a7f67bdf2c9f24509b8e81e0f35573b611987c80 12-Jul-2006 Jeremy Kerr <jk@ozlabs.org> [POWERPC] Constify & voidify get_property()

Now that get_property() returns a void *, there's no need to cast its
return value. Also, treat the return value as const, so we can
constify get_property later.

powerpc core changes.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
45507ff3a2c58bc4781688eac1a80979ea972dce 04-Jul-2006 Benjamin Herrenschmidt <benh@kernel.crashing.org> [POWERPC] Fix legacy_serial.c error handling on 32 bits

The code in legacy_serial.c wouldn't properly compare OF translation
results against OF_BAD_ADDR as it's using a phys_addr_t which is 32
bits on some 32-bit powerpc platforms. This fixes it by always using
a u64 which is what is returned by the OF parsing routines. It also
makes translation failure harmless for ISA serial ports. If they
can't translate, we can't use the UART early, but we can still let the
8250 driver use it later on by using IO port accessors.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
f704b8d1f080ee71b7a9a88bcf585e7dd4272f4b 04-Jul-2006 Benjamin Herrenschmidt <benh@kernel.crashing.org> [POWERPC] Fix legacy_serial.c error handling on 32 bits

The code in legacy_serial.c wouldn't properly compare OF translation
results against OF_BAD_ADDR as it's using a phys_addr_t which is 32
bits on some 32-bit powerpc platforms. This fixes it by always using
a u64 which is what is returned by the OF parsing routines. It also
makes translation failure harmless for ISA serial ports. If they
can't translate, we can't use the UART early, but we can still let the
8250 driver use it later on by using IO port accessors.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
0ebfff1491ef85d41ddf9c633834838be144f69f 03-Jul-2006 Benjamin Herrenschmidt <benh@kernel.crashing.org> [POWERPC] Add new interrupt mapping core and change platforms to use it

This adds the new irq remapper core and removes the old one. Because
there are some fundamental conflicts with the old code, like the value
of NO_IRQ which I'm now setting to 0 (as per discussions with Linus),
etc..., this commit also changes the relevant platform and driver code
over to use the new remapper (so as not to cause difficulties later
in bisecting).

This patch removes the old pre-parsing of the open firmware interrupt
tree along with all the bogus assumptions it made to try to renumber
interrupts according to the platform. This is all to be handled by the
new code now.

For the pSeries XICS interrupt controller, a single remapper host is
created for the whole machine regardless of how many interrupt
presentation and source controllers are found, and it's set to match
any device node that isn't a 8259. That works fine on pSeries and
avoids having to deal with some of the complexities of split source
controllers vs. presentation controllers in the pSeries device trees.

The powerpc i8259 PIC driver now always requests the legacy interrupt
range. It also has the feature of being able to match any device node
(including NULL) if passed no device node as an input. That will help
porting over platforms with broken device-trees like Pegasos who don't
have a proper interrupt tree.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
7c6efda5996c26c468eaba178af9bac8b70dbdcb 03-Jul-2006 Benjamin Herrenschmidt <benh@kernel.crashing.org> [POWERPC] Fix error handling in detecting legacy serial ports

Previously we weren't checking for failures in translating device
addresses from the firmware.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
6ab3d5624e172c553004ecc862bfeac16d9d68b7 30-Jun-2006 Jörn Engel <joern@wohnheim.fh-wedel.de> Remove obsolete #include <linux/config.h>

Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
c5d56332fd6c2f0c7cf9d1f65416076f2711ea28 13-Jun-2006 Zang Roy-r61911 <tie-fei.zang@freescale.com> [POWERPC] Add general support for mpc7448hpc2 (Taiga) platform

Add support for Freescale mpc7448 (Taiga) board support

Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
37a801c776109dce801875b12525a9eaa12481e6 26-Mar-2006 Michael Neuling <mikey@neuling.org> [PATCH] powerpc: legacy_serial loop cleanup

We only ever execute the loop once, so let's move it to a function
making it more readable. Cleanup patch, no functional change.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
af308377e204e25f1f58627d05fe0f483703b514 23-Mar-2006 Stephen Rothwell <sfr@canb.auug.org.au> [PATCH] powerpc: fix various sparse warnings

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
577bca9eff94193a06e426f8dbf6b3152247a209 01-Feb-2006 Olaf Hering <olh@suse.de> [PATCH] CONFIG_ISA does not make sense for CONFIG_PPC_PSERIES

Older pSeries systems with serial ports dont get any console output after
recent changes. CONFIG_ISA does not make sense for CONFIG_PPC_PSERIES
because it enables lots of old drivers. Instead, remove the dependency on
CONFIG_ISA from the serial port discovery code.

Signed-off-by: Olaf Hering <olh@suse.de>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
017e0fad3e40ece983527ec88a92b3da8fcdecea 03-Jan-2006 Kumar Gala <galak@gate.crashing.org> [PATCH] powerpc: fixing compile issue with !CONFIG_PCI in legacy_serial.c

Only build in support for ISA and PCI cases if we have enabled CONFIG_ISA
and CONFIG_PCI. Additionally, isa_bridge is a global so we shouldn't use
it a parameter name since it gets redefined to NULL when !CONFIG_PCI.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
b580d46ce833f6bdc6a5602f4f0efb1d9c488ed6 20-Dec-2005 Kumar Gala <galak@gate.crashing.org> [PATCH] powerpc: Add the ability to handle SOC ports in legacy_serial

Add the ability to configure and initialize legacy 8250 serials
ports on an SOC bus. Also, fixed an issue that we would not
configure any serial ports if "linux,stdout-path" was not found.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
d2dd482bc17c3bc240045f80a7c4b4d5cea5e29c 30-Nov-2005 Benjamin Herrenschmidt <benh@kernel.crashing.org> [PATCH] powerpc: Update OF address parsers

This updates the OF address parsers to return the IO flags
indicating the type of address obtained. It also adds a PCI
call for converting physical addresses that hit IO space into
into IO tokens, and add routines that return the translated
addresses into struct resource

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
8dacaedf04467e32c50148751a96150e73323cdc 29-Nov-2005 Benjamin Herrenschmidt <benh@kernel.crashing.org> [PATCH] powerpc: More serial probe fixes (#2)

This fixes the new serial probe code with some PCI MMIO UARTs, and fixes
CHRP build with ARCH=powerpc.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
31df1678d7732b94178a6e457ed6666e4431212f 24-Nov-2005 David Woodhouse <dwmw2@infradead.org> [PATCH] powerpc: serial port discovery: cope with broken firmware

On Tue, 2005-11-22 at 15:49 +1100, Benjamin Herrenschmidt wrote:
> This moves the discovery of legacy serial ports to a separate file,
> makes it common to ppc32 and ppc64, and reworks it to use the new OF
> address translators to get to the ports early. This new version can also
> detect some PCI serial cards using legacy chips and will probably match
> those discovered port with the default console choice.

This makes it deal with the fact that the Pegasos firmware reports that
its clock frequency is zero...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
463ce0e103f419f51b1769111e73fe8bb305d0ec 23-Nov-2005 Benjamin Herrenschmidt <benh@kernel.crashing.org> [PATCH] powerpc: serial port discovery (#2)

This moves the discovery of legacy serial ports to a separate file,
makes it common to ppc32 and ppc64, and reworks it to use the new OF
address translators to get to the ports early. This new version can also
detect some PCI serial cards using legacy chips and will probably match
those discovered port with the default console choice.

Only ppc64 gets udbg still yet, unifying udbg isn't finished yet.

It also adds some speed-probing code to udbg so that the default console
can come up at the same speed it was set to by the firmware.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>