LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3] serial: allow passing in hardware bug info via platform device
From: Paul Gortmaker @ 2011-12-01 23:47 UTC (permalink / raw)
  To: gregkh, alan, galak, scottwood; +Cc: linuxppc-dev, linux-kernel, linux-serial
In-Reply-To: <1322783258-20443-1-git-send-email-paul.gortmaker@windriver.com>

The normal arch hook into the 8250 serial world is via passing
in a plat_serial8250_port struct.  However, this struct does
not have a bugs field, so there is no way to have the arch
code pass in info about known uart issues.

Add a bug field to the plat_serial8250_port struct, so that the
arch can pass in this information.  Also don't do a blanket
overwrite of the bugs setting in the 8250.c driver.  Finally,
relocate the known bug #define list to a globally visible header
so that the arch can assign any appropriate values from the list.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/tty/serial/8250.c   |    3 ++-
 drivers/tty/serial/8250.h   |    5 -----
 include/linux/serial_8250.h |    6 ++++++
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index 7c94dbc..f99f27c 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -1101,7 +1101,6 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
 	spin_lock_irqsave(&up->port.lock, flags);
 
 	up->capabilities = 0;
-	up->port.bugs = 0;
 
 	if (!(up->port.flags & UPF_BUGGY_UART)) {
 		/*
@@ -3075,6 +3074,7 @@ static int __devinit serial8250_probe(struct platform_device *dev)
 		port.serial_out		= p->serial_out;
 		port.handle_irq		= p->handle_irq;
 		port.set_termios	= p->set_termios;
+		port.bugs		= p->bugs;
 		port.pm			= p->pm;
 		port.dev		= &dev->dev;
 		port.irqflags		|= irqflag;
@@ -3225,6 +3225,7 @@ int serial8250_register_port(struct uart_port *port)
 		uart->port.regshift     = port->regshift;
 		uart->port.iotype       = port->iotype;
 		uart->port.flags        = port->flags | UPF_BOOT_AUTOCONF;
+		uart->port.bugs         = port->bugs;
 		uart->port.mapbase      = port->mapbase;
 		uart->port.private_data = port->private_data;
 		if (port->dev)
diff --git a/drivers/tty/serial/8250.h b/drivers/tty/serial/8250.h
index 6edf4a6..caefe00 100644
--- a/drivers/tty/serial/8250.h
+++ b/drivers/tty/serial/8250.h
@@ -44,11 +44,6 @@ struct serial8250_config {
 #define UART_CAP_UUE	(1 << 12)	/* UART needs IER bit 6 set (Xscale) */
 #define UART_CAP_RTOIE	(1 << 13)	/* UART needs IER bit 4 set (Xscale, Tegra) */
 
-#define UART_BUG_QUOT	(1 << 0)	/* UART has buggy quot LSB */
-#define UART_BUG_TXEN	(1 << 1)	/* UART has buggy TX IIR status */
-#define UART_BUG_NOMSR	(1 << 2)	/* UART has buggy MSR status bits (Au1x00) */
-#define UART_BUG_THRE	(1 << 3)	/* UART has buggy THRE reassertion */
-
 #define PROBE_RSA	(1 << 0)
 #define PROBE_ANY	(~0)
 
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 1f05bbe..8c660af 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -14,6 +14,11 @@
 #include <linux/serial_core.h>
 #include <linux/platform_device.h>
 
+#define UART_BUG_QUOT	(1 << 0)	/* buggy quot LSB */
+#define UART_BUG_TXEN	(1 << 1)	/* buggy TX IIR status */
+#define UART_BUG_NOMSR	(1 << 2)	/* buggy MSR status bits (Au1x00) */
+#define UART_BUG_THRE	(1 << 3)	/* buggy THRE reassertion */
+
 /*
  * This is the platform device platform_data structure
  */
@@ -30,6 +35,7 @@ struct plat_serial8250_port {
 	unsigned char	hub6;
 	upf_t		flags;		/* UPF_* flags */
 	unsigned int	type;		/* If UPF_FIXED_TYPE */
+	unsigned short	bugs;		/* hardware specific bugs */
 	unsigned int	(*serial_in)(struct uart_port *, int);
 	void		(*serial_out)(struct uart_port *, int, int);
 	void		(*set_termios)(struct uart_port *,
-- 
1.7.7

^ permalink raw reply related

* [PATCH 0/3] RFC Fix Fsl 8250 BRK bug via letting plat code set bugs
From: Paul Gortmaker @ 2011-12-01 23:47 UTC (permalink / raw)
  To: gregkh, alan, galak, scottwood; +Cc: linuxppc-dev, linux-kernel, linux-serial

This is a respin of an earlier patch[1] that enabled a workaround
via Kconfig for an errata issue when using BRK on FSL 16550 UARTs.

In this version, the 8250 specific bug field is moved to the generic
uart_port struct, since hardware bugs aren't the unique domain of 
just the 8250 class of uarts.

Then the ability to set a known bugs value via the platform_device entry
point is added, so that it can be set externally vs. requiring some sort
of autodetection from the actual driver(s).

Then, the FSL errata fix is added to 8250.c by using the above support.
An entry in a DTS file is used to flag boards/platforms with the issue.
It is also added in a way that is optimized away for other architectures.

Kumar has a patch pending[2] that updates all the dts files.  I've not
included it here, so that review focus can be on the implementation.

I've re-tested it on an sbc8641D, where sysrq was useless before; with
this fix, it works as expected.

Thanks,
Paul.

[1] http://patchwork.ozlabs.org/patch/46609/
[2] http://patchwork.ozlabs.org/patch/128070/

--------

Paul Gortmaker (3):
  serial: make bugs field not specific to 8250 type uarts.
  serial: allow passing in hardware bug info via platform device
  8250: add workaround for MPC8[356]xx UART break IRQ storm

 arch/powerpc/kernel/legacy_serial.c |   11 ++++++++++
 drivers/tty/serial/8250.c           |   37 +++++++++++++++++++++-------------
 drivers/tty/serial/8250.h           |    5 ----
 include/linux/serial_8250.h         |   11 ++++++++++
 include/linux/serial_core.h         |    1 +
 5 files changed, 46 insertions(+), 19 deletions(-)

-- 
1.7.7

^ permalink raw reply

* [PATCH 1/3] serial: make bugs field not specific to 8250 type uarts.
From: Paul Gortmaker @ 2011-12-01 23:47 UTC (permalink / raw)
  To: gregkh, alan, galak, scottwood; +Cc: linuxppc-dev, linux-kernel, linux-serial
In-Reply-To: <1322783258-20443-1-git-send-email-paul.gortmaker@windriver.com>

There is a struct uart_8250_port that is private to 8250.c
itself, and it had a bugs field.  But there is no reason to
assume that hardware bugs are unique to 8250 type UARTS.

Make the bugs field part of the globally visible struct
uart_port and remove the 8250 specific one.

The value in doing so is that it helps pave the way for
allowing arch or platform specific code to pass in information
to the specific uart drivers about uart bugs known to impact
certain platforms that would otherwise be hard to detect from
within the context of the driver itself.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/tty/serial/8250.c   |   25 ++++++++++++-------------
 include/linux/serial_core.h |    1 +
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index eeadf1b..7c94dbc 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -134,7 +134,6 @@ struct uart_8250_port {
 	struct timer_list	timer;		/* "no irq" timer */
 	struct list_head	list;		/* ports on this IRQ */
 	unsigned short		capabilities;	/* port capabilities */
-	unsigned short		bugs;		/* port bugs */
 	unsigned int		tx_loadsz;	/* transmit fifo load size */
 	unsigned char		acr;
 	unsigned char		ier;
@@ -828,7 +827,7 @@ static void autoconfig_has_efr(struct uart_8250_port *up)
 		 * when DLL is 0.
 		 */
 		if (id3 == 0x52 && rev == 0x01)
-			up->bugs |= UART_BUG_QUOT;
+			up->port.bugs |= UART_BUG_QUOT;
 		return;
 	}
 
@@ -1102,7 +1101,7 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
 	spin_lock_irqsave(&up->port.lock, flags);
 
 	up->capabilities = 0;
-	up->bugs = 0;
+	up->port.bugs = 0;
 
 	if (!(up->port.flags & UPF_BUGGY_UART)) {
 		/*
@@ -1337,7 +1336,7 @@ static void serial8250_start_tx(struct uart_port *port)
 		up->ier |= UART_IER_THRI;
 		serial_out(up, UART_IER, up->ier);
 
-		if (up->bugs & UART_BUG_TXEN) {
+		if (port->bugs & UART_BUG_TXEN) {
 			unsigned char lsr;
 			lsr = serial_in(up, UART_LSR);
 			up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
@@ -1373,7 +1372,7 @@ static void serial8250_enable_ms(struct uart_port *port)
 		container_of(port, struct uart_8250_port, port);
 
 	/* no MSR capabilities */
-	if (up->bugs & UART_BUG_NOMSR)
+	if (port->bugs & UART_BUG_NOMSR)
 		return;
 
 	up->ier |= UART_IER_MSI;
@@ -2089,7 +2088,7 @@ static int serial8250_startup(struct uart_port *port)
 		 * kick the UART on a regular basis.
 		 */
 		if (!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) {
-			up->bugs |= UART_BUG_THRE;
+			port->bugs |= UART_BUG_THRE;
 			pr_debug("ttyS%d - using backup timer\n",
 				 serial_index(port));
 		}
@@ -2099,7 +2098,7 @@ static int serial8250_startup(struct uart_port *port)
 	 * The above check will only give an accurate result the first time
 	 * the port is opened so this value needs to be preserved.
 	 */
-	if (up->bugs & UART_BUG_THRE) {
+	if (port->bugs & UART_BUG_THRE) {
 		up->timer.function = serial8250_backup_timeout;
 		up->timer.data = (unsigned long)up;
 		mod_timer(&up->timer, jiffies +
@@ -2162,13 +2161,13 @@ static int serial8250_startup(struct uart_port *port)
 	serial_outp(up, UART_IER, 0);
 
 	if (lsr & UART_LSR_TEMT && iir & UART_IIR_NO_INT) {
-		if (!(up->bugs & UART_BUG_TXEN)) {
-			up->bugs |= UART_BUG_TXEN;
+		if (!(port->bugs & UART_BUG_TXEN)) {
+			port->bugs |= UART_BUG_TXEN;
 			pr_debug("ttyS%d - enabling bad tx status workarounds\n",
 				 serial_index(port));
 		}
 	} else {
-		up->bugs &= ~UART_BUG_TXEN;
+		port->bugs &= ~UART_BUG_TXEN;
 	}
 
 dont_test_tx_en:
@@ -2323,7 +2322,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
 	/*
 	 * Oxford Semi 952 rev B workaround
 	 */
-	if (up->bugs & UART_BUG_QUOT && (quot & 0xff) == 0)
+	if (port->bugs & UART_BUG_QUOT && (quot & 0xff) == 0)
 		quot++;
 
 	if (up->capabilities & UART_CAP_FIFO && up->port.fifosize > 1) {
@@ -2390,7 +2389,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
 	 * CTS flow control flag and modem status interrupts
 	 */
 	up->ier &= ~UART_IER_MSI;
-	if (!(up->bugs & UART_BUG_NOMSR) &&
+	if (!(port->bugs & UART_BUG_NOMSR) &&
 			UART_ENABLE_MS(&up->port, termios->c_cflag))
 		up->ier |= UART_IER_MSI;
 	if (up->capabilities & UART_CAP_UUE)
@@ -2666,7 +2665,7 @@ static void serial8250_config_port(struct uart_port *port, int flags)
 
 	/* if access method is AU, it is a 16550 with a quirk */
 	if (up->port.type == PORT_16550A && up->port.iotype == UPIO_AU)
-		up->bugs |= UART_BUG_NOMSR;
+		port->bugs |= UART_BUG_NOMSR;
 
 	if (up->port.type != PORT_UNKNOWN && flags & UART_CONFIG_IRQ)
 		autoconfig_irq(up);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index eadf33d..791536c 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -323,6 +323,7 @@ struct uart_port {
 
 	unsigned int		read_status_mask;	/* driver specific */
 	unsigned int		ignore_status_mask;	/* driver specific */
+	unsigned short		bugs;			/* driver specific */
 	struct uart_state	*state;			/* pointer to parent state */
 	struct uart_icount	icount;			/* statistics */
 
-- 
1.7.7

^ permalink raw reply related

* [PATCH 3/3] 8250: add workaround for MPC8[356]xx UART break IRQ storm
From: Paul Gortmaker @ 2011-12-01 23:47 UTC (permalink / raw)
  To: gregkh, alan, galak, scottwood; +Cc: linuxppc-dev, linux-kernel, linux-serial
In-Reply-To: <1322783258-20443-1-git-send-email-paul.gortmaker@windriver.com>

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>
---
 arch/powerpc/kernel/legacy_serial.c |   11 +++++++++++
 drivers/tty/serial/8250.c           |   11 ++++++++++-
 include/linux/serial_8250.h         |    5 +++++
 3 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index c7b5afe..dd232ca 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -476,6 +476,15 @@ static void __init fixup_port_mmio(int index,
 	port->membase = ioremap(port->mapbase, 0x100);
 }
 
+static void __init fixup_port_bugs(int index,
+				   struct device_node *np,
+				   struct plat_serial8250_port *port)
+{
+	DBG("fixup_port_bugs(%d)\n", index);
+
+	if (of_device_is_compatible(np, "fsl,ns16550"))
+		port->bugs = UART_BUG_FSLBK;
+}
 /*
  * This is called as an arch initcall, hopefully before the PCI bus is
  * probed and/or the 8250 driver loaded since we need to register our
@@ -512,6 +521,8 @@ static int __init serial_dev_init(void)
 			fixup_port_pio(i, np, port);
 		if ((port->iotype == UPIO_MEM) || (port->iotype == UPIO_TSI))
 			fixup_port_mmio(i, np, port);
+
+		fixup_port_bugs(i, np, port);
 	}
 
 	DBG("Registering platform serial ports\n");
diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index f99f27c..32e9821 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -142,6 +142,7 @@ struct uart_8250_port {
 	unsigned char		mcr_mask;	/* mask of user bits */
 	unsigned char		mcr_force;	/* mask of forced bits */
 	unsigned char		cur_iotype;	/* Running I/O type */
+	unsigned char		lsr_last;	/* LSR of last IRQ event */
 
 	/*
 	 * Some bits in registers are cleared on a read, so they must
@@ -1553,7 +1554,15 @@ static void serial8250_handle_port(struct uart_8250_port *up)
 
 	spin_lock_irqsave(&up->port.lock, flags);
 
-	status = serial_inp(up, UART_LSR);
+	/* Workaround for IRQ storm errata on break with Freescale 16550 */
+	if (UART_BUG_FSLBK & up->port.bugs && up->lsr_last & UART_LSR_BI) {
+		up->lsr_last &= ~UART_LSR_BI;
+		serial_inp(up, UART_RX);
+		spin_unlock_irqrestore(&up->port.lock, flags);
+		return;
+	}
+
+	status = up->lsr_last = serial_inp(up, UART_LSR);
 
 	DEBUG_INTR("status = %x...", status);
 
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 8c660af..b0f4042 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -18,6 +18,11 @@
 #define UART_BUG_TXEN	(1 << 1)	/* buggy TX IIR status */
 #define UART_BUG_NOMSR	(1 << 2)	/* buggy MSR status bits (Au1x00) */
 #define UART_BUG_THRE	(1 << 3)	/* buggy THRE reassertion */
+#ifdef CONFIG_PPC32
+#define UART_BUG_FSLBK	(1 << 4)	/* buggy FSL break IRQ storm */
+#else	/* help GCC optimize away IRQ handler errata code for ARCH != PPC32 */
+#define UART_BUG_FSLBK	0
+#endif
 
 /*
  * This is the platform device platform_data structure
-- 
1.7.7

^ permalink raw reply related

* Re: [PATCH 3/3] 8250: add workaround for MPC8[356]xx UART break IRQ storm
From: Scott Wood @ 2011-12-01 23:51 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: gregkh, linux-kernel, linux-serial, linuxppc-dev, alan
In-Reply-To: <1322783258-20443-4-git-send-email-paul.gortmaker@windriver.com>

On 12/01/2011 05:47 PM, Paul Gortmaker wrote:
> diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
> index 8c660af..b0f4042 100644
> --- a/include/linux/serial_8250.h
> +++ b/include/linux/serial_8250.h
> @@ -18,6 +18,11 @@
>  #define UART_BUG_TXEN	(1 << 1)	/* buggy TX IIR status */
>  #define UART_BUG_NOMSR	(1 << 2)	/* buggy MSR status bits (Au1x00) */
>  #define UART_BUG_THRE	(1 << 3)	/* buggy THRE reassertion */
> +#ifdef CONFIG_PPC32
> +#define UART_BUG_FSLBK	(1 << 4)	/* buggy FSL break IRQ storm */
> +#else	/* help GCC optimize away IRQ handler errata code for ARCH != PPC32 */
> +#define UART_BUG_FSLBK	0
> +#endif

I believe this bug still exists on our 64-bit chips.

-Scott

^ permalink raw reply

* Re: [PATCH 3/3] 8250: add workaround for MPC8[356]xx UART break IRQ storm
From: Paul Gortmaker @ 2011-12-02  0:05 UTC (permalink / raw)
  To: Scott Wood; +Cc: gregkh, linux-kernel, linux-serial, linuxppc-dev, alan
In-Reply-To: <4ED812E4.60905@freescale.com>

On 11-12-01 06:51 PM, Scott Wood wrote:
> On 12/01/2011 05:47 PM, Paul Gortmaker wrote:
>> diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
>> index 8c660af..b0f4042 100644
>> --- a/include/linux/serial_8250.h
>> +++ b/include/linux/serial_8250.h
>> @@ -18,6 +18,11 @@
>>  #define UART_BUG_TXEN	(1 << 1)	/* buggy TX IIR status */
>>  #define UART_BUG_NOMSR	(1 << 2)	/* buggy MSR status bits (Au1x00) */
>>  #define UART_BUG_THRE	(1 << 3)	/* buggy THRE reassertion */
>> +#ifdef CONFIG_PPC32
>> +#define UART_BUG_FSLBK	(1 << 4)	/* buggy FSL break IRQ storm */
>> +#else	/* help GCC optimize away IRQ handler errata code for ARCH != PPC32 */
>> +#define UART_BUG_FSLBK	0
>> +#endif
> 
> I believe this bug still exists on our 64-bit chips.

OK, I'll simply change the above to CONFIG_PPC then.

Thanks,
Paul.

> 
> -Scott
> 

^ permalink raw reply

* [PATCH][v2] Enable CONFIG_STRICT_DEVMEM support for Powerpc
From: Sukadev Bhattiprolu @ 2011-12-02  0:11 UTC (permalink / raw)
  To: benh; +Cc: linuxppc-dev, sbest, paulus, anton

>From aebed2e9fb9fba7dd0a34595780b828d7a545ba2 Mon Sep 17 00:00:00 2001
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Date: Mon, 29 Aug 2011 14:12:08 -0700
Subject: [PATCH 1/1][v2] Enable CONFIG_STRICT_DEVMEM support for Powerpc.

As described in the help text in the patch, this token restricts general
access to /dev/mem as a way of increasing security. Specifically, access
to exclusive IOMEM and kernel RAM is denied unless CONFIG_STRICT_DEVMEM is
set to 'n'.

Implement the 'devmem_is_allowed()' interface for POWER. It will be
called from range_is_allowed() when userpsace attempts to access /dev/mem.

This patch is based on an earlier patch from Steve Best and with input from
Paul Mackerras.

A test for this patch:

	# cat /proc/rtas/rmo_buffer 
	000000000f190000 10000

	# python -c "print 0x000000000f190000 / 0x10000"
	3865

	# dd if=/dev/mem of=/tmp/foo count=1 bs=64k skip=3865
	1+0 records in
	1+0 records out
	65536 bytes (66 kB) copied, 0.000205235 s, 319 MB/s

	# dd if=/dev/mem of=/tmp/foo count=1 bs=64k skip=3864
	dd: reading `/dev/mem': Operation not permitted
	0+0 records in
	0+0 records out
	0 bytes (0 B) copied, 0.000226844 s, 0.0 kB/s

	# dd if=/dev/mem of=/tmp/foo count=1 bs=64k skip=3866
	dd: reading `/dev/mem': Operation not permitted
	0+0 records in
	0+0 records out
	0 bytes (0 B) copied, 0.00023542 s, 0.0 kB/s

	# dd if=/dev/mem of=/tmp/foo
	dd: reading `/dev/mem': Operation not permitted
	0+0 records in
	0+0 records out
	0 bytes (0 B) copied, 0.00022519 s, 0.0 kB/s

Changelog[v2]:
	- [Anton Blanchard] Punch a hole in devmem to allow librtas/dlpar
	  tools access to /dev/mem.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
---
 arch/powerpc/Kconfig.debug      |   12 ++++++++++++
 arch/powerpc/include/asm/page.h |    1 +
 arch/powerpc/kernel/rtas.c      |   10 ++++++++++
 arch/powerpc/mm/mem.c           |   20 ++++++++++++++++++++
 drivers/char/mem.c              |    5 +++--
 5 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index 067cb84..1cf1b00 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -298,4 +298,16 @@ config PPC_EARLY_DEBUG_CPM_ADDR
 	  platform probing is done, all platforms selected must
 	  share the same address.
 
+config STRICT_DEVMEM
+	def_bool y
+	prompt "Filter access to /dev/mem"
+	help
+	  This option restricts access to /dev/mem.  If this option is
+	  disabled, you allow userspace access to all memory, including
+	  kernel and userspace memory. Accidental memory access is likely
+	  to be disastrous.
+	  Memory access is required for experts who want to debug the kernel.
+
+	  If you are unsure, say Y.
+
 endmenu
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index 2cd664e..dc2ec96 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -261,6 +261,7 @@ extern void clear_user_page(void *page, unsigned long vaddr, struct page *pg);
 extern void copy_user_page(void *to, void *from, unsigned long vaddr,
 		struct page *p);
 extern int page_is_ram(unsigned long pfn);
+extern int devmem_is_allowed(unsigned long pfn);
 
 #ifdef CONFIG_PPC_SMLPAR
 void arch_free_page(struct page *page, int order);
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index d5ca823..07cf2cf 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -937,6 +937,16 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
 	return 0;
 }
 
+int page_is_rtas(unsigned long pfn)
+{
+	unsigned long paddr = (pfn << PAGE_SHIFT);
+
+	if (paddr >= rtas_rmo_buf && paddr < (rtas_rmo_buf + RTAS_RMOBUF_MAX))
+		return 1;
+
+	return 0;
+}
+
 /*
  * Call early during boot, before mem init or bootmem, to retrieve the RTAS
  * informations from the device-tree and allocate the RMO buffer for userland
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index c781bbc..d21dbc6 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -549,3 +549,23 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
 	hash_preload(vma->vm_mm, address, access, trap);
 #endif /* CONFIG_PPC_STD_MMU */
 }
+
+extern int page_is_rtas(unsigned long pfn);
+
+/*
+ * devmem_is_allowed(): check to see if /dev/mem access to a certain address
+ * is valid. The argument is a physical page number.
+ *
+ * Access has to be given to non-kernel-ram areas as well, these contain the
+ * PCI mmio resources as well as potential bios/acpi data regions.
+ */
+int devmem_is_allowed(unsigned long pfn)
+{
+	if (iomem_is_exclusive(pfn << PAGE_SHIFT))
+		return 0;
+	if (!page_is_ram(pfn))
+		return 1;
+	if (page_is_rtas(pfn))
+		return 1;
+	return 0;
+}
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 8fc04b4..64917e8 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -29,6 +29,7 @@
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
+#include <asm/page.h>
 
 #ifdef CONFIG_IA64
 # include <linux/efi.h>
@@ -66,8 +67,8 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
 	while (cursor < to) {
 		if (!devmem_is_allowed(pfn)) {
 			printk(KERN_INFO
-		"Program %s tried to access /dev/mem between %Lx->%Lx.\n",
-				current->comm, from, to);
+		"Program %s tried to access /dev/mem between %Lx->%Lx and "
+			"pfn %lu.\n", current->comm, from, to, pfn);
 			return 0;
 		}
 		cursor += PAGE_SIZE;
-- 
1.7.0.4

^ permalink raw reply related

* Re: [PATCH 3/3] 8250: add workaround for MPC8[356]xx UART break IRQ storm
From: Kumar Gala @ 2011-12-02  0:17 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: gregkh, linux-kernel, linux-serial, Scott Wood, linuxppc-dev,
	alan
In-Reply-To: <4ED81632.3030809@windriver.com>


On Dec 1, 2011, at 6:05 PM, Paul Gortmaker wrote:

> On 11-12-01 06:51 PM, Scott Wood wrote:
>> On 12/01/2011 05:47 PM, Paul Gortmaker wrote:
>>> diff --git a/include/linux/serial_8250.h =
b/include/linux/serial_8250.h
>>> index 8c660af..b0f4042 100644
>>> --- a/include/linux/serial_8250.h
>>> +++ b/include/linux/serial_8250.h
>>> @@ -18,6 +18,11 @@
>>> #define UART_BUG_TXEN	(1 << 1)	/* buggy TX IIR status =
*/
>>> #define UART_BUG_NOMSR	(1 << 2)	/* buggy MSR status bits =
(Au1x00) */
>>> #define UART_BUG_THRE	(1 << 3)	/* buggy THRE =
reassertion */
>>> +#ifdef CONFIG_PPC32
>>> +#define UART_BUG_FSLBK	(1 << 4)	/* buggy FSL break IRQ =
storm */
>>> +#else	/* help GCC optimize away IRQ handler errata code for =
ARCH !=3D PPC32 */
>>> +#define UART_BUG_FSLBK	0
>>> +#endif
>>=20
>> I believe this bug still exists on our 64-bit chips.
>=20
> OK, I'll simply change the above to CONFIG_PPC then.

It does, the bug is in the uart IP which I don't think we ever plan on =
fixing, so 32 or 64-bit parts will have it for ever and ever ;)

- k=

^ permalink raw reply

* Re: [RFC][PATCH] update FSL 16550 nodes to have...
From: Paul Gortmaker @ 2011-12-02  0:41 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <1322510541-30688-1-git-send-email-galak@kernel.crashing.org>

On Mon, Nov 28, 2011 at 3:02 PM, Kumar Gala <galak@kernel.crashing.org> wrote:
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
> * Need to fixup the commit message

I had this written when I was thinking of re-sending the dts
with the other three, that is before I realized the dts patch
would then overwhelm the other patches completely.  :)

P.

----------------
    ppc: update FSL 16550 nodes to have fsl,ns16550 compat entry

    There is an errata relating to break handling on some of
    the Freescale 16550 implementations.  By marking the nodes
    with a fsl prefix, we can use that to know when to enable
    the errata handling.
----------------

^ permalink raw reply

* Re: [PATCH 1/3] serial: make bugs field not specific to 8250 type uarts.
From: Alan Cox @ 2011-12-02  0:51 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: gregkh, linux-kernel, linux-serial, scottwood, linuxppc-dev
In-Reply-To: <1322783258-20443-2-git-send-email-paul.gortmaker@windriver.com>

> Make the bugs field part of the globally visible struct
> uart_port and remove the 8250 specific one.

Except all the bits in it are 8250 specific things or names that are
meaningless in generic form - no. I also don't want to encourage flags
and bug bits. We already have too many and its making the code a mess.
So right now we want less not more.

^ permalink raw reply

* Re: [PATCH 3/3] 8250: add workaround for MPC8[356]xx UART break IRQ storm
From: Alan Cox @ 2011-12-02  0:57 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: gregkh, linux-kernel, linux-serial, scottwood, linuxppc-dev
In-Reply-To: <1322783258-20443-4-git-send-email-paul.gortmaker@windriver.com>


> @@ -1553,7 +1554,15 @@ static void serial8250_handle_port(struct
> uart_8250_port *up) 
>  	spin_lock_irqsave(&up->port.lock, flags);
>  
> -	status = serial_inp(up, UART_LSR);
> +	/* Workaround for IRQ storm errata on break with Freescale
> 16550 */
> +	if (UART_BUG_FSLBK & up->port.bugs && up->lsr_last &
> UART_LSR_BI) {
> +		up->lsr_last &= ~UART_LSR_BI;
> +		serial_inp(up, UART_RX);
> +		spin_unlock_irqrestore(&up->port.lock, flags);
> +		return;
> +	}
> +
> +	status = up->lsr_last = serial_inp(up, UART_LSR);

We've now had a recent pile of IRQ function changes adding more quirk
bits and special casing. This doesn't scale. We either need to make
handle_port a method the specific drivers can override or you could
hide the mess in your serial_inp implementation and not touch any core
code.

I really don't mind which but I suspect dealing with it in your
serial_inp handler so that when you read UART_LSR you do the fixup
might be simplest providing you can just do that.

Sorting out a ->handle_port override is probably ultimately the right
thing to do and then we can push some of the other funnies out further.

At this point it's becoming increasingly clear that 8250 UART cloners
are both very bad at cloning the things accurately, and very busy adding
extra useful features so we need to start to treat 8250.c as a library
you can wrap.

Alan

^ permalink raw reply

* Re: [PATCH][v2] Enable CONFIG_STRICT_DEVMEM support for Powerpc
From: Benjamin Herrenschmidt @ 2011-12-02  1:23 UTC (permalink / raw)
  To: Sukadev Bhattiprolu; +Cc: linuxppc-dev, sbest, paulus, anton
In-Reply-To: <20111202001141.GA14860@us.ibm.com>

On Thu, 2011-12-01 at 16:11 -0800, Sukadev Bhattiprolu wrote:
> >From aebed2e9fb9fba7dd0a34595780b828d7a545ba2 Mon Sep 17 00:00:00 2001
> From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
> Date: Mon, 29 Aug 2011 14:12:08 -0700
> Subject: [PATCH 1/1][v2] Enable CONFIG_STRICT_DEVMEM support for Powerpc.
> 
> As described in the help text in the patch, this token restricts general
> access to /dev/mem as a way of increasing security. Specifically, access
> to exclusive IOMEM and kernel RAM is denied unless CONFIG_STRICT_DEVMEM is
> set to 'n'.
> 
> Implement the 'devmem_is_allowed()' interface for POWER. It will be
> called from range_is_allowed() when userpsace attempts to access /dev/mem.
> 
> This patch is based on an earlier patch from Steve Best and with input from
> Paul Mackerras.

A slightly different version of that patch is already in my -next branch
since earlier this week. Please send a followup patch adding the missing
rtas bit.

Note that I've dropped the generic printk change which has nothing to do
in that patch and can/should be submitted separately if it's really
needed.

Cheers,
Ben.


> A test for this patch:
> 
> 	# cat /proc/rtas/rmo_buffer 
> 	000000000f190000 10000
> 
> 	# python -c "print 0x000000000f190000 / 0x10000"
> 	3865
> 
> 	# dd if=/dev/mem of=/tmp/foo count=1 bs=64k skip=3865
> 	1+0 records in
> 	1+0 records out
> 	65536 bytes (66 kB) copied, 0.000205235 s, 319 MB/s
> 
> 	# dd if=/dev/mem of=/tmp/foo count=1 bs=64k skip=3864
> 	dd: reading `/dev/mem': Operation not permitted
> 	0+0 records in
> 	0+0 records out
> 	0 bytes (0 B) copied, 0.000226844 s, 0.0 kB/s
> 
> 	# dd if=/dev/mem of=/tmp/foo count=1 bs=64k skip=3866
> 	dd: reading `/dev/mem': Operation not permitted
> 	0+0 records in
> 	0+0 records out
> 	0 bytes (0 B) copied, 0.00023542 s, 0.0 kB/s
> 
> 	# dd if=/dev/mem of=/tmp/foo
> 	dd: reading `/dev/mem': Operation not permitted
> 	0+0 records in
> 	0+0 records out
> 	0 bytes (0 B) copied, 0.00022519 s, 0.0 kB/s
> 
> Changelog[v2]:
> 	- [Anton Blanchard] Punch a hole in devmem to allow librtas/dlpar
> 	  tools access to /dev/mem.
> 
> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
> ---
>  arch/powerpc/Kconfig.debug      |   12 ++++++++++++
>  arch/powerpc/include/asm/page.h |    1 +
>  arch/powerpc/kernel/rtas.c      |   10 ++++++++++
>  arch/powerpc/mm/mem.c           |   20 ++++++++++++++++++++
>  drivers/char/mem.c              |    5 +++--
>  5 files changed, 46 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
> index 067cb84..1cf1b00 100644
> --- a/arch/powerpc/Kconfig.debug
> +++ b/arch/powerpc/Kconfig.debug
> @@ -298,4 +298,16 @@ config PPC_EARLY_DEBUG_CPM_ADDR
>  	  platform probing is done, all platforms selected must
>  	  share the same address.
>  
> +config STRICT_DEVMEM
> +	def_bool y
> +	prompt "Filter access to /dev/mem"
> +	help
> +	  This option restricts access to /dev/mem.  If this option is
> +	  disabled, you allow userspace access to all memory, including
> +	  kernel and userspace memory. Accidental memory access is likely
> +	  to be disastrous.
> +	  Memory access is required for experts who want to debug the kernel.
> +
> +	  If you are unsure, say Y.
> +
>  endmenu
> diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
> index 2cd664e..dc2ec96 100644
> --- a/arch/powerpc/include/asm/page.h
> +++ b/arch/powerpc/include/asm/page.h
> @@ -261,6 +261,7 @@ extern void clear_user_page(void *page, unsigned long vaddr, struct page *pg);
>  extern void copy_user_page(void *to, void *from, unsigned long vaddr,
>  		struct page *p);
>  extern int page_is_ram(unsigned long pfn);
> +extern int devmem_is_allowed(unsigned long pfn);
>  
>  #ifdef CONFIG_PPC_SMLPAR
>  void arch_free_page(struct page *page, int order);
> diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
> index d5ca823..07cf2cf 100644
> --- a/arch/powerpc/kernel/rtas.c
> +++ b/arch/powerpc/kernel/rtas.c
> @@ -937,6 +937,16 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
>  	return 0;
>  }
>  
> +int page_is_rtas(unsigned long pfn)
> +{
> +	unsigned long paddr = (pfn << PAGE_SHIFT);
> +
> +	if (paddr >= rtas_rmo_buf && paddr < (rtas_rmo_buf + RTAS_RMOBUF_MAX))
> +		return 1;
> +
> +	return 0;
> +}
> +
>  /*
>   * Call early during boot, before mem init or bootmem, to retrieve the RTAS
>   * informations from the device-tree and allocate the RMO buffer for userland
> diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
> index c781bbc..d21dbc6 100644
> --- a/arch/powerpc/mm/mem.c
> +++ b/arch/powerpc/mm/mem.c
> @@ -549,3 +549,23 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
>  	hash_preload(vma->vm_mm, address, access, trap);
>  #endif /* CONFIG_PPC_STD_MMU */
>  }
> +
> +extern int page_is_rtas(unsigned long pfn);
> +
> +/*
> + * devmem_is_allowed(): check to see if /dev/mem access to a certain address
> + * is valid. The argument is a physical page number.
> + *
> + * Access has to be given to non-kernel-ram areas as well, these contain the
> + * PCI mmio resources as well as potential bios/acpi data regions.
> + */
> +int devmem_is_allowed(unsigned long pfn)
> +{
> +	if (iomem_is_exclusive(pfn << PAGE_SHIFT))
> +		return 0;
> +	if (!page_is_ram(pfn))
> +		return 1;
> +	if (page_is_rtas(pfn))
> +		return 1;
> +	return 0;
> +}
> diff --git a/drivers/char/mem.c b/drivers/char/mem.c
> index 8fc04b4..64917e8 100644
> --- a/drivers/char/mem.c
> +++ b/drivers/char/mem.c
> @@ -29,6 +29,7 @@
>  
>  #include <asm/uaccess.h>
>  #include <asm/io.h>
> +#include <asm/page.h>
>  
>  #ifdef CONFIG_IA64
>  # include <linux/efi.h>
> @@ -66,8 +67,8 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
>  	while (cursor < to) {
>  		if (!devmem_is_allowed(pfn)) {
>  			printk(KERN_INFO
> -		"Program %s tried to access /dev/mem between %Lx->%Lx.\n",
> -				current->comm, from, to);
> +		"Program %s tried to access /dev/mem between %Lx->%Lx and "
> +			"pfn %lu.\n", current->comm, from, to, pfn);
>  			return 0;
>  		}
>  		cursor += PAGE_SIZE;

^ permalink raw reply

* Re: [PATCH][v2] Enable CONFIG_STRICT_DEVMEM support for Powerpc
From: Benjamin Herrenschmidt @ 2011-12-02  1:26 UTC (permalink / raw)
  To: Sukadev Bhattiprolu; +Cc: linuxppc-dev, sbest, paulus, anton
In-Reply-To: <20111202001141.GA14860@us.ibm.com>

And an additional comment regarding the rtas bit:

>  #ifdef CONFIG_PPC_SMLPAR
>  void arch_free_page(struct page *page, int order);
> diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
> index d5ca823..07cf2cf 100644
> --- a/arch/powerpc/kernel/rtas.c
> +++ b/arch/powerpc/kernel/rtas.c
> @@ -937,6 +937,16 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
>  	return 0;
>  }
>  
> +int page_is_rtas(unsigned long pfn)
> +{
> +	unsigned long paddr = (pfn << PAGE_SHIFT);
> +
> +	if (paddr >= rtas_rmo_buf && paddr < (rtas_rmo_buf + RTAS_RMOBUF_MAX))
> +		return 1;
> +
> +	return 0;
> +}

So this only exist whenever rtas.c is compiled... but ...

> +
>  /*
>   * Call early during boot, before mem init or bootmem, to retrieve the RTAS
>   * informations from the device-tree and allocate the RMO buffer for userland
> diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
> index c781bbc..d21dbc6 100644
> --- a/arch/powerpc/mm/mem.c
> +++ b/arch/powerpc/mm/mem.c
> @@ -549,3 +549,23 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
>  	hash_preload(vma->vm_mm, address, access, trap);
>  #endif /* CONFIG_PPC_STD_MMU */
>  }
> +
> +extern int page_is_rtas(unsigned long pfn);
> +
> +/*
> + * devmem_is_allowed(): check to see if /dev/mem access to a certain address
> + * is valid. The argument is a physical page number.
> + *
> + * Access has to be given to non-kernel-ram areas as well, these contain the
> + * PCI mmio resources as well as potential bios/acpi data regions.
> + */
> +int devmem_is_allowed(unsigned long pfn)
> +{
> +	if (iomem_is_exclusive(pfn << PAGE_SHIFT))
> +		return 0;
> +	if (!page_is_ram(pfn))
> +		return 1;
> +	if (page_is_rtas(pfn))
> +		return 1;
> +	return 0;
> +}

This calls it unconditionally... you just broke the build of all !rtas
platforms. Additionally, putting an extern definition like that in a .c
file is gross at best....

Please instead, put in a header something like

#ifdef CONFIG_PPC_RTAS
extern int page_is_rtas(unsigned long pfn);
#else
static inline int page_is_rtas(unsigned long pfn) { }
#endif

And while at it, call it page_is_rtas_user_buf(); to make it clear what
we are talking about, ie, not RTAS core per-se but specifically the RMO
buffer.

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH 1/3] serial: make bugs field not specific to 8250 type uarts.
From: Paul Gortmaker @ 2011-12-02  1:32 UTC (permalink / raw)
  To: Alan Cox; +Cc: gregkh, linux-kernel, linux-serial, scottwood, linuxppc-dev
In-Reply-To: <20111202005150.2e9fde43@bob.linux.org.uk>

On Thu, Dec 1, 2011 at 7:51 PM, Alan Cox <alan@linux.intel.com> wrote:
>> Make the bugs field part of the globally visible struct
>> uart_port and remove the 8250 specific one.
>
> Except all the bits in it are 8250 specific things or names that are
> meaningless in generic form - no. I also don't want to encourage flags
> and bug bits. We already have too many and its making the code a mess.
> So right now we want less not more.

The bits in "bugs" are only passed through -- the idea is that there is
no "interpretation" of them by any generic layer -- only that they prop
from the arch down to the driver which knows what they mean.

I can understand the "want less not more" mentality -- I was thinking
the same thing when I was looking at the replication of fields between
uart_port and uart_8250_port, and toying with the idea of helping clean
that up....  (separate topic, to be sure.)

If you have an idea in mind how arch/platform code should cleanly
pass data about known uart bugs to the uart driver, then let me know
what you have in mind.  I've no real attachment to what I proposed
here -- it just happened to be the solution I thought would be the least
offensive.  If there is a better idea floating around, I'll go ahead and
try to implement it.

Thanks,
Paul.

> --
> To unsubscribe from this list: send the line "unsubscribe linux-serial" i=
n
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at =A0http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] powerpc/nvram: Add spinlock to oops_to_nvram to prevent oops in compression code.
From: Jim Keniston @ 2011-12-02  1:37 UTC (permalink / raw)
  To: Anton Blanchard; +Cc: paulus, linuxppc-dev
In-Reply-To: <20111201124645.24c6e54f@kryten>

On Thu, 2011-12-01 at 12:46 +1100, Anton Blanchard wrote:
> When issuing a system reset we almost always oops in the oops_to_nvram
> code because multiple CPUs are using the deflate work area. Add a
> spinlock to protect it.
> 
> To play it safe I'm using trylock to avoid locking up if the NVRAM
> code oopses. This means we might miss multiple CPUs oopsing at exactly
> the same time but I think it's best to play it safe for now. Once we
> are happy with the reliability we can change it to a full spinlock.
> 
> Signed-off-by: Anton Blanchard <anton@samba.org>

Acked-by: Jim Keniston <jkenisto@us.ibm.com>

> ---
> 
> Index: linux-build/arch/powerpc/platforms/pseries/nvram.c
> ===================================================================
> --- linux-build.orig/arch/powerpc/platforms/pseries/nvram.c	2011-12-01 09:44:27.205568463 +1100
> +++ linux-build/arch/powerpc/platforms/pseries/nvram.c	2011-12-01 12:36:49.334478156 +1100
> @@ -634,6 +634,8 @@ static void oops_to_nvram(struct kmsg_du
>  {
>  	static unsigned int oops_count = 0;
>  	static bool panicking = false;
> +	static DEFINE_SPINLOCK(lock);
> +	unsigned long flags;
>  	size_t text_len;
>  	unsigned int err_type = ERR_TYPE_KERNEL_PANIC_GZ;
>  	int rc = -1;
> @@ -664,6 +666,9 @@ static void oops_to_nvram(struct kmsg_du
>  	if (clobbering_unread_rtas_event())
>  		return;
> 
> +	if (!spin_trylock_irqsave(&lock, flags))
> +		return;
> +
>  	if (big_oops_buf) {
>  		text_len = capture_last_msgs(old_msgs, old_len,
>  			new_msgs, new_len, big_oops_buf, big_oops_buf_sz);
> @@ -679,4 +684,6 @@ static void oops_to_nvram(struct kmsg_du
> 
>  	(void) nvram_write_os_partition(&oops_log_partition, oops_buf,
>  		(int) (sizeof(*oops_len) + *oops_len), err_type, ++oops_count);
> +
> +	spin_unlock_irqrestore(&lock, flags);
>  }
> 

^ permalink raw reply

* Re: [PATCH 3/3] 8250: add workaround for MPC8[356]xx UART break IRQ storm
From: Paul Gortmaker @ 2011-12-02  1:42 UTC (permalink / raw)
  To: Alan Cox; +Cc: gregkh, linux-kernel, linux-serial, scottwood, linuxppc-dev
In-Reply-To: <20111202005752.10ce5eea@bob.linux.org.uk>

On Thu, Dec 1, 2011 at 7:57 PM, Alan Cox <alan@linux.intel.com> wrote:
>
>> @@ -1553,7 +1554,15 @@ static void serial8250_handle_port(struct
>> uart_8250_port *up)
>> =A0 =A0 =A0 spin_lock_irqsave(&up->port.lock, flags);
>>
>> - =A0 =A0 status =3D serial_inp(up, UART_LSR);
>> + =A0 =A0 /* Workaround for IRQ storm errata on break with Freescale
>> 16550 */
>> + =A0 =A0 if (UART_BUG_FSLBK & up->port.bugs && up->lsr_last &
>> UART_LSR_BI) {
>> + =A0 =A0 =A0 =A0 =A0 =A0 up->lsr_last &=3D ~UART_LSR_BI;
>> + =A0 =A0 =A0 =A0 =A0 =A0 serial_inp(up, UART_RX);
>> + =A0 =A0 =A0 =A0 =A0 =A0 spin_unlock_irqrestore(&up->port.lock, flags);
>> + =A0 =A0 =A0 =A0 =A0 =A0 return;
>> + =A0 =A0 }
>> +
>> + =A0 =A0 status =3D up->lsr_last =3D serial_inp(up, UART_LSR);
>
> We've now had a recent pile of IRQ function changes adding more quirk
> bits and special casing. This doesn't scale. We either need to make
> handle_port a method the specific drivers can override or you could
> hide the mess in your serial_inp implementation and not touch any core
> code.

To be fair, this one is zero cost for !PPC, but I understand your point,
and the idea of hiding it somehow in serial_inp was something that
never crossed my mind.  I'll look into seeing if I can abuse that.

>
> I really don't mind which but I suspect dealing with it in your
> serial_inp handler so that when you read UART_LSR you do the fixup
> might be simplest providing you can just do that.
>
> Sorting out a ->handle_port override is probably ultimately the right
> thing to do and then we can push some of the other funnies out further.
>
> At this point it's becoming increasingly clear that 8250 UART cloners
> are both very bad at cloning the things accurately, and very busy adding
> extra useful features so we need to start to treat 8250.c as a library
> you can wrap.

Sad but true.  It is like a time warp back to lib8390.c  --- whee.

P.

>
> Alan
> --
> To unsubscribe from this list: send the line "unsubscribe linux-serial" i=
n
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at =A0http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH 10/10] powerpc/mpic: Add in-core support for cascaded MPICs
From: Moffett, Kyle D @ 2011-12-02  1:48 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, michaele@au1.ibm.com, Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <1322722788.5215.3.camel@concordia>

Ben,

I fixed the 3 issues that Paul and Michael reported and I can provide them
to you two different ways, however you would prefer.  I can also send the
patches via email if that's more convenient.

Option 1: Squashed into the the original patches for bisectability:
  git://opensource.exmeritus.com/hww-1u-1a/linux.git mpc85xx/mpic-and-stuff

Option 2: As a fixup patch on the end:
  git://opensource.exmeritus.com/hww-1u-1a/linux.git mpc85xx/mpic-and-stuff=
-fixup

You can also use HTTP if you would prefer:
  http://opensource.exmeritus.com/git/hww-1u-1a/linux.git

Cheers,
Kyle Moffett

--
Curious about my work on the Debian powerpcspe port?
I'm keeping a blog here: http://pureperl.blogspot.com/

^ permalink raw reply

* [powerpc] boot up problem
From: Jia Hongtao-B38951 @ 2011-12-02  2:21 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev@lists.ozlabs.org, Li Yang-R58472
In-Reply-To: <3EC6F9E0-C847-4DA8-AD8C-313976982A10@kernel.crashing.org>

Hi

I just found that the 'next' branch you mentioned have problem to boot up.
I test it in p1022ds and p1010rdb boards and the result are both the same.
Note that for p1022ds I use "make p1022ds.dtb" to make the dtb file(36bit) =
with 36bit-uboot.
And for p1010rdb I use all 32bit image.
The problem list below:

scsi0 : sata_fsl
ata1: SATA max UDMA/133 irq 74
fsl-sata fffe19000.sata: Sata FSL Platform/CSB Driver init
scsi1 : sata_fsl
ata2: SATA max UDMA/133 irq 41
Fixed MDIO Bus: probed
Unable to handle kernel paging request for data at address 0x00000000
Faulting instruction address: 0xc0451630
Oops: Kernel access of bad area, sig: 11 [#1]
SMP NR_CPUS=3D2 P1022 DS
Modules linked in:
NIP: c0451630 LR: c0451618 CTR: 00000007
REGS: ef03fce0 TRAP: 0300   Not tainted  (3.2.0-rc3-00099-g883381d)
MSR: 00029000 <EE,ME,CE>  CR: 24042022  XER: 00000000
DEAR: 00000000, ESR: 00800000
TASK =3D ef040000[1] 'swapper' THREAD: ef03e000 CPU: 0
GPR00: ef03fd98 ef03fd90 ef040000 ef1ab22c 00000000 00000002 ffeb0000 0000f=
ffe
GPR08: b0541215 00000000 00000000 00000000 24042028 23c406c2 00000000 00000=
000
GPR16: c0000a00 00000014 3fffffff 03ff9000 00000015 7ff3a760 f1044030 fffff=
ff4
GPR24: c053e128 ef1ab230 c056a3a8 ef03e000 ef040000 ef1ab22c 00000000 ef1ab=
228
NIP [c0451630] __mutex_lock_slowpath+0xb4/0x190
LR [c0451618] __mutex_lock_slowpath+0x9c/0x190
Call Trace:
[ef03fdd0] [c0451758] mutex_lock+0x4c/0x50
[ef03fde0] [c02b5124] mdiobus_read+0x38/0x74
[ef03fe00] [c02b41f4] get_phy_id+0x24/0x80
[ef03fe20] [c02b9de4] fsl_pq_mdio_probe+0x3b4/0x580
[ef03feb0] [c0266120] platform_drv_probe+0x20/0x30
[ef03fec0] [c0264bbc] driver_probe_device+0xa4/0x1d4
[ef03fee0] [c0264da8] __driver_attach+0xbc/0xc0
[ef03ff00] [c0263ac0] bus_for_each_dev+0x60/0x9c
[ef03ff30] [c02647f4] driver_attach+0x24/0x34
[ef03ff40] [c0264444] bus_add_driver+0x1ac/0x274
[ef03ff70] [c02651b0] driver_register+0x88/0x154
[ef03ff90] [c0266450] platform_driver_register+0x68/0x78
[ef03ffa0] [c05d93b8] fsl_pq_mdio_init+0x18/0x28
[ef03ffb0] [c0001eb8] do_one_initcall+0x34/0x1a8
[ef03ffe0] [c05bb82c] kernel_init+0xa0/0x13c
[ef03fff0] [c000d878] kernel_thread+0x4c/0x68
Instruction dump:
801c0020 2f800063 419dffe8 3bbf0004 7fa3eb78 48001aad 813f000c 38010008
3b3f0008 901f000c 93210008 9121000c
 3800ffff 93810010 7c0004ac
---[ end trace 1643a9a9c5097f8f ]---
Kernel panic - not syncing: Attempted to kill init!
Call Trace:
[ef03fbc0] [c0008044] show_stack+0x44/0x154 (unreliable)
[ef03fc00] [c04532c8] panic+0xa4/0x1d8
[ef03fc50] [c0049a00] do_exit+0x5dc/0x684
[ef03fca0] [c000a6f0] die+0xdc/0x1b4
[ef03fcc0] [c00128d0] bad_page_fault+0xb4/0xfc
[ef03fcd0] [c000ebe4] handle_page_fault+0x7c/0x80
--- Exception: 300 at __mutex_lock_slowpath+0xb4/0x190
    LR =3D __mutex_lock_slowpath+0x9c/0x190
[ef03fd90] [00000000]   (null) (unreliable)
[ef03fdd0] [c0451758] mutex_lock+0x4c/0x50
[ef03fde0] [c02b5124] mdiobus_read+0x38/0x74
[ef03fe00] [c02b41f4] get_phy_id+0x24/0x80
[ef03fe20] [c02b9de4] fsl_pq_mdio_probe+0x3b4/0x580
[ef03feb0] [c0266120] platform_drv_probe+0x20/0x30
[ef03fec0] [c0264bbc] driver_probe_device+0xa4/0x1d4
[ef03fee0] [c0264da8] __driver_attach+0xbc/0xc0
[ef03ff00] [c0263ac0] bus_for_each_dev+0x60/0x9c
[ef03ff30] [c02647f4] driver_attach+0x24/0x34
[ef03ff40] [c0264444] bus_add_driver+0x1ac/0x274
[ef03ff70] [c02651b0] driver_register+0x88/0x154
[ef03ff90] [c0266450] platform_driver_register+0x68/0x78
[ef03ffa0] [c05d93b8] fsl_pq_mdio_init+0x18/0x28
[ef03ffb0] [c0001eb8] do_one_initcall+0x34/0x1a8
[ef03ffe0] [c05bb82c] kernel_init+0xa0/0x13c
[ef03fff0] [c000d878] kernel_thread+0x4c/0x68
Rebooting in 180 seconds..

Do you or anyone else have any idea about this?
Thanks.


-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]=20
Sent: Thursday, November 24, 2011 3:10 PM
To: Jia Hongtao-B38951
Cc: Li Yang-R58472
Subject: Re: [PATCH 1/2] Unify pci/pcie initialization code

When you do this please do it against my latest upstream 'next' branch on:

http://git.kernel.org/?p=3Dlinux/kernel/git/galak/powerpc.git
git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git

- k

On Nov 24, 2011, at 12:27 AM, Jia Hongtao-B38951 wrote:

> Ok, I got it.
>=20
> - Hongtao
>=20
> -----Original Message-----
> From: Li Yang-R58472
> Sent: Thursday, November 24, 2011 2:06 PM
> To: Jia Hongtao-B38951; Kumar Gala
> Subject: RE: [PATCH 1/2] Unify pci/pcie initialization code
>=20
> Hongtao,
>=20
> Please update all the boards currently using fsl_add_bridge().
>=20
> - Leo
>=20
>> -----Original Message-----
>> From: Kumar Gala [mailto:galak@kernel.crashing.org]
>> Sent: Thursday, November 24, 2011 12:51 PM
>> To: Jia Hongtao-B38951
>> Cc: linuxppc-dev@lists.ozlabs.org; Gala Kumar-B11780; Li Yang-R58472
>> Subject: Re: [PATCH 1/2] Unify pci/pcie initialization code
>>=20
>>=20
>> On Nov 22, 2011, at 12:20 AM, Jia Hongtao-B38951 wrote:
>>=20
>>> Hi Kumar,
>>> We want more comments on this series of patches ([1/2] & [2/2]) to=20
>>> speed
>> up the pushing-to-kernel progress.
>>> Thanks.
>>=20
>> I think the code is fine, but you need to update it for all the=20
>> boards include the 86xx ones.
>>=20
>> - k
>>=20
>>>=20
>>> -----Original Message-----
>>> From: Jia Hongtao-B38951
>>> Sent: Monday, October 31, 2011 1:55 PM
>>> To: linuxppc-dev@lists.ozlabs.org
>>> Cc: Li Yang-R58472; Gala Kumar-B11780; Jia Hongtao-B38951
>>> Subject: [PATCH 1/2] Unify pci/pcie initialization code
>>>=20
>>> In previous version pci/pcie initialization is in platform code=20
>>> which
>> Initialize PCI bridge base on EP/RC or host/agent settings.
>>> We unified pci/pcie initialization as common APIs named=20
>>> fsl_pci_setup
>> which can be called by platform code.
>>>=20
>>> Signed-off-by: Jia Hongtao <B38951@freescale.com>
>>> Signed-off-by: Li Yang <leoli@freescale.com>
>>> ---
>>> arch/powerpc/platforms/85xx/mpc85xx_ds.c |   30 ++-----------------
>>> arch/powerpc/sysdev/fsl_pci.c            |   48
>> ++++++++++++++++++++++++++++++
>>> arch/powerpc/sysdev/fsl_pci.h            |    5 +++
>>> 3 files changed, 56 insertions(+), 27 deletions(-)
>>>=20
>>> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
>> b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
>>> index 10e7db0..7188c0b 100644
>>> --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
>>> +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
>>> @@ -157,33 +157,12 @@ extern void __init mpc85xx_smp_init(void);=20
>>> #endif
>> static void __init mpc85xx_ds_setup_arch(void)  { -#ifdef CONFIG_PCI
>>> -	struct device_node *np;
>>> -	struct pci_controller *hose;
>>> -#endif
>>> -	dma_addr_t max =3D 0xffffffff;
>>> -
>>> 	if (ppc_md.progress)
>>> 		ppc_md.progress("mpc85xx_ds_setup_arch()", 0);
>>>=20
>>> -#ifdef CONFIG_PCI
>>> -	for_each_node_by_type(np, "pci") {
>>> -		if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
>>> -		    of_device_is_compatible(np, "fsl,mpc8548-pcie") ||
>>> -		    of_device_is_compatible(np, "fsl,p2020-pcie")) {
>>> -			struct resource rsrc;
>>> -			of_address_to_resource(np, 0, &rsrc);
>>> -			if ((rsrc.start & 0xfffff) =3D=3D primary_phb_addr)
>>> -				fsl_add_bridge(np, 1);
>>> -			else
>>> -				fsl_add_bridge(np, 0);
>>> -
>>> -			hose =3D pci_find_hose_for_OF_device(np);
>>> -			max =3D min(max, hose->dma_window_base_cur +
>>> -					hose->dma_window_size);
>>> -		}
>>> -	}
>>> +	fsl_pci_setup(primary_phb_addr);
>>>=20
>>> +#ifdef CONFIG_PCI
>>> 	ppc_md.pci_exclude_device =3D mpc85xx_exclude_device;  #endif
>>>=20
>>> @@ -192,11 +171,8 @@ static void __init mpc85xx_ds_setup_arch(void)
>> #endif
>>>=20
>>> #ifdef CONFIG_SWIOTLB
>>> -	if (memblock_end_of_DRAM() > max) {
>>> +	if (memblock_end_of_DRAM() > 0xffffffff)
>>> 		ppc_swiotlb_enable =3D 1;
>>> -		set_pci_dma_ops(&swiotlb_dma_ops);
>>> -		ppc_md.pci_dma_dev_setup =3D pci_dma_dev_setup_swiotlb;
>>> -	}
>>> #endif
>>>=20
>>> 	printk("MPC85xx DS board from Freescale Semiconductor\n"); diff --
>> git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c=20
>> index 80b8b7a..4d4536f 100644
>>> --- a/arch/powerpc/sysdev/fsl_pci.c
>>> +++ b/arch/powerpc/sysdev/fsl_pci.c
>>> @@ -402,6 +402,54 @@ int __init fsl_add_bridge(struct device_node=20
>>> *dev,
>> int is_primary)  }  #endif /* CONFIG_FSL_SOC_BOOKE || CONFIG_PPC_86xx=20
>> */
>>>=20
>>> +static struct of_device_id pci_ids[] =3D {
>>> +	{ .compatible =3D "fsl,mpc8540-pci", },
>>> +	{ .compatible =3D "fsl,mpc8548-pcie", },
>>> +	{},
>>> +};
>>> +
>>> +/**
>>> + * fsl_pci_setup - Initialization for PCI
>>> + * @primary_phb_addr: primary bus address
>>> + *
>>> + * Add bridge if pci controller is a host  */ void=20
>>> +fsl_pci_setup(int
>>> +primary_phb_addr) {
>>> +	struct device_node *np;
>>> +	struct pci_controller *hose;
>>> +	dma_addr_t min_dma_addr =3D 0xffffffff;
>>> +
>>> +	for_each_node_by_type(np, "pci") {
>>> +		if (of_match_node(pci_ids, np)) {
>>> +			struct resource rsrc;
>>> +			of_address_to_resource(np, 0, &rsrc);
>>> +			if ((rsrc.start & 0xfffff) =3D=3D primary_phb_addr)
>>> +				fsl_add_bridge(np, 1);
>>> +			else
>>> +				fsl_add_bridge(np, 0);
>>> +
>>> +			hose =3D pci_find_hose_for_OF_device(np);
>>> +			min_dma_addr =3D min(min_dma_addr,
>>> +					hose->dma_window_base_cur
>>> +					+ hose->dma_window_size);
>>> +
>>> +		}
>>> +	}
>>> +
>>> +#ifdef CONFIG_SWIOTLB
>>> +	/*
>>> +	 * if we couldn't map all of DRAM via the dma windows we need
>> SWIOTLB
>>> +	 * to handle buffers located outside of dma capable memory region
>>> +	 */
>>> +	if (memblock_end_of_DRAM() > min_dma_addr) {
>>> +		ppc_swiotlb_enable =3D 1;
>>> +		set_pci_dma_ops(&swiotlb_dma_ops);
>>> +		ppc_md.pci_dma_dev_setup =3D pci_dma_dev_setup_swiotlb;
>>> +	}
>>> +#endif
>>> +}
>>> +
>>> DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_FREESCALE, PCI_ANY_ID,
>> quirk_fsl_pcie_header);
>>>=20
>>> #if defined(CONFIG_PPC_83xx) || defined(CONFIG_PPC_MPC512x) diff=20
>>> --git
>> a/arch/powerpc/sysdev/fsl_pci.h b/arch/powerpc/sysdev/fsl_pci.h index
>> a39ed5c..775ea21 100644
>>> --- a/arch/powerpc/sysdev/fsl_pci.h
>>> +++ b/arch/powerpc/sysdev/fsl_pci.h
>>> @@ -89,6 +89,11 @@ struct ccsr_pci { };
>>>=20
>>> extern int fsl_add_bridge(struct device_node *dev, int is_primary);
>>> +#ifndef CONFIG_PCI
>>> +#define fsl_pci_setup(p)
>>> +#else
>>> +extern void fsl_pci_setup(int primary_phb_addr); #endif
>>> extern void fsl_pcibios_fixup_bus(struct pci_bus *bus);  extern int
>> mpc83xx_add_bridge(struct device_node *dev);
>>> u64 fsl_pci_immrbar_base(struct pci_controller *hose);
>>> --
>>> 1.7.5.1
>>>=20
>>>=20
>>> _______________________________________________
>>> Linuxppc-dev mailing list
>>> Linuxppc-dev@lists.ozlabs.org
>>> https://lists.ozlabs.org/listinfo/linuxppc-dev
>>=20
>=20

^ permalink raw reply

* Re: [PATCH 10/10] powerpc/mpic: Add in-core support for cascaded MPICs
From: Benjamin Herrenschmidt @ 2011-12-02  3:04 UTC (permalink / raw)
  To: Moffett, Kyle D; +Cc: linuxppc-dev, Paul Mackerras, michaele@au1.ibm.com
In-Reply-To: <CDCF68E8-7EF4-4ED7-A1FA-2A2CE74287CB@boeing.com>

On Thu, 2011-12-01 at 19:48 -0600, Moffett, Kyle D wrote:
> Ben,
> 
> I fixed the 3 issues that Paul and Michael reported and I can provide them
> to you two different ways, however you would prefer.  I can also send the
> patches via email if that's more convenient.
> 
> Option 1: Squashed into the the original patches for bisectability:
>   git://opensource.exmeritus.com/hww-1u-1a/linux.git mpc85xx/mpic-and-stuff

This option, please just re-send to the list.

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH][v2] Enable CONFIG_STRICT_DEVMEM support for Powerpc
From: Sukadev Bhattiprolu @ 2011-12-02  3:25 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, sbest, paulus, anton
In-Reply-To: <1322789207.3729.45.camel@pasglop>

Benjamin Herrenschmidt [benh@kernel.crashing.org] wrote:
| And an additional comment regarding the rtas bit:
| > +int devmem_is_allowed(unsigned long pfn)
| > +{
| > +	if (iomem_is_exclusive(pfn << PAGE_SHIFT))
| > +		return 0;
| > +	if (!page_is_ram(pfn))
| > +		return 1;
| > +	if (page_is_rtas(pfn))
| > +		return 1;
| > +	return 0;
| > +}
| 
| This calls it unconditionally... you just broke the build of all !rtas
| platforms. Additionally, putting an extern definition like that in a .c
| file is gross at best....

Oh, Sorry.

| 
| Please instead, put in a header something like
| 
| #ifdef CONFIG_PPC_RTAS
| extern int page_is_rtas(unsigned long pfn);
| #else
| static inline int page_is_rtas(unsigned long pfn) { }
| #endif
| 
| And while at it, call it page_is_rtas_user_buf(); to make it clear what
| we are talking about, ie, not RTAS core per-se but specifically the RMO
| buffer.

Ok. I will rename, move the declaration to <asm/rtas.h> and resend the
incremental patch.

Sukadev

^ permalink raw reply

* RE: [PATCH][RFC] fsldma: fix performance degradation by optimizing spinlock use.
From: Shi Xuelin-B29237 @ 2011-12-02  3:47 UTC (permalink / raw)
  To: Ira W. Snyder
  Cc: vinod.koul@intel.com, dan.j.williams@intel.com,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	Li Yang-R58472
In-Reply-To: <20111130170737.GA25892@ovro.caltech.edu>

SGkgSXJpcywNCg0KPkknbSBjb252aW5jZWQgdGhhdCAic21wX3JtYigpIiBpcyBuZWVkZWQgd2hl
biByZW1vdmluZyB0aGUgc3BpbmxvY2suIEFzIG5vdGVkLCBEb2N1bWVudGF0aW9uL21lbW9yeS1i
YXJyaWVycy50eHQgc2F5cyB0aGF0IHN0b3JlcyBvbiBvbmUgQ1BVIGNhbiBiZQ0KPm9ic2VydmVk
IGJ5IGFub3RoZXIgQ1BVIGluIGEgZGlmZmVyZW50IG9yZGVyLg0KPlByZXZpb3VzbHksIHRoZXJl
IHdhcyBhbiBVTkxPQ0sgKGluIGZzbF9kbWFfdHhfc3VibWl0KSBmb2xsb3dlZCBieSBhIExPQ0sg
KGluIGZzbF90eF9zdGF0dXMpLiBUaGlzIHByb3ZpZGVkIGEgImZ1bGwgYmFycmllciIsIGZvcmNp
bmcgdGhlIG9wZXJhdGlvbnMgdG8gDQo+Y29tcGxldGUgY29ycmVjdGx5IHdoZW4gdmlld2VkIGJ5
IHRoZSBzZWNvbmQgQ1BVLiANCg0KSSBkbyBub3QgYWdyZWUgdGhpcyBzbXBfcm1iKCkgd29ya3Mg
aGVyZS4gQmVjYXVzZSB3aGVuIHRoaXMgc21wX3JtYigpIGV4ZWN1dGVkIGFuZCBiZWdpbiB0byBy
ZWFkIGNoYW4tPmNvbW1vbi5jb29raWUsIHlvdSBzdG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a2llID09IDE5DQo+ID4gPiA+IGRlc2NyaXB0b3ItPmNvb2tpZSA9PSAyMA0KPiA+ID4gPg0KPiA+
ID4gPiBUaGVuIGRtYV9hc3luY19pc19jb21wbGV0ZSgpIHJldHVybnMgRE1BX0lOX1BST0dSRVNT
LCB3aGljaCBpcyBjb3JyZWN0Lg0KPiA+ID4gPg0KPiA+ID4gPiBUaGFua3MsDQo+ID4gPiA+IEly
YQ0KPiA+ID4gPg0KPiA+ID4gPg0KPiA+ID4gPiBfX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fXw0KPiA+ID4gPiBMaW51eHBwYy1kZXYgbWFpbGluZyBsaXN0DQo+
ID4gPiA+IExpbnV4cHBjLWRldkBsaXN0cy5vemxhYnMub3JnDQo+ID4gPiA+IGh0dHBzOi8vbGlz
dHMub3psYWJzLm9yZy9saXN0aW5mby9saW51eHBwYy1kZXYNCj4gPiANCj4gDQoNCg==

^ permalink raw reply

* Re: [linuxppc-release] [powerpc] boot up problem
From: Tabi Timur-B04825 @ 2011-12-02  3:55 UTC (permalink / raw)
  To: Jia Hongtao-B38951
  Cc: Fleming Andy-AFLEMING, linuxppc-dev@lists.ozlabs.org,
	Li Yang-R58472
In-Reply-To: <412C8208B4A0464FA894C5F0C278CD5DFDC478@039-SN1MPN1-005.039d.mgd.msft.net>

Jia Hongtao-B38951 wrote:
> Hi
>
> I just found that the 'next' branch you mentioned have problem to boot up=
.
> I test it in p1022ds and p1010rdb boards and the result are both the same=
.
> Note that for p1022ds I use "make p1022ds.dtb" to make the dtb file(36bit=
) with 36bit-uboot.
> And for p1010rdb I use all 32bit image.
> The problem list below:
>
> scsi0 : sata_fsl
> ata1: SATA max UDMA/133 irq 74
> fsl-sata fffe19000.sata: Sata FSL Platform/CSB Driver init
> scsi1 : sata_fsl
> ata2: SATA max UDMA/133 irq 41
> Fixed MDIO Bus: probed
> Unable to handle kernel paging request for data at address 0x00000000
> Faulting instruction address: 0xc0451630
> Oops: Kernel access of bad area, sig: 11 [#1]

Andy has phy driver patch that fixes this.

--=20
Timur Tabi
Linux kernel developer at Freescale=

^ permalink raw reply

* Re: [linuxppc-release] [powerpc] boot up problem
From: Kumar Gala @ 2011-12-02  4:12 UTC (permalink / raw)
  To: Jia Hongtao-B38951; +Cc: LinuxPPC-dev list, Li Yang-R58472
In-Reply-To: <412C8208B4A0464FA894C5F0C278CD5DFDC478@039-SN1MPN1-005.039d.mgd.msft.net>


On Dec 1, 2011, at 8:21 PM, Jia Hongtao-B38951 wrote:

> Hi
>=20
> I just found that the 'next' branch you mentioned have problem to boot =
up.
> I test it in p1022ds and p1010rdb boards and the result are both the =
same.
> Note that for p1022ds I use "make p1022ds.dtb" to make the dtb =
file(36bit) with 36bit-uboot.
> And for p1010rdb I use all 32bit image.
> The problem list below:

Can you try Linus's tree and v3.2-rc4

http://git.kernel.org/?p=3Dlinux/kernel/git/torvalds/linux.git;a=3Dsummary=


and see if you have same issue.

> scsi0 : sata_fsl
> ata1: SATA max UDMA/133 irq 74
> fsl-sata fffe19000.sata: Sata FSL Platform/CSB Driver init
> scsi1 : sata_fsl
> ata2: SATA max UDMA/133 irq 41
> Fixed MDIO Bus: probed
> Unable to handle kernel paging request for data at address 0x00000000
> Faulting instruction address: 0xc0451630
> Oops: Kernel access of bad area, sig: 11 [#1]
> SMP NR_CPUS=3D2 P1022 DS
> Modules linked in:
> NIP: c0451630 LR: c0451618 CTR: 00000007
> REGS: ef03fce0 TRAP: 0300   Not tainted  (3.2.0-rc3-00099-g883381d)
> MSR: 00029000 <EE,ME,CE>  CR: 24042022  XER: 00000000
> DEAR: 00000000, ESR: 00800000
> TASK =3D ef040000[1] 'swapper' THREAD: ef03e000 CPU: 0
> GPR00: ef03fd98 ef03fd90 ef040000 ef1ab22c 00000000 00000002 ffeb0000 =
0000fffe
> GPR08: b0541215 00000000 00000000 00000000 24042028 23c406c2 00000000 =
00000000
> GPR16: c0000a00 00000014 3fffffff 03ff9000 00000015 7ff3a760 f1044030 =
fffffff4
> GPR24: c053e128 ef1ab230 c056a3a8 ef03e000 ef040000 ef1ab22c 00000000 =
ef1ab228
> NIP [c0451630] __mutex_lock_slowpath+0xb4/0x190
> LR [c0451618] __mutex_lock_slowpath+0x9c/0x190
> Call Trace:
> [ef03fdd0] [c0451758] mutex_lock+0x4c/0x50
> [ef03fde0] [c02b5124] mdiobus_read+0x38/0x74
> [ef03fe00] [c02b41f4] get_phy_id+0x24/0x80
> [ef03fe20] [c02b9de4] fsl_pq_mdio_probe+0x3b4/0x580
> [ef03feb0] [c0266120] platform_drv_probe+0x20/0x30
> [ef03fec0] [c0264bbc] driver_probe_device+0xa4/0x1d4
> [ef03fee0] [c0264da8] __driver_attach+0xbc/0xc0
> [ef03ff00] [c0263ac0] bus_for_each_dev+0x60/0x9c
> [ef03ff30] [c02647f4] driver_attach+0x24/0x34
> [ef03ff40] [c0264444] bus_add_driver+0x1ac/0x274
> [ef03ff70] [c02651b0] driver_register+0x88/0x154
> [ef03ff90] [c0266450] platform_driver_register+0x68/0x78
> [ef03ffa0] [c05d93b8] fsl_pq_mdio_init+0x18/0x28
> [ef03ffb0] [c0001eb8] do_one_initcall+0x34/0x1a8
> [ef03ffe0] [c05bb82c] kernel_init+0xa0/0x13c
> [ef03fff0] [c000d878] kernel_thread+0x4c/0x68
> Instruction dump:
> 801c0020 2f800063 419dffe8 3bbf0004 7fa3eb78 48001aad 813f000c =
38010008
> 3b3f0008 901f000c 93210008 9121000c
> 3800ffff 93810010 7c0004ac
> ---[ end trace 1643a9a9c5097f8f ]---
> Kernel panic - not syncing: Attempted to kill init!
> Call Trace:
> [ef03fbc0] [c0008044] show_stack+0x44/0x154 (unreliable)
> [ef03fc00] [c04532c8] panic+0xa4/0x1d8
> [ef03fc50] [c0049a00] do_exit+0x5dc/0x684
> [ef03fca0] [c000a6f0] die+0xdc/0x1b4
> [ef03fcc0] [c00128d0] bad_page_fault+0xb4/0xfc
> [ef03fcd0] [c000ebe4] handle_page_fault+0x7c/0x80
> --- Exception: 300 at __mutex_lock_slowpath+0xb4/0x190
>    LR =3D __mutex_lock_slowpath+0x9c/0x190
> [ef03fd90] [00000000]   (null) (unreliable)
> [ef03fdd0] [c0451758] mutex_lock+0x4c/0x50
> [ef03fde0] [c02b5124] mdiobus_read+0x38/0x74
> [ef03fe00] [c02b41f4] get_phy_id+0x24/0x80
> [ef03fe20] [c02b9de4] fsl_pq_mdio_probe+0x3b4/0x580
> [ef03feb0] [c0266120] platform_drv_probe+0x20/0x30
> [ef03fec0] [c0264bbc] driver_probe_device+0xa4/0x1d4
> [ef03fee0] [c0264da8] __driver_attach+0xbc/0xc0
> [ef03ff00] [c0263ac0] bus_for_each_dev+0x60/0x9c
> [ef03ff30] [c02647f4] driver_attach+0x24/0x34
> [ef03ff40] [c0264444] bus_add_driver+0x1ac/0x274
> [ef03ff70] [c02651b0] driver_register+0x88/0x154
> [ef03ff90] [c0266450] platform_driver_register+0x68/0x78
> [ef03ffa0] [c05d93b8] fsl_pq_mdio_init+0x18/0x28
> [ef03ffb0] [c0001eb8] do_one_initcall+0x34/0x1a8
> [ef03ffe0] [c05bb82c] kernel_init+0xa0/0x13c
> [ef03fff0] [c000d878] kernel_thread+0x4c/0x68
> Rebooting in 180 seconds..
>=20
> Do you or anyone else have any idea about this?
> Thanks.

^ permalink raw reply

* Re: [linuxppc-release] [powerpc] boot up problem
From: Kumar Gala @ 2011-12-02  4:12 UTC (permalink / raw)
  To: Andy Fleming
  Cc: LinuxPPC-dev list, Fleming Andy-AFLEMING, Tabi Timur-B04825,
	Li Yang-R58472, Jia Hongtao-B38951
In-Reply-To: <4ED84C32.3010807@freescale.com>


On Dec 1, 2011, at 9:55 PM, Tabi Timur-B04825 wrote:

> Jia Hongtao-B38951 wrote:
>> Hi
>>=20
>> I just found that the 'next' branch you mentioned have problem to =
boot up.
>> I test it in p1022ds and p1010rdb boards and the result are both the =
same.
>> Note that for p1022ds I use "make p1022ds.dtb" to make the dtb =
file(36bit) with 36bit-uboot.
>> And for p1010rdb I use all 32bit image.
>> The problem list below:
>>=20
>> scsi0 : sata_fsl
>> ata1: SATA max UDMA/133 irq 74
>> fsl-sata fffe19000.sata: Sata FSL Platform/CSB Driver init
>> scsi1 : sata_fsl
>> ata2: SATA max UDMA/133 irq 41
>> Fixed MDIO Bus: probed
>> Unable to handle kernel paging request for data at address 0x00000000
>> Faulting instruction address: 0xc0451630
>> Oops: Kernel access of bad area, sig: 11 [#1]
>=20
> Andy has phy driver patch that fixes this.

Andy,

What's going on here?  Is there a fix in v3.2-rc4?

- k=

^ permalink raw reply

* [PATCH] powerpc: Add support for OpenBlockS 600
From: Benjamin Herrenschmidt @ 2011-12-02  5:35 UTC (permalink / raw)
  To: linuxppc-dev

So I've had one of these for a while and it looks like the vendor never
bothered submitting the support upstream.

This adds it using ppc40x_simple and provides a device-tree.

There are some changes to the boot wrapper because the way u-boot works
on this thing, it seems to expect a multipart image with the kernel,
initrd and dtb in it.

The USB support is missing as it needs the yet unmerged driver for
the DWC OTG part and the GPIOs may need further definition in the dts.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/powerpc/Makefile                      |    2 +-
 arch/powerpc/boot/Makefile                 |    7 +
 arch/powerpc/boot/dts/obs600.dts           |  314 ++++++++++++++++++++++++++++
 arch/powerpc/boot/wrapper                  |   22 ++-
 arch/powerpc/configs/40x/obs600_defconfig  |   83 ++++++++
 arch/powerpc/platforms/40x/Kconfig         |   10 +
 arch/powerpc/platforms/40x/ppc40x_simple.c |    3 +-
 7 files changed, 438 insertions(+), 3 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/obs600.dts
 create mode 100644 arch/powerpc/configs/40x/obs600_defconfig

diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 59f462b..ffe4d88 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -165,7 +165,7 @@ all: zImage
 
 # With make 3.82 we cannot mix normal and wildcard targets
 BOOT_TARGETS1 := zImage zImage.initrd uImage
-BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
+BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.% uImage.%
 
 PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
 
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 72ee8c1..80c133c 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -199,6 +199,7 @@ image-$(CONFIG_EP405)			+= dtbImage.ep405
 image-$(CONFIG_HOTFOOT)			+= cuImage.hotfoot
 image-$(CONFIG_WALNUT)			+= treeImage.walnut
 image-$(CONFIG_ACADIA)			+= cuImage.acadia
+image-$(CONFIG_OBS600)			+= uImage.obs600
 
 # Board ports in arch/powerpc/platform/44x/Kconfig
 image-$(CONFIG_EBONY)			+= treeImage.ebony cuImage.ebony
@@ -316,6 +317,12 @@ $(obj)/zImage.iseries: vmlinux
 $(obj)/uImage: vmlinux $(wrapperbits)
 	$(call if_changed,wrap,uboot)
 
+$(obj)/uImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits)
+	$(call if_changed,wrap,uboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
+
+$(obj)/uImage.%: vmlinux $(obj)/%.dtb $(wrapperbits)
+	$(call if_changed,wrap,uboot-$*,,$(obj)/$*.dtb)
+
 $(obj)/cuImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits)
 	$(call if_changed,wrap,cuboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
 
diff --git a/arch/powerpc/boot/dts/obs600.dts b/arch/powerpc/boot/dts/obs600.dts
new file mode 100644
index 0000000..daad350
--- /dev/null
+++ b/arch/powerpc/boot/dts/obs600.dts
@@ -0,0 +1,314 @@
+/*
+ * Device Tree Source for PlatHome OpenBlockS 600 (405EX)
+ *
+ * Copyright 2011 Ben Herrenschmidt, IBM Corp.
+ *
+ * Based on Kilauea by:
+ *
+ * Copyright 2007-2009 DENX Software Engineering, Stefan Roese <sr@denx.de>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without
+ * any warranty of any kind, whether express or implied.
+ */
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	model = "PlatHome,OpenBlockS 600";
+	compatible = "plathome,obs600";
+	dcr-parent = <&{/cpus/cpu@0}>;
+
+	aliases {
+		ethernet0 = &EMAC0;
+		ethernet1 = &EMAC1;
+		serial0 = &UART0;
+		serial1 = &UART1;
+	};
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu@0 {
+			device_type = "cpu";
+			model = "PowerPC,405EX";
+			reg = <0x00000000>;
+			clock-frequency = <0>; /* Filled in by U-Boot */
+			timebase-frequency = <0>; /* Filled in by U-Boot */
+			i-cache-line-size = <32>;
+			d-cache-line-size = <32>;
+			i-cache-size = <16384>; /* 16 kB */
+			d-cache-size = <16384>; /* 16 kB */
+			dcr-controller;
+			dcr-access-method = "native";
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x00000000>; /* Filled in by U-Boot */
+	};
+
+	UIC0: interrupt-controller {
+		compatible = "ibm,uic-405ex", "ibm,uic";
+		interrupt-controller;
+		cell-index = <0>;
+		dcr-reg = <0x0c0 0x009>;
+		#address-cells = <0>;
+		#size-cells = <0>;
+		#interrupt-cells = <2>;
+	};
+
+	UIC1: interrupt-controller1 {
+		compatible = "ibm,uic-405ex","ibm,uic";
+		interrupt-controller;
+		cell-index = <1>;
+		dcr-reg = <0x0d0 0x009>;
+		#address-cells = <0>;
+		#size-cells = <0>;
+		#interrupt-cells = <2>;
+		interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */
+		interrupt-parent = <&UIC0>;
+	};
+
+	UIC2: interrupt-controller2 {
+		compatible = "ibm,uic-405ex","ibm,uic";
+		interrupt-controller;
+		cell-index = <2>;
+		dcr-reg = <0x0e0 0x009>;
+		#address-cells = <0>;
+		#size-cells = <0>;
+		#interrupt-cells = <2>;
+		interrupts = <0x1c 0x4 0x1d 0x4>; /* cascade */
+		interrupt-parent = <&UIC0>;
+	};
+
+	CPM0: cpm {
+		compatible = "ibm,cpm";
+		dcr-access-method = "native";
+		dcr-reg = <0x0b0 0x003>;
+		unused-units = <0x00000000>;
+		idle-doze = <0x02000000>;
+		standby = <0xe3e74800>;
+	};
+
+	plb {
+		compatible = "ibm,plb-405ex", "ibm,plb4";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+		clock-frequency = <0>; /* Filled in by U-Boot */
+
+		SDRAM0: memory-controller {
+			compatible = "ibm,sdram-405ex", "ibm,sdram-4xx-ddr2";
+			dcr-reg = <0x010 0x002>;
+			interrupt-parent = <&UIC2>;
+			interrupts = <0x5 0x4	/* ECC DED Error */ 
+				      0x6 0x4>;	/* ECC SEC Error */ 
+		};
+
+		CRYPTO: crypto@ef700000 {
+			compatible = "amcc,ppc405ex-crypto", "amcc,ppc4xx-crypto";
+			reg = <0xef700000 0x80400>;
+			interrupt-parent = <&UIC0>;
+			interrupts = <0x17 0x2>;
+		};
+
+		MAL0: mcmal {
+			compatible = "ibm,mcmal-405ex", "ibm,mcmal2";
+			dcr-reg = <0x180 0x062>;
+			num-tx-chans = <2>;
+			num-rx-chans = <2>;
+			interrupt-parent = <&MAL0>;
+			interrupts = <0x0 0x1 0x2 0x3 0x4>;
+			#interrupt-cells = <1>;
+			#address-cells = <0>;
+			#size-cells = <0>;
+			interrupt-map = </*TXEOB*/ 0x0 &UIC0 0xa 0x4
+					/*RXEOB*/ 0x1 &UIC0 0xb 0x4
+					/*SERR*/  0x2 &UIC1 0x0 0x4
+					/*TXDE*/  0x3 &UIC1 0x1 0x4
+					/*RXDE*/  0x4 &UIC1 0x2 0x4>;
+			interrupt-map-mask = <0xffffffff>;
+		};
+
+		POB0: opb {
+			compatible = "ibm,opb-405ex", "ibm,opb";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0x80000000 0x80000000 0x10000000
+				  0xef600000 0xef600000 0x00a00000
+				  0xf0000000 0xf0000000 0x10000000>;
+			dcr-reg = <0x0a0 0x005>;
+			clock-frequency = <0>; /* Filled in by U-Boot */
+
+			EBC0: ebc {
+				compatible = "ibm,ebc-405ex", "ibm,ebc";
+				dcr-reg = <0x012 0x002>;
+				#address-cells = <2>;
+				#size-cells = <1>;
+				clock-frequency = <0>; /* Filled in by U-Boot */
+				/* ranges property is supplied by U-Boot */
+				interrupts = <0x5 0x1>;
+				interrupt-parent = <&UIC1>;
+
+				nor_flash@0,0 {
+					compatible = "amd,s29gl512n", "cfi-flash";
+					bank-width = <2>;
+					reg = <0x00000000 0x00000000 0x08000000>;
+					#address-cells = <1>;
+					#size-cells = <1>;
+					partition@0 {
+						label = "kernel + initrd";
+						reg = <0x00000000 0x03de0000>;
+					};
+					partition@3de0000 {
+						label = "user config area";
+						reg = <0x03de0000 0x00080000>;
+					};
+					partition@3e60000 {
+						label = "user program area";
+						reg = <0x03e60000 0x04000000>;
+					};
+					partition@7e60000 {
+						label = "flat device tree";
+						reg = <0x07e60000 0x00080000>;
+					};
+					partition@7ee0000 {
+						label = "test program";
+						reg = <0x07ee0000 0x00080000>;
+					};
+					partition@7f60000 {
+						label = "u-boot env";
+						reg = <0x07f60000 0x00040000>;
+					};
+					partition@7fa0000 {
+						label = "u-boot";
+						reg = <0x07fa0000 0x00060000>;
+					};
+				};
+			};
+
+			UART0: serial@ef600200 {
+				device_type = "serial";
+				compatible = "ns16550";
+				reg = <0xef600200 0x00000008>;
+				virtual-reg = <0xef600200>;
+				clock-frequency = <0>; /* Filled in by U-Boot */
+				current-speed = <0>;
+				interrupt-parent = <&UIC0>;
+				interrupts = <0x1a 0x4>;
+			};
+
+			UART1: serial@ef600300 {
+				device_type = "serial";
+				compatible = "ns16550";
+				reg = <0xef600300 0x00000008>;
+				virtual-reg = <0xef600300>;
+				clock-frequency = <0>; /* Filled in by U-Boot */
+				current-speed = <0>;
+				interrupt-parent = <&UIC0>;
+				interrupts = <0x1 0x4>;
+			};
+
+			IIC0: i2c@ef600400 {
+				compatible = "ibm,iic-405ex", "ibm,iic";
+				reg = <0xef600400 0x00000014>;
+				interrupt-parent = <&UIC0>;
+				interrupts = <0x2 0x4>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				rtc@68 {
+					compatible = "dallas,ds1340";
+					reg = <0x68>;
+				};
+			};
+
+			IIC1: i2c@ef600500 {
+				compatible = "ibm,iic-405ex", "ibm,iic";
+				reg = <0xef600500 0x00000014>;
+				interrupt-parent = <&UIC0>;
+				interrupts = <0x7 0x4>;
+			};
+
+			RGMII0: emac-rgmii@ef600b00 {
+				compatible = "ibm,rgmii-405ex", "ibm,rgmii";
+				reg = <0xef600b00 0x00000104>;
+				has-mdio;
+			};
+
+			EMAC0: ethernet@ef600900 {
+				linux,network-index = <0x0>;
+				device_type = "network";
+				compatible = "ibm,emac-405ex", "ibm,emac4sync";
+				interrupt-parent = <&EMAC0>;
+				interrupts = <0x0 0x1>;
+				#interrupt-cells = <1>;
+				#address-cells = <0>;
+				#size-cells = <0>;
+				interrupt-map = </*Status*/ 0x0 &UIC0 0x18 0x4
+						/*Wake*/  0x1 &UIC1 0x1d 0x4>;
+				reg = <0xef600900 0x000000c4>;
+				local-mac-address = [000000000000]; /* Filled in by U-Boot */
+				mal-device = <&MAL0>;
+				mal-tx-channel = <0>;
+				mal-rx-channel = <0>;
+				cell-index = <0>;
+				max-frame-size = <9000>;
+				rx-fifo-size = <4096>;
+				tx-fifo-size = <2048>;
+				rx-fifo-size-gige = <16384>;
+				tx-fifo-size-gige = <16384>;
+				phy-mode = "rgmii";
+				phy-map = <0x00000000>;
+				rgmii-device = <&RGMII0>;
+				rgmii-channel = <0>;
+				has-inverted-stacr-oc;
+				has-new-stacr-staopc;
+			};
+
+			EMAC1: ethernet@ef600a00 {
+				linux,network-index = <0x1>;
+				device_type = "network";
+				compatible = "ibm,emac-405ex", "ibm,emac4sync";
+				interrupt-parent = <&EMAC1>;
+				interrupts = <0x0 0x1>;
+				#interrupt-cells = <1>;
+				#address-cells = <0>;
+				#size-cells = <0>;
+				interrupt-map = </*Status*/ 0x0 &UIC0 0x19 0x4
+						/*Wake*/  0x1 &UIC1 0x1f 0x4>;
+				reg = <0xef600a00 0x000000c4>;
+				local-mac-address = [000000000000]; /* Filled in by U-Boot */
+				mal-device = <&MAL0>;
+				mal-tx-channel = <1>;
+				mal-rx-channel = <1>;
+				cell-index = <1>;
+				max-frame-size = <9000>;
+				rx-fifo-size = <4096>;
+				tx-fifo-size = <2048>;
+				rx-fifo-size-gige = <16384>;
+				tx-fifo-size-gige = <16384>;
+				phy-mode = "rgmii";
+				phy-map = <0x00000000>;
+				rgmii-device = <&RGMII0>;
+				rgmii-channel = <1>;
+				has-inverted-stacr-oc;
+				has-new-stacr-staopc;
+			};
+
+			GPIO: gpio@ef600800 {
+				device_type = "gpio";	
+				compatible = "ibm,gpio-405ex", "ibm,ppc4xx-gpio";
+				reg = <0xef600800 0x50>;
+			};
+		};
+	};
+        chosen {
+                linux,stdout-path = "/plb/opb/serial@ef600200";
+        };
+};
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index c74531a..14cd4bc 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -163,7 +163,7 @@ coff)
     link_address='0x500000'
     pie=
     ;;
-miboot|uboot)
+miboot|uboot*)
     # miboot and U-boot want just the bare bits, not an ELF binary
     ext=bin
     objflags="-O binary"
@@ -291,6 +291,26 @@ uboot)
     fi
     exit 0
     ;;
+uboot-obs600)
+    rm -f "$ofile"
+    # obs600 wants a multi image with an initrd, so we need to put a fake
+    # one in even when building a "normal" image.
+    if [ -n "$initrd" ]; then
+	real_rd="$initrd"
+    else
+	real_rd=`mktemp`
+	echo "\0" >>"$real_rd"
+    fi
+    ${MKIMAGE} -A ppc -O linux -T multi -C gzip -a $membase -e $membase \
+	$uboot_version -d "$vmz":"$real_rd":"$dtb" "$ofile"
+    if [ -z "$initrd" ]; then
+	rm -f "$real_rd"
+    fi
+    if [ -z "$cacheit" ]; then
+	rm -f "$vmz"
+    fi
+    exit 0
+    ;;
 esac
 
 addsec() {
diff --git a/arch/powerpc/configs/40x/obs600_defconfig b/arch/powerpc/configs/40x/obs600_defconfig
new file mode 100644
index 0000000..91c110d
--- /dev/null
+++ b/arch/powerpc/configs/40x/obs600_defconfig
@@ -0,0 +1,83 @@
+CONFIG_40x=y
+CONFIG_EXPERIMENTAL=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_EXPERT=y
+CONFIG_KALLSYMS_ALL=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_WALNUT is not set
+CONFIG_OBS600=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_MATH_EMULATION=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_IPV6 is not set
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_CONNECTOR=y
+CONFIG_MTD=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_OF_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_JEDECPROBE=y
+CONFIG_MTD_CFI_AMDSTD=y
+CONFIG_MTD_PHYSMAP_OF=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_NDFC=y
+CONFIG_PROC_DEVICETREE=y
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=35000
+CONFIG_NETDEVICES=y
+CONFIG_IBM_EMAC=y
+CONFIG_IBM_EMAC_RXB=256
+CONFIG_IBM_EMAC_TXB=256
+# CONFIG_INPUT is not set
+# CONFIG_SERIO is not set
+# CONFIG_VT is not set
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_OF_PLATFORM=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_IBM_IIC=y
+CONFIG_SENSORS_LM75=y
+CONFIG_THERMAL=y
+# CONFIG_USB_SUPPORT is not set
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_DS1307=y
+CONFIG_EXT2_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_TMPFS=y
+CONFIG_CRAMFS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_ROOT_NFS=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_FS=y
+CONFIG_DETECT_HUNG_TASK=y
+CONFIG_SYSCTL_SYSCALL_CHECK=y
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_ECB=y
+CONFIG_CRYPTO_PCBC=y
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
diff --git a/arch/powerpc/platforms/40x/Kconfig b/arch/powerpc/platforms/40x/Kconfig
index 1530229..bac24a0 100644
--- a/arch/powerpc/platforms/40x/Kconfig
+++ b/arch/powerpc/platforms/40x/Kconfig
@@ -100,6 +100,16 @@ config XILINX_VIRTEX_GENERIC_BOARD
 	  Most Virtex designs should use this unless it needs to do some
 	  special configuration at board probe time.
 
+config OBS600
+	bool "OpenBlockS 600"
+	depends on 40x
+	default n
+	select 405EX
+	select PPC40x_SIMPLE
+	help
+	  This option enables support for PlatHome OpenBlockS 600 server
+
+
 config PPC40x_SIMPLE
 	bool "Simple PowerPC 40x board support"
 	depends on 40x
diff --git a/arch/powerpc/platforms/40x/ppc40x_simple.c b/arch/powerpc/platforms/40x/ppc40x_simple.c
index e8dd5c5..ecac237 100644
--- a/arch/powerpc/platforms/40x/ppc40x_simple.c
+++ b/arch/powerpc/platforms/40x/ppc40x_simple.c
@@ -55,7 +55,8 @@ static const char *board[] __initdata = {
 	"amcc,haleakala",
 	"amcc,kilauea",
 	"amcc,makalu",
-	"est,hotfoot"
+	"est,hotfoot",
+	"plathome,obs600"
 };
 
 static int __init ppc40x_probe(void)

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox