All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Initial PXA DT bindings
@ 2011-11-01 18:32 Marek Vasut
  2011-11-01 18:32 ` [PATCH 1/3] ARM: pxa: Add DT support to pxa2xx-uart Marek Vasut
                   ` (3 more replies)
  0 siblings, 4 replies; 41+ messages in thread
From: Marek Vasut @ 2011-11-01 18:32 UTC (permalink / raw)
  To: linux-arm-kernel

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

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Grant Likely <grant.likely@secretlab.ca>

-- 
1.7.6.3

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 1/3] ARM: pxa: Add DT support to pxa2xx-uart
  2011-11-01 18:32 [PATCH 0/3] Initial PXA DT bindings Marek Vasut
@ 2011-11-01 18:32 ` Marek Vasut
  2011-11-01 20:00   ` Rob Herring
  2011-11-07 22:24   ` Grant Likely
  2011-11-01 18:32 ` [PATCH 2/3] ARM: pxa: Add DT testing machine Marek Vasut
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 41+ messages in thread
From: Marek Vasut @ 2011-11-01 18:32 UTC (permalink / raw)
  To: linux-arm-kernel

Add device tree binding for PXA2xx UARTs. Tested on Vpac270 board.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
---
 drivers/tty/serial/pxa.c |   50 +++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 47 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
index 531931c..836cbb4 100644
--- a/drivers/tty/serial/pxa.c
+++ b/drivers/tty/serial/pxa.c
@@ -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
 	},
 };
 
-- 
1.7.6.3

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 2/3] ARM: pxa: Add DT testing machine
  2011-11-01 18:32 [PATCH 0/3] Initial PXA DT bindings Marek Vasut
  2011-11-01 18:32 ` [PATCH 1/3] ARM: pxa: Add DT support to pxa2xx-uart Marek Vasut
@ 2011-11-01 18:32 ` Marek Vasut
  2011-11-07 22:18   ` Grant Likely
  2011-11-01 18:32 ` [PATCH 3/3] ARM: pxa: Add basic DTS files for PXA/Vpac270 " Marek Vasut
  2011-11-07 21:31 ` [PATCH 0/3 V2] Initial PXA DT bindings Marek Vasut
  3 siblings, 1 reply; 41+ messages in thread
From: Marek Vasut @ 2011-11-01 18:32 UTC (permalink / raw)
  To: linux-arm-kernel

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 <marek.vasut@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
---
 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

diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index cd19309..e152a9c 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -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
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index cc39d17..5f69281 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -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
diff --git a/arch/arm/mach-pxa/vpac270-dt.c b/arch/arm/mach-pxa/vpac270-dt.c
new file mode 100644
index 0000000..dc9a6dd
--- /dev/null
+++ b/arch/arm/mach-pxa/vpac270-dt.c
@@ -0,0 +1,82 @@
+/*
+ * Hardware definitions for Voipac PXA270 driven by FDT
+ *
+ * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
+ *
+ * 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 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();
+}
+
+static struct of_device_id pxa_dt_match_table[] __initdata = {
+	{ .compatible = "simple-bus", },
+	{}
+};
+
+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();
+	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();
+}
+
+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
-- 
1.7.6.3

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 3/3] ARM: pxa: Add basic DTS files for PXA/Vpac270 testing machine
  2011-11-01 18:32 [PATCH 0/3] Initial PXA DT bindings Marek Vasut
  2011-11-01 18:32 ` [PATCH 1/3] ARM: pxa: Add DT support to pxa2xx-uart Marek Vasut
  2011-11-01 18:32 ` [PATCH 2/3] ARM: pxa: Add DT testing machine Marek Vasut
@ 2011-11-01 18:32 ` Marek Vasut
  2011-11-07 21:31 ` [PATCH 0/3 V2] Initial PXA DT bindings Marek Vasut
  3 siblings, 0 replies; 41+ messages in thread
From: Marek Vasut @ 2011-11-01 18:32 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
---
 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

diff --git a/arch/arm/boot/dts/pxa-vpac270.dts b/arch/arm/boot/dts/pxa-vpac270.dts
new file mode 100644
index 0000000..48dd9e5
--- /dev/null
+++ b/arch/arm/boot/dts/pxa-vpac270.dts
@@ -0,0 +1,37 @@
+/*
+ * pxa-vpac270.dts - Device Tree file for Voipac PXA270 board
+ *
+ * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
+ *
+ * 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";
+		};
+	};
+};
diff --git a/arch/arm/boot/dts/pxa.dtsi b/arch/arm/boot/dts/pxa.dtsi
new file mode 100644
index 0000000..2d2f5b97
--- /dev/null
+++ b/arch/arm/boot/dts/pxa.dtsi
@@ -0,0 +1,72 @@
+/*
+ * pxa.dtsi - Device Tree Include file for Marvell PXA2xx/PXA3xx family SoC
+ *
+ * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
+ *
+ * Licensed under GPLv2 or later.
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+	model = "Marvell PXA2xx/PXA3xx family SoC";
+	compatible = "marvell,pxa";
+	interrupt-parent = <&pxairq>;
+
+	alias {
+		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>;
+			marvell,pxa250 = <1>;
+			status = "disabled";
+		};
+	};
+};
-- 
1.7.6.3

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 1/3] ARM: pxa: Add DT support to pxa2xx-uart
  2011-11-01 18:32 ` [PATCH 1/3] ARM: pxa: Add DT support to pxa2xx-uart Marek Vasut
@ 2011-11-01 20:00   ` Rob Herring
  2011-11-01 20:15     ` Marek Vasut
  2011-11-07 22:24   ` Grant Likely
  1 sibling, 1 reply; 41+ messages in thread
From: Rob Herring @ 2011-11-01 20:00 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/01/2011 01:32 PM, Marek Vasut wrote:
> Add device tree binding for PXA2xx UARTs. Tested on Vpac270 board.
> 
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> ---
>  drivers/tty/serial/pxa.c |   50 +++++++++++++++++++++++++++++++++++++++++++--
>  1 files changed, 47 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
> index 531931c..836cbb4 100644
> --- a/drivers/tty/serial/pxa.c
> +++ b/drivers/tty/serial/pxa.c
> @@ -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++;

You have no guarantee of the probe ordering yet are dependent on the
number later on to set the name.

> +	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,

> +
> +	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;
> 

What about non-DT probing when CONFIG_OF is enabled?

>  	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

Use recently added of_match_ptr and remove the ifdef.

Rob

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 1/3] ARM: pxa: Add DT support to pxa2xx-uart
  2011-11-01 20:00   ` Rob Herring
