Skip to contentSkip to conversation

Migrate NXP/Freescale Vybrid based boards to support pure DT

PATCH Superseded Bhuvanchandra DV 3 participants 13 messages Jan 25, 2016 – Feb 2, 2016

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover Migrate NXP/Freescale Vybrid based boards to support pure DT

Changes since V1:
- Update the license string in device tree's.
- Update all lpuart's uart nodes in device tree.
- Dropped *_dtb_defconfig and updated the default defconfig's with DT support.
- Reordered defconfig's using defconfig via savedefconfig.
- Use one patch to update all Vybrid based board defconfig's.
- Dropped vybrid_gpio driver legacy code. Thanks! Stefan for pointing this.
- Dropped the legacy way of enabling GPIO, UART and SPI on NXP/Freescale Vybrid based board's.

- Compile checked for vf610twr and pcm052 since I don't have access to such hardware at my end. Reviewer's and tester's welcome!

Bhuvanchandra DV (8):
arm: vybrid: Enable lpuart support
arm: colibri-vf: Enable serial support
dm: lpuart: Drop the legacy code
dm: vybrid_gpio: Drop legacy code
arm: vybrid: Drop enabling gpio, uart and spi in legacy mode
arm: vf610-twr: Add device tree files
arm: pcm052: Add device tree files
arm: vybrid: Update defconfig's

 arch/arm/dts/Makefile            |   4 +-
 arch/arm/dts/pcm052.dts          |  22 +++++++++
 arch/arm/dts/vf-colibri.dtsi     |   9 ++++
 arch/arm/dts/vf.dtsi             |  47 ++++++++++++++++--
 arch/arm/dts/vf500-colibri.dts   |   5 --
 arch/arm/dts/vf610-colibri.dts   |   5 --
 arch/arm/dts/vf610-twr.dts       |  22 +++++++++
 configs/colibri_vf_defconfig     |   8 ++++
 configs/colibri_vf_dtb_defconfig |  14 ------
 configs/pcm052_defconfig         |   7 +++
 configs/vf610twr_defconfig       |   7 +++
 configs/vf610twr_nand_defconfig  |   7 +++
 drivers/gpio/vybrid_gpio.c       |  18 -------
 drivers/serial/serial_lpuart.c   | 101 +--------------------------------------
 include/configs/colibri_vf.h     |  13 -----
 include/configs/pcm052.h         |   3 --
 include/configs/vf610twr.h       |   3 --
 17 files changed, 129 insertions(+), 166 deletions(-)
 create mode 100644 arch/arm/dts/pcm052.dts
 create mode 100644 arch/arm/dts/vf610-twr.dts
 delete mode 100644 configs/colibri_vf_dtb_defconfig
Signature · 1 line
2.7.0
#1 lore raw

PATCH v2 1/8 arm: vybrid: Enable lpuart support

- Add device tree node's for lpuart on Vybrid platform
- Update the license string.

---
 arch/arm/dts/vf.dtsi           | 47 +++++++++++++++++++++++++++++++++++++-----
 arch/arm/dts/vf500-colibri.dts |  5 -----
 arch/arm/dts/vf610-colibri.dts |  5 -----
 3 files changed, 42 insertions(+), 15 deletions(-)
arch/arm/dts/vf.dtsi +42 -5
index 78706e1..8b87b57 100644
@@ -2,11 +2,6 @@
  * Copyright 2013 Freescale Semiconductor, Inc.
  *
  * SPDX-License-Identifier:     GPL-2.0+ or X11
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 /include/ "skeleton.dtsi"
 
@@ -17,6 +12,12 @@
 		gpio2 = &gpio2;
 		gpio3 = &gpio3;
 		gpio4 = &gpio4;
+		serial0 = &uart0;
+		serial1 = &uart1;
+		serial2 = &uart2;
+		serial3 = &uart3;
+		serial4 = &uart4;
+		serial5 = &uart5;
 		spi0 = &dspi0;
 		spi1 = &dspi1;
 	};
@@ -33,6 +34,30 @@
 			#size-cells = <1>;
 			ranges;
 
+			uart0: serial at 40027000 {
+				compatible = "fsl,vf610-lpuart";
+				reg = <0x40027000 0x1000>;
+				status = "disabled";
+			};
+
+			uart1: serial at 40028000 {
+				compatible = "fsl,vf610-lpuart";
+				reg = <0x40028000 0x1000>;
+				status = "disabled";
+			};
+
+			uart2: serial at 40029000 {
+				compatible = "fsl,vf610-lpuart";
+				reg = <0x40029000 0x1000>;
+				status = "disabled";
+			};
+
+			uart3: serial at 4002a000 {
+				compatible = "fsl,vf610-lpuart";
+				reg = <0x4002a000 0x1000>;
+				status = "disabled";
+			};
+
 			dspi0: dspi0 at 4002c000 {
 				#address-cells = <1>;
 				#size-cells = <0>;
@@ -95,6 +120,18 @@
 			#address-cells = <1>;
 			#size-cells = <1>;
 			ranges;
+
+			uart4: serial at 400a9000 {
+				compatible = "fsl,vf610-lpuart";
+				reg = <0x400a9000 0x1000>;
+				status = "disabled";
+			};
+
+			uart5: serial at 400aa000 {
+				compatible = "fsl,vf610-lpuart";
+				reg = <0x400aa000 0x1000>;
+				status = "disabled";
+			};
 		};
 	};
 };
arch/arm/dts/vf500-colibri.dts +0 -5
index e383306..02d0ce8 100644
@@ -2,11 +2,6 @@
  * Copyright 2014 Toradex AG
  *
  * SPDX-License-Identifier:     GPL-2.0+ or X11
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 
 /dts-v1/;
arch/arm/dts/vf610-colibri.dts +0 -5
index 63bb3f4..24dfcbe 100644
@@ -2,11 +2,6 @@
  * Copyright 2014 Toradex AG
  *
  * SPDX-License-Identifier:     GPL-2.0+ or X11
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 
 /dts-v1/;
Signature · 1 line
2.7.0
#2 lore raw

PATCH v2 2/8 arm: colibri-vf: Enable serial support

In reply to Bhuvanchandra DV

- Enable lpuart support on Toradex Colibri VF50/VF61
- Use UART0 for stdout.

---
 arch/arm/dts/vf-colibri.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/dts/vf-colibri.dtsi +9 -0
index 7a8e9bee..13a1dba 100644
@@ -10,6 +10,12 @@
  */
 #include "vf.dtsi"
 
+/ {
+	chosen {
+		stdout-path = &uart0;
+	};
+};
+
 &dspi1 {
 	status = "okay";
 	bus-num = <1>;
@@ -19,3 +25,6 @@
 		spi-max-frequency = <50000000>;
 	};
 };
+&uart0 {
+	status = "okay";
+};
Signature · 1 line
2.7.0
#3 lore raw

PATCH v2 2/8 arm: colibri-vf: Enable serial support

Quoted 2 lines · Bhuvanchandra DV

- Enable lpuart support on Toradex Colibri VF50/VF61
- Use UART0 for stdout.

Compared to the previous commit, I would say here it is fine, since those two changes are really connected.

--
Stefan

Quoted 30 lines
---
 arch/arm/dts/vf-colibri.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/dts/vf-colibri.dtsi +9 -0
index 7a8e9bee..13a1dba 100644
@@ -10,6 +10,12 @@
  */
 #include "vf.dtsi"
 
+/ {
+	chosen {
+		stdout-path = &uart0;
+	};
+};
+
 &dspi1 {
 	status = "okay";
 	bus-num = <1>;
@@ -19,3 +25,6 @@
 		spi-max-frequency = <50000000>;
 	};
 };
+&uart0 {
+	status = "okay";
+};
#4 lore raw

PATCH v2 3/8 dm: lpuart: Drop the legacy code

In reply to Bhuvanchandra DV

All boards using this driver are with device tree support, hence drop the legacy code in driver to have a pure DT solution.

---
 drivers/serial/serial_lpuart.c | 101 +----------------------------------------
 1 file changed, 2 insertions(+), 99 deletions(-)
drivers/serial/serial_lpuart.c +2 -99
index 3f9c4d1..fc3321f 100644
@@ -48,8 +48,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-struct lpuart_fsl *base = (struct lpuart_fsl *)LPUART_BASE;
-
 struct lpuart_serial_platdata {
 	struct lpuart_fsl *reg;
 };
@@ -127,43 +125,6 @@ static int _lpuart_serial_init(struct lpuart_fsl *base)
 	return 0;
 }
 
-#ifndef CONFIG_DM_SERIAL
-static void lpuart_serial_setbrg(void)
-{
-	_lpuart_serial_setbrg(base, gd->baudrate);
-}
-
-static int lpuart_serial_getc(void)
-{
-	return _lpuart_serial_getc(base);
-}
-
-static void lpuart_serial_putc(const char c)
-{
-	_lpuart_serial_putc(base, c);
-}
-
-static int lpuart_serial_tstc(void)
-{
-	return _lpuart_serial_tstc(base);
-}
-
-static int lpuart_serial_init(void)
-{
-	return _lpuart_serial_init(base);
-}
-
-static struct serial_device lpuart_serial_drv = {
-	.name = "lpuart_serial",
-	.start = lpuart_serial_init,
-	.stop = NULL,
-	.setbrg = lpuart_serial_setbrg,
-	.putc = lpuart_serial_putc,
-	.puts = default_serial_puts,
-	.getc = lpuart_serial_getc,
-	.tstc = lpuart_serial_tstc,
-};
-#else /* CONFIG_DM_SERIAL */
 static int lpuart_serial_setbrg(struct udevice *dev, int baudrate)
 {
 	struct lpuart_serial_platdata *plat = dev->platdata;
@@ -210,8 +171,8 @@ static int lpuart_serial_probe(struct udevice *dev)
 
 	return _lpuart_serial_init(reg);
 }
-#endif /* CONFIG_DM_SERIAL */
 #else
+
 static void _lpuart32_serial_setbrg(struct lpuart_fsl *base, int baudrate)
 {
 	u32 clk = CONFIG_SYS_CLK_FREQ;
@@ -281,43 +242,6 @@ static int _lpuart32_serial_init(struct lpuart_fsl *base)
 	return 0;
 }
 
-#ifndef CONFIG_DM_SERIAL
-static void lpuart32_serial_setbrg(void)
-{
-	_lpuart32_serial_setbrg(base, gd->baudrate);
-}
-
-static int lpuart32_serial_getc(void)
-{
-	return _lpuart32_serial_getc(base);
-}
-
-static void lpuart32_serial_putc(const char c)
-{
-	_lpuart32_serial_putc(base, c);
-}
-
-static int lpuart32_serial_tstc(void)
-{
-	return _lpuart32_serial_tstc(base);
-}
-
-static int lpuart32_serial_init(void)
-{
-	return _lpuart32_serial_init(base);
-}
-
-static struct serial_device lpuart32_serial_drv = {
-	.name = "lpuart32_serial",
-	.start = lpuart32_serial_init,
-	.stop = NULL,
-	.setbrg = lpuart32_serial_setbrg,
-	.putc = lpuart32_serial_putc,
-	.puts = default_serial_puts,
-	.getc = lpuart32_serial_getc,
-	.tstc = lpuart32_serial_tstc,
-};
-#else /* CONFIG_DM_SERIAL */
 static int lpuart32_serial_setbrg(struct udevice *dev, int baudrate)
 {
 	struct lpuart_serial_platdata *plat = dev->platdata;
@@ -364,28 +288,8 @@ static int lpuart32_serial_probe(struct udevice *dev)
 
 	return _lpuart32_serial_init(reg);
 }
-#endif /* CONFIG_DM_SERIAL */
-#endif
-
-#ifndef CONFIG_DM_SERIAL
-void lpuart_serial_initialize(void)
-{
-#ifdef CONFIG_LPUART_32B_REG
-	serial_register(&lpuart32_serial_drv);
-#else
-	serial_register(&lpuart_serial_drv);
-#endif
-}
+#endif /* CONFIG_LPUART_32B_REG */
 
-__weak struct serial_device *default_serial_console(void)
-{
-#ifdef CONFIG_LPUART_32B_REG
-	return &lpuart32_serial_drv;
-#else
-	return &lpuart_serial_drv;
-#endif
-}
-#else /* CONFIG_DM_SERIAL */
 static int lpuart_serial_ofdata_to_platdata(struct udevice *dev)
 {
 	struct lpuart_serial_platdata *plat = dev->platdata;
@@ -447,4 +351,3 @@ U_BOOT_DRIVER(serial_lpuart32) = {
 	.flags = DM_FLAG_PRE_RELOC,
 };
 #endif /* CONFIG_LPUART_32B_REG */
-#endif /* CONFIG_DM_SERIAL */
Signature · 1 line
2.7.0
#5 lore raw

PATCH v2 3/8 dm: lpuart: Drop the legacy code

Quoted 2 lines · Bhuvanchandra DV

All boards using this driver are with device tree support, hence drop the legacy code in driver to have a pure DT solution.

Hm, dropping the legacy code at this point probably leads to a broken state (bisectability...)

I would recommend to first move the boards to device tree and then drop legacy stuff... Probably along these lines:

arm: vybrid: Enable lpuart support
arm: colibri-vf: Enable serial support
arm: vybrid: Drop enabling gpio, uart and spi in legacy mode
arm: vf610-twr: Add device tree files
arm: pcm052: Add device tree files
arm: vybrid: Update defconfig's
dm: lpuart: Drop the legacy code
dm: vybrid_gpio: Drop legacy code

--
Stefan

Quoted 153 lines
---
 drivers/serial/serial_lpuart.c | 101 +----------------------------------------
 1 file changed, 2 insertions(+), 99 deletions(-)
drivers/serial/serial_lpuart.c +2 -99
index 3f9c4d1..fc3321f 100644
@@ -48,8 +48,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-struct lpuart_fsl *base = (struct lpuart_fsl *)LPUART_BASE;
-
 struct lpuart_serial_platdata {
 	struct lpuart_fsl *reg;
 };
@@ -127,43 +125,6 @@ static int _lpuart_serial_init(struct lpuart_fsl *base)
 	return 0;
 }
 
