[PATCH] Handle reg-shift property for of_serial ports

David Woodhouse dwmw2 at infradead.org
Sat Jul 7 14:58:28 EST 2007


The MV64660 has reg-shift==2 for its otherwise 16550-compatible uarts.
While the bootwrapper copes with this, of_serial.c doesn't. (The udbg
code doesn't either, but I'll fix that later).

Signed-off-by: David Woodhouse <dwmw2 at infradead.org>

diff --git a/drivers/serial/of_serial.c b/drivers/serial/of_serial.c
index 7ffdaea..0761ff9 100644
--- a/drivers/serial/of_serial.c
+++ b/drivers/serial/of_serial.c
@@ -25,12 +25,13 @@ static int __devinit of_platform_serial_setup(struct of_device *ofdev,
 {
 	struct resource resource;
 	struct device_node *np = ofdev->node;
-	const unsigned int *clk, *spd;
+	const unsigned int *clk, *spd, *rs;
 	int ret;
 
 	memset(port, 0, sizeof *port);
 	spd = of_get_property(np, "current-speed", NULL);
 	clk = of_get_property(np, "clock-frequency", NULL);
+	rs = of_get_property(np, "reg-shift", NULL);
 	if (!clk) {
 		dev_warn(&ofdev->dev, "no clock-frequency property set\n");
 		return -ENODEV;
@@ -48,6 +49,8 @@ static int __devinit of_platform_serial_setup(struct of_device *ofdev,
 	port->iotype = UPIO_MEM;
 	port->type = type;
 	port->uartclk = *clk;
+	if (rs)
+		port->regshift = *rs;
 	port->flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP
 		| UPF_FIXED_PORT;
 	port->dev = &ofdev->dev;


-- 
dwmw2




More information about the Linuxppc-dev mailing list