LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Uartlite: Revert register io access changes
From: Grant Likely @ 2007-10-02 16:47 UTC (permalink / raw)
  To: linuxppc-dev, jwboyer, jacmet

From: Grant Likely <grant.likely@secretlab.ca>

Reverts commit 58205d2b1256a32c9e8b02587f8ef3cdcf1eb8bd

This driver is used by devices other than the xilinx opb-uartlite which
depend on bytewise access to the registers.  The change to 32 bit access
does not work on these devices.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

 arch/ppc/syslib/virtex_devices.c |    2 +-
 drivers/serial/uartlite.c        |   36 ++++++++++++++++++------------------
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/arch/ppc/syslib/virtex_devices.c b/arch/ppc/syslib/virtex_devices.c
index 270ad3a..ace4ec0 100644
--- a/arch/ppc/syslib/virtex_devices.c
+++ b/arch/ppc/syslib/virtex_devices.c
@@ -28,7 +28,7 @@
 	.num_resources = 2, \
 	.resource = (struct resource[]) { \
 		{ \
-			.start = XPAR_UARTLITE_##num##_BASEADDR, \
+			.start = XPAR_UARTLITE_##num##_BASEADDR + 3, \
 			.end = XPAR_UARTLITE_##num##_HIGHADDR, \
 			.flags = IORESOURCE_MEM, \
 		}, \
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index 2b8404c..dfef83f 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -75,7 +75,7 @@ static int ulite_receive(struct uart_port *port, int stat)
 	/* stats */
 	if (stat & ULITE_STATUS_RXVALID) {
 		port->icount.rx++;
-		ch = in_be32((void*)port->membase + ULITE_RX);
+		ch = readb(port->membase + ULITE_RX);
 
 		if (stat & ULITE_STATUS_PARITY)
 			port->icount.parity++;
@@ -120,7 +120,7 @@ static int ulite_transmit(struct uart_port *port, int stat)
 		return 0;
 
 	if (port->x_char) {
-		out_be32((void*)port->membase + ULITE_TX, port->x_char);
+		writeb(port->x_char, port->membase + ULITE_TX);
 		port->x_char = 0;
 		port->icount.tx++;
 		return 1;
@@ -129,7 +129,7 @@ static int ulite_transmit(struct uart_port *port, int stat)
 	if (uart_circ_empty(xmit) || uart_tx_stopped(port))
 		return 0;
 
-	out_be32((void*)port->membase + ULITE_TX, xmit->buf[xmit->tail]);
+	writeb(xmit->buf[xmit->tail], port->membase + ULITE_TX);
 	xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE-1);
 	port->icount.tx++;
 
@@ -146,7 +146,7 @@ static irqreturn_t ulite_isr(int irq, void *dev_id)
 	int busy;
 
 	do {
-		int stat = in_be32((void*)port->membase + ULITE_STATUS);
+		int stat = readb(port->membase + ULITE_STATUS);
 		busy  = ulite_receive(port, stat);
 		busy |= ulite_transmit(port, stat);
 	} while (busy);
@@ -162,7 +162,7 @@ static unsigned int ulite_tx_empty(struct uart_port *port)
 	unsigned int ret;
 
 	spin_lock_irqsave(&port->lock, flags);
-	ret = in_be32((void*)port->membase + ULITE_STATUS);
+	ret = readb(port->membase + ULITE_STATUS);
 	spin_unlock_irqrestore(&port->lock, flags);
 
 	return ret & ULITE_STATUS_TXEMPTY ? TIOCSER_TEMT : 0;
@@ -185,7 +185,7 @@ static void ulite_stop_tx(struct uart_port *port)
 
 static void ulite_start_tx(struct uart_port *port)
 {
-	ulite_transmit(port, in_be32((void*)port->membase + ULITE_STATUS));
+	ulite_transmit(port, readb(port->membase + ULITE_STATUS));
 }
 
 static void ulite_stop_rx(struct uart_port *port)
@@ -214,17 +214,17 @@ static int ulite_startup(struct uart_port *port)
 	if (ret)
 		return ret;
 
-	out_be32((void*)port->membase + ULITE_CONTROL,
-	         ULITE_CONTROL_RST_RX | ULITE_CONTROL_RST_TX);
-	out_be32((void*)port->membase + ULITE_CONTROL, ULITE_CONTROL_IE);
+	writeb(ULITE_CONTROL_RST_RX | ULITE_CONTROL_RST_TX,
+	       port->membase + ULITE_CONTROL);
+	writeb(ULITE_CONTROL_IE, port->membase + ULITE_CONTROL);
 
 	return 0;
 }
 
 static void ulite_shutdown(struct uart_port *port)
 {
-	out_be32((void*)port->membase + ULITE_CONTROL, 0);
-	in_be32((void*)port->membase + ULITE_CONTROL); /* dummy */
+	writeb(0, port->membase + ULITE_CONTROL);
+	readb(port->membase + ULITE_CONTROL); /* dummy */
 	free_irq(port->irq, port);
 }
 
@@ -332,7 +332,7 @@ static void ulite_console_wait_tx(struct uart_port *port)
 
 	/* wait up to 10ms for the character(s) to be sent */
 	for (i = 0; i < 10000; i++) {
-		if (in_be32((void*)port->membase + ULITE_STATUS) & ULITE_STATUS_TXEMPTY)
+		if (readb(port->membase + ULITE_STATUS) & ULITE_STATUS_TXEMPTY)
 			break;
 		udelay(1);
 	}
@@ -341,7 +341,7 @@ static void ulite_console_wait_tx(struct uart_port *port)
 static void ulite_console_putchar(struct uart_port *port, int ch)
 {
 	ulite_console_wait_tx(port);
-	out_be32((void*)port->membase + ULITE_TX, ch);
+	writeb(ch, port->membase + ULITE_TX);
 }
 
 static void ulite_console_write(struct console *co, const char *s,
@@ -358,8 +358,8 @@ static void ulite_console_write(struct console *co, const char *s,
 		spin_lock_irqsave(&port->lock, flags);
 
 	/* save and disable interrupt */
-	ier = in_be32((void*)port->membase + ULITE_STATUS) & ULITE_STATUS_IE;
-	out_be32((void*)port->membase + ULITE_CONTROL, 0);
+	ier = readb(port->membase + ULITE_STATUS) & ULITE_STATUS_IE;
+	writeb(0, port->membase + ULITE_CONTROL);
 
 	uart_console_write(port, s, count, ulite_console_putchar);
 
@@ -367,7 +367,7 @@ static void ulite_console_write(struct console *co, const char *s,
 
 	/* restore interrupt state */
 	if (ier)
-		out_be32((void*)port->membase + ULITE_CONTROL, ULITE_CONTROL_IE);
+		writeb(ULITE_CONTROL_IE, port->membase + ULITE_CONTROL);
 
 	if (locked)
 		spin_unlock_irqrestore(&port->lock, flags);
@@ -598,7 +598,7 @@ ulite_of_probe(struct of_device *op, const struct of_device_id *match)
 
 	rc = of_address_to_resource(op->node, 0, &res);
 	if (rc) {
-		dev_err(&op->dev, "invalide address\n");
+		dev_err(&op->dev, "invalid address\n");
 		return rc;
 	}
 
@@ -606,7 +606,7 @@ ulite_of_probe(struct of_device *op, const struct of_device_id *match)
 
 	id = of_get_property(op->node, "port-number", NULL);
 
-	return ulite_assign(&op->dev, id ? *id : -1, res.start, irq);
+	return ulite_assign(&op->dev, id ? *id : -1, res.start+3, irq);
 }
 
 static int __devexit ulite_of_remove(struct of_device *op)

^ permalink raw reply related

* Re: [PATCH 2/2] Uartlite: Revert register io access changes
From: Grant Likely @ 2007-10-02 16:46 UTC (permalink / raw)
  To: linuxppc-dev, jwboyer, jacmet
In-Reply-To: <20071002164421.24562.33312.stgit@trillian.cg.shawcable.net>

On 10/2/07, Grant Likely <grant.likely@secretlab.ca> wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
>
> Reverts commit 58205d2b1256a32c9e8b02587f8ef3cdcf1eb8bd
>
> This driver is used by devices other than the xilinx opb-uartlite which
> depend on bytewise access to the registers.  The change to 32 bit access
> does not work on these devices.
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
>
>  0 files changed, 0 insertions(+), 0 deletions(-)

Oops.... let me try that again.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* [PATCH 2/2] Uartlite: Revert register io access changes
From: Grant Likely @ 2007-10-02 16:44 UTC (permalink / raw)
  To: linuxppc-dev, jwboyer, jacmet
In-Reply-To: <20071002164415.24562.44426.stgit@trillian.cg.shawcable.net>

From: Grant Likely <grant.likely@secretlab.ca>

Reverts commit 58205d2b1256a32c9e8b02587f8ef3cdcf1eb8bd

This driver is used by devices other than the xilinx opb-uartlite which
depend on bytewise access to the registers.  The change to 32 bit access
does not work on these devices.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

 0 files changed, 0 insertions(+), 0 deletions(-)

^ permalink raw reply

* [PATCH 1/2] Uartlite: Add macros for register names
From: Grant Likely @ 2007-10-02 16:44 UTC (permalink / raw)
  To: linuxppc-dev, jwboyer, jacmet

From: Grant Likely <grant.likely@secretlab.ca>

Add macros to define register names to improve readability.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

 arch/powerpc/boot/uartlite.c |   27 +++++++++++++++++++++------
 1 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/boot/uartlite.c b/arch/powerpc/boot/uartlite.c
index f4249a7..38a470b 100644
--- a/arch/powerpc/boot/uartlite.c
+++ b/arch/powerpc/boot/uartlite.c
@@ -16,30 +16,45 @@
 #include "io.h"
 #include "ops.h"
 
+#define ULITE_RX		0x00
+#define ULITE_TX		0x04
+#define ULITE_STATUS		0x08
+#define ULITE_CONTROL		0x0c
+
+#define ULITE_STATUS_RXVALID	0x01
+#define ULITE_STATUS_TXFULL	0x08
+
+#define ULITE_CONTROL_RST_RX	0x02
+
 static void * reg_base;
 
 static int uartlite_open(void)
 {
 	/* Clear the RX FIFO */
-	out_be32(reg_base + 0x0C, 0x2);
+	out_be32(reg_base + ULITE_CONTROL, ULITE_CONTROL_RST_RX);
 	return 0;
 }
 
 static void uartlite_putc(unsigned char c)
 {
-	while ((in_be32(reg_base + 0x8) & 0x08) != 0); /* spin */
-	out_be32(reg_base + 0x4, c);
+	u32 reg = ULITE_STATUS_TXFULL;
+	while (reg & ULITE_STATUS_TXFULL) /* spin on TXFULL bit */
+		reg = in_be32(reg_base + ULITE_STATUS);
+	out_be32(reg_base + ULITE_TX, c);
 }
 
 static unsigned char uartlite_getc(void)
 {
-	while ((in_be32(reg_base + 0x8) & 0x01) == 0); /* spin */
-	return in_be32(reg_base);
+	u32 reg = ULITE_STATUS_RXVALID;
+	while (reg & ULITE_STATUS_RXVALID) /* spin on RXVALID bit */
+		reg = in_be32(reg_base + ULITE_STATUS);
+	return in_be32(reg_base + ULITE_RX);
 }
 
 static u8 uartlite_tstc(void)
 {
-	return ((in_be32(reg_base + 0x8) & 0x01) != 0);
+	u32 reg = in_be32(reg_base + ULITE_STATUS);
+	return reg & ULITE_STATUS_RXVALID;
 }
 
 int uartlite_console_init(void *devp, struct serial_console_data *scdp)

^ permalink raw reply related

* Re: [PATCH] cpm: Describe multi-user ram in its own device node.
From: Timur Tabi @ 2007-10-02 15:51 UTC (permalink / raw)
  To: Scott Wood; +Cc: PowerPC dev list
In-Reply-To: <47026884.4040909@freescale.com>

Scott Wood wrote:

> I was thinking of just removing the muram code from qe_lib, and having 
> it use the code in cpm_common.c.

Do we want to have the QE library include CPM code at this point?  I know we 
want to merge some QE and CPM code, but I would rather do that in one shot 
than piecemeal.

> BTW, searching the entire device tree for a node with the name 
> "data-only", regardless of context, seems a bit insane to me.

Yes, I noticed that, too.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

^ permalink raw reply

* Re: [PATCH 2 6/7] Uartlite: Add of-platform-bus binding
From: Grant Likely @ 2007-10-02 16:23 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <47026D5C.4050308@freescale.com>

On 10/2/07, Scott Wood <scottwood@freescale.com> wrote:
> It would be nice, though, to merge platform and of_platform to some
> extent, so that things which don't need to check "special" device tree
> properties wouldn't have to make any changes other than maybe adding an
> extra match table entry.

yes, that would be really nice.

On that note, is it possible to modify the device tree (and of_device
registrations) at run time?  The one feature I do really like about
using the platform bus is that you can register/unregister devices at
run time.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: [PATCH 2 6/7] Uartlite: Add of-platform-bus binding
From: Grant Likely @ 2007-10-02 16:10 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: linuxppc-dev
In-Reply-To: <871wcd33ux.fsf@macbook.be.48ers.dk>

On 10/2/07, Peter Korsgaard <jacmet@sunsite.dk> wrote:
> >>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:
>
> Hi,
>
>  Grant> static int __devinit
>  Grant> ulite_of_probe(struct of_device *op, const struct of_device_id *match)
>
> This looks like uartlite code to me ;)
>
>  Grant> {
>  Grant>         struct resource res;
>  Grant>         const unsigned int *id;
>  Grant>         int irq, rc;
>  Grant>         dev_dbg(&op->dev, "%s(%p, %p)\n", __FUNCTION__, op, match);
>  Grant>         rc = of_address_to_resource(op->node, 0, &res);
>  Grant>         if (rc) {
>  Grant>                 dev_err(&op->dev, "invalide address\n");
>  Grant>                 return rc;
>  Grant>         }
>  Grant>         irq = irq_of_parse_and_map(op->node, 0);
>  Grant>         id = of_get_property(op->node, "port-number", NULL);
>  Grant>         return ulite_assign(&op->dev, id ? *id : -1, res.start, irq);
>  Grant> }
>
>  Grant> What advantages do you see with the constructor approach?
>
> One advantage is that it keeps the of stuff out of the drivers. There
> already is one bus for platform stuff in the kernel, so from a device
> driver writer POV the of stuff is just extra fluff. Imagine the ARM or
> MIPS people coming up with 2 other incompatible ways of doing this and
> you'll see the drivers bloat.
>
> E.G. I use the smsc911x.c network driver on powerpc which is written
> by an ARM guy. Why should he need to care about of stuff in his driver?

The problem is that driver specific constructor code needs to be
written regardless.  Where should it live?  With the driver or in the
arch code?  Actually, with the arch code doesn't work well either
because multiple archs will be using of_platform (microblaze for
example), so they need to live somewhere common.

My opinion is that since it is driver-specific code anyway, then it
belongs with the driver.  Plus a driver writer for ARM doesn't need to
write them.  It's the powerpc or microblaze developer who will do it.
If the driver maintainer doesn't want the binding in the main driver
.c file, then the binding can easily be in an additional .c file
without needing to add a constructor.  (Kind of like how many USB host
controllers are managed)

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: [PATCH 2 6/7] Uartlite: Add of-platform-bus binding
From: Scott Wood @ 2007-10-02 16:10 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: linuxppc-dev
In-Reply-To: <871wcd33ux.fsf@macbook.be.48ers.dk>

Peter Korsgaard wrote:
>  Grant> What advantages do you see with the constructor approach?
> 
> One advantage is that it keeps the of stuff out of the drivers. There
> already is one bus for platform stuff in the kernel, so from a device
> driver writer POV the of stuff is just extra fluff. Imagine the ARM or
> MIPS people coming up with 2 other incompatible ways of doing this and
> you'll see the drivers bloat.

OTOH, it's nice to keep everything relating to a certain device in one 
spot, rather than scattering some bits in arch.  Plus, the device tree 
is not just powerpc; it's also used on sparc ond OLPC.

> E.G. I use the smsc911x.c network driver on powerpc which is written
> by an ARM guy. Why should he need to care about of stuff in his driver?

Just because an ARM guy wrote it doesn't mean powerpc guys can't stuff 
things in there. :-)

It would be nice, though, to merge platform and of_platform to some 
extent, so that things which don't need to check "special" device tree 
properties wouldn't have to make any changes other than maybe adding an 
extra match table entry.

-Scott

^ permalink raw reply

* Re: [PATCH 11/18] Virtex: Port UARTLITE driver to of-platform-bus
From: Peter Korsgaard @ 2007-10-02 16:01 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40710020856x5faf2d82p281bb269286ba4c4@mail.gmail.com>

>>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:

Hi,

 Grant> On 10/2/07, Peter Korsgaard <jacmet@sunsite.dk> wrote:
 >> >>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:
 Grant> +       pr_debug("uartlite: calling platform_driver_register()\n");
 Grant> +       if ((ret = platform_driver_register(&ulite_platform_driver)) != 0)
 >> 
 >> I prefer to not have assignments in the if ().

 Grant> Already fixed in v3

Ok, thanks.

 >> Are all the pr_debug necessary? It looks quite messy.

 Grant> Maybe messy, but *very* useful.  Looks prettier in the v3 version with
 Grant> the assignment and if() on separate lines.

Ok, I'll take a look (sorry, I'm behind on mails..)