-#ifndef CONFIG_DM_SERIAL
-static void lpuart_serial_setbrg(void)
-{
-	_lpuart_serial_setbrg(base, gd->baudrate);
-}
-
-static int lpuart_serial_getc(void)
-{
-	return _lpuart_serial_getc(base);
-}
-
-static void lpuart_serial_putc(const char c)
-{
-	_lpuart_serial_putc(base, c);
-}
-
-static int lpuart_serial_tstc(void)
-{
-	return _lpuart_serial_tstc(base);
-}
-
-static int lpuart_serial_init(void)
-{
-	return _lpuart_serial_init(base);
-}
-
-static struct serial_device lpuart_serial_drv = {
-	.name = "lpuart_serial",
-	.start = lpuart_serial_init,
-	.stop = NULL,
-	.setbrg = lpuart_serial_setbrg,
-	.putc = lpuart_serial_putc,
-	.puts = default_serial_puts,
-	.getc = lpuart_serial_getc,
-	.tstc = lpuart_serial_tstc,
-};
-#else /* CONFIG_DM_SERIAL */
 static int lpuart_serial_setbrg(struct udevice *dev, int baudrate)
 {
 	struct lpuart_serial_platdata *plat = dev->platdata;
@@ -210,8 +171,8 @@ static int lpuart_serial_probe(struct udevice *dev)
 
 	return _lpuart_serial_init(reg);
 }
-#endif /* CONFIG_DM_SERIAL */
 #else
+
 static void _lpuart32_serial_setbrg(struct lpuart_fsl *base, int baudrate)
 {
 	u32 clk = CONFIG_SYS_CLK_FREQ;
@@ -281,43 +242,6 @@ static int _lpuart32_serial_init(struct lpuart_fsl *base)
 	return 0;
 }
 
-#ifndef CONFIG_DM_SERIAL
-static void lpuart32_serial_setbrg(void)
-{
-	_lpuart32_serial_setbrg(base, gd->baudrate);
-}
-
-static int lpuart32_serial_getc(void)
-{
-	return _lpuart32_serial_getc(base);
-}
-
-static void lpuart32_serial_putc(const char c)
-{
-	_lpuart32_serial_putc(base, c);
-}
-
-static int lpuart32_serial_tstc(void)
-{
-	return _lpuart32_serial_tstc(base);
-}
-
-static int lpuart32_serial_init(void)
-{
-	return _lpuart32_serial_init(base);
-}
-
-static struct serial_device lpuart32_serial_drv = {
-	.name = "lpuart32_serial",
-	.start = lpuart32_serial_init,
-	.stop = NULL,
-	.setbrg = lpuart32_serial_setbrg,
-	.putc = lpuart32_serial_putc,
-	.puts = default_serial_puts,
-	.getc = lpuart32_serial_getc,
-	.tstc = lpuart32_serial_tstc,
-};
-#else /* CONFIG_DM_SERIAL */
 static int lpuart32_serial_setbrg(struct udevice *dev, int baudrate)
 {
 	struct lpuart_serial_platdata *plat = dev->platdata;
@@ -364,28 +288,8 @@ static int lpuart32_serial_probe(struct udevice *dev)
 
 	return _lpuart32_serial_init(reg);
 }
-#endif /* CONFIG_DM_SERIAL */
-#endif
-
-#ifndef CONFIG_DM_SERIAL
-void lpuart_serial_initialize(void)
-{
-#ifdef CONFIG_LPUART_32B_REG
-	serial_register(&lpuart32_serial_drv);
-#else
-	serial_register(&lpuart_serial_drv);
-#endif
-}
+#endif /* CONFIG_LPUART_32B_REG */
 
