From c96fe58356f50c239798a128a4d3f528ec40bf6c Mon Sep 17 00:00:00 2001 From: John Linn Date: Thu, 3 Apr 2008 10:22:19 +1100 Subject: [PATCH] --- yaml --- r: 93473 b: refs/heads/master c: b912b5e2cfb35c02c9c79d3f6e31753f3be4dd83 h: refs/heads/master i: 93471: 1e87f011f2d0f63bb2be9b0a221d3ed43f39a425 v: v3 --- [refs] | 2 +- trunk/Documentation/powerpc/booting-without-of.txt | 11 +++++++++++ trunk/drivers/serial/of_serial.c | 14 +++++++++++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index ca146f17a014..ed8363743eeb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2f0b45f846735b486c0383740d3959941c4721a4 +refs/heads/master: b912b5e2cfb35c02c9c79d3f6e31753f3be4dd83 diff --git a/trunk/Documentation/powerpc/booting-without-of.txt b/trunk/Documentation/powerpc/booting-without-of.txt index 4cc780024e6c..cf89e8cfd5bf 100644 --- a/trunk/Documentation/powerpc/booting-without-of.txt +++ b/trunk/Documentation/powerpc/booting-without-of.txt @@ -2601,6 +2601,17 @@ platforms are moved over to use the flattened-device-tree model. differ between different families. May be 'virtex2p', 'virtex4', or 'virtex5'. + vi) Xilinx Uart 16550 + + Xilinx UART 16550 devices are very similar to the NS16550 but with + different register spacing and an offset from the base address. + + Requred properties: + - clock-frequency : Frequency of the clock input + - reg-offset : A value of 3 is required + - reg-shift : A value of 2 is required + + p) Freescale Synchronous Serial Interface The SSI is a serial device that communicates with audio codecs. It can diff --git a/trunk/drivers/serial/of_serial.c b/trunk/drivers/serial/of_serial.c index 8aacfb78deab..25029c7570b6 100644 --- a/trunk/drivers/serial/of_serial.c +++ b/trunk/drivers/serial/of_serial.c @@ -31,7 +31,8 @@ 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; - int ret; + const u32 *prop; + int ret, prop_size; memset(port, 0, sizeof *port); spd = of_get_property(np, "current-speed", NULL); @@ -49,6 +50,17 @@ static int __devinit of_platform_serial_setup(struct of_device *ofdev, spin_lock_init(&port->lock); port->mapbase = resource.start; + + /* Check for shifted address mapping */ + prop = of_get_property(np, "reg-offset", &prop_size); + if (prop && (prop_size == sizeof(u32))) + port->mapbase += *prop; + + /* Check for registers offset within the devices address range */ + prop = of_get_property(np, "reg-shift", &prop_size); + if (prop && (prop_size == sizeof(u32))) + port->regshift = *prop; + port->irq = irq_of_parse_and_map(np, 0); port->iotype = UPIO_MEM; port->type = type;