* [PATCH 1/7] [POWERPC] Xilinx: Uartlite: Make console output actually work. [not found] <1199820909-32341-1-git-send-email-stephen.neuendorffer@xilinx.com> @ 2008-01-08 19:35 ` Stephen Neuendorffer 2008-01-09 11:20 ` Peter Korsgaard [not found] ` <1199820909-32341-2-git-send-email-stephen.neuendorffer@xilinx.com> 1 sibling, 1 reply; 10+ messages in thread From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw) To: grant.likely, linuxppc-dev, simekm2, jwilliams From: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Fixed to apply against 2.6.24-rc5, and remove DEBUG information. Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> --- drivers/serial/uartlite.c | 121 +++++++++++++++++++++++++++++---------------- 1 files changed, 79 insertions(+), 42 deletions(-) diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c index 3f59324..71e4c0a 100644 --- a/drivers/serial/uartlite.c +++ b/drivers/serial/uartlite.c @@ -9,6 +9,8 @@ * kind, whether express or implied. */ +#undef DEBUG + #include <linux/platform_device.h> #include <linux/module.h> #include <linux/console.h> @@ -321,6 +323,49 @@ static struct uart_ops ulite_ops = { .verify_port = ulite_verify_port }; +/** + * ulite_get_port: Get the uart_port for a given port number and base addr + */ +static struct uart_port *ulite_get_port(int id) +{ + struct uart_port *port; + + /* if id = -1; then scan for a free id and use that */ + if (id < 0) { + for (id = 0; id < ULITE_NR_UARTS; id++) + if (ulite_ports[id].mapbase == 0) + break; + } + + if ((id < 0) || (id >= ULITE_NR_UARTS)) { + printk(KERN_WARNING "uartlite: invalid id: %i\n", id); + return NULL; + } + + /* The ID is valid, so get the address of the uart_port structure */ + port = &ulite_ports[id]; + + /* Is the structure is already initialized? */ + if (port->mapbase) + return port; + + /* At this point, we've got an empty uart_port struct, initialize it */ + spin_lock_init(&port->lock); + port->membase = NULL; + port->fifosize = 16; + port->regshift = 2; + port->iotype = UPIO_MEM; + port->iobase = 1; /* mark port in use */ + port->ops = &ulite_ops; + port->irq = NO_IRQ; + port->flags = UPF_BOOT_AUTOCONF; + port->dev = NULL; + port->type = PORT_UNKNOWN; + port->line = id; + + return port; +} + /* --------------------------------------------------------------------- * Console driver operations */ @@ -376,7 +421,7 @@ static void ulite_console_write(struct console *co, const char *s, } #if defined(CONFIG_OF) -static inline void __init ulite_console_of_find_device(int id) +static inline u32 __init ulite_console_of_find_device(int id) { struct device_node *np; struct resource res; @@ -392,13 +437,14 @@ static inline void __init ulite_console_of_find_device(int id) if (rc) continue; - ulite_ports[id].mapbase = res.start; of_node_put(np); - return; + return res.start+3; } + + return 0; } #else /* CONFIG_OF */ -static inline void __init ulite_console_of_find_device(int id) { /* do nothing */ } +static inline u32 __init ulite_console_of_find_device(int id) { return 0; } #endif /* CONFIG_OF */ static int __init ulite_console_setup(struct console *co, char *options) @@ -408,25 +454,33 @@ static int __init ulite_console_setup(struct console *co, char *options) int bits = 8; int parity = 'n'; int flow = 'n'; + u32 base; - if (co->index < 0 || co->index >= ULITE_NR_UARTS) - return -EINVAL; + /* Find a matching uart port in the device tree */ + base = ulite_console_of_find_device(co->index); - port = &ulite_ports[co->index]; + /* Get the port structure */ + port = ulite_get_port(co->index); + if (!port) + return -ENODEV; - /* Check if it is an OF device */ - if (!port->mapbase) - ulite_console_of_find_device(co->index); + /* was it initialized for this device? */ + if (base) { + if ((port->mapbase) && (port->mapbase != base)) { + pr_debug(KERN_DEBUG "ulite: addr mismatch; %x != %x\n", + port->mapbase, base); + return -ENODEV; /* port used by another device; bail */ + } + port->mapbase = base; + } - /* Do we have a device now? */ - if (!port->mapbase) { - pr_debug("console on ttyUL%i not present\n", co->index); + if (!port->mapbase) return -ENODEV; - } - /* not initialized yet? */ + /* registers mapped yet? */ if (!port->membase) { - if (ulite_request_port(port)) + port->membase = ioremap(port->mapbase, ULITE_REGION); + if (!port->membase) return -ENODEV; } @@ -488,39 +542,22 @@ static int __devinit ulite_assign(struct device *dev, int id, u32 base, int irq) struct uart_port *port; int rc; - /* if id = -1; then scan for a free id and use that */ - if (id < 0) { - for (id = 0; id < ULITE_NR_UARTS; id++) - if (ulite_ports[id].mapbase == 0) - break; - } - if (id < 0 || id >= ULITE_NR_UARTS) { - dev_err(dev, "%s%i too large\n", ULITE_NAME, id); - return -EINVAL; + port = ulite_get_port(id); + if (!port) { + dev_err(dev, "Cannot get uart_port structure\n"); + return -ENODEV; } - if ((ulite_ports[id].mapbase) && (ulite_ports[id].mapbase != base)) { - dev_err(dev, "cannot assign to %s%i; it is already in use\n", - ULITE_NAME, id); - return -EBUSY; + /* was it initialized for this device? */ + if ((port->mapbase) && (port->mapbase != base)) { + pr_debug(KERN_DEBUG "ulite: addr mismatch; %x != %x\n", + port->mapbase, base); + return -ENODEV; } - port = &ulite_ports[id]; - - spin_lock_init(&port->lock); - port->fifosize = 16; - port->regshift = 2; - port->iotype = UPIO_MEM; - port->iobase = 1; /* mark port in use */ port->mapbase = base; - port->membase = NULL; - port->ops = &ulite_ops; port->irq = irq; - port->flags = UPF_BOOT_AUTOCONF; port->dev = dev; - port->type = PORT_UNKNOWN; - port->line = id; - dev_set_drvdata(dev, port); /* Register the port */ -- 1.5.3.4-dirty ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/7] [POWERPC] Xilinx: Uartlite: Make console output actually work. 2008-01-08 19:35 ` [PATCH 1/7] [POWERPC] Xilinx: Uartlite: Make console output actually work Stephen Neuendorffer @ 2008-01-09 11:20 ` Peter Korsgaard 0 siblings, 0 replies; 10+ messages in thread From: Peter Korsgaard @ 2008-01-09 11:20 UTC (permalink / raw) To: Stephen Neuendorffer; +Cc: linuxppc-dev, simekm2 >>>>> "Stephen" == Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> writes: > From: Grant Likely <grant.likely@secretlab.ca> > Signed-off-by: Grant Likely <grant.likely@secretlab.ca> > Fixed to apply against 2.6.24-rc5, and remove DEBUG information. Please CC me and the linux-serial list on uartlite patches. The subject seems to be wrong, as console output works ok here (non-OF). Perhaps change to uartlite: fix OF console setup ? > Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> > --- > drivers/serial/uartlite.c | 121 +++++++++++++++++++++++++++++---------------- > 1 files changed, 79 insertions(+), 42 deletions(-) > diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c > index 3f59324..71e4c0a 100644 > --- a/drivers/serial/uartlite.c > +++ b/drivers/serial/uartlite.c > @@ -9,6 +9,8 @@ > * kind, whether express or implied. > */ > +#undef DEBUG > + Don't do that! What are you trying to do? > #include <linux/platform_device.h> > #include <linux/module.h> > #include <linux/console.h> > @@ -321,6 +323,49 @@ static struct uart_ops ulite_ops = { > .verify_port = ulite_verify_port > }; > +/** > + * ulite_get_port: Get the uart_port for a given port number and base addr > + */ > +static struct uart_port *ulite_get_port(int id) > +{ > + struct uart_port *port; > + > + /* if id = -1; then scan for a free id and use that */ > + if (id < 0) { > + for (id = 0; id < ULITE_NR_UARTS; id++) > + if (ulite_ports[id].mapbase == 0) > + break; > + } > + > + if ((id < 0) || (id >= ULITE_NR_UARTS)) { > + printk(KERN_WARNING "uartlite: invalid id: %i\n", id); pr_warn > + return NULL; > + } > + > + /* The ID is valid, so get the address of the uart_port structure */ > + port = &ulite_ports[id]; > + > + /* Is the structure is already initialized? */ > + if (port->mapbase) > + return port; > + > + /* At this point, we've got an empty uart_port struct, initialize it */ > + spin_lock_init(&port->lock); > + port->membase = NULL; > + port->fifosize = 16; > + port->regshift = 2; > + port->iotype = UPIO_MEM; > + port->iobase = 1; /* mark port in use */ > + port->ops = &ulite_ops; > + port->irq = NO_IRQ; > + port->flags = UPF_BOOT_AUTOCONF; > + port->dev = NULL; > + port->type = PORT_UNKNOWN; > + port->line = id; Please put the above in a conditional istead of 2 returns, E.G. if (!port->mapbase) { spin_lock_init .. > + > + return port; > +} > + > /* --------------------------------------------------------------------- > * Console driver operations > */ > @@ -376,7 +421,7 @@ static void ulite_console_write(struct console *co, const char *s, > } > #if defined(CONFIG_OF) > -static inline void __init ulite_console_of_find_device(int id) > +static inline u32 __init ulite_console_of_find_device(int id) resource_size_t? > { > struct device_node *np; > struct resource res; > @@ -392,13 +437,14 @@ static inline void __init ulite_console_of_find_device(int id) > if (rc) > continue; > - ulite_ports[id].mapbase = res.start; > of_node_put(np); > - return; > + return res.start+3; Are all OF users big endian? > } > + > + return 0; > } > #else /* CONFIG_OF */ > -static inline void __init ulite_console_of_find_device(int id) { /* do nothing */ } > +static inline u32 __init ulite_console_of_find_device(int id) { return 0; } > #endif /* CONFIG_OF */ > static int __init ulite_console_setup(struct console *co, char *options) > @@ -408,25 +454,33 @@ static int __init ulite_console_setup(struct console *co, char *options) > int bits = 8; > int parity = 'n'; > int flow = 'n'; > + u32 base; > - if (co->index < 0 || co->index >= ULITE_NR_UARTS) > - return -EINVAL; > + /* Find a matching uart port in the device tree */ > + base = ulite_console_of_find_device(co->index); > - port = &ulite_ports[co->index]; > + /* Get the port structure */ > + port = ulite_get_port(co->index); > + if (!port) > + return -ENODEV; > - /* Check if it is an OF device */ > - if (!port->mapbase) > - ulite_console_of_find_device(co->index); > + /* was it initialized for this device? */ > + if (base) { I preferred the old way, where it was clearer that this stuff is only done in the OF case, E.G.: /* Check if it is an OF device */ if (!port->mapbase) port->mapbase = ulite_console_of_find_device(co->index); > + if ((port->mapbase) && (port->mapbase != base)) { > + pr_debug(KERN_DEBUG "ulite: addr mismatch; %x != %x\n", > + port->mapbase, base); > + return -ENODEV; /* port used by another device; bail */ You have this both here and in ulite_assign - Couldn't this be moved to ulite_get_port? > + } > + port->mapbase = base; > + } > - /* Do we have a device now? */ > - if (!port->mapbase) { > - pr_debug("console on ttyUL%i not present\n", co->index); > + if (!port->mapbase) > return -ENODEV; > - } > - /* not initialized yet? */ > + /* registers mapped yet? */ > if (!port->membase) { > - if (ulite_request_port(port)) > + port->membase = ioremap(port->mapbase, ULITE_REGION); > + if (!port->membase) > return -ENODEV; Why not use request_port? > } > @@ -488,39 +542,22 @@ static int __devinit ulite_assign(struct device *dev, int id, u32 base, int irq) > struct uart_port *port; > int rc; > - /* if id = -1; then scan for a free id and use that */ > - if (id < 0) { > - for (id = 0; id < ULITE_NR_UARTS; id++) > - if (ulite_ports[id].mapbase == 0) > - break; > - } > - if (id < 0 || id >= ULITE_NR_UARTS) { > - dev_err(dev, "%s%i too large\n", ULITE_NAME, id); > - return -EINVAL; > + port = ulite_get_port(id); > + if (!port) { > + dev_err(dev, "Cannot get uart_port structure\n"); ulite_get_port can only fail in the invalid id case, where a suitable error message has already been printed. This doesn't really add anything. > + return -ENODEV; Why change the error code? > } > - if ((ulite_ports[id].mapbase) && (ulite_ports[id].mapbase != base)) { > - dev_err(dev, "cannot assign to %s%i; it is already in use\n", > - ULITE_NAME, id); > - return -EBUSY; > + /* was it initialized for this device? */ > + if ((port->mapbase) && (port->mapbase != base)) { > + pr_debug(KERN_DEBUG "ulite: addr mismatch; %x != %x\n", > + port->mapbase, base); > + return -ENODEV; Why change the error message? I found the old better. Also use dev_err istead of pr_debug. You again changed the error code. > } > - port = &ulite_ports[id]; > - > - spin_lock_init(&port->lock); > - port->fifosize = 16; > - port->regshift = 2; > - port->iotype = UPIO_MEM; > - port->iobase = 1; /* mark port in use */ port-> mapbase = base; > - port->membase = NULL; > - port->ops = &ulite_ops; port-> irq = irq; > - port->flags = UPF_BOOT_AUTOCONF; port-> dev = dev; > - port->type = PORT_UNKNOWN; > - port->line = id; > - > dev_set_drvdata(dev, port); > /* Register the port */ > -- > 1.5.3.4-dirty > _______________________________________________ > Linuxppc-dev mailing list > Linuxppc-dev@ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc-dev -- Bye, Peter Korsgaard ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <1199820909-32341-2-git-send-email-stephen.neuendorffer@xilinx.com>]
* [PATCH 2/7] [POWERPC] Xilinx: update compatible list for interrupt controller [not found] ` <1199820909-32341-2-git-send-email-stephen.neuendorffer@xilinx.com> @ 2008-01-08 19:35 ` Stephen Neuendorffer [not found] ` <1199820909-32341-3-git-send-email-stephen.neuendorffer@xilinx.com> 1 sibling, 0 replies; 10+ messages in thread From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw) To: grant.likely, linuxppc-dev, simekm2, jwilliams These values now match what is generated by the uboot BSP generator. Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> --- arch/powerpc/sysdev/xilinx_intc.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/sysdev/xilinx_intc.c b/arch/powerpc/sysdev/xilinx_intc.c index c2f17cc..ba8eea2 100644 --- a/arch/powerpc/sysdev/xilinx_intc.c +++ b/arch/powerpc/sysdev/xilinx_intc.c @@ -135,10 +135,16 @@ void __init xilinx_intc_init_tree(void) struct device_node *np; /* find top level interrupt controller */ - for_each_compatible_node(np, NULL, "xilinx,intc") { + for_each_compatible_node(np, NULL, "xlnx,opb-intc-1.00.c") { if (!of_get_property(np, "interrupts", NULL)) break; } + if (!np) { + for_each_compatible_node(np, NULL, "xlnx,xps-intc-1.00.a") { + if (!of_get_property(np, "interrupts", NULL)) + break; + } + } /* xilinx interrupt controller needs to be top level */ BUG_ON(!np); -- 1.5.3.4-dirty ^ permalink raw reply related [flat|nested] 10+ messages in thread
[parent not found: <1199820909-32341-3-git-send-email-stephen.neuendorffer@xilinx.com>]
* [PATCH 3/7] [POWERPC] Xilinx: Update compatible to use values generated by BSP generator. [not found] ` <1199820909-32341-3-git-send-email-stephen.neuendorffer@xilinx.com> @ 2008-01-08 19:35 ` Stephen Neuendorffer [not found] ` <1199820909-32341-4-git-send-email-stephen.neuendorffer@xilinx.com> 1 sibling, 0 replies; 10+ messages in thread From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw) To: grant.likely, linuxppc-dev, simekm2, jwilliams Mainly, this involves two changes: 1) xilinx->xlnx (recognized standard is to use the stock ticker) 2) In order to have the device tree focus on describing what the hardware is as exactly as possible, the compatible strings contain the full IP name and IP version. Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> --- arch/powerpc/platforms/40x/virtex.c | 2 +- drivers/block/xsysace.c | 4 ++- drivers/serial/uartlite.c | 43 ++++++++++++++++++++++------------- drivers/video/xilinxfb.c | 2 +- 4 files changed, 32 insertions(+), 19 deletions(-) diff --git a/arch/powerpc/platforms/40x/virtex.c b/arch/powerpc/platforms/40x/virtex.c index 14bbc32..859ba1d 100644 --- a/arch/powerpc/platforms/40x/virtex.c +++ b/arch/powerpc/platforms/40x/virtex.c @@ -30,7 +30,7 @@ static int __init virtex_probe(void) { unsigned long root = of_get_flat_dt_root(); - if (!of_flat_dt_is_compatible(root, "xilinx,virtex")) + if (!of_flat_dt_is_compatible(root, "xlnx,virtex")) return 0; return 1; diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c index 82effce..45bc51b 100644 --- a/drivers/block/xsysace.c +++ b/drivers/block/xsysace.c @@ -1208,7 +1208,9 @@ static int __devexit ace_of_remove(struct of_device *op) /* Match table for of_platform binding */ static struct of_device_id __devinit ace_of_match[] = { - { .compatible = "xilinx,xsysace", }, + { .compatible = "xlnx,opb-sysace-1.00.b", }, + { .compatible = "xlnx,opb-sysace-1.00.c", }, + { .compatible = "xlnx,xps-sysace-1.00.a", }, {}, }; MODULE_DEVICE_TABLE(of, ace_of_match); diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c index 71e4c0a..02c2d89 100644 --- a/drivers/serial/uartlite.c +++ b/drivers/serial/uartlite.c @@ -19,10 +19,21 @@ #include <linux/tty.h> #include <linux/delay.h> #include <linux/interrupt.h> +#include <linux/init.h> #include <asm/io.h> #if defined(CONFIG_OF) +#include <linux/of.h> #include <linux/of_device.h> #include <linux/of_platform.h> + +/* Match table for of_platform binding */ +static struct of_device_id __devinitdata ulite_of_match[] = { + { .type = "serial", .compatible = "xlnx,opb-uartlite-1.00.b", }, + { .type = "serial", .compatible = "xlnx,xps-uartlite-1.00.a", }, + {}, +}; +MODULE_DEVICE_TABLE(of, ulite_of_match); + #endif #define ULITE_NAME "ttyUL" @@ -427,18 +438,25 @@ static inline u32 __init ulite_console_of_find_device(int id) struct resource res; const unsigned int *of_id; int rc; + const struct of_device_id *matches = ulite_of_match; + + while (matches->compatible[0]) { + for_each_compatible_node(np, NULL, matches->compatible) { + if (!of_match_node(matches, np)) + continue; - for_each_compatible_node(np, NULL, "xilinx,uartlite") { - of_id = of_get_property(np, "port-number", NULL); - if ((!of_id) || (*of_id != id)) - continue; + of_id = of_get_property(np, "port-number", NULL); + if ((!of_id) || (*of_id != id)) + continue; - rc = of_address_to_resource(np, 0, &res); - if (rc) - continue; + rc = of_address_to_resource(np, 0, &res); + if (rc) + continue; - of_node_put(np); - return res.start+3; + of_node_put(np); + return res.start+3; + } + matches++; } return 0; @@ -654,13 +672,6 @@ static int __devexit ulite_of_remove(struct of_device *op) return ulite_release(&op->dev); } -/* Match table for of_platform binding */ -static struct of_device_id __devinit ulite_of_match[] = { - { .type = "serial", .compatible = "xilinx,uartlite", }, - {}, -}; -MODULE_DEVICE_TABLE(of, ulite_of_match); - static struct of_platform_driver ulite_of_driver = { .owner = THIS_MODULE, .name = "uartlite", diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c index e38d3b7..9b426d3 100644 --- a/drivers/video/xilinxfb.c +++ b/drivers/video/xilinxfb.c @@ -460,7 +460,7 @@ static int __devexit xilinxfb_of_remove(struct of_device *op) /* Match table for of_platform binding */ static struct of_device_id __devinit xilinxfb_of_match[] = { - { .compatible = "xilinx,ml300-fb", }, + { .compatible = "xlnx,plb-tft-cntlr-ref-1.00.a", }, {}, }; MODULE_DEVICE_TABLE(of, xilinxfb_of_match); -- 1.5.3.4-dirty ^ permalink raw reply related [flat|nested] 10+ messages in thread
[parent not found: <1199820909-32341-4-git-send-email-stephen.neuendorffer@xilinx.com>]
* [PATCH 4/7] [POWERPC] Xilinx: Add correct compatible list for device tree bus bindings. [not found] ` <1199820909-32341-4-git-send-email-stephen.neuendorffer@xilinx.com> @ 2008-01-08 19:35 ` Stephen Neuendorffer 2008-01-09 0:55 ` Stephen Rothwell [not found] ` <1199820909-32341-5-git-send-email-stephen.neuendorffer@xilinx.com> 1 sibling, 1 reply; 10+ messages in thread From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw) To: grant.likely, linuxppc-dev, simekm2, jwilliams Includes both flavors of plb, opb, dcr, and a pseudo 'compound' bus for representing compound peripherals containing more than one logical device. Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> --- arch/powerpc/platforms/40x/virtex.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/platforms/40x/virtex.c b/arch/powerpc/platforms/40x/virtex.c index 859ba1d..7590fa5 100644 --- a/arch/powerpc/platforms/40x/virtex.c +++ b/arch/powerpc/platforms/40x/virtex.c @@ -15,12 +15,22 @@ #include <asm/time.h> #include <asm/xilinx_intc.h> +static struct of_device_id xilinx_of_bus_ids[] = { + { .compatible = "xlnx,plb-v46-1.00.a", }, + { .compatible = "xlnx,plb-v34-1.01.a", }, + { .compatible = "xlnx,plb-v34-1.02.a", }, + { .compatible = "xlnx,opb-v20-1.10.c", }, + { .compatible = "xlnx,dcr-v29-1.00.a", }, + { .compatible = "xlnx,compound", }, + {}, +}; + static int __init virtex_device_probe(void) { if (!machine_is(virtex)) return 0; - of_platform_bus_probe(NULL, NULL, NULL); + of_platform_bus_probe(NULL, xilinx_of_bus_ids, NULL); return 0; } -- 1.5.3.4-dirty ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 4/7] [POWERPC] Xilinx: Add correct compatible list for device tree bus bindings. 2008-01-08 19:35 ` [PATCH 4/7] [POWERPC] Xilinx: Add correct compatible list for device tree bus bindings Stephen Neuendorffer @ 2008-01-09 0:55 ` Stephen Rothwell 0 siblings, 0 replies; 10+ messages in thread From: Stephen Rothwell @ 2008-01-09 0:55 UTC (permalink / raw) To: Stephen Neuendorffer; +Cc: linuxppc-dev, simekm2 [-- Attachment #1: Type: text/plain, Size: 305 bytes --] Hi Stephen, On Tue, 8 Jan 2008 11:35:06 -0800 Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> wrote: > > +static struct of_device_id xilinx_of_bus_ids[] = { Should be __initdata. -- Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <1199820909-32341-5-git-send-email-stephen.neuendorffer@xilinx.com>]
* [PATCH 5/7] [POWERPC] Xilinx: Update booting-without-of. [not found] ` <1199820909-32341-5-git-send-email-stephen.neuendorffer@xilinx.com> @ 2008-01-08 19:35 ` Stephen Neuendorffer [not found] ` <1199820909-32341-6-git-send-email-stephen.neuendorffer@xilinx.com> 1 sibling, 0 replies; 10+ messages in thread From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw) To: grant.likely, linuxppc-dev, simekm2, jwilliams This now better describes what the UBoot device tree generator actually does. In particular: 1) Nodes have a label derived from the device name, and a node name derived from a generic version of the device type, e.g. 'ethernet', 'serial', etc. 2) Usage of compound nodes (representing more than one device in the same IP) which actually works. This requires having a valid compatible node, and all the other things that a bus normally has. I've chosen 'xlnx,compound' as the bus name to describe these compound nodes. In addition, I've clarified some of the language relating to how mhs nodes should be represent in the device tree. Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> --- Documentation/powerpc/booting-without-of.txt | 56 +++++++++++++++----------- 1 files changed, 33 insertions(+), 23 deletions(-) diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt index e9a3cb1..d14e45d 100644 --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/powerpc/booting-without-of.txt @@ -2276,7 +2276,7 @@ platforms are moved over to use the flattened-device-tree model. properties of the device node. In general, device nodes for IP-cores will take the following form: - (name)@(base-address) { + (name): (generic-name)@(base-address) { compatible = "xlnx,(ip-core-name)-(HW_VER)" [, (list of compatible devices), ...]; reg = <(baseaddr) (size)>; @@ -2286,6 +2286,9 @@ platforms are moved over to use the flattened-device-tree model. xlnx,(parameter2) = <(int-value)>; }; + (generic-name): an open firmware-style name that describes the + generic class of device. Preferably, this is one word, such + as 'serial' or 'ethernet'. (ip-core-name): the name of the ip block (given after the BEGIN directive in system.mhs). Should be in lowercase and all underscores '_' converted to dashes '-'. @@ -2294,9 +2297,9 @@ platforms are moved over to use the flattened-device-tree model. dropped from the parameter name, the name is converted to lowercase and all underscore '_' characters are converted to dashes '-'. - (baseaddr): the C_BASEADDR parameter. + (baseaddr): the baseaddr parameter value (often named C_BASEADDR). (HW_VER): from the HW_VER parameter. - (size): equals C_HIGHADDR - C_BASEADDR + 1 + (size): the address range size (often C_HIGHADDR - C_BASEADDR + 1). Typically, the compatible list will include the exact IP core version followed by an older IP core version which implements the same @@ -2326,11 +2329,11 @@ platforms are moved over to use the flattened-device-tree model. becomes the following device tree node: - opb-uartlite-0@ec100000 { + opb_uartlite_0: serial@ec100000 { device_type = "serial"; compatible = "xlnx,opb-uartlite-1.00.b"; reg = <ec100000 10000>; - interrupt-parent = <&opb-intc>; + interrupt-parent = <&opb_intc_0>; interrupts = <1 0>; // got this from the opb_intc parameters current-speed = <d#115200>; // standard serial device prop clock-frequency = <d#50000000>; // standard serial device prop @@ -2339,16 +2342,19 @@ platforms are moved over to use the flattened-device-tree model. xlnx,use-parity = <0>; }; - Some IP cores actually implement 2 or more logical devices. In this case, - the device should still describe the whole IP core with a single node - and add a child node for each logical device. The ranges property can - be used to translate from parent IP-core to the registers of each device. - (Note: this makes the assumption that both logical devices have the same - bus binding. If this is not true, then separate nodes should be used for - each logical device). The 'cell-index' property can be used to enumerate - logical devices within an IP core. For example, the following is the - system.mhs entry for the dual ps2 controller found on the ml403 reference - design. + Some IP cores actually implement 2 or more logical devices. In + this case, the device should still describe the whole IP core with + a single node and add a child node for each logical device. The + ranges property can be used to translate from parent IP-core to the + registers of each device. In addition, the parent node should be + compatible with the bus type 'xlnx,compound', and should contain + #address-cells and #size-cells, as with any other bus. (Note: this + makes the assumption that both logical devices have the same bus + binding. If this is not true, then separate nodes should be used + for each logical device). The 'cell-index' property can be used to + enumerate logical devices within an IP core. For example, the + following is the system.mhs entry for the dual ps2 controller found + on the ml403 reference design. BEGIN opb_ps2_dual_ref PARAMETER INSTANCE = opb_ps2_dual_ref_0 @@ -2370,21 +2376,24 @@ platforms are moved over to use the flattened-device-tree model. It would result in the following device tree nodes: - opb_ps2_dual_ref_0@a9000000 { + opb_ps2_dual_ref_0: opb-ps2-dual-ref@a9000000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "xlnx,compound"; ranges = <0 a9000000 2000>; // If this device had extra parameters, then they would // go here. ps2@0 { compatible = "xlnx,opb-ps2-dual-ref-1.00.a"; reg = <0 40>; - interrupt-parent = <&opb-intc>; + interrupt-parent = <&opb_intc_0>; interrupts = <3 0>; cell-index = <0>; }; ps2@1000 { compatible = "xlnx,opb-ps2-dual-ref-1.00.a"; reg = <1000 40>; - interrupt-parent = <&opb-intc>; + interrupt-parent = <&opb_intc_0>; interrupts = <3 0>; cell-index = <0>; }; @@ -2447,17 +2456,18 @@ platforms are moved over to use the flattened-device-tree model. Gives this device tree (some properties removed for clarity): - plb-v34-0 { + plb@0 { #address-cells = <1>; #size-cells = <1>; + compatible = "xlnx,plb-v34-1.02.a"; device_type = "ibm,plb"; ranges; // 1:1 translation - plb-bram-if-cntrl-0@ffff0000 { + plb_bram_if_cntrl_0: bram@ffff0000 { reg = <ffff0000 10000>; } - opb-v20-0 { + opb@20000000 { #address-cells = <1>; #size-cells = <1>; ranges = <20000000 20000000 20000000 @@ -2465,11 +2475,11 @@ platforms are moved over to use the flattened-device-tree model. 80000000 80000000 40000000 c0000000 c0000000 20000000>; - opb-uart16550-0@a0000000 { + opb_uart16550_0: serial@a0000000 { reg = <a00000000 2000>; }; - opb-intc-0@d1000fc0 { + opb_intc_0: interrupt-controller@d1000fc0 { reg = <d1000fc0 20>; }; }; -- 1.5.3.4-dirty ^ permalink raw reply related [flat|nested] 10+ messages in thread
[parent not found: <1199820909-32341-6-git-send-email-stephen.neuendorffer@xilinx.com>]
* [PATCH 6/7] [POWERPC] Xilinx: updated device tree compatibility to match uboot bsp generator. [not found] ` <1199820909-32341-6-git-send-email-stephen.neuendorffer@xilinx.com> @ 2008-01-08 19:35 ` Stephen Neuendorffer [not found] ` <1199820909-32341-7-git-send-email-stephen.neuendorffer@xilinx.com> 1 sibling, 0 replies; 10+ messages in thread From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw) To: grant.likely, linuxppc-dev, simekm2, jwilliams Missed this one in the boot loader before. Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> --- arch/powerpc/boot/serial.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c index cafeece..b6c68ef 100644 --- a/arch/powerpc/boot/serial.c +++ b/arch/powerpc/boot/serial.c @@ -128,7 +128,8 @@ int serial_console_init(void) rc = cpm_console_init(devp, &serial_cd); else if (dt_is_compatible(devp, "mpc5200-psc-uart")) rc = mpc5200_psc_console_init(devp, &serial_cd); - else if (dt_is_compatible(devp, "xilinx,uartlite")) + else if (dt_is_compatible(devp, "xlnx,opb-uartlite-1.00.b") || + dt_is_compatible(devp, "xlnx,xps-uartlite-1.00.a")) rc = uartlite_console_init(devp, &serial_cd); /* Add other serial console driver calls here */ -- 1.5.3.4-dirty ^ permalink raw reply related [flat|nested] 10+ messages in thread
[parent not found: <1199820909-32341-7-git-send-email-stephen.neuendorffer@xilinx.com>]
* [PATCH 7/7] [POWERPC] Xilinx: Uartlite: Section type fixups [not found] ` <1199820909-32341-7-git-send-email-stephen.neuendorffer@xilinx.com> @ 2008-01-08 19:35 ` Stephen Neuendorffer 2008-01-09 11:24 ` Peter Korsgaard 0 siblings, 1 reply; 10+ messages in thread From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw) To: grant.likely, linuxppc-dev, simekm2, jwilliams All the __devexit functions are now appropriately tagged. This fixes some ppc link warnings. Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> --- drivers/serial/uartlite.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c index 02c2d89..ecd5540 100644 --- a/drivers/serial/uartlite.c +++ b/drivers/serial/uartlite.c @@ -594,7 +594,7 @@ static int __devinit ulite_assign(struct device *dev, int id, u32 base, int irq) * * @dev: pointer to device structure */ -static int __devinit ulite_release(struct device *dev) +static int __devexit ulite_release(struct device *dev) { struct uart_port *port = dev_get_drvdata(dev); int rc = 0; @@ -627,7 +627,7 @@ static int __devinit ulite_probe(struct platform_device *pdev) return ulite_assign(&pdev->dev, pdev->id, res->start, res2->start); } -static int ulite_remove(struct platform_device *pdev) +static int __devexit ulite_remove(struct platform_device *pdev) { return ulite_release(&pdev->dev); } -- 1.5.3.4-dirty ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 7/7] [POWERPC] Xilinx: Uartlite: Section type fixups 2008-01-08 19:35 ` [PATCH 7/7] [POWERPC] Xilinx: Uartlite: Section type fixups Stephen Neuendorffer @ 2008-01-09 11:24 ` Peter Korsgaard 0 siblings, 0 replies; 10+ messages in thread From: Peter Korsgaard @ 2008-01-09 11:24 UTC (permalink / raw) To: Stephen Neuendorffer; +Cc: linuxppc-dev, simekm2 >>>>> "Stephen" == Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> writes: Stephen> All the __devexit functions are now appropriately tagged. This fixes Stephen> some ppc link warnings. You forgot to add __devexit_p(ulite_remove) in ulite_platform_driver, otherwise: Acked-by: Peter Korsgaard <jacmet@sunsite.dk> Stephen> Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> Stephen> --- Stephen> drivers/serial/uartlite.c | 4 ++-- Stephen> 1 files changed, 2 insertions(+), 2 deletions(-) Stephen> diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c Stephen> index 02c2d89..ecd5540 100644 Stephen> --- a/drivers/serial/uartlite.c Stephen> +++ b/drivers/serial/uartlite.c Stephen> @@ -594,7 +594,7 @@ static int __devinit ulite_assign(struct device *dev, int id, u32 base, int irq) Stephen> * Stephen> * @dev: pointer to device structure Stephen> */ Stephen> -static int __devinit ulite_release(struct device *dev) Stephen> +static int __devexit ulite_release(struct device *dev) Stephen> { Stephen> struct uart_port *port = dev_get_drvdata(dev); Stephen> int rc = 0; Stephen> @@ -627,7 +627,7 @@ static int __devinit ulite_probe(struct platform_device *pdev) Stephen> return ulite_assign(&pdev->dev, pdev->id, res->start, res2->start); Stephen> } Stephen> -static int ulite_remove(struct platform_device *pdev) Stephen> +static int __devexit ulite_remove(struct platform_device *pdev) Stephen> { Stephen> return ulite_release(&pdev->dev); Stephen> } Stephen> -- Stephen> 1.5.3.4-dirty Stephen> _______________________________________________ Stephen> Linuxppc-dev mailing list Stephen> Linuxppc-dev@ozlabs.org Stephen> https://ozlabs.org/mailman/listinfo/linuxppc-dev -- Bye, Peter Korsgaard ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2008-01-09 11:24 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <1199820909-32341-1-git-send-email-stephen.neuendorffer@xilinx.com> 2008-01-08 19:35 ` [PATCH 1/7] [POWERPC] Xilinx: Uartlite: Make console output actually work Stephen Neuendorffer 2008-01-09 11:20 ` Peter Korsgaard [not found] ` <1199820909-32341-2-git-send-email-stephen.neuendorffer@xilinx.com> 2008-01-08 19:35 ` [PATCH 2/7] [POWERPC] Xilinx: update compatible list for interrupt controller Stephen Neuendorffer [not found] ` <1199820909-32341-3-git-send-email-stephen.neuendorffer@xilinx.com> 2008-01-08 19:35 ` [PATCH 3/7] [POWERPC] Xilinx: Update compatible to use values generated by BSP generator Stephen Neuendorffer [not found] ` <1199820909-32341-4-git-send-email-stephen.neuendorffer@xilinx.com> 2008-01-08 19:35 ` [PATCH 4/7] [POWERPC] Xilinx: Add correct compatible list for device tree bus bindings Stephen Neuendorffer 2008-01-09 0:55 ` Stephen Rothwell [not found] ` <1199820909-32341-5-git-send-email-stephen.neuendorffer@xilinx.com> 2008-01-08 19:35 ` [PATCH 5/7] [POWERPC] Xilinx: Update booting-without-of Stephen Neuendorffer [not found] ` <1199820909-32341-6-git-send-email-stephen.neuendorffer@xilinx.com> 2008-01-08 19:35 ` [PATCH 6/7] [POWERPC] Xilinx: updated device tree compatibility to match uboot bsp generator Stephen Neuendorffer [not found] ` <1199820909-32341-7-git-send-email-stephen.neuendorffer@xilinx.com> 2008-01-08 19:35 ` [PATCH 7/7] [POWERPC] Xilinx: Uartlite: Section type fixups Stephen Neuendorffer 2008-01-09 11:24 ` Peter Korsgaard
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).