-- 
Bye, Peter Korsgaard

^ permalink raw reply

* Re: [PATCH 2 6/7] Uartlite: Add of-platform-bus binding
From: Peter Korsgaard @ 2007-10-02 15:58 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40710020726s330d586p6ece70ae378f1206@mail.gmail.com>

>>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:

Hi,

 Grant> static int __devinit
 Grant> ulite_of_probe(struct of_device *op, const struct of_device_id *match)

This looks like uartlite code to me ;)

 Grant> {
 Grant>         struct resource res;
 Grant>         const unsigned int *id;
 Grant>         int irq, rc;
 Grant>         dev_dbg(&op->dev, "%s(%p, %p)\n", __FUNCTION__, op, match);
 Grant>         rc = of_address_to_resource(op->node, 0, &res);
 Grant>         if (rc) {
 Grant>                 dev_err(&op->dev, "invalide address\n");
 Grant>                 return rc;
 Grant>         }
 Grant>         irq = irq_of_parse_and_map(op->node, 0);
 Grant>         id = of_get_property(op->node, "port-number", NULL);
 Grant>         return ulite_assign(&op->dev, id ? *id : -1, res.start, irq);
 Grant> }

 Grant> What advantages do you see with the constructor approach?

One advantage is that it keeps the of stuff out of the drivers. There
already is one bus for platform stuff in the kernel, so from a device
driver writer POV the of stuff is just extra fluff. Imagine the ARM or
MIPS people coming up with 2 other incompatible ways of doing this and
you'll see the drivers bloat.