@ 2011-11-01 20:15     ` Marek Vasut
  2011-11-02 13:52       ` Rob Herring
  0 siblings, 1 reply; 41+ messages in thread
From: Marek Vasut @ 2011-11-01 20:15 UTC (permalink / raw)
  To: linux-arm-kernel

> On 11/01/2011 01:32 PM, Marek Vasut wrote:
> > Add device tree binding for PXA2xx UARTs. Tested on Vpac270 board.
> > 
> > Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> > Cc: Arnd Bergmann <arnd@arndb.de>
> > Cc: Grant Likely <grant.likely@secretlab.ca>
> > ---
> > 
> >  drivers/tty/serial/pxa.c |   50
> >  +++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 47
> >  insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
> > index 531931c..836cbb4 100644
> > --- a/drivers/tty/serial/pxa.c
> > +++ b/drivers/tty/serial/pxa.c
> > @@ -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++;
> 
> 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 ?
> 
> > +	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,

Yes, I'm checking if the port has an additional parameter "marvell,pxa250" set, 
which means it should check if the CPU is pxa250.

> 
> > +
> > +	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;
> 
> What about non-DT probing when CONFIG_OF is enabled?

Then ret isn't -EINVAL and it should be ok ?

> 
> >  	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
> 
> Use recently added of_match_ptr and remove the ifdef.

ACK
> 
> Rob

Cheers

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 1/3] ARM: pxa: Add DT support to pxa2xx-uart
  2011-11-01 20:15     ` Marek Vasut
@ 2011-11-02 13:52       ` Rob Herring
  2011-11-02 14:30         ` Marek Vasut
  0 siblings, 1 reply; 41+ messages in thread
From: Rob Herring @ 2011-11-02 13:52 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/01/2011 03:15 PM, Marek Vasut wrote:
>> On 11/01/2011 01:32 PM, Marek Vasut wrote:
>>> Add device tree binding for PXA2xx UARTs. Tested on Vpac270 board.
>>>
>>> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
>>> Cc: Arnd Bergmann <arnd@arndb.de>
>>> Cc: Grant Likely <grant.likely@secretlab.ca>
>>> ---
>>>
>>>  drivers/tty/serial/pxa.c |   50
>>>  +++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 47
>>>  insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
>>> index 531931c..836cbb4 100644
>>> --- a/drivers/tty/serial/pxa.c
>>> +++ b/drivers/tty/serial/pxa.c
>>> @@ -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++;
>>
>> 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 ?

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.

>>
>>> +	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,
> 
> 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.

> 
>>
>>> +
>>> +	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;
>>
>> What about non-DT probing when CONFIG_OF is enabled?
> 
> Then ret isn't -EINVAL and it should be ok ?

Ahh, yes you're right.

Rob

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 1/3] ARM: pxa: Add DT support to pxa2xx-uart
  2011-11-02 13:52       ` Rob Herring
@ 2011-11-02 14:30         ` Marek Vasut
  0 siblings, 0 replies; 41+ messages in thread
From: Marek Vasut @ 2011-11-02 14:30 UTC (permalink / raw)
  To: linux-arm-kernel

> On 11/01/2011 03:15 PM, Marek Vasut wrote:
> >> On 11/01/2011 01:32 PM, Marek Vasut wrote:
> >>> Add device tree binding for PXA2xx UARTs. Tested on Vpac270 board.
> >>> 
> >>> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> >>> Cc: Arnd Bergmann <arnd@arndb.de>
> >>> Cc: Grant Likely <grant.likely@secretlab.ca>
> >>> ---
> >>> 
> >>>  drivers/tty/serial/pxa.c |   50
> >>>  +++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 47
> >>>  insertions(+), 3 deletions(-)
> >>> 
> >>> diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
> >>> index 531931c..836cbb4 100644
> >>> --- a/drivers/tty/serial/pxa.c
> >>> +++ b/drivers/tty/serial/pxa.c
> >>> @@ -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++;
> >> 
> >> 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 ?
> 
> 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.
> 
> >>> +	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,
> > 
> > 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.
> 
> >>> +
> >>> +	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;
> >> 
> >> What about non-DT probing when CONFIG_OF is enabled?
> > 
> > Then ret isn't -EINVAL and 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!

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 0/3 V2] Initial PXA DT bindings
  2011-11-01 18:32 [PATCH 0/3] Initial PXA DT bindings Marek Vasut
                   ` (2 preceding siblings ...)
  2011-11-01 18:32 ` [PATCH 3/3] ARM: pxa: Add basic DTS files for PXA/Vpac270 " Marek Vasut
@ 2011-11-07 21:31 ` Marek Vasut
  2011-11-07 21:31   ` [PATCH 1/3 V2] ARM: pxa: Add DT support to pxa2xx-uart Marek Vasut
                     ` (3 more replies)
  3 siblings, 4 replies; 41+ messages in thread
From: Marek Vasut @ 2011-11-07 21:31 UTC (permalink / raw)
  To: linux-arm-kernel

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        |   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)

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <robherring2@gmail.com>

-- 
1.7.7.1

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 1/3 V2] ARM: pxa: Add DT support to pxa2xx-uart
  2011-11-07 21:31 ` [PATCH 0/3 V2] Initial PXA DT bindings Marek Vasut
@ 2011-11-07 21:31   ` Marek Vasut
  2011-11-07 21:37     ` Rob Herring
  2011-11-10 12:00     ` Russell King - ARM Linux
  2011-11-07 21:31   ` [PATCH 2/3 RESEND] ARM: pxa: Add DT testing machine Marek Vasut
                     ` (2 subsequent siblings)
  3 siblings, 2 replies; 41+ messages in thread
From: Marek Vasut @ 2011-11-07 21:31 UTC (permalink / raw)
  To: linux-arm-kernel

Add device tree binding for PXA2xx UARTs. Tested on Vpac270 board.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <robherring2@gmail.com>
---
 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).

diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
index 5c8e3bb..80bee8e 100644
--- a/drivers/tty/serial/pxa.c
+++ b/drivers/tty/serial/pxa.c
@@ -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),
 	},
 };
 
-- 
1.7.7.1

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 2/3 RESEND] ARM: pxa: Add DT testing machine
  2011-11-07 21:31 ` [PATCH 0/3 V2] Initial PXA DT bindings Marek Vasut
  2011-11-07 21:31   ` [PATCH 1/3 V2] ARM: pxa: Add DT support to pxa2xx-uart Marek Vasut
