* [PATCH] Fix 8250 probe on ppc32
@ 2005-11-07 10:04 David Woodhouse
2005-11-07 16:09 ` Tom Rini
0 siblings, 1 reply; 19+ messages in thread
From: David Woodhouse @ 2005-11-07 10:04 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
The probe at random I/O locations for 8250 serial ports makes my SMP G4
very unhappy. Theoretically it's supposed to catch the machine check and
recover, but that doesn't actually work very reliably -- the machine
often just locks up hard instead.
This makes ppc32 use the same code for locating 8250 serial ports in the
device tree as ppc64 already uses, and hence makes it refrain from
poking at non-existent ports.
This fairly much obsoletes include/asm-ppc/pc_serial.h -- other machines
with 8250 ports which are currently responsible for the mess in
include/asm-ppc/serial.h itself should be converted to a platform_device
of their own before they become supported in arch/powerpc.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -31,8 +31,6 @@
#include <linux/notifier.h>
#include <linux/cpu.h>
#include <linux/unistd.h>
-#include <linux/serial.h>
-#include <linux/serial_8250.h>
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/processor.h>
@@ -51,7 +49,6 @@
#include <asm/system.h>
#include <asm/rtas.h>
#include <asm/iommu.h>
-#include <asm/serial.h>
#include <asm/cache.h>
#include <asm/page.h>
#include <asm/mmu.h>
@@ -713,187 +710,6 @@ void ppc64_terminate_msg(unsigned int sr
printk("[terminate]%04x %s\n", src, msg);
}
-#ifndef CONFIG_PPC_ISERIES
-/*
- * This function can be used by platforms to "find" legacy serial ports.
- * It works for "serial" nodes under an "isa" node, and will try to
- * respect the "ibm,aix-loc" property if any. It works with up to 8
- * ports.
- */
-
-#define MAX_LEGACY_SERIAL_PORTS 8
-static struct plat_serial8250_port serial_ports[MAX_LEGACY_SERIAL_PORTS+1];
-static unsigned int old_serial_count;
-
-void __init generic_find_legacy_serial_ports(u64 *physport,
- unsigned int *default_speed)
-{
- struct device_node *np;
- u32 *sizeprop;
-
- struct isa_reg_property {
- u32 space;
- u32 address;
- u32 size;
- };
- struct pci_reg_property {
- struct pci_address addr;
- u32 size_hi;
- u32 size_lo;
- };
-
- DBG(" -> generic_find_legacy_serial_port()\n");
-
- *physport = 0;
- if (default_speed)
- *default_speed = 0;
-
- np = of_find_node_by_path("/");
- if (!np)
- return;
-
- /* First fill our array */
- for (np = NULL; (np = of_find_node_by_type(np, "serial"));) {
- struct device_node *isa, *pci;
- struct isa_reg_property *reg;
- unsigned long phys_size, addr_size, io_base;
- u32 *rangesp;
- u32 *interrupts, *clk, *spd;
- char *typep;
- int index, rlen, rentsize;
-
- /* Ok, first check if it's under an "isa" parent */
- isa = of_get_parent(np);
- if (!isa || strcmp(isa->name, "isa")) {
- DBG("%s: no isa parent found\n", np->full_name);
- continue;
- }
-
- /* Now look for an "ibm,aix-loc" property that gives us ordering
- * if any...
- */
- typep = (char *)get_property(np, "ibm,aix-loc", NULL);
-
- /* Get the ISA port number */
- reg = (struct isa_reg_property *)get_property(np, "reg", NULL);
- if (reg == NULL)
- goto next_port;
- /* We assume the interrupt number isn't translated ... */
- interrupts = (u32 *)get_property(np, "interrupts", NULL);
- /* get clock freq. if present */
- clk = (u32 *)get_property(np, "clock-frequency", NULL);
- /* get default speed if present */
- spd = (u32 *)get_property(np, "current-speed", NULL);
- /* Default to locate at end of array */
- index = old_serial_count; /* end of the array by default */
-
- /* If we have a location index, then use it */
- if (typep && *typep == 'S') {
- index = simple_strtol(typep+1, NULL, 0) - 1;
- /* if index is out of range, use end of array instead */
- if (index >= MAX_LEGACY_SERIAL_PORTS)
- index = old_serial_count;
- /* if our index is still out of range, that mean that
- * array is full, we could scan for a free slot but that
- * make little sense to bother, just skip the port
- */
- if (index >= MAX_LEGACY_SERIAL_PORTS)
- goto next_port;
- if (index >= old_serial_count)
- old_serial_count = index + 1;
- /* Check if there is a port who already claimed our slot */
- if (serial_ports[index].iobase != 0) {
- /* if we still have some room, move it, else override */
- if (old_serial_count < MAX_LEGACY_SERIAL_PORTS) {
- DBG("Moved legacy port %d -> %d\n", index,
- old_serial_count);
- serial_ports[old_serial_count++] =
- serial_ports[index];
- } else {
- DBG("Replacing legacy port %d\n", index);
- }
- }
- }
- if (index >= MAX_LEGACY_SERIAL_PORTS)
- goto next_port;
- if (index >= old_serial_count)
- old_serial_count = index + 1;
-
- /* Now fill the entry */
- memset(&serial_ports[index], 0, sizeof(struct plat_serial8250_port));
- serial_ports[index].uartclk = clk ? *clk : BASE_BAUD * 16;
- serial_ports[index].iobase = reg->address;
- serial_ports[index].irq = interrupts ? interrupts[0] : 0;
- serial_ports[index].flags = ASYNC_BOOT_AUTOCONF;
-
- DBG("Added legacy port, index: %d, port: %x, irq: %d, clk: %d\n",
- index,
- serial_ports[index].iobase,
- serial_ports[index].irq,
- serial_ports[index].uartclk);
-
- /* Get phys address of IO reg for port 1 */
- if (index != 0)
- goto next_port;
-
- pci = of_get_parent(isa);
- if (!pci) {
- DBG("%s: no pci parent found\n", np->full_name);
- goto next_port;
- }
-
- rangesp = (u32 *)get_property(pci, "ranges", &rlen);
- if (rangesp == NULL) {
- of_node_put(pci);
- goto next_port;
- }
- rlen /= 4;
-
- /* we need the #size-cells of the PCI bridge node itself */
- phys_size = 1;
- sizeprop = (u32 *)get_property(pci, "#size-cells", NULL);
- if (sizeprop != NULL)
- phys_size = *sizeprop;
- /* we need the parent #addr-cells */
- addr_size = prom_n_addr_cells(pci);
- rentsize = 3 + addr_size + phys_size;
- io_base = 0;
- for (;rlen >= rentsize; rlen -= rentsize,rangesp += rentsize) {
- if (((rangesp[0] >> 24) & 0x3) != 1)
- continue; /* not IO space */
- io_base = rangesp[3];
- if (addr_size == 2)
- io_base = (io_base << 32) | rangesp[4];
- }
- if (io_base != 0) {
- *physport = io_base + reg->address;
- if (default_speed && spd)
- *default_speed = *spd;
- }
- of_node_put(pci);
- next_port:
- of_node_put(isa);
- }
-
- DBG(" <- generic_find_legacy_serial_port()\n");
-}
-
-static struct platform_device serial_device = {
- .name = "serial8250",
- .id = PLAT8250_DEV_PLATFORM,
- .dev = {
- .platform_data = serial_ports,
- },
-};
-
-static int __init serial_dev_init(void)
-{
- return platform_device_register(&serial_device);
-}
-arch_initcall(serial_dev_init);
-
-#endif /* CONFIG_PPC_ISERIES */
-
int check_legacy_ioport(unsigned long base_port)
{
if (ppc_md.check_legacy_ioport == NULL)
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -77,6 +77,11 @@ config SERIAL_8250_CS
If unsure, say N.
+config SERIAL_8250_OF
+ bool
+ default y
+ depends on PPC_OF && SERIAL_8250
+
config SERIAL_8250_ACPI
bool "8250/16550 device discovery via ACPI namespace"
default y if IA64
diff --git a/include/asm-ppc/pc_serial.h b/include/asm-ppc/pc_serial.h
--- a/include/asm-ppc/pc_serial.h
+++ b/include/asm-ppc/pc_serial.h
@@ -26,18 +26,4 @@
#define RS_TABLE_SIZE 4
#endif
-/* Standard COM flags (except for COM4, because of the 8514 problem) */
-#ifdef CONFIG_SERIAL_DETECT_IRQ
-#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
-#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
-#else
-#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
-#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
-#endif
-
-#define SERIAL_PORT_DFNS \
- /* UART CLK PORT IRQ FLAGS */ \
- { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
- { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \
- { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \
- { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
+#define SERIAL_PORT_DFNS /* */
--- /dev/null 2005-10-08 11:44:47.528646500 +0100
+++ b/drivers/serial/8250_of.c 2005-11-07 09:51:22.000000000 +0000
@@ -0,0 +1,197 @@
+#include <linux/kernel.h>
+#include <linux/serial.h>
+#include <linux/serial_8250.h>
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/pci.h>
+#include <asm/serial.h>
+#include <asm/prom.h>
+
+#if 0
+#define DBG(fmt...) printk(KERN_DEBUG fmt)
+#else
+#define DBG(fmt...) do { } while (0)
+#endif
+
+/*
+ * This function can be used by platforms to "find" legacy serial ports.
+ * It works for "serial" nodes under an "isa" node, and will try to
+ * respect the "ibm,aix-loc" property if any. It works with up to 8
+ * ports.
+ */
+
+#define MAX_LEGACY_SERIAL_PORTS 8
+static int ports_probed = 0;
+
+static struct plat_serial8250_port serial_ports[MAX_LEGACY_SERIAL_PORTS+1];
+static unsigned int old_serial_count;
+
+void __init generic_find_legacy_serial_ports(u64 *physport,
+ unsigned int *default_speed)
+{
+ struct device_node *np;
+ u32 *sizeprop;
+
+ struct isa_reg_property {
+ u32 space;
+ u32 address;
+ u32 size;
+ };
+
+ DBG(" -> generic_find_legacy_serial_port()\n");
+ ports_probed = 1;
+
+ *physport = 0;
+ if (default_speed)
+ *default_speed = 0;
+
+ np = of_find_node_by_path("/");
+ if (!np)
+ return;
+
+ /* First fill our array */
+ for (np = NULL; (np = of_find_node_by_type(np, "serial"));) {
+ struct device_node *isa, *pci;
+ struct isa_reg_property *reg;
+ unsigned long phys_size, addr_size;
+ u64 io_base;
+ u32 *rangesp;
+ u32 *interrupts, *clk, *spd;
+ char *typep;
+ int index, rlen, rentsize;
+
+ /* Ok, first check if it's under an "isa" parent */
+ isa = of_get_parent(np);
+ if (!isa || strcmp(isa->name, "isa")) {
+ DBG("%s: no isa parent found\n", np->full_name);
+ continue;
+ }
+
+ /* Now look for an "ibm,aix-loc" property that gives us ordering
+ * if any...
+ */
+ typep = (char *)get_property(np, "ibm,aix-loc", NULL);
+
+ /* Get the ISA port number */
+ reg = (struct isa_reg_property *)get_property(np, "reg", NULL);
+ if (reg == NULL)
+ goto next_port;
+ /* We assume the interrupt number isn't translated ... */
+ interrupts = (u32 *)get_property(np, "interrupts", NULL);
+ /* get clock freq. if present */
+ clk = (u32 *)get_property(np, "clock-frequency", NULL);
+ /* get default speed if present */
+ spd = (u32 *)get_property(np, "current-speed", NULL);
+ /* Default to locate at end of array */
+ index = old_serial_count; /* end of the array by default */
+
+ /* If we have a location index, then use it */
+ if (typep && *typep == 'S') {
+ index = simple_strtol(typep+1, NULL, 0) - 1;
+ /* if index is out of range, use end of array instead */
+ if (index >= MAX_LEGACY_SERIAL_PORTS)
+ index = old_serial_count;
+ /* if our index is still out of range, that mean that
+ * array is full, we could scan for a free slot but that
+ * make little sense to bother, just skip the port
+ */
+ if (index >= MAX_LEGACY_SERIAL_PORTS)
+ goto next_port;
+ if (index >= old_serial_count)
+ old_serial_count = index + 1;
+ /* Check if there is a port who already claimed our slot */
+ if (serial_ports[index].iobase != 0) {
+ /* if we still have some room, move it, else override */
+ if (old_serial_count < MAX_LEGACY_SERIAL_PORTS) {
+ DBG("Moved legacy port %d -> %d\n", index,
+ old_serial_count);
+ serial_ports[old_serial_count++] =
+ serial_ports[index];
+ } else {
+ DBG("Replacing legacy port %d\n", index);
+ }
+ }
+ }
+ if (index >= MAX_LEGACY_SERIAL_PORTS)
+ goto next_port;
+ if (index >= old_serial_count)
+ old_serial_count = index + 1;
+
+ /* Now fill the entry */
+ memset(&serial_ports[index], 0, sizeof(struct plat_serial8250_port));
+ serial_ports[index].uartclk = (clk && *clk) ? *clk : BASE_BAUD * 16;
+ serial_ports[index].iobase = reg->address;
+ serial_ports[index].irq = interrupts ? interrupts[0] : 0;
+ serial_ports[index].flags = ASYNC_BOOT_AUTOCONF;
+
+ DBG("Added legacy port, index: %d, port: %x, irq: %d, clk: %d\n",
+ index,
+ serial_ports[index].iobase,
+ serial_ports[index].irq,
+ serial_ports[index].uartclk);
+
+ /* Get phys address of IO reg for port 1 */
+ if (index != 0)
+ goto next_port;
+
+ pci = of_get_parent(isa);
+ if (!pci) {
+ DBG("%s: no pci parent found\n", np->full_name);
+ goto next_port;
+ }
+
+ rangesp = (u32 *)get_property(pci, "ranges", &rlen);
+ if (rangesp == NULL) {
+ of_node_put(pci);
+ goto next_port;
+ }
+ rlen /= 4;
+
+ /* we need the #size-cells of the PCI bridge node itself */
+ phys_size = 1;
+ sizeprop = (u32 *)get_property(pci, "#size-cells", NULL);
+ if (sizeprop != NULL)
+ phys_size = *sizeprop;
+ /* we need the parent #addr-cells */
+ addr_size = prom_n_addr_cells(pci);
+ rentsize = 3 + addr_size + phys_size;
+ io_base = 0;
+ for (;rlen >= rentsize; rlen -= rentsize,rangesp += rentsize) {
+ if (((rangesp[0] >> 24) & 0x3) != 1)
+ continue; /* not IO space */
+ io_base = rangesp[3];
+ if (addr_size == 2)
+ io_base = (io_base << 32) | rangesp[4];
+ }
+ if (io_base != 0) {
+ *physport = io_base + reg->address;
+ if (default_speed && spd)
+ *default_speed = *spd;
+ }
+ of_node_put(pci);
+ next_port:
+ of_node_put(isa);
+ }
+
+ DBG(" <- generic_find_legacy_serial_port()\n");
+}
+
+static struct platform_device serial_device = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev = {
+ .platform_data = serial_ports,
+ },
+};
+
+static int __init serial_dev_init(void)
+{
+ u64 phys;
+ unsigned int spd;
+
+ if (!ports_probed)
+ generic_find_legacy_serial_ports(&phys, &spd);
+ return platform_device_register(&serial_device);
+}
+arch_initcall(serial_dev_init);
--
dwmw2
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Fix 8250 probe on ppc32
2005-11-07 10:04 [PATCH] Fix 8250 probe on ppc32 David Woodhouse
@ 2005-11-07 16:09 ` Tom Rini
2005-11-07 16:20 ` David Woodhouse
0 siblings, 1 reply; 19+ messages in thread
From: Tom Rini @ 2005-11-07 16:09 UTC (permalink / raw)
To: David Woodhouse; +Cc: linuxppc-dev
On Mon, Nov 07, 2005 at 10:04:17AM +0000, David Woodhouse wrote:
> This fairly much obsoletes include/asm-ppc/pc_serial.h -- other machines
> with 8250 ports which are currently responsible for the mess in
> include/asm-ppc/serial.h itself should be converted to a platform_device
> of their own before they become supported in arch/powerpc.
That depends on what we're going to expect out of arch/powerpc/boot,
which I'm talking with Paul about. But..
> --- /dev/null 2005-10-08 11:44:47.528646500 +0100
> +++ b/drivers/serial/8250_of.c 2005-11-07 09:51:22.000000000 +0000
> @@ -0,0 +1,197 @@
> +#include <linux/kernel.h>
[snip]
> +#if 0
> +#define DBG(fmt...) printk(KERN_DEBUG fmt)
> +#else
> +#define DBG(fmt...) do { } while (0)
> +#endif
pr_debug(), line wrap and a legal boilerplate
(arch/ppc/platforms/lopec.c has the smallest one our laywers could come
up with) ? :)
--
Tom Rini
http://gate.crashing.org/~trini/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Fix 8250 probe on ppc32
2005-11-07 16:09 ` Tom Rini
@ 2005-11-07 16:20 ` David Woodhouse
2005-11-07 16:31 ` Tom Rini
2005-11-07 16:54 ` Christoph Hellwig
0 siblings, 2 replies; 19+ messages in thread
From: David Woodhouse @ 2005-11-07 16:20 UTC (permalink / raw)
To: Tom Rini; +Cc: linuxppc-dev
On Mon, 2005-11-07 at 09:09 -0700, Tom Rini wrote:
> That depends on what we're going to expect out of arch/powerpc/boot,
> which I'm talking with Paul about.
I'd be quite happy to see the bootloader code kept separate from the
kernel in future.
Fedora's ppc64-utils package currently has a 'mkzimage' script and a
bootloader stub based on what's in arch/ppc64/kernel, but modified to be
capable of loading 32-bit kernels too. We can quite happily put together
the stub, the vmlinux and the initrd after the fact.
I don't really see why any of the other stubs necessarily need to live
with the kernel either.
--
dwmw2
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Fix 8250 probe on ppc32
2005-11-07 16:20 ` David Woodhouse
@ 2005-11-07 16:31 ` Tom Rini
2005-11-07 17:25 ` Dan Malek
2005-11-07 16:54 ` Christoph Hellwig
1 sibling, 1 reply; 19+ messages in thread
From: Tom Rini @ 2005-11-07 16:31 UTC (permalink / raw)
To: David Woodhouse; +Cc: linuxppc-dev
On Mon, Nov 07, 2005 at 04:20:22PM +0000, David Woodhouse wrote:
> On Mon, 2005-11-07 at 09:09 -0700, Tom Rini wrote:
> > That depends on what we're going to expect out of arch/powerpc/boot,
> > which I'm talking with Paul about.
>
> I'd be quite happy to see the bootloader code kept separate from the
> kernel in future.
>
> Fedora's ppc64-utils package currently has a 'mkzimage' script and a
> bootloader stub based on what's in arch/ppc64/kernel, but modified to be
> capable of loading 32-bit kernels too. We can quite happily put together
> the stub, the vmlinux and the initrd after the fact.
I've always found it quite handy, and thought it was a good new user
experiance that they could just build and boot the kernel with just the
kernel tarball around. If everything going forward ships from the hw
vendor with U-Boot, that's less of an issue, but I don't know how likely
!Freescale is to change.
> I don't really see why any of the other stubs necessarily need to live
> with the kernel either.
Avoiding duplication of hardware defines (serial, whack-a-device, etc)
has been part of it.
--
Tom Rini
http://gate.crashing.org/~trini/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Fix 8250 probe on ppc32
2005-11-07 16:20 ` David Woodhouse
2005-11-07 16:31 ` Tom Rini
@ 2005-11-07 16:54 ` Christoph Hellwig
2005-11-07 17:02 ` David Woodhouse
1 sibling, 1 reply; 19+ messages in thread
From: Christoph Hellwig @ 2005-11-07 16:54 UTC (permalink / raw)
To: David Woodhouse; +Cc: Tom Rini, linuxppc-dev
On Mon, Nov 07, 2005 at 04:20:22PM +0000, David Woodhouse wrote:
> Fedora's ppc64-utils package currently has a 'mkzimage' script and a
> bootloader stub based on what's in arch/ppc64/kernel, but modified to be
> capable of loading 32-bit kernels too. We can quite happily put together
> the stub, the vmlinux and the initrd after the fact.
What about putting that into the kernel tree so it can be built as part
of make boot.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Fix 8250 probe on ppc32
2005-11-07 16:54 ` Christoph Hellwig
@ 2005-11-07 17:02 ` David Woodhouse
2005-11-16 8:51 ` David Woodhouse
0 siblings, 1 reply; 19+ messages in thread
From: David Woodhouse @ 2005-11-07 17:02 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Tom Rini, linuxppc-dev
On Mon, 2005-11-07 at 17:54 +0100, Christoph Hellwig wrote:
> What about putting that into the kernel tree so it can be built as
> part of make boot.
The mkzimage script? That doesn't make a lot of sense. The whole point
in that is to build the zImage _separately_ from the kernel. The kernel
is already capable of making the zImage by itself as part of the build
process.
Or do you just mean the trivial patch to make arch/ppc64/boot/ capable
of loading a 32-bit kernel? That'll make sense if that code gets moved
to arch/powerpc/boot, and I'll do so then.
--
dwmw2
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Fix 8250 probe on ppc32
2005-11-07 16:31 ` Tom Rini
@ 2005-11-07 17:25 ` Dan Malek
0 siblings, 0 replies; 19+ messages in thread
From: Dan Malek @ 2005-11-07 17:25 UTC (permalink / raw)
To: Tom Rini; +Cc: linuxppc-dev, David Woodhouse
On Nov 7, 2005, at 11:31 AM, Tom Rini wrote:
> ..... If everything going forward ships from the hw
> vendor with U-Boot,
You can't make that assumption. Very few production
systems ship with U-Boot, whether we like it or not.
For those of us that developed all of this "boot wrapper"
code and remember why it was done, all of those reasons
still exist. More people are using U-Boot, but it's mostly
during development. The other embedded software we
are trying to displace with Linux sometimes doesn't have
the rom space, and there is the "we didn't have it before"
mentality that is hard to change.
Don't cast this old boot code too far away, people still use it.
Thanks.
-- Dan
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Fix 8250 probe on ppc32
2005-11-07 17:02 ` David Woodhouse
@ 2005-11-16 8:51 ` David Woodhouse
2005-11-16 9:12 ` Paul Mackerras
0 siblings, 1 reply; 19+ messages in thread
From: David Woodhouse @ 2005-11-16 8:51 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Tom Rini, linuxppc-dev
On Mon, 2005-11-07 at 17:02 +0000, David Woodhouse wrote:
> Or do you just mean the trivial patch to make arch/ppc64/boot/ capable
> of loading a 32-bit kernel? That'll make sense if that code gets moved
> to arch/powerpc/boot, and I'll do so then.
.... except that it seems to have been done already -- the code which
just landed in arch/powerpc/boot can already load a 32-bit kernel.
--
dwmw2
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Fix 8250 probe on ppc32
2005-11-16 8:51 ` David Woodhouse
@ 2005-11-16 9:12 ` Paul Mackerras
2005-11-16 10:25 ` David Woodhouse
0 siblings, 1 reply; 19+ messages in thread
From: Paul Mackerras @ 2005-11-16 9:12 UTC (permalink / raw)
To: David Woodhouse; +Cc: Tom Rini, linuxppc-dev
David Woodhouse writes:
> .... except that it seems to have been done already -- the code which
> just landed in arch/powerpc/boot can already load a 32-bit kernel.
Yes, it works on newworld (at least it does on my G4 powerbook). It
should work on 32-bit CHRP with any luck, but for oldworld we'll have
to generate a COFF file.
Paul.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Fix 8250 probe on ppc32
2005-11-16 9:12 ` Paul Mackerras
@ 2005-11-16 10:25 ` David Woodhouse
2005-11-16 15:24 ` Kumar Gala
2005-11-18 1:12 ` Paul Mackerras
0 siblings, 2 replies; 19+ messages in thread
From: David Woodhouse @ 2005-11-16 10:25 UTC (permalink / raw)
To: Paul Mackerras; +Cc: Tom Rini, linuxppc-dev
On Wed, 2005-11-16 at 20:12 +1100, Paul Mackerras wrote:
> Yes, it works on newworld (at least it does on my G4 powerbook). It
> should work on 32-bit CHRP with any luck, but for oldworld we'll have
> to generate a COFF file.
I'll try it on Pegasos some time tonight or tomorrow. AFAICT I'm going
to need the patch which started this thread, if I want any serial ports
on my Pegasos. The newly-created asm-powerpc/serial.h file is devoid of
serial port definitions.
Here it is again, with Tom's three criticisms addressed, deliberately
ignored, and addressed. In that order.
It no longer touches asm-ppc/serial.h, so doesn't break the legacy
zImage.
---
[PATCH] Fix 8250 probe on ppc32
There are no serial ports defined in the new asm-powerpc/serial.h, and
rightly so. The 64-bit setup code has a routine to look in the device
tree for them and register a platform_device for any we find there; this
patch steals that routine and makes it available on 32-bit machines
too...
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
--- linux-2.6.14/drivers/serial/Makefile~ 2005-11-07 22:17:27.000000000 -0500
+++ linux-2.6.14/drivers/serial/Makefile 2005-11-07 22:17:35.000000000 -0500
@@ -22,6 +22,7 @@ obj-$(CONFIG_SERIAL_8250_ACCENT) += 8250
obj-$(CONFIG_SERIAL_8250_BOCA) += 8250_boca.o
obj-$(CONFIG_SERIAL_8250_HUB6) += 8250_hub6.o
obj-$(CONFIG_SERIAL_8250_MCA) += 8250_mca.o
+obj-$(CONFIG_SERIAL_8250_OF) += 8250_of.o
obj-$(CONFIG_SERIAL_8250_AU1X00) += 8250_au1x00.o
obj-$(CONFIG_SERIAL_AMBA_PL010) += amba-pl010.o
obj-$(CONFIG_SERIAL_AMBA_PL011) += amba-pl011.o
--- linux-2.6.13/drivers/serial/8250_of.c.sof 2005-10-20 13:19:07.000000000 +0100
+++ linux-2.6.13/drivers/serial/8250_of.c 2005-10-20 13:19:26.000000000 +0100
@@ -0,0 +1,206 @@
+/*
+ * Search OpenFirmware device tree for 8250-compatible serial ports
+ *
+ * Moved from arch/powerpc/kernel/setup_64.c:
+ *
+ * Copyright (C) 2001 PPC64, IBM Corp
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#undef DEBUG
+
+#include <linux/kernel.h>
+#include <linux/serial.h>
+#include <linux/serial_8250.h>
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/pci.h>
+#include <asm/serial.h>
+#include <asm/prom.h>
+
+/*
+ * This function can be used by platforms to "find" legacy serial ports.
+ * It works for "serial" nodes under an "isa" node, and will try to
+ * respect the "ibm,aix-loc" property if any. It works with up to 8
+ * ports.
+ */
+
+#define MAX_LEGACY_SERIAL_PORTS 8
+static int ports_probed = 0;
+
+static struct plat_serial8250_port serial_ports[MAX_LEGACY_SERIAL_PORTS+1];
+static unsigned int old_serial_count;
+
+void __init generic_find_legacy_serial_ports(u64 *physport,
+ unsigned int *default_speed)
+{
+ struct device_node *np;
+ u32 *sizeprop;
+
+ struct isa_reg_property {
+ u32 space;
+ u32 address;
+ u32 size;
+ };
+
+ pr_debug(" -> generic_find_legacy_serial_port()\n");
+ ports_probed = 1;
+
+ *physport = 0;
+ if (default_speed)
+ *default_speed = 0;
+
+ np = of_find_node_by_path("/");
+ if (!np)
+ return;
+
+ /* First fill our array */
+ for (np = NULL; (np = of_find_node_by_type(np, "serial"));) {
+ struct device_node *isa, *pci;
+ struct isa_reg_property *reg;
+ unsigned long phys_size, addr_size;
+ u64 io_base;
+ u32 *rangesp;
+ u32 *interrupts, *clk, *spd;
+ char *typep;
+ int index, rlen, rentsize;
+
+ /* Ok, first check if it's under an "isa" parent */
+ isa = of_get_parent(np);
+ if (!isa || strcmp(isa->name, "isa")) {
+ pr_debug("%s: no isa parent found\n", np->full_name);
+ continue;
+ }
+
+ /* Now look for an "ibm,aix-loc" property that gives us ordering
+ * if any...
+ */
+ typep = (char *)get_property(np, "ibm,aix-loc", NULL);
+
+ /* Get the ISA port number */
+ reg = (struct isa_reg_property *)get_property(np, "reg", NULL);
+ if (reg == NULL)
+ goto next_port;
+ /* We assume the interrupt number isn't translated ... */
+ interrupts = (u32 *)get_property(np, "interrupts", NULL);
+ /* get clock freq. if present */
+ clk = (u32 *)get_property(np, "clock-frequency", NULL);
+ /* get default speed if present */
+ spd = (u32 *)get_property(np, "current-speed", NULL);
+ /* Default to locate at end of array */
+ index = old_serial_count; /* end of the array by default */
+
+ /* If we have a location index, then use it */
+ if (typep && *typep == 'S') {
+ index = simple_strtol(typep+1, NULL, 0) - 1;
+ /* if index is out of range, use end of array instead */
+ if (index >= MAX_LEGACY_SERIAL_PORTS)
+ index = old_serial_count;
+ /* if our index is still out of range, that mean that
+ * array is full, we could scan for a free slot but that
+ * make little sense to bother, just skip the port
+ */
+ if (index >= MAX_LEGACY_SERIAL_PORTS)
+ goto next_port;
+ if (index >= old_serial_count)
+ old_serial_count = index + 1;
+ /* Check if there is a port who already claimed our slot */
+ if (serial_ports[index].iobase != 0) {
+ /* if we still have some room, move it, else override */
+ if (old_serial_count < MAX_LEGACY_SERIAL_PORTS) {
+ pr_debug("Moved legacy port %d -> %d\n", index,
+ old_serial_count);
+ serial_ports[old_serial_count++] =
+ serial_ports[index];
+ } else {
+ pr_debug("Replacing legacy port %d\n", index);
+ }
+ }
+ }
+ if (index >= MAX_LEGACY_SERIAL_PORTS)
+ goto next_port;
+ if (index >= old_serial_count)
+ old_serial_count = index + 1;
+
+ /* Now fill the entry */
+ memset(&serial_ports[index], 0, sizeof(struct plat_serial8250_port));
+ serial_ports[index].uartclk = (clk && *clk) ? *clk : BASE_BAUD * 16;
+ serial_ports[index].iobase = reg->address;
+ serial_ports[index].irq = interrupts ? interrupts[0] : 0;
+ serial_ports[index].flags = ASYNC_BOOT_AUTOCONF;
+
+ pr_debug("Added legacy port, index: %d, port: %x, irq: %d, clk: %d\n",
+ index,
+ serial_ports[index].iobase,
+ serial_ports[index].irq,
+ serial_ports[index].uartclk);
+
+ /* Get phys address of IO reg for port 1 */
+ if (index != 0)
+ goto next_port;
+
+ pci = of_get_parent(isa);
+ if (!pci) {
+ pr_debug("%s: no pci parent found\n", np->full_name);
+ goto next_port;
+ }
+
+ rangesp = (u32 *)get_property(pci, "ranges", &rlen);
+ if (rangesp == NULL) {
+ of_node_put(pci);
+ goto next_port;
+ }
+ rlen /= 4;
+
+ /* we need the #size-cells of the PCI bridge node itself */
+ phys_size = 1;
+ sizeprop = (u32 *)get_property(pci, "#size-cells", NULL);
+ if (sizeprop != NULL)
+ phys_size = *sizeprop;
+ /* we need the parent #addr-cells */
+ addr_size = prom_n_addr_cells(pci);
+ rentsize = 3 + addr_size + phys_size;
+ io_base = 0;
+ for (;rlen >= rentsize; rlen -= rentsize,rangesp += rentsize) {
+ if (((rangesp[0] >> 24) & 0x3) != 1)
+ continue; /* not IO space */
+ io_base = rangesp[3];
+ if (addr_size == 2)
+ io_base = (io_base << 32) | rangesp[4];
+ }
+ if (io_base != 0) {
+ *physport = io_base + reg->address;
+ if (default_speed && spd)
+ *default_speed = *spd;
+ }
+ of_node_put(pci);
+ next_port:
+ of_node_put(isa);
+ }
+
+ pr_debug(" <- generic_find_legacy_serial_port()\n");
+}
+
+static struct platform_device serial_device = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev = {
+ .platform_data = serial_ports,
+ },
+};
+
+static int __init serial_dev_init(void)
+{
+ u64 phys;
+ unsigned int spd;
+
+ if (!ports_probed)
+ generic_find_legacy_serial_ports(&phys, &spd);
+ return platform_device_register(&serial_device);
+}
+arch_initcall(serial_dev_init);
--- linux-2.6.13/drivers/serial/Kconfig.sof 2005-10-20 12:54:48.000000000 +0100
+++ linux-2.6.13/drivers/serial/Kconfig 2005-10-20 13:05:39.000000000 +0100
@@ -77,6 +77,11 @@ config SERIAL_8250_CS
If unsure, say N.
+config SERIAL_8250_OF
+ bool
+ default y
+ depends on PPC_OF && SERIAL_8250 && PPC_MERGE
+
config SERIAL_8250_ACPI
bool "8250/16550 device discovery via ACPI namespace"
default y if IA64
--- linux-2.6.13/arch/powerpc/kernel/setup_64.c.sof 2005-10-20 13:13:08.000000000 +0100
+++ linux-2.6.13/arch/powerpc/kernel/setup_64.c 2005-10-20 13:16:28.000000000 +0100
@@ -31,8 +31,6 @@
#include <linux/notifier.h>
#include <linux/cpu.h>
#include <linux/unistd.h>
-#include <linux/serial.h>
-#include <linux/serial_8250.h>
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/processor.h>
@@ -52,7 +50,6 @@
#include <asm/system.h>
#include <asm/rtas.h>
#include <asm/iommu.h>
-#include <asm/serial.h>
#include <asm/cache.h>
#include <asm/page.h>
#include <asm/mmu.h>
@@ -1104,187 +1101,6 @@ void __init setup_default_decr(void)
lpaca->next_jiffy_update_tb = get_tb() + tb_ticks_per_jiffy;
}
-#ifndef CONFIG_PPC_ISERIES
-/*
- * This function can be used by platforms to "find" legacy serial ports.
- * It works for "serial" nodes under an "isa" node, and will try to
- * respect the "ibm,aix-loc" property if any. It works with up to 8
- * ports.
- */
-
-#define MAX_LEGACY_SERIAL_PORTS 8
-static struct plat_serial8250_port serial_ports[MAX_LEGACY_SERIAL_PORTS+1];
-static unsigned int old_serial_count;
-
-void __init generic_find_legacy_serial_ports(u64 *physport,
- unsigned int *default_speed)
-{
- struct device_node *np;
- u32 *sizeprop;
-
- struct isa_reg_property {
- u32 space;
- u32 address;
- u32 size;
- };
- struct pci_reg_property {
- struct pci_address addr;
- u32 size_hi;
- u32 size_lo;
- };
-
- DBG(" -> generic_find_legacy_serial_port()\n");
-
- *physport = 0;
- if (default_speed)
- *default_speed = 0;
-
- np = of_find_node_by_path("/");
- if (!np)
- return;
-
- /* First fill our array */
- for (np = NULL; (np = of_find_node_by_type(np, "serial"));) {
- struct device_node *isa, *pci;
- struct isa_reg_property *reg;
- unsigned long phys_size, addr_size, io_base;
- u32 *rangesp;
- u32 *interrupts, *clk, *spd;
- char *typep;
- int index, rlen, rentsize;
-
- /* Ok, first check if it's under an "isa" parent */
- isa = of_get_parent(np);
- if (!isa || strcmp(isa->name, "isa")) {
- DBG("%s: no isa parent found\n", np->full_name);
- continue;
- }
-
- /* Now look for an "ibm,aix-loc" property that gives us ordering
- * if any...
- */
- typep = (char *)get_property(np, "ibm,aix-loc", NULL);
-
- /* Get the ISA port number */
- reg = (struct isa_reg_property *)get_property(np, "reg", NULL);
- if (reg == NULL)
- goto next_port;
- /* We assume the interrupt number isn't translated ... */
- interrupts = (u32 *)get_property(np, "interrupts", NULL);
- /* get clock freq. if present */
- clk = (u32 *)get_property(np, "clock-frequency", NULL);
- /* get default speed if present */
- spd = (u32 *)get_property(np, "current-speed", NULL);
- /* Default to locate at end of array */
- index = old_serial_count; /* end of the array by default */
-
- /* If we have a location index, then use it */
- if (typep && *typep == 'S') {
- index = simple_strtol(typep+1, NULL, 0) - 1;
- /* if index is out of range, use end of array instead */
- if (index >= MAX_LEGACY_SERIAL_PORTS)
- index = old_serial_count;
- /* if our index is still out of range, that mean that
- * array is full, we could scan for a free slot but that
- * make little sense to bother, just skip the port
- */
- if (index >= MAX_LEGACY_SERIAL_PORTS)
- goto next_port;
- if (index >= old_serial_count)
- old_serial_count = index + 1;
- /* Check if there is a port who already claimed our slot */
- if (serial_ports[index].iobase != 0) {
- /* if we still have some room, move it, else override */
- if (old_serial_count < MAX_LEGACY_SERIAL_PORTS) {
- DBG("Moved legacy port %d -> %d\n", index,
- old_serial_count);
- serial_ports[old_serial_count++] =
- serial_ports[index];
- } else {
- DBG("Replacing legacy port %d\n", index);
- }
- }
- }
- if (index >= MAX_LEGACY_SERIAL_PORTS)
- goto next_port;
- if (index >= old_serial_count)
- old_serial_count = index + 1;
-
- /* Now fill the entry */
- memset(&serial_ports[index], 0, sizeof(struct plat_serial8250_port));
- serial_ports[index].uartclk = clk ? *clk : BASE_BAUD * 16;
- serial_ports[index].iobase = reg->address;
- serial_ports[index].irq = interrupts ? interrupts[0] : 0;
- serial_ports[index].flags = ASYNC_BOOT_AUTOCONF;
-
- DBG("Added legacy port, index: %d, port: %x, irq: %d, clk: %d\n",
- index,
- serial_ports[index].iobase,
- serial_ports[index].irq,
- serial_ports[index].uartclk);
-
- /* Get phys address of IO reg for port 1 */
- if (index != 0)
- goto next_port;
-
- pci = of_get_parent(isa);
- if (!pci) {
- DBG("%s: no pci parent found\n", np->full_name);
- goto next_port;
- }
-
- rangesp = (u32 *)get_property(pci, "ranges", &rlen);
- if (rangesp == NULL) {
- of_node_put(pci);
- goto next_port;
- }
- rlen /= 4;
-
- /* we need the #size-cells of the PCI bridge node itself */
- phys_size = 1;
- sizeprop = (u32 *)get_property(pci, "#size-cells", NULL);
- if (sizeprop != NULL)
- phys_size = *sizeprop;
- /* we need the parent #addr-cells */
- addr_size = prom_n_addr_cells(pci);
- rentsize = 3 + addr_size + phys_size;
- io_base = 0;
- for (;rlen >= rentsize; rlen -= rentsize,rangesp += rentsize) {
- if (((rangesp[0] >> 24) & 0x3) != 1)
- continue; /* not IO space */
- io_base = rangesp[3];
- if (addr_size == 2)
- io_base = (io_base << 32) | rangesp[4];
- }
- if (io_base != 0) {
- *physport = io_base + reg->address;
- if (default_speed && spd)
- *default_speed = *spd;
- }
- of_node_put(pci);
- next_port:
- of_node_put(isa);
- }
-
- DBG(" <- generic_find_legacy_serial_port()\n");
-}
-
-static struct platform_device serial_device = {
- .name = "serial8250",
- .id = PLAT8250_DEV_PLATFORM,
- .dev = {
- .platform_data = serial_ports,
- },
-};
-
-static int __init serial_dev_init(void)
-{
- return platform_device_register(&serial_device);
-}
-arch_initcall(serial_dev_init);
-
-#endif /* CONFIG_PPC_ISERIES */
-
int check_legacy_ioport(unsigned long base_port)
{
if (ppc_md.check_legacy_ioport == NULL)
--
dwmw2
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Fix 8250 probe on ppc32
2005-11-16 10:25 ` David Woodhouse
@ 2005-11-16 15:24 ` Kumar Gala
2005-11-18 1:12 ` Paul Mackerras
1 sibling, 0 replies; 19+ messages in thread
From: Kumar Gala @ 2005-11-16 15:24 UTC (permalink / raw)
To: David Woodhouse; +Cc: Tom Rini, linuxppc-dev
On Nov 16, 2005, at 4:25 AM, David Woodhouse wrote:
> On Wed, 2005-11-16 at 20:12 +1100, Paul Mackerras wrote:
>> Yes, it works on newworld (at least it does on my G4 powerbook). It
>> should work on 32-bit CHRP with any luck, but for oldworld we'll have
>> to generate a COFF file.
>
> I'll try it on Pegasos some time tonight or tomorrow. AFAICT I'm going
> to need the patch which started this thread, if I want any serial
> ports
> on my Pegasos. The newly-created asm-powerpc/serial.h file is
> devoid of
> serial port definitions.
>
> Here it is again, with Tom's three criticisms addressed, deliberately
> ignored, and addressed. In that order.
>
> It no longer touches asm-ppc/serial.h, so doesn't break the legacy
> zImage.
>
> ---
> [PATCH] Fix 8250 probe on ppc32
>
> There are no serial ports defined in the new asm-powerpc/serial.h, and
> rightly so. The 64-bit setup code has a routine to look in the device
> tree for them and register a platform_device for any we find there;
> this
> patch steals that routine and makes it available on 32-bit machines
> too...
>
> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
>
[snip]
> --- linux-2.6.13/drivers/serial/Kconfig.sof 2005-10-20
> 12:54:48.000000000 +0100
> +++ linux-2.6.13/drivers/serial/Kconfig 2005-10-20
> 13:05:39.000000000 +0100
> @@ -77,6 +77,11 @@ config SERIAL_8250_CS
>
> If unsure, say N.
>
> +config SERIAL_8250_OF
> + bool
> + default y
> + depends on PPC_OF && SERIAL_8250 && PPC_MERGE
> +
> config SERIAL_8250_ACPI
> bool "8250/16550 device discovery via ACPI namespace"
> default y if IA64
[snip]
Should this really depend on PPC_OF? Does it require true
OpenFirmware or just a flat dev tree to work?
I ask because I'd like to extended this in the future to handle 8250
serial ports that aren't on a PCI or ISA bus, but on SoCs like 83xx,
85xx, 86xx, 4xx? These will most likely not be running with true OF
but I've got a flat dev tree working today.
The following is what I've been toying with for an description of the
8250 node (in .dts format):
serial@4500 {
device_type = "serial";
compatible = "ns16550";
reg = <4500 100>;
clock-frequency = <0>;
interrupts = <1a 3>;
interrupt-parent = <40000>;
};
- kumar
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Fix 8250 probe on ppc32
2005-11-16 10:25 ` David Woodhouse
2005-11-16 15:24 ` Kumar Gala
@ 2005-11-18 1:12 ` Paul Mackerras
2005-11-18 3:26 ` Kumar Gala
1 sibling, 1 reply; 19+ messages in thread
From: Paul Mackerras @ 2005-11-18 1:12 UTC (permalink / raw)
To: David Woodhouse; +Cc: Tom Rini, linuxppc-dev
David Woodhouse writes:
> I'll try it on Pegasos some time tonight or tomorrow. AFAICT I'm going
> to need the patch which started this thread, if I want any serial ports
> on my Pegasos. The newly-created asm-powerpc/serial.h file is devoid of
> serial port definitions.
This intersects with some more ambitious reworking Ben H is doing, so
I won't put this one in.
Paul.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Fix 8250 probe on ppc32
2005-11-18 1:12 ` Paul Mackerras
@ 2005-11-18 3:26 ` Kumar Gala
2005-11-18 3:50 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 19+ messages in thread
From: Kumar Gala @ 2005-11-18 3:26 UTC (permalink / raw)
To: Paul Mackerras, Benjamin Herrenschmidt
Cc: Tom Rini, David Woodhouse, linuxppc-dev list
Paul or BenH,
Would you like to enlighten us on this ambitious rework?
- kumar
On Nov 17, 2005, at 7:12 PM, Paul Mackerras wrote:
> David Woodhouse writes:
>
>> I'll try it on Pegasos some time tonight or tomorrow. AFAICT I'm
>> going
>> to need the patch which started this thread, if I want any serial
>> ports
>> on my Pegasos. The newly-created asm-powerpc/serial.h file is
>> devoid of
>> serial port definitions.
>
> This intersects with some more ambitious reworking Ben H is doing, so
> I won't put this one in.
>
> Paul.
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Fix 8250 probe on ppc32
2005-11-18 3:26 ` Kumar Gala
@ 2005-11-18 3:50 ` Benjamin Herrenschmidt
2005-11-18 8:23 ` Christoph Hellwig
0 siblings, 1 reply; 19+ messages in thread
From: Benjamin Herrenschmidt @ 2005-11-18 3:50 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev list, David Woodhouse, Tom Rini
On Thu, 2005-11-17 at 21:26 -0600, Kumar Gala wrote:
> Paul or BenH,
>
> Would you like to enlighten us on this ambitious rework?
First, some better & more generic routines for translating addresses
from the device-tree, and some more generic code for looking for
standard serial port using the above routines, among others ... also,
set_preferred_console gets modified to use the previous list so it can
detect the ports more reliably, etc ....
Ben.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Fix 8250 probe on ppc32
2005-11-18 3:50 ` Benjamin Herrenschmidt
@ 2005-11-18 8:23 ` Christoph Hellwig
2005-11-18 10:51 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 19+ messages in thread
From: Christoph Hellwig @ 2005-11-18 8:23 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list, David Woodhouse, Tom Rini
On Fri, Nov 18, 2005 at 02:50:17PM +1100, Benjamin Herrenschmidt wrote:
> On Thu, 2005-11-17 at 21:26 -0600, Kumar Gala wrote:
> > Paul or BenH,
> >
> > Would you like to enlighten us on this ambitious rework?
>
> First, some better & more generic routines for translating addresses
> from the device-tree, and some more generic code for looking for
> standard serial port using the above routines, among others ... also,
> set_preferred_console gets modified to use the previous list so it can
> detect the ports more reliably, etc ....
so as a start can we move the code to a place in arch/powerpc/ where
it can bee used by ppc32 _now_ because it fixes a real problem? You
can add your encehancements whenever you get time to actually do it.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Fix 8250 probe on ppc32
2005-11-18 8:23 ` Christoph Hellwig
@ 2005-11-18 10:51 ` Benjamin Herrenschmidt
2005-11-18 14:46 ` Kumar Gala
0 siblings, 1 reply; 19+ messages in thread
From: Benjamin Herrenschmidt @ 2005-11-18 10:51 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linuxppc-dev list, David Woodhouse, Tom Rini
On Fri, 2005-11-18 at 09:23 +0100, Christoph Hellwig wrote:
> On Fri, Nov 18, 2005 at 02:50:17PM +1100, Benjamin Herrenschmidt wrote:
> > On Thu, 2005-11-17 at 21:26 -0600, Kumar Gala wrote:
> > > Paul or BenH,
> > >
> > > Would you like to enlighten us on this ambitious rework?
> >
> > First, some better & more generic routines for translating addresses
> > from the device-tree, and some more generic code for looking for
> > standard serial port using the above routines, among others ... also,
> > set_preferred_console gets modified to use the previous list so it can
> > detect the ports more reliably, etc ....
>
> so as a start can we move the code to a place in arch/powerpc/ where
> it can bee used by ppc32 _now_ because it fixes a real problem? You
> can add your encehancements whenever you get time to actually do it.
My patch makes it ppc32 too :) udbg gets build on ppc32 along with early
console etc... all with the same code path as ppc64. I still need to
test it on more hw and fix a few problems and hopefully will post it
before the week-end is over.
Ben
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Fix 8250 probe on ppc32
2005-11-18 10:51 ` Benjamin Herrenschmidt
@ 2005-11-18 14:46 ` Kumar Gala
2005-11-18 21:36 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 19+ messages in thread
From: Kumar Gala @ 2005-11-18 14:46 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list, David Woodhouse, Tom Rini
On Nov 18, 2005, at 4:51 AM, Benjamin Herrenschmidt wrote:
> On Fri, 2005-11-18 at 09:23 +0100, Christoph Hellwig wrote:
>> On Fri, Nov 18, 2005 at 02:50:17PM +1100, Benjamin Herrenschmidt
>> wrote:
>>> On Thu, 2005-11-17 at 21:26 -0600, Kumar Gala wrote:
>>>> Paul or BenH,
>>>>
>>>> Would you like to enlighten us on this ambitious rework?
>>>
>>> First, some better & more generic routines for translating addresses
>>> from the device-tree, and some more generic code for looking for
>>> standard serial port using the above routines, among others ...
>>> also,
>>> set_preferred_console gets modified to use the previous list so
>>> it can
>>> detect the ports more reliably, etc ....
>>
>> so as a start can we move the code to a place in arch/powerpc/ where
>> it can bee used by ppc32 _now_ because it fixes a real problem? You
>> can add your encehancements whenever you get time to actually do it.
>
> My patch makes it ppc32 too :) udbg gets build on ppc32 along with
> early
> console etc... all with the same code path as ppc64. I still need to
> test it on more hw and fix a few problems and hopefully will post it
> before the week-end is over.
How early on can we use udbg? I'd be interested to see how this is
going to work out for 4xx/83xx/85xx w/built-in 8250's.
- kumar
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Fix 8250 probe on ppc32
2005-11-18 14:46 ` Kumar Gala
@ 2005-11-18 21:36 ` Benjamin Herrenschmidt
2005-11-18 21:39 ` David Woodhouse
0 siblings, 1 reply; 19+ messages in thread
From: Benjamin Herrenschmidt @ 2005-11-18 21:36 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev list, David Woodhouse, Tom Rini
> How early on can we use udbg? I'd be interested to see how this is
> going to work out for 4xx/83xx/85xx w/built-in 8250's.
As soon as you can get something mapped I suppose... On ppc32 with
BootX, I setup a BAT in head.S, thus udbg is available in
machine_init(). On ppc64 with hypervisor console, we can enable hacks
that initialize udbg in real mode.
Ben.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Fix 8250 probe on ppc32
2005-11-18 21:36 ` Benjamin Herrenschmidt
@ 2005-11-18 21:39 ` David Woodhouse
0 siblings, 0 replies; 19+ messages in thread
From: David Woodhouse @ 2005-11-18 21:39 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list, Tom Rini
On Sat, 2005-11-19 at 08:36 +1100, Benjamin Herrenschmidt wrote:
> As soon as you can get something mapped I suppose... On ppc32 with
> BootX, I setup a BAT in head.S, thus udbg is available in
> machine_init(). On ppc64 with hypervisor console, we can enable hacks
> that initialize udbg in real mode.
About the same time as you can first call register_console() with it
then.
I always used to call serial8250_console_init() from the beginning of
setup_arch() if I wanted that kind of thing.
--
dwmw2
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2005-11-18 21:39 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-07 10:04 [PATCH] Fix 8250 probe on ppc32 David Woodhouse
2005-11-07 16:09 ` Tom Rini
2005-11-07 16:20 ` David Woodhouse
2005-11-07 16:31 ` Tom Rini
2005-11-07 17:25 ` Dan Malek
2005-11-07 16:54 ` Christoph Hellwig
2005-11-07 17:02 ` David Woodhouse
2005-11-16 8:51 ` David Woodhouse
2005-11-16 9:12 ` Paul Mackerras
2005-11-16 10:25 ` David Woodhouse
2005-11-16 15:24 ` Kumar Gala
2005-11-18 1:12 ` Paul Mackerras
2005-11-18 3:26 ` Kumar Gala
2005-11-18 3:50 ` Benjamin Herrenschmidt
2005-11-18 8:23 ` Christoph Hellwig
2005-11-18 10:51 ` Benjamin Herrenschmidt
2005-11-18 14:46 ` Kumar Gala
2005-11-18 21:36 ` Benjamin Herrenschmidt
2005-11-18 21:39 ` David Woodhouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).