[U-Boot] [PATCH 0/8] Convert lpuart serial driver to driver model

- Convert lpuart driver to driver model and remove the legacy code. - Update Toradex Colibri VF50/VF61 serial support with driver model. - Update Freescale vf610twr serial support with driver model. - Update Freescale ls1021atwr serial support with driver model. - Update Phytec pcm052 serial support with driver model. - Tested the driver on Toradex Colibri VF50/VF61 hardware. - Compile checked board files for vf610twr, ls1021atwr and pcm052 since I don't have access to such hardware at my end. Reviewers and testers welcome!
Bhuvanchandra DV (8): dm: lpuart: Add driver model support for the serial driver colibri_vf: Update enabling lpuart support with driver model arm: vf610twr: Add driver model support vf610twr: Update enabling lpuart with driver model arm: ls102xa: Add driver model support ls1021x: Update enabling lpuart with driver model arm: pcm052: Enable driver model support pcm052: Update enabling lpuart support with driver model
arch/arm/include/asm/arch-ls102xa/serial.h | 16 ++++ arch/arm/include/asm/arch-vf610/serial.h | 16 ++++ board/freescale/ls1021atwr/ls1021atwr.c | 15 ++- board/freescale/vf610twr/vf610twr.c | 13 +++ board/phytec/pcm052/pcm052.c | 13 +++ board/toradex/colibri_vf/colibri_vf.c | 13 +++ configs/ls1021atwr_nor_lpuart_defconfig | 1 + configs/pcm052_defconfig | 1 + configs/vf610twr_defconfig | 1 + configs/vf610twr_nand_defconfig | 1 + drivers/serial/Kconfig | 6 ++ drivers/serial/serial_lpuart.c | 148 +++++++++++++++-------------- include/configs/colibri_vf.h | 6 +- include/configs/ls1021atwr.h | 1 + include/configs/pcm052.h | 6 +- include/configs/vf610twr.h | 6 +- 16 files changed, 180 insertions(+), 83 deletions(-) create mode 100644 arch/arm/include/asm/arch-ls102xa/serial.h create mode 100644 arch/arm/include/asm/arch-vf610/serial.h