@ 2011-11-07 21:31   ` Marek Vasut
  2011-11-07 21:59     ` Rob Herring
  2011-11-07 21:31   ` [PATCH 3/3 V2] ARM: pxa: Add basic DTS files for PXA/Vpac270 " Marek Vasut
  2012-07-17 13:30   ` [PATCH 0/3 V2] Initial PXA DT bindings Daniel Mack
  3 siblings, 1 reply; 41+ messages in thread
From: Marek Vasut @ 2011-11-07 21:31 UTC (permalink / raw)
  To: linux-arm-kernel

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 <marek.vasut@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <robherring2@gmail.com>
---
 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

diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 61d3c72..a9bba3d 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -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
 
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index be0f7df..2b80829 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -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
diff --git a/arch/arm/mach-pxa/vpac270-dt.c b/arch/arm/mach-pxa/vpac270-dt.c
new file mode 100644
index 0000000..dc9a6dd
--- /dev/null
+++ b/arch/arm/mach-pxa/vpac270-dt.c
@@ -0,0 +1,82 @@
+/*
+ * Hardware definitions for Voipac PXA270 driven by FDT
+ *
+ * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
+ *
+ * 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 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();
+}
+
+static struct of_device_id pxa_dt_match_table[] __initdata = {
+	{ .compatible = "simple-bus", },
+	{}
+};
+
+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();
+	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();
+}
+
+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
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
index a7539a6..339ecdf 100644
--- a/arch/arm/mach-pxa/vpac270.c
+++ b/arch/arm/mach-pxa/vpac270.c
@@ -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
-- 
1.7.7.1

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 3/3 V2] ARM: pxa: Add basic DTS files for PXA/Vpac270 testing machine
  2011-11-07 21:31 ` [PATCH 0/3 V2] Initial PXA DT bindings Marek Vasut
  2011-11-07 21:31   ` [PATCH 1/3 V2] ARM: pxa: Add DT support to pxa2xx-uart Marek Vasut
  2011-11-07 21:31   ` [PATCH 2/3 RESEND] ARM: pxa: Add DT testing machine Marek Vasut
@ 2011-11-07 21:31   ` Marek Vasut
  2011-11-07 21:45     ` Rob Herring
  2012-07-17 13:30   ` [PATCH 0/3 V2] Initial PXA DT bindings Daniel Mack
  3 siblings, 1 reply; 41+ messages in thread
From: Marek Vasut @ 2011-11-07 21:31 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <robherring2@gmail.com>
---
 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.

diff --git a/arch/arm/boot/dts/pxa-vpac270.dts b/arch/arm/boot/dts/pxa-vpac270.dts
new file mode 100644
index 0000000..48dd9e5
--- /dev/null
+++ b/arch/arm/boot/dts/pxa-vpac270.dts
@@ -0,0 +1,37 @@
+/*
+ * pxa-vpac270.dts - Device Tree file for Voipac PXA270 board
+ *
+ * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
+ *
+ * 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";
+		};
+	};
+};
diff --git a/arch/arm/boot/dts/pxa.dtsi b/arch/arm/boot/dts/pxa.dtsi
new file mode 100644
index 0000000..4c9c4c7
--- /dev/null
+++ b/arch/arm/boot/dts/pxa.dtsi
@@ -0,0 +1,71 @@
+/*
+ * pxa.dtsi - Device Tree Include file for Marvell PXA2xx/PXA3xx family SoC
+ *
+ * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
+ *
+ * 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";
+		};
+	};
+};
-- 
1.7.7.1

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 1/3 V2] ARM: pxa: Add DT support to pxa2xx-uart
  2011-11-07 21:31   ` [PATCH 1/3 V2] ARM: pxa: Add DT support to pxa2xx-uart Marek Vasut
@ 2011-11-07 21:37     ` Rob Herring
  2011-11-07 21:53       ` Marek Vasut
  2011-11-10 12:00     ` Russell King - ARM Linux
  1 sibling, 1 reply; 41+ messages in thread
From: Rob Herring @ 2011-11-07 21:37 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/07/2011 03:31 PM, Marek Vasut wrote:
> Add device tree binding for PXA2xx UARTs. Tested on Vpac270 board.
> 
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Rob Herring <robherring2@gmail.com>
> ---

Acked-by: Rob Herring <rob.herring@calxeda.com>

>  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).
> 
> diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
> index 5c8e3bb..80bee8e 100644
> --- a/drivers/tty/serial/pxa.c
> +++ b/drivers/tty/serial/pxa.c
> @@ -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),
>  	},
>  };
>  

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 3/3 V2] ARM: pxa: Add basic DTS files for PXA/Vpac270 testing machine
  2011-11-07 21:31   ` [PATCH 3/3 V2] ARM: pxa: Add basic DTS files for PXA/Vpac270 " Marek Vasut
@ 2011-11-07 21:45     ` Rob Herring
  2011-11-07 21:55       ` Marek Vasut
  0 siblings, 1 reply; 41+ messages in thread
From: Rob Herring @ 2011-11-07 21:45 UTC (permalink / raw)
  To: linux-arm-kernel


On 11/07/2011 03:31 PM, Marek Vasut wrote:
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Rob Herring <robherring2@gmail.com>
> ---

Couple of minor things below. With those fixed:

Acked-by: Rob Herring <rob.herring@calxeda.com>

>  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.

Should be a safe assumption. Only someone capable of implementing board
support should create a dts...

> 
> diff --git a/arch/arm/boot/dts/pxa-vpac270.dts b/arch/arm/boot/dts/pxa-vpac270.dts
> new file mode 100644
> index 0000000..48dd9e5
> --- /dev/null
> +++ b/arch/arm/boot/dts/pxa-vpac270.dts
> @@ -0,0 +1,37 @@
> +/*
> + * pxa-vpac270.dts - Device Tree file for Voipac PXA270 board
> + *
> + * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
> + *
> + * 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";

Isn't mem= redundant with the memory node below?

> +		linux,stdout-path = &ffuart;
> +	};
> +
> +	memory at a0000000 {
> +		reg = <0xa0000000 0x8000000>;
> +	};
> +
> +	pxabus {
> +		ffuart: uart at 40100000 {

These should be serial at ...

> +			status = "okay";
> +		};
> +
> +		btuart: uart at 40200000 {
> +			status = "okay";
> +		};
> +
> +		stuart: uart at 40700000 {
> +			status = "okay";
> +		};
> +	};
> +};
> diff --git a/arch/arm/boot/dts/pxa.dtsi b/arch/arm/boot/dts/pxa.dtsi
> new file mode 100644
> index 0000000..4c9c4c7
> --- /dev/null
> +++ b/arch/arm/boot/dts/pxa.dtsi
> @@ -0,0 +1,71 @@
> +/*
> + * pxa.dtsi - Device Tree Include file for Marvell PXA2xx/PXA3xx family SoC
> + *
> + * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
> + *
> + * 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";
> +		};
> +	};
> +};

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 1/3 V2] ARM: pxa: Add DT support to pxa2xx-uart
  2011-11-07 21:37     ` Rob Herring
@ 2011-11-07 21:53       ` Marek Vasut
  0 siblings, 0 replies; 41+ messages in thread
From: Marek Vasut @ 2011-11-07 21:53 UTC (permalink / raw)
  To: linux-arm-kernel

> On 11/07/2011 03:31 PM, Marek Vasut wrote:
> > Add device tree binding for PXA2xx UARTs. Tested on Vpac270 board.
> > 
> > Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> > Cc: Arnd Bergmann <arnd@arndb.de>
> > Cc: Grant Likely <grant.likely@secretlab.ca>
> > Cc: Rob Herring <robherring2@gmail.com>
> > ---
> 
> Acked-by: Rob Herring <rob.herring@calxeda.com>

Thanks for explaining stuff, Rob!

M

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 3/3 V2] ARM: pxa: Add basic DTS files for PXA/Vpac270 testing machine
  2011-11-07 21:45     ` Rob Herring
@ 2011-11-07 21:55       ` Marek Vasut
  2011-11-07 22:03         ` Rob Herring
  0 siblings, 1 reply; 41+ messages in thread
From: Marek Vasut @ 2011-11-07 21:55 UTC (permalink / raw)
  To: linux-arm-kernel

> On 11/07/2011 03:31 PM, Marek Vasut wrote:
> > Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> > Cc: Arnd Bergmann <arnd@arndb.de>
> > Cc: Grant Likely <grant.likely@secretlab.ca>
> > Cc: Rob Herring <robherring2@gmail.com>
> > ---
> 
> Couple of minor things below. With those fixed:
> 
> Acked-by: Rob Herring <rob.herring@calxeda.com>
> 
> >  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.
> 
> Should be a safe assumption. Only someone capable of implementing board
> support should create a dts...
> 
> > diff --git a/arch/arm/boot/dts/pxa-vpac270.dts
> > b/arch/arm/boot/dts/pxa-vpac270.dts new file mode 100644
> > index 0000000..48dd9e5
> > --- /dev/null
> > +++ b/arch/arm/boot/dts/pxa-vpac270.dts
> > @@ -0,0 +1,37 @@
> > +/*
> > + * pxa-vpac270.dts - Device Tree file for Voipac PXA270 board
> > + *
> > + * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
> > + *
> > + * 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";
> 
> 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.

> 
> > +		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 ?

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 2/3 RESEND] ARM: pxa: Add DT testing machine
  2011-11-07 21:31   ` [PATCH 2/3 RESEND] ARM: pxa: Add DT testing machine Marek Vasut
@ 2011-11-07 21:59     ` Rob Herring
  2011-11-07 22:06       ` Marek Vasut
  0 siblings, 1 reply; 41+ messages in thread
From: Rob Herring @ 2011-11-07 21:59 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/07/2011 03:31 PM, Marek Vasut wrote:
> 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 <marek.vasut@gmail.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Rob Herring <robherring2@gmail.com>
> ---
>  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
> 
> diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
> index 61d3c72..a9bba3d 100644
> --- a/arch/arm/mach-pxa/Kconfig
> +++ b/arch/arm/mach-pxa/Kconfig
> @@ -616,6 +616,21 @@ config MACH_ZIPIT2
>  	bool "Zipit Z2 Handheld"
>  	select PXA27x
>  	select HAVE_PWM

Add a blank line.

> +config MACH_VPAC_DT
> +	bool "PXA (Voipac270) FDT Machine"

This should be more generic to be all PXA DT machines.

> +	select PXA27x
> +	select OF
> +	depends on !MACH_VPAC270 && EXPERIMENTAL

Drop these depends.

> +	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.

> +	  NOTE: Use only if you know what you're doing!!
> +
>  endif
>  endmenu
>  
> diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
> index be0f7df..2b80829 100644
> --- a/arch/arm/mach-pxa/Makefile
> +++ b/arch/arm/mach-pxa/Makefile
> @@ -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
> diff --git a/arch/arm/mach-pxa/vpac270-dt.c b/arch/arm/mach-pxa/vpac270-dt.c
> new file mode 100644
> index 0000000..dc9a6dd
> --- /dev/null
> +++ b/arch/arm/mach-pxa/vpac270-dt.c
> @@ -0,0 +1,82 @@
> +/*
> + * Hardware definitions for Voipac PXA270 driven by FDT
> + *
> + * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
> + *
> + * 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 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.

> +}
> +
> +static struct of_device_id pxa_dt_match_table[] __initdata = {
> +	{ .compatible = "simple-bus", },
> +	{}
> +};

Any reason you can't use the default table?

> +
> +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.

> +
> +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();
> +	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.

> +}
> +
> +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
> diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
> index a7539a6..339ecdf 100644
> --- a/arch/arm/mach-pxa/vpac270.c
> +++ b/arch/arm/mach-pxa/vpac270.c
> @@ -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

You shouldn't need this ifndef.

Rob

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 3/3 V2] ARM: pxa: Add basic DTS files for PXA/Vpac270 testing machine
  2011-11-07 21:55       ` Marek Vasut
@ 2011-11-07 22:03         ` Rob Herring
  0 siblings, 0 replies; 41+ messages in thread
From: Rob Herring @ 2011-11-07 22:03 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/07/2011 03:55 PM, Marek Vasut wrote:
>> On 11/07/2011 03:31 PM, Marek Vasut wrote:
>>> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
>>> Cc: Arnd Bergmann <arnd@arndb.de>
>>> Cc: Grant Likely <grant.likely@secretlab.ca>
>>> Cc: Rob Herring <robherring2@gmail.com>
>>> ---
>>
>> Couple of minor things below. With those fixed:
>>
>> Acked-by: Rob Herring <rob.herring@calxeda.com>
>>
>>>  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.
>>
>> Should be a safe assumption. Only someone capable of implementing board
>> support should create a dts...
>>
>>> diff --git a/arch/arm/boot/dts/pxa-vpac270.dts
>>> b/arch/arm/boot/dts/pxa-vpac270.dts new file mode 100644
>>> index 0000000..48dd9e5
>>> --- /dev/null
>>> +++ b/arch/arm/boot/dts/pxa-vpac270.dts
>>> @@ -0,0 +1,37 @@
>>> +/*
>>> + * pxa-vpac270.dts - Device Tree file for Voipac PXA270 board
>>> + *
>>> + * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
>>> + *
>>> + * 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";
>>
>> 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.
> 

Okay.

>>
>>> +		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 ?

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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 2/3 RESEND] ARM: pxa: Add DT testing machine
  2011-11-07 21:59     ` Rob Herring
@ 2011-11-07 22:06       ` Marek Vasut
  2011-11-07 22:30         ` Grant Likely
  2011-11-07 22:32         ` Rob Herring
  0 siblings, 2 replies; 41+ messages in thread
From: Marek Vasut @ 2011-11-07 22:06 UTC (permalink / raw)
  To: linux-arm-kernel

> On 11/07/2011 03:31 PM, Marek Vasut wrote:
> > 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 <marek.vasut@gmail.com>
> > Cc: Arnd Bergmann <arnd@arndb.de>
> > Cc: Grant Likely <grant.likely@secretlab.ca>
> > Cc: Rob Herring <robherring2@gmail.com>
> > ---
> > 
> >  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
> > 
> > diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
> > index 61d3c72..a9bba3d 100644
> > --- a/arch/arm/mach-pxa/Kconfig
> > +++ b/arch/arm/mach-pxa/Kconfig
> > @@ -616,6 +616,21 @@ config MACH_ZIPIT2
> > 
> >  	bool "Zipit Z2 Handheld"
> >  	select PXA27x
> >  	select HAVE_PWM
> 
> Add a blank line.
> 
> > +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.

> 
> > +	select PXA27x
> > +	select OF
> > +	depends on !MACH_VPAC270 && EXPERIMENTAL
> 
> Drop these depends.

Nope
> 
> > +	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.
> 
> > +	  NOTE: Use only if you know what you're doing!!
> > +
> > 
> >  endif
> >  endmenu
> > 
> > diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
> > index be0f7df..2b80829 100644
> > --- a/arch/arm/mach-pxa/Makefile
> > +++ b/arch/arm/mach-pxa/Makefile
> > @@ -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
> > diff --git a/arch/arm/mach-pxa/vpac270-dt.c
> > b/arch/arm/mach-pxa/vpac270-dt.c new file mode 100644
> > index 0000000..dc9a6dd
> > --- /dev/null
> > +++ b/arch/arm/mach-pxa/vpac270-dt.c
> > @@ -0,0 +1,82 @@
> > +/*
> > + * Hardware definitions for Voipac PXA270 driven by FDT
> > + *
> > + * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
> > + *
> > + * 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 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.

That's the long-term plan.
> 
> > +}
> > +
> > +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?
> 
> > +
> > +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?
> 
> > +
> > +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();
> > +	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.
> 
> > +}
> > +
> > +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
> > diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
> > index a7539a6..339ecdf 100644
> > --- a/arch/arm/mach-pxa/vpac270.c
> > +++ b/arch/arm/mach-pxa/vpac270.c
> > @@ -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
> 
> You shouldn't need this ifndef.

For some reason, it refuses to boot if I do have both compiled in.

> 
> Rob

M

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 2/3] ARM: pxa: Add DT testing machine
  2011-11-01 18:32 ` [PATCH 2/3] ARM: pxa: Add DT testing machine Marek Vasut
@ 2011-11-07 22:18   ` Grant Likely
  2011-11-07 22:24     ` Marek Vasut
  0 siblings, 1 reply; 41+ messages in thread
From: Grant Likely @ 2011-11-07 22:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 01, 2011 at 07:32:33PM +0100, Marek Vasut wrote:
> 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 <marek.vasut@gmail.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> ---
>  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
> 
> diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
> index cd19309..e152a9c 100644
> --- a/arch/arm/mach-pxa/Kconfig
> +++ b/arch/arm/mach-pxa/Kconfig
> @@ -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
> diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
> index cc39d17..5f69281 100644
> --- a/arch/arm/mach-pxa/Makefile
> +++ b/arch/arm/mach-pxa/Makefile
> @@ -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
> diff --git a/arch/arm/mach-pxa/vpac270-dt.c b/arch/arm/mach-pxa/vpac270-dt.c
> new file mode 100644
> index 0000000..dc9a6dd
> --- /dev/null
> +++ b/arch/arm/mach-pxa/vpac270-dt.c
> @@ -0,0 +1,82 @@
> +/*
> + * Hardware definitions for Voipac PXA270 driven by FDT
> + *
> + * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
> + *
> + * 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.

> + *
> + */
> +
> +#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", },
> +	{},
> +};
> +
> +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.