-__weak struct serial_device *default_serial_console(void)
-{
-#ifdef CONFIG_LPUART_32B_REG
-	return &lpuart32_serial_drv;
-#else
-	return &lpuart_serial_drv;
-#endif
-}
-#else /* CONFIG_DM_SERIAL */
 static int lpuart_serial_ofdata_to_platdata(struct udevice *dev)
 {
 	struct lpuart_serial_platdata *plat = dev->platdata;
@@ -447,4 +351,3 @@ U_BOOT_DRIVER(serial_lpuart32) = {
 	.flags = DM_FLAG_PRE_RELOC,
 };
 #endif /* CONFIG_LPUART_32B_REG */
-#endif /* CONFIG_DM_SERIAL */
#6 lore raw

PATCH v2 3/8 dm: lpuart: Drop the legacy code

Quoted 10 lines · Stefan Agner
Quoted 2 lines · Bhuvanchandra DV

All boards using this driver are with device tree support, hence drop the legacy code in driver to have a pure DT solution.

Hm, dropping the legacy code at this point probably leads to a broken state (bisectability...)

I would recommend to first move the boards to device tree and then drop legacy stuff... Probably along these lines:

Quoted 8 lines

arm: vybrid: Enable lpuart support
arm: colibri-vf: Enable serial support
arm: vybrid: Drop enabling gpio, uart and spi in legacy mode
arm: vf610-twr: Add device tree files
arm: pcm052: Add device tree files
arm: vybrid: Update defconfig's
dm: lpuart: Drop the legacy code
dm: vybrid_gpio: Drop legacy code

Will reorder the patches in next version.

Quoted 157 lines

--
Stefan

Quoted 153 lines
---
  drivers/serial/serial_lpuart.c | 101 +----------------------------------------
  1 file changed, 2 insertions(+), 99 deletions(-)
drivers/serial/serial_lpuart.c +2 -99
index 3f9c4d1..fc3321f 100644
@@ -48,8 +48,6 @@
 
  DECLARE_GLOBAL_DATA_PTR;
 
-struct lpuart_fsl *base = (struct lpuart_fsl *)LPUART_BASE;
-
  struct lpuart_serial_platdata {
  	struct lpuart_fsl *reg;
  };
@@ -127,43 +125,6 @@ static int _lpuart_serial_init(struct lpuart_fsl *base)
  	return 0;
  }
 
-#ifndef CONFIG_DM_SERIAL
-static void lpuart_serial_setbrg(void)
-{
-	_lpuart_serial_setbrg(base, gd->baudrate);
-}
-
-static int lpuart_serial_getc(void)
-{
-	return _lpuart_serial_getc(base);
-}
-
-static void lpuart_serial_putc(const char c)
-{
-	_lpuart_serial_putc(base, c);
-}
-
-static int lpuart_serial_tstc(void)
-{
-	return _lpuart_serial_tstc(base);
-}
-
-static int lpuart_serial_init(void)
-{
-	return _lpuart_serial_init(base);
-}
-
-static struct serial_device lpuart_serial_drv = {
-	.name = "lpuart_serial",
-	.start = lpuart_serial_init,
-	.stop = NULL,
-	.setbrg = lpuart_serial_setbrg,
-	.putc = lpuart_serial_putc,
-	.puts = default_serial_puts,
-	.getc = lpuart_serial_getc,
-	.tstc = lpuart_serial_tstc,
-};
-#else /* CONFIG_DM_SERIAL */
  static int lpuart_serial_setbrg(struct udevice *dev, int baudrate)
  {
  	struct lpuart_serial_platdata *plat = dev->platdata;
@@ -210,8 +171,8 @@ static int lpuart_serial_probe(struct udevice *dev)
 
  	return _lpuart_serial_init(reg);
  }
-#endif /* CONFIG_DM_SERIAL */
  #else
+
  static void _lpuart32_serial_setbrg(struct lpuart_fsl *base, int baudrate)
  {
  	u32 clk = CONFIG_SYS_CLK_FREQ;
@@ -281,43 +242,6 @@ static int _lpuart32_serial_init(struct lpuart_fsl *base)
  	return 0;
  }
 
-#ifndef CONFIG_DM_SERIAL
-static void lpuart32_serial_setbrg(void)
-{
-	_lpuart32_serial_setbrg(base, gd->baudrate);
-}
-
-static int lpuart32_serial_getc(void)
-{
-	return _lpuart32_serial_getc(base);
-}
-
-static void lpuart32_serial_putc(const char c)
-{
-	_lpuart32_serial_putc(base, c);
-}
-
-static int lpuart32_serial_tstc(void)
-{
-	return _lpuart32_serial_tstc(base);
-}
-
-static int lpuart32_serial_init(void)
-{
-	return _lpuart32_serial_init(base);
-}
-
-static struct serial_device lpuart32_serial_drv = {
-	.name = "lpuart32_serial",
-	.start = lpuart32_serial_init,
-	.stop = NULL,
-	.setbrg = lpuart32_serial_setbrg,
-	.putc = lpuart32_serial_putc,
-	.puts = default_serial_puts,
-	.getc = lpuart32_serial_getc,
-	.tstc = lpuart32_serial_tstc,
-};
-#else /* CONFIG_DM_SERIAL */
  static int lpuart32_serial_setbrg(struct udevice *dev, int baudrate)
  {
  	struct lpuart_serial_platdata *plat = dev->platdata;
@@ -364,28 +288,8 @@ static int lpuart32_serial_probe(struct udevice *dev)
 
  	return _lpuart32_serial_init(reg);
  }
