From 911a3175997000c1fcddb2013aaa5fbbee79f0f0 Mon Sep 17 00:00:00 2001 From: Grant Likely Date: Wed, 6 Feb 2008 10:23:12 -0700 Subject: [POWERPC] Fix incorrectly tagged __devinitdata structures Fix compile errors in the xilinxfb, xsysace and uartlite drivers used by the Xilinx Virtex platform Signed-off-by: Grant Likely Acked-by: Peter Korsgaard --- drivers/serial/uartlite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/serial/uartlite.c') diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c index 80943409edb..c54a5ad992b 100644 --- a/drivers/serial/uartlite.c +++ b/drivers/serial/uartlite.c @@ -618,7 +618,7 @@ static int __devexit ulite_of_remove(struct of_device *op) } /* Match table for of_platform binding */ -static struct of_device_id __devinit ulite_of_match[] = { +static struct of_device_id ulite_of_match[] __devinitdata = { { .type = "serial", .compatible = "xilinx,uartlite", }, {}, }; -- cgit v1.2.3 From 0e349b0e2d90eb1bb76d16c48d0127feebfeeb89 Mon Sep 17 00:00:00 2001 From: Stephen Neuendorffer Date: Wed, 9 Jan 2008 06:35:05 +1100 Subject: [POWERPC] Xilinx: Update compatible to use values generated by BSP generator. 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 Acked-by: Peter Korsgaard Signed-off-by: Grant Likely --- arch/powerpc/platforms/40x/virtex.c | 2 +- drivers/block/xsysace.c | 4 +++- drivers/serial/uartlite.c | 23 +++++++++++++++-------- drivers/video/xilinxfb.c | 2 +- 4 files changed, 20 insertions(+), 11 deletions(-) (limited to 'drivers/serial/uartlite.c') diff --git a/arch/powerpc/platforms/40x/virtex.c b/arch/powerpc/platforms/40x/virtex.c index 88b66444dfb..0422590040d 100644 --- a/arch/powerpc/platforms/40x/virtex.c +++ b/arch/powerpc/platforms/40x/virtex.c @@ -37,7 +37,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 1110e1b6071..4a7a059ebaf 100644 --- a/drivers/block/xsysace.c +++ b/drivers/block/xsysace.c @@ -1203,7 +1203,9 @@ static int __devexit ace_of_remove(struct of_device *op) /* Match table for of_platform binding */ static struct of_device_id ace_of_match[] __devinitdata = { - { .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 c54a5ad992b..b22023f1ec6 100644 --- a/drivers/serial/uartlite.c +++ b/drivers/serial/uartlite.c @@ -17,10 +17,21 @@ #include #include #include +#include #include #if defined(CONFIG_OF) +#include #include #include + +/* Match table for of_platform binding */ +static struct of_device_id ulite_of_match[] __devinitdata = { + { .compatible = "xlnx,opb-uartlite-1.00.b", }, + { .compatible = "xlnx,xps-uartlite-1.00.a", }, + {} +}; +MODULE_DEVICE_TABLE(of, ulite_of_match); + #endif #define ULITE_NAME "ttyUL" @@ -275,6 +286,9 @@ static void ulite_release_port(struct uart_port *port) static int ulite_request_port(struct uart_port *port) { + pr_debug("ulite console: port=%p; port->mapbase=%x\n", + port, port->mapbase); + if (!request_mem_region(port->mapbase, ULITE_REGION, "uartlite")) { dev_err(port->dev, "Memory region busy\n"); return -EBUSY; @@ -383,7 +397,7 @@ static inline void __init ulite_console_of_find_device(int id) const unsigned int *of_id; int rc; - for_each_compatible_node(np, NULL, "xilinx,uartlite") { + for_each_matching_node(np, ulite_of_match) { of_id = of_get_property(np, "port-number", NULL); if ((!of_id) || (*of_id != id)) continue; @@ -617,13 +631,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 ulite_of_match[] __devinitdata = { - { .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 c92e99eced2..7b3a8423f48 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 xilinxfb_of_match[] __devinitdata = { - { .compatible = "xilinx,ml300-fb", }, + { .compatible = "xlnx,plb-tft-cntlr-ref-1.00.a", }, {}, }; MODULE_DEVICE_TABLE(of, xilinxfb_of_match); -- cgit v1.2.3 From 3de66a175d2014246a2e990412e5750922e5c7d8 Mon Sep 17 00:00:00 2001 From: Grant Likely Date: Wed, 6 Feb 2008 10:23:41 -0700 Subject: [POWERPC] Eliminate broken OF console initialization. Probing of the console at console_initcall time is broken. It tries to call memory allocation routines which aren't initialized yet. Problem solved by removing the early probe entirely. The console init is called again anyway after the uartlite device is initialized and the memory allocation routines can be called safely. Signed-off-by: Grant Likely Acked-by: Peter Korsgaard --- drivers/serial/uartlite.c | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'drivers/serial/uartlite.c') diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c index b22023f1ec6..1a7bccebd50 100644 --- a/drivers/serial/uartlite.c +++ b/drivers/serial/uartlite.c @@ -389,32 +389,6 @@ static void ulite_console_write(struct console *co, const char *s, spin_unlock_irqrestore(&port->lock, flags); } -#if defined(CONFIG_OF) -static inline void __init ulite_console_of_find_device(int id) -{ - struct device_node *np; - struct resource res; - const unsigned int *of_id; - int rc; - - for_each_matching_node(np, ulite_of_match) { - 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; - - ulite_ports[id].mapbase = res.start; - of_node_put(np); - return; - } -} -#else /* CONFIG_OF */ -static inline void __init ulite_console_of_find_device(int id) { /* do nothing */ } -#endif /* CONFIG_OF */ - static int __init ulite_console_setup(struct console *co, char *options) { struct uart_port *port; @@ -428,11 +402,7 @@ static int __init ulite_console_setup(struct console *co, char *options) port = &ulite_ports[co->index]; - /* Check if it is an OF device */ - if (!port->mapbase) - ulite_console_of_find_device(co->index); - - /* Do we have a device now? */ + /* Has the device been initialized yet? */ if (!port->mapbase) { pr_debug("console on ttyUL%i not present\n", co->index); return -ENODEV; -- cgit v1.2.3