> +
> +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();
> +	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.

> +}
> +
> +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
> -- 
> 1.7.6.3
> 

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 2/3] ARM: pxa: Add DT testing machine
  2011-11-07 22:18   ` Grant Likely
@ 2011-11-07 22:24     ` Marek Vasut
  0 siblings, 0 replies; 41+ messages in thread
From: Marek Vasut @ 2011-11-07 22:24 UTC (permalink / raw)
  To: linux-arm-kernel

> On Tue, Nov 01, 2011 at 07:32:33PM +0100, Marek Vasut wrote:
> > 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 <marek.vasut@gmail.com>
> > Cc: Arnd Bergmann <arnd@arndb.de>
> > Cc: Grant Likely <grant.likely@secretlab.ca>
> > ---
> > 
> >  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
> > 
> > diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
> > index cd19309..e152a9c 100644
> > --- a/arch/arm/mach-pxa/Kconfig
> > +++ b/arch/arm/mach-pxa/Kconfig
> > @@ -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
> > 
> > diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
> > index cc39d17..5f69281 100644
> > --- a/arch/arm/mach-pxa/Makefile
> > +++ b/arch/arm/mach-pxa/Makefile
> > @@ -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
> > diff --git a/arch/arm/mach-pxa/vpac270-dt.c
> > b/arch/arm/mach-pxa/vpac270-dt.c new file mode 100644
> > index 0000000..dc9a6dd
> > --- /dev/null
> > +++ b/arch/arm/mach-pxa/vpac270-dt.c
> > @@ -0,0 +1,82 @@
> > +/*
> > + * Hardware definitions for Voipac PXA270 driven by FDT
> > + *
> > + * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
> > + *
> > + * 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.

Hi Grant, well ok, I have no problem with that. Can you apply the rest of the 
patches (0001, 0003)?

> 
> > + *
> > + */
> > +
> > +#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", },
> > +	{},
> > +};
> > +
> > +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.

