LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCHv3 2.6.25] i2c: adds support for i2c bus on Freescale CPM1/CPM2 controllers
From: Kumar Gala @ 2008-01-28 17:01 UTC (permalink / raw)
  To: Jochen Friedrich
  Cc: linuxppc-dev list, Kernel, Linux, Jean Delvare, Linux I2C,
	Scott Wood
In-Reply-To: <479A185D.6010406@scram.de>


On Jan 25, 2008, at 11:11 AM, Jochen Friedrich wrote:

> Using the port of 2.4 code from Vitaly Bordug <vitb@kernel.crashing.org 
> >
> and the actual algorithm used by the i2c driver of the DBox code on
> cvs.tuxboc.org from Tmbinc, Gillem (htoa@gmx.net). Renamed i2c-rpx.c  
> and
> i2c-algo-8xx.c to i2c-cpm.c and converted the driver to an
> of_platform_driver.
>
> Signed-off-by: Jochen Friedrich <jochen@scram.de>
> ---
> arch/powerpc/boot/dts/mpc8272ads.dts         |   10 +
> arch/powerpc/boot/dts/mpc866ads.dts          |   10 +
> arch/powerpc/boot/dts/mpc885ads.dts          |   10 +
> arch/powerpc/platforms/8xx/mpc885ads_setup.c |    5 +
> drivers/i2c/busses/Kconfig                   |   10 +
> drivers/i2c/busses/Makefile                  |    1 +
> drivers/i2c/busses/i2c-cpm.c                 |  759 +++++++++++++++++ 
> +++++++++
> 7 files changed, 805 insertions(+), 0 deletions(-)

really should be split in two patches.  The drivers/i2c/* should go  
via the i2c maintainers.  the arch/powerpc via me or vitaly.

- k

^ permalink raw reply

* [PATCH] [POWERPC] 83xx: rework platform Kconfig
From: Kumar Gala @ 2008-01-28 16:53 UTC (permalink / raw)
  To: linuxppc-dev

* Allow multiple boards to be selected in a single build
* Removed Kconfig option '83xx' which existed only for compat with arch/ppc
* Removed Kconfig option 'PPC_MPC836x' since its not used
* Renamed Kconfig option 'MPC834x' to 'PPC_MPC834x' to match others
* Added a multiplatform 83xx defconfig (mpc83xx_defconfig).

---

Removed defconfig from patch

 arch/powerpc/configs/mpc83xx_defconfig |  895 ++++++++++++++++++++++++++++++++
 arch/powerpc/platforms/83xx/Kconfig    |   43 +-
 arch/powerpc/platforms/83xx/usb.c      |    4 +-
 arch/powerpc/platforms/Kconfig         |    2 +-
 arch/powerpc/platforms/Kconfig.cputype |    4 -
 5 files changed, 918 insertions(+), 30 deletions(-)
 create mode 100644 arch/powerpc/configs/mpc83xx_defconfig

diff --git a/arch/powerpc/platforms/83xx/Kconfig b/arch/powerpc/platforms/83xx/Kconfig
index ba28882..13587e2 100644
--- a/arch/powerpc/platforms/83xx/Kconfig
+++ b/arch/powerpc/platforms/83xx/Kconfig
@@ -1,11 +1,15 @@
-choice
-	prompt "83xx Board Type"
+menuconfig MPC83xx
+	bool "83xx Board Type"
 	depends on PPC_83xx
-	default MPC834x_MDS
+	select PPC_UDBG_16550
+	select PPC_INDIRECT_PCI
+
+if MPC83xx

 config MPC831x_RDB
 	bool "Freescale MPC831x RDB"
 	select DEFAULT_UIMAGE
+	select PPC_MPC831x
 	help
 	  This option enables support for the MPC8313 RDB and MPC8315 RDB boards.

@@ -13,6 +17,7 @@ config MPC832x_MDS
 	bool "Freescale MPC832x MDS"
 	select DEFAULT_UIMAGE
 	select QUICC_ENGINE
+	select PPC_MPC832x
 	help
 	  This option enables support for the MPC832x MDS evaluation board.

@@ -20,12 +25,14 @@ config MPC832x_RDB
 	bool "Freescale MPC832x RDB"
 	select DEFAULT_UIMAGE
 	select QUICC_ENGINE
+	select PPC_MPC832x
 	help
 	  This option enables support for the MPC8323 RDB board.

 config MPC834x_MDS
 	bool "Freescale MPC834x MDS"
 	select DEFAULT_UIMAGE
+	select PPC_MPC834x
 	help
 	  This option enables support for the MPC 834x MDS evaluation board.

@@ -37,6 +44,7 @@ config MPC834x_MDS
 config MPC834x_ITX
 	bool "Freescale MPC834x ITX"
 	select DEFAULT_UIMAGE
+	select PPC_MPC834x
 	help
 	  This option enables support for the MPC 834x ITX evaluation board.

@@ -53,49 +61,38 @@ config MPC836x_MDS
 config MPC837x_MDS
 	bool "Freescale MPC837x MDS"
 	select DEFAULT_UIMAGE
+	select PPC_MPC837x
 	help
 	  This option enables support for the MPC837x MDS Processor Board.

 config MPC837x_RDB
 	bool "Freescale MPC837x RDB"
 	select DEFAULT_UIMAGE
+	select PPC_MPC837x
 	help
 	  This option enables support for the MPC837x RDB Board.

 config SBC834x
 	bool "Wind River SBC834x"
 	select DEFAULT_UIMAGE
+	select PPC_MPC834x
 	help
 	  This option enables support for the Wind River SBC834x board.

-endchoice
+endif

+# used for usb
 config PPC_MPC831x
 	bool
-	select PPC_UDBG_16550
-	select PPC_INDIRECT_PCI
-	default y if MPC831x_RDB

+# used for math-emu
 config PPC_MPC832x
 	bool
-	select PPC_UDBG_16550
-	select PPC_INDIRECT_PCI
-	default y if MPC832x_MDS || MPC832x_RDB

-config MPC834x
+# used for usb
+config PPC_MPC834x
 	bool
-	select PPC_UDBG_16550
-	select PPC_INDIRECT_PCI
-	default y if MPC834x_MDS || MPC834x_ITX || SBC834x
-
-config PPC_MPC836x
-	bool
-	select PPC_UDBG_16550
-	select PPC_INDIRECT_PCI
-	default y if MPC836x_MDS

+# used for usb
 config PPC_MPC837x
 	bool
-	select PPC_UDBG_16550
-	select PPC_INDIRECT_PCI
-	default y if MPC837x_MDS || MPC837x_RDB
diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c
index 6a454a4..681230a 100644
--- a/arch/powerpc/platforms/83xx/usb.c
+++ b/arch/powerpc/platforms/83xx/usb.c
@@ -22,7 +22,7 @@
 #include "mpc83xx.h"


-#ifdef CONFIG_MPC834x
+#ifdef CONFIG_PPC_MPC834x
 int mpc834x_usb_cfg(void)
 {
 	unsigned long sccr, sicrl, sicrh;
@@ -96,7 +96,7 @@ int mpc834x_usb_cfg(void)
 	iounmap(immap);
 	return 0;
 }
-#endif /* CONFIG_MPC834x */
+#endif /* CONFIG_PPC_MPC834x */

 #ifdef CONFIG_PPC_MPC831x
 int mpc831x_usb_cfg(void)
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 582a3a6..fdce10c 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -21,7 +21,7 @@ config PPC_83xx
 	bool "Freescale 83xx"
 	depends on 6xx
 	select FSL_SOC
-	select 83xx
+	select MPC83xx
 	select IPIC
 	select WANT_DEVICE_TREE

diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index f6bf025..7fc4110 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -93,10 +93,6 @@ config 6xx
 config 8xx
 	bool

-# this is temp to handle compat with arch=ppc
-config 83xx
-	bool
-
 config E500
 	bool

-- 
1.5.3.7

^ permalink raw reply related

* [PATCH] [POWERPC] 85xx: convert sbc85* boards to use machine_device_initcall
From: Kumar Gala @ 2008-01-28 16:56 UTC (permalink / raw)
  To: linuxppc-dev

---
 arch/powerpc/platforms/85xx/sbc8548.c |    6 ++----
 arch/powerpc/platforms/85xx/sbc8560.c |    6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/sbc8548.c b/arch/powerpc/platforms/85xx/sbc8548.c