Convert lpuart driver to driver model and remove the legacy code.
Signed-off-by: Bhuvanchandra DV bhuvanchandra.dv@toradex.com --- arch/arm/include/asm/arch-vf610/serial.h | 16 ++++ drivers/serial/Kconfig | 6 ++ drivers/serial/serial_lpuart.c | 148 ++++++++++++++++--------------- 3 files changed, 97 insertions(+), 73 deletions(-) create mode 100644 arch/arm/include/asm/arch-vf610/serial.h
diff --git a/arch/arm/include/asm/arch-vf610/serial.h b/arch/arm/include/asm/arch-vf610/serial.h new file mode 100644 index 0000000..e9ab552 --- /dev/null +++ b/arch/arm/include/asm/arch-vf610/serial.h @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2016 Toradex, Inc. + * + * Author: Bhuvanchandra DV bhuvanchandra.dv@toradex.com + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef _LPUART_SERIAL_H +#define _LPUART_SERIAL_H + +struct lpuart_serial_platdata { + uint32_t base_addr; +}; + +#endif diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 1fc287e..56a06a7 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -223,4 +223,10 @@ config UNIPHIER_SERIAL If you have a UniPhier based board and want to use the on-chip serial ports, say Y to this option. If unsure, say N.
+config FSL_LPUART + bool "Freescale lpuart serial port support" + depends on DM_SERIAL + help + Support for the on-chip lpuart on some Freescale SOCs. + endmenu diff --git a/drivers/serial/serial_lpuart.c b/drivers/serial/serial_lpuart.c index 63fc388..4724f42 100644 --- a/drivers/serial/serial_lpuart.c +++ b/drivers/serial/serial_lpuart.c @@ -5,12 +5,14 @@ */
#include <common.h> +#include <dm.h> #include <watchdog.h> #include <asm/io.h> #include <serial.h> #include <linux/compiler.h> #include <asm/arch/imx-regs.h> #include <asm/arch/clock.h> +#include <asm/arch/serial.h>
#define US1_TDRE (1 << 7) #define US1_RDRF (1 << 5) @@ -47,26 +49,35 @@
DECLARE_GLOBAL_DATA_PTR;
-struct lpuart_fsl *base = (struct lpuart_fsl *)LPUART_BASE; +struct lpuart_serial_priv { + struct lpuart_fsl *lpuart_base; +};
#ifndef CONFIG_LPUART_32B_REG -static void lpuart_serial_setbrg(void) +int lpuart_serial_setbrg(struct udevice *dev, int baudrate) { + struct lpuart_serial_priv *priv = dev_get_priv(dev); + struct lpuart_fsl *base = priv->lpuart_base; u32 clk = mxc_get_clock(MXC_UART_CLK); u16 sbr;
if (!gd->baudrate) - gd->baudrate = CONFIG_BAUDRATE; + gd->baudrate = baudrate;
sbr = (u16)(clk / (16 * gd->baudrate)); /* place adjustment later - n/32 BRFA */
__raw_writeb(sbr >> 8, &base->ubdh); __raw_writeb(sbr & 0xff, &base->ubdl); + + return 0; }
-static int lpuart_serial_getc(void) +static int lpuart_serial_getc(struct udevice *dev) { + struct lpuart_serial_priv *priv = dev_get_priv(dev); + struct lpuart_fsl *base = priv->lpuart_base; + while (!(__raw_readb(&base->us1) & (US1_RDRF | US1_OR))) WATCHDOG_RESET();
@@ -75,8 +86,11 @@ static int lpuart_serial_getc(void) return __raw_readb(&base->ud); }
-static void lpuart_serial_putc(const char c) +static int lpuart_serial_putc(struct udevice *dev, const char c) { + struct lpuart_serial_priv *priv = dev_get_priv(dev); + struct lpuart_fsl *base = priv->lpuart_base; + if (c == '\n') serial_putc('\r');
@@ -84,24 +98,15 @@ static void lpuart_serial_putc(const char c) WATCHDOG_RESET();
__raw_writeb(c, &base->ud); -} - -/* - * Test whether a character is in the RX buffer - */ -static int lpuart_serial_tstc(void) -{ - if (__raw_readb(&base->urcfifo) == 0) - return 0;
- return 1; + return 0; }
/* * Initialise the serial port with the given baudrate. The settings * are always 8 data bits, no parity, 1 stop bit, no start bits. */ -static int lpuart_serial_init(void) +static int lpuart_serial_init(struct lpuart_fsl *base) { u8 ctrl;
@@ -118,29 +123,15 @@ static int lpuart_serial_init(void) __raw_writeb(0x0, &base->utwfifo); __raw_writeb(0x1, &base->urwfifo); __raw_writeb(CFIFO_TXFLUSH | CFIFO_RXFLUSH, &base->ucfifo); - - /* provide data bits, parity, stop bit, etc */ - - serial_setbrg(); - __raw_writeb(UC2_RE | UC2_TE, &base->uc2);
return 0; } - -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 -static void lpuart32_serial_setbrg(void) +#else /* CONFIG_LPUART_32B_REG */ +int lpuart32_serial_setbrg(struct udevice *dev, int baudrate) { + struct lpuart_serial_priv *priv = dev_get_priv(dev); + struct lpuart_fsl *base = priv->lpuart_base; u32 clk = CONFIG_SYS_CLK_FREQ; u32 sbr;
@@ -151,10 +142,14 @@ static void lpuart32_serial_setbrg(void) /* place adjustment later - n/32 BRFA */
out_be32(&base->baud, sbr); + + return 0; }
-static int lpuart32_serial_getc(void) +static int lpuart32_serial_getc(struct udevice *dev) { + struct lpuart_serial_priv *priv = dev_get_priv(dev); + struct lpuart_fsl *base = priv->lpuart_base; u32 stat;
while (((stat = in_be32(&base->stat)) & STAT_RDRF) == 0) { @@ -165,8 +160,11 @@ static int lpuart32_serial_getc(void) return in_be32(&base->data) & 0x3ff; }
-static void lpuart32_serial_putc(const char c) +static int lpuart32_serial_putc(struct udevice *dev, const char c) { + struct lpuart_serial_priv *priv = dev_get_priv(dev); + struct lpuart_fsl *base = priv->lpuart_base; + if (c == '\n') serial_putc('\r');
@@ -174,24 +172,15 @@ static void lpuart32_serial_putc(const char c) WATCHDOG_RESET();
out_be32(&base->data, c); -}
-/* - * Test whether a character is in the RX buffer - */ -static int lpuart32_serial_tstc(void) -{ - if ((in_be32(&base->water) >> 24) == 0) - return 0; - - return 1; + return 0; }
/* * Initialise the serial port with the given baudrate. The settings * are always 8 data bits, no parity, 1 stop bit, no start bits. */ -static int lpuart32_serial_init(void) +static int lpuart32_serial_init(struct lpuart_fsl *base) { u8 ctrl;
@@ -204,41 +193,54 @@ static int lpuart32_serial_init(void) out_be32(&base->fifo, ~(FIFO_TXFE | FIFO_RXFE));
out_be32(&base->match, 0); - /* provide data bits, parity, stop bit, etc */ - - serial_setbrg(); - out_be32(&base->ctrl, CTRL_RE | CTRL_TE);
return 0; } +#endif /* CONFIG_LPUART_32B_REG */
-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, -}; -#endif - -void lpuart_serial_initialize(void) +static int lpuart_serial_probe(struct udevice *dev) { -#ifdef CONFIG_LPUART_32B_REG - serial_register(&lpuart32_serial_drv); + struct lpuart_serial_platdata *plat = dev->platdata; + struct lpuart_serial_priv *priv = dev_get_priv(dev); + + priv->lpuart_base = (struct lpuart_fsl *)plat->base_addr; +#ifndef CONFIG_LPUART_32B_REG + lpuart_serial_init(priv->lpuart_base); #else - serial_register(&lpuart_serial_drv); + lpuart32_serial_init(priv->lpuart_base); #endif + return 0; }
-__weak struct serial_device *default_serial_console(void) -{ -#ifdef CONFIG_LPUART_32B_REG - return &lpuart32_serial_drv; +#ifndef CONFIG_LPUART_32B_REG +static const struct dm_serial_ops lpuart_serial_ops = { + .putc = lpuart_serial_putc, + .getc = lpuart_serial_getc, + .setbrg = lpuart_serial_setbrg, +}; + +U_BOOT_DRIVER(serial_lpuart) = { + .name = "serial_lpuart", + .id = UCLASS_SERIAL, + .probe = lpuart_serial_probe, + .ops = &lpuart_serial_ops, + .flags = DM_FLAG_PRE_RELOC, + .priv_auto_alloc_size = sizeof(struct lpuart_serial_priv), +}; #else - return &lpuart_serial_drv; +static const struct dm_serial_ops lpuart32_serial_ops = { + .putc = lpuart32_serial_putc, + .getc = lpuart32_serial_getc, + .setbrg = lpuart32_serial_setbrg, +}; + +U_BOOT_DRIVER(serial_lpuart32) = { + .name = "serial_lpuart32", + .id = UCLASS_SERIAL, + .probe = lpuart_serial_probe, + .ops = &lpuart32_serial_ops, + .flags = DM_FLAG_PRE_RELOC, + .priv_auto_alloc_size = sizeof(struct lpuart_serial_priv), +}; #endif -}

Signed-off-by: Bhuvanchandra DV bhuvanchandra.dv@toradex.com --- board/toradex/colibri_vf/colibri_vf.c | 13 +++++++++++++ include/configs/colibri_vf.h | 6 +++--- 2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/board/toradex/colibri_vf/colibri_vf.c b/board/toradex/colibri_vf/colibri_vf.c index c65ccb3..76bc51c 100644 --- a/board/toradex/colibri_vf/colibri_vf.c +++ b/board/toradex/colibri_vf/colibri_vf.c @@ -8,12 +8,14 @@ */
#include <common.h> +#include <dm.h> #include <asm/io.h> #include <asm/arch/imx-regs.h> #include <asm/arch/iomux-vf610.h> #include <asm/arch/ddrmc-vf610.h> #include <asm/arch/crm_regs.h> #include <asm/arch/clock.h> +#include <asm/arch/serial.h> #include <mmc.h> #include <fsl_esdhc.h> #include <miiphy.h> @@ -586,3 +588,14 @@ int board_usb_phy_mode(int port) } } #endif + +#ifdef CONFIG_FSL_LPUART +static struct lpuart_serial_platdata lpuart_serial_plat = { + .base_addr = UART0_BASE, +}; + +U_BOOT_DEVICE(lpuart_serial) = { + .name = "serial_lpuart", + .platdata = &lpuart_serial_plat, +}; +#endif diff --git a/include/configs/colibri_vf.h b/include/configs/colibri_vf.h index 708c79a..6ecfdb2 100644 --- a/include/configs/colibri_vf.h +++ b/include/configs/colibri_vf.h @@ -36,15 +36,15 @@
#define CONFIG_BOARD_EARLY_INIT_F
+/* UART support */ +#define CONFIG_DM_SERIAL #define CONFIG_FSL_LPUART -#define LPUART_BASE UART0_BASE +#define CONFIG_BAUDRATE 115200
/* 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
/* NAND support */

Signed-off-by: Bhuvanchandra DV bhuvanchandra.dv@toradex.com --- configs/vf610twr_defconfig | 1 + configs/vf610twr_nand_defconfig | 1 + 2 files changed, 2 insertions(+)
diff --git a/configs/vf610twr_defconfig b/configs/vf610twr_defconfig index dc8df5c..46b4e00 100644 --- a/configs/vf610twr_defconfig +++ b/configs/vf610twr_defconfig @@ -3,6 +3,7 @@ CONFIG_TARGET_VF610TWR=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/vf610twr/imximage.cfg,ENV_IS_IN_MMC" # CONFIG_CMD_IMLS is not set # CONFIG_CMD_SETEXPR is not set +CONFIG_DM=y CONFIG_NAND_VF610_NFC=y CONFIG_SYS_NAND_BUSWIDTH_16BIT=y CONFIG_SPI_FLASH=y diff --git a/configs/vf610twr_nand_defconfig b/configs/vf610twr_nand_defconfig index 98880f3..d244459 100644 --- a/configs/vf610twr_nand_defconfig +++ b/configs/vf610twr_nand_defconfig @@ -3,6 +3,7 @@ CONFIG_TARGET_VF610TWR=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/vf610twr/imximage.cfg,ENV_IS_IN_NAND" # CONFIG_CMD_IMLS is not set # CONFIG_CMD_SETEXPR is not set +CONFIG_DM=y CONFIG_NAND_VF610_NFC=y CONFIG_SYS_NAND_BUSWIDTH_16BIT=y CONFIG_SPI_FLASH=y

Signed-off-by: Bhuvanchandra DV bhuvanchandra.dv@toradex.com --- board/freescale/vf610twr/vf610twr.c | 13 +++++++++++++ include/configs/vf610twr.h | 6 +++--- 2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/board/freescale/vf610twr/vf610twr.c b/board/freescale/vf610twr/vf610twr.c index 37b241d..3ca0094 100644 --- a/board/freescale/vf610twr/vf610twr.c +++ b/board/freescale/vf610twr/vf610twr.c @@ -5,12 +5,14 @@ */
#include <common.h> +#include <dm.h> #include <asm/io.h> #include <asm/arch/imx-regs.h> #include <asm/arch/iomux-vf610.h> #include <asm/arch/ddrmc-vf610.h> #include <asm/arch/crm_regs.h> #include <asm/arch/clock.h> +#include <asm/arch/serial.h> #include <mmc.h> #include <fsl_esdhc.h> #include <miiphy.h> @@ -385,3 +387,14 @@ int checkboard(void)
return 0; } + +#ifdef CONFIG_FSL_LPUART +static struct lpuart_serial_platdata lpuart_serial_plat = { + .base_addr = UART1_BASE, +}; + +U_BOOT_DEVICE(lpuart_serial) = { + .name = "serial_lpuart", + .platdata = &lpuart_serial_plat, +}; +#endif diff --git a/include/configs/vf610twr.h b/include/configs/vf610twr.h index 34df6f0..fd898c0 100644 --- a/include/configs/vf610twr.h +++ b/include/configs/vf610twr.h @@ -34,13 +34,13 @@
#define CONFIG_BOARD_EARLY_INIT_F
+/* UART support */ +#define CONFIG_DM_SERIAL #define CONFIG_FSL_LPUART -#define LPUART_BASE UART1_BASE +#define CONFIG_BAUDRATE 115200
/* Allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE -#define CONFIG_SYS_UART_PORT (1) -#define CONFIG_BAUDRATE 115200
/* NAND support */ #define CONFIG_CMD_NAND