Thanks for explaining!
> 
> > +
> > +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();
> > +	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(). 

Exactly

> 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).

> 
> 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.
> 
> > +}
> > +
> > +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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 1/3] ARM: pxa: Add DT support to pxa2xx-uart
  2011-11-01 18:32 ` [PATCH 1/3] ARM: pxa: Add DT support to pxa2xx-uart Marek Vasut
  2011-11-01 20:00   ` Rob Herring
@ 2011-11-07 22:24   ` Grant Likely
  2011-11-07 22:25     ` Marek Vasut
  1 sibling, 1 reply; 41+ messages in thread
From: Grant Likely @ 2011-11-07 22:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 01, 2011 at 07:32:32PM +0100, Marek Vasut wrote:
> Add device tree binding for PXA2xx UARTs. Tested on Vpac270 board.
> 
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> ---
>  drivers/tty/serial/pxa.c |   50 +++++++++++++++++++++++++++++++++++++++++++--
>  1 files changed, 47 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
> index 531931c..836cbb4 100644
> --- a/drivers/tty/serial/pxa.c
> +++ b/drivers/tty/serial/pxa.c
> @@ -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))

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.

> +		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().  :-)

> +
> +	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

Doing it this way eliminates the #ifdef:

	.of_match_table = of_match_ptr(serial_pxa_dt_ids),