-#endif /* CONFIG_DM_SERIAL */
-#endif
-
-#ifndef CONFIG_DM_SERIAL
-void lpuart_serial_initialize(void)
-{
-#ifdef CONFIG_LPUART_32B_REG
-	serial_register(&lpuart32_serial_drv);
-#else
-	serial_register(&lpuart_serial_drv);
-#endif
-}
+#endif /* CONFIG_LPUART_32B_REG */
 
-__weak struct serial_device *default_serial_console(void)
-{
-#ifdef CONFIG_LPUART_32B_REG
-	return &lpuart32_serial_drv;
-#else
-	return &lpuart_serial_drv;
-#endif
-}
-#else /* CONFIG_DM_SERIAL */
  static int lpuart_serial_ofdata_to_platdata(struct udevice *dev)
  {
  	struct lpuart_serial_platdata *plat = dev->platdata;
@@ -447,4 +351,3 @@ U_BOOT_DRIVER(serial_lpuart32) = {
  	.flags = DM_FLAG_PRE_RELOC,
  };
  #endif /* CONFIG_LPUART_32B_REG */
-#endif /* CONFIG_DM_SERIAL */
Signature · 2 lines
Best regards,
Bhuvan
#7 lore raw

PATCH v2 4/8 dm: vybrid_gpio: Drop legacy code

In reply to Bhuvanchandra DV

All boards using this driver are with device tree support, hence drop the legacy code in driver to have a pure DT solution.

---
 drivers/gpio/vybrid_gpio.c | 18 ------------------
 1 file changed, 18 deletions(-)
drivers/gpio/vybrid_gpio.c +0 -18
index 4d25f9a..a30ba5d 100644
@@ -135,24 +135,6 @@ static int vybrid_gpio_bind(struct udevice *dev)
 	return 0;
 }
 