Signed-off-by: Bhuvanchandra DV bhuvanchandra.dv@toradex.com --- configs/ls1021atwr_nor_lpuart_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/ls1021atwr_nor_lpuart_defconfig b/configs/ls1021atwr_nor_lpuart_defconfig index d7afca9..d52181b 100644 --- a/configs/ls1021atwr_nor_lpuart_defconfig +++ b/configs/ls1021atwr_nor_lpuart_defconfig @@ -2,5 +2,6 @@ CONFIG_ARM=y CONFIG_TARGET_LS1021ATWR=y CONFIG_SYS_EXTRA_OPTIONS="LPUART" # CONFIG_CMD_SETEXPR is not set +CONFIG_DM=y CONFIG_NETDEVICES=y CONFIG_E1000=y

Signed-off-by: Bhuvanchandra DV bhuvanchandra.dv@toradex.com --- arch/arm/include/asm/arch-ls102xa/serial.h | 16 ++++++++++++++++ board/freescale/ls1021atwr/ls1021atwr.c | 15 ++++++++++++++- include/configs/ls1021atwr.h | 1 + 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 arch/arm/include/asm/arch-ls102xa/serial.h
diff --git a/arch/arm/include/asm/arch-ls102xa/serial.h b/arch/arm/include/asm/arch-ls102xa/serial.h new file mode 100644 index 0000000..8a99149 --- /dev/null +++ b/arch/arm/include/asm/arch-ls102xa/serial.h @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2016 Toradex, Inc. + * + * Author: Bhuvanchandra DV bhuvanchandra.dv@toradex.com + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef _LPUART32_SERIAL_H +#define _LPUART32_SERIAL_H + +struct lpuart_serial_platdata { + uint32_t base_addr; +}; + +#endif diff --git a/board/freescale/ls1021atwr/ls1021atwr.c b/board/freescale/ls1021atwr/ls1021atwr.c index 8eaff5f..6d3977f 100644 --- a/board/freescale/ls1021atwr/ls1021atwr.c +++ b/board/freescale/ls1021atwr/ls1021atwr.c @@ -5,10 +5,13 @@ */
#include <common.h> +#include <dm.h> #include <i2c.h> #include <asm/io.h> #include <asm/arch/immap_ls102xa.h> #include <asm/arch/clock.h> +#include <asm/arch/config.h> +#include <asm/arch/serial.h> #include <asm/arch/fsl_serdes.h> #include <asm/arch/ls102xa_stream_id.h> #include <asm/arch/ls102xa_devdis.h> @@ -31,7 +34,6 @@ #include "../../../drivers/qe/qe.h" #endif
- DECLARE_GLOBAL_DATA_PTR;
#define VERSION_MASK 0x00FF @@ -793,3 +795,14 @@ U_BOOT_CMD( "\nWARNING: If you aren't familiar with the setting of serdes, don't try to change anything!\n" ); #endif + +#ifdef CONFIG_FSL_LPUART +static struct lpuart_serial_platdata lpuart_serial_plat = { + .base_addr = LPUART_BASE, +}; + +U_BOOT_DEVICE(lpuart_serial) = { + .name = "serial_lpuart32", + .platdata = &lpuart_serial_plat, +}; +#endif diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h index c12ba3a..896c419 100644 --- a/include/configs/ls1021atwr.h +++ b/include/configs/ls1021atwr.h @@ -266,6 +266,7 @@ * Serial Port */ #ifdef CONFIG_LPUART +#define CONFIG_DM_SERIAL #define CONFIG_FSL_LPUART #define CONFIG_LPUART_32B_REG #else

Signed-off-by: Bhuvanchandra DV bhuvanchandra.dv@toradex.com --- configs/pcm052_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/pcm052_defconfig b/configs/pcm052_defconfig index 9125645..12fdc0c 100644 --- a/configs/pcm052_defconfig +++ b/configs/pcm052_defconfig @@ -1,5 +1,6 @@ CONFIG_ARM=y CONFIG_TARGET_PCM052=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/phytec/pcm052/imximage.cfg,ENV_IS_IN_NAND" +CONFIG_DM=y CONFIG_NAND_VF610_NFC=y CONFIG_SYS_NAND_BUSWIDTH_16BIT=y

Signed-off-by: Bhuvanchandra DV bhuvanchandra.dv@toradex.com --- board/phytec/pcm052/pcm052.c | 13 +++++++++++++ include/configs/pcm052.h | 6 +++--- 2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/board/phytec/pcm052/pcm052.c b/board/phytec/pcm052/pcm052.c index e4f61e1..3f2ed38 100644 --- a/board/phytec/pcm052/pcm052.c +++ b/board/phytec/pcm052/pcm052.c @@ -5,12 +5,14 @@ */
#include <common.h> +#include <dm.h> #include <asm/io.h> #include <asm/arch/imx-regs.h> #include <asm/arch/iomux-vf610.h> #include <asm/arch/ddrmc-vf610.h> #include <asm/arch/crm_regs.h> #include <asm/arch/clock.h> +#include <asm/arch/serial.h> #include <mmc.h> #include <fsl_esdhc.h> #include <miiphy.h> @@ -513,3 +515,14 @@ int checkboard(void)
return 0; } + +#ifdef CONFIG_FSL_LPUART +static struct lpuart_serial_platdata lpuart_serial_plat = { + .base_addr = UART1_BASE, +}; + +U_BOOT_DEVICE(lpuart_serial) = { + .name = "serial_lpuart", + .platdata = &lpuart_serial_plat, +}; +#endif diff --git a/include/configs/pcm052.h b/include/configs/pcm052.h index b851bba..bd3992f 100644 --- a/include/configs/pcm052.h +++ b/include/configs/pcm052.h @@ -27,13 +27,13 @@
#define CONFIG_BOARD_EARLY_INIT_F
+/* UART support */ +#define CONFIG_DM_SERIAL #define CONFIG_FSL_LPUART -#define LPUART_BASE UART1_BASE +#define CONFIG_BAUDRATE 115200
/* Allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE -#define CONFIG_SYS_UART_PORT (1) -#define CONFIG_BAUDRATE 115200
#undef CONFIG_CMD_IMLS

Hi Bhuvanchandra,
On Tue, Jan 12, 2016 at 12:28 PM, Bhuvanchandra DV bhuvanchandra.dv@toradex.com wrote:
- Convert lpuart driver to driver model and remove the legacy code.
- Update Toradex Colibri VF50/VF61 serial support with driver model.
- Update Freescale vf610twr serial support with driver model.
- Update Freescale ls1021atwr serial support with driver model.
- Update Phytec pcm052 serial support with driver model.
- Tested the driver on Toradex Colibri VF50/VF61 hardware.
- Compile checked board files for vf610twr, ls1021atwr and pcm052 since I don't have access to such hardware at my end. Reviewers and testers welcome!
Bhuvanchandra DV (8): dm: lpuart: Add driver model support for the serial driver colibri_vf: Update enabling lpuart support with driver model arm: vf610twr: Add driver model support vf610twr: Update enabling lpuart with driver model arm: ls102xa: Add driver model support ls1021x: Update enabling lpuart with driver model arm: pcm052: Enable driver model support pcm052: Update enabling lpuart support with driver model
arch/arm/include/asm/arch-ls102xa/serial.h | 16 ++++ arch/arm/include/asm/arch-vf610/serial.h | 16 ++++ board/freescale/ls1021atwr/ls1021atwr.c | 15 ++- board/freescale/vf610twr/vf610twr.c | 13 +++ board/phytec/pcm052/pcm052.c | 13 +++ board/toradex/colibri_vf/colibri_vf.c | 13 +++ configs/ls1021atwr_nor_lpuart_defconfig | 1 + configs/pcm052_defconfig | 1 + configs/vf610twr_defconfig | 1 + configs/vf610twr_nand_defconfig | 1 + drivers/serial/Kconfig | 6 ++ drivers/serial/serial_lpuart.c | 148 +++++++++++++++-------------- include/configs/colibri_vf.h | 6 +- include/configs/ls1021atwr.h | 1 + include/configs/pcm052.h | 6 +- include/configs/vf610twr.h | 6 +- 16 files changed, 180 insertions(+), 83 deletions(-) create mode 100644 arch/arm/include/asm/arch-ls102xa/serial.h create mode 100644 arch/arm/include/asm/arch-vf610/serial.h
--
Please see existing patch series @ http://patchwork.ozlabs.org/patch/561855/. You can drop the ls102xa changes and rebase your patch series on top of that. Thanks!
Regards, Bin

Hi Bin,
On 01/12/2016 11:05 AM, Bin Meng wrote:
Hi Bhuvanchandra,
On Tue, Jan 12, 2016 at 12:28 PM, Bhuvanchandra DV bhuvanchandra.dv@toradex.com wrote:
- Convert lpuart driver to driver model and remove the legacy code.
- Update Toradex Colibri VF50/VF61 serial support with driver model.
- Update Freescale vf610twr serial support with driver model.
- Update Freescale ls1021atwr serial support with driver model.
- Update Phytec pcm052 serial support with driver model.
- Tested the driver on Toradex Colibri VF50/VF61 hardware.
- Compile checked board files for vf610twr, ls1021atwr and pcm052 since I don't have access to such hardware at my end. Reviewers and testers welcome!
Bhuvanchandra DV (8): dm: lpuart: Add driver model support for the serial driver colibri_vf: Update enabling lpuart support with driver model arm: vf610twr: Add driver model support vf610twr: Update enabling lpuart with driver model arm: ls102xa: Add driver model support ls1021x: Update enabling lpuart with driver model arm: pcm052: Enable driver model support pcm052: Update enabling lpuart support with driver model
arch/arm/include/asm/arch-ls102xa/serial.h | 16 ++++ arch/arm/include/asm/arch-vf610/serial.h | 16 ++++ board/freescale/ls1021atwr/ls1021atwr.c | 15 ++- board/freescale/vf610twr/vf610twr.c | 13 +++ board/phytec/pcm052/pcm052.c | 13 +++ board/toradex/colibri_vf/colibri_vf.c | 13 +++ configs/ls1021atwr_nor_lpuart_defconfig | 1 + configs/pcm052_defconfig | 1 + configs/vf610twr_defconfig | 1 + configs/vf610twr_nand_defconfig | 1 + drivers/serial/Kconfig | 6 ++ drivers/serial/serial_lpuart.c | 148 +++++++++++++++-------------- include/configs/colibri_vf.h | 6 +- include/configs/ls1021atwr.h | 1 + include/configs/pcm052.h | 6 +- include/configs/vf610twr.h | 6 +- 16 files changed, 180 insertions(+), 83 deletions(-) create mode 100644 arch/arm/include/asm/arch-ls102xa/serial.h create mode 100644 arch/arm/include/asm/arch-vf610/serial.h
--
Please see existing patch series @ http://patchwork.ozlabs.org/patch/561855/. You can drop the ls102xa changes and rebase your patch series on top of that. Thanks!
We are not aware of this patch set, sorry! about that. You want me to drop only the ls102xa changes? How about the changes/updates to the lpuart driver? should i update them with your device tree support stuff and rebase the remaining patch set along with your Signed-off-by tag ? Any suggestions ?
Regards, Bin

Hi Bhuvanchandra,
On Tue, Jan 12, 2016 at 2:43 PM, Bhuvanchandra DV bhuvanchandra.dv@toradex.com wrote:
Hi Bin,
On 01/12/2016 11:05 AM, Bin Meng wrote:
Hi Bhuvanchandra,
On Tue, Jan 12, 2016 at 12:28 PM, Bhuvanchandra DV bhuvanchandra.dv@toradex.com wrote:
- Convert lpuart driver to driver model and remove the legacy code.
- Update Toradex Colibri VF50/VF61 serial support with driver model.
- Update Freescale vf610twr serial support with driver model.
- Update Freescale ls1021atwr serial support with driver model.
- Update Phytec pcm052 serial support with driver model.
- Tested the driver on Toradex Colibri VF50/VF61 hardware.
- Compile checked board files for vf610twr, ls1021atwr and pcm052 since I don't have access to such hardware at my end. Reviewers and testers welcome!
Bhuvanchandra DV (8): dm: lpuart: Add driver model support for the serial driver colibri_vf: Update enabling lpuart support with driver model arm: vf610twr: Add driver model support vf610twr: Update enabling lpuart with driver model arm: ls102xa: Add driver model support ls1021x: Update enabling lpuart with driver model arm: pcm052: Enable driver model support pcm052: Update enabling lpuart support with driver model
arch/arm/include/asm/arch-ls102xa/serial.h | 16 ++++ arch/arm/include/asm/arch-vf610/serial.h | 16 ++++ board/freescale/ls1021atwr/ls1021atwr.c | 15 ++- board/freescale/vf610twr/vf610twr.c | 13 +++ board/phytec/pcm052/pcm052.c | 13 +++ board/toradex/colibri_vf/colibri_vf.c | 13 +++ configs/ls1021atwr_nor_lpuart_defconfig | 1 + configs/pcm052_defconfig | 1 + configs/vf610twr_defconfig | 1 + configs/vf610twr_nand_defconfig | 1 + drivers/serial/Kconfig | 6 ++ drivers/serial/serial_lpuart.c | 148 +++++++++++++++-------------- include/configs/colibri_vf.h | 6 +- include/configs/ls1021atwr.h | 1 + include/configs/pcm052.h | 6 +- include/configs/vf610twr.h | 6 +- 16 files changed, 180 insertions(+), 83 deletions(-) create mode 100644 arch/arm/include/asm/arch-ls102xa/serial.h create mode 100644 arch/arm/include/asm/arch-vf610/serial.h
--
Please see existing patch series @ http://patchwork.ozlabs.org/patch/561855/. You can drop the ls102xa changes and rebase your patch series on top of that. Thanks!
We are not aware of this patch set, sorry! about that. You want me to drop only the ls102xa changes? How about the changes/updates to the lpuart driver? should i update them with your device tree support stuff and rebase the remaining patch set along with your Signed-off-by tag ? Any suggestions ?
I believe you can: - Drop the LPUART DM conversion patch in your series, which was already done - Drop the ls1021atwr changes, which was already done - Do the similar changes to all other boards in your series, by following ls1021atwr changes in my series - There is no need to add my SOB tag in your series as I was actually not doing anything :)
Regards, Bin

Hi Bin,
On 01/12/2016 12:21 PM, Bin Meng wrote:
Hi Bhuvanchandra,
On Tue, Jan 12, 2016 at 2:43 PM, Bhuvanchandra DV bhuvanchandra.dv@toradex.com wrote:
Hi Bin,
On 01/12/2016 11:05 AM, Bin Meng wrote:
Hi Bhuvanchandra,
On Tue, Jan 12, 2016 at 12:28 PM, Bhuvanchandra DV bhuvanchandra.dv@toradex.com wrote:
- Convert lpuart driver to driver model and remove the legacy code.
- Update Toradex Colibri VF50/VF61 serial support with driver model.
- Update Freescale vf610twr serial support with driver model.
- Update Freescale ls1021atwr serial support with driver model.
- Update Phytec pcm052 serial support with driver model.
- Tested the driver on Toradex Colibri VF50/VF61 hardware.
- Compile checked board files for vf610twr, ls1021atwr and pcm052 since I don't have access to such hardware at my end. Reviewers and testers welcome!
Bhuvanchandra DV (8): dm: lpuart: Add driver model support for the serial driver colibri_vf: Update enabling lpuart support with driver model arm: vf610twr: Add driver model support vf610twr: Update enabling lpuart with driver model arm: ls102xa: Add driver model support ls1021x: Update enabling lpuart with driver model arm: pcm052: Enable driver model support pcm052: Update enabling lpuart support with driver model
arch/arm/include/asm/arch-ls102xa/serial.h | 16 ++++ arch/arm/include/asm/arch-vf610/serial.h | 16 ++++ board/freescale/ls1021atwr/ls1021atwr.c | 15 ++- board/freescale/vf610twr/vf610twr.c | 13 +++ board/phytec/pcm052/pcm052.c | 13 +++ board/toradex/colibri_vf/colibri_vf.c | 13 +++ configs/ls1021atwr_nor_lpuart_defconfig | 1 + configs/pcm052_defconfig | 1 + configs/vf610twr_defconfig | 1 + configs/vf610twr_nand_defconfig | 1 + drivers/serial/Kconfig | 6 ++ drivers/serial/serial_lpuart.c | 148 +++++++++++++++-------------- include/configs/colibri_vf.h | 6 +- include/configs/ls1021atwr.h | 1 + include/configs/pcm052.h | 6 +- include/configs/vf610twr.h | 6 +- 16 files changed, 180 insertions(+), 83 deletions(-) create mode 100644 arch/arm/include/asm/arch-ls102xa/serial.h create mode 100644 arch/arm/include/asm/arch-vf610/serial.h
--
Please see existing patch series @ http://patchwork.ozlabs.org/patch/561855/. You can drop the ls102xa changes and rebase your patch series on top of that. Thanks!
We are not aware of this patch set, sorry! about that. You want me to drop only the ls102xa changes? How about the changes/updates to the lpuart driver? should i update them with your device tree support stuff and rebase the remaining patch set along with your Signed-off-by tag ? Any suggestions ?
I believe you can:
- Drop the LPUART DM conversion patch in your series, which was already done
I believe that the patch set[1] is now _only_ supporting device tree enabled boards, there are boards using lpuart which are not yet having device trees, boards like vf610twr and Phytec pcm052. Even with driver model enabled i guess these boards canont use lpuart via platform data with this patch set. I think it would be nice to have the support for both platform data and device tree so that we can use it with platform data via board files and device tree too.
Since only few boards are using lpuart driver we can update the driver completly to driver model, drop the legacy code and update the boards.
Seems the legacy code in lpuart driver is broken: drivers/serial/serial_lpuart.c:148:9: error: too few arguments to function '_lpuart_serial_tstc'
I will test the patch set[1] atleast on Toradex Colibri VF50/VF61 h/w and will provide a detailed report of my observations.
[1] http://patchwork.ozlabs.org/patch/561855/
- Drop the ls1021atwr changes, which was already done
- Do the similar changes to all other boards in your series, by
following ls1021atwr changes in my series
- There is no need to add my SOB tag in your series as I was actually
not doing anything :)
Regards, Bin

Hi,
On 12 January 2016 at 02:30, Bhuvanchandra DV bhuvanchandra.dv@toradex.com wrote:
Hi Bin,
On 01/12/2016 12:21 PM, Bin Meng wrote:
Hi Bhuvanchandra,
On Tue, Jan 12, 2016 at 2:43 PM, Bhuvanchandra DV bhuvanchandra.dv@toradex.com wrote:
Hi Bin,
On 01/12/2016 11:05 AM, Bin Meng wrote:
Hi Bhuvanchandra,
On Tue, Jan 12, 2016 at 12:28 PM, Bhuvanchandra DV bhuvanchandra.dv@toradex.com wrote:
- Convert lpuart driver to driver model and remove the legacy code.
- Update Toradex Colibri VF50/VF61 serial support with driver model.
- Update Freescale vf610twr serial support with driver model.
- Update Freescale ls1021atwr serial support with driver model.
- Update Phytec pcm052 serial support with driver model.
- Tested the driver on Toradex Colibri VF50/VF61 hardware.
- Compile checked board files for vf610twr, ls1021atwr and pcm052 since I don't have access to such hardware at my end. Reviewers and testers welcome!
Bhuvanchandra DV (8): dm: lpuart: Add driver model support for the serial driver colibri_vf: Update enabling lpuart support with driver model arm: vf610twr: Add driver model support vf610twr: Update enabling lpuart with driver model arm: ls102xa: Add driver model support ls1021x: Update enabling lpuart with driver model arm: pcm052: Enable driver model support pcm052: Update enabling lpuart support with driver model
arch/arm/include/asm/arch-ls102xa/serial.h | 16 ++++ arch/arm/include/asm/arch-vf610/serial.h | 16 ++++ board/freescale/ls1021atwr/ls1021atwr.c | 15 ++- board/freescale/vf610twr/vf610twr.c | 13 +++ board/phytec/pcm052/pcm052.c | 13 +++ board/toradex/colibri_vf/colibri_vf.c | 13 +++ configs/ls1021atwr_nor_lpuart_defconfig | 1 + configs/pcm052_defconfig | 1 + configs/vf610twr_defconfig | 1 + configs/vf610twr_nand_defconfig | 1 + drivers/serial/Kconfig | 6 ++ drivers/serial/serial_lpuart.c | 148 +++++++++++++++-------------- include/configs/colibri_vf.h | 6 +- include/configs/ls1021atwr.h | 1 + include/configs/pcm052.h | 6 +- include/configs/vf610twr.h | 6 +- 16 files changed, 180 insertions(+), 83 deletions(-) create mode 100644 arch/arm/include/asm/arch-ls102xa/serial.h create mode 100644 arch/arm/include/asm/arch-vf610/serial.h
--
Please see existing patch series @ http://patchwork.ozlabs.org/patch/561855/. You can drop the ls102xa changes and rebase your patch series on top of that. Thanks!
We are not aware of this patch set, sorry! about that. You want me to drop only the ls102xa changes? How about the changes/updates to the lpuart driver? should i update them with your device tree support stuff and rebase the remaining patch set along with your Signed-off-by tag ? Any suggestions ?
I believe you can:
- Drop the LPUART DM conversion patch in your series, which was already
done
I believe that the patch set[1] is now _only_ supporting device tree enabled boards, there are boards using lpuart which are not yet having device trees, boards like vf610twr and Phytec pcm052. Even with driver model enabled i guess these boards canont use lpuart via platform data with this patch set. I think it would be nice to have the support for both platform data and device tree so that we can use it with platform data via board files and device tree too.
Since only few boards are using lpuart driver we can update the driver completly to driver model, drop the legacy code and update the boards.
Seems the legacy code in lpuart driver is broken: drivers/serial/serial_lpuart.c:148:9: error: too few arguments to function '_lpuart_serial_tstc'
I will test the patch set[1] atleast on Toradex Colibri VF50/VF61 h/w and will provide a detailed report of my observations.
[1] http://patchwork.ozlabs.org/patch/561855/
- Drop the ls1021atwr changes, which was already done
- Do the similar changes to all other boards in your series, by
following ls1021atwr changes in my series
- There is no need to add my SOB tag in your series as I was actually
not doing anything :)
Please go ahead and post any new patches that are required here now that Bin's series has landed.
Regards, Simon

Hi Simon,
On 01/22/2016 08:46 AM, Simon Glass wrote:
Hi,
On 12 January 2016 at 02:30, Bhuvanchandra DV bhuvanchandra.dv@toradex.com wrote:
Hi Bin,
On 01/12/2016 12:21 PM, Bin Meng wrote:
Hi Bhuvanchandra,
On Tue, Jan 12, 2016 at 2:43 PM, Bhuvanchandra DV bhuvanchandra.dv@toradex.com wrote:
Hi Bin,
On 01/12/2016 11:05 AM, Bin Meng wrote:
Hi Bhuvanchandra,
On Tue, Jan 12, 2016 at 12:28 PM, Bhuvanchandra DV bhuvanchandra.dv@toradex.com wrote:
- Convert lpuart driver to driver model and remove the legacy code.
- Update Toradex Colibri VF50/VF61 serial support with driver model.
- Update Freescale vf610twr serial support with driver model.
- Update Freescale ls1021atwr serial support with driver model.
- Update Phytec pcm052 serial support with driver model.
- Tested the driver on Toradex Colibri VF50/VF61 hardware.
- Compile checked board files for vf610twr, ls1021atwr and pcm052 since I don't have access to such hardware at my end. Reviewers and testers welcome!
Bhuvanchandra DV (8): dm: lpuart: Add driver model support for the serial driver colibri_vf: Update enabling lpuart support with driver model arm: vf610twr: Add driver model support vf610twr: Update enabling lpuart with driver model arm: ls102xa: Add driver model support ls1021x: Update enabling lpuart with driver model arm: pcm052: Enable driver model support pcm052: Update enabling lpuart support with driver model
arch/arm/include/asm/arch-ls102xa/serial.h | 16 ++++ arch/arm/include/asm/arch-vf610/serial.h | 16 ++++ board/freescale/ls1021atwr/ls1021atwr.c | 15 ++- board/freescale/vf610twr/vf610twr.c | 13 +++ board/phytec/pcm052/pcm052.c | 13 +++ board/toradex/colibri_vf/colibri_vf.c | 13 +++ configs/ls1021atwr_nor_lpuart_defconfig | 1 + configs/pcm052_defconfig | 1 + configs/vf610twr_defconfig | 1 + configs/vf610twr_nand_defconfig | 1 + drivers/serial/Kconfig | 6 ++ drivers/serial/serial_lpuart.c | 148
+++++++++++++++-------------- include/configs/colibri_vf.h | 6 +- include/configs/ls1021atwr.h | 1 + include/configs/pcm052.h | 6 +- include/configs/vf610twr.h | 6 +- 16 files changed, 180 insertions(+), 83 deletions(-) create mode 100644 arch/arm/include/asm/arch-ls102xa/serial.h create mode 100644 arch/arm/include/asm/arch-vf610/serial.h
--
Please see existing patch series @ http://patchwork.ozlabs.org/patch/561855/. You can drop the ls102xa changes and rebase your patch series on top of that. Thanks!
We are not aware of this patch set, sorry! about that. You want me to drop only the ls102xa changes? How about the changes/updates to the lpuart driver? should i update them with your device tree support stuff and rebase the remaining patch set along with your Signed-off-by tag ? Any suggestions ?
I believe you can:
- Drop the LPUART DM conversion patch in your series, which was already
done
I believe that the patch set[1] is now _only_ supporting device tree enabled boards, there are boards using lpuart which are not yet having device trees, boards like vf610twr and Phytec pcm052. Even with driver model enabled i guess these boards canont use lpuart via platform data with this patch set. I think it would be nice to have the support for both platform data and device tree so that we can use it with platform data via board files and device tree too.
Since only few boards are using lpuart driver we can update the driver completly to driver model, drop the legacy code and update the boards.
Seems the legacy code in lpuart driver is broken: drivers/serial/serial_lpuart.c:148:9: error: too few arguments to function '_lpuart_serial_tstc'
I will test the patch set[1] atleast on Toradex Colibri VF50/VF61 h/w and will provide a detailed report of my observations.
[1] http://patchwork.ozlabs.org/patch/561855/
- Drop the ls1021atwr changes, which was already done
- Do the similar changes to all other boards in your series, by
following ls1021atwr changes in my series
- There is no need to add my SOB tag in your series as I was actually
not doing anything :)
Please go ahead and post any new patches that are required here now that Bin's series has landed.
Will submit the new patchset ASAP.
Regards, Simon
participants (3)
-
Bhuvanchandra DV
-
Bin Meng
-
Simon Glass