Otherwise looks good.

g.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 1/3] ARM: pxa: Add DT support to pxa2xx-uart
  2011-11-07 22:24   ` Grant Likely
@ 2011-11-07 22:25     ` Marek Vasut
  0 siblings, 0 replies; 41+ messages in thread
From: Marek Vasut @ 2011-11-07 22:25 UTC (permalink / raw)
  To: linux-arm-kernel

> On Tue, Nov 01, 2011 at 07:32:32PM +0100, Marek Vasut wrote:
> > Add device tree binding for PXA2xx UARTs. Tested on Vpac270 board.
> > 
> > Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> > Cc: Arnd Bergmann <arnd@arndb.de>
> > Cc: Grant Likely <grant.likely@secretlab.ca>
> > ---
> > 
> >  drivers/tty/serial/pxa.c |   50
> >  +++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 47
> >  insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
> > index 531931c..836cbb4 100644
> > --- a/drivers/tty/serial/pxa.c
> > +++ b/drivers/tty/serial/pxa.c
> > @@ -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))
> 
> 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.
> 
> > +		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().  :-)

Please see V2 of the patch. I offloaded the responsibility to user, which is how 
it should be.

> 
> > +
> > +	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
> 
> Doing it this way eliminates the #ifdef:
> 
> 	.of_match_table = of_match_ptr(serial_pxa_dt_ids),

Done in V2
> 
> Otherwise looks good.
> 
> g.

Thanks
M

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 2/3 RESEND] ARM: pxa: Add DT testing machine
  2011-11-07 22:06       ` Marek Vasut
@ 2011-11-07 22:30         ` Grant Likely
  2011-11-07 22:31           ` Marek Vasut
  2011-11-07 22:32         ` Rob Herring
  1 sibling, 1 reply; 41+ messages in thread
From: Grant Likely @ 2011-11-07 22:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 07, 2011 at 11:06:42PM +0100, Marek Vasut wrote:
> > On 11/07/2011 03:31 PM, Marek Vasut wrote:
> > > 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 <marek.vasut@gmail.com>
> > > Cc: Arnd Bergmann <arnd@arndb.de>
> > > Cc: Grant Likely <grant.likely@secretlab.ca>
> > > Cc: Rob Herring <robherring2@gmail.com>
> > > ---
> > > +	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.

Nah, do it now.  Aim high.  :-)

g.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 2/3 RESEND] ARM: pxa: Add DT testing machine
  2011-11-07 22:30         ` Grant Likely
@ 2011-11-07 22:31           ` Marek Vasut
  2011-11-07 22:38             ` Rob Herring
  0 siblings, 1 reply; 41+ messages in thread
From: Marek Vasut @ 2011-11-07 22:31 UTC (permalink / raw)
  To: linux-arm-kernel

> On Mon, Nov 07, 2011 at 11:06:42PM +0100, Marek Vasut wrote:
> > > On 11/07/2011 03:31 PM, Marek Vasut wrote:
> > > > 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 <marek.vasut@gmail.com>
> > > > Cc: Arnd Bergmann <arnd@arndb.de>
> > > > Cc: Grant Likely <grant.likely@secretlab.ca>
> > > > Cc: Rob Herring <robherring2@gmail.com>
> > > > ---
> > > > +	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.
> 
> 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?

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 2/3 RESEND] ARM: pxa: Add DT testing machine
  2011-11-07 22:06       ` Marek Vasut
  2011-11-07 22:30         ` Grant Likely
@ 2011-11-07 22:32         ` Rob Herring
  2011-11-08  1:12           ` Grant Likely
  1 sibling, 1 reply; 41+ messages in thread
From: Rob Herring @ 2011-11-07 22:32 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/07/2011 04:06 PM, Marek Vasut wrote:
>> On 11/07/2011 03:31 PM, Marek Vasut wrote:
>>> 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 <marek.vasut@gmail.com>
>>> Cc: Arnd Bergmann <arnd@arndb.de>
>>> Cc: Grant Likely <grant.likely@secretlab.ca>
>>> Cc: Rob Herring <robherring2@gmail.com>
>>> ---
>>>
>>>  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
>>>
>>> diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
>>> index 61d3c72..a9bba3d 100644
>>> --- a/arch/arm/mach-pxa/Kconfig
>>> +++ b/arch/arm/mach-pxa/Kconfig
>>> @@ -616,6 +616,21 @@ config MACH_ZIPIT2
>>>
>>>  	bool "Zipit Z2 Handheld"
>>>  	select PXA27x
>>>  	select HAVE_PWM
>>
>> Add a blank line.
>>
>>> +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.
> 
>>
>>> +	select PXA27x
>>> +	select OF
>>> +	depends on !MACH_VPAC270 && EXPERIMENTAL
>>
>> Drop these depends.
> 
> Nope
>>
>>> +	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.

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.

>>
>>> +	  NOTE: Use only if you know what you're doing!!
>>> +
>>>
>>>  endif
>>>  endmenu
>>>
>>> diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
>>> index be0f7df..2b80829 100644
>>> --- a/arch/arm/mach-pxa/Makefile
>>> +++ b/arch/arm/mach-pxa/Makefile
>>> @@ -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
>>> diff --git a/arch/arm/mach-pxa/vpac270-dt.c
>>> b/arch/arm/mach-pxa/vpac270-dt.c new file mode 100644
>>> index 0000000..dc9a6dd
>>> --- /dev/null
>>> +++ b/arch/arm/mach-pxa/vpac270-dt.c
>>> @@ -0,0 +1,82 @@
>>> +/*
>>> + * Hardware definitions for Voipac PXA270 driven by FDT
>>> + *
>>> + * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
>>> + *
>>> + * 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 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.
> 
> That's the long-term plan.
>>
>>> +}
>>> +
>>> +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?

of_default_bus_match_table

>>
>>> +
>>> +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?

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

>>
>>> +
>>> +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();
>>> +	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.
>>
>>> +}
>>> +
>>> +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
>>> diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
>>> index a7539a6..339ecdf 100644
>>> --- a/arch/arm/mach-pxa/vpac270.c
>>> +++ b/arch/arm/mach-pxa/vpac270.c
>>> @@ -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
>>
>> 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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 2/3 RESEND] ARM: pxa: Add DT testing machine
  2011-11-07 22:31           ` Marek Vasut
