Skip to contentSkip to conversation

Migrate NXP/Freescale Vybrid based boards to support pure DT

PATCH Superseded Bhuvanchandra DV 2 participants 12 messages Jan 27, 2016 – Feb 2, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

Changes since v3:
- Add missing space in device tree.
- Reorder the patchset to avoid broken state.

Changes since v2:
- Split the patch for updating the license string.
- Reorder the patchset to avoid broken state.

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 (9):
arm: vybrid: Enable lpuart support
arm: vybrid: Update the license string
arm: colibri-vf: Enable serial support
arm: vf610-twr: Add device tree file's
arm: pcm052: Add device tree file's
arm: vybrid: Update defconfig's
arm: vybrid: Drop enabling GPIO, SPI and UART in legacy mode
dm: lpuart: Drop the legacy code
dm: vybrid_gpio: Drop legacy code

 arch/arm/dts/Makefile            |   4 +-
 arch/arm/dts/pcm052.dts          |  22 +++++++++
 arch/arm/dts/vf-colibri.dtsi     |  15 ++++--
 arch/arm/dts/vf.dtsi             |  48 +++++++++++++++++--
 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, 131 insertions(+), 171 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 v4 1/9 arm: vybrid: Enable lpuart support

Add device tree node's for lpuart on Vybrid platform

---
 arch/arm/dts/vf.dtsi | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
arch/arm/dts/vf.dtsi +43 -0
index 78706e1..7aa4c91 100644
@@ -17,6 +17,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 +39,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 +125,19 @@
 			#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";
+			};
+
 		};
 	};
 };
Signature · 1 line
2.7.0
#2 lore raw

PATCH v4 2/9 arm: vybrid: Update the license string

In reply to Bhuvanchandra DV

Since SPDX license is already there, drop the full one.

---
 arch/arm/dts/vf-colibri.dtsi   | 5 -----
 arch/arm/dts/vf.dtsi           | 5 -----
 arch/arm/dts/vf500-colibri.dts | 5 -----
 arch/arm/dts/vf610-colibri.dts | 5 -----
 4 files changed, 20 deletions(-)
arch/arm/dts/vf-colibri.dtsi +0 -5
index 7a8e9bee..f005339 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.
  */
 #include "vf.dtsi"
 
arch/arm/dts/vf.dtsi +0 -5
index 7aa4c91..1530d2f 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"
 
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
#3 lore raw

PATCH v4 3/9 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 | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/dts/vf-colibri.dtsi +10 -0
index f005339..dc52748 100644
@@ -5,6 +5,12 @@
  */
 #include "vf.dtsi"
 
+/ {
+	chosen {
+		stdout-path = &uart0;
+	};
+};
+
 &dspi1 {
 	status = "okay";
 	bus-num = <1>;
@@ -14,3 +20,7 @@
 		spi-max-frequency = <50000000>;
 	};
 };
+
+&uart0 {
+	status = "okay";
+};
Signature · 1 line
2.7.0
#4 lore raw

PATCH v4 4/9 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
#5 lore raw

PATCH v4 5/9 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
#6 lore raw

PATCH v4 6/9 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
#7 lore raw

PATCH v4 7/9 arm: vybrid: Drop enabling GPIO, SPI and UART in legacy mode

In reply to Bhuvanchandra DV

Remove the legacy way of enabling GPIO, SPI and UART 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
#8 lore raw

PATCH v4 8/9 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
#9 lore raw

PATCH v4 9/9 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
#10 lore raw

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

In reply to Bhuvanchandra DV

Ping!

Quoted 54 lines · Bhuvanchandra DV

Changes since v3:
- Add missing space in device tree.
- Reorder the patchset to avoid broken state.

Changes since v2:
- Split the patch for updating the license string.
- Reorder the patchset to avoid broken state.

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 (9):
arm: vybrid: Enable lpuart support
arm: vybrid: Update the license string
arm: colibri-vf: Enable serial support
arm: vf610-twr: Add device tree file's
arm: pcm052: Add device tree file's
arm: vybrid: Update defconfig's
arm: vybrid: Drop enabling GPIO, SPI and UART in legacy mode
dm: lpuart: Drop the legacy code
dm: vybrid_gpio: Drop legacy code

  arch/arm/dts/Makefile            |   4 +-
  arch/arm/dts/pcm052.dts          |  22 +++++++++
  arch/arm/dts/vf-colibri.dtsi     |  15 ++++--
  arch/arm/dts/vf.dtsi             |  48 +++++++++++++++++--
  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, 131 insertions(+), 171 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 · 2 lines
Best regards,
Bhuvan
#11 lore raw

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

In reply to Bhuvanchandra DV
Quoted 45 lines · Bhuvanchandra DV

Changes since v3:
- Add missing space in device tree.
- Reorder the patchset to avoid broken state.

Changes since v2:
- Split the patch for updating the license string.
- Reorder the patchset to avoid broken state.

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 (9):
arm: vybrid: Enable lpuart support
arm: vybrid: Update the license string
arm: colibri-vf: Enable serial support
arm: vf610-twr: Add device tree file's
arm: pcm052: Add device tree file's
arm: vybrid: Update defconfig's
arm: vybrid: Drop enabling GPIO, SPI and UART in legacy mode
dm: lpuart: Drop the legacy code
dm: vybrid_gpio: Drop legacy code

 arch/arm/dts/Makefile            |   4 +-
 arch/arm/dts/pcm052.dts          |  22 +++++++++
 arch/arm/dts/vf-colibri.dtsi     |  15 ++++--
 arch/arm/dts/vf.dtsi             |  48 +++++++++++++++++--
 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 -------
Quoted 9 lines
 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, 131 insertions(+), 171 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

Whole series applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================