index de27b57..488facb 100644
--- a/arch/powerpc/platforms/85xx/sbc8548.c
+++ b/arch/powerpc/platforms/85xx/sbc8548.c
@@ -135,13 +135,11 @@ static struct of_device_id __initdata of_bus_ids[] = {

 static int __init declare_of_platform_devices(void)
 {
-	if (!machine_is(sbc8548))
-		return 0;
-
 	of_platform_bus_probe(NULL, of_bus_ids, NULL);
+
 	return 0;
 }
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(sbc8548, declare_of_platform_devices);

 /*
  * Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/sbc8560.c b/arch/powerpc/platforms/85xx/sbc8560.c
index e2bc368..2c580cd 100644
--- a/arch/powerpc/platforms/85xx/sbc8560.c
+++ b/arch/powerpc/platforms/85xx/sbc8560.c
@@ -222,13 +222,11 @@ static struct of_device_id __initdata of_bus_ids[] = {

 static int __init declare_of_platform_devices(void)
 {
-	if (!machine_is(sbc8560))
-		return 0;
-
 	of_platform_bus_probe(NULL, of_bus_ids, NULL);
+
 	return 0;
 }
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(sbc8560, declare_of_platform_devices);

 /*
  * Called very early, device-tree isn't unflattened
-- 
1.5.3.7

^ permalink raw reply related

* [Add mpc5121 support PATCH v4 3/4] Factor out 5200 dependencies from 52xx psc driver
From: John Rigby @ 2008-01-28 17:28 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: John Rigby
In-Reply-To: <1201541336-28676-3-git-send-email-jrigby@freescale.com>

PSCs change from 5200 to 5121
this patch localizes the differences in
preparation for adding 5121 support

Signed-off-by: John Rigby <jrigby@freescale.com>
---
 drivers/serial/mpc52xx_uart.c |  256 ++++++++++++++++++++++++++++++----------
 1 files changed, 192 insertions(+), 64 deletions(-)

diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 1e3721a..5bd1171 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -67,7 +67,6 @@
 #include <linux/serial.h>
 #include <linux/sysrq.h>
 #include <linux/console.h>
-
 #include <linux/delay.h>
 #include <linux/io.h>
 
@@ -111,8 +110,8 @@ static struct device_node *mpc52xx_uart_nodes[MPC52xx_PSC_MAXNUM];
 static void mpc52xx_uart_of_enumerate(void);
 #endif
 
+
 #define PSC(port) ((struct mpc52xx_psc __iomem *)((port)->membase))
-#define FIFO(port) ((struct mpc52xx_psc_fifo __iomem *)(PSC(port)+1))
 
 
 /* Forward declaration of the interruption handling routine */
@@ -135,6 +134,162 @@ static struct of_device_id mpc52xx_uart_of_match[] = {
 };
 #endif
 
+/* ======================================================================== */
+/* PSC fifo operations for isolating differences between 52xx and 512x      */
+/* ======================================================================== */
+
+struct psc_ops {
+	void		(*fifo_init)(struct uart_port *port);
+	int		(*raw_rx_rdy)(struct uart_port *port);
+	int		(*raw_tx_rdy)(struct uart_port *port);
+	int		(*rx_rdy)(struct uart_port *port);
+	int		(*tx_rdy)(struct uart_port *port);
+	int		(*tx_empty)(struct uart_port *port);
+	void		(*stop_rx)(struct uart_port *port);
+	void		(*start_tx)(struct uart_port *port);
+	void		(*stop_tx)(struct uart_port *port);
+	void		(*rx_clr_irq)(struct uart_port *port);
+	void		(*tx_clr_irq)(struct uart_port *port);
+	void		(*write_char)(struct uart_port *port, unsigned char c);
+	unsigned char	(*read_char)(struct uart_port *port);
+	void		(*cw_disable_ints)(struct uart_port *port);
+	void		(*cw_restore_ints)(struct uart_port *port);
+	unsigned long	(*getuartclk)(void *p);
+};
+
+#define FIFO_52xx(port) ((struct mpc52xx_psc_fifo __iomem *)(PSC(port)+1))
+static void mpc52xx_psc_fifo_init(struct uart_port *port)
+{
+	struct mpc52xx_psc __iomem *psc = PSC(port);
+	struct mpc52xx_psc_fifo __iomem *fifo = FIFO_52xx(port);
+
+	/* /32 prescaler */
+	out_be16(&psc->mpc52xx_psc_clock_select, 0xdd00);
+
+	out_8(&fifo->rfcntl, 0x00);
+	out_be16(&fifo->rfalarm, 0x1ff);
+	out_8(&fifo->tfcntl, 0x07);
+	out_be16(&fifo->tfalarm, 0x80);
+
+	port->read_status_mask |= MPC52xx_PSC_IMR_RXRDY | MPC52xx_PSC_IMR_TXRDY;
+	out_be16(&psc->mpc52xx_psc_imr, port->read_status_mask);
+}
+
+static int mpc52xx_psc_raw_rx_rdy(struct uart_port *port)
+{
+	return in_be16(&PSC(port)->mpc52xx_psc_status)
+	    & MPC52xx_PSC_SR_RXRDY;
+}
+
+static int mpc52xx_psc_raw_tx_rdy(struct uart_port *port)
+{
+	return in_be16(&PSC(port)->mpc52xx_psc_status)
+	    & MPC52xx_PSC_SR_TXRDY;
+}
+
+
+static int mpc52xx_psc_rx_rdy(struct uart_port *port)
+{
+	return in_be16(&PSC(port)->mpc52xx_psc_isr)
+	    & port->read_status_mask
+	    & MPC52xx_PSC_IMR_RXRDY;
+}
+
+static int mpc52xx_psc_tx_rdy(struct uart_port *port)
+{
+	return in_be16(&PSC(port)->mpc52xx_psc_isr)
+	    & port->read_status_mask
+	    & MPC52xx_PSC_IMR_TXRDY;
+}
+
+static int mpc52xx_psc_tx_empty(struct uart_port *port)
+{
+	return in_be16(&PSC(port)->mpc52xx_psc_status)
+	    & MPC52xx_PSC_SR_TXEMP;
+}
+
+static void mpc52xx_psc_start_tx(struct uart_port *port)
+{
+	port->read_status_mask |= MPC52xx_PSC_IMR_TXRDY;
+	out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
+}
+
+static void mpc52xx_psc_stop_tx(struct uart_port *port)
+{
+	port->read_status_mask &= ~MPC52xx_PSC_IMR_TXRDY;
+	out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
+}
+
+static void mpc52xx_psc_stop_rx(struct uart_port *port)
+{
+	port->read_status_mask &= ~MPC52xx_PSC_IMR_RXRDY;
+	out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
+}
+
+static void mpc52xx_psc_rx_clr_irq(struct uart_port *port)
+{
+}
+
+static void mpc52xx_psc_tx_clr_irq(struct uart_port *port)
+{
+}
+
+static void mpc52xx_psc_write_char(struct uart_port *port, unsigned char c)
+{
+	out_8(&PSC(port)->mpc52xx_psc_buffer_8, c);
+}
+
+static unsigned char mpc52xx_psc_read_char(struct uart_port *port)
+{
+	return in_8(&PSC(port)->mpc52xx_psc_buffer_8);
+}
+
+static void mpc52xx_psc_cw_disable_ints(struct uart_port *port)
+{
+	out_be16(&PSC(port)->mpc52xx_psc_imr, 0);
+}
+
+static void mpc52xx_psc_cw_restore_ints(struct uart_port *port)
+{
+	out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
+}
+
+/* Search for bus-frequency property in this node or a parent */
+static unsigned long mpc52xx_getuartclk(void *p)
+{
+#if defined(CONFIG_PPC_MERGE)
+	/*
+	 * 5200 UARTs have a / 32 prescaler
+	 * but the generic serial code assumes 16
+	 * so return ipb freq / 2
+	 */
+	return mpc52xx_find_ipb_freq(p) / 2;
+#else
+	pr_debug("unexpected call to mpc52xx_getuartclk with arch/ppc\n");
+	return NULL;
+#endif
+}
+
+static struct psc_ops mpc52xx_psc_ops = {
+	.fifo_init = mpc52xx_psc_fifo_init,
+	.raw_rx_rdy = mpc52xx_psc_raw_rx_rdy,
+	.raw_tx_rdy = mpc52xx_psc_raw_tx_rdy,
+	.rx_rdy = mpc52xx_psc_rx_rdy,
+	.tx_rdy = mpc52xx_psc_tx_rdy,
+	.tx_empty = mpc52xx_psc_tx_empty,
+	.stop_rx = mpc52xx_psc_stop_rx,
+	.start_tx = mpc52xx_psc_start_tx,
+	.stop_tx = mpc52xx_psc_stop_tx,
+	.rx_clr_irq = mpc52xx_psc_rx_clr_irq,
+	.tx_clr_irq = mpc52xx_psc_tx_clr_irq,
+	.write_char = mpc52xx_psc_write_char,
+	.read_char = mpc52xx_psc_read_char,
+	.cw_disable_ints = mpc52xx_psc_cw_disable_ints,
+	.cw_restore_ints = mpc52xx_psc_cw_restore_ints,
+	.getuartclk = mpc52xx_getuartclk,
+};
+
+static struct psc_ops *psc_ops = &mpc52xx_psc_ops;
 
 /* ======================================================================== */
 /* UART operations                                                          */
@@ -143,8 +298,7 @@ static struct of_device_id mpc52xx_uart_of_match[] = {
 static unsigned int
 mpc52xx_uart_tx_empty(struct uart_port *port)
 {
-	int status = in_be16(&PSC(port)->mpc52xx_psc_status);
-	return (status & MPC52xx_PSC_SR_TXEMP) ? TIOCSER_TEMT : 0;
+	return psc_ops->tx_empty(port) ? TIOCSER_TEMT : 0;
 }
 
 static void
@@ -164,16 +318,14 @@ static void
 mpc52xx_uart_stop_tx(struct uart_port *port)
 {
 	/* port->lock taken by caller */
-	port->read_status_mask &= ~MPC52xx_PSC_IMR_TXRDY;
-	out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
+	psc_ops->stop_tx(port);
 }
 
 static void
 mpc52xx_uart_start_tx(struct uart_port *port)
 {
 	/* port->lock taken by caller */
-	port->read_status_mask |= MPC52xx_PSC_IMR_TXRDY;
-	out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
+	psc_ops->start_tx(port);
 }
 
 static void
@@ -186,8 +338,7 @@ mpc52xx_uart_send_xchar(struct uart_port *port, char ch)
 	if (ch) {
 		/* Make sure tx interrupts are on */
 		/* Truly necessary ??? They should be anyway */
-		port->read_status_mask |= MPC52xx_PSC_IMR_TXRDY;
-		out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
+		psc_ops->start_tx(port);
 	}
 
 	spin_unlock_irqrestore(&port->lock, flags);
@@ -197,8 +348,7 @@ static void
 mpc52xx_uart_stop_rx(struct uart_port *port)
 {
 	/* port->lock taken by caller */
-	port->read_status_mask &= ~MPC52xx_PSC_IMR_RXRDY;
-	out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
+	psc_ops->stop_rx(port);
 }
 
 static void
@@ -225,7 +375,6 @@ static int
 mpc52xx_uart_startup(struct uart_port *port)
 {
 	struct mpc52xx_psc __iomem *psc = PSC(port);
-	struct mpc52xx_psc_fifo __iomem *fifo = FIFO(port);
 	int ret;
 
 	/* Request IRQ */
@@ -240,15 +389,7 @@ mpc52xx_uart_startup(struct uart_port *port)
 
 	out_be32(&psc->sicr, 0);	/* UART mode DCD ignored */
 
-	out_be16(&psc->mpc52xx_psc_clock_select, 0xdd00); /* /16 prescaler on */
-
-	out_8(&fifo->rfcntl, 0x00);
-	out_be16(&fifo->rfalarm, 0x1ff);
-	out_8(&fifo->tfcntl, 0x07);
-	out_be16(&fifo->tfalarm, 0x80);
-
-	port->read_status_mask |= MPC52xx_PSC_IMR_RXRDY | MPC52xx_PSC_IMR_TXRDY;
-	out_be16(&psc->mpc52xx_psc_imr, port->read_status_mask);
+	psc_ops->fifo_init(port);
 
 	out_8(&psc->command, MPC52xx_PSC_TX_ENABLE);
 	out_8(&psc->command, MPC52xx_PSC_RX_ENABLE);
@@ -331,8 +472,7 @@ mpc52xx_uart_set_termios(struct uart_port *port, struct ktermios *new,
 	 * boot for the console, all stuff is not yet ready to receive at that
 	 * time and that just makes the kernel oops */
 	/* while (j-- && mpc52xx_uart_int_rx_chars(port)); */
-	while (!(in_be16(&psc->mpc52xx_psc_status) & MPC52xx_PSC_SR_TXEMP) &&
-	       --j)
+	while (!mpc52xx_uart_tx_empty(port) && --j)
 		udelay(1);
 
 	if (!j)
@@ -460,11 +600,9 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port)
 	unsigned short status;
 
 	/* While we can read, do so ! */
-	while ((status = in_be16(&PSC(port)->mpc52xx_psc_status)) &
-		MPC52xx_PSC_SR_RXRDY) {
-
+	while (psc_ops->raw_rx_rdy(port)) {
 		/* Get the char */
-		ch = in_8(&PSC(port)->mpc52xx_psc_buffer_8);
+		ch = psc_ops->read_char(port);
 
 		/* Handle sysreq char */
 #ifdef SUPPORT_SYSRQ
@@ -479,6 +617,8 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port)
 		flag = TTY_NORMAL;
 		port->icount.rx++;
 
+		status = in_be16(&PSC(port)->mpc52xx_psc_status);
+
 		if (status & (MPC52xx_PSC_SR_PE |
 			      MPC52xx_PSC_SR_FE |
 			      MPC52xx_PSC_SR_RB)) {
@@ -508,7 +648,7 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port)
 
 	tty_flip_buffer_push(tty);
 
-	return in_be16(&PSC(port)->mpc52xx_psc_status) & MPC52xx_PSC_SR_RXRDY;
+	return psc_ops->raw_rx_rdy(port);
 }
 
 static inline int
@@ -518,7 +658,7 @@ mpc52xx_uart_int_tx_chars(struct uart_port *port)
 
 	/* Process out of band chars */
 	if (port->x_char) {
-		out_8(&PSC(port)->mpc52xx_psc_buffer_8, port->x_char);
+		psc_ops->write_char(port, port->x_char);
 		port->icount.tx++;
 		port->x_char = 0;
 		return 1;
@@ -531,8 +671,8 @@ mpc52xx_uart_int_tx_chars(struct uart_port *port)
 	}
 
 	/* Send chars */
-	while (in_be16(&PSC(port)->mpc52xx_psc_status) & MPC52xx_PSC_SR_TXRDY) {
-		out_8(&PSC(port)->mpc52xx_psc_buffer_8, xmit->buf[xmit->tail]);
+	while (psc_ops->raw_tx_rdy(port)) {
+		psc_ops->write_char(port, xmit->buf[xmit->tail]);
 		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
 		port->icount.tx++;
 		if (uart_circ_empty(xmit))
@@ -558,7 +698,6 @@ mpc52xx_uart_int(int irq, void *dev_id)
 	struct uart_port *port = dev_id;
 	unsigned long pass = ISR_PASS_LIMIT;
 	unsigned int keepgoing;
-	unsigned short status;
 
 	spin_lock(&port->lock);
 
@@ -567,18 +706,12 @@ mpc52xx_uart_int(int irq, void *dev_id)
 		/* If we don't find anything to do, we stop */
 		keepgoing = 0;
 
-		/* Read status */
-		status = in_be16(&PSC(port)->mpc52xx_psc_isr);
-		status &= port->read_status_mask;
-
-		/* Do we need to receive chars ? */
-		/* For this RX interrupts must be on and some chars waiting */
-		if (status & MPC52xx_PSC_IMR_RXRDY)
+		psc_ops->rx_clr_irq(port);
+		if (psc_ops->rx_rdy(port))
 			keepgoing |= mpc52xx_uart_int_rx_chars(port);
 
-		/* Do we need to send chars ? */
-		/* For this, TX must be ready and TX interrupt enabled */
-		if (status & MPC52xx_PSC_IMR_TXRDY)
+		psc_ops->tx_clr_irq(port);
+		if (psc_ops->tx_rdy(port))
 			keepgoing |= mpc52xx_uart_int_tx_chars(port);
 
 		/* Limit number of iteration */
@@ -645,36 +778,33 @@ static void
 mpc52xx_console_write(struct console *co, const char *s, unsigned int count)
 {
 	struct uart_port *port = &mpc52xx_uart_ports[co->index];
-	struct mpc52xx_psc __iomem *psc = PSC(port);
 	unsigned int i, j;
 
 	/* Disable interrupts */
-	out_be16(&psc->mpc52xx_psc_imr, 0);
+	psc_ops->cw_disable_ints(port);
 
 	/* Wait the TX buffer to be empty */
 	j = 5000000;	/* Maximum wait */
-	while (!(in_be16(&psc->mpc52xx_psc_status) & MPC52xx_PSC_SR_TXEMP) &&
-	       --j)
+	while (!mpc52xx_uart_tx_empty(port) && --j)
 		udelay(1);
 
 	/* Write all the chars */
 	for (i = 0; i < count; i++, s++) {
 		/* Line return handling */
 		if (*s == '\n')
-			out_8(&psc->mpc52xx_psc_buffer_8, '\r');
+			psc_ops->write_char(port, '\r');
 
 		/* Send the char */
-		out_8(&psc->mpc52xx_psc_buffer_8, *s);
+		psc_ops->write_char(port, *s);
 
 		/* Wait the TX buffer to be empty */
 		j = 20000;	/* Maximum wait */
-		while (!(in_be16(&psc->mpc52xx_psc_status) &
-			 MPC52xx_PSC_SR_TXEMP) && --j)
+		while (!mpc52xx_uart_tx_empty(port) && --j)
 			udelay(1);
 	}
 
 	/* Restore interrupt state */
-	out_be16(&psc->mpc52xx_psc_imr, port->read_status_mask);
+	psc_ops->cw_restore_ints(port);
 }
 
 #if !defined(CONFIG_PPC_MERGE)
@@ -719,7 +849,7 @@ mpc52xx_console_setup(struct console *co, char *options)
 {
 	struct uart_port *port = &mpc52xx_uart_ports[co->index];
 	struct device_node *np = mpc52xx_uart_nodes[co->index];
-	unsigned int ipb_freq;
+	unsigned int uartclk;
 	struct resource res;
 	int ret;
 
@@ -751,17 +881,16 @@ mpc52xx_console_setup(struct console *co, char *options)
 		return ret;
 	}
 
-	/* Search for bus-frequency property in this node or a parent */
-	ipb_freq = mpc52xx_find_ipb_freq(np);
-	if (ipb_freq == 0) {
-		pr_debug("Could not find IPB bus frequency!\n");
+	uartclk = psc_ops->getuartclk(np);
+	if (uartclk == 0) {
+		pr_debug("Could not find uart clock frequency!\n");
 		return -EINVAL;
 	}
 
 	/* Basic port init. Needed since we use some uart_??? func before
 	 * real init for early access */
 	spin_lock_init(&port->lock);
-	port->uartclk	= ipb_freq / 2;
+	port->uartclk = uartclk;
 	port->ops	= &mpc52xx_uart_ops;
 	port->mapbase = res.start;
 	port->membase = ioremap(res.start, sizeof(struct mpc52xx_psc));
@@ -947,7 +1076,7 @@ static int __devinit
 mpc52xx_uart_of_probe(struct of_device *op, const struct of_device_id *match)
 {
 	int idx = -1;
-	unsigned int ipb_freq;
+	unsigned int uartclk;
 	struct uart_port *port = NULL;
 	struct resource res;
 	int ret;
@@ -963,10 +1092,9 @@ mpc52xx_uart_of_probe(struct of_device *op, const struct of_device_id *match)
 	pr_debug("Found %s assigned to ttyPSC%x\n",
 		 mpc52xx_uart_nodes[idx]->full_name, idx);
 
-	/* Search for bus-frequency property in this node or a parent */
-	ipb_freq = mpc52xx_find_ipb_freq(op->node);
-	if (ipb_freq == 0) {
-		dev_dbg(&op->dev, "Could not find IPB bus frequency!\n");
+	uartclk = psc_ops->getuartclk(op->node);
+	if (uartclk == 0) {
+		dev_dbg(&op->dev, "Could not find uart clock frequency!\n");
 		return -EINVAL;
 	}
 
@@ -974,7 +1102,7 @@ mpc52xx_uart_of_probe(struct of_device *op, const struct of_device_id *match)
 	port = &mpc52xx_uart_ports[idx];
 
 	spin_lock_init(&port->lock);
-	port->uartclk	= ipb_freq / 2;
+	port->uartclk = uartclk;
 	port->fifosize	= 512;
 	port->iotype	= UPIO_MEM;
 	port->flags	= UPF_BOOT_AUTOCONF |
-- 
1.5.3.8

^ permalink raw reply related

* [Add mpc5121 support PATCH v4 1/4] Basic Freescale MPC512x support
From: John Rigby @ 2008-01-28 17:28 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: John Rigby
In-Reply-To: <1201541336-28676-1-git-send-email-jrigby@freescale.com>

512x is very similar to 83xx and most
of this is patterned after code from 83xx.

New platform:
    changed:
	arch/powerpc/Kconfig
	arch/powerpc/platforms/Kconfig
	arch/powerpc/platforms/Kconfig.cputype
	arch/powerpc/platforms/Makefile
    new:
	arch/powerpc/platforms/512x/*
	include/asm-powerpc/mpc512x.h

Signed-off-by: John Rigby <jrigby@freescale.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>

Conflicts:

	arch/powerpc/Kconfig
---
 arch/powerpc/Kconfig                      |    2 +-
 arch/powerpc/platforms/512x/Kconfig       |   20 ++++++
 arch/powerpc/platforms/512x/Makefile      |    4 +
 arch/powerpc/platforms/512x/mpc5121_ads.c |  104 +++++++++++++++++++++++++++++
 arch/powerpc/platforms/Kconfig            |    1 +
 arch/powerpc/platforms/Kconfig.cputype    |    6 +-
 arch/powerpc/platforms/Makefile           |    1 +
 include/asm-powerpc/mpc512x.h             |   22 ++++++
 8 files changed, 156 insertions(+), 4 deletions(-)
 create mode 100644 arch/powerpc/platforms/512x/Kconfig
 create mode 100644 arch/powerpc/platforms/512x/Makefile
 create mode 100644 arch/powerpc/platforms/512x/mpc5121_ads.c
 create mode 100644 include/asm-powerpc/mpc512x.h

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 5e10838..12c5cde 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -481,7 +481,7 @@ config PCI
 	bool "PCI support" if 40x || CPM2 || PPC_83xx || PPC_85xx || PPC_86xx \
 		|| PPC_MPC52xx || (EMBEDDED && (PPC_PSERIES || PPC_ISERIES)) \
 		|| PPC_PS3 || 44x
-	default y if !40x && !CPM2 && !8xx && !PPC_83xx \
+	default y if !40x && !CPM2 && !8xx && !PPC_MPC512x && !PPC_83xx \
 		&& !PPC_85xx && !PPC_86xx
 	default PCI_PERMEDIA if !4xx && !CPM2 && !8xx
 	default PCI_QSPAN if !4xx && !CPM2 && 8xx
diff --git a/arch/powerpc/platforms/512x/Kconfig b/arch/powerpc/platforms/512x/Kconfig
new file mode 100644
index 0000000..c6fa49e
--- /dev/null
+++ b/arch/powerpc/platforms/512x/Kconfig
@@ -0,0 +1,20 @@
+config PPC_MPC512x
+	bool
+	select FSL_SOC
+	select IPIC
+	default n
+
+config PPC_MPC5121
+	bool
+	select PPC_MPC512x
+	default n
+
+config MPC5121_ADS
+	bool "Freescale MPC5121E ADS"
+	depends on PPC_MULTIPLATFORM && PPC32
+	select DEFAULT_UIMAGE
+	select WANT_DEVICE_TREE
+	select PPC_MPC5121
+	help
+	  This option enables support for the MPC5121E ADS board.
+	default n
diff --git a/arch/powerpc/platforms/512x/Makefile b/arch/powerpc/platforms/512x/Makefile
new file mode 100644
index 0000000..232c89f
--- /dev/null
+++ b/arch/powerpc/platforms/512x/Makefile
@@ -0,0 +1,4 @@
+#
+# Makefile for the Freescale PowerPC 512x linux kernel.
+#
+obj-$(CONFIG_MPC5121_ADS)	+= mpc5121_ads.o
diff --git a/arch/powerpc/platforms/512x/mpc5121_ads.c b/arch/powerpc/platforms/512x/mpc5121_ads.c
new file mode 100644
index 0000000..50bd3a3
--- /dev/null
+++ b/arch/powerpc/platforms/512x/mpc5121_ads.c
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+ *
+ * Author: John Rigby, <jrigby@freescale.com>, Thur Mar 29 2007
+ *
+ * Description:
+ * MPC5121 ADS board setup
+ *
+ * This 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.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/io.h>
+#include <linux/irq.h>
+#include <linux/of_platform.h>
+
+#include <asm/machdep.h>
+#include <asm/ipic.h>
+#include <asm/prom.h>
+#include <asm/time.h>
+
+/**
+ * 	mpc512x_find_ips_freq - Find the IPS bus frequency for a device
+ * 	@node:	device node
+ *
+ * 	Returns IPS bus frequency, or 0 if the bus frequency cannot be found.
+ */
+unsigned long
+mpc512x_find_ips_freq(struct device_node *node)
+{
+	struct device_node *np;
+	const unsigned int *p_ips_freq = NULL;
+
+	of_node_get(node);
+	while (node) {
+		p_ips_freq = of_get_property(node, "bus-frequency", NULL);
+		if (p_ips_freq)
+			break;
+
+		np = of_get_parent(node);
+		of_node_put(node);
+		node = np;
+	}
+	if (node)
+		of_node_put(node);
+
+	return p_ips_freq ? *p_ips_freq : 0;
+}
+EXPORT_SYMBOL(mpc512x_find_ips_freq);
+
+static struct of_device_id __initdata of_bus_ids[] = {
+	{ .name = "soc", },
+	{ .name = "localbus", },
+	{},
+};
+
+static void __init mpc5121_ads_declare_of_platform_devices(void)
+{
+	/* Find every child of the SOC node and add it to of_platform */
+	if (of_platform_bus_probe(NULL, of_bus_ids, NULL))
+		printk(KERN_ERR __FILE__ ": "
+			"Error while probing of_platform bus\n");
+}
+
+static void __init mpc5121_ads_init_IRQ(void)
+{
+	struct device_node *np;
+
+	np = of_find_compatible_node(NULL, NULL, "fsl,ipic");
+	if (!np)
+		return;
+
+	ipic_init(np, 0);
+	of_node_put(np);
+
+	/*
+	 * Initialize the default interrupt mapping priorities,
+	 * in case the boot rom changed something on us.
+	 */
+	ipic_set_default_priority();
+}
+
+/*
+ * Called very early, MMU is off, device-tree isn't unflattened
+ */
+static int __init mpc5121_ads_probe(void)
+{
+	unsigned long root = of_get_flat_dt_root();
+
+	return of_flat_dt_is_compatible(root, "fsl,mpc5121ads");
+}
+
+define_machine(mpc5121_ads) {
+	.name			= "MPC5121 ADS",
+	.probe			= mpc5121_ads_probe,
+	.init			= mpc5121_ads_declare_of_platform_devices,
+	.init_IRQ		= mpc5121_ads_init_IRQ,
+	.get_irq		= ipic_get_irq,
+	.calibrate_decr		= generic_calibrate_decr,
+};
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 4286664..d0606a9 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -41,6 +41,7 @@ config CLASSIC32
 source "arch/powerpc/platforms/pseries/Kconfig"
 source "arch/powerpc/platforms/iseries/Kconfig"
 source "arch/powerpc/platforms/chrp/Kconfig"
+source "arch/powerpc/platforms/512x/Kconfig"
 source "arch/powerpc/platforms/52xx/Kconfig"
 source "arch/powerpc/platforms/powermac/Kconfig"
 source "arch/powerpc/platforms/prep/Kconfig"
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index c3ee0b5..fb86300 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -14,7 +14,7 @@ choice
 	  There are five families of 32 bit PowerPC chips supported.
 	  The most common ones are the desktop and server CPUs (601, 603,
 	  604, 740, 750, 74xx) CPUs from Freescale and IBM, with their
-	  embedded 52xx/82xx/83xx/86xx counterparts.
+	  embedded 512x/52xx/82xx/83xx/86xx counterparts.
 	  The other embeeded parts, namely 4xx, 8xx, e200 (55xx) and e500
 	  (85xx) each form a family of their own that is not compatible
 	  with the others.
@@ -22,7 +22,7 @@ choice
 	  If unsure, select 52xx/6xx/7xx/74xx/82xx/83xx/86xx.
 
 config 6xx
-	bool "52xx/6xx/7xx/74xx/82xx/83xx/86xx"
+	bool "512x/52xx/6xx/7xx/74xx/82xx/83xx/86xx"
 	select PPC_FPU
 
 config PPC_85xx
@@ -229,7 +229,7 @@ config NR_CPUS
 
 config NOT_COHERENT_CACHE
 	bool
-	depends on 4xx || 8xx || E200
+	depends on 4xx || 8xx || E200 || PPC_MPC512x
 	default y
 
 config CHECK_CACHE_COHERENCY
diff --git a/arch/powerpc/platforms/Makefile b/arch/powerpc/platforms/Makefile
index 6d9079d..a984894 100644
--- a/arch/powerpc/platforms/Makefile
+++ b/arch/powerpc/platforms/Makefile
@@ -11,6 +11,7 @@ endif
 obj-$(CONFIG_PPC_CHRP)		+= chrp/
 obj-$(CONFIG_40x)		+= 40x/
 obj-$(CONFIG_44x)		+= 44x/
+obj-$(CONFIG_PPC_MPC512x)	+= 512x/
 obj-$(CONFIG_PPC_MPC52xx)	+= 52xx/
 obj-$(CONFIG_PPC_8xx)		+= 8xx/
 obj-$(CONFIG_PPC_82xx)		+= 82xx/
diff --git a/include/asm-powerpc/mpc512x.h b/include/asm-powerpc/mpc512x.h
new file mode 100644
index 0000000..c48a165
--- /dev/null
+++ b/include/asm-powerpc/mpc512x.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+ *
+ * Author: John Rigby, <jrigby@freescale.com>, Friday Apr 13 2007
+ *
+ * Description:
+ * MPC5121 Prototypes and definitions
+ *
+ * This 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.
+ *
+ */
+
+#ifndef __ASM_POWERPC_MPC512x_H__
+#define __ASM_POWERPC_MPC512x_H__
+
+extern unsigned long mpc512x_find_ips_freq(struct device_node *node);
+
+#endif /* __ASM_POWERPC_MPC512x_H__ */
+
-- 
1.5.3.8

^ permalink raw reply related

* [Add mpc5121 support PATCH v4 4/4] Add MPC512x support to MPC52xx psc driver
From: John Rigby @ 2008-01-28 17:28 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: John Rigby
In-Reply-To: <1201541336-28676-4-git-send-email-jrigby@freescale.com>

Add 512x support using the psc_ops framework established
with the previous patch.

All 512x PSCs share the same interrupt so add
IRQF_SHARED to irq flags.

Signed-off-by: John Rigby <jrigby@freescale.com>
---
 drivers/serial/Kconfig            |   12 ++--
 drivers/serial/mpc52xx_uart.c     |  177 +++++++++++++++++++++++++++++++++++--
 include/asm-powerpc/mpc52xx_psc.h |   48 ++++++++++
 3 files changed, 222 insertions(+), 15 deletions(-)

diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index d962b74..d9d7673 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -1114,17 +1114,17 @@ config SERIAL_SGI_L1_CONSOLE
 		say Y.  Otherwise, say N.
 
 config SERIAL_MPC52xx
-	tristate "Freescale MPC52xx family PSC serial support"
-	depends on PPC_MPC52xx
+	tristate "Freescale MPC52xx/MPC512x family PSC serial support"
+	depends on PPC_MPC52xx || PPC_MPC512x
 	select SERIAL_CORE
 	help
-	  This drivers support the MPC52xx PSC serial ports. If you would
-	  like to use them, you must answer Y or M to this option. Not that
+	  This driver supports MPC52xx and MPC512x PSC serial ports. If you would
+	  like to use them, you must answer Y or M to this option. Note that
 	  for use as console, it must be included in kernel and not as a
 	  module.
 
 config SERIAL_MPC52xx_CONSOLE
-	bool "Console on a Freescale MPC52xx family PSC serial port"
+	bool "Console on a Freescale MPC52xx/MPC512x family PSC serial port"
 	depends on SERIAL_MPC52xx=y
 	select SERIAL_CORE_CONSOLE
 	help
@@ -1132,7 +1132,7 @@ config SERIAL_MPC52xx_CONSOLE
 	  of the Freescale MPC52xx family as a console.
 
 config SERIAL_MPC52xx_CONSOLE_BAUD
-	int "Freescale MPC52xx family PSC serial port baud"
+	int "Freescale MPC52xx/MPC512x family PSC serial port baud"
 	depends on SERIAL_MPC52xx_CONSOLE=y
 	default "9600"
 	help
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 5bd1171..75654f8 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -16,6 +16,9 @@
  * Some of the code has been inspired/copied from the 2.4 code written
  * by Dale Farnsworth <dfarnsworth@mvista.com>.
  *
+ * Copyright (C) 2008 Freescale Semiconductor Inc.
+ *                    John Rigby <jrigby@gmail.com>
+ * Added support for MPC5121
  * Copyright (C) 2006 Secret Lab Technologies Ltd.
  *                    Grant Likely <grant.likely@secretlab.ca>
  * Copyright (C) 2004-2006 Sylvain Munaut <tnt@246tNt.com>
@@ -78,6 +81,7 @@
 #endif
 
 #include <asm/mpc52xx.h>
+#include <asm/mpc512x.h>
 #include <asm/mpc52xx_psc.h>
 
 #if defined(CONFIG_SERIAL_MPC52xx_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
@@ -127,12 +131,6 @@ static irqreturn_t mpc52xx_uart_int(int irq, void *dev_id);
 #define uart_console(port)	(0)
 #endif
 
-#if defined(CONFIG_PPC_MERGE)
-static struct of_device_id mpc52xx_uart_of_match[] = {
-	{ .type = "serial", .compatible = "mpc5200-psc-uart", },
-	{},
-};
-#endif
 
 /* ======================================================================== */
 /* PSC fifo operations for isolating differences between 52xx and 512x      */
@@ -157,6 +155,7 @@ struct psc_ops {
 	unsigned long	(*getuartclk)(void *p);
 };
 
+#ifdef CONFIG_PPC_MPC52xx
 #define FIFO_52xx(port) ((struct mpc52xx_psc_fifo __iomem *)(PSC(port)+1))
 static void mpc52xx_psc_fifo_init(struct uart_port *port)
 {
@@ -289,7 +288,161 @@ static struct psc_ops mpc52xx_psc_ops = {
 	.getuartclk = mpc52xx_getuartclk,
 };
 
-static struct psc_ops *psc_ops = &mpc52xx_psc_ops;
+#endif /* CONFIG_MPC52xx */
+
+#ifdef CONFIG_PPC_MPC512x
+#define FIFO_512x(port) ((struct mpc512x_psc_fifo __iomem *)(PSC(port)+1))
+static void mpc512x_psc_fifo_init(struct uart_port *port)
+{
+	out_be32(&FIFO_512x(port)->txcmd, MPC512x_PSC_FIFO_RESET_SLICE);
+	out_be32(&FIFO_512x(port)->txcmd, MPC512x_PSC_FIFO_ENABLE_SLICE);
+	out_be32(&FIFO_512x(port)->txalarm, 1);
+	out_be32(&FIFO_512x(port)->tximr, 0);
+
+	out_be32(&FIFO_512x(port)->rxcmd, MPC512x_PSC_FIFO_RESET_SLICE);
+	out_be32(&FIFO_512x(port)->rxcmd, MPC512x_PSC_FIFO_ENABLE_SLICE);
+	out_be32(&FIFO_512x(port)->rxalarm, 1);
+	out_be32(&FIFO_512x(port)->rximr, 0);
+
+	out_be32(&FIFO_512x(port)->tximr, MPC512x_PSC_FIFO_ALARM);
+	out_be32(&FIFO_512x(port)->rximr, MPC512x_PSC_FIFO_ALARM);
+}
+
+static int mpc512x_psc_raw_rx_rdy(struct uart_port *port)
+{
+	return !(in_be32(&FIFO_512x(port)->rxsr) & MPC512x_PSC_FIFO_EMPTY);
+}
+
+static int mpc512x_psc_raw_tx_rdy(struct uart_port *port)
+{
+	return !(in_be32(&FIFO_512x(port)->txsr) & MPC512x_PSC_FIFO_FULL);
+}
+
+static int mpc512x_psc_rx_rdy(struct uart_port *port)
+{
+	return in_be32(&FIFO_512x(port)->rxsr)
+	    & in_be32(&FIFO_512x(port)->rximr)
+	    & MPC512x_PSC_FIFO_ALARM;
+}
+
+static int mpc512x_psc_tx_rdy(struct uart_port *port)
+{
+	return in_be32(&FIFO_512x(port)->txsr)
+	    & in_be32(&FIFO_512x(port)->tximr)
+	    & MPC512x_PSC_FIFO_ALARM;
+}
+
+static int mpc512x_psc_tx_empty(struct uart_port *port)
+{
+	return in_be32(&FIFO_512x(port)->txsr)
+	    & MPC512x_PSC_FIFO_EMPTY;
+}
+
+static void mpc512x_psc_stop_rx(struct uart_port *port)
+{
+	unsigned long rx_fifo_imr;
+
+	rx_fifo_imr = in_be32(&FIFO_512x(port)->rximr);
+	rx_fifo_imr &= ~MPC512x_PSC_FIFO_ALARM;
+	out_be32(&FIFO_512x(port)->rximr, rx_fifo_imr);
+}
+
+static void mpc512x_psc_start_tx(struct uart_port *port)
+{
+	unsigned long tx_fifo_imr;
+
+	tx_fifo_imr = in_be32(&FIFO_512x(port)->tximr);
+	tx_fifo_imr |= MPC512x_PSC_FIFO_ALARM;
+	out_be32(&FIFO_512x(port)->tximr, tx_fifo_imr);
+}
+
+static void mpc512x_psc_stop_tx(struct uart_port *port)
+{
+	unsigned long tx_fifo_imr;
+
+	tx_fifo_imr = in_be32(&FIFO_512x(port)->tximr);
+	tx_fifo_imr &= ~MPC512x_PSC_FIFO_ALARM;
+	out_be32(&FIFO_512x(port)->tximr, tx_fifo_imr);
+}
+
+static void mpc512x_psc_rx_clr_irq(struct uart_port *port)
+{
+	out_be32(&FIFO_512x(port)->rxisr, in_be32(&FIFO_512x(port)->rxisr));
+}
+
+static void mpc512x_psc_tx_clr_irq(struct uart_port *port)
+{
+	out_be32(&FIFO_512x(port)->txisr, in_be32(&FIFO_512x(port)->txisr));
+}
+
+static void mpc512x_psc_write_char(struct uart_port *port, unsigned char c)
+{
+	out_8(&FIFO_512x(port)->txdata_8, c);
+}
+
+static unsigned char mpc512x_psc_read_char(struct uart_port *port)
+{
+	return in_8(&FIFO_512x(port)->rxdata_8);
+}
+
+static void mpc512x_psc_cw_disable_ints(struct uart_port *port)
+{
+	port->read_status_mask =
+		in_be32(&FIFO_512x(port)->tximr) << 16 |
+		in_be32(&FIFO_512x(port)->rximr);
+	out_be32(&FIFO_512x(port)->tximr, 0);
+	out_be32(&FIFO_512x(port)->rximr, 0);
+}
+
+static void mpc512x_psc_cw_restore_ints(struct uart_port *port)
+{
+	out_be32(&FIFO_512x(port)->tximr,
+		(port->read_status_mask >> 16) & 0x7f);
+	out_be32(&FIFO_512x(port)->rximr, port->read_status_mask & 0x7f);
+}
+
+static unsigned long mpc512x_getuartclk(void *p)
+{
+	return mpc512x_find_ips_freq(p);
+}
+
+static struct psc_ops mpc512x_psc_ops = {
+	.fifo_init = mpc512x_psc_fifo_init,
+	.raw_rx_rdy = mpc512x_psc_raw_rx_rdy,
+	.raw_tx_rdy = mpc512x_psc_raw_tx_rdy,
+	.rx_rdy = mpc512x_psc_rx_rdy,
+	.tx_rdy = mpc512x_psc_tx_rdy,
+	.tx_empty = mpc512x_psc_tx_empty,
+	.stop_rx = mpc512x_psc_stop_rx,
+	.start_tx = mpc512x_psc_start_tx,
+	.stop_tx = mpc512x_psc_stop_tx,
+	.rx_clr_irq = mpc512x_psc_rx_clr_irq,
+	.tx_clr_irq = mpc512x_psc_tx_clr_irq,
+	.write_char = mpc512x_psc_write_char,
+	.read_char = mpc512x_psc_read_char,
+	.cw_disable_ints = mpc512x_psc_cw_disable_ints,
+	.cw_restore_ints = mpc512x_psc_cw_restore_ints,
+	.getuartclk = mpc512x_getuartclk,
+};
+#endif
+
+static struct psc_ops *psc_ops;
+
+#if defined(CONFIG_PPC_MERGE)
+static const struct of_device_id mpc52xx_uart_of_match[] = {
+#ifdef CONFIG_PPC_MPC52xx
+	{.type = "serial",
+	 .compatible = "mpc5200-psc-uart",
+	 .data = &mpc52xx_psc_ops},
+#endif
+#ifdef CONFIG_PPC_MPC512x
+	{.type = "serial",
+	 .compatible = "fsl,mpc5121-psc-uart",
+	 .data = &mpc512x_psc_ops},
+#endif
+	{},
+};
+#endif
 
 /* ======================================================================== */
 /* UART operations                                                          */
@@ -379,7 +532,8 @@ mpc52xx_uart_startup(struct uart_port *port)
 
 	/* Request IRQ */
 	ret = request_irq(port->irq, mpc52xx_uart_int,
-		IRQF_DISABLED | IRQF_SAMPLE_RANDOM, "mpc52xx_psc_uart", port);
+		IRQF_DISABLED | IRQF_SAMPLE_RANDOM | IRQF_SHARED,
+		"mpc52xx_psc_uart", port);
 	if (ret)
 		return ret;
 
@@ -1206,15 +1360,19 @@ mpc52xx_uart_of_enumerate(void)
 	static int enum_done;
 	struct device_node *np;
 	const unsigned int *devno;
+	const struct  of_device_id *match;
 	int i;
 
 	if (enum_done)
 		return;
 
 	for_each_node_by_type(np, "serial") {
-		if (!of_match_node(mpc52xx_uart_of_match, np))
+		match = of_match_node(mpc52xx_uart_of_match, np);
+		if (!match)
 			continue;
 
+		psc_ops = match->data;
+
 		/* Is a particular device number requested? */
 		devno = of_get_property(np, "port-number", NULL);
 		mpc52xx_uart_of_assign(np, devno ? *devno : -1);
@@ -1275,6 +1433,7 @@ mpc52xx_uart_init(void)
 		return ret;
 	}
 #else
+	psc_ops = &mpc52xx_psc_ops;
 	ret = platform_driver_register(&mpc52xx_uart_platform_driver);
 	if (ret) {
 		printk(KERN_ERR "%s: platform_driver_register failed (%i)\n",
diff --git a/include/asm-powerpc/mpc52xx_psc.h b/include/asm-powerpc/mpc52xx_psc.h
index bea42b9..710c5d3 100644
--- a/include/asm-powerpc/mpc52xx_psc.h
+++ b/include/asm-powerpc/mpc52xx_psc.h
@@ -190,5 +190,53 @@ struct mpc52xx_psc_fifo {
 	u16		tflwfptr;	/* PSC + 0x9e */
 };
 
+#define MPC512x_PSC_FIFO_RESET_SLICE	0x80
+#define MPC512x_PSC_FIFO_ENABLE_SLICE	0x01
+#define MPC512x_PSC_FIFO_ENABLE_DMA	0x04
+
+#define MPC512x_PSC_FIFO_EMPTY		0x1
+#define MPC512x_PSC_FIFO_FULL		0x2
+#define MPC512x_PSC_FIFO_ALARM		0x4
+#define MPC512x_PSC_FIFO_URERR		0x8
+#define MPC512x_PSC_FIFO_ORERR		0x01
+#define MPC512x_PSC_FIFO_MEMERROR	0x02
+
+struct mpc512x_psc_fifo {
+	u32		reserved1[10];
+	u32		txcmd;		/* PSC + 0x80 */
+	u32		txalarm;	/* PSC + 0x84 */
+	u32		txsr;		/* PSC + 0x88 */
+	u32		txisr;		/* PSC + 0x8c */
+	u32		tximr;		/* PSC + 0x90 */
+	u32		txcnt;		/* PSC + 0x94 */
+	u32		txptr;		/* PSC + 0x98 */
+	u32		txsz;		/* PSC + 0x9c */
+	u32		reserved2[7];
+	union {
+		u8	txdata_8;
+		u16	txdata_16;
+		u32	txdata_32;
+	} txdata; 			/* PSC + 0xbc */
+#define txdata_8 txdata.txdata_8
+#define txdata_16 txdata.txdata_16
+#define txdata_32 txdata.txdata_32
+	u32		rxcmd;		/* PSC + 0xc0 */
+	u32		rxalarm;	/* PSC + 0xc4 */
+	u32		rxsr;		/* PSC + 0xc8 */
+	u32		rxisr;		/* PSC + 0xcc */
+	u32		rximr;		/* PSC + 0xd0 */
+	u32		rxcnt;		/* PSC + 0xd4 */
+	u32		rxptr;		/* PSC + 0xd8 */
+	u32		rxsz;		/* PSC + 0xdc */
+	u32		reserved3[7];
+	union {
+		u8	rxdata_8;
+		u16	rxdata_16;
+		u32	rxdata_32;
+	} rxdata; 			/* PSC + 0xfc */
+#define rxdata_8 rxdata.rxdata_8
+#define rxdata_16 rxdata.rxdata_16
+#define rxdata_32 rxdata.rxdata_32
+};
 
 #endif  /* __ASM_MPC52xx_PSC_H__ */
-- 
1.5.3.8

^ permalink raw reply related

* [Add mpc5121 support PATCH v4 2/4] Device tree for MPC5121 ADS
From: John Rigby @ 2008-01-28 17:28 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: John Rigby
In-Reply-To: <1201541336-28676-2-git-send-email-jrigby@freescale.com>

Minimal /dts-v1/ device tree for mpc5121 ads.

port-number property in uart nodes
will go away after the driver learns to use aliases

Signed-off-by: John Rigby <jrigby@freescale.com>
---
 arch/powerpc/boot/dts/mpc5121ads.dts |  122 ++++++++++++++++++++++++++++++++++
 1 files changed, 122 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/mpc5121ads.dts

diff --git a/arch/powerpc/boot/dts/mpc5121ads.dts b/arch/powerpc/boot/dts/mpc5121ads.dts
new file mode 100644
index 0000000..94ad7b2
--- /dev/null
+++ b/arch/powerpc/boot/dts/mpc5121ads.dts
@@ -0,0 +1,122 @@
+/*
+ * MPC5121E MDS Device Tree Source
+ *
+ * Copyright 2007 Freescale Semiconductor Inc.
+ *
+ * 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.
+ */
+
+/dts-v1/;
+
+/ {
+	model = "mpc5121ads";
+	compatible = "fsl,mpc5121ads";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		PowerPC,5121@0 {
+			device_type = "cpu";
+			reg = <0>;
+			d-cache-line-size = <0x20>;	// 32 bytes
+			i-cache-line-size = <0x20>;	// 32 bytes
+			d-cache-size = <0x8000>;	// L1, 32K
+			i-cache-size = <0x8000>;	// L1, 32K
+			timebase-frequency = <49500000>;// 49.5 MHz (csb/4)
+			bus-frequency = <198000000>;	// 198 MHz csb bus
+			clock-frequency = <396000000>;	// 396 MHz ppc core
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x10000000>;	// 256MB at 0
+	};
+
+	localbus@80000020 {
+		compatible = "fsl,mpc5121ads-localbus";
+		#address-cells = <2>;
+		#size-cells = <1>;
+		reg = <0x80000020 0x40>;
+
+		ranges = <0x0 0x0 0xfc000000 0x04000000
+			  0x2 0x0 0x82000000 0x00008000>;
+
+		flash@0,0 {
+			compatible = "cfi-flash";
+			reg = <0 0x0 0x4000000>;
+			bank-width = <4>;
+			device-width = <1>;
+		};
+
+		board-control@2,0 {
+			compatible = "fsl,mpc5121ads-cpld";
+			reg = <0x2 0x0 0x8000>;
+		};
+	};
+
+	soc@80000000 {
+		compatible = "fsl,mpc5121-immr";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		#interrupt-cells = <2>;
+		ranges = <0x0 0x80000000 0x400000>;
+		reg = <0x80000000 0x400000>;
+		bus-frequency = <66000000>;	// 66 MHz ips bus
+
+
+		// IPIC
+		// interrupts cell = <intr #, sense>
+		// sense values match linux IORESOURCE_IRQ_* defines:
+		// sense == 8: Level, low assertion
+		// sense == 2: Edge, high-to-low change
+		//
+		ipic: interrupt-controller@c00 {
+			compatible = "fsl,mpc5121-ipic", "fsl,ipic";
+			interrupt-controller;
+			#address-cells = <0>;
+			#interrupt-cells = <2>;
+			reg = <0xc00 0x100>;
+		};
+
+		// 512x PSCs are not 52xx PSCs compatible
+		// PSC3 serial port A aka ttyPSC0
+		serial@11300 {
+			device_type = "serial";
+			compatible = "fsl,mpc5121-psc-uart";
+			// Logical port assignment needed until driver
+			// learns to use aliases
+			port-number = <0>;
+			cell-index = <3>;
+			reg = <0x11300 0x100>;
+			interrupts = <0x28 0x8>; // actually the fifo irq
+			interrupt-parent = < &ipic >;
+		};
+
+		// PSC4 serial port B aka ttyPSC1
+		serial@11400 {
+			device_type = "serial";
+			compatible = "fsl,mpc5121-psc-uart";
+			// Logical port assignment needed until driver
+			// learns to use aliases
+			port-number = <1>;
+			cell-index = <4>;
+			reg = <0x11400 0x100>;
+			interrupts = <0x28 0x8>; // actually the fifo irq
+			interrupt-parent = < &ipic >;
+		};
+
+		pscsfifo@11f00 {
+			compatible = "fsl,mpc5121-psc-fifo";
+			reg = <0x11f00 0x100>;
+			interrupts = <0x28 0x8>;
+			interrupt-parent = < &ipic >;
+		};
+	};
+};
-- 
1.5.3.8

^ permalink raw reply related

* [Add mpc5121 support PATCH v4 0/4] Basic Freescale MPC512x support
From: John Rigby @ 2008-01-28 17:28 UTC (permalink / raw)
  To: linuxppc-dev

New patches set hopefully for 2.6.25
Changes since v3
First four patches have already gone in via Grant and Kumar

1/4 Basic-Freescale-MPC512x-support.patch
    Previously Acked-by: Grant Likely <grant.likely@secretlab.ca>

2/4 Device-tree-for-MPC5121-ADS.patch
    Updated to /dts-v1/

3/4 Factor out 5200 dependencies from 52xx psc driver
    Fixed problem on no output in userland

4/4 Add MPC512x support to MPC52xx psc driver
    No changes since v3

^ permalink raw reply

* Preferred GIT URL for arch/powerpc Latest-and-Greatest (was Re: Reminder: removal of arch/ppc - (Sequoia))
From: Grant Erickson @ 2008-01-28 17:01 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-embedded
In-Reply-To: <20080127200044.148982a6@zod.rchland.ibm.com>

On 1/27/08 6:00 PM, Josh Boyer wrote:
> On Sun, 27 Jan 2008 18:37:22 -0500
> Steve Heflin <sheflin@newagemicro.com> wrote:
> 
>> Hello!
>> 
>> Yes! I'm looking at 2.6.23.14 as I thought that was the newest
>> version. I completely missed seeing the 2.6.24 kit, thank you so much!!
> 
> FYI, 2.6.24 is considered fairly old relatively speaking.  With so much
> activity going on for the embedded boards for arch/powerpc, you're sort
> of missing out if you aren't running from the latest git trees.
> 
> Yes, I realize how ridiculous it sounds to say a kernel that was just
> released 3 days ago is old, but that's reality.
> 
> josh

What's the best/preferred GIT URL for current, up-to-date arch/powerpc
activity? Is it?

    git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc

I am particularly interested in Kilauea/Haleakala-related development.

Regards,

Grant Erickson

^ permalink raw reply

* Re: [PATCHv3 2.6.25] i2c: adds support for i2c bus on Freescale CPM1/CPM2 controllers
From: Bryan Wu @ 2008-01-28 17:21 UTC (permalink / raw)
  To: Jochen Friedrich
  Cc: linuxppc-dev list, Kernel, Linux, Jean Delvare, Linux I2C,
	Scott Wood
In-Reply-To: <479A185D.6010406@scram.de>

On Jan 26, 2008 1:11 AM, Jochen Friedrich <jochen@scram.de> wrote:
> Using the port of 2.4 code from Vitaly Bordug <vitb@kernel.crashing.org>
> and the actual algorithm used by the i2c driver of the DBox code on
> cvs.tuxboc.org from Tmbinc, Gillem (htoa@gmx.net). Renamed i2c-rpx.c and
> i2c-algo-8xx.c to i2c-cpm.c and converted the driver to an
> of_platform_driver.
>
> Signed-off-by: Jochen Friedrich <jochen@scram.de>
> ---
>  arch/powerpc/boot/dts/mpc8272ads.dts         |   10 +
>  arch/powerpc/boot/dts/mpc866ads.dts          |   10 +
>  arch/powerpc/boot/dts/mpc885ads.dts          |   10 +
>  arch/powerpc/platforms/8xx/mpc885ads_setup.c |    5 +
>  drivers/i2c/busses/Kconfig                   |   10 +
>  drivers/i2c/busses/Makefile                  |    1 +
>  drivers/i2c/busses/i2c-cpm.c                 |  759 ++++++++++++++++++++++++++
>  7 files changed, 805 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/i2c/busses/i2c-cpm.c
>
> diff --git a/arch/powerpc/boot/dts/mpc8272ads.dts b/arch/powerpc/boot/dts/mpc8272ads.dts
> index 7285ca1..7273996 100644
> --- a/arch/powerpc/boot/dts/mpc8272ads.dts
> +++ b/arch/powerpc/boot/dts/mpc8272ads.dts
> @@ -215,6 +215,16 @@
>                                 linux,network-index = <1>;
>                                 fsl,cpm-command = <16200300>;
>                         };
> +
> +                       i2c@11860 {
> +                               compatible = "fsl,mpc8248-i2c",
> +                                            "fsl,cpm2-i2c",
> +                                            "fsl,cpm-i2c";
> +                               reg = <11860 20 8afc 2>;
> +                               interrupts = <1 8>;
> +                               interrupt-parent = <&PIC>;
> +                               fsl,cpm-command = <29600000>;
> +                       };
>                 };
>
>                 PIC: interrupt-controller@10c00 {
> diff --git a/arch/powerpc/boot/dts/mpc866ads.dts b/arch/powerpc/boot/dts/mpc866ads.dts
> index daf9433..80c08bf 100644
> --- a/arch/powerpc/boot/dts/mpc866ads.dts
> +++ b/arch/powerpc/boot/dts/mpc866ads.dts
> @@ -169,6 +169,16 @@
>                                 fsl,cpm-command = <0000>;
>                                 linux,network-index = <1>;
>                         };
> +
> +                       i2c@860 {
> +                               compatible = "fsl,mpc866-i2c",
> +                                            "fsl,cpm1-i2c",
> +                                            "fsl,cpm-i2c";
> +                               reg = <860 20 3c80 30>;
> +                               interrupts = <10 3>;
> +                               interrupt-parent = <&Cpm_pic>;
> +                               fsl,cpm-command = <0010>;
> +                       };
>                 };
>         };
>
> diff --git a/arch/powerpc/boot/dts/mpc885ads.dts b/arch/powerpc/boot/dts/mpc885ads.dts
> index 8848e63..fd9c9d7 100644
> --- a/arch/powerpc/boot/dts/mpc885ads.dts
> +++ b/arch/powerpc/boot/dts/mpc885ads.dts
> @@ -213,6 +213,16 @@
>                                 fsl,cpm-command = <0080>;
>                                 linux,network-index = <2>;
>                         };
> +
> +                       i2c@860 {
> +                               compatible = "fsl,mpc885-i2c",
> +                                            "fsl,cpm1-i2c",
> +                                            "fsl,cpm-i2c";
> +                               reg = <860 20 3c80 30>;
> +                               interrupts = <10>;
> +                               interrupt-parent = <&CPM_PIC>;
> +                               fsl,cpm-command = <0010>;
> +                       };
>                 };
>         };
>
> diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
> index f39447b..1e7d056 100644
> --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
> +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
> @@ -157,6 +157,11 @@ static struct cpm_pin mpc885ads_pins[] = {
>         {CPM_PORTE, 28, CPM_PIN_OUTPUT},
>         {CPM_PORTE, 29, CPM_PIN_OUTPUT},
>  #endif
> +       /* I2C */
> +#ifdef CONFIG_I2C_8XX
> +       {CPM_PORTB, 26, CPM_PIN_INPUT | CPM_PIN_OPENDRAIN},
> +       {CPM_PORTB, 27, CPM_PIN_INPUT | CPM_PIN_OPENDRAIN},
> +#endif
>  };
>
>  static void __init init_ioports(void)
> diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
> index c466c6c..5950172 100644
> --- a/drivers/i2c/busses/Kconfig
> +++ b/drivers/i2c/busses/Kconfig
> @@ -114,6 +114,16 @@ config I2C_BLACKFIN_TWI_CLK_KHZ
>         help
>           The unit of the TWI clock is kHz.
>
> +config I2C_CPM
> +       tristate "Freescale CPM1 or CPM2 (MPC8xx/826x)"
> +       depends on (CPM1 || CPM2) && I2C && PPC_OF
> +       help
> +         This supports the use of the I2C interface on Freescale
> +         processors with CPM1 or CPM2.
> +
> +         This driver can also be built as a module.  If so, the module
> +         will be called i2c-cpm.
> +
>  config I2C_DAVINCI
>         tristate "DaVinci I2C driver"
>         depends on ARCH_DAVINCI
> diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
> index 81d43c2..a395555 100644
> --- a/drivers/i2c/busses/Makefile
> +++ b/drivers/i2c/busses/Makefile
> @@ -11,6 +11,7 @@ obj-$(CONFIG_I2C_AMD8111)     += i2c-amd8111.o
>  obj-$(CONFIG_I2C_AT91)         += i2c-at91.o
>  obj-$(CONFIG_I2C_AU1550)       += i2c-au1550.o
>  obj-$(CONFIG_I2C_BLACKFIN_TWI) += i2c-bfin-twi.o
> +obj-$(CONFIG_I2C_CPM)          += i2c-cpm.o
>  obj-$(CONFIG_I2C_DAVINCI)      += i2c-davinci.o
>  obj-$(CONFIG_I2C_ELEKTOR)      += i2c-elektor.o
>  obj-$(CONFIG_I2C_GPIO)         += i2c-gpio.o
> diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
> new file mode 100644
> index 0000000..7191427
> --- /dev/null
> +++ b/drivers/i2c/busses/i2c-cpm.c
> @@ -0,0 +1,759 @@
> +/*
> + * Freescale CPM1/CPM2 I2C interface.
> + * Copyright (c) 1999 Dan Malek (dmalek@jlc.net).
> + *

[!snip!]

> +
> +       /* register new adapter to i2c module... */
> +
> +       result = i2c_add_adapter(&cpm->adap);

As I was pointed before, please use the new style i2c driver interface:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=991dee591a99d035796a8c194eb1796cc020e142

-Bryan Wu

[!snip!]

^ permalink raw reply

* Re: request_irq() for external interrupt pin on MPC875 (A&M adder MPC  875)
From: Scott Wood @ 2008-01-28 17:20 UTC (permalink / raw)
  To: Rognlien Dag Kristian; +Cc: linuxppc-dev
In-Reply-To: <39417DF3286A66428FA558987839F44F03FC914F@SINTEFXCH01.sintef.no>

Rognlien Dag Kristian wrote:
> With kernel 2.6.13 we used
>  
> request_irq (use_irq, irq_handler, SA_INTERRUPT|SA_SHIRQ, DEVICE_NAME, dev)
>  
> where use_irq is 12 to use the external IRQ6 pin.
>  
> We are now trying to get this driver to work with the 2.6.25 pull from 
> powerpc.git.
>  
> request_irq (use_irq, irq_handler, IRQF_SHARED, DEVICE_NAME, dev);
>  
> returns -ENOSYS on the newer kernel.
>  
> Have the IRQ mappings for the external IRQX pins been moved in the later 
> kernels?

Yes, you need to use the result of irq_create_mapping() or 
irq_of_parse_and_map().

-Scott

^ permalink raw reply

* Re: [PATCH 3/3] Add device tree compatible aliases to i2c drivers
From: Jon Loeliger @ 2008-01-28 17:10 UTC (permalink / raw)
  To: Jon Smirl; +Cc: linuxppc-dev@ozlabs.org, i2c
In-Reply-To: <20080128144209.8410.37884.stgit@terra.home>

On Mon, 2008-01-28 at 08:42, Jon Smirl wrote:
> PowerPC device trees use a different naming convention than the Linux kernel.  Provide alias names for i2c drivers in order to allow them to be loaded by device tree name. The OF_ID macro ensures that the aliases are only present in powerpc builds and separated into their own namespace.
> 
> Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
> ---

Hi Jon,

Any chance we can have hard 70-ish column limited
log messages, please?

Thanks,
jdl

^ permalink raw reply

* [PATCH] [POWERPC] 85xx: rework platform Kconfig
From: Kumar Gala @ 2008-01-28 16:25 UTC (permalink / raw)
  To: linuxppc-dev

* Allow multiple boards to be selected in a single build
* Removed Kconfig option '85xx' which existed only for compat with arch/ppc
* Added a multiplatform 85xx defconfig (mpc85xx_defconfig). This builds
  all 85xx boards except sbc8560 and stx_gp3 since these to boards have
  board specific ifdef in driver code that may break all other boards

---

* removed defconfig from patch.

 arch/powerpc/configs/mpc85xx_defconfig | 1521 ++++++++++++++++++++++++++++++++
 arch/powerpc/platforms/85xx/Kconfig    |   32 +-
 arch/powerpc/platforms/Kconfig.cputype |    6 +-
 3 files changed, 1533 insertions(+), 26 deletions(-)
 create mode 100644 arch/powerpc/configs/mpc85xx_defconfig

diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index 74779b9..7e76ddb 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -1,7 +1,14 @@
-choice
-	prompt "Machine Type"
+menuconfig MPC85xx
+	bool "Machine Type"
 	depends on PPC_85xx
-	default MPC8540_ADS
+	select PPC_UDBG_16550
+	select PPC_INDIRECT_PCI if PCI
+	select MPIC
+	select FSL_PCI if PCI
+	select SERIAL_8250_SHARE_IRQ if SERIAL_8250
+	default y
+
+if MPC85xx

 config MPC8540_ADS
 	bool "Freescale MPC8540 ADS"
@@ -96,24 +103,7 @@ config SBC8560
 	help
 	  This option enables support for the Wind River SBC8560 board

-endchoice
+endif # MPC85xx

 config TQM85xx
 	bool
-	select MPC85xx
-
-config MPC8540
-	bool
-	select PPC_UDBG_16550
-	select PPC_INDIRECT_PCI
-	default y if MPC8540_ADS || MPC85xx_CDS || SBC8548
-
-config MPC85xx
-	bool
-	select PPC_UDBG_16550
-	select PPC_INDIRECT_PCI if PCI
-	select MPIC
-	select FSL_PCI if PCI
-	select SERIAL_8250_SHARE_IRQ if SERIAL_8250
-	default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS \
-		|| MPC85xx_MDS || MPC85xx_DS || STX_GP3 || SBC8560 || SBC8548
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index c3ee0b5..f6bf025 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -29,8 +29,8 @@ config PPC_85xx
 	bool "Freescale 85xx"
 	select E500
 	select FSL_SOC
-	select 85xx
 	select WANT_DEVICE_TREE
+	select MPC85xx

 config PPC_8xx
 	bool "Freescale 8xx"
@@ -97,10 +97,6 @@ config 8xx
 config 83xx
 	bool

-# this is temp to handle compat with arch=ppc
-config 85xx
-	bool
-
 config E500
 	bool

-- 
1.5.3.7

^ permalink raw reply related

* Re: [Cbe-oss-dev] [PATCH 3/3] Cell IOMMU static mapping support
From: Olof Johansson @ 2008-01-28 16:23 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linuxppc-dev, cbe-oss-dev
In-Reply-To: <200801281241.49059.arnd@arndb.de>

On Mon, Jan 28, 2008 at 12:41:48PM +0100, Arnd Bergmann wrote:
> On Saturday 26 January 2008, Olof Johansson wrote:
> > > 
> > > So instead of having an IOMMU window that we use to temporarily map things
> > > in and out of DMA'able space, at boot we create a 1:1 mapping for all of
> > > memory. This obviously only works for devices that can do 64-bit DMA.
> > 
> > I don't get it. Why not disable the iommu instead?
> > 
> 
> When you disable the iommu, the 32-bit devices stop working because
> they can no longer access all of main memory.
> 
> The 1:1 mapping is in addition to the DMA window used for those devices,
> not in place of it.

Ok, makes sense.

I was going to protest the hack for >32GB configs, with the motivation
that just using the htab-backed window is way too small for such a
config. However, with 32GB memory and 4K pages, that window is 512MB, so
we should be fine.

Having that described in the patch (or at least in the patch description)
to make it more clear could be good. That, and the fact that the mapping
is offset on <32GB memory machines, and thus not really a 1:1 mapping.

Does the cell I/O bridge reflect out accesses to 2-4GB on the bus
again? If not, that could be another place to stick the dynamic range
for large config machines.


-Olof

^ permalink raw reply

* Re: [PATCH 0/9] 83xx DTS fixes and v1 conversions
From: Kumar Gala @ 2008-01-28 16:09 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linuxppc-dev
In-Reply-To: <479DFA0A.1060706@windriver.com>


On Jan 28, 2008, at 9:51 AM, Paul Gortmaker wrote:

> Kumar Gala wrote:
>> On Mon, 28 Jan 2008, Paul Gortmaker wrote:
>>
>>
>>> This series incorporates my earlier qe/muram fix before converting
>>> the existing mpc83xx DTS files to v1 format.  I've also redone the
>>> mpc834x_mds with the IRQs as decimal as per Kumar's comments and
>>> re-included that too.  I've kept each board as a separate commit
>>> in case one of them conflicts with what someone else is working on.
>>>
>>> Boards covered are: 8349mds, 8349mitx, 8349mitx-gp, 836x_mds,
>>> 8323_mds, 8323_rdb, and the 8313_rdb.  Plus a small tweak to the
>>> sbc8349 (it was already v1 -- but IRQs were in hex.)
>>>
>>> I've fed all the files to DTC before and after to ensure the
>>> output is the same after the conversion.
>>>
>>> I'm not aware of any explicit rules for what is hex vs decimal.
>>> I've tried to keep things that are usually discussed in decimal
>>> as decimal quantities (i.e. cache size, IRQ, counts, indicies)
>>> and all other data that you'd normally expect in hex (addresses,
>>> IRQ flags, masks) as hex -- including prefixing 0x on values from
>>> zero to 10 where it tends to make rows of numbers (e.g. ranges)
>>> align for better readability, even though it isn't required.
>>>
>>>
>>
>> Can you regen these patches (2..9) againast my latest tree.  Also, a
>> single patch that cleans up all the boards is sufficient.
>>
>
> The patches should be current to your tree still as of today; they  
> are based on:
>
> f09f415ea23272ae68f9322f90246680d46f4868        not-for-merge
> branch 'for-2.6.25' of git://git.kernel.org/pub/scm/linux/kernel/git/ 
> galak/powerpc
>
> My patch #1 with all four qe/muram boards was posted earlier here:
>
> http://ozlabs.org/pipermail/linuxppc-dev/2008-January/050767.html
>
> Let me know what you need them based against and I can respin
> as required.

I've pushed out a bunch of stuff today.

commit 390167efa329d11099957108fc23d1ad15c3f37e

I'm expect a respin since the patches don't currently apply to my tree.

- k

^ permalink raw reply

* Re: [PATCH 2/3] Convert PowerPC MPC i2c to of_platform_driver from platform_driver
From: Olof Johansson @ 2008-01-28 16:12 UTC (permalink / raw)
  To: Jon Smirl; +Cc: linuxppc-dev, i2c
In-Reply-To: <20080128144206.8410.2505.stgit@terra.home>

Hi,

Nice to see this one, I've been waiting for it. :)

On Mon, Jan 28, 2008 at 09:42:07AM -0500, Jon Smirl wrote:

> diff --git a/drivers/i2c/busses/powerpc-common.c b/drivers/i2c/busses/powerpc-common.c
> new file mode 100644
> index 0000000..51b039f
> --- /dev/null
> +++ b/drivers/i2c/busses/powerpc-common.c

This is really broader than powerpc. devtree-common.c would be a more
suitable name.

> @@ -0,0 +1,81 @@
> +/*
> + * powerpc-common.c - routines common to device tree parsing for all
> + *                    powerpc based i2c hosts
> + *
> + * 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.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> + *
> + * (C) Copyright 2008 Jon Smirl <jonsmirl@gmail.com>
> + *
> + */
> +
> +#include <linux/interrupt.h>
> +#include <linux/i2c.h>
> +#include <linux/of_platform.h>
> +
> +#include "powerpc-common.h"
> +
> +#ifdef CONFIG_PPC_MERGE
> +
> +void of_register_i2c_devices(struct i2c_adapter *adap, struct device_node *adap_node)
> +{
> +	void *result;
> +	struct device_node *node = NULL;
> +
> +	while ((node = of_get_next_child(adap_node, node))) {
> +		struct i2c_board_info info;
> +		const u32 *addr;
> +		const char *compatible;
> +		int len;
> +
> +		compatible = of_get_property(node, "compatible", NULL);
> +		if (!compatible) {
> +			printk(KERN_ERR "i2c-mpc.c: missing compatible attribute\n");
> +			continue;
> +		}
> +
> +		addr = of_get_property(node, "reg", &len);
> +		if (!addr || len < sizeof(int) || *addr > (1 << 10) - 1) {
> +			printk(KERN_ERR "i2c-mpc.c: missing reg attribute for %s\n", compatible);

This is no longer i2c-mpc. Same for the other comments in this function.


-Olof

^ permalink raw reply

* Re: [PATCH 0/9] 83xx DTS fixes and v1 conversions
From: Grant Likely @ 2008-01-28 15:57 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linuxppc-dev
In-Reply-To: <1201505279-25847-1-git-send-email-paul.gortmaker@windriver.com>

On 1/28/08, Paul Gortmaker <paul.gortmaker@windriver.com> wrote:
>
> This series incorporates my earlier qe/muram fix before converting
> the existing mpc83xx DTS files to v1 format.  I've also redone the
> mpc834x_mds with the IRQs as decimal as per Kumar's comments and
> re-included that too.  I've kept each board as a separate commit
> in case one of them conflicts with what someone else is working on.
>
> Boards covered are: 8349mds, 8349mitx, 8349mitx-gp, 836x_mds,
> 8323_mds, 8323_rdb, and the 8313_rdb.  Plus a small tweak to the
> sbc8349 (it was already v1 -- but IRQs were in hex.)

Cool!  Want to do the 5200 dts files too?  :-)

/me is lazy

Cheers.
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: [PATCH 0/9] 83xx DTS fixes and v1 conversions
From: Paul Gortmaker @ 2008-01-28 15:51 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <Pine.LNX.4.64.0801280904310.19922@blarg.am.freescale.net>

Kumar Gala wrote:
> On Mon, 28 Jan 2008, Paul Gortmaker wrote:
>
>   
>> This series incorporates my earlier qe/muram fix before converting
>> the existing mpc83xx DTS files to v1 format.  I've also redone the
>> mpc834x_mds with the IRQs as decimal as per Kumar's comments and
>> re-included that too.  I've kept each board as a separate commit
>> in case one of them conflicts with what someone else is working on.
>>
>> Boards covered are: 8349mds, 8349mitx, 8349mitx-gp, 836x_mds,
>> 8323_mds, 8323_rdb, and the 8313_rdb.  Plus a small tweak to the
>> sbc8349 (it was already v1 -- but IRQs were in hex.)
>>
>> I've fed all the files to DTC before and after to ensure the
>> output is the same after the conversion.
>>
>> I'm not aware of any explicit rules for what is hex vs decimal.
>> I've tried to keep things that are usually discussed in decimal
>> as decimal quantities (i.e. cache size, IRQ, counts, indicies)
>> and all other data that you'd normally expect in hex (addresses,
>> IRQ flags, masks) as hex -- including prefixing 0x on values from
>> zero to 10 where it tends to make rows of numbers (e.g. ranges)
>> align for better readability, even though it isn't required.
>>
>>     
>
> Can you regen these patches (2..9) againast my latest tree.  Also, a
> single patch that cleans up all the boards is sufficient.
>   

The patches should be current to your tree still as of today; they are 
based on:

f09f415ea23272ae68f9322f90246680d46f4868        not-for-merge
branch 'for-2.6.25' of 
git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc

My patch #1 with all four qe/muram boards was posted earlier here:

http://ozlabs.org/pipermail/linuxppc-dev/2008-January/050767.html

Let me know what you need them based against and I can respin
as required.

P.



> - k
>   

^ permalink raw reply

* Re: Load Kernel 2.6 using U-boot on ML403
From: Robert Woodworth @ 2008-01-28 15:51 UTC (permalink / raw)
  To: Yedu Jathavedan; +Cc: linuxppc-embedded
In-Reply-To: <20080127202502.zte3h0yr4s44ooc8@webmail.cecs.pdx.edu>

If you're starting a new design, I *highly* recommend using EDK9.2 with
MPMC3 and LL_TEMAC.

Using the Wizard in EDK9.2 and using the kernel from git.xilinx.com
everything will work fine out-of-the-box.  Including the ethernet.

I've had troubles with the older (EDK9.1) TEMAC and GigE switches not
syncing correctly.   The LL_TEMAC in EDK9.2 solved this issue.



RJW.



On Sun, 2008-01-27 at 20:25 -0800, Yedu Jathavedan wrote:
> >
> > Looking at your bootlog, it doesn't look like you've got the systemace
> > driver built into the kernel.
> >
> >
> Grant,
> 
> Yes, the systemace was not built into the kernel. It is successfully  
> booting the kernel now.
> Trying to bring up the Ethernet interface. Any pointers?
> 
> Thank you,
> Yedu
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded

^ permalink raw reply

* Re: PATCH[1/1] 8xx: Add clock-frequency to .dts brg entries
From: Scott Wood @ 2008-01-28 15:50 UTC (permalink / raw)
  To: Bryan O'Donoghue; +Cc: linuxppc-dev
In-Reply-To: <1201485191.5537.55.camel@neuromancer.mindspace>

On Mon, Jan 28, 2008 at 01:53:11AM +0000, Bryan O'Donoghue wrote:
> cpm_uart_core has a dependency on fsl,cpm-brg/clock-frequency, this
> means that a .dts that uses the cpm uart driver needs to supply a
> clock-frequency entry for get_brgfreq to return a meaningful number.
> 
> Included is a patchset which adds the correct brgclk to the adder port -
> @ 50Mhz and also adds an entry for mpc885ads - which I've noticed is
> missing a clock-frequency entry.

It's not missing -- it's added by the bootwrapper.

-Scott

^ permalink raw reply

* Re: Load Kernel 2.6 using U-boot on ML403
From: Robert Woodworth @ 2008-01-28 15:47 UTC (permalink / raw)
  To: Yedu Jathavedan; +Cc: linuxppc-embedded
In-Reply-To: <20080126231047.y3lm7epb0gw4cog8@webmail.cecs.pdx.edu>

Do you really need u-boot??

I'm using an ML403 without u-boot.  I've generated my .ace file with the
zImage.elf directly and it works fine.



If there is a choice of u-boot or not, why choose u-boot?


RJW.




On Sat, 2008-01-26 at 23:10 -0800, Yedu Jathavedan wrote:
> Hi,
> I have downloaded the 2.6 kernel from
> http://git.secretlab.ca/git/linux-2.6-virtex.git , installed &
> compiled it. I used "make ARCH=ppc CROSS_COMPILE=ppc_4xx-
> ml403_defconfig" to build the .config file. (As explained in
> http://wiki.secretlab.ca/index.php/Linux_on_Xilinx_Virtex)
> 
> Problem -
> 
> 
> 1)Downloaded(sourceforge.net) & compiled the U-boot 1.1.6 files to get
> u-boot, u-boot.srec & u-boot.bin (I didn't find ml403 board config for
> the uboot. So used ml300_config). 
> 
> After this, I tried to convert the u-boot (README says that this is an
> ELF file) into an ace file. But, it gave me the error saying unable to
> read elf file. Is it because ML403 board is not supported or is it
> possible that the u-boot image that I created is corrupted?
> 
> $ xmd -tcl genace.tcl -jprog -board ml403 -hw download.bit -elf u-boot
> -ace uboot.ace
> Xilinx EDK 9.1 Build EDK_J.19
> Executing xmd script : $HOME/EDK/data/xmd/genace.tcl
> 
> #######################################################################
> XMD GenACE utility. Generate SystemACE File from bit/elf/data Files
> #######################################################################
> Target Type not defined for Processor 1, Using default Target Type
> ppc_hw
> GenACE Options:
>         Board      : ml403
>         Jtag Devs  : xcf32p xc4vfx12 xc95144xl
>         FPGA pos   : 2
>         JPROG      : true
>         HW File    : download.bit
>         ACE File   : uboot.ace
>         nCPUs      : 1
> 
>         Processor ppc_hw_1 Information
>                 Debug opt : -debugdevice devicenr 2 cpunr 1
>                 ELF files : u-boot
>                 Start PC Address : 0xfff80000
> 
> ############################################################
> Converting Bitstream 'download.bit' to SVF file 'download.svf'
> Executing 'impact -batch bit2svf.scr'
> Copying download.svf File to  uboot.svf File
> ############################################################
> Converting ELF file 'u-boot' to SVF file 'u-boot.svf'
> Error: E02 Failed to download ELF file
> 
> ERROR(1053): UNABLE to Read Elf File. The Elf File Maybe Corrupted
>         : u-boot
> #$
> 
> 
> ______________________________________________________________________
> Problem -
> 2) Since generating ace files failed, I tried to search the net for an
> u-boot ace file that could run on ML403 & found it at
> http://88.191.24.164/docenligne/projets/samba/2006/linux-embarque-sur-ml-403/u-boot-ml403.ace/view
> 
> I copied this ace file (u-boot-ml403.ace) along with the kernel 2.6
> image (uImage) onto my CF card & booted the board. After loading the
> kernel, it fails to read the correct root device. I tried changing the
> "bootargs" env variable root = /dev/xsysace/disc0/part2 rw to root
> = /dev/xsysace2 rw & root = /dev/xsda2 rw.
> 
> But, it failed in both cases. (There was a previous post on Problem2 a
> year ago & he solved it by giving root =/dev/xsysace2)
> 
> Environment size: 246/1020 bytes
> #u-boot> setenv bootargs console=ttyS0,9600 root=/dev/xsysace2 rw     
> #u-boot> fatload ace 0 0x400000 uImage
> reading uImage
> 
> 952237 bytes read
> #u-boot>  bootm 0x400000
> ## Booting image at 00400000 ...
>    Image Name:   Linux-2.6.24-rc3
>    Image Type:   PowerPC Linux Kernel Image (gzip compressed)
>    Data Size:    952173 Bytes = 929.9 kB
>    Load Address: 00000000
>    Entry Point:  00000000
>    Verifying Checksum ... OK
>    Uncompressing Kernel Image ... OK
> [    0.000000] Linux version 2.6.24-rc3 (icdt@icdt05) (gcc version
> 4.0.0 (DENX ELDK 4.0 4.0.0)) #1 Fri Jan 25 21:23:54 PST 2008
> [    0.000000] Xilinx ML403 Reference System (Virtex-4 FX)
> [    0.000000] Zone PFN ranges:
> [    0.000000]   DMA             0 ->    16384
> [    0.000000]   Normal      16384 ->    16384
> [    0.000000] Movable zone start PFN for each node
> [    0.000000] early_node_map[1] active PFN ranges
> [    0.000000]     0:        0 ->    16384
> [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.
> Total pages: 16256
> [    0.000000] Kernel command line: console=ttyS0,9600 ip=off
> root=/dev/xsysace  root=/dev/xsysace2 rw
> [    0.000000] Xilinx INTC #0 at 0xD1000FC0 mapped to 0xFDFFEFC0
> [    0.000000] PID hash table entries: 256 (order: 8, 1024 bytes)
> [    0.000179] Console: colour dummy device 80x25
> [    0.000669] Dentry cache hash table entries: 8192 (order: 3, 32768
> bytes)
> [    0.001431] Inode-cache hash table entries: 4096 (order: 2, 16384
> bytes)
> [    0.015197] Memory: 62860k available (1452k kernel code, 496k data,
> 96k init, 0k highmem)
> [    0.204614] Mount-cache hash table entries: 512
> [    0.209345] net_namespace: 64 bytes
> [    0.213840] NET: Registered protocol family 16
> [    0.252576] NET: Registered protocol family 2
> [    0.288713] IP route cache hash table entries: 1024 (order: 0, 4096
> bytes)
> [    0.291229] TCP established hash table entries: 2048 (order: 2,
> 16384 bytes)
> [    0.291535] TCP bind hash table entries: 2048 (order: 1, 8192
> bytes)
> [    0.291709] TCP: Hash tables configured (established 2048 bind
> 2048)
> [    0.291737] TCP reno registered
> [    0.301433] sysctl table check failed: /kernel/l2cr .1.31 Missing
> strategy
> [    0.301509] Call Trace:
> [    0.301528] [c3c17e80] [c00084f4] show_stack+0x4c/0x174
> (unreliable)
> [    0.301611] [c3c17eb0] [c00305e0] set_fail+0x50/0x68
> [    0.301678] [c3c17ed0] [c0030c68] sysctl_check_table+0x670/0x6bc
> [    0.301726] [c3c17f10] [c0030c7c] sysctl_check_table+0x684/0x6bc
> [    0.301771] [c3c17f50] [c001df28] register_sysctl_table+0x5c/0xac
> [    0.301832] [c3c17f70] [c01dca84] register_ppc_htab_sysctl
> +0x18/0x2c
> [    0.301897] [c3c17f80] [c01d6848] kernel_init+0xc8/0x284
> [    0.301938] [c3c17ff0] [c0004af8] kernel_thread+0x44/0x60
> [    0.307739] io scheduler noop registered
> [    0.307792] io scheduler anticipatory registered (default)
> [    0.307817] io scheduler deadline registered
> [    0.307967] io scheduler cfq registered
> [    0.364669] Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports,
> IRQ sharing disabled
> [    0.370815] serial8250.0: ttyS0 at MMIO 0xa0001003 (irq = 9) is a
> 16450
> [    0.370893] console [ttyS0] enabled
> [    3.286815] RAMDISK driver initialized: 16 RAM disks of 65536K size
> 1024 blocksize
> [    3.376997] tun: Universal TUN/TAP device driver, 1.6
> [    3.437161] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
> [    3.512736] mice: PS/2 mouse device common for all mice
> [    3.574814] TCP cubic registered
> [    3.613145] NET: Registered protocol family 1
> [    3.665227] NET: Registered protocol family 17
> [    3.720647] VFS: Cannot open root device "xsysace2" or
> unknown-block(0,0)
> [    3.801333] Please append a correct "root=" boot option; here are
> the available partitions:
> [    3.901354] Kernel panic - not syncing: VFS: Unable to mount root
> fs on unknown-block(0,0)
> [    4.000286] Rebooting in 180 seconds..
> 
> 
> ______________________________________________________________________
> Can anyone help me with either one (or both) of the above problems?  I
> have pretty much run out of ideas. :(
> 
> Thanks & Regards,
> Yedu
> 
> 
> Hi,
> 
> Goal - To use the USB Host on ML403 in a PowerPC processor reference
> system to store some data on a Thumb Drive.
> 
> Background - I downloaded the 2.6 kernel from
> http://git.secretlab.ca/git/linux-2.6-virtex.git , installed &
> compiled it to get uImage & zImage.elf files. I used "make
> ml403_defconfig" to build the .config file. (As explained in
> http://wiki.secretlab.ca/index.php/Linux_on_Xilinx_Virtex)
> 
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded

^ permalink raw reply

* uclibc eldk 4.1.0 has not libSegFault.so,  is there any reason?
From: DI BACCO ANTONIO - technolabs @ 2008-01-28 15:30 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 3 bytes --]

 

[-- Attachment #2: Type: text/html, Size: 251 bytes --]

^ permalink raw reply

* Re: [PATCH] [POWERPC] 86xx: Remove unused IRQ defines
From: Jon Loeliger @ 2008-01-28 15:29 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <Pine.LNX.4.64.0801280919410.22627@blarg.am.freescale.net>

So, like, the other day Kumar Gala mumbled:
> 86xx uses the flat device tree for all its needs so we dont need explicit
> IRQ info. Its not clear why this code existed since 86xx never existed in
> arch/ppc.

Sorry, my fault.

If you Sign-off-by: that patch, a maintainer can apply it! :-)

jdl

^ permalink raw reply

* Re: [PATCH 1/9] qe/muram dts: Explicitly set address-cells and size cells for muram
From: Paul Gortmaker @ 2008-01-28 15:26 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <Pine.LNX.4.64.0801280903130.19922@blarg.am.freescale.net>

Kumar Gala wrote:
> On Mon, 28 Jan 2008, Paul Gortmaker wrote:
>
>   
>> Currently there are several dts that don't specify address or size
>> cells for the muram.  This causes dtc to use default values, one of
>> which is an address-cells of two, and this breaks the parsing of the
>> muram ranges, which is assuming an address-cells of one. For example:
>>
>> Warning (reg_format): "reg" property in
>> /qe@e0100000/muram@10000/data-only@0 has invalid length
>> (8 bytes) (#address-cells == 2, #size-cells == 1)
>>
>> Explicitly setting the address and size cells gets it parsed properly
>> and gets rid of the four dtc warnings.
>>
>> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
>> ---
>>  arch/powerpc/boot/dts/mpc836x_mds.dts |    4 +++-
>>  1 files changed, 3 insertions(+), 1 deletions(-)
>>
>>     
>
> Also fixed up mpc832x_*.dts and mpc8568mds.dts.
>   

Thanks - I'd done those as well but forgot to git-add....

P.

^ permalink raw reply

* [PATCH] [POWERPC] 86xx: Remove unused IRQ defines
From: Kumar Gala @ 2008-01-28 15:20 UTC (permalink / raw)
  To: linuxppc-dev

86xx uses the flat device tree for all its needs so we dont need explicit
IRQ info. Its not clear why this code existed since 86xx never existed in
arch/ppc.

---
 include/asm-powerpc/irq.h |   86 ---------------------------------------------
 1 files changed, 0 insertions(+), 86 deletions(-)

diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h
index 0efe7b2..b5c0312 100644
--- a/include/asm-powerpc/irq.h
+++ b/include/asm-powerpc/irq.h
@@ -483,92 +483,6 @@ static __inline__ int irq_canonicalize(int irq)
  */
 #define	mk_int_int_mask(IL) (1 << (7 - (IL/2)))

-#elif defined(CONFIG_PPC_86xx)
-#include <asm/mpc86xx.h>
-
-#define NR_EPIC_INTS 48
-#ifndef NR_8259_INTS
-#define NR_8259_INTS 16 /*ULI 1575 can route 12 interrupts */
-#endif
-#define NUM_8259_INTERRUPTS NR_8259_INTS
-
-#ifndef I8259_OFFSET
-#define I8259_OFFSET 0
-#endif
-
-#define NR_IRQS 256
-
-/* Internal IRQs on MPC86xx OpenPIC */
-
-#ifndef MPC86xx_OPENPIC_IRQ_OFFSET
-#define MPC86xx_OPENPIC_IRQ_OFFSET NR_8259_INTS
-#endif
-
-/* The 48 internal sources */
-#define MPC86xx_IRQ_NULL        ( 0 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_MCM         ( 1 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_DDR         ( 2 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_LBC         ( 3 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_DMA0        ( 4 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_DMA1        ( 5 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_DMA2        ( 6 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_DMA3        ( 7 + MPC86xx_OPENPIC_IRQ_OFFSET)
-
-/* no 10,11 */
-#define MPC86xx_IRQ_UART2       (12 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_TSEC1_TX    (13 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_TSEC1_RX    (14 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_TSEC3_TX    (15 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_TSEC3_RX    (16 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_TSEC3_ERROR (17 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_TSEC1_ERROR (18 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_TSEC2_TX    (19 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_TSEC2_RX    (20 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_TSEC4_TX    (21 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_TSEC4_RX    (22 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_TSEC4_ERROR (23 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_TSEC2_ERROR (24 + MPC86xx_OPENPIC_IRQ_OFFSET)
-/* no 25 */
-#define MPC86xx_IRQ_UART1       (26 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_IIC         (27 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_PERFMON       (28 + MPC86xx_OPENPIC_IRQ_OFFSET)
-/* no 29,30,31 */
-#define MPC86xx_IRQ_SRIO_ERROR    (32 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_SRIO_OUT_BELL (33 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_SRIO_IN_BELL  (34 + MPC86xx_OPENPIC_IRQ_OFFSET)
-/* no 35,36 */
-#define MPC86xx_IRQ_SRIO_OUT_MSG1 (37 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_SRIO_IN_MSG1  (38 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_SRIO_OUT_MSG2 (39 + MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_SRIO_IN_MSG2  (40 + MPC86xx_OPENPIC_IRQ_OFFSET)
-
-/* The 12 external interrupt lines */
-#define MPC86xx_IRQ_EXT_BASE	48
-#define MPC86xx_IRQ_EXT0	(0 + MPC86xx_IRQ_EXT_BASE \
-		+ MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_EXT1	(1 + MPC86xx_IRQ_EXT_BASE \
-		+ MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_EXT2	(2 + MPC86xx_IRQ_EXT_BASE \
-		+ MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_EXT3	(3 + MPC86xx_IRQ_EXT_BASE \
-		+ MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_EXT4	(4 + MPC86xx_IRQ_EXT_BASE \
-		+ MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_EXT5	(5 + MPC86xx_IRQ_EXT_BASE \
-		+ MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_EXT6	(6 + MPC86xx_IRQ_EXT_BASE \
-		+ MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_EXT7	(7 + MPC86xx_IRQ_EXT_BASE \
-		+ MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_EXT8	(8 + MPC86xx_IRQ_EXT_BASE \
-		+ MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_EXT9	(9 + MPC86xx_IRQ_EXT_BASE \
-		+ MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_EXT10	(10 + MPC86xx_IRQ_EXT_BASE \
-		+ MPC86xx_OPENPIC_IRQ_OFFSET)
-#define MPC86xx_IRQ_EXT11	(11 + MPC86xx_IRQ_EXT_BASE \
-		+ MPC86xx_OPENPIC_IRQ_OFFSET)
-
 #else /* CONFIG_40x + CONFIG_8xx */
 /*
  * this is the # irq's for all ppc arch's (pmac/chrp/prep)
-- 
1.5.3.7

^ 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