Initial PXA DT bindings
Subsystems (5)
cover Initial PXA DT bindings
This patchset starts effort to convert PXA machines to DT. I started with PXA UART driver and added a stub machine, which I plan to eventually rename to board-pxa-dt when ready.
The file in patch 0002 contains style errors (line over 80), because they are 1 character over. To avoid crippling readability, I left that as is.
Marek Vasut (3):
ARM: pxa: Add DT support to pxa2xx-uart
ARM: pxa: Add DT testing machine
ARM: pxa: Add basic DTS files for PXA/Vpac270 testing machine
arch/arm/boot/dts/pxa-vpac270.dts | 37 +++++++++++++++++ arch/arm/boot/dts/pxa.dtsi | 72 ++++++++++++++++++++++++++++++++ arch/arm/mach-pxa/Kconfig | 15 +++++++ arch/arm/mach-pxa/Makefile | 3 + arch/arm/mach-pxa/vpac270-dt.c | 82 +++++++++++++++++++++++++++++++++++++ drivers/tty/serial/pxa.c | 50 +++++++++++++++++++++- 6 files changed, 256 insertions(+), 3 deletions(-) create mode 100644 arch/arm/boot/dts/pxa-vpac270.dts create mode 100644 arch/arm/boot/dts/pxa.dtsi create mode 100644 arch/arm/mach-pxa/vpac270-dt.c
Signature · 1 line
1.7.6.3
PATCH 1/3 ARM: pxa: Add DT support to pxa2xx-uart
Add device tree binding for PXA2xx UARTs. Tested on Vpac270 board.
--- drivers/tty/serial/pxa.c | 50 +++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 47 insertions(+), 3 deletions(-)
drivers/tty/serial/pxa.c +47 -3
@@ -43,6 +43,8 @@#include <linux/clk.h> #include <linux/io.h> #include <linux/slab.h> +#include <linux/of.h> +#include <linux/of_device.h> struct uart_pxa_port {struct uart_port port;
@@ -761,11 +763,50 @@ static const struct dev_pm_ops serial_pxa_pm_ops = { };#endif +#ifdef CONFIG_OF +static struct of_device_id serial_pxa_dt_ids[] = { + { .compatible ="marvell,pxa2xx-uart" }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, serial_pxa_dt_ids); + +static int serial_pxa_probe_dt (struct platform_device *pdev,int *portid) +{ +struct device_node *np = pdev->dev.of_node; +static int portnum; + +if (!np) +return -ENODEV ; + +/* PXA has up to four UART ports */ + *portid = portnum++; +if (*portid >=4 ) +return -ENODEV ; + +/* Check if we're probing compatible ports only! */ +if (of_get_property (np,"marvell,pxa250" ,NULL )) +if (!cpu_is_pxa25x ()) +return -EINVAL ; + +return 0 ; +} +#else +static inline int serial_pxa_probe_dt (struct platform_device *pdev,int *portid) +{ +return 0 ; +} +#endif +static int serial_pxa_probe (struct platform_device *dev) {struct uart_pxa_port *sport;struct resource *mmres, *irqres;int ret; +int portid = dev->id; + + ret =serial_pxa_probe_dt (dev, &portid); +if (ret == -EINVAL ) +return 0 ; mmres =platform_get_resource (dev,IORESOURCE_MEM ,0 ); irqres =platform_get_resource (dev,IORESOURCE_IRQ ,0 );
@@ -788,12 +829,12 @@ static int serial_pxa_probe(struct platform_device *dev) sport->port.irq = irqres->start; sport->port.fifosize =64 ; sport->port.ops = &serial_pxa_pops; - sport->port.line = dev->id; + sport->port.line = portid; sport->port.dev = &dev->dev; sport->port.flags =UPF_IOREMAP |UPF_BOOT_AUTOCONF ; sport->port.uartclk =clk_get_rate (sport->clk); -switch (dev->id) { +switch (portid) {case 0 : sport->name ="FFUART" ;break ;case 1 : sport->name ="BTUART" ;break ;case 2 : sport->name ="STUART" ;break ;
@@ -809,7 +850,7 @@ static int serial_pxa_probe(struct platform_device *dev) goto err_clk; } - serial_pxa_ports[dev->id] = sport; + serial_pxa_ports[portid] = sport;uart_add_one_port (&serial_pxa_reg, &sport->port);platform_set_drvdata (dev, sport);
@@ -846,6 +887,9 @@ static struct platform_driver serial_pxa_driver = {#ifdef CONFIG_PM .pm = &serial_pxa_pm_ops,#endif +#ifdef CONFIG_OF + .of_match_table = serial_pxa_dt_ids, +#endif }, };
Signature · 1 line
1.7.6.3
PATCH 1/3 ARM: pxa: Add DT support to pxa2xx-uart
Quoted 33 lines · Marek Vasut
Add device tree binding for PXA2xx UARTs. Tested on Vpac270 board.
Signed-off-by Marek Vasut <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Grant Likely <[email protected]>--- drivers/tty/serial/pxa.c | 50 +++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 47 insertions(+), 3 deletions(-)drivers/tty/serial/pxa.c +9
-0@@ -43,6 +43,8 @@#include <linux/clk.h> #include <linux/io.h> #include <linux/slab.h> +#include <linux/of.h> +#include <linux/of_device.h> struct uart_pxa_port {struct uart_port port;@@ -761,11 +763,50 @@ static const struct dev_pm_ops serial_pxa_pm_ops = { };#endif +#ifdef CONFIG_OF +static struct of_device_id serial_pxa_dt_ids[] = { + { .compatible ="marvell,pxa2xx-uart" }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, serial_pxa_dt_ids); +
drivers/tty/serial/pxa.c static const struct dev_pm_ops serial_pxa_pm_ops = { · line 782
Quoted 10 lines
drivers/tty/serial/pxa.c +10
-0+static int serial_pxa_probe_dt (struct platform_device *pdev,int *portid) +{ +struct device_node *np = pdev->dev.of_node; +static int portnum; + +if (!np) +return -ENODEV ; + +/* PXA has up to four UART ports */ + *portid = portnum++;
You have no guarantee of the probe ordering yet are dependent on the number later on to set the name.
drivers/tty/serial/pxa.c static const struct dev_pm_ops serial_pxa_pm_ops = { · line 789
Quoted 7 lines
drivers/tty/serial/pxa.c +7
-0+if (*portid >=4 ) +return -ENODEV ; + +/* Check if we're probing compatible ports only! */ +if (of_get_property (np,"marvell,pxa250" ,NULL )) +if (!cpu_is_pxa25x ()) +return -EINVAL ;
if dev->of_node is set, then you already know you matched against marvell,pxa2xx-uart,
Quoted 11 lines
drivers/tty/serial/pxa.c +10
-0+ + return 0; +} +#else +static inline int serial_pxa_probe_dt (struct platform_device *pdev,int *portid) +{ +return 0 ; +} +#endif +static int serial_pxa_probe (struct platform_device *dev)
drivers/tty/serial/pxa.c static const struct dev_pm_ops serial_pxa_pm_ops = { · line 810
Quoted 10 lines
drivers/tty/serial/pxa.c +5
-0{struct uart_pxa_port *sport;struct resource *mmres, *irqres;int ret; +int portid = dev->id; + + ret =serial_pxa_probe_dt (dev, &portid); +if (ret == -EINVAL ) +return 0 ;
What about non-DT probing when CONFIG_OF is enabled?
Quoted 27 lines
drivers/tty/serial/pxa.c +3
-3mmres =platform_get_resource (dev,IORESOURCE_MEM ,0 ); irqres =platform_get_resource (dev,IORESOURCE_IRQ ,0 );@@ -788,12 +829,12 @@ static int serial_pxa_probe(struct platform_device *dev) sport->port.irq = irqres->start; sport->port.fifosize =64 ; sport->port.ops = &serial_pxa_pops; - sport->port.line = dev->id; + sport->port.line = portid; sport->port.dev = &dev->dev; sport->port.flags =UPF_IOREMAP |UPF_BOOT_AUTOCONF ; sport->port.uartclk =clk_get_rate (sport->clk); -switch (dev->id) { +switch (portid) {case 0 : sport->name ="FFUART" ;break ;case 1 : sport->name ="BTUART" ;break ;case 2 : sport->name ="STUART" ;break ;@@ -809,7 +850,7 @@ static int serial_pxa_probe(struct platform_device *dev) goto err_clk; } - serial_pxa_ports[dev->id] = sport; + serial_pxa_ports[portid] = sport;uart_add_one_port (&serial_pxa_reg, &sport->port);platform_set_drvdata (dev, sport);
drivers/tty/serial/pxa.c static struct platform_driver serial_pxa_driver = { · line 892
Quoted 6 lines
drivers/tty/serial/pxa.c +3
-0@@ -846,6 +887,9 @@ static struct platform_driver serial_pxa_driver = {#ifdef CONFIG_PM .pm = &serial_pxa_pm_ops,#endif +#ifdef CONFIG_OF + .of_match_table = serial_pxa_dt_ids, +#endif
Use recently added of_match_ptr and remove the ifdef.
Rob
PATCH 1/3 ARM: pxa: Add DT support to pxa2xx-uart
Quoted 47 lines · Marek Vasut
Quoted 46 lines
Add device tree binding for PXA2xx UARTs. Tested on Vpac270 board.
Signed-off-by Marek Vasut <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Grant Likely <[email protected]>---
drivers/tty/serial/pxa.c | 50+++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 47 insertions(+), 3 deletions(-)
drivers/tty/serial/pxa.c +2
-0@@ -43,6 +43,8 @@#include <linux/clk.h> #include <linux/io.h> #include <linux/slab.h> +#include <linux/of.h> +#include <linux/of_device.h> struct
uart_pxa_port{drivers/tty/serial/pxa.c +11
-0struct uart_port port;@@ -761,11 +763,50 @@ static const struct dev_pm_ops serial_pxa_pm_ops = { };#endif +#ifdef CONFIG_OF +static struct of_device_id serial_pxa_dt_ids[] = { + { .compatible ="marvell,pxa2xx-uart" }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, serial_pxa_dt_ids); + +static int serial_pxa_probe_dt (struct platform_device *pdev,int *portid) +{ +struct device_node *np = pdev->dev.of_node; +static int portnum; +
Quoted 8 lines
drivers/tty/serial/pxa.c static const struct dev_pm_ops serial_pxa_pm_ops = { · line 782
Quoted 5 lines
drivers/tty/serial/pxa.c +5
-0+if (!np) +return -ENODEV ; + +/* PXA has up to four UART ports */ + *portid = portnum++;You have no guarantee of the probe ordering yet are dependent on the number later on to set the name.
The probe order should be the one according to the order of ports in DT, right ?
Quoted 11 lines
drivers/tty/serial/pxa.c static const struct dev_pm_ops serial_pxa_pm_ops = { · line 789
Quoted 8 lines
drivers/tty/serial/pxa.c +7
-0+if (*portid >=4 ) +return -ENODEV ; + +/* Check if we're probing compatible ports only! */ +if (of_get_property (np,"marvell,pxa250" ,NULL )) +if (!cpu_is_pxa25x ()) +return -EINVAL ;if
dev->of_nodeis set, then you already know you matched against marvell,pxa2xx-uart,
Yes, I'm checking if the port has an additional parameter "marvell,pxa250" set, which means it should check if the CPU is pxa250.
Quoted 19 lines
Quoted 19 lines
drivers/tty/serial/pxa.c +9
-0+ +return 0 ; +} +#else +static inline int serial_pxa_probe_dt (struct platform_device *pdev,int *portid) +{ +return 0 ; +} +#endif +static int serial_pxa_probe (struct platform_device *dev) {struct uart_pxa_port *sport;struct resource *mmres, *irqres;int ret;
Quoted 7 lines
drivers/tty/serial/pxa.c static const struct dev_pm_ops serial_pxa_pm_ops = { · line 809
Quoted 5 lines
drivers/tty/serial/pxa.c +5
-0+int portid = dev->id; + + ret =serial_pxa_probe_dt (dev, &portid); +if (ret == -EINVAL ) +return 0 ;What about non-DT probing when
CONFIG_OFis enabled?
Then ret isn't -EINVAL and it should be ok ?
Quoted 44 lines
Quoted 44 lines
drivers/tty/serial/pxa.c +3
-3mmres =platform_get_resource (dev,IORESOURCE_MEM ,0 ); irqres =platform_get_resource (dev,IORESOURCE_IRQ ,0 );@@ -788,12 +829,12 @@ static int serial_pxa_probe(struct platform_device *dev) sport->port.irq = irqres->start; sport->port.fifosize =64 ; sport->port.ops = &serial_pxa_pops; - sport->port.line = dev->id; + sport->port.line = portid; sport->port.dev = &dev->dev; sport->port.flags =UPF_IOREMAP |UPF_BOOT_AUTOCONF ; sport->port.uartclk =clk_get_rate (sport->clk); -switch (dev->id) { +switch (portid) {case 0 : sport->name ="FFUART" ;break ;case 1 : sport->name ="BTUART" ;break ;case 2 : sport->name ="STUART" ;break ;@@ -809,7 +850,7 @@ static int serial_pxa_probe(struct platform_device *dev) goto err_clk; } - serial_pxa_ports[dev->id] = sport; + serial_pxa_ports[portid] = sport;drivers/tty/serial/pxa.c +0
-0uart_add_one_port (&serial_pxa_reg, &sport->port);platform_set_drvdata (dev, sport);@@ -846,6 +887,9 @@ static struct platform_driver serial_pxa_driver = {#ifdef CONFIG_PM .pm = &serial_pxa_pm_ops,
Quoted 7 lines
drivers/tty/serial/pxa.c static struct platform_driver serial_pxa_driver = { · line 892
Quoted 5 lines
drivers/tty/serial/pxa.c +3
-0#endif +#ifdef CONFIG_OF + .of_match_table = serial_pxa_dt_ids, +#endif Use recently added
of_match_ptrand remove the ifdef.
ACK
Quoted 2 lines
Rob
Cheers
PATCH 1/3 ARM: pxa: Add DT support to pxa2xx-uart
Quoted 56 lines · Marek Vasut
Quoted 47 lines · Marek Vasut
Quoted 46 lines
Add device tree binding for PXA2xx UARTs. Tested on Vpac270 board.
Signed-off-by Marek Vasut <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Grant Likely <[email protected]>---
drivers/tty/serial/pxa.c | 50+++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 47 insertions(+), 3 deletions(-)
drivers/tty/serial/pxa.c +2
-0@@ -43,6 +43,8 @@#include <linux/clk.h> #include <linux/io.h> #include <linux/slab.h> +#include <linux/of.h> +#include <linux/of_device.h> struct
uart_pxa_port{drivers/tty/serial/pxa.c +11
-0struct uart_port port;@@ -761,11 +763,50 @@ static const struct dev_pm_ops serial_pxa_pm_ops = { };#endif +#ifdef CONFIG_OF +static struct of_device_id serial_pxa_dt_ids[] = { + { .compatible ="marvell,pxa2xx-uart" }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, serial_pxa_dt_ids); + +static int serial_pxa_probe_dt (struct platform_device *pdev,int *portid) +{ +struct device_node *np = pdev->dev.of_node; +static int portnum; +Quoted 8 lines
drivers/tty/serial/pxa.c static const struct dev_pm_ops serial_pxa_pm_ops = { · line 782
Quoted 5 lines
drivers/tty/serial/pxa.c +5
-0+if (!np) +return -ENODEV ; + +/* PXA has up to four UART ports */ + *portid = portnum++;You have no guarantee of the probe ordering yet are dependent on the number later on to set the name.
Quoted 1 line
The probe order should be the one according to the order of ports in DT, right ?
Maybe so, but there is no guarantee of that. If you can avoid it that would be best, but I think most serial drivers end up with some sort of index. Look at the recent DT support for i.MX uart and the alias support.
Quoted 12 lines
Quoted 11 lines
drivers/tty/serial/pxa.c static const struct dev_pm_ops serial_pxa_pm_ops = { · line 789
Quoted 8 lines
drivers/tty/serial/pxa.c +7
-0+if (*portid >=4 ) +return -ENODEV ; + +/* Check if we're probing compatible ports only! */ +if (of_get_property (np,"marvell,pxa250" ,NULL )) +if (!cpu_is_pxa25x ()) +return -EINVAL ;if
dev->of_nodeis set, then you already know you matched against marvell,pxa2xx-uart,
Quoted 2 lines
Yes, I'm checking if the port has an additional parameter "marvell,pxa250" set, which means it should check if the CPU is pxa250.
If you have differences between pxa250 uart and other pxa2xx uart versions, then the compatible string should reflect this (i.e. marvell,pxa250-uart). Generally, you want to be specific with compatible strings. To do it generically, use the oldest chip name and newer chips can be compatible. For example, a pxa250 uart can use marvell,pxa250-uart and every other chip can use marvell,pxa210-uart.
Quoted 28 lines
Quoted 20 lines
Quoted 20 lines
drivers/tty/serial/pxa.c +9
-0+ +return 0 ; +} +#else +static inline int serial_pxa_probe_dt (struct platform_device *pdev,int *portid) +{ +return 0 ; +} +#endif +static int serial_pxa_probe (struct platform_device *dev) {struct uart_pxa_port *sport;struct resource *mmres, *irqres;int ret;Quoted 7 lines
drivers/tty/serial/pxa.c static const struct dev_pm_ops serial_pxa_pm_ops = { · line 809
Quoted 5 lines
drivers/tty/serial/pxa.c +5
-0+int portid = dev->id; + + ret =serial_pxa_probe_dt (dev, &portid); +if (ret == -EINVAL ) +return 0 ;What about non-DT probing when
CONFIG_OFis enabled?
Quoted 1 line
Then ret isn't
-EINVALand it should be ok ?
Ahh, yes you're right.
Rob
PATCH 1/3 ARM: pxa: Add DT support to pxa2xx-uart
Quoted 111 lines · Marek Vasut
Quoted 56 lines
Quoted 47 lines · Marek Vasut
Quoted 46 lines
Add device tree binding for PXA2xx UARTs. Tested on Vpac270 board.
Signed-off-by Marek Vasut <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Grant Likely <[email protected]>---
drivers/tty/serial/pxa.c | 50+++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 47 insertions(+), 3 deletions(-)
drivers/tty/serial/pxa.c +2
-0@@ -43,6 +43,8 @@#include <linux/clk.h> #include <linux/io.h> #include <linux/slab.h> +#include <linux/of.h> +#include <linux/of_device.h> struct
uart_pxa_port{drivers/tty/serial/pxa.c +11
-0struct uart_port port;@@ -761,11 +763,50 @@ static const struct dev_pm_ops serial_pxa_pm_ops = { };#endif +#ifdef CONFIG_OF +static struct of_device_id serial_pxa_dt_ids[] = { + { .compatible ="marvell,pxa2xx-uart" }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, serial_pxa_dt_ids); + +static int serial_pxa_probe_dt (struct platform_device *pdev,int *portid) +{ +struct device_node *np = pdev->dev.of_node; +static int portnum; +Quoted 8 lines
drivers/tty/serial/pxa.c static const struct dev_pm_ops serial_pxa_pm_ops = { · line 782
Quoted 5 lines
drivers/tty/serial/pxa.c +5
-0+if (!np) +return -ENODEV ; + +/* PXA has up to four UART ports */ + *portid = portnum++;You have no guarantee of the probe ordering yet are dependent on the number later on to set the name.
Quoted 2 lines
The probe order should be the one according to the order of ports in DT, right ?
Maybe so, but there is no guarantee of that. If you can avoid it that would be best, but I think most serial drivers end up with some sort of index. Look at the recent DT support for i.MX uart and the alias support.
Quoted 11 lines
Quoted 10 lines
drivers/tty/serial/pxa.c static const struct dev_pm_ops serial_pxa_pm_ops = { · line 789
Quoted 7 lines
drivers/tty/serial/pxa.c +7
-0+if (*portid >=4 ) +return -ENODEV ; + +/* Check if we're probing compatible ports only! */ +if (of_get_property (np,"marvell,pxa250" ,NULL )) +if (!cpu_is_pxa25x ()) +return -EINVAL ;if
dev->of_nodeis set, then you already know you matched against marvell,pxa2xx-uart,Quoted 2 lines
Yes, I'm checking if the port has an additional parameter "marvell,pxa250" set, which means it should check if the CPU is pxa250.
If you have differences between pxa250 uart and other pxa2xx uart versions, then the compatible string should reflect this (i.e. marvell,pxa250-uart). Generally, you want to be specific with compatible strings. To do it generically, use the oldest chip name and newer chips can be compatible. For example, a pxa250 uart can use marvell,pxa250-uart and every other chip can use marvell,pxa210-uart.
Quoted 26 lines
Quoted 25 lines
Quoted 13 lines
drivers/tty/serial/pxa.c +9
-0+ +return 0 ; +} +#else +static inline int serial_pxa_probe_dt (struct platform_device *pdev, int *portid) +{ +return 0 ; +} +#endif +static int serial_pxa_probe (struct platform_device *dev) {drivers/tty/serial/pxa.c static const struct dev_pm_ops serial_pxa_pm_ops
Quoted 10 lines
drivers/tty/serial/pxa.c +5
-0struct uart_pxa_port *sport;struct resource *mmres, *irqres;int ret; +int portid = dev->id; + + ret =serial_pxa_probe_dt (dev, &portid); +if (ret == -EINVAL ) +return 0 ;What about non-DT probing when
CONFIG_OFis enabled?
Quoted 5 lines
Quoted 1 line
Then ret isn't
-EINVALand it should be ok ?Ahh, yes you're right.
Rob
Thanks Rob,
I'm quite new to this DT stuff. This was very helpful though, expect new load of patches soon. Thanks!
PATCH 1/3 ARM: pxa: Add DT support to pxa2xx-uart
In reply to Marek VasutQuoted 38 lines · Marek Vasut
Add device tree binding for PXA2xx UARTs. Tested on Vpac270 board.
Signed-off-by Marek Vasut <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Grant Likely <[email protected]>--- drivers/tty/serial/pxa.c | 50 +++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 47 insertions(+), 3 deletions(-)drivers/tty/serial/pxa.c +14
-0@@ -43,6 +43,8 @@#include <linux/clk.h> #include <linux/io.h> #include <linux/slab.h> +#include <linux/of.h> +#include <linux/of_device.h> struct uart_pxa_port {struct uart_port port;@@ -761,11 +763,50 @@ static const struct dev_pm_ops serial_pxa_pm_ops = { };#endif +#ifdef CONFIG_OF +static struct of_device_id serial_pxa_dt_ids[] = { + { .compatible ="marvell,pxa2xx-uart" }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, serial_pxa_dt_ids); + +static int serial_pxa_probe_dt (struct platform_device *pdev,int *portid) +{ +struct device_node *np = pdev->dev.of_node; +static int portnum; +
drivers/tty/serial/pxa.c static const struct dev_pm_ops serial_pxa_pm_ops = { · line 787
Quoted 10 lines
drivers/tty/serial/pxa.c +10
-0+if (!np) +return -ENODEV ; + +/* PXA has up to four UART ports */ + *portid = portnum++; +if (*portid >=4 ) +return -ENODEV ; + +/* Check if we're probing compatible ports only! */ +if (of_get_property (np,"marvell,pxa250" ,NULL ))
This looks wrong. Compatibility should be based solely on the 'compatible' property of the device node. A separate of_get_property() doesn't make much sense. You can use of_device_is_compatible(), or a better option would probably be to use of_match_device() so that you can add additional setup data from the .data field in the serial_pxa_dt_ids list.
drivers/tty/serial/pxa.c static const struct dev_pm_ops serial_pxa_pm_ops = { · line 789
Quoted 2 lines
drivers/tty/serial/pxa.c +2
-0+if (!cpu_is_pxa25x ()) +return -EINVAL ;
Do you really want to fail silently here? If the cpu does not match pxa25x, then there is something very wrong with the device tree data for the machine. I would fail loudly with WARN_ON() or dev_err(). :-)
Quoted 48 lines
drivers/tty/serial/pxa.c +18
-3+ + return 0; +} +#else +static inline int serial_pxa_probe_dt (struct platform_device *pdev,int *portid) +{ +return 0 ; +} +#endif +static int serial_pxa_probe (struct platform_device *dev) {struct uart_pxa_port *sport;struct resource *mmres, *irqres;int ret; +int portid = dev->id; + + ret =serial_pxa_probe_dt (dev, &portid); +if (ret == -EINVAL ) +return 0 ; mmres =platform_get_resource (dev,IORESOURCE_MEM ,0 ); irqres =platform_get_resource (dev,IORESOURCE_IRQ ,0 );@@ -788,12 +829,12 @@ static int serial_pxa_probe(struct platform_device *dev) sport->port.irq = irqres->start; sport->port.fifosize =64 ; sport->port.ops = &serial_pxa_pops; - sport->port.line = dev->id; + sport->port.line = portid; sport->port.dev = &dev->dev; sport->port.flags =UPF_IOREMAP |UPF_BOOT_AUTOCONF ; sport->port.uartclk =clk_get_rate (sport->clk); -switch (dev->id) { +switch (portid) {case 0 : sport->name ="FFUART" ;break ;case 1 : sport->name ="BTUART" ;break ;case 2 : sport->name ="STUART" ;break ;@@ -809,7 +850,7 @@ static int serial_pxa_probe(struct platform_device *dev) goto err_clk; } - serial_pxa_ports[dev->id] = sport; + serial_pxa_ports[portid] = sport;uart_add_one_port (&serial_pxa_reg, &sport->port);platform_set_drvdata (dev, sport);
drivers/tty/serial/pxa.c static struct platform_driver serial_pxa_driver = { · line 892
Quoted 6 lines
drivers/tty/serial/pxa.c +3
-0@@ -846,6 +887,9 @@ static struct platform_driver serial_pxa_driver = {#ifdef CONFIG_PM .pm = &serial_pxa_pm_ops,#endif +#ifdef CONFIG_OF + .of_match_table = serial_pxa_dt_ids, +#endif
Doing it this way eliminates the #ifdef:
.of_match_table = of_match_ptr(serial_pxa_dt_ids),
Otherwise looks good.
g.
PATCH 1/3 ARM: pxa: Add DT support to pxa2xx-uart
Quoted 65 lines · Marek Vasut
Quoted 46 lines
Add device tree binding for PXA2xx UARTs. Tested on Vpac270 board.
Signed-off-by Marek Vasut <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Grant Likely <[email protected]>---
drivers/tty/serial/pxa.c | 50+++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 47 insertions(+), 3 deletions(-)
drivers/tty/serial/pxa.c +2
-0@@ -43,6 +43,8 @@#include <linux/clk.h> #include <linux/io.h> #include <linux/slab.h> +#include <linux/of.h> +#include <linux/of_device.h> struct
uart_pxa_port{drivers/tty/serial/pxa.c +11
-0struct uart_port port;@@ -761,11 +763,50 @@ static const struct dev_pm_ops serial_pxa_pm_ops = { };#endif +#ifdef CONFIG_OF +static struct of_device_id serial_pxa_dt_ids[] = { + { .compatible ="marvell,pxa2xx-uart" }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, serial_pxa_dt_ids); + +static int serial_pxa_probe_dt (struct platform_device *pdev,int *portid) +{ +struct device_node *np = pdev->dev.of_node; +static int portnum; +drivers/tty/serial/pxa.c static const struct dev_pm_ops serial_pxa_pm_ops = · line 789
Quoted 10 lines
drivers/tty/serial/pxa.c +10
-0+if (!np) +return -ENODEV ; + +/* PXA has up to four UART ports */ + *portid = portnum++; +if (*portid >=4 ) +return -ENODEV ; + +/* Check if we're probing compatible ports only! */ +if (of_get_property (np,"marvell,pxa250" ,NULL ))This looks wrong. Compatibility should be based solely on the 'compatible' property of the device node. A separate
of_get_property()doesn't make much sense. You can useof_device_is_compatible(), or a better option would probably be to useof_match_device()so that you can add additional setup data from the .data field in theserial_pxa_dt_idslist.
Quoted 6 lines
drivers/tty/serial/pxa.c static const struct dev_pm_ops serial_pxa_pm_ops = { · line 789
Quoted 2 lines
drivers/tty/serial/pxa.c +2
-0+if (!cpu_is_pxa25x ()) +return -EINVAL ;Do you really want to fail silently here? If the cpu does not match pxa25x, then there is something very wrong with the device tree data for the machine. I would fail loudly with
WARN_ON()ordev_err(). :-)
Please see V2 of the patch. I offloaded the responsibility to user, which is how it should be.
Quoted 70 lines
Quoted 70 lines
drivers/tty/serial/pxa.c +17
-3+ +return 0 ; +} +#else +static inline int serial_pxa_probe_dt (struct platform_device *pdev,int *portid) +{ +return 0 ; +} +#endif +static int serial_pxa_probe (struct platform_device *dev) {struct uart_pxa_port *sport;struct resource *mmres, *irqres;int ret; +int portid = dev->id; + + ret =serial_pxa_probe_dt (dev, &portid); +if (ret == -EINVAL ) +return 0 ; mmres =platform_get_resource (dev,IORESOURCE_MEM ,0 ); irqres =platform_get_resource (dev,IORESOURCE_IRQ ,0 );@@ -788,12 +829,12 @@ static int serial_pxa_probe(struct platform_device *dev) sport->port.irq = irqres->start; sport->port.fifosize =64 ; sport->port.ops = &serial_pxa_pops; - sport->port.line = dev->id; + sport->port.line = portid; sport->port.dev = &dev->dev; sport->port.flags =UPF_IOREMAP |UPF_BOOT_AUTOCONF ; sport->port.uartclk =clk_get_rate (sport->clk); -switch (dev->id) { +switch (portid) {case 0 : sport->name ="FFUART" ;break ;case 1 : sport->name ="BTUART" ;break ;case 2 : sport->name ="STUART" ;break ;@@ -809,7 +850,7 @@ static int serial_pxa_probe(struct platform_device *dev) goto err_clk; } - serial_pxa_ports[dev->id] = sport; + serial_pxa_ports[portid] = sport;drivers/tty/serial/pxa.c +0
-0uart_add_one_port (&serial_pxa_reg, &sport->port);platform_set_drvdata (dev, sport);@@ -846,6 +887,9 @@ static struct platform_driver serial_pxa_driver = {#ifdef CONFIG_PM .pm = &serial_pxa_pm_ops,#endif
Quoted 7 lines
drivers/tty/serial/pxa.c static struct platform_driver serial_pxa_driver = { · line 892
Quoted 3 lines
drivers/tty/serial/pxa.c +3
-0+#ifdef CONFIG_OF + .of_match_table = serial_pxa_dt_ids, +#endif Doing it this way eliminates the #ifdef:
.of_match_table =
of_match_ptr(serial_pxa_dt_ids),
Done in V2
Quoted 4 lines
Otherwise looks good.
g.
Thanks
M
PATCH 2/3 ARM: pxa: Add DT testing machine
In reply to Marek VasutI use the Voipac PXA270 board for PXA DT conversion. This board is a helper for the conversion to go smoothly and the testing to be easy.
--- arch/arm/mach-pxa/Kconfig | 15 +++++++ arch/arm/mach-pxa/Makefile | 3 + arch/arm/mach-pxa/vpac270-dt.c | 82 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-pxa/vpac270-dt.c
arch/arm/mach-pxa/Kconfig +15 -0
@@ -599,6 +599,21 @@ config MACH_ZIPIT2 select PXA27x select HAVE_PWM +config MACH_VPAC_DT + bool "PXA (Voipac270) FDT Machine" + select PXA27x + select OF + depends on !MACH_VPAC270 && EXPERIMENTAL + help + PXA Device Tree Machine. + This is to be a generic machine which probes all of it's drivers + using the Flattened Device Tree blob. This is work-in-progress + so don't expect much yet. We selected the Voipac PXA270 device + as a base device to test support along the way. + + NOTE: This platform is mutually exclusive with the original! + NOTE: Use only if you know what you're doing!! + endmenu config PXA25x
arch/arm/mach-pxa/Makefile +3 -0
@@ -104,3 +104,6 @@ led-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o obj-$(CONFIG_LEDS) += $(led-y) obj-$(CONFIG_TOSA_BT) += tosa-bt.o + +# PXA FDT board +obj-$(CONFIG_MACH_VPAC_DT) += vpac270-dt.o
arch/arm/mach-pxa/vpac270-dt.c new file +82 -0
82 lines not on this page · raw message
Signature · 1 line
1.7.6.3
PATCH 2/3 ARM: pxa: Add DT testing machine
Quoted 58 lines · Marek Vasut
I use the Voipac PXA270 board for PXA DT conversion. This board is a helper for the conversion to go smoothly and the testing to be easy.
Signed-off-by Marek Vasut <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Grant Likely <[email protected]>--- arch/arm/mach-pxa/Kconfig | 15 +++++++ arch/arm/mach-pxa/Makefile | 3 + arch/arm/mach-pxa/vpac270-dt.c | 82 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-pxa/vpac270-dt.carch/arm/mach-pxa/Kconfig +15
-0@@ -599,6 +599,21 @@ config MACH_ZIPIT2 select PXA27x select HAVE_PWM +config MACH_VPAC_DT + bool "PXA (Voipac270) FDT Machine" + select PXA27x + select OF + depends on !MACH_VPAC270 && EXPERIMENTAL + help + PXA Device Tree Machine. + This is to be a generic machine which probes all of it's drivers + using the Flattened Device Tree blob. This is work-in-progress + so don't expect much yet. We selected the Voipac PXA270 device + as a base device to test support along the way. + + NOTE: This platform is mutually exclusive with the original! + NOTE: Use only if you know what you're doing!! + endmenu config PXA25xarch/arm/mach-pxa/Makefile +3
-0@@ -104,3 +104,6 @@ led-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o obj-$(CONFIG_LEDS) += $(led-y) obj-$(CONFIG_TOSA_BT) += tosa-bt.o + +# PXA FDT board +obj-$(CONFIG_MACH_VPAC_DT) += vpac270-dt.oarch/arm/mach-pxa/vpac270-dt.c new file +2
-0@@ -0,0 +1,82 @@ +/* +* Hardware definitions for Voipac PXA270 driven by FDT
arch/arm/mach-pxa/vpac270-dt.c line 12
Quoted 10 lines
arch/arm/mach-pxa/vpac270-dt.c new file +10
-0+* +* Copyright (C) 2011 Marek Vasut <[email protected]> +* +* NOTE: This is an ongoing effort of preparing generic FDT-based board +* for PXA machines. This particular device allows us to test the +* support for breakage. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation.
Rather that starting with a file named for a specific machine, I'd recommend something like pxa270-dt.c that will start with Voipac support only, but will grow support for other boards over time.
Quoted 15 lines
arch/arm/mach-pxa/vpac270-dt.c new file +15
-0+* +*/ + +#include <linux/of_platform.h> +#include <linux/irqdomain.h> +#include "vpac270.c" + +/****************************************************************************** +* Machine init +******************************************************************************/ +static const struct of_device_id pxairq_of_match[]__initconst = { + { .compatible ="marvell,pxa-irq" , }, + {}, +}; +
arch/arm/mach-pxa/vpac270-dt.c line 37
Quoted 10 lines
arch/arm/mach-pxa/vpac270-dt.c new file +10
-0+static void __init pxa_dt_init_irq (void ) +{ +irq_domain_generate_simple (pxairq_of_match,0x40d00000 ,0 ); +pxa27x_init_irq (); +} + +static struct of_device_id pxa_dt_match_table[]__initdata = { + { .compatible ="simple-bus" , }, + {} +};
You can use the stock of_default_bus_match_table[] instead of adding another one.
Quoted 20 lines
arch/arm/mach-pxa/vpac270-dt.c new file +20
-0+ +static const struct of_dev_auxdata pxa_dt_auxdata_table[]__initconst = { +OF_DEV_AUXDATA ("marvell,pxa2xx-uart" ,0x40100000 ,"pxa2xx-uart.0" ,NULL ), +OF_DEV_AUXDATA ("marvell,pxa2xx-uart" ,0x40200000 ,"pxa2xx-uart.1" ,NULL ), +OF_DEV_AUXDATA ("marvell,pxa2xx-uart" ,0x40700000 ,"pxa2xx-uart.2" ,NULL ), +}; + +static void __init vpac270_dt_init (void ) +{ +pxa2xx_mfp_config (ARRAY_AND_SIZE (vpac270_pin_config)); + +of_platform_populate (NULL , pxa_dt_match_table, + pxa_dt_auxdata_table,NULL ); + +pxa_set_i2c_info (NULL ); +pxa27x_set_i2c_power_info (NULL ); + +vpac270_pmic_init (); +vpac270_lcd_init (); +vpac270_mmc_init ();
arch/arm/mach-pxa/vpac270-dt.c line 67
Quoted 10 lines
arch/arm/mach-pxa/vpac270-dt.c new file +10
-0+vpac270_nor_init (); +vpac270_onenand_init (); +vpac270_leds_init (); +vpac270_keys_init (); +vpac270_uhc_init (); +vpac270_udc_init (); +vpac270_eth_init (); +vpac270_ts_init (); +vpac270_rtc_init (); +vpac270_ide_init ();
Ideally of course, all this stuff would be handled in device drivers based on platform_devices created by of_platform_populate(). In the short term, you could have one machine specific setup function for each supported machine and chose the one to execute based on the top level compatible property.
Alternatively, you could make this new support file only support a subset of devices that can currently work with device tree, and then build it up as drivers gain DT support. It will be easier to pull in additional board support that way.
Quoted 18 lines
arch/arm/mach-pxa/vpac270-dt.c new file +15
-0+} + +static const char *vpac270_dt_board_compat[]__initdata = { +"voipac,vpac270" , +NULL +}; + +DT_MACHINE_START (PXA_DT ,"Marvell PXA2xx/PXA3xx (Flattened Device Tree)" ) + .map_io = pxa27x_map_io, + .init_irq = pxa_dt_init_irq, + .handle_irq = pxa27x_handle_irq, + .timer = &pxa_timer, + .init_machine = vpac270_dt_init, + .dt_compat = vpac270_dt_board_compat, +MACHINE_END Signature · 1 line
1.7.6.3
PATCH 2/3 ARM: pxa: Add DT testing machine
Quoted 72 lines · Marek Vasut
Quoted 71 lines
I use the Voipac PXA270 board for PXA DT conversion. This board is a helper for the conversion to go smoothly and the testing to be easy.
Signed-off-by Marek Vasut <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Grant Likely <[email protected]>---
arch/arm/mach-pxa/Kconfig | 15 +++++++ arch/arm/mach-pxa/Makefile | 3 + arch/arm/mach-pxa/vpac270-dt.c | 82 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-pxa/vpac270-dt.carch/arm/mach-pxa/Kconfig +15
-0@@ -599,6 +599,21 @@ config MACH_ZIPIT2 select PXA27x select HAVE_PWM +config MACH_VPAC_DT + bool "PXA (Voipac270) FDT Machine" + select PXA27x + select OF + depends on !MACH_VPAC270 && EXPERIMENTAL + help + PXA Device Tree Machine. + This is to be a generic machine which probes all of it's drivers + using the Flattened Device Tree blob. This is work-in-progress + so don't expect much yet. We selected the Voipac PXA270 device + as a base device to test support along the way. + + NOTE: This platform is mutually exclusive with the original! + NOTE: Use only if you know what you're doing!! + endmenuconfig PXA25x
arch/arm/mach-pxa/Makefile +3
-0@@ -104,3 +104,6 @@ led-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o obj-$(CONFIG_LEDS) += $(led-y) obj-$(CONFIG_TOSA_BT) += tosa-bt.o + +# PXA FDT board +obj-$(CONFIG_MACH_VPAC_DT) += vpac270-dt.o(quoted diff) +0
-0
b/arch/arm/mach-pxa/vpac270-dt.cnew file mode 100644 index 0000000..dc9a6ddarch/arm/mach-pxa/vpac270-dt.c new file +8
-0@@ -0,0 +1,82 @@ +/* +* Hardware definitions for Voipac PXA270 driven by FDT +* +* Copyright (C) 2011 Marek Vasut <[email protected]> +* +* NOTE: This is an ongoing effort of preparing generic FDT-based board +* for PXA machines. This particular device allows us to test the +* support for breakage.
Quoted 8 lines
arch/arm/mach-pxa/vpac270-dt.c line 12
Quoted 4 lines
arch/arm/mach-pxa/vpac270-dt.c new file +4
-0+* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. Rather that starting with a file named for a specific machine, I'd recommend something like
pxa270-dt.cthat will start with Voipac support only, but will grow support for other boards over time.
Hi Grant, well ok, I have no problem with that. Can you apply the rest of the patches (0001, 0003)?
Quoted 22 lines
Quoted 22 lines
arch/arm/mach-pxa/vpac270-dt.c new file +8
-0+* +*/ + +#include <linux/of_platform.h> +#include <linux/irqdomain.h> +#include "vpac270.c" + +/*********************************************************************** ******* + * Machine init
+
************************************************************************
******/ +static const structof_device_idpxairq_of_match[]__initconst=
{ + { .compatible = "marvell,pxa-irq", },arch/arm/mach-pxa/vpac270-dt.c new file +8
-0+ {}, +}; + +static void __init pxa_dt_init_irq (void ) +{ +irq_domain_generate_simple (pxairq_of_match,0x40d00000 ,0 ); +pxa27x_init_irq (); +}
Quoted 8 lines
arch/arm/mach-pxa/vpac270-dt.c line 37
Quoted 5 lines
arch/arm/mach-pxa/vpac270-dt.c new file +5
-0+ +static struct of_device_id pxa_dt_match_table[]__initdata = { + { .compatible ="simple-bus" , }, + {} +};You can use the stock of_default_bus_match_table[] instead of adding another one.
Thanks for explaining!
Quoted 26 lines
Quoted 26 lines
arch/arm/mach-pxa/vpac270-dt.c new file +2
-0+ +static const struct of_dev_auxdata pxa_dt_auxdata_table[] __initconst ={ + OF_DEV_AUXDATA("marvell,pxa2xx-uart",
0x40100000, "pxa2xx-uart.0",
NULL), + OF_DEV_AUXDATA("marvell,pxa2xx-uart",0x40200000,
"pxa2xx-uart.1", NULL), + OF_DEV_AUXDATA("marvell,pxa2xx-uart",0x40700000, "pxa2xx-uart.2", NULL), +};arch/arm/mach-pxa/vpac270-dt.c new file +19
-0+ +static void __init vpac270_dt_init (void ) +{ +pxa2xx_mfp_config (ARRAY_AND_SIZE (vpac270_pin_config)); + +of_platform_populate (NULL , pxa_dt_match_table, + pxa_dt_auxdata_table,NULL ); + +pxa_set_i2c_info (NULL ); +pxa27x_set_i2c_power_info (NULL ); + +vpac270_pmic_init (); +vpac270_lcd_init (); +vpac270_mmc_init (); +vpac270_nor_init (); +vpac270_onenand_init (); +vpac270_leds_init (); +vpac270_keys_init (); +vpac270_uhc_init ();
Quoted 8 lines
arch/arm/mach-pxa/vpac270-dt.c line 67
Quoted 5 lines
arch/arm/mach-pxa/vpac270-dt.c new file +5
-0+vpac270_udc_init (); +vpac270_eth_init (); +vpac270_ts_init (); +vpac270_rtc_init (); +vpac270_ide_init ();Ideally of course, all this stuff would be handled in device drivers based on
platform_devicescreated byof_platform_populate().
Exactly
Quoted 4 lines
In the
short term, you could have one machine specific setup function for each supported machine and chose the one to execute based on the top level compatible property.
Yes, that's also true. This looks doable as a short-term solution (until DT for PXA is more complete).
Quoted 5 lines
Alternatively, you could make this new support file only support a subset of devices that can currently work with device tree, and then build it up as drivers gain DT support. It will be easier to pull in additional board support that way.
That's a problem actually. The thing won't even boot without some of the stuff registered here :-/
The other option is for me to keep it out of tree and apply this one only when I have this device working cleanly with DT.
Quoted 16 lines
Quoted 16 lines
arch/arm/mach-pxa/vpac270-dt.c new file +8
-0+} + +static const char *vpac270_dt_board_compat[]__initdata = { +"voipac,vpac270" , +NULL +}; + +DT_MACHINE_START(PXA_DT, "Marvell PXA2xx/PXA3xx (Flattened DeviceTree)") + .map_io =
pxa27x_map_io,arch/arm/mach-pxa/vpac270-dt.c new file +6
-0+ .init_irq = pxa_dt_init_irq, + .handle_irq = pxa27x_handle_irq, + .timer = &pxa_timer, + .init_machine = vpac270_dt_init, + .dt_compat = vpac270_dt_board_compat, +MACHINE_END
PATCH 3/3 ARM: pxa: Add basic DTS files for PXA/Vpac270 testing machine
In reply to Marek Vasut--- arch/arm/boot/dts/pxa-vpac270.dts | 37 +++++++++++++++++++ arch/arm/boot/dts/pxa.dtsi | 72 +++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/pxa-vpac270.dts create mode 100644 arch/arm/boot/dts/pxa.dtsi
arch/arm/boot/dts/pxa-vpac270.dts new file +37 -0
@@ -0,0 +1,37 @@ +/* + * pxa-vpac270.dts - Device Tree file for Voipac PXA270 board + * + * Copyright (C) 2011 Marek Vasut <[email protected]> + * + * Licensed under GPLv2 or later. + */ +/dts-v1/; +/include/ "pxa.dtsi" + +/ { + model = "Voipac VPAC270"; + compatible = "voipac,vpac270"; + + chosen { + bootargs = "console=ttyS0,115200 mem=128M at 0xa0000000"; + linux,stdout-path = &ffuart; + }; + + memory at a0000000 { + reg = <0xa0000000 0x8000000>; + }; + + pxabus { + ffuart: uart at 40100000 { + status = "okay"; + }; + + btuart: uart at 40200000 { + status = "okay"; + }; + + stuart: uart at 40700000 { + status = "okay"; + }; + }; +};
arch/arm/boot/dts/pxa.dtsi new file +72 -0
72 lines not on this page · raw message
Signature · 1 line
1.7.6.3
v2 cover Initial PXA DT bindings
In reply to Marek VasutThis patchset starts effort to convert PXA machines to DT. I started with PXA UART driver and added a stub machine, which I plan to eventually rename to board-pxa-dt when ready.
The file in patch 0002 contains style errors (line over 80), because they are 1 character over. To avoid crippling readability, I left that as is.
Marek Vasut (3):
ARM: pxa: Add DT support to pxa2xx-uart
ARM: pxa: Add DT testing machine
ARM: pxa: Add basic DTS files for PXA/Vpac270 testing machine
arch/arm/boot/dts/pxa-vpac270.dts | 37 +++++++++++++++++ arch/arm/boot/dts/pxa.dtsi | 71 ++++++++++++++++++++++++++++++++ arch/arm/mach-pxa/Kconfig | 15 +++++++ arch/arm/mach-pxa/Makefile | 3 + arch/arm/mach-pxa/vpac270-dt.c | 82 +++++++++++++++++++++++++++++++++++++ arch/arm/mach-pxa/vpac270.c | 2 + drivers/tty/serial/pxa.c | 46 +++++++++++++++++++- 7 files changed, 253 insertions(+), 3 deletions(-) create mode 100644 arch/arm/boot/dts/pxa-vpac270.dts create mode 100644 arch/arm/boot/dts/pxa.dtsi create mode 100644 arch/arm/mach-pxa/vpac270-dt.c
V2: Adjust to recent DT changes (see patches for details)
Signature · 1 line
1.7.7.1
PATCH v2 1/3 ARM: pxa: Add DT support to pxa2xx-uart
Add device tree binding for PXA2xx UARTs. Tested on Vpac270 board.
--- drivers/tty/serial/pxa.c | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 43 insertions(+), 3 deletions(-)
V2: Use of_alias_get_id() instead of static int portnum
Drop checking of CPU type, instead let user handle HWUART on his own (by not registering it in the DT file on new CPUs -- this depends on user's sanity).
drivers/tty/serial/pxa.c +43 -3
@@ -43,6 +43,8 @@#include <linux/clk.h> #include <linux/io.h> #include <linux/slab.h> +#include <linux/of.h> +#include <linux/of_device.h> struct uart_pxa_port {struct uart_port port;
@@ -781,11 +783,48 @@ static const struct dev_pm_ops serial_pxa_pm_ops = { };#endif +#ifdef CONFIG_OF +static struct of_device_id serial_pxa_dt_ids[] = { + { .compatible ="marvell,pxa2xx-uart" }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, serial_pxa_dt_ids); + +static int serial_pxa_probe_dt (struct platform_device *pdev,int *portid) +{ +struct device_node *np = pdev->dev.of_node; +int ret; + +if (!np) +return -ENODEV ; + + ret =of_alias_get_id (np,"serial" ); +if (ret <0 ) { +dev_err (&pdev->dev,"Failed to get alias id, errno %d\n" , ret); +return -ENODEV ; + } + + *portid = ret; + +return 0 ; +} +#else +static inline int serial_pxa_probe_dt (struct platform_device *pdev,int *portid) +{ +return 0 ; +} +#endif +static int serial_pxa_probe (struct platform_device *dev) {struct uart_pxa_port *sport;struct resource *mmres, *irqres;int ret; +int portid = dev->id; + + ret =serial_pxa_probe_dt (dev, &portid); +if (ret == -EINVAL ) +return 0 ; mmres =platform_get_resource (dev,IORESOURCE_MEM ,0 ); irqres =platform_get_resource (dev,IORESOURCE_IRQ ,0 );
@@ -808,12 +847,12 @@ static int serial_pxa_probe(struct platform_device *dev) sport->port.irq = irqres->start; sport->port.fifosize =64 ; sport->port.ops = &serial_pxa_pops; - sport->port.line = dev->id; + sport->port.line = portid; sport->port.dev = &dev->dev; sport->port.flags =UPF_IOREMAP |UPF_BOOT_AUTOCONF ; sport->port.uartclk =clk_get_rate (sport->clk); -switch (dev->id) { +switch (portid) {case 0 : sport->name ="FFUART" ;break ;case 1 : sport->name ="BTUART" ;break ;case 2 : sport->name ="STUART" ;break ;
@@ -829,7 +868,7 @@ static int serial_pxa_probe(struct platform_device *dev) goto err_clk; } - serial_pxa_ports[dev->id] = sport; + serial_pxa_ports[portid] = sport;uart_add_one_port (&serial_pxa_reg, &sport->port);platform_set_drvdata (dev, sport);
@@ -866,6 +905,7 @@ static struct platform_driver serial_pxa_driver = {#ifdef CONFIG_PM .pm = &serial_pxa_pm_ops, #endif + .of_match_table = of_match_ptr(serial_pxa_dt_ids), }, };
Signature · 1 line
1.7.7.1
PATCH v2 1/3 ARM: pxa: Add DT support to pxa2xx-uart
Quoted 7 lines · Marek Vasut
Add device tree binding for PXA2xx UARTs. Tested on Vpac270 board.
Signed-off-by Marek Vasut <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Grant Likely <[email protected]>Cc Rob Herring <[email protected]>---
Quoted 101 lines
drivers/tty/serial/pxa.c | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 43 insertions(+), 3 deletions(-)V2: Use
of_alias_get_id()instead of static int portnum
Drop checking of CPU type, instead let user handle HWUART on his own (by not registering it in the DT file on new CPUs -- this depends on user's sanity).drivers/tty/serial/pxa.c +43
-3@@ -43,6 +43,8 @@#include <linux/clk.h> #include <linux/io.h> #include <linux/slab.h> +#include <linux/of.h> +#include <linux/of_device.h> struct uart_pxa_port {struct uart_port port;@@ -781,11 +783,48 @@ static const struct dev_pm_ops serial_pxa_pm_ops = { };#endif +#ifdef CONFIG_OF +static struct of_device_id serial_pxa_dt_ids[] = { + { .compatible ="marvell,pxa2xx-uart" }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, serial_pxa_dt_ids); + +static int serial_pxa_probe_dt (struct platform_device *pdev,int *portid) +{ +struct device_node *np = pdev->dev.of_node; +int ret; + +if (!np) +return -ENODEV ; + + ret =of_alias_get_id (np,"serial" ); +if (ret <0 ) { +dev_err (&pdev->dev,"Failed to get alias id, errno %d\n" , ret); +return -ENODEV ; + } + + *portid = ret; + +return 0 ; +} +#else +static inline int serial_pxa_probe_dt (struct platform_device *pdev,int *portid) +{ +return 0 ; +} +#endif +static int serial_pxa_probe (struct platform_device *dev) {struct uart_pxa_port *sport;struct resource *mmres, *irqres;int ret; +int portid = dev->id; + + ret =serial_pxa_probe_dt (dev, &portid); +if (ret == -EINVAL ) +return 0 ; mmres =platform_get_resource (dev,IORESOURCE_MEM ,0 ); irqres =platform_get_resource (dev,IORESOURCE_IRQ ,0 );@@ -808,12 +847,12 @@ static int serial_pxa_probe(struct platform_device *dev) sport->port.irq = irqres->start; sport->port.fifosize =64 ; sport->port.ops = &serial_pxa_pops; - sport->port.line = dev->id; + sport->port.line = portid; sport->port.dev = &dev->dev; sport->port.flags =UPF_IOREMAP |UPF_BOOT_AUTOCONF ; sport->port.uartclk =clk_get_rate (sport->clk); -switch (dev->id) { +switch (portid) {case 0 : sport->name ="FFUART" ;break ;case 1 : sport->name ="BTUART" ;break ;case 2 : sport->name ="STUART" ;break ;@@ -829,7 +868,7 @@ static int serial_pxa_probe(struct platform_device *dev) goto err_clk; } - serial_pxa_ports[dev->id] = sport; + serial_pxa_ports[portid] = sport;uart_add_one_port (&serial_pxa_reg, &sport->port);platform_set_drvdata (dev, sport);@@ -866,6 +905,7 @@ static struct platform_driver serial_pxa_driver = {#ifdef CONFIG_PM .pm = &serial_pxa_pm_ops, #endif + .of_match_table = of_match_ptr(serial_pxa_dt_ids), }, };
PATCH v2 1/3 ARM: pxa: Add DT support to pxa2xx-uart
Quoted 10 lines · Marek Vasut
Quoted 7 lines
Add device tree binding for PXA2xx UARTs. Tested on Vpac270 board.
Signed-off-by Marek Vasut <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Grant Likely <[email protected]>Cc Rob Herring <[email protected]>---
Acked-by Rob Herring <[email protected]>
Thanks for explaining stuff, Rob!
M
PATCH v2 1/3 ARM: pxa: Add DT support to pxa2xx-uart
In reply to Marek VasutQuoted 12 lines · Marek Vasut
drivers/tty/serial/pxa.c +8
-0@@ -781,11 +783,48 @@ static const struct dev_pm_ops serial_pxa_pm_ops = { };#endif +#ifdef CONFIG_OF +static struct of_device_id serial_pxa_dt_ids[] = { + { .compatible ="marvell,pxa2xx-uart" }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, serial_pxa_dt_ids); + +static int serial_pxa_probe_dt (struct platform_device *pdev,int *portid)
drivers/tty/serial/pxa.c static const struct dev_pm_ops serial_pxa_pm_ops = { · line 803
Quoted 10 lines
drivers/tty/serial/pxa.c +10
-0+{ +struct device_node *np = pdev->dev.of_node; +int ret; + +if (!np) +return -ENODEV ; + + ret =of_alias_get_id (np,"serial" ); +if (ret <0 ) { +dev_err (&pdev->dev,"Failed to get alias id, errno %d\n" , ret);
Is this documented somewhere (eg, an example dt snippet for a PXA uart).
There is the requirement that new DT bindings must be documented.
PATCH v2 1/3 ARM: pxa: Add DT support to pxa2xx-uart
Quoted 19 lines · Marek Vasut
Quoted 18 lines
drivers/tty/serial/pxa.c +11
-0@@ -781,11 +783,48 @@ static const struct dev_pm_ops serial_pxa_pm_ops = { };#endif +#ifdef CONFIG_OF +static struct of_device_id serial_pxa_dt_ids[] = { + { .compatible ="marvell,pxa2xx-uart" }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, serial_pxa_dt_ids); + +static int serial_pxa_probe_dt (struct platform_device *pdev,int *portid) +{ +struct device_node *np = pdev->dev.of_node; +int ret; +
Quoted 8 lines
drivers/tty/serial/pxa.c static const struct dev_pm_ops serial_pxa_pm_ops = { · line 803
Quoted 6 lines
drivers/tty/serial/pxa.c +6
-0+if (!np) +return -ENODEV ; + + ret =of_alias_get_id (np,"serial" ); +if (ret <0 ) { +dev_err (&pdev->dev,"Failed to get alias id, errno %d\n" , ret);Is this documented somewhere (eg, an example dt snippet for a PXA uart).
Yes it is, in patch 3/3 I'm adding an example DT code for vpac270 machine.
Quoted 2 lines
There is the requirement that new DT bindings must be documented.
Thank you for guiding me, I really fell into deep water here.
PATCH v2 1/3 ARM: pxa: Add DT support to pxa2xx-uart
Quoted 28 lines · Marek Vasut
Quoted 19 lines · Marek Vasut
Quoted 18 lines
drivers/tty/serial/pxa.c +11
-0@@ -781,11 +783,48 @@ static const struct dev_pm_ops serial_pxa_pm_ops = { };#endif +#ifdef CONFIG_OF +static struct of_device_id serial_pxa_dt_ids[] = { + { .compatible ="marvell,pxa2xx-uart" }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, serial_pxa_dt_ids); + +static int serial_pxa_probe_dt (struct platform_device *pdev,int *portid) +{ +struct device_node *np = pdev->dev.of_node; +int ret; +Quoted 8 lines
drivers/tty/serial/pxa.c static const struct dev_pm_ops serial_pxa_pm_ops = { · line 803
Quoted 6 lines
drivers/tty/serial/pxa.c +6
-0+if (!np) +return -ENODEV ; + + ret =of_alias_get_id (np,"serial" ); +if (ret <0 ) { +dev_err (&pdev->dev,"Failed to get alias id, errno %d\n" , ret);Is this documented somewhere (eg, an example dt snippet for a PXA uart).
Quoted 1 line
Yes it is, in patch 3/3 I'm adding an example DT code for vpac270 machine.
No, you need to add both machine and uart binding documentation in Documentation/devicetree/bindings/
Rob
Quoted 5 lines
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH RESEND 2/3 ARM: pxa: Add DT testing machine
In reply to Marek VasutI use the Voipac PXA270 board for PXA DT conversion. This board is a helper for the conversion to go smoothly and the testing to be easy.
--- arch/arm/mach-pxa/Kconfig | 15 +++++++ arch/arm/mach-pxa/Makefile | 3 + arch/arm/mach-pxa/vpac270-dt.c | 82 ++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-pxa/vpac270.c | 2 + 4 files changed, 102 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-pxa/vpac270-dt.c
arch/arm/mach-pxa/Kconfig +15 -0
@@ -616,6 +616,21 @@ config MACH_ZIPIT2 bool "Zipit Z2 Handheld" select PXA27x select HAVE_PWM +config MACH_VPAC_DT + bool "PXA (Voipac270) FDT Machine" + select PXA27x + select OF + depends on !MACH_VPAC270 && EXPERIMENTAL + help + PXA Device Tree Machine. + This is to be a generic machine which probes all of it's drivers + using the Flattened Device Tree blob. This is work-in-progress + so don't expect much yet. We selected the Voipac PXA270 device + as a base device to test support along the way. + + NOTE: This platform is mutually exclusive with the original! + NOTE: Use only if you know what you're doing!! + endif endmenu
arch/arm/mach-pxa/Makefile +3 -0
@@ -104,3 +104,6 @@ led-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o obj-$(CONFIG_LEDS) += $(led-y) obj-$(CONFIG_TOSA_BT) += tosa-bt.o + +# PXA FDT board +obj-$(CONFIG_MACH_VPAC_DT) += vpac270-dt.o
arch/arm/mach-pxa/vpac270-dt.c new file +82 -0
82 lines not on this page · raw message
arch/arm/mach-pxa/vpac270.c +2 -0
@@ -715,6 +715,7 @@ static void __init vpac270_init(void)vpac270_ide_init (); } +#ifndef CONFIG_MACH_VPAC_DT MACHINE_START (VPAC270 ,"Voipac PXA270" ) .atag_offset = 0x100, .map_io = pxa27x_map_io,
@@ -723,3 +724,4 @@ MACHINE_START(VPAC270, "Voipac PXA270") .timer = &pxa_timer, .init_machine = vpac270_init MACHINE_END +#endif
Signature · 1 line
1.7.7.1
PATCH RESEND 2/3 ARM: pxa: Add DT testing machine
Quoted 20 lines · Marek Vasut
I use the Voipac PXA270 board for PXA DT conversion. This board is a helper for the conversion to go smoothly and the testing to be easy.
Signed-off-by Marek Vasut <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Grant Likely <[email protected]>Cc Rob Herring <[email protected]>--- arch/arm/mach-pxa/Kconfig | 15 +++++++ arch/arm/mach-pxa/Makefile | 3 + arch/arm/mach-pxa/vpac270-dt.c | 82 ++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-pxa/vpac270.c | 2 + 4 files changed, 102 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-pxa/vpac270-dt.carch/arm/mach-pxa/Kconfig +0
-0
arch/arm/mach-pxa/Kconfig config MACH_ZIPIT2 · line 618
Quoted 3 lines
arch/arm/mach-pxa/Kconfig +0
-0@@ -616,6 +616,21 @@ config MACH_ZIPIT2 bool "Zipit Z2 Handheld" select PXA27x select HAVE_PWM
Add a blank line.
arch/arm/mach-pxa/Kconfig config MACH_ZIPIT2 · line 620
Quoted 2 lines
arch/arm/mach-pxa/Kconfig +2
-0+config MACH_VPAC_DT + bool "PXA (Voipac270) FDT Machine"
This should be more generic to be all PXA DT machines.
arch/arm/mach-pxa/Kconfig config MACH_ZIPIT2 · line 623
Quoted 3 lines
arch/arm/mach-pxa/Kconfig +3
-0+ select PXA27x + select OF + depends on !MACH_VPAC270 && EXPERIMENTAL
Drop these depends.
arch/arm/mach-pxa/Kconfig config MACH_ZIPIT2 · line 631
Quoted 8 lines
arch/arm/mach-pxa/Kconfig +8
-0+ help + PXA Device Tree Machine. + This is to be a generic machine which probes all of it's drivers + using the Flattened Device Tree blob. This is work-in-progress + so don't expect much yet. We selected the Voipac PXA270 device + as a base device to test support along the way. + + NOTE: This platform is mutually exclusive with the original!
It shouldn't need to be.
Quoted 43 lines
arch/arm/mach-pxa/Kconfig +2
-0+ NOTE: Use only if you know what you're doing!! + endif endmenuarch/arm/mach-pxa/Makefile +3
-0@@ -104,3 +104,6 @@ led-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o obj-$(CONFIG_LEDS) += $(led-y) obj-$(CONFIG_TOSA_BT) += tosa-bt.o + +# PXA FDT board +obj-$(CONFIG_MACH_VPAC_DT) += vpac270-dt.oarch/arm/mach-pxa/vpac270-dt.c new file +21
-0@@ -0,0 +1,82 @@ +/* +* Hardware definitions for Voipac PXA270 driven by FDT +* +* Copyright (C) 2011 Marek Vasut <[email protected]> +* +* NOTE: This is an ongoing effort of preparing generic FDT-based board +* for PXA machines. This particular device allows us to test the +* support for breakage. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +* +*/ + +#include <linux/of_platform.h> +#include <linux/irqdomain.h> +#include "vpac270.c" + +/****************************************************************************** +* Machine init
arch/arm/mach-pxa/vpac270-dt.c line 31
Quoted 10 lines
arch/arm/mach-pxa/vpac270-dt.c new file +10
-0+******************************************************************************/ +static const struct of_device_id pxairq_of_match[]__initconst = { + { .compatible ="marvell,pxa-irq" , }, + {}, +}; + +static void __init pxa_dt_init_irq (void ) +{ +irq_domain_generate_simple (pxairq_of_match,0x40d00000 ,0 ); +pxa27x_init_irq ();
Ideally the interrupt controller itself would be converted over to support domains and DT init.
arch/arm/mach-pxa/vpac270-dt.c line 37
Quoted 6 lines
arch/arm/mach-pxa/vpac270-dt.c new file +6
-0+} + +static struct of_device_id pxa_dt_match_table[]__initdata = { + { .compatible ="simple-bus" , }, + {} +};
Any reason you can't use the default table?
arch/arm/mach-pxa/vpac270-dt.c line 43
Quoted 6 lines
arch/arm/mach-pxa/vpac270-dt.c new file +6
-0+ +static const struct of_dev_auxdata pxa_dt_auxdata_table[]__initconst = { +OF_DEV_AUXDATA ("marvell,pxa2xx-uart" ,0x40100000 ,"pxa2xx-uart.0" ,NULL ), +OF_DEV_AUXDATA ("marvell,pxa2xx-uart" ,0x40200000 ,"pxa2xx-uart.1" ,NULL ), +OF_DEV_AUXDATA ("marvell,pxa2xx-uart" ,0x40700000 ,"pxa2xx-uart.2" ,NULL ), +};
Is this for clkdev? If so, you can just add additional lookups using the DT device name.
Quoted 14 lines
arch/arm/mach-pxa/vpac270-dt.c new file +14
-0+ +static void __init vpac270_dt_init (void ) +{ +pxa2xx_mfp_config (ARRAY_AND_SIZE (vpac270_pin_config)); + +of_platform_populate (NULL , pxa_dt_match_table, + pxa_dt_auxdata_table,NULL ); + +pxa_set_i2c_info (NULL ); +pxa27x_set_i2c_power_info (NULL ); + +vpac270_pmic_init (); +vpac270_lcd_init (); +vpac270_mmc_init ();
arch/arm/mach-pxa/vpac270-dt.c line 67
Quoted 10 lines
arch/arm/mach-pxa/vpac270-dt.c new file +10
-0+vpac270_nor_init (); +vpac270_onenand_init (); +vpac270_leds_init (); +vpac270_keys_init (); +vpac270_uhc_init (); +vpac270_udc_init (); +vpac270_eth_init (); +vpac270_ts_init (); +vpac270_rtc_init (); +vpac270_ide_init ();
Generally, devices get added as they are converted to use DT.
Quoted 28 lines
arch/arm/mach-pxa/vpac270-dt.c new file +15
-0+} + +static const char *vpac270_dt_board_compat[]__initdata = { +"voipac,vpac270" , +NULL +}; + +DT_MACHINE_START (PXA_DT ,"Marvell PXA2xx/PXA3xx (Flattened Device Tree)" ) + .map_io = pxa27x_map_io, + .init_irq = pxa_dt_init_irq, + .handle_irq = pxa27x_handle_irq, + .timer = &pxa_timer, + .init_machine = vpac270_dt_init, + .dt_compat = vpac270_dt_board_compat, +MACHINE_END arch/arm/mach-pxa/vpac270.c +1
-0@@ -715,6 +715,7 @@ static void __init vpac270_init(void)vpac270_ide_init (); } +#ifndef CONFIG_MACH_VPAC_DT MACHINE_START (VPAC270 ,"Voipac PXA270" ) .atag_offset = 0x100, .map_io = pxa27x_map_io,
arch/arm/mach-pxa/vpac270.c MACHINE_START(VPAC270, "Voipac PXA270") · line 727
Quoted 4 lines
arch/arm/mach-pxa/vpac270.c +1
-0@@ -723,3 +724,4 @@ MACHINE_START(VPAC270, "Voipac PXA270") .timer = &pxa_timer, .init_machine = vpac270_init MACHINE_END +#endif
You shouldn't need this ifndef.
Rob
PATCH RESEND 2/3 ARM: pxa: Add DT testing machine
Quoted 30 lines · Marek Vasut
Quoted 22 lines
I use the Voipac PXA270 board for PXA DT conversion. This board is a helper for the conversion to go smoothly and the testing to be easy.
Signed-off-by Marek Vasut <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Grant Likely <[email protected]>Cc Rob Herring <[email protected]>---
arch/arm/mach-pxa/Kconfig | 15 +++++++ arch/arm/mach-pxa/Makefile | 3 + arch/arm/mach-pxa/vpac270-dt.c | 82 ++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-pxa/vpac270.c | 2 + 4 files changed, 102 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-pxa/vpac270-dt.carch/arm/mach-pxa/Kconfig +0
-0arch/arm/mach-pxa/Kconfig config MACH_ZIPIT2 · line 619
Quoted 4 lines
arch/arm/mach-pxa/Kconfig +0
-0@@ -616,6 +616,21 @@ config MACH_ZIPIT2 bool "Zipit Z2 Handheld" select PXA27x select HAVE_PWMAdd a blank line.
Quoted 4 lines
arch/arm/mach-pxa/Kconfig config MACH_ZIPIT2 · line 620
Quoted 2 lines
arch/arm/mach-pxa/Kconfig +2
-0+config MACH_VPAC_DT + bool "PXA (Voipac270) FDT Machine"This should be more generic to be all PXA DT machines.
I need an initial porting machine, isn't it explicit enough ... the description below I mean.
Quoted 6 lines
arch/arm/mach-pxa/Kconfig config MACH_ZIPIT2 · line 623
Quoted 4 lines
arch/arm/mach-pxa/Kconfig +3
-0+ select PXA27x + select OF + depends on !MACH_VPAC270 && EXPERIMENTALDrop these depends.
Nope
Quoted 11 lines
arch/arm/mach-pxa/Kconfig config MACH_ZIPIT2 · line 631
Quoted 9 lines
arch/arm/mach-pxa/Kconfig +8
-0+ help + PXA Device Tree Machine. + This is to be a generic machine which probes all of it's drivers + using the Flattened Device Tree blob. This is work-in-progress + so don't expect much yet. We selected the Voipac PXA270 device + as a base device to test support along the way. + + NOTE: This platform is mutually exclusive with the original!It shouldn't need to be.
I want it that way ... eventually, this will be renamed to PXA_DT, but not now.
Quoted 53 lines
Quoted 53 lines
arch/arm/mach-pxa/Kconfig +2
-0+ NOTE: Use only if you know what you're doing!! + endifendmenu
arch/arm/mach-pxa/Makefile +3
-0@@ -104,3 +104,6 @@ led-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o obj-$(CONFIG_LEDS) += $(led-y) obj-$(CONFIG_TOSA_BT) += tosa-bt.o + +# PXA FDT board +obj-$(CONFIG_MACH_VPAC_DT) += vpac270-dt.o(quoted diff) +0
-0
b/arch/arm/mach-pxa/vpac270-dt.cnew file mode 100644 index 0000000..dc9a6ddarch/arm/mach-pxa/vpac270-dt.c new file +20
-0@@ -0,0 +1,82 @@ +/* +* Hardware definitions for Voipac PXA270 driven by FDT +* +* Copyright (C) 2011 Marek Vasut <[email protected]> +* +* NOTE: This is an ongoing effort of preparing generic FDT-based board +* for PXA machines. This particular device allows us to test the +* support for breakage. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +* +*/ + +#include <linux/of_platform.h> +#include <linux/irqdomain.h> +#include "vpac270.c" + +/*********************************************************************** ******* + * Machine init
+
************************************************************************
******/ +static const structof_device_idpxairq_of_match[]__initconst=
{ + { .compatible = "marvell,pxa-irq", },arch/arm/mach-pxa/vpac270-dt.c new file +2
-0+ {}, +};
Quoted 8 lines
arch/arm/mach-pxa/vpac270-dt.c line 31
Quoted 5 lines
arch/arm/mach-pxa/vpac270-dt.c new file +5
-0+ +static void __init pxa_dt_init_irq (void ) +{ +irq_domain_generate_simple (pxairq_of_match,0x40d00000 ,0 ); +pxa27x_init_irq ();Ideally the interrupt controller itself would be converted over to support domains and DT init.
That's the long-term plan.
Quoted 9 lines
arch/arm/mach-pxa/vpac270-dt.c line 37
Quoted 7 lines
arch/arm/mach-pxa/vpac270-dt.c new file +6
-0+} + +static struct of_device_id pxa_dt_match_table[]__initdata = { + { .compatible ="simple-bus" , }, + {} +};Any reason you can't use the default table?
What default table?
Quoted 10 lines
Quoted 7 lines
arch/arm/mach-pxa/vpac270-dt.c new file +2
-0+ +static const struct of_dev_auxdata pxa_dt_auxdata_table[] __initconst ={ + OF_DEV_AUXDATA("marvell,pxa2xx-uart",
0x40100000, "pxa2xx-uart.0",
NULL), + OF_DEV_AUXDATA("marvell,pxa2xx-uart",0x40200000,
"pxa2xx-uart.1", NULL), + OF_DEV_AUXDATA("marvell,pxa2xx-uart",0x40700000, "pxa2xx-uart.2", NULL), +};Is this for clkdev? If so, you can just add additional lookups using the DT device name.
What do you mean?
Quoted 19 lines
Quoted 19 lines
arch/arm/mach-pxa/vpac270-dt.c new file +18
-0+ +static void __init vpac270_dt_init (void ) +{ +pxa2xx_mfp_config (ARRAY_AND_SIZE (vpac270_pin_config)); + +of_platform_populate (NULL , pxa_dt_match_table, + pxa_dt_auxdata_table,NULL ); + +pxa_set_i2c_info (NULL ); +pxa27x_set_i2c_power_info (NULL ); + +vpac270_pmic_init (); +vpac270_lcd_init (); +vpac270_mmc_init (); +vpac270_nor_init (); +vpac270_onenand_init (); +vpac270_leds_init (); +vpac270_keys_init ();
Quoted 8 lines
arch/arm/mach-pxa/vpac270-dt.c line 67
Quoted 6 lines
arch/arm/mach-pxa/vpac270-dt.c new file +6
-0+vpac270_uhc_init (); +vpac270_udc_init (); +vpac270_eth_init (); +vpac270_ts_init (); +vpac270_rtc_init (); +vpac270_ide_init ();Generally, devices get added as they are converted to use DT.
Well the board won't boot purely from DT yet ... and to see it breaks nothing, I'm comparing it to non-dt implementation.
Quoted 35 lines
Quoted 35 lines
arch/arm/mach-pxa/vpac270-dt.c new file +8
-0+} + +static const char *vpac270_dt_board_compat[]__initdata = { +"voipac,vpac270" , +NULL +}; + +DT_MACHINE_START(PXA_DT, "Marvell PXA2xx/PXA3xx (Flattened DeviceTree)") + .map_io =
pxa27x_map_io,arch/arm/mach-pxa/vpac270-dt.c new file +6
-0+ .init_irq = pxa_dt_init_irq, + .handle_irq = pxa27x_handle_irq, + .timer = &pxa_timer, + .init_machine = vpac270_dt_init, + .dt_compat = vpac270_dt_board_compat, +MACHINE_END arch/arm/mach-pxa/vpac270.c +1
-0@@ -715,6 +715,7 @@ static void __init vpac270_init(void)vpac270_ide_init (); } +#ifndef CONFIG_MACH_VPAC_DT
MACHINE_START(VPAC270, "Voipac PXA270")arch/arm/mach-pxa/vpac270.c +0
-0.atag_offset = 0x100, .map_io = pxa27x_map_io,@@ -723,3 +724,4 @@ MACHINE_START(VPAC270, "Voipac PXA270")
Quoted 8 lines
arch/arm/mach-pxa/vpac270.c MACHINE_START(VPAC270, "Voipac PXA270") · line 727
Quoted 6 lines
arch/arm/mach-pxa/vpac270.c +1
-0.timer = &pxa_timer, .init_machine = vpac270_init MACHINE_END +#endif You shouldn't need this ifndef.
For some reason, it refuses to boot if I do have both compiled in.
Quoted 2 lines
Rob
M
PATCH RESEND 2/3 ARM: pxa: Add DT testing machine
Quoted 20 lines · Marek Vasut
Quoted 19 lines · Marek Vasut
Quoted 8 lines
I use the Voipac PXA270 board for PXA DT conversion. This board is a helper for the conversion to go smoothly and the testing to be easy.
Signed-off-by Marek Vasut <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Grant Likely <[email protected]>Cc Rob Herring <[email protected]>---
arch/arm/mach-pxa/Kconfig config MACH_ZIPIT2 · line 631
Quoted 8 lines
arch/arm/mach-pxa/Kconfig +8
-0+ help + PXA Device Tree Machine. + This is to be a generic machine which probes all of it's drivers + using the Flattened Device Tree blob. This is work-in-progress + so don't expect much yet. We selected the Voipac PXA270 device + as a base device to test support along the way. + + NOTE: This platform is mutually exclusive with the original!It shouldn't need to be.
Quoted 1 line
I want it that way ... eventually, this will be renamed to
PXA_DT, but not now.
Nah, do it now. Aim high. :-)
g.
PATCH RESEND 2/3 ARM: pxa: Add DT testing machine
Quoted 5 lines · Marek Vasut
Quoted 4 lines
Quoted 4 lines · Marek Vasut
Quoted 3 lines
I use the Voipac PXA270 board for PXA DT conversion. This board is a helper for the conversion to go smoothly and the testing to be easy.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
arch/arm/mach-pxa/Kconfig config MACH_ZIPIT2
Quoted 8 lines
Signed-off-by Marek Vasut <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Grant Likely <[email protected]>Cc Rob Herring <[email protected]>---
arch/arm/mach-pxa/Kconfig +3
-0+ help + PXA Device Tree Machine. + This is to be a generic machine which probes all of it's
drivers
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
arch/arm/mach-pxa/Kconfig config MACH_ZIPIT2 · line 631
Quoted 5 lines
arch/arm/mach-pxa/Kconfig +5
-0+ using the Flattened Device Tree blob. This is work-in-progress + so don't expect much yet. We selected the Voipac PXA270 device + as a base device to test support along the way. + + NOTE: This platform is mutually exclusive with the original!It shouldn't need to be.
Quoted 6 lines
Quoted 2 lines
I want it that way ... eventually, this will be renamed to
PXA_DT, but not now.Nah, do it now. Aim high. :-)
g.
Hehe, all right then. This patch shall be reworked soon. Also, I'll push the patchset to k.org git soon.
btw. what's the exact git repo and branch I should rebase this on?
PATCH RESEND 2/3 ARM: pxa: Add DT testing machine
Quoted 25 lines · Marek Vasut
Quoted 5 lines · Marek Vasut
Quoted 4 lines
Quoted 4 lines · Marek Vasut
Quoted 3 lines
I use the Voipac PXA270 board for PXA DT conversion. This board is a helper for the conversion to go smoothly and the testing to be easy.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
arch/arm/mach-pxa/Kconfig config MACH_ZIPIT2
Quoted 8 lines
Signed-off-by Marek Vasut <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Grant Likely <[email protected]>Cc Rob Herring <[email protected]>---
arch/arm/mach-pxa/Kconfig +3
-0+ help + PXA Device Tree Machine. + This is to be a generic machine which probes all of it'sdrivers
Quoted 11 lines
Quoted 10 lines
Quoted 7 lines
arch/arm/mach-pxa/Kconfig config MACH_ZIPIT2 · line 631
Quoted 5 lines
arch/arm/mach-pxa/Kconfig +5
-0+ using the Flattened Device Tree blob. This is work-in-progress + so don't expect much yet. We selected the Voipac PXA270 device + as a base device to test support along the way. + + NOTE: This platform is mutually exclusive with the original!It shouldn't need to be.
I want it that way ... eventually, this will be renamed to
PXA_DT, but not now.
Quoted 8 lines
Quoted 3 lines
Nah, do it now. Aim high. :-)
g.
Hehe, all right then. This patch shall be reworked soon. Also, I'll push the patchset to k.org git soon.
btw. what's the exact git repo and branch I should rebase this on?
The minimum -rcX you are dependent on. Clearly document (for Arnd) any other branches you are dependent on. That doesn't really matter until you are ready to send to Arnd though.
Rob
PATCH RESEND 2/3 ARM: pxa: Add DT testing machine
In reply to Marek VasutQuoted 58 lines · Marek Vasut
Quoted 30 lines · Marek Vasut
Quoted 22 lines
I use the Voipac PXA270 board for PXA DT conversion. This board is a helper for the conversion to go smoothly and the testing to be easy.
Signed-off-by Marek Vasut <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Grant Likely <[email protected]>Cc Rob Herring <[email protected]>---
arch/arm/mach-pxa/Kconfig | 15 +++++++ arch/arm/mach-pxa/Makefile | 3 + arch/arm/mach-pxa/vpac270-dt.c | 82 ++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-pxa/vpac270.c | 2 + 4 files changed, 102 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-pxa/vpac270-dt.carch/arm/mach-pxa/Kconfig +0
-0arch/arm/mach-pxa/Kconfig config MACH_ZIPIT2 · line 619
Quoted 4 lines
arch/arm/mach-pxa/Kconfig +0
-0@@ -616,6 +616,21 @@ config MACH_ZIPIT2 bool "Zipit Z2 Handheld" select PXA27x select HAVE_PWMAdd a blank line.
Quoted 4 lines
arch/arm/mach-pxa/Kconfig config MACH_ZIPIT2 · line 620
Quoted 2 lines
arch/arm/mach-pxa/Kconfig +2
-0+config MACH_VPAC_DT + bool "PXA (Voipac270) FDT Machine"This should be more generic to be all PXA DT machines.
I need an initial porting machine, isn't it explicit enough ... the description below I mean.
Quoted 6 lines
arch/arm/mach-pxa/Kconfig config MACH_ZIPIT2 · line 623
Quoted 4 lines
arch/arm/mach-pxa/Kconfig +3
-0+ select PXA27x + select OF + depends on !MACH_VPAC270 && EXPERIMENTALDrop these depends.
Nope
Quoted 11 lines
arch/arm/mach-pxa/Kconfig config MACH_ZIPIT2 · line 631
Quoted 9 lines
arch/arm/mach-pxa/Kconfig +8
-0+ help + PXA Device Tree Machine. + This is to be a generic machine which probes all of it's drivers + using the Flattened Device Tree blob. This is work-in-progress + so don't expect much yet. We selected the Voipac PXA270 device + as a base device to test support along the way. + + NOTE: This platform is mutually exclusive with the original!It shouldn't need to be.
Quoted 1 line
I want it that way ... eventually, this will be renamed to
PXA_DT, but not now.
And the maintainers don't want it that way.
The DT support is specific to a certain machine by the virtue of having 1 dts file. There is no reason to make the code specific, too.
Quoted 73 lines
Quoted 53 lines
Quoted 53 lines
arch/arm/mach-pxa/Kconfig +2
-0+ NOTE: Use only if you know what you're doing!! + endifendmenu
arch/arm/mach-pxa/Makefile +3
-0@@ -104,3 +104,6 @@ led-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o obj-$(CONFIG_LEDS) += $(led-y) obj-$(CONFIG_TOSA_BT) += tosa-bt.o + +# PXA FDT board +obj-$(CONFIG_MACH_VPAC_DT) += vpac270-dt.o(quoted diff) +0
-0
b/arch/arm/mach-pxa/vpac270-dt.cnew file mode 100644 index 0000000..dc9a6ddarch/arm/mach-pxa/vpac270-dt.c new file +20
-0@@ -0,0 +1,82 @@ +/* +* Hardware definitions for Voipac PXA270 driven by FDT +* +* Copyright (C) 2011 Marek Vasut <[email protected]> +* +* NOTE: This is an ongoing effort of preparing generic FDT-based board +* for PXA machines. This particular device allows us to test the +* support for breakage. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +* +*/ + +#include <linux/of_platform.h> +#include <linux/irqdomain.h> +#include "vpac270.c" + +/*********************************************************************** ******* + * Machine init
+
************************************************************************
******/ +static const structof_device_idpxairq_of_match[]__initconst=
{ + { .compatible = "marvell,pxa-irq", },arch/arm/mach-pxa/vpac270-dt.c new file +2
-0+ {}, +};Quoted 8 lines
arch/arm/mach-pxa/vpac270-dt.c line 31
Quoted 5 lines
arch/arm/mach-pxa/vpac270-dt.c new file +5
-0+ +static void __init pxa_dt_init_irq (void ) +{ +irq_domain_generate_simple (pxairq_of_match,0x40d00000 ,0 ); +pxa27x_init_irq ();Ideally the interrupt controller itself would be converted over to support domains and DT init.
That's the long-term plan.
Quoted 9 lines
arch/arm/mach-pxa/vpac270-dt.c line 37
Quoted 7 lines
arch/arm/mach-pxa/vpac270-dt.c new file +6
-0+} + +static struct of_device_id pxa_dt_match_table[]__initdata = { + { .compatible ="simple-bus" , }, + {} +};Any reason you can't use the default table?
Quoted 1 line
What default table?
of_default_bus_match_table
Quoted 11 lines
Quoted 10 lines
Quoted 7 lines
arch/arm/mach-pxa/vpac270-dt.c new file +2
-0+ +static const struct of_dev_auxdata pxa_dt_auxdata_table[] __initconst ={ + OF_DEV_AUXDATA("marvell,pxa2xx-uart",
0x40100000, "pxa2xx-uart.0",
NULL), + OF_DEV_AUXDATA("marvell,pxa2xx-uart",0x40200000,
"pxa2xx-uart.1", NULL), + OF_DEV_AUXDATA("marvell,pxa2xx-uart",0x40700000, "pxa2xx-uart.2", NULL), +};Is this for clkdev? If so, you can just add additional lookups using the DT device name.
Quoted 1 line
What do you mean?
The purpose of auxdata is for adding (hopefully temporary) platform_data to devices. You are not doing that, so the only other use I have seen is for clocks. You can instead just add more clkdev lookups which use the DT style dev name. See the at91 device tree support thread:
https://lkml.org/lkml/2011/10/24/226
Quoted 68 lines
Quoted 19 lines
Quoted 19 lines
arch/arm/mach-pxa/vpac270-dt.c new file +18
-0+ +static void __init vpac270_dt_init (void ) +{ +pxa2xx_mfp_config (ARRAY_AND_SIZE (vpac270_pin_config)); + +of_platform_populate (NULL , pxa_dt_match_table, + pxa_dt_auxdata_table,NULL ); + +pxa_set_i2c_info (NULL ); +pxa27x_set_i2c_power_info (NULL ); + +vpac270_pmic_init (); +vpac270_lcd_init (); +vpac270_mmc_init (); +vpac270_nor_init (); +vpac270_onenand_init (); +vpac270_leds_init (); +vpac270_keys_init ();Quoted 8 lines
arch/arm/mach-pxa/vpac270-dt.c line 67
Quoted 6 lines
arch/arm/mach-pxa/vpac270-dt.c new file +6
-0+vpac270_uhc_init (); +vpac270_udc_init (); +vpac270_eth_init (); +vpac270_ts_init (); +vpac270_rtc_init (); +vpac270_ide_init ();Generally, devices get added as they are converted to use DT.
Well the board won't boot purely from DT yet ... and to see it breaks nothing, I'm comparing it to non-dt implementation.
Quoted 38 lines
Quoted 38 lines
arch/arm/mach-pxa/vpac270-dt.c new file +8
-0+} + +static const char *vpac270_dt_board_compat[]__initdata = { +"voipac,vpac270" , +NULL +}; + +DT_MACHINE_START(PXA_DT, "Marvell PXA2xx/PXA3xx (Flattened DeviceTree)") + .map_io =
pxa27x_map_io,arch/arm/mach-pxa/vpac270-dt.c new file +6
-0+ .init_irq = pxa_dt_init_irq, + .handle_irq = pxa27x_handle_irq, + .timer = &pxa_timer, + .init_machine = vpac270_dt_init, + .dt_compat = vpac270_dt_board_compat, +MACHINE_END arch/arm/mach-pxa/vpac270.c +1
-0@@ -715,6 +715,7 @@ static void __init vpac270_init(void)vpac270_ide_init (); } +#ifndef CONFIG_MACH_VPAC_DT
MACHINE_START(VPAC270, "Voipac PXA270")arch/arm/mach-pxa/vpac270.c +0
-0.atag_offset = 0x100, .map_io = pxa27x_map_io,@@ -723,3 +724,4 @@ MACHINE_START(VPAC270, "Voipac PXA270") .timer = &pxa_timer, .init_machine = vpac270_init
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
MACHINE_END+#endif
You shouldn't need this ifndef.
For some reason, it refuses to boot if I do have both compiled in.
That doesn't really sound like a good reason. Perhaps you have initcalls which run unconditionally.
Rob
PATCH RESEND 2/3 ARM: pxa: Add DT testing machine
Quoted 19 lines · Rob Herring
Quoted 18 lines · Marek Vasut
Quoted 17 lines
Quoted 12 lines
+#ifndef ? ?CONFIG_MACH_VPAC_DT
?MACHINE_START(VPAC270, "Voipac PXA270")
? ? .atag_offset ? ?=
0x100,
? ? .map_io ? ? ? ? =pxa27x_map_io,(quoted diff) +0
-0@@ -723,3 +724,4 @@ MACHINE_START(VPAC270, "Voipac PXA270") ? ? .timer ? ? ? ? ?= &pxa_timer,? ? .init_machine ? =
vpac270_initQuoted 3 lines
?MACHINE_END
+#endif
You shouldn't need this ifndef.
Quoted 5 lines
Quoted 2 lines
For some reason, it refuses to boot if I do have both compiled in.
That doesn't really sound like a good reason. Perhaps you have initcalls which run unconditionally.
Yes, this is very important. Turning on DT support must not break non-DT support in the same kernel. You must be able to configure both into the kernel and then boot both with and without DT (assuming of course that non-DT booting is supported already in the kernel). The reason for this is that it is a lot more friendly to debug DT support when the same kernel can still be booted the old way after turning DT on. I am unlikely to be moved on this point.
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
PATCH v2 3/3 ARM: pxa: Add basic DTS files for PXA/Vpac270 testing machine
In reply to Marek Vasut--- arch/arm/boot/dts/pxa-vpac270.dts | 37 +++++++++++++++++++ arch/arm/boot/dts/pxa.dtsi | 71 +++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/pxa-vpac270.dts create mode 100644 arch/arm/boot/dts/pxa.dtsi
V2: Fix typo -- rename alias -> aliases in the pxa270.dtsi
Drop marvell,pxa250 option, instead leave all ports disable and let user select, which will be registered. This depends on the user not doing something stupid (like registering HWUART, which is available only on pxa250) on pxa320.
arch/arm/boot/dts/pxa-vpac270.dts new file +37 -0
@@ -0,0 +1,37 @@ +/* + * pxa-vpac270.dts - Device Tree file for Voipac PXA270 board + * + * Copyright (C) 2011 Marek Vasut <[email protected]> + * + * Licensed under GPLv2 or later. + */ +/dts-v1/; +/include/ "pxa.dtsi" + +/ { + model = "Voipac VPAC270"; + compatible = "voipac,vpac270"; + + chosen { + bootargs = "console=ttyS0,115200 mem=128M at 0xa0000000"; + linux,stdout-path = &ffuart; + }; + + memory at a0000000 { + reg = <0xa0000000 0x8000000>; + }; + + pxabus { + ffuart: uart at 40100000 { + status = "okay"; + }; + + btuart: uart at 40200000 { + status = "okay"; + }; + + stuart: uart at 40700000 { + status = "okay"; + }; + }; +};
arch/arm/boot/dts/pxa.dtsi new file +71 -0
71 lines not on this page · raw message
Signature · 1 line
1.7.7.1
PATCH v2 3/3 ARM: pxa: Add basic DTS files for PXA/Vpac270 testing machine
Quoted 5 lines · Marek Vasut
Signed-off-by Marek Vasut <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Grant Likely <[email protected]>Cc Rob Herring <[email protected]>---
Couple of minor things below. With those fixed:
Quoted 11 lines
arch/arm/boot/dts/pxa-vpac270.dts | 37 +++++++++++++++++++ arch/arm/boot/dts/pxa.dtsi | 71 +++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/pxa-vpac270.dts create mode 100644 arch/arm/boot/dts/pxa.dtsiV2: Fix typo -- rename alias -> aliases in the
pxa270.dtsi
Drop marvell,pxa250 option, instead leave all ports disable and let user select, which will be registered. This depends on the user not doing something stupid (like registering HWUART, which is available only on pxa250) on pxa320.
Should be a safe assumption. Only someone capable of implementing board support should create a dts...
Quoted 13 lines
arch/arm/boot/dts/pxa-vpac270.dts new file +6
-0@@ -0,0 +1,37 @@ +/* + * pxa-vpac270.dts - Device Tree file for Voipac PXA270 board + * + * Copyright (C) 2011 Marek Vasut <[email protected]> + * + * Licensed under GPLv2 or later.
arch/arm/boot/dts/pxa-vpac270.dts line 16
Quoted 10 lines
arch/arm/boot/dts/pxa-vpac270.dts new file +10
-0+ */ +/dts-v1/; +/include/ "pxa.dtsi" + +/ { + model = "Voipac VPAC270"; + compatible = "voipac,vpac270"; + + chosen { + bootargs = "console=ttyS0,115200 mem=128M at 0xa0000000";
Isn't mem= redundant with the memory node below?
arch/arm/boot/dts/pxa-vpac270.dts line 25
Quoted 9 lines
arch/arm/boot/dts/pxa-vpac270.dts new file +9
-0+ linux,stdout-path = &ffuart; + }; + + memory at a0000000 { + reg = <0xa0000000 0x8000000>; + }; + + pxabus { + ffuart: uart at 40100000 {
These should be serial at ...
Quoted 89 lines
arch/arm/boot/dts/pxa-vpac270.dts new file +12
-0+ status = "okay"; + }; + + btuart: uart at 40200000 { + status = "okay"; + }; + + stuart: uart at 40700000 { + status = "okay"; + }; + }; +};arch/arm/boot/dts/pxa.dtsi new file +71
-0@@ -0,0 +1,71 @@ +/* + * pxa.dtsi - Device Tree Include file for Marvell PXA2xx/PXA3xx family SoC + * + * Copyright (C) 2011 Marek Vasut <[email protected]> + * + * Licensed under GPLv2 or later. + */ + +/include/ "skeleton.dtsi" + +/ { + model = "Marvell PXA2xx/PXA3xx family SoC"; + compatible = "marvell,pxa"; + interrupt-parent = <&pxairq>; + + aliases { + serial0 = &ffuart; + serial1 = &btuart; + serial2 = &stuart; + serial3 = &hwuart; + }; + + cpus { + cpu at 0 { + compatible = "arm,xscale"; + }; + }; + + pxabus { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + pxairq: interrupt-controller at 40d00000 { + #interrupt-cells = <1>; + compatible = "marvell,pxa-irq"; + interrupt-controller; + interrupt-parent; + reg = <0x40d00000 0xd0>; + }; + + ffuart: uart at 40100000 { + compatible = "marvell,pxa2xx-uart"; + reg = <0x40100000 0x30>; + interrupts = <22>; + status = "disabled"; + }; + + btuart: uart at 40200000 { + compatible = "marvell,pxa2xx-uart"; + reg = <0x40200000 0x30>; + interrupts = <21>; + status = "disabled"; + }; + + stuart: uart at 40700000 { + compatible = "marvell,pxa2xx-uart"; + reg = <0x40700000 0x30>; + interrupts = <20>; + status = "disabled"; + }; + + hwuart: uart at 41100000 { + compatible = "marvell,pxa2xx-uart"; + reg = <0x41100000 0x30>; + interrupts = <7>; + status = "disabled"; + }; + }; +};
PATCH v2 3/3 ARM: pxa: Add basic DTS files for PXA/Vpac270 testing machine
Quoted 44 lines · Marek Vasut
Quoted 5 lines
Signed-off-by Marek Vasut <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Grant Likely <[email protected]>Cc Rob Herring <[email protected]>---
Couple of minor things below. With those fixed:
Acked-by Rob Herring <[email protected]>Quoted 7 lines
arch/arm/boot/dts/pxa-vpac270.dts | 37 +++++++++++++++++++ arch/arm/boot/dts/pxa.dtsi | 71 +++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/pxa-vpac270.dts create mode 100644 arch/arm/boot/dts/pxa.dtsiQuoted 6 lines
V2: Fix typo -- rename alias -> aliases in the
pxa270.dtsiDrop marvell,pxa250 option, instead leave all ports disable and let user select, which will be registered. This depends on the user not doing something stupid (like registering HWUART, which is available only on pxa250) on pxa320.
Should be a safe assumption. Only someone capable of implementing board support should create a dts...
Quoted 16 lines
(quoted diff) +0
-0
b/arch/arm/boot/dts/pxa-vpac270.dtsnew file mode 100644 index 0000000..48dd9e5arch/arm/boot/dts/pxa-vpac270.dts new file +10
-0@@ -0,0 +1,37 @@ +/* + * pxa-vpac270.dts - Device Tree file for Voipac PXA270 board + * + * Copyright (C) 2011 Marek Vasut <[email protected]> + * + * Licensed under GPLv2 or later. + */ +/dts-v1/; +/include/ "pxa.dtsi" +
Quoted 8 lines
arch/arm/boot/dts/pxa-vpac270.dts line 16
Quoted 6 lines
arch/arm/boot/dts/pxa-vpac270.dts new file +6
-0+/ { + model = "Voipac VPAC270"; + compatible = "voipac,vpac270"; + + chosen { + bootargs = "console=ttyS0,115200 mem=128M at 0xa0000000";Isn't mem= redundant with the memory node below?
Yes it is, but ...
the board has 256MB or RAM, PXA assumes ram base at 0xa0000000, but the other node is at 0x80000000. U-Boot passes both nodes to kernel, kernel gets confused and crashes. Basically, we need to wait until uboot supports relative uImages (should be soon) and then we can drop this and use whole 256MB of RAM.
Quoted 12 lines
arch/arm/boot/dts/pxa-vpac270.dts line 25
Quoted 10 lines
arch/arm/boot/dts/pxa-vpac270.dts new file +9
-0+ linux,stdout-path = &ffuart; + }; + + memory at a0000000 { + reg = <0xa0000000 0x8000000>; + }; + + pxabus { + ffuart: uart at 40100000 {These should be serial at ...
Thanks, but why ? Is there some rule about it ?
PATCH v2 3/3 ARM: pxa: Add basic DTS files for PXA/Vpac270 testing machine
Quoted 53 lines · Marek Vasut
Quoted 44 lines · Marek Vasut
Quoted 5 lines
Signed-off-by Marek Vasut <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Grant Likely <[email protected]>Cc Rob Herring <[email protected]>---
Couple of minor things below. With those fixed:
Acked-by Rob Herring <[email protected]>Quoted 7 lines
arch/arm/boot/dts/pxa-vpac270.dts | 37 +++++++++++++++++++ arch/arm/boot/dts/pxa.dtsi | 71 +++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/pxa-vpac270.dts create mode 100644 arch/arm/boot/dts/pxa.dtsiQuoted 6 lines
V2: Fix typo -- rename alias -> aliases in the
pxa270.dtsiDrop marvell,pxa250 option, instead leave all ports disable and let user select, which will be registered. This depends on the user not doing something stupid (like registering HWUART, which is available only on pxa250) on pxa320.
Should be a safe assumption. Only someone capable of implementing board support should create a dts...
Quoted 16 lines
(quoted diff) +0
-0
b/arch/arm/boot/dts/pxa-vpac270.dtsnew file mode 100644 index 0000000..48dd9e5arch/arm/boot/dts/pxa-vpac270.dts new file +10
-0@@ -0,0 +1,37 @@ +/* + * pxa-vpac270.dts - Device Tree file for Voipac PXA270 board + * + * Copyright (C) 2011 Marek Vasut <[email protected]> + * + * Licensed under GPLv2 or later. + */ +/dts-v1/; +/include/ "pxa.dtsi" +Quoted 8 lines
arch/arm/boot/dts/pxa-vpac270.dts line 16
Quoted 6 lines
arch/arm/boot/dts/pxa-vpac270.dts new file +6
-0+/ { + model = "Voipac VPAC270"; + compatible = "voipac,vpac270"; + + chosen { + bootargs = "console=ttyS0,115200 mem=128M at 0xa0000000";Isn't mem= redundant with the memory node below?
Quoted 7 lines
Yes it is, but ...
the board has 256MB or RAM, PXA assumes ram base at
0xa0000000, but the other node is at0x80000000. U-Boot passes both nodes to kernel, kernel gets confused and crashes. Basically, we need to wait until uboot supports relative uImages (should be soon) and then we can drop this and use whole 256MB of RAM.
Okay.
Quoted 13 lines
Quoted 12 lines
arch/arm/boot/dts/pxa-vpac270.dts line 25
Quoted 10 lines
arch/arm/boot/dts/pxa-vpac270.dts new file +9
-0+ linux,stdout-path = &ffuart; + }; + + memory at a0000000 { + reg = <0xa0000000 0x8000000>; + }; + + pxabus { + ffuart: uart at 40100000 {These should be serial at ...
Quoted 1 line
Thanks, but why ? Is there some rule about it ?
There's generic names defined in ePAPR spec (It's a powerpc spec, but many parts still apply).
https://www.power.org/resources/downloads/Power_ePAPR_APPROVED_v1.0.pdf
Rob
v2 cover Initial PXA DT bindings
In reply to Marek VasutQuoted 12 lines · Marek Vasut
This patchset starts effort to convert PXA machines to DT. I started with PXA UART driver and added a stub machine, which I plan to eventually rename to board-pxa-dt when ready.
The file in patch 0002 contains style errors (line over 80), because they are 1 character over. To avoid crippling readability, I left that as is.
Marek Vasut (3):
ARM: pxa: Add DT support to pxa2xx-uart
ARM: pxa: Add DT testing machine
ARM: pxa: Add basic DTS files for PXA/Vpac270 testing machine
Quoted 11 lines
arch/arm/boot/dts/pxa-vpac270.dts | 37 +++++++++++++++++ arch/arm/boot/dts/pxa.dtsi | 71 ++++++++++++++++++++++++++++++++ arch/arm/mach-pxa/Kconfig | 15 +++++++ arch/arm/mach-pxa/Makefile | 3 + arch/arm/mach-pxa/vpac270-dt.c | 82 +++++++++++++++++++++++++++++++++++++ arch/arm/mach-pxa/vpac270.c | 2 + drivers/tty/serial/pxa.c | 46 +++++++++++++++++++- 7 files changed, 253 insertions(+), 3 deletions(-) create mode 100644 arch/arm/boot/dts/pxa-vpac270.dts create mode 100644 arch/arm/boot/dts/pxa.dtsi create mode 100644 arch/arm/mach-pxa/vpac270-dt.c
I wonder what happend to this patch series. I can't seem to find the patches in mainline, although it's more than 8 months ago when they were discussed. And I can't see any reason for rejecting them in the thread either.
I'd like to extend the support to PXA3xx chips and get rid of some board files in favour of DT. One uncertainty I have about that is clock handling. What's a good migration path to get those bits moved over?
Quoted 1 line
From what I can see, when probed solely from the device tree, device
names default to their base address, and the dev_id is a globally incrementing counter. Are platforms supposed to provide clock aliases in that form?
Daniel
v2 cover Initial PXA DT bindings
Quoted 4 lines · Daniel Mack
I wonder what happend to this patch series. I can't seem to find the patches in mainline, although it's more than 8 months ago when they were discussed. And I can't see any reason for rejecting them in the thread either.
I agree. The patches look like they were on the right track and then just dropped. If you have a vpac270 board, it would be nice if you could get them running on a newer kernel and submit them again. Of course if Marek is interested in picking up where he left, that would also be appreciated.
Quoted 7 lines
I'd like to extend the support to PXA3xx chips and get rid of some board files in favour of DT. One uncertainty I have about that is clock handling. What's a good migration path to get those bits moved over? From what I can see, when probed solely from the device tree, device names default to their base address, and the
dev_idis a globally incrementing counter. Are platforms supposed to provide clock aliases in that form?
There are three possible ways to handle that:
1. For the most basic conversion, use an auxdata table to restore the original names of all devices and don't touch the clock lookup table.
2. For a platform that has all (or most) boards converted to DT, try not to use an auxdata table and use the names from the device tree in the clock lookup table.
3. For new platforms and those that want to be up to the latest standards, use the common clock framework and put the clock lookup into the device tree using the new clock bindings.
For an incremental conversion, starting with the first option is usually the easiest.
Arnd
v2 cover Initial PXA DT bindings
Quoted 9 lines · Arnd Bergmann
Quoted 4 lines · Daniel Mack
I wonder what happend to this patch series. I can't seem to find the patches in mainline, although it's more than 8 months ago when they were discussed. And I can't see any reason for rejecting them in the thread either.
I agree. The patches look like they were on the right track and then just dropped. If you have a vpac270 board, it would be nice if you could get them running on a newer kernel and submit them again.
Nope, I don't.
Quoted 2 lines
Of course if Marek is interested in picking up where he left, that would also be appreciated.
What about just taking them as they are? I believe Marek tested them back in the days when he submitted.
Quoted 17 lines
Quoted 7 lines
I'd like to extend the support to PXA3xx chips and get rid of some board files in favour of DT. One uncertainty I have about that is clock handling. What's a good migration path to get those bits moved over? From what I can see, when probed solely from the device tree, device names default to their base address, and the
dev_idis a globally incrementing counter. Are platforms supposed to provide clock aliases in that form?There are three possible ways to handle that:
1. For the most basic conversion, use an auxdata table to restore the original names of all devices and don't touch the clock lookup table.
2. For a platform that has all (or most) boards converted to DT, try not to use an auxdata table and use the names from the device tree in the clock lookup table.
Quoted 6 lines
3. For new platforms and those that want to be up to the latest standards, use the common clock framework and put the clock lookup into the device tree using the new clock bindings.
For an incremental conversion, starting with the first option is usually the easiest.
Ok, good. I'll have a look. Thanks for explaining!
Daniel
v2 cover Initial PXA DT bindings
Quoted 5 lines · Daniel Mack
Quoted 2 lines
Of course if Marek is interested in picking up where he left, that would also be appreciated.
What about just taking them as they are? I believe Marek tested them back in the days when he submitted.
The patches are 9 months old now, which means the probably don't apply any more. If you send us a version that applies and builds on v3.5-rc7 and the maintainers don't object, we can definitely take them.
Arnd
v2 cover Initial PXA DT bindings
Quoted 10 lines · Arnd Bergmann
Quoted 5 lines · Daniel Mack
Quoted 2 lines
Of course if Marek is interested in picking up where he left, that would also be appreciated.
What about just taking them as they are? I believe Marek tested them back in the days when he submitted.
The patches are 9 months old now, which means the probably don't apply any more. If you send us a version that applies and builds on v3.5-rc7 and the maintainers don't object, we can definitely take them.
As Haojian is currently working on the support for MMP series, I'm not sure if he has any update on the PXA side?
v2 cover Initial PXA DT bindings
Quoted 5 lines · Eric Miao
Quoted 4 lines · Arnd Bergmann
Quoted 3 lines · Daniel Mack
Quoted 2 lines
Of course if Marek is interested in picking up where he left, that would also be appreciated.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
What about just taking them as they are? I believe Marek tested them back in the days when he submitted.
The patches are 9 months old now, which means the probably don't apply any more. If you send us a version that applies and builds on v3.5-rc7 and the maintainers don't object, we can definitely take them.
As Haojian is currently working on the support for MMP series,
I've seen that. The code looks very clean in that area.
Quoted 2 lines
I'm not
sure if he has any update on the PXA side?
If not, I would use the mmp code as reference. Just let me know :)
Daniel
v2 cover Initial PXA DT bindings
Quoted 13 lines · Daniel Mack
Quoted 12 lines · Eric Miao
Quoted 10 lines · Arnd Bergmann
Quoted 5 lines · Daniel Mack
Quoted 2 lines
Of course if Marek is interested in picking up where he left, that would also be appreciated.
What about just taking them as they are? I believe Marek tested them back in the days when he submitted.
The patches are 9 months old now, which means the probably don't apply any more. If you send us a version that applies and builds on v3.5-rc7 and the maintainers don't object, we can definitely take them.
Quoted 8 lines
Quoted 1 line
As Haojian is currently working on the support for MMP series,
I've seen that. The code looks very clean in that area.
Quoted 2 lines
I'm not
sure if he has any update on the PXA side?If not, I would use the mmp code as reference. Just let me know :)
Yeah, that would be great, thanks.
Haojian Zhuang
maintainerv2 cover Initial PXA DT bindings
In reply to Daniel MackQuoted 13 lines · Daniel Mack
Quoted 12 lines · Eric Miao
Quoted 10 lines · Arnd Bergmann
Quoted 5 lines · Daniel Mack
Quoted 2 lines
Of course if Marek is interested in picking up where he left, that would also be appreciated.
What about just taking them as they are? I believe Marek tested them back in the days when he submitted.
The patches are 9 months old now, which means the probably don't apply any more. If you send us a version that applies and builds on v3.5-rc7 and the maintainers don't object, we can definitely take them.
Quoted 10 lines
Quoted 1 line
As Haojian is currently working on the support for MMP series,
I've seen that. The code looks very clean in that area.
Quoted 2 lines
I'm not
sure if he has any update on the PXA side?If not, I would use the mmp code as reference. Just let me know :)
Thanks. I'll wait your new patches. :)
v2 cover Initial PXA DT bindings
In reply to Arnd BergmannQuoted 9 lines · Arnd Bergmann
Quoted 5 lines · Daniel Mack
Quoted 2 lines
Of course if Marek is interested in picking up where he left, that would also be appreciated.
What about just taking them as they are? I believe Marek tested them back in the days when he submitted.
The patches are 9 months old now, which means the probably don't apply any more.
Yes, you're right.
Quoted 2 lines
If you send us a version that applies and builds on v3.5-rc7 and the maintainers don't object, we can definitely take them.
I'll rework them and add other stuff as well, then send a new series.
Marek, I think it would be best if you wait a little and then rebase the Vpac specific bits.
Daniel
v2 cover Initial PXA DT bindings
Dear Daniel Mack,
Quoted 13 lines · Arnd Bergmann
Quoted 9 lines · Daniel Mack
Quoted 5 lines
Quoted 2 lines
Of course if Marek is interested in picking up where he left, that would also be appreciated.
What about just taking them as they are? I believe Marek tested them back in the days when he submitted.
The patches are 9 months old now, which means the probably don't apply any more.
Yes, you're right.
Quoted 7 lines
Quoted 2 lines
If you send us a version that applies and builds on v3.5-rc7 and the maintainers don't object, we can definitely take them.
I'll rework them and add other stuff as well, then send a new series.
Marek, I think it would be best if you wait a little and then rebase the Vpac specific bits.
I'll gladly wait. I'm stalled by hacking on the FSL chip now. I can try digging out the vpac board and try getting it running, but I won't promise a thing, ok?
Nine months ago -- that seems like some university stuff got in the way and I simply forgot about them later on.
Quoted 1 line
Daniel
Best regards,
Marek Vasut