-#if !CONFIG_IS_ENABLED(OF_CONTROL)
-static const struct vybrid_gpio_platdata vybrid_gpio[] = {
-	{0, GPIO0_BASE_ADDR, "GPIO0 "},
-	{1, GPIO1_BASE_ADDR, "GPIO1 "},
-	{2, GPIO2_BASE_ADDR, "GPIO2 "},
-	{3, GPIO3_BASE_ADDR, "GPIO3 "},
-	{4, GPIO4_BASE_ADDR, "GPIO4 "},
-};
-
-U_BOOT_DEVICES(vybrid_gpio) = {
-	{ "gpio_vybrid", &vybrid_gpio[0] },
-	{ "gpio_vybrid", &vybrid_gpio[1] },
-	{ "gpio_vybrid", &vybrid_gpio[2] },
-	{ "gpio_vybrid", &vybrid_gpio[3] },
-	{ "gpio_vybrid", &vybrid_gpio[4] },
-};
-#endif
-
 static const struct udevice_id vybrid_gpio_ids[] = {
 	{ .compatible = "fsl,vf610-gpio" },
 	{ }
Signature · 1 line
2.7.0
#8 lore raw

PATCH v2 5/8 arm: vybrid: Drop enabling GPIO, UART and SPI in legacy mode

In reply to Bhuvanchandra DV

Remove the legacy way of enabling UART, GPIO and SPI on Vybrid based boards since these driver's now only supports DT mode.

---
 include/configs/colibri_vf.h | 13 -------------
 include/configs/pcm052.h     |  3 ---
 include/configs/vf610twr.h   |  3 ---
 3 files changed, 19 deletions(-)
include/configs/colibri_vf.h +0 -13
index 5aed3a5..6efff76 100644
@@ -36,13 +36,10 @@
 
 #define CONFIG_BOARD_EARLY_INIT_F
 
-#define LPUART_BASE			UART0_BASE
-
 /* Allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 #define CONFIG_VERSION_VARIABLE
-#define CONFIG_SYS_UART_PORT		(0)
 #define CONFIG_BAUDRATE			115200
 #define CONFIG_CMD_ASKENV
 
@@ -52,10 +49,6 @@
 #define CONFIG_SYS_MAX_NAND_DEVICE	1
 #define CONFIG_SYS_NAND_BASE		NFC_BASE_ADDR
 
-/* GPIO support */
-#define CONFIG_DM_GPIO
-#define CONFIG_VYBRID_GPIO
-
 /* Dynamic MTD partition support */
 #define CONFIG_CMD_MTDPARTS	/* Enable 'mtdparts' command line support */
 #define CONFIG_MTD_PARTITIONS
@@ -265,10 +258,4 @@
 #define CONFIG_USB_FUNCTION_MASS_STORAGE
 #define CONFIG_CMD_USB_MASS_STORAGE
 
-/* Enable SPI support */
-#ifdef CONFIG_OF_CONTROL
-#define CONFIG_DM_SPI
-#define CONFIG_CMD_SPI
-#endif
-
 #endif /* __CONFIG_H */
include/configs/pcm052.h +0 -3
index 891bdb0..f3353f2 100644
@@ -27,11 +27,8 @@
 
 #define CONFIG_BOARD_EARLY_INIT_F
 
-#define LPUART_BASE			UART1_BASE
-
 /* Allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
-#define CONFIG_SYS_UART_PORT		(1)
 #define CONFIG_BAUDRATE			115200
 
 #undef CONFIG_CMD_IMLS
include/configs/vf610twr.h +0 -3
index dcfafaf..84ad2c3 100644
@@ -34,11 +34,8 @@
 
 #define CONFIG_BOARD_EARLY_INIT_F
 
-#define LPUART_BASE			UART1_BASE
-
 /* Allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
-#define CONFIG_SYS_UART_PORT		(1)
 #define CONFIG_BAUDRATE			115200
 
 /* NAND support */
Signature · 1 line
2.7.0
#10 lore raw

PATCH v2 6/8 arm: vf610-twr: Add device tree file's

In reply to Bhuvanchandra DV

- Add device tree files for NXP/Freescale VF610 Tower Board.
- Enable lpuart support on NXP/Freescale VF610 Tower Board.
- Use UART1 as stdout.

---
 arch/arm/dts/Makefile      |  3 ++-
 arch/arm/dts/vf610-twr.dts | 22 ++++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/vf610-twr.dts
arch/arm/dts/Makefile +2 -1
index f66ff41..c6fb50c 100644
@@ -190,7 +190,8 @@ dtb-$(CONFIG_MACH_SUN9I) += \
 	sun9i-a80-cubieboard4.dtb
 
 dtb-$(CONFIG_VF610) += vf500-colibri.dtb \
-	vf610-colibri.dtb
+	vf610-colibri.dtb \
+	vf610-twr.dtb
 
 dtb-$(CONFIG_SOC_KEYSTONE) += k2hk-evm.dtb \
 	k2l-evm.dtb \
arch/arm/dts/vf610-twr.dts new file +22 -0
new file mode 100644
index 0000000..a4ccbcb
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2016 Toradex AG
+ *
+ * SPDX-License-Identifier:     GPL-2.0+ or X11
+ */
+
+/dts-v1/;
+#include "vf.dtsi"
+
+/ {
+	model = "VF610 Tower Board";
+	compatible = "fsl,vf610-twr", "fsl,vf610";
+
+	choosen {
+		stdout-path = &uart1;
+	};
+
+};
+
+&uart1 {
+	status = "okay";
+};
Signature · 1 line
2.7.0
#11 lore raw

PATCH v2 7/8 arm: pcm052: Add device tree file's

In reply to Bhuvanchandra DV

- Add device tree files for Phytec phyCORE-Vybrid Board.
- Enable lpuart support for Phytec phyCORE-Vybrid Board.
- Use UART1 for stdout.

---
 arch/arm/dts/Makefile   |  3 ++-
 arch/arm/dts/pcm052.dts | 22 ++++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/pcm052.dts
arch/arm/dts/Makefile +2 -1
index c6fb50c..b3bde5a 100644
@@ -191,7 +191,8 @@ dtb-$(CONFIG_MACH_SUN9I) += \
 
 dtb-$(CONFIG_VF610) += vf500-colibri.dtb \
 	vf610-colibri.dtb \
-	vf610-twr.dtb
+	vf610-twr.dtb \
+	pcm052.dtb
 
 dtb-$(CONFIG_SOC_KEYSTONE) += k2hk-evm.dtb \
 	k2l-evm.dtb \
arch/arm/dts/pcm052.dts new file +22 -0
new file mode 100644
index 0000000..0475f1f
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2016 Toradex AG
+ *
+ * SPDX-License-Identifier:     GPL-2.0+ or X11
+ */
+
+/dts-v1/;
+#include "vf.dtsi"
+
+/ {
+	model = "Phytec phyCORE-Vybrid";
+	compatible = "phytec,pcm052", "fsl,vf610";
+
+	choosen {
+		stdout-path = &uart1;
+	};
+
+};
+
+&uart1 {
+	status = "okay";
+};
Signature · 1 line
2.7.0
#12 lore raw

PATCH v2 8/8 arm: vybrid: Update defconfig's

In reply to Bhuvanchandra DV

Let's go with pure DT solution for board's
based on NXP/Freescale Vybrid platform.

- Merge the DT defconfig with non-DT defconfig for Toradex Colibri VF50/VF61 and drop the non-DT defconfig.
- Update the legacy defconfigs for NXP/Freescale VF610 Tower Board with DT.
- Update the legacy defconfigs for Phytec phyCORE-vybrid Board with DT.

---
 configs/colibri_vf_defconfig     |  8 ++++++++
 configs/colibri_vf_dtb_defconfig | 14 --------------
 configs/pcm052_defconfig         |  7 +++++++
 configs/vf610twr_defconfig       |  7 +++++++
 configs/vf610twr_nand_defconfig  |  7 +++++++
 5 files changed, 29 insertions(+), 14 deletions(-)
 delete mode 100644 configs/colibri_vf_dtb_defconfig
configs/colibri_vf_defconfig +8 -0
index 45917c8..27a41e7 100644
@@ -1,11 +1,19 @@
 CONFIG_ARM=y
 CONFIG_TARGET_COLIBRI_VF=y
+CONFIG_DM_SERIAL=y
+CONFIG_DM_SPI=y
+CONFIG_DM_GPIO=y
+CONFIG_DEFAULT_DEVICE_TREE="vf610-colibri"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/colibri_vf/imximage.cfg,ENV_IS_IN_NAND,IMX_NAND"
 CONFIG_SYS_PROMPT="Colibri VFxx # "
 # CONFIG_CMD_IMLS is not set
+CONFIG_CMD_SPI=y
 CONFIG_CMD_GPIO=y
 # CONFIG_CMD_SETEXPR is not set
+CONFIG_OF_CONTROL=y
 CONFIG_DM=y
+CONFIG_VYBRID_GPIO=y
 CONFIG_NAND_VF610_NFC=y
 CONFIG_SYS_NAND_VF610_NFC_60_ECC_BYTES=y
 CONFIG_FSL_LPUART=y
+CONFIG_FSL_DSPI=y
configs/colibri_vf_dtb_defconfig deleted +0 -14
deleted file mode 100644
index b1a843a..0000000
@@ -1,14 +0,0 @@
-CONFIG_ARM=y
-CONFIG_TARGET_COLIBRI_VF=y
-CONFIG_DEFAULT_DEVICE_TREE="vf610-colibri"
-CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/colibri_vf/imximage.cfg,ENV_IS_IN_NAND,IMX_NAND"
-CONFIG_SYS_PROMPT="Colibri VFxx # "
-# CONFIG_CMD_IMLS is not set
-CONFIG_CMD_GPIO=y
-# CONFIG_CMD_SETEXPR is not set
-# CONFIG_CMD_NET is not set
-CONFIG_OF_CONTROL=y
-CONFIG_DM=y
-CONFIG_NAND_VF610_NFC=y
-CONFIG_SYS_NAND_VF610_NFC_60_ECC_BYTES=y
-CONFIG_FSL_LPUART=y
configs/pcm052_defconfig +7 -0
index 26ab733..49159ce 100644
@@ -1,6 +1,13 @@
 CONFIG_ARM=y
 CONFIG_TARGET_PCM052=y
+CONFIG_DM_SERIAL=y
+CONFIG_DM_GPIO=y
+CONFIG_DEFAULT_DEVICE_TREE="pcm052"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/phytec/pcm052/imximage.cfg,ENV_IS_IN_NAND"
+CONFIG_CMD_GPIO=y
+CONFIG_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_VYBRID_GPIO=y
 CONFIG_NAND_VF610_NFC=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_FSL_LPUART=y
configs/vf610twr_defconfig +7 -0
index d51c93b..d959293 100644
@@ -1,8 +1,15 @@
 CONFIG_ARM=y
 CONFIG_TARGET_VF610TWR=y
+CONFIG_DM_SERIAL=y
+CONFIG_DM_GPIO=y
+CONFIG_DEFAULT_DEVICE_TREE="vf610-twr"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/vf610twr/imximage.cfg,ENV_IS_IN_MMC"
 # CONFIG_CMD_IMLS is not set
+CONFIG_CMD_GPIO=y
 # CONFIG_CMD_SETEXPR is not set
+CONFIG_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_VYBRID_GPIO=y
 CONFIG_NAND_VF610_NFC=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_SPI_FLASH=y
configs/vf610twr_nand_defconfig +7 -0
index 299fa8f..b6a96f2 100644
@@ -1,8 +1,15 @@
 CONFIG_ARM=y
 CONFIG_TARGET_VF610TWR=y
+CONFIG_DM_SERIAL=y
+CONFIG_DM_GPIO=y
+CONFIG_DEFAULT_DEVICE_TREE="vf610-twr"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/vf610twr/imximage.cfg,ENV_IS_IN_NAND"
 # CONFIG_CMD_IMLS is not set
+CONFIG_CMD_GPIO=y
 # CONFIG_CMD_SETEXPR is not set
+CONFIG_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_VYBRID_GPIO=y
 CONFIG_NAND_VF610_NFC=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_SPI_FLASH=y
Signature · 1 line
2.7.0