E.G. I use the smsc911x.c network driver on powerpc which is written
by an ARM guy. Why should he need to care about of stuff in his driver?

-- 
Bye, Peter Korsgaard

^ permalink raw reply

* Re: [PATCH 11/18] Virtex: Port UARTLITE driver to of-platform-bus
From: Grant Likely @ 2007-10-02 15:56 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: linuxppc-dev
In-Reply-To: <87641p34dn.fsf@macbook.be.48ers.dk>

On 10/2/07, Peter Korsgaard <jacmet@sunsite.dk> wrote:
> >>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:
>  Grant> +       pr_debug("uartlite: calling platform_driver_register()\n");
>  Grant> +       if ((ret = platform_driver_register(&ulite_platform_driver)) != 0)
>
> I prefer to not have assignments in the if ().

Already fixed in v3

> Are all the pr_debug necessary? It looks quite messy.

Maybe messy, but *very* useful.  Looks prettier in the v3 version with
the assignment and if() on separate lines.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* [PATCH] Remove unnecessary memset from physmap_of driver
From: Valentine Barshak @ 2007-10-02 15:53 UTC (permalink / raw)
  To: linuxppc-dev

No need for memset to zero memory here, since we use kzalloc.

Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
---
 drivers/mtd/maps/physmap_of.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index cf75a56..aeed9ea 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -232,7 +232,6 @@ static int __devinit of_flash_probe(struct of_device *dev,
 	info = kzalloc(sizeof(*info), GFP_KERNEL);
 	if (!info)
 		goto err_out;
-	memset(info, 0, sizeof(*info));
 
 	dev_set_drvdata(&dev->dev, info);
 
-- 
1.5.2.4

^ permalink raw reply related

* Re: [PATCH 06/18] [POWERPC] Fix UARTLITE reg io for little-endian architectures (ie. microblaze)
From: Grant Likely @ 2007-10-02 15:54 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: linuxppc-dev
In-Reply-To: <87abr134pc.fsf@macbook.be.48ers.dk>

On 10/2/07, Peter Korsgaard <jacmet@sunsite.dk> wrote:
> The uartlite driver is ofcause primarily used to drive Xilinx
> OPB_Uartlite IP blocks, but that's not the only use - E.G. we are
> using another simple UART with the same hardware interface but sitting
> on a 16bit bus. With the current driver this works fine, but won't
> with the out_be32.

Ugh.  Alright I'll revert the patch.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: [PATCH] cpm: rounding of brg clockdivider
From: Scott Wood @ 2007-10-02 15:46 UTC (permalink / raw)
  To: Esben Haabendal; +Cc: LinuxPPC-dev
In-Reply-To: <9edac4e26b9461b125012c7e025c847f@127.0.0.1>

Esben Haabendal wrote:
> Do rounding of brg clockdivider instead of truncate to get more precise baudrates

IIRC, the truncated divider produced better results with serial on 
mpc8272ads...

-Scott

^ permalink raw reply

* Re: [PATCH 11/18] Virtex: Port UARTLITE driver to of-platform-bus
From: Peter Korsgaard @ 2007-10-02 15:47 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <20070928181748.18608.62409.stgit@trillian.cg.shawcable.net>

>>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:

Hi,

 Grant> From: Grant Likely <grant.likely@secretlab.ca>
 Grant> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
 Grant> ---

 Grant>  drivers/serial/uartlite.c |  101 +++++++++++++++++++++++++++++++++++++++++----
 Grant>  1 files changed, 93 insertions(+), 8 deletions(-)

 Grant> diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
 Grant> index ed13b9f..8f742e0 100644
 Grant> --- a/drivers/serial/uartlite.c
 Grant> +++ b/drivers/serial/uartlite.c
 Grant> @@ -1,7 +1,8 @@
 Grant>  /*
 Grant>   * uartlite.c: Serial driver for Xilinx uartlite serial controller
 Grant>   *
 Grant> - * Peter Korsgaard <jacmet@sunsite.dk>
 Grant> + * Copyright (C) 2006 Peter Korsgaard <jacmet@sunsite.dk>
 Grant> + * Copyright (C) 2007 Secret Lab Technologies Ltd.
 Grant>   *
 Grant>   * This file is licensed under the terms of the GNU General Public License
 Grant>   * version 2.  This program is licensed "as is" without any warranty of any
 Grant> @@ -17,6 +18,10 @@
 Grant>  #include <linux/delay.h>
 Grant>  #include <linux/interrupt.h>
 Grant>  #include <asm/io.h>
 Grant> +#if defined(CONFIG_OF)
 Grant> +#include <linux/of_device.h>
 Grant> +#include <linux/of_platform.h>
 Grant> +#endif
 
 Grant>  #define ULITE_NAME		"ttyUL"
 Grant>  #define ULITE_MAJOR		204
 Grant> @@ -382,8 +387,10 @@ static int __init ulite_console_setup(struct console *co, char *options)
 Grant>  	port = &ulite_ports[co->index];
 
 Grant>  	/* not initialized yet? */
 Grant> -	if (!port->membase)
 Grant> +	if (!port->membase) {
 Grant> +		pr_debug("console on ttyUL%i not initialized\n", co->index);
 Grant>  		return -ENODEV;
 Grant> +	}

Unrelated change.
 
 Grant>  	if (options)
 Grant>  		uart_parse_options(options, &baud, &parity, &bits, &flow);
 Grant> @@ -542,6 +549,72 @@ static struct platform_driver ulite_platform_driver = {
 Grant>  };
 
 Grant>  /* ---------------------------------------------------------------------
 Grant> + * OF bus bindings
 Grant> + */
 Grant> +#if defined(CONFIG_OF)
 Grant> +static int __devinit
 Grant> +ulite_of_probe(struct of_device *op, const struct of_device_id *match)
 Grant> +{
 Grant> +	struct resource res;
 Grant> +	const unsigned int *id;
 Grant> +	int irq, rc;
 Grant> +
 Grant> +	dev_dbg(&op->dev, "%s(%p, %p)\n", __FUNCTION__, op, match);
 Grant> +
 Grant> +	rc = of_address_to_resource(op->node, 0, &res);
 Grant> +	if (rc) {
 Grant> +		dev_err(&op->dev, "invalide address\n");
 Grant> +		return rc;
 Grant> +	}
 Grant> +
 Grant> +	irq = irq_of_parse_and_map(op->node, 0);
 Grant> +
 Grant> +	id = of_get_property(op->node, "port-number", NULL);
 Grant> +
 Grant> +	return ulite_assign(&op->dev, id ? *id : -1, res.start, irq);
 Grant> +}
 Grant> +
 Grant> +static int ulite_of_remove(struct of_device *op)
 Grant> +{
 Grant> +	return ulite_release(&op->dev);
 Grant> +}
 Grant> +
 Grant> +/* Match table for of_platform binding */
 Grant> +static struct of_device_id __devinit ulite_of_match[] = {
 Grant> +	{ .type = "serial", .compatible = "xilinx,uartlite", },
 Grant> +	{},
 Grant> +};
 Grant> +MODULE_DEVICE_TABLE(of, ulite_of_match);
 Grant> +
 Grant> +static struct of_platform_driver ulite_of_driver = {
 Grant> +	.owner = THIS_MODULE,
 Grant> +	.name = "uartlite",
 Grant> +	.match_table = ulite_of_match,
 Grant> +	.probe = ulite_of_probe,
 Grant> +	.remove = ulite_of_remove,
 Grant> +	.driver = {
 Grant> +		.name = "uartlite",
 Grant> +	},
 Grant> +};
 Grant> +
 Grant> +/* Registration helpers to keep the number of #ifdefs to a minimum */
 Grant> +static inline int __init ulite_of_register(void)
 Grant> +{
 Grant> +	pr_debug("uartlite: calling of_register_platform_driver()\n");
 Grant> +	return of_register_platform_driver(&ulite_of_driver);
 Grant> +}
 Grant> +
 Grant> +static inline void __init ulite_of_unregister(void)
 Grant> +{
 Grant> +	of_unregister_platform_driver(&ulite_of_driver);
 Grant> +}
 Grant> +#else /* CONFIG_OF */
 Grant> +/* CONFIG_OF not enabled; do nothing helpers */
 Grant> +static inline int __init ulite_of_register(void) { return 0; }
 Grant> +static inline void __init ulite_of_unregister(void) { }
 Grant> +#endif /* CONFIG_OF */
 Grant> +
 Grant> +/* ---------------------------------------------------------------------
 Grant>   * Module setup/teardown
 Grant>   */
 
 Grant> @@ -549,20 +622,32 @@ int __init ulite_init(void)
 Grant>  {
 Grant>  	int ret;
 
 Grant> -	ret = uart_register_driver(&ulite_uart_driver);
 Grant> -	if (ret)
 Grant> -		return ret;
 Grant> +	pr_debug("uartlite: calling uart_register_driver()\n");
 Grant> +	if ((ret = uart_register_driver(&ulite_uart_driver)) != 0)
 Grant> +		goto err_uart;
 
 Grant> -	ret = platform_driver_register(&ulite_platform_driver);
 Grant> -	if (ret)
 Grant> -		uart_unregister_driver(&ulite_uart_driver);
 Grant> +	if ((ret = ulite_of_register()) != 0)
 Grant> +		goto err_of;
 
 Grant> +	pr_debug("uartlite: calling platform_driver_register()\n");
 Grant> +	if ((ret = platform_driver_register(&ulite_platform_driver)) != 0)

I prefer to not have assignments in the if ().
Are all the pr_debug necessary? It looks quite messy.

 Grant> +		goto err_plat;
 Grant> +

 Grant> +	return 0;
 Grant> +
 Grant> +err_plat:
 Grant> +	ulite_of_unregister();
 Grant> +err_of:
 Grant> +	uart_unregister_driver(&ulite_uart_driver);
 Grant> +err_uart:
 Grant> +	printk(KERN_ERR "registering uartlite driver failed: err=%i", ret);
 Grant>  	return ret;
 Grant>  }
 
 Grant>  void __exit ulite_exit(void)
 Grant>  {
 Grant>  	platform_driver_unregister(&ulite_platform_driver);
 Grant> +	ulite_of_unregister();
 Grant>  	uart_unregister_driver(&ulite_uart_driver);
 Grant>  }
 


-- 
Bye, Peter Korsgaard

^ permalink raw reply

* Re: [RFC PATCH v0.2] net driver: mpc52xx fec
From: Robert Schwebel @ 2007-10-02 15:46 UTC (permalink / raw)
  To: Domen Puncer; +Cc: netdev, linuxppc-embedded
In-Reply-To: <20071002143202.GQ32628@nd47.coderock.org>

On Tue, Oct 02, 2007 at 04:32:02PM +0200, Domen Puncer wrote:
> The patch looks ok to me.

Short update: even with the patch, the driver doesn't work on an
rt-preempt enabled kernel, or at least not reliable. It survives normal
traffic and ping -f, but dies when running nmap against the box, with a
set RFIFO_ERROR flag.

More research needs to be done.

Robert
-- 
Pengutronix - Linux Solutions for Science and Industry
Entwicklungszentrum Nord     http://www.pengutronix.de

^ permalink raw reply

* Re: [PATCH 06/18] [POWERPC] Fix UARTLITE reg io for little-endian architectures (ie. microblaze)
From: Peter Korsgaard @ 2007-10-02 15:40 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <20070928181704.18608.40317.stgit@trillian.cg.shawcable.net>

>>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:

 Grant> From: Grant Likely <grant.likely@secretlab.ca>
 Grant> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
 Grant> Acked-by: John Williams <jwilliams@itee.uq.edu.au>

Huh? This seems a bit confused. Microblaze is big endian and out_be32
is only defined in arch/p{,ower}pc.

This has been discussed before. The logical registers are 8bit, but
the OPB implementation (by virtue of it being a 32bit bus) uses
32bit spacing between the registers.

The fact is that the only portable access to non-pci registers in the
kernel is 8 bit.

The uartlite driver is ofcause primarily used to drive Xilinx
OPB_Uartlite IP blocks, but that's not the only use - E.G. we are
using another simple UART with the same hardware interface but sitting
on a 16bit bus. With the current driver this works fine, but won't
with the out_be32.

For a new design wi'll use an AT91 (arm). I don't see any reason why
we shouldn't be able to use the same UART block there.

 Grant> ---

 Grant>  arch/ppc/syslib/virtex_devices.c |    2 +-
 Grant>  drivers/serial/uartlite.c        |   32 ++++++++++++++++----------------
 Grant>  2 files changed, 17 insertions(+), 17 deletions(-)

 Grant> diff --git a/arch/ppc/syslib/virtex_devices.c b/arch/ppc/syslib/virtex_devices.c
 Grant> index ace4ec0..270ad3a 100644
 Grant> --- a/arch/ppc/syslib/virtex_devices.c
 Grant> +++ b/arch/ppc/syslib/virtex_devices.c
 Grant> @@ -28,7 +28,7 @@
 Grant>  	.num_resources = 2, \
 Grant>  	.resource = (struct resource[]) { \
 Grant>  		{ \
 Grant> -			.start = XPAR_UARTLITE_##num##_BASEADDR + 3, \
 Grant> +			.start = XPAR_UARTLITE_##num##_BASEADDR, \
 Grant>  			.end = XPAR_UARTLITE_##num##_HIGHADDR, \
 Grant>  			.flags = IORESOURCE_MEM, \
 Grant>  		}, \
 Grant> diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
 Grant> index f5051cf..59b674a 100644
 Grant> --- a/drivers/serial/uartlite.c
 Grant> +++ b/drivers/serial/uartlite.c
 Grant> @@ -61,7 +61,7 @@ static int ulite_receive(struct uart_port *port, int stat)
 Grant>  	/* stats */
 Grant>  	if (stat & ULITE_STATUS_RXVALID) {
 port-> icount.rx++;
 Grant> -		ch = readb(port->membase + ULITE_RX);
 Grant> +		ch = in_be32((void*)port->membase + ULITE_RX);
 
 Grant>  		if (stat & ULITE_STATUS_PARITY)
 port-> icount.parity++;
 Grant> @@ -106,7 +106,7 @@ static int ulite_transmit(struct uart_port *port, int stat)
 Grant>  		return 0;
 
 Grant>  	if (port->x_char) {
 Grant> -		writeb(port->x_char, port->membase + ULITE_TX);
 Grant> +		out_be32((void*)port->membase + ULITE_TX, port->x_char);
 port-> x_char = 0;
 port-> icount.tx++;
 Grant>  		return 1;
 Grant> @@ -115,7 +115,7 @@ static int ulite_transmit(struct uart_port *port, int stat)
 Grant>  	if (uart_circ_empty(xmit) || uart_tx_stopped(port))
 Grant>  		return 0;
 
 Grant> -	writeb(xmit->buf[xmit->tail], port->membase + ULITE_TX);
 Grant> +	out_be32((void*)port->membase + ULITE_TX, xmit->buf[xmit->tail]);
 xmit-> tail = (xmit->tail + 1) & (UART_XMIT_SIZE-1);
 port-> icount.tx++;
 
 Grant> @@ -132,7 +132,7 @@ static irqreturn_t ulite_isr(int irq, void *dev_id)
 Grant>  	int busy;
 
 Grant>  	do {
 Grant> -		int stat = readb(port->membase + ULITE_STATUS);
 Grant> +		int stat = in_be32((void*)port->membase + ULITE_STATUS);
 Grant>  		busy  = ulite_receive(port, stat);
 Grant>  		busy |= ulite_transmit(port, stat);
 Grant>  	} while (busy);
 Grant> @@ -148,7 +148,7 @@ static unsigned int ulite_tx_empty(struct uart_port *port)
 Grant>  	unsigned int ret;
 
 Grant>  	spin_lock_irqsave(&port->lock, flags);
 Grant> -	ret = readb(port->membase + ULITE_STATUS);
 Grant> +	ret = in_be32((void*)port->membase + ULITE_STATUS);
 Grant>  	spin_unlock_irqrestore(&port->lock, flags);
 
 Grant>  	return ret & ULITE_STATUS_TXEMPTY ? TIOCSER_TEMT : 0;
 Grant> @@ -171,7 +171,7 @@ static void ulite_stop_tx(struct uart_port *port)
 
 Grant>  static void ulite_start_tx(struct uart_port *port)
 Grant>  {
 Grant> -	ulite_transmit(port, readb(port->membase + ULITE_STATUS));
 Grant> +	ulite_transmit(port, in_be32((void*)port->membase + ULITE_STATUS));
 Grant>  }
 
 Grant>  static void ulite_stop_rx(struct uart_port *port)
 Grant> @@ -200,17 +200,17 @@ static int ulite_startup(struct uart_port *port)
 Grant>  	if (ret)
 Grant>  		return ret;
 
 Grant> -	writeb(ULITE_CONTROL_RST_RX | ULITE_CONTROL_RST_TX,
 Grant> -	       port->membase + ULITE_CONTROL);
 Grant> -	writeb(ULITE_CONTROL_IE, port->membase + ULITE_CONTROL);
 Grant> +	out_be32((void*)port->membase + ULITE_CONTROL,
 Grant> +	         ULITE_CONTROL_RST_RX | ULITE_CONTROL_RST_TX);
 Grant> +	out_be32((void*)port->membase + ULITE_CONTROL, ULITE_CONTROL_IE);
 
 Grant>  	return 0;
 Grant>  }
 
 Grant>  static void ulite_shutdown(struct uart_port *port)
 Grant>  {
 Grant> -	writeb(0, port->membase + ULITE_CONTROL);
 Grant> -	readb(port->membase + ULITE_CONTROL); /* dummy */
 Grant> +	out_be32((void*)port->membase + ULITE_CONTROL, 0);
 Grant> +	in_be32((void*)port->membase + ULITE_CONTROL); /* dummy */
 Grant>  	free_irq(port->irq, port);
 Grant>  }
 
 Grant> @@ -314,7 +314,7 @@ static void ulite_console_wait_tx(struct uart_port *port)
 
 Grant>  	/* wait up to 10ms for the character(s) to be sent */
 Grant>  	for (i = 0; i < 10000; i++) {
 Grant> -		if (readb(port->membase + ULITE_STATUS) & ULITE_STATUS_TXEMPTY)
 Grant> +		if (in_be32((void*)port->membase + ULITE_STATUS) & ULITE_STATUS_TXEMPTY)
 Grant>  			break;
 Grant>  		udelay(1);
 Grant>  	}
 Grant> @@ -323,7 +323,7 @@ static void ulite_console_wait_tx(struct uart_port *port)
 Grant>  static void ulite_console_putchar(struct uart_port *port, int ch)
 Grant>  {
 Grant>  	ulite_console_wait_tx(port);
 Grant> -	writeb(ch, port->membase + ULITE_TX);
 Grant> +	out_be32((void*)port->membase + ULITE_TX, ch);
 Grant>  }
 
 Grant>  static void ulite_console_write(struct console *co, const char *s,
 Grant> @@ -340,8 +340,8 @@ static void ulite_console_write(struct console *co, const char *s,
 Grant>  		spin_lock_irqsave(&port->lock, flags);
 
 Grant>  	/* save and disable interrupt */
 Grant> -	ier = readb(port->membase + ULITE_STATUS) & ULITE_STATUS_IE;
 Grant> -	writeb(0, port->membase + ULITE_CONTROL);
 Grant> +	ier = in_be32((void*)port->membase + ULITE_STATUS) & ULITE_STATUS_IE;
 Grant> +	out_be32((void*)port->membase + ULITE_CONTROL, 0);
 
 Grant>  	uart_console_write(port, s, count, ulite_console_putchar);
 
 Grant> @@ -349,7 +349,7 @@ static void ulite_console_write(struct console *co, const char *s,
 
 Grant>  	/* restore interrupt state */
 Grant>  	if (ier)
 Grant> -		writeb(ULITE_CONTROL_IE, port->membase + ULITE_CONTROL);
 Grant> +		out_be32((void*)port->membase + ULITE_CONTROL, ULITE_CONTROL_IE);
 
 Grant>  	if (locked)
 Grant>  		spin_unlock_irqrestore(&port->lock, flags);


-- 
Bye, Peter Korsgaard

^ permalink raw reply

* Re: [PATCH 08/18] Uartlite: Add macro for uartlite device name
From: Grant Likely @ 2007-10-02 15:34 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: linuxppc-dev
In-Reply-To: <87ejgd356y.fsf@macbook.be.48ers.dk>

On 10/2/07, Peter Korsgaard <jacmet@sunsite.dk> wrote:
> >>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:
>
> Hi,
>
>  Grant> From: Grant Likely <grant.likely@secretlab.ca>
>  Grant> Changed to make the OF bus binding a wee bit cleaner
>
>  Grant> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
>  Grant> ---
>
>  Grant>  arch/powerpc/platforms/40x/Kconfig |    4 ++--
>  Grant>  drivers/serial/uartlite.c          |    5 +++--
>  Grant>  2 files changed, 5 insertions(+), 4 deletions(-)
>
>  Grant> diff --git a/arch/powerpc/platforms/40x/Kconfig b/arch/powerpc/platforms/40x/Kconfig
>  Grant> index 1aae0e6..44f08dd 100644
>  Grant> --- a/arch/powerpc/platforms/40x/Kconfig
>  Grant> +++ b/arch/powerpc/platforms/40x/Kconfig
>  Grant> @@ -65,8 +65,8 @@ config XILINX_VIRTEX_GENERIC_BOARD
>  Grant>         bool "Generic Xilinx Virtex board"
>  Grant>         depends on 40x
>  Grant>         default y
>  Grant> -       select VIRTEX_II_PRO
>  Grant> -       select VIRTEX_4_FX
>  Grant> +       select XILINX_VIRTEX_II_PRO
>  Grant> +       select XILINX_VIRTEX_4_FX
>
> Huh? What does this have to do with $SUBJ?

This was a mess up on my part on this version of the patch set.  v3
has it fixed.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: [PATCH 08/18] Uartlite: Add macro for uartlite device name
From: Peter Korsgaard @ 2007-10-02 15:29 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <20070928181726.18608.73695.stgit@trillian.cg.shawcable.net>

>>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:

Hi,

 Grant> From: Grant Likely <grant.likely@secretlab.ca>
 Grant> Changed to make the OF bus binding a wee bit cleaner

 Grant> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
 Grant> ---

 Grant>  arch/powerpc/platforms/40x/Kconfig |    4 ++--
 Grant>  drivers/serial/uartlite.c          |    5 +++--
 Grant>  2 files changed, 5 insertions(+), 4 deletions(-)

 Grant> diff --git a/arch/powerpc/platforms/40x/Kconfig b/arch/powerpc/platforms/40x/Kconfig
 Grant> index 1aae0e6..44f08dd 100644
 Grant> --- a/arch/powerpc/platforms/40x/Kconfig
 Grant> +++ b/arch/powerpc/platforms/40x/Kconfig
 Grant> @@ -65,8 +65,8 @@ config XILINX_VIRTEX_GENERIC_BOARD
 Grant>  	bool "Generic Xilinx Virtex board"
 Grant>  	depends on 40x
 Grant>  	default y
 Grant> -	select VIRTEX_II_PRO
 Grant> -	select VIRTEX_4_FX
 Grant> +	select XILINX_VIRTEX_II_PRO
 Grant> +	select XILINX_VIRTEX_4_FX

Huh? What does this have to do with $SUBJ?

 Grant>  	help
 Grant>  	  This option enables generic support for Xilinx Virtex based boards.
 
 Grant> diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
 Grant> index ae05a67..10e0da9 100644
 Grant> --- a/drivers/serial/uartlite.c
 Grant> +++ b/drivers/serial/uartlite.c
 Grant> @@ -18,6 +18,7 @@
 Grant>  #include <linux/interrupt.h>
 Grant>  #include <asm/io.h>
 
 Grant> +#define ULITE_NAME		"ttyUL"
 Grant>  #define ULITE_MAJOR		204
 Grant>  #define ULITE_MINOR		187
 Grant>  #define ULITE_NR_UARTS		4

Otherwise Acked-by: Peter Korsgaard <jacmet@sunsite.dk>

-- 
Bye, Peter Korsgaard

^ permalink raw reply

* Re: [PATCH 07/18] Uartlite: change name of ports to ulite_ports
From: Peter Korsgaard @ 2007-10-02 15:27 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <20070928181718.18608.60984.stgit@trillian.cg.shawcable.net>

>>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:

 Grant> From: Grant Likely <grant.likely@secretlab.ca>
 Grant> Changed to match naming convention used in the rest of the module

Ok.

Acked-by: Peter Korsgaard <jacmet@sunsite.dk>

-- 
Bye, Peter Korsgaard

^ permalink raw reply

* Re: [PATCH 05/18] Add PowerPC Xilinx Virtex entry to maintainers
From: Peter Korsgaard @ 2007-10-02 15:26 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <20070928181627.18608.29878.stgit@trillian.cg.shawcable.net>

>>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:

Hi,
 
 Grant> +LINUX FOR POWERPC EMBEDDED XILINX VIRTEX
 Grant> +P:	Grant Likely
 Grant> +M:	grant.likely@secretlab.ca
 Grant> +W:	http://www.secretlab.ca/

That page doesn't have any Xilinx info. What about 
http://wiki.secretlab.ca/index.php/Linux_on_Xilinx_Virtex instead?

-- 
Bye, Peter Korsgaard

^ permalink raw reply

* Re: [PATCH 10/18] Uartlite: improve in-code comments
From: Peter Korsgaard @ 2007-10-02 15:24 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <20070928181740.18608.67126.stgit@trillian.cg.shawcable.net>

>>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:

 Grant> From: Grant Likely <grant.likely@secretlab.ca>
 Grant> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

Fine by me.

Acked-by: Peter Korsgaard <jacmet@sunsite.dk>

-- 
Bye, Peter Korsgaard

^ permalink raw reply

* Re: [PATCH 01/18] Virtex: Add uartlite bootwrapper driver
From: Grant Likely @ 2007-10-02 15:12 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: linuxppc-dev
In-Reply-To: <87ve9p36d8.fsf@macbook.be.48ers.dk>

On 10/2/07, Peter Korsgaard <jacmet@sunsite.dk> wrote:
> >>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:
>
> Hi,
>
>  Grant> +static int uartlite_open(void)
>  Grant> +{
>  Grant> +       /* Clear the RX FIFO */
>  Grant> +       out_be32(reg_base + 0x0C, 0x2);
>  Grant> +       return 0;
>  Grant> +}
>  Grant> +
>  Grant> +static void uartlite_putc(unsigned char c)
>  Grant> +{
>  Grant> +       while ((in_be32(reg_base + 0x8) & 0x08) != 0); /* spin */
>  Grant> +       out_be32(reg_base + 0x4, c);
>
> RX, TX, STATUS and CONTROL defines for the registers would be nice for
> readability.

Good idea, I'll add a patch for that

g.


-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: [PATCH 01/18] Virtex: Add uartlite bootwrapper driver
From: Peter Korsgaard @ 2007-10-02 15:04 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <20070928181551.18608.88418.stgit@trillian.cg.shawcable.net>

>>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:

Hi,

 Grant> +static int uartlite_open(void)
 Grant> +{
 Grant> +	/* Clear the RX FIFO */
 Grant> +	out_be32(reg_base + 0x0C, 0x2);
 Grant> +	return 0;
 Grant> +}
 Grant> +
 Grant> +static void uartlite_putc(unsigned char c)
 Grant> +{
 Grant> +	while ((in_be32(reg_base + 0x8) & 0x08) != 0); /* spin */
 Grant> +	out_be32(reg_base + 0x4, c);

RX, TX, STATUS and CONTROL defines for the registers would be nice for
readability.

-- 
Bye, Peter Korsgaard

^ permalink raw reply

* Re: [PATCH] cpm: Describe multi-user ram in its own device node.
From: Timur Tabi @ 2007-10-02 14:49 UTC (permalink / raw)
  To: Kumar Gala; +Cc: PowerPC dev list
In-Reply-To: <AD243886-65DE-4285-ADD3-1D4C5ABA2E3C@kernel.crashing.org>

Kumar Gala wrote:
> 
> On Oct 1, 2007, at 11:10 AM, Scott Wood wrote:
> 
>> Kumar Gala wrote:
>>> On Sep 29, 2007, at 1:49 AM, Vitaly Bordug wrote:
>>>> cpms have dpram, qe has muram. these two are the same stuff in fact. 
>>>> Or you are asking about have QE stuff utilize such a binding at the 
>>>> same pass?
>>> I was asking about both these things.
>>
>> As stated in the commit message, QE can use this; it just needs a 
>> compatible entry in the data node.
> 
> can some one look at that.

Scott's proposal says this:

muram@0 {
	#address-cells = <1>;
	#size-cells = <1>;
	ranges = <0 0 10000>;

	data@0 {
		compatible = "fsl,cpm-muram-data";
		reg = <0 2000 9800 800>;
	};

Currently, the QE has this:

muram@10000 {
	device_type = "muram";
	ranges = <0 00010000 0000c000>;

	data-only@0{
		reg = <0 c000>;
	};
};

The code to process this node is qe_muram_init() in 
arch/powerpc/sysdev/qe_lib/qe.c.

	if ((np = of_find_node_by_name(NULL, "data-only")) != NULL) {
		address = *of_get_address(np, 0, &size, &flags);
		of_node_put(np);
		rh_attach_region(&qe_muram_info,
			(void *)address, (int)size);
	}

I think it would be trivial to modify this code to look for a Scott-style 
muram node.  Heck, it could be modified to look for both, and so we'll 
maintain compatibility.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

^ permalink raw reply


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