@ 2011-11-07 22:38             ` Rob Herring
  0 siblings, 0 replies; 41+ messages in thread
From: Rob Herring @ 2011-11-07 22:38 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/07/2011 04:31 PM, Marek Vasut wrote:
>> On Mon, Nov 07, 2011 at 11:06:42PM +0100, Marek Vasut wrote:
>>>> On 11/07/2011 03:31 PM, Marek Vasut wrote:
>>>>> 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 <marek.vasut@gmail.com>
>>>>> Cc: Arnd Bergmann <arnd@arndb.de>
>>>>> Cc: Grant Likely <grant.likely@secretlab.ca>
>>>>> Cc: Rob Herring <robherring2@gmail.com>
>>>>> ---
>>>>> +	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.
>>
>> 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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 2/3 RESEND] ARM: pxa: Add DT testing machine
  2011-11-07 22:32         ` Rob Herring
@ 2011-11-08  1:12           ` Grant Likely
  0 siblings, 0 replies; 41+ messages in thread
From: Grant Likely @ 2011-11-08  1:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 7, 2011 at 3:32 PM, Rob Herring <robherring2@gmail.com> wrote:
> On 11/07/2011 04:06 PM, Marek Vasut wrote:
>>>> +#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
>>>
>>> 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.

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.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 1/3 V2] ARM: pxa: Add DT support to pxa2xx-uart
  2011-11-07 21:31   ` [PATCH 1/3 V2] ARM: pxa: Add DT support to pxa2xx-uart Marek Vasut
  2011-11-07 21:37     ` Rob Herring
@ 2011-11-10 12:00     ` Russell King - ARM Linux
  2011-11-10 16:59       ` Marek Vasut
  1 sibling, 1 reply; 41+ messages in thread
From: Russell King - ARM Linux @ 2011-11-10 12:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 07, 2011 at 10:31:43PM +0100, Marek Vasut wrote:
> @@ -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);

Is this documented somewhere (eg, an example dt snippet for a PXA uart).

There is the requirement that new DT bindings must be documented.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 1/3 V2] ARM: pxa: Add DT support to pxa2xx-uart
  2011-11-10 12:00     ` Russell King - ARM Linux
@ 2011-11-10 16:59       ` Marek Vasut
  2011-11-10 17:07         ` Rob Herring
  0 siblings, 1 reply; 41+ messages in thread
From: Marek Vasut @ 2011-11-10 16:59 UTC (permalink / raw)
  To: linux-arm-kernel

> On Mon, Nov 07, 2011 at 10:31:43PM +0100, Marek Vasut wrote:
> > @@ -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);
> 
> 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.
> 
> There is the requirement that new DT bindings must be documented.

Thank you for guiding me, I really fell into deep water here.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 1/3 V2] ARM: pxa: Add DT support to pxa2xx-uart
  2011-11-10 16:59       ` Marek Vasut
@ 2011-11-10 17:07         ` Rob Herring
  0 siblings, 0 replies; 41+ messages in thread
From: Rob Herring @ 2011-11-10 17:07 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/10/2011 10:59 AM, Marek Vasut wrote:
>> On Mon, Nov 07, 2011 at 10:31:43PM +0100, Marek Vasut wrote:
>>> @@ -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);
>>
>> 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.

No, you need to add both machine and uart binding documentation in
Documentation/devicetree/bindings/

Rob

> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 0/3 V2] Initial PXA DT bindings
  2011-11-07 21:31 ` [PATCH 0/3 V2] Initial PXA DT bindings Marek Vasut
                     ` (2 preceding siblings ...)
  2011-11-07 21:31   ` [PATCH 3/3 V2] ARM: pxa: Add basic DTS files for PXA/Vpac270 " Marek Vasut
@ 2012-07-17 13:30   ` Daniel Mack
  2012-07-17 14:03     ` Arnd Bergmann
  3 siblings, 1 reply; 41+ messages in thread
From: Daniel Mack @ 2012-07-17 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

On 07.11.2011 22:31, Marek Vasut wrote:
> 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        |   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?
>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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 0/3 V2] Initial PXA DT bindings
  2012-07-17 13:30   ` [PATCH 0/3 V2] Initial PXA DT bindings Daniel Mack
@ 2012-07-17 14:03     ` Arnd Bergmann
  2012-07-17 14:47       ` Daniel Mack
  0 siblings, 1 reply; 41+ messages in thread
From: Arnd Bergmann @ 2012-07-17 14:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 17 July 2012, Daniel Mack wrote:
> 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.

> 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_id is 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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 0/3 V2] Initial PXA DT bindings
  2012-07-17 14:03     ` Arnd Bergmann
@ 2012-07-17 14:47       ` Daniel Mack
  2012-07-17 15:31         ` Arnd Bergmann
  0 siblings, 1 reply; 41+ messages in thread
From: Daniel Mack @ 2012-07-17 14:47 UTC (permalink / raw)
  To: linux-arm-kernel

On 17.07.2012 16:03, Arnd Bergmann wrote:
> On Tuesday 17 July 2012, Daniel Mack wrote:
>> 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.

> 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.

>> 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_id is 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.

Ok, good. I'll have a look. Thanks for explaining!


Daniel

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 0/3 V2] Initial PXA DT bindings
  2012-07-17 14:47       ` Daniel Mack
@ 2012-07-17 15:31         ` Arnd Bergmann
  2012-07-17 18:04           ` Eric Miao
  2012-07-17 19:14           ` Daniel Mack
  0 siblings, 2 replies; 41+ messages in thread
From: Arnd Bergmann @ 2012-07-17 15:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 17 July 2012, Daniel Mack wrote:
> > 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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 0/3 V2] Initial PXA DT bindings
  2012-07-17 15:31         ` Arnd Bergmann
@ 2012-07-17 18:04           ` Eric Miao
  2012-07-17 19:57             ` Daniel Mack
  2012-07-17 19:14           ` Daniel Mack
  1 sibling, 1 reply; 41+ messages in thread
From: Eric Miao @ 2012-07-17 18:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jul 17, 2012 at 11:31 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Tuesday 17 July 2012, Daniel Mack wrote:
>> > 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?

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 0/3 V2] Initial PXA DT bindings
  2012-07-17 15:31         ` Arnd Bergmann
  2012-07-17 18:04           ` Eric Miao
@ 2012-07-17 19:14           ` Daniel Mack
  2012-07-18 12:58             ` Marek Vasut
  1 sibling, 1 reply; 41+ messages in thread
From: Daniel Mack @ 2012-07-17 19:14 UTC (permalink / raw)
  To: linux-arm-kernel

On 17.07.2012 17:31, Arnd Bergmann wrote:
> On Tuesday 17 July 2012, Daniel Mack wrote:
>>> 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.

> 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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 0/3 V2] Initial PXA DT bindings
  2012-07-17 18:04           ` Eric Miao
@ 2012-07-17 19:57             ` Daniel Mack
  2012-07-17 20:02               ` Eric Miao
  2012-07-19  3:11               ` Haojian Zhuang
  0 siblings, 2 replies; 41+ messages in thread
From: Daniel Mack @ 2012-07-17 19:57 UTC (permalink / raw)
  To: linux-arm-kernel

On 17.07.2012 20:04, Eric Miao wrote:
> On Tue, Jul 17, 2012 at 11:31 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>> On Tuesday 17 July 2012, Daniel Mack wrote:
>>>> 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've seen that. The code looks very clean in that area.

> 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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 0/3 V2] Initial PXA DT bindings
  2012-07-17 19:57             ` Daniel Mack
@ 2012-07-17 20:02               ` Eric Miao
  2012-07-19  3:11               ` Haojian Zhuang
  1 sibling, 0 replies; 41+ messages in thread
From: Eric Miao @ 2012-07-17 20:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jul 18, 2012 at 3:57 AM, Daniel Mack <zonque@gmail.com> wrote:
> On 17.07.2012 20:04, Eric Miao wrote:
>> On Tue, Jul 17, 2012 at 11:31 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>>> On Tuesday 17 July 2012, Daniel Mack wrote:
>>>>> 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've seen that. The code looks very clean in that area.
>
>> 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.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 0/3 V2] Initial PXA DT bindings
  2012-07-17 19:14           ` Daniel Mack
@ 2012-07-18 12:58             ` Marek Vasut
  0 siblings, 0 replies; 41+ messages in thread
From: Marek Vasut @ 2012-07-18 12:58 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Daniel Mack,

> On 17.07.2012 17:31, Arnd Bergmann wrote:
> > On Tuesday 17 July 2012, Daniel Mack wrote:
> >>> 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.
> 
> > 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.

> Daniel

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 0/3 V2] Initial PXA DT bindings
  2012-07-17 19:57             ` Daniel Mack
  2012-07-17 20:02               ` Eric Miao
@ 2012-07-19  3:11               ` Haojian Zhuang
  1 sibling, 0 replies; 41+ messages in thread
From: Haojian Zhuang @ 2012-07-19  3:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jul 18, 2012 at 3:57 AM, Daniel Mack <zonque@gmail.com> wrote:
> On 17.07.2012 20:04, Eric Miao wrote:
>> On Tue, Jul 17, 2012 at 11:31 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>>> On Tuesday 17 July 2012, Daniel Mack wrote:
>>>>> 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've seen that. The code looks very clean in that area.
>
>> 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. :)

^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2012-07-19  3:11 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-01 18:32 [PATCH 0/3] Initial PXA DT bindings Marek Vasut
2011-11-01 18:32 ` [PATCH 1/3] ARM: pxa: Add DT support to pxa2xx-uart Marek Vasut
2011-11-01 20:00   ` Rob Herring
2011-11-01 20:15     ` Marek Vasut
2011-11-02 13:52       ` Rob Herring
2011-11-02 14:30         ` Marek Vasut
2011-11-07 22:24   ` Grant Likely
2011-11-07 22:25     ` Marek Vasut
2011-11-01 18:32 ` [PATCH 2/3] ARM: pxa: Add DT testing machine Marek Vasut
2011-11-07 22:18   ` Grant Likely
2011-11-07 22:24     ` Marek Vasut
2011-11-01 18:32 ` [PATCH 3/3] ARM: pxa: Add basic DTS files for PXA/Vpac270 " Marek Vasut
2011-11-07 21:31 ` [PATCH 0/3 V2] Initial PXA DT bindings Marek Vasut
2011-11-07 21:31   ` [PATCH 1/3 V2] ARM: pxa: Add DT support to pxa2xx-uart Marek Vasut
2011-11-07 21:37     ` Rob Herring
2011-11-07 21:53       ` Marek Vasut
2011-11-10 12:00     ` Russell King - ARM Linux
2011-11-10 16:59       ` Marek Vasut
2011-11-10 17:07         ` Rob Herring
2011-11-07 21:31   ` [PATCH 2/3 RESEND] ARM: pxa: Add DT testing machine Marek Vasut
2011-11-07 21:59     ` Rob Herring
2011-11-07 22:06       ` Marek Vasut
2011-11-07 22:30         ` Grant Likely
2011-11-07 22:31           ` Marek Vasut
2011-11-07 22:38             ` Rob Herring
2011-11-07 22:32         ` Rob Herring
2011-11-08  1:12           ` Grant Likely
2011-11-07 21:31   ` [PATCH 3/3 V2] ARM: pxa: Add basic DTS files for PXA/Vpac270 " Marek Vasut
2011-11-07 21:45     ` Rob Herring
2011-11-07 21:55       ` Marek Vasut
2011-11-07 22:03         ` Rob Herring
2012-07-17 13:30   ` [PATCH 0/3 V2] Initial PXA DT bindings Daniel Mack
2012-07-17 14:03     ` Arnd Bergmann
2012-07-17 14:47       ` Daniel Mack
2012-07-17 15:31         ` Arnd Bergmann
2012-07-17 18:04           ` Eric Miao
2012-07-17 19:57             ` Daniel Mack
2012-07-17 20:02               ` Eric Miao
2012-07-19  3:11               ` Haojian Zhuang
2012-07-17 19:14           ` Daniel Mack
2012-07-18 12:58             ` Marek Vasut

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.