* [U-Boot] [PATCH 1/4] armv8/ls1043aqds: added lpuart support
@ 2016-01-19 6:48 Wenbin Song
2016-01-19 6:48 ` [U-Boot] [PATCH 2/4] armv8/ls1043aqds: Add lpuart defconfig Wenbin Song
` (4 more replies)
0 siblings, 5 replies; 16+ messages in thread
From: Wenbin Song @ 2016-01-19 6:48 UTC (permalink / raw)
To: u-boot
From: Shaohui Xie <shaohui.xie@nxp.com>
Signed-off-by: Shaohui Xie <shaohui.xie@nxp.com>
Signed-off-by: Mingkai Hu <mingkai.hu@nxp.com>
---
board/freescale/ls1043aqds/ls1043aqds.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/board/freescale/ls1043aqds/ls1043aqds.c b/board/freescale/ls1043aqds/ls1043aqds.c
index d6696ca..1da3fe1 100644
--- a/board/freescale/ls1043aqds/ls1043aqds.c
+++ b/board/freescale/ls1043aqds/ls1043aqds.c
@@ -40,6 +40,9 @@ enum {
#define CFG_SD_MUX3_MUX4 0x1 /* MUX4 */
#define CFG_SD_MUX4_SLOT3 0x0 /* SLOT3 TX/RX1 */
#define CFG_SD_MUX4_SLOT1 0x1 /* SLOT1 TX/RX3 */
+#define CFG_UART_MUX_MASK 0x6
+#define CFG_UART_MUX_SHIFT 1
+#define CFG_LPUART_EN 0x1
int checkboard(void)
{
@@ -218,7 +221,19 @@ void board_retimer_init(void)
int board_early_init_f(void)
{
+#ifdef CONFIG_LPUART
+ u8 uart;
+#endif
fsl_lsch2_early_init_f();
+#ifdef CONFIG_LPUART
+ /*FIXME: need to check which lpuart is enabled in rcw, for now
+ * we use lpuart1.
+ */
+ uart = QIXIS_READ(brdcfg[14]);
+ uart &= ~CFG_UART_MUX_MASK;
+ uart |= CFG_LPUART_EN << CFG_UART_MUX_SHIFT;
+ QIXIS_WRITE(brdcfg[14], uart);
+#endif
return 0;
}
--
2.1.0.27.g96db324
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 2/4] armv8/ls1043aqds: Add lpuart defconfig
2016-01-19 6:48 [U-Boot] [PATCH 1/4] armv8/ls1043aqds: added lpuart support Wenbin Song
@ 2016-01-19 6:48 ` Wenbin Song
2016-01-19 8:02 ` Bin Meng
2016-01-19 6:48 ` [U-Boot] [PATCH 3/4] armv8/ls1043aqds: Fix CONFIG_LPUART Wenbin Song
` (3 subsequent siblings)
4 siblings, 1 reply; 16+ messages in thread
From: Wenbin Song @ 2016-01-19 6:48 UTC (permalink / raw)
To: u-boot
---
configs/ls1043aqds_lpuart_defconfig | 8 ++++++++
1 file changed, 8 insertions(+)
create mode 100644 configs/ls1043aqds_lpuart_defconfig
diff --git a/configs/ls1043aqds_lpuart_defconfig b/configs/ls1043aqds_lpuart_defconfig
new file mode 100644
index 0000000..ca06abe
--- /dev/null
+++ b/configs/ls1043aqds_lpuart_defconfig
@@ -0,0 +1,8 @@
+CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4,LPUART"
+CONFIG_ARM=y
+CONFIG_TARGET_LS1043AQDS=y
+CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1043a-qds"
+CONFIG_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPI_FLASH=y
+CONFIG_DM_SPI=y
--
2.1.0.27.g96db324
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 3/4] armv8/ls1043aqds: Fix CONFIG_LPUART
2016-01-19 6:48 [U-Boot] [PATCH 1/4] armv8/ls1043aqds: added lpuart support Wenbin Song
2016-01-19 6:48 ` [U-Boot] [PATCH 2/4] armv8/ls1043aqds: Add lpuart defconfig Wenbin Song
@ 2016-01-19 6:48 ` Wenbin Song
2016-01-19 7:06 ` Mingkai Hu
2016-01-19 8:04 ` Bin Meng
2016-01-19 6:48 ` [U-Boot] [PATCH 4/4] armv8/ls1043aqds: Initizlize NS16550 if enalbed LPUART Wenbin Song
` (2 subsequent siblings)
4 siblings, 2 replies; 16+ messages in thread
From: Wenbin Song @ 2016-01-19 6:48 UTC (permalink / raw)
To: u-boot
From: songwenbin <Wenbin.Song@freescale.com>
If configured CONFIG_LPUART, should undefine the NS16550
Signed-off-by: Wenbin Song <wenbin.song@nxp.com>
---
include/configs/ls1043aqds.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h
index 398f1c3..88f4bc0 100644
--- a/include/configs/ls1043aqds.h
+++ b/include/configs/ls1043aqds.h
@@ -88,6 +88,17 @@ unsigned long get_board_ddr_clk(void);
#define CONFIG_SYS_FSL_PBL_RCW board/freescale/ls1043aqds/ls1043aqds_rcw_sd_ifc.cfg
#endif
+/*
+ * LPUART
+ */
+#ifdef CONFIG_LPUART
+#define CONFIG_FSL_LPUART
+#define CONFIG_LPUART_32B_REG
+#undef CONFIG_CONS_INDEX
+#undef CONFIG_SYS_NS16550_SERIAL
+#undef CONFIG_SYS_NS16550_CLK
+#endif
+
/* SATA */
#define CONFIG_LIBATA
#define CONFIG_SCSI_AHCI
--
2.1.0.27.g96db324
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 4/4] armv8/ls1043aqds: Initizlize NS16550 if enalbed LPUART
2016-01-19 6:48 [U-Boot] [PATCH 1/4] armv8/ls1043aqds: added lpuart support Wenbin Song
2016-01-19 6:48 ` [U-Boot] [PATCH 2/4] armv8/ls1043aqds: Add lpuart defconfig Wenbin Song
2016-01-19 6:48 ` [U-Boot] [PATCH 3/4] armv8/ls1043aqds: Fix CONFIG_LPUART Wenbin Song
@ 2016-01-19 6:48 ` Wenbin Song
2016-01-19 8:07 ` Bin Meng
2016-01-19 7:03 ` [U-Boot] [PATCH 1/4] armv8/ls1043aqds: added lpuart support Mingkai Hu
2016-01-19 8:00 ` Bin Meng
4 siblings, 1 reply; 16+ messages in thread
From: Wenbin Song @ 2016-01-19 6:48 UTC (permalink / raw)
To: u-boot
From: Wenbin Song <Wenbin.Song@freescale.com>
Need to initialize ns16550 to support earlycon on kernel.
Signed-off-by: Wenbin Song <Wenbin.Song@freescale.com>
Signed-off-by: Mingkai Hu <Mingkai.Hu@freescale.com>
---
board/freescale/ls1043aqds/ls1043aqds.c | 12 ++++++++++++
configs/ls1043aqds_lpuart_defconfig | 1 +
include/configs/ls1043aqds.h | 3 ++-
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/board/freescale/ls1043aqds/ls1043aqds.c b/board/freescale/ls1043aqds/ls1043aqds.c
index 1da3fe1..fcbd95c 100644
--- a/board/freescale/ls1043aqds/ls1043aqds.c
+++ b/board/freescale/ls1043aqds/ls1043aqds.c
@@ -21,6 +21,7 @@
#include <fsl_esdhc.h>
#include <fsl_ifc.h>
#include <spl.h>
+#include <ns16550.h>
#include "../common/qixis.h"
#include "ls1043aqds_qixis.h"
@@ -219,6 +220,17 @@ void board_retimer_init(void)
i2c_write(I2C_RETIMER_ADDR, 0x64, 1, ®, 1);
}
+int board_early_init_r(void)
+{
+#ifdef CONFIG_LPUART
+ /* Initialize ns16500 for earlycon on kernel.*/
+ NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
+ DIV_ROUND_CLOSEST(CONFIG_SYS_NS16550_CLK,
+ 16 * CONFIG_BAUDRATE));
+#endif
+ return 0;
+}
+
int board_early_init_f(void)
{
#ifdef CONFIG_LPUART
diff --git a/configs/ls1043aqds_lpuart_defconfig b/configs/ls1043aqds_lpuart_defconfig
index ca06abe..26f7b36 100644
--- a/configs/ls1043aqds_lpuart_defconfig
+++ b/configs/ls1043aqds_lpuart_defconfig
@@ -1,6 +1,7 @@
CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4,LPUART"
CONFIG_ARM=y
CONFIG_TARGET_LS1043AQDS=y
+CONFIG_SYS_NS16550=y
CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1043a-qds"
CONFIG_OF_CONTROL=y
CONFIG_DM=y
diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h
index 88f4bc0..d66d8f9 100644
--- a/include/configs/ls1043aqds.h
+++ b/include/configs/ls1043aqds.h
@@ -30,6 +30,8 @@ unsigned long get_board_ddr_clk(void);
#define CONFIG_LAYERSCAPE_NS_ACCESS
+#define CONFIG_BOARD_EARLY_INIT_R
+
#define CONFIG_DIMM_SLOTS_PER_CTLR 1
/* Physical Memory Map */
#define CONFIG_CHIP_SELECTS_PER_CTRL 4
@@ -96,7 +98,6 @@ unsigned long get_board_ddr_clk(void);
#define CONFIG_LPUART_32B_REG
#undef CONFIG_CONS_INDEX
#undef CONFIG_SYS_NS16550_SERIAL
-#undef CONFIG_SYS_NS16550_CLK
#endif
/* SATA */
--
2.1.0.27.g96db324
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 1/4] armv8/ls1043aqds: added lpuart support
2016-01-19 6:48 [U-Boot] [PATCH 1/4] armv8/ls1043aqds: added lpuart support Wenbin Song
` (2 preceding siblings ...)
2016-01-19 6:48 ` [U-Boot] [PATCH 4/4] armv8/ls1043aqds: Initizlize NS16550 if enalbed LPUART Wenbin Song
@ 2016-01-19 7:03 ` Mingkai Hu
2016-01-19 8:00 ` Bin Meng
4 siblings, 0 replies; 16+ messages in thread
From: Mingkai Hu @ 2016-01-19 7:03 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: Wenbin Song [mailto:wenbin.song at nxp.com]
> Sent: Tuesday, January 19, 2016 2:48 PM
> To: yorksun at freescale.com; Mingkai Hu; Qianyu Gong; Shaohui Xie; Wenbin
> Song; u-boot at lists.denx.de
> Subject: [PATCH 1/4] armv8/ls1043aqds: added lpuart support
>
> From: Shaohui Xie <shaohui.xie@nxp.com>
>
> Signed-off-by: Shaohui Xie <shaohui.xie@nxp.com>
> Signed-off-by: Mingkai Hu <mingkai.hu@nxp.com>
> ---
> board/freescale/ls1043aqds/ls1043aqds.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/board/freescale/ls1043aqds/ls1043aqds.c
> b/board/freescale/ls1043aqds/ls1043aqds.c
> index d6696ca..1da3fe1 100644
> --- a/board/freescale/ls1043aqds/ls1043aqds.c
> +++ b/board/freescale/ls1043aqds/ls1043aqds.c
> @@ -40,6 +40,9 @@ enum {
> #define CFG_SD_MUX3_MUX4 0x1 /* MUX4 */
> #define CFG_SD_MUX4_SLOT3 0x0 /* SLOT3 TX/RX1 */
> #define CFG_SD_MUX4_SLOT1 0x1 /* SLOT1 TX/RX3 */
> +#define CFG_UART_MUX_MASK 0x6
> +#define CFG_UART_MUX_SHIFT 1
> +#define CFG_LPUART_EN 0x1
>
> int checkboard(void)
> {
> @@ -218,7 +221,19 @@ void board_retimer_init(void)
>
> int board_early_init_f(void)
> {
> +#ifdef CONFIG_LPUART
> + u8 uart;
> +#endif
> fsl_lsch2_early_init_f();
> +#ifdef CONFIG_LPUART
> + /*FIXME: need to check which lpuart is enabled in rcw, for now
> + * we use lpuart1.
> + */
> + uart = QIXIS_READ(brdcfg[14]);
> + uart &= ~CFG_UART_MUX_MASK;
> + uart |= CFG_LPUART_EN << CFG_UART_MUX_SHIFT;
> + QIXIS_WRITE(brdcfg[14], uart);
> +#endif
>
Please use the RCW to check which LPUART is enabled.
Thanks,
Mingkai
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 3/4] armv8/ls1043aqds: Fix CONFIG_LPUART
2016-01-19 6:48 ` [U-Boot] [PATCH 3/4] armv8/ls1043aqds: Fix CONFIG_LPUART Wenbin Song
@ 2016-01-19 7:06 ` Mingkai Hu
2016-01-19 8:04 ` Bin Meng
1 sibling, 0 replies; 16+ messages in thread
From: Mingkai Hu @ 2016-01-19 7:06 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: Wenbin Song [mailto:wenbin.song at nxp.com]
> Sent: Tuesday, January 19, 2016 2:48 PM
> To: yorksun at freescale.com; Mingkai Hu; Qianyu Gong; Shaohui Xie; Wenbin
> Song; u-boot at lists.denx.de
> Cc: songwenbin
> Subject: [PATCH 3/4] armv8/ls1043aqds: Fix CONFIG_LPUART
>
> From: songwenbin <Wenbin.Song@freescale.com>
>
> If configured CONFIG_LPUART, should undefine the NS16550
>
> Signed-off-by: Wenbin Song <wenbin.song@nxp.com>
> ---
> include/configs/ls1043aqds.h | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h
> index 398f1c3..88f4bc0 100644
> --- a/include/configs/ls1043aqds.h
> +++ b/include/configs/ls1043aqds.h
> @@ -88,6 +88,17 @@ unsigned long get_board_ddr_clk(void); #define
> CONFIG_SYS_FSL_PBL_RCW
> board/freescale/ls1043aqds/ls1043aqds_rcw_sd_ifc.cfg
> #endif
>
> +/*
> + * LPUART
> + */
> +#ifdef CONFIG_LPUART
> +#define CONFIG_FSL_LPUART
> +#define CONFIG_LPUART_32B_REG
> +#undef CONFIG_CONS_INDEX
> +#undef CONFIG_SYS_NS16550_SERIAL
> +#undef CONFIG_SYS_NS16550_CLK
> +#endif
> +
> /* SATA */
> #define CONFIG_LIBATA
> #define CONFIG_SCSI_AHCI
> --
> 2.1.0.27.g96db324
It's better to rephrase tile to "armv8/ls1043aqds: add LPUART support"?
And give more information about "undefine the NS16550" in commit message.
Thanks,
Mingkai
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 1/4] armv8/ls1043aqds: added lpuart support
2016-01-19 6:48 [U-Boot] [PATCH 1/4] armv8/ls1043aqds: added lpuart support Wenbin Song
` (3 preceding siblings ...)
2016-01-19 7:03 ` [U-Boot] [PATCH 1/4] armv8/ls1043aqds: added lpuart support Mingkai Hu
@ 2016-01-19 8:00 ` Bin Meng
4 siblings, 0 replies; 16+ messages in thread
From: Bin Meng @ 2016-01-19 8:00 UTC (permalink / raw)
To: u-boot
Hi Wenbin,
On Tue, Jan 19, 2016 at 2:48 PM, Wenbin Song <wenbin.song@nxp.com> wrote:
> From: Shaohui Xie <shaohui.xie@nxp.com>
>
Please try to add a commit message.
> Signed-off-by: Shaohui Xie <shaohui.xie@nxp.com>
> Signed-off-by: Mingkai Hu <mingkai.hu@nxp.com>
> ---
> board/freescale/ls1043aqds/ls1043aqds.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/board/freescale/ls1043aqds/ls1043aqds.c b/board/freescale/ls1043aqds/ls1043aqds.c
> index d6696ca..1da3fe1 100644
> --- a/board/freescale/ls1043aqds/ls1043aqds.c
> +++ b/board/freescale/ls1043aqds/ls1043aqds.c
> @@ -40,6 +40,9 @@ enum {
> #define CFG_SD_MUX3_MUX4 0x1 /* MUX4 */
> #define CFG_SD_MUX4_SLOT3 0x0 /* SLOT3 TX/RX1 */
> #define CFG_SD_MUX4_SLOT1 0x1 /* SLOT1 TX/RX3 */
> +#define CFG_UART_MUX_MASK 0x6
> +#define CFG_UART_MUX_SHIFT 1
> +#define CFG_LPUART_EN 0x1
>
> int checkboard(void)
> {
> @@ -218,7 +221,19 @@ void board_retimer_init(void)
>
> int board_early_init_f(void)
> {
> +#ifdef CONFIG_LPUART
> + u8 uart;
> +#endif
> fsl_lsch2_early_init_f();
> +#ifdef CONFIG_LPUART
> + /*FIXME: need to check which lpuart is enabled in rcw, for now
> + * we use lpuart1.
> + */
Please use correct multi-line comment format.
> + uart = QIXIS_READ(brdcfg[14]);
> + uart &= ~CFG_UART_MUX_MASK;
> + uart |= CFG_LPUART_EN << CFG_UART_MUX_SHIFT;
> + QIXIS_WRITE(brdcfg[14], uart);
> +#endif
>
> return 0;
> }
> --
Regards,
Bin
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 2/4] armv8/ls1043aqds: Add lpuart defconfig
2016-01-19 6:48 ` [U-Boot] [PATCH 2/4] armv8/ls1043aqds: Add lpuart defconfig Wenbin Song
@ 2016-01-19 8:02 ` Bin Meng
2016-01-20 4:29 ` Wenbin Song
0 siblings, 1 reply; 16+ messages in thread
From: Bin Meng @ 2016-01-19 8:02 UTC (permalink / raw)
To: u-boot
Hi Wenbin,
On Tue, Jan 19, 2016 at 2:48 PM, Wenbin Song <wenbin.song@nxp.com> wrote:
> ---
Please include a commit message and SoB here.
> configs/ls1043aqds_lpuart_defconfig | 8 ++++++++
> 1 file changed, 8 insertions(+)
> create mode 100644 configs/ls1043aqds_lpuart_defconfig
>
> diff --git a/configs/ls1043aqds_lpuart_defconfig b/configs/ls1043aqds_lpuart_defconfig
> new file mode 100644
> index 0000000..ca06abe
> --- /dev/null
> +++ b/configs/ls1043aqds_lpuart_defconfig
> @@ -0,0 +1,8 @@
> +CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4,LPUART"
> +CONFIG_ARM=y
> +CONFIG_TARGET_LS1043AQDS=y
> +CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1043a-qds"
> +CONFIG_OF_CONTROL=y
> +CONFIG_DM=y
> +CONFIG_SPI_FLASH=y
> +CONFIG_DM_SPI=y
> --
Please use the driver model LPUART driver in this series
(http://patchwork.ozlabs.org/patch/567250/).
Regards,
Bin
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 3/4] armv8/ls1043aqds: Fix CONFIG_LPUART
2016-01-19 6:48 ` [U-Boot] [PATCH 3/4] armv8/ls1043aqds: Fix CONFIG_LPUART Wenbin Song
2016-01-19 7:06 ` Mingkai Hu
@ 2016-01-19 8:04 ` Bin Meng
1 sibling, 0 replies; 16+ messages in thread
From: Bin Meng @ 2016-01-19 8:04 UTC (permalink / raw)
To: u-boot
Hi Wenbin,
On Tue, Jan 19, 2016 at 2:48 PM, Wenbin Song <wenbin.song@nxp.com> wrote:
> From: songwenbin <Wenbin.Song@freescale.com>
>
> If configured CONFIG_LPUART, should undefine the NS16550
>
> Signed-off-by: Wenbin Song <wenbin.song@nxp.com>
> ---
> include/configs/ls1043aqds.h | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h
> index 398f1c3..88f4bc0 100644
> --- a/include/configs/ls1043aqds.h
> +++ b/include/configs/ls1043aqds.h
> @@ -88,6 +88,17 @@ unsigned long get_board_ddr_clk(void);
> #define CONFIG_SYS_FSL_PBL_RCW board/freescale/ls1043aqds/ls1043aqds_rcw_sd_ifc.cfg
> #endif
>
> +/*
> + * LPUART
> + */
> +#ifdef CONFIG_LPUART
> +#define CONFIG_FSL_LPUART
> +#define CONFIG_LPUART_32B_REG
> +#undef CONFIG_CONS_INDEX
> +#undef CONFIG_SYS_NS16550_SERIAL
> +#undef CONFIG_SYS_NS16550_CLK
> +#endif
> +
Please update board defconfig instead #define / #undef in the
configuration header. The NS16550 and LPUART are now both Kconfig
options.
Regards,
Bin
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 4/4] armv8/ls1043aqds: Initizlize NS16550 if enalbed LPUART
2016-01-19 6:48 ` [U-Boot] [PATCH 4/4] armv8/ls1043aqds: Initizlize NS16550 if enalbed LPUART Wenbin Song
@ 2016-01-19 8:07 ` Bin Meng
2016-01-19 10:21 ` Wenbin Song
0 siblings, 1 reply; 16+ messages in thread
From: Bin Meng @ 2016-01-19 8:07 UTC (permalink / raw)
To: u-boot
Hi Wenbin,
On Tue, Jan 19, 2016 at 2:48 PM, Wenbin Song <wenbin.song@nxp.com> wrote:
> From: Wenbin Song <Wenbin.Song@freescale.com>
>
> Need to initialize ns16550 to support earlycon on kernel.
>
> Signed-off-by: Wenbin Song <Wenbin.Song@freescale.com>
> Signed-off-by: Mingkai Hu <Mingkai.Hu@freescale.com>
> ---
> board/freescale/ls1043aqds/ls1043aqds.c | 12 ++++++++++++
> configs/ls1043aqds_lpuart_defconfig | 1 +
> include/configs/ls1043aqds.h | 3 ++-
> 3 files changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/board/freescale/ls1043aqds/ls1043aqds.c b/board/freescale/ls1043aqds/ls1043aqds.c
> index 1da3fe1..fcbd95c 100644
> --- a/board/freescale/ls1043aqds/ls1043aqds.c
> +++ b/board/freescale/ls1043aqds/ls1043aqds.c
> @@ -21,6 +21,7 @@
> #include <fsl_esdhc.h>
> #include <fsl_ifc.h>
> #include <spl.h>
> +#include <ns16550.h>
>
> #include "../common/qixis.h"
> #include "ls1043aqds_qixis.h"
> @@ -219,6 +220,17 @@ void board_retimer_init(void)
> i2c_write(I2C_RETIMER_ADDR, 0x64, 1, ®, 1);
> }
>
> +int board_early_init_r(void)
> +{
> +#ifdef CONFIG_LPUART
> + /* Initialize ns16500 for earlycon on kernel.*/
> + NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
> + DIV_ROUND_CLOSEST(CONFIG_SYS_NS16550_CLK,
> + 16 * CONFIG_BAUDRATE));
> +#endif
This change does not make a lot sense to me. Since U-Boot is using
LPUART as its system console, why do you want to load a kernel that
uses the NS16550 as the system console? IMHO we should ask kernel to
use LPUART as well, IOW keep in sync with the underlying bootloader.
> + return 0;
> +}
> +
> int board_early_init_f(void)
> {
> #ifdef CONFIG_LPUART
> diff --git a/configs/ls1043aqds_lpuart_defconfig b/configs/ls1043aqds_lpuart_defconfig
> index ca06abe..26f7b36 100644
> --- a/configs/ls1043aqds_lpuart_defconfig
> +++ b/configs/ls1043aqds_lpuart_defconfig
> @@ -1,6 +1,7 @@
> CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4,LPUART"
> CONFIG_ARM=y
> CONFIG_TARGET_LS1043AQDS=y
> +CONFIG_SYS_NS16550=y
> CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1043a-qds"
> CONFIG_OF_CONTROL=y
> CONFIG_DM=y
> diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h
> index 88f4bc0..d66d8f9 100644
> --- a/include/configs/ls1043aqds.h
> +++ b/include/configs/ls1043aqds.h
> @@ -30,6 +30,8 @@ unsigned long get_board_ddr_clk(void);
>
> #define CONFIG_LAYERSCAPE_NS_ACCESS
>
> +#define CONFIG_BOARD_EARLY_INIT_R
> +
> #define CONFIG_DIMM_SLOTS_PER_CTLR 1
> /* Physical Memory Map */
> #define CONFIG_CHIP_SELECTS_PER_CTRL 4
> @@ -96,7 +98,6 @@ unsigned long get_board_ddr_clk(void);
> #define CONFIG_LPUART_32B_REG
> #undef CONFIG_CONS_INDEX
> #undef CONFIG_SYS_NS16550_SERIAL
> -#undef CONFIG_SYS_NS16550_CLK
> #endif
>
> /* SATA */
> --
Regards,
Bin
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 4/4] armv8/ls1043aqds: Initizlize NS16550 if enalbed LPUART
2016-01-19 8:07 ` Bin Meng
@ 2016-01-19 10:21 ` Wenbin Song
2016-01-19 10:42 ` Bin Meng
0 siblings, 1 reply; 16+ messages in thread
From: Wenbin Song @ 2016-01-19 10:21 UTC (permalink / raw)
To: u-boot
Hi: Bin,
Because we use the ns16550 as the early console when booting kernel , and the earlycon driver on kernel cannot initialize port->uartclk rightly, So if we want to use it, we must initialize ns16550 on uboot, and use the bootargs as follow :
"console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,0x21c0500 "
int __init early_serial8250_setup(struct earlycon_device *device,
const char *options)
{
if (!(device->port.membase || device->port.iobase))
return -ENODEV;
if (!device->baud) {
struct uart_port *port = &device->port;
unsigned int ier;
/* assume the device was initialized, only mask interrupts */
ier = serial8250_early_in(port, UART_IER);
serial8250_early_out(port, UART_IER, ier & UART_IER_UUE);
} else
init_port(device);
device->con->write = early_serial8250_write;
return 0;
}
Regards
Wenbin Song
-----Original Message-----
From: Bin Meng [mailto:bmeng.cn at gmail.com]
Sent: Tuesday, January 19, 2016 4:08 PM
To: Wenbin Song <wenbin.song@nxp.com>
Cc: York Sun <yorksun@freescale.com>; Mingkai Hu <mingkai.hu@nxp.com>; Qianyu Gong <qianyu.gong@nxp.com>; Shaohui Xie <shaohui.xie@nxp.com>; U-Boot Mailing List <u-boot@lists.denx.de>; Wenbin Song <Wenbin.Song@freescale.com>
Subject: Re: [U-Boot] [PATCH 4/4] armv8/ls1043aqds: Initizlize NS16550 if enalbed LPUART
Hi Wenbin,
On Tue, Jan 19, 2016 at 2:48 PM, Wenbin Song <wenbin.song@nxp.com> wrote:
> From: Wenbin Song <Wenbin.Song@freescale.com>
>
> Need to initialize ns16550 to support earlycon on kernel.
>
> Signed-off-by: Wenbin Song <Wenbin.Song@freescale.com>
> Signed-off-by: Mingkai Hu <Mingkai.Hu@freescale.com>
> ---
> board/freescale/ls1043aqds/ls1043aqds.c | 12 ++++++++++++
> configs/ls1043aqds_lpuart_defconfig | 1 +
> include/configs/ls1043aqds.h | 3 ++-
> 3 files changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/board/freescale/ls1043aqds/ls1043aqds.c
> b/board/freescale/ls1043aqds/ls1043aqds.c
> index 1da3fe1..fcbd95c 100644
> --- a/board/freescale/ls1043aqds/ls1043aqds.c
> +++ b/board/freescale/ls1043aqds/ls1043aqds.c
> @@ -21,6 +21,7 @@
> #include <fsl_esdhc.h>
> #include <fsl_ifc.h>
> #include <spl.h>
> +#include <ns16550.h>
>
> #include "../common/qixis.h"
> #include "ls1043aqds_qixis.h"
> @@ -219,6 +220,17 @@ void board_retimer_init(void)
> i2c_write(I2C_RETIMER_ADDR, 0x64, 1, ®, 1); }
>
> +int board_early_init_r(void)
> +{
> +#ifdef CONFIG_LPUART
> + /* Initialize ns16500 for earlycon on kernel.*/
> + NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
> + DIV_ROUND_CLOSEST(CONFIG_SYS_NS16550_CLK,
> + 16 * CONFIG_BAUDRATE)); #endif
This change does not make a lot sense to me. Since U-Boot is using LPUART as its system console, why do you want to load a kernel that uses the NS16550 as the system console? IMHO we should ask kernel to use LPUART as well, IOW keep in sync with the underlying bootloader.
> + return 0;
> +}
> +
> int board_early_init_f(void)
> {
> #ifdef CONFIG_LPUART
> diff --git a/configs/ls1043aqds_lpuart_defconfig
> b/configs/ls1043aqds_lpuart_defconfig
> index ca06abe..26f7b36 100644
> --- a/configs/ls1043aqds_lpuart_defconfig
> +++ b/configs/ls1043aqds_lpuart_defconfig
> @@ -1,6 +1,7 @@
> CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4,LPUART"
> CONFIG_ARM=y
> CONFIG_TARGET_LS1043AQDS=y
> +CONFIG_SYS_NS16550=y
> CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1043a-qds"
> CONFIG_OF_CONTROL=y
> CONFIG_DM=y
> diff --git a/include/configs/ls1043aqds.h
> b/include/configs/ls1043aqds.h index 88f4bc0..d66d8f9 100644
> --- a/include/configs/ls1043aqds.h
> +++ b/include/configs/ls1043aqds.h
> @@ -30,6 +30,8 @@ unsigned long get_board_ddr_clk(void);
>
> #define CONFIG_LAYERSCAPE_NS_ACCESS
>
> +#define CONFIG_BOARD_EARLY_INIT_R
> +
> #define CONFIG_DIMM_SLOTS_PER_CTLR 1
> /* Physical Memory Map */
> #define CONFIG_CHIP_SELECTS_PER_CTRL 4
> @@ -96,7 +98,6 @@ unsigned long get_board_ddr_clk(void); #define
> CONFIG_LPUART_32B_REG #undef CONFIG_CONS_INDEX #undef
> CONFIG_SYS_NS16550_SERIAL -#undef CONFIG_SYS_NS16550_CLK #endif
>
> /* SATA */
> --
Regards,
Bin
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 4/4] armv8/ls1043aqds: Initizlize NS16550 if enalbed LPUART
2016-01-19 10:21 ` Wenbin Song
@ 2016-01-19 10:42 ` Bin Meng
2016-01-19 12:12 ` Wenbin Song
0 siblings, 1 reply; 16+ messages in thread
From: Bin Meng @ 2016-01-19 10:42 UTC (permalink / raw)
To: u-boot
Hi Wenbin,
On Tue, Jan 19, 2016 at 6:21 PM, Wenbin Song <wenbin.song@nxp.com> wrote:
> Hi: Bin,
> Because we use the ns16550 as the early console when booting kernel , and the earlycon driver on kernel cannot initialize port->uartclk rightly, So if we want to use it, we must initialize ns16550 on uboot, and use the bootargs as follow :
> "console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,0x21c0500 "
>
I understand this. My question was: U-Boot was booted using LPUART as
its serial console, why do you bother loading a kernel with another
serial port as the early console?
> int __init early_serial8250_setup(struct earlycon_device *device,
> const char *options)
> {
> if (!(device->port.membase || device->port.iobase))
> return -ENODEV;
>
> if (!device->baud) {
> struct uart_port *port = &device->port;
> unsigned int ier;
>
> /* assume the device was initialized, only mask interrupts */
> ier = serial8250_early_in(port, UART_IER);
> serial8250_early_out(port, UART_IER, ier & UART_IER_UUE);
> } else
> init_port(device);
>
> device->con->write = early_serial8250_write;
> return 0;
> }
>
[snip]
Regards,
Bin
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 4/4] armv8/ls1043aqds: Initizlize NS16550 if enalbed LPUART
2016-01-19 10:42 ` Bin Meng
@ 2016-01-19 12:12 ` Wenbin Song
0 siblings, 0 replies; 16+ messages in thread
From: Wenbin Song @ 2016-01-19 12:12 UTC (permalink / raw)
To: u-boot
Hi:Bin
Thanks for your advice! I realize that I can use the lpuart as earlycon on kernel . So I will remove this patch on next vesion.
Thanks
Wenbin Song
Sent from my iPhone
> On Jan 19, 2016, at 18:42, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Hi Wenbin,
>
>> On Tue, Jan 19, 2016 at 6:21 PM, Wenbin Song <wenbin.song@nxp.com> wrote:
>> Hi: Bin,
>> Because we use the ns16550 as the early console when booting kernel , and the earlycon driver on kernel cannot initialize port->uartclk rightly, So if we want to use it, we must initialize ns16550 on uboot, and use the bootargs as follow :
>> "console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,0x21c0500 "
>
> I understand this. My question was: U-Boot was booted using LPUART as
> its serial console, why do you bother loading a kernel with another
> serial port as the early console?
>
>> int __init early_serial8250_setup(struct earlycon_device *device,
>> const char *options)
>> {
>> if (!(device->port.membase || device->port.iobase))
>> return -ENODEV;
>>
>> if (!device->baud) {
>> struct uart_port *port = &device->port;
>> unsigned int ier;
>>
>> /* assume the device was initialized, only mask interrupts */
>> ier = serial8250_early_in(port, UART_IER);
>> serial8250_early_out(port, UART_IER, ier & UART_IER_UUE);
>> } else
>> init_port(device);
>>
>> device->con->write = early_serial8250_write;
>> return 0;
>> }
>
> [snip]
>
> Regards,
> Bin
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 2/4] armv8/ls1043aqds: Add lpuart defconfig
2016-01-19 8:02 ` Bin Meng
@ 2016-01-20 4:29 ` Wenbin Song
2016-01-20 5:32 ` Bin Meng
0 siblings, 1 reply; 16+ messages in thread
From: Wenbin Song @ 2016-01-20 4:29 UTC (permalink / raw)
To: u-boot
Hi: Bin,
Could you tell me which tree your patches have been merged into ?
Regards
Wenbin Song
-----Original Message-----
From: Bin Meng [mailto:bmeng.cn at gmail.com]
Sent: Tuesday, January 19, 2016 4:03 PM
To: Wenbin Song <wenbin.song@nxp.com>
Cc: York Sun <yorksun@freescale.com>; Mingkai Hu <mingkai.hu@nxp.com>; Qianyu Gong <qianyu.gong@nxp.com>; Shaohui Xie <shaohui.xie@nxp.com>; U-Boot Mailing List <u-boot@lists.denx.de>
Subject: Re: [U-Boot] [PATCH 2/4] armv8/ls1043aqds: Add lpuart defconfig
Hi Wenbin,
On Tue, Jan 19, 2016 at 2:48 PM, Wenbin Song <wenbin.song@nxp.com> wrote:
> ---
Please include a commit message and SoB here.
> configs/ls1043aqds_lpuart_defconfig | 8 ++++++++
> 1 file changed, 8 insertions(+)
> create mode 100644 configs/ls1043aqds_lpuart_defconfig
>
> diff --git a/configs/ls1043aqds_lpuart_defconfig
> b/configs/ls1043aqds_lpuart_defconfig
> new file mode 100644
> index 0000000..ca06abe
> --- /dev/null
> +++ b/configs/ls1043aqds_lpuart_defconfig
> @@ -0,0 +1,8 @@
> +CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4,LPUART"
> +CONFIG_ARM=y
> +CONFIG_TARGET_LS1043AQDS=y
> +CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1043a-qds"
> +CONFIG_OF_CONTROL=y
> +CONFIG_DM=y
> +CONFIG_SPI_FLASH=y
> +CONFIG_DM_SPI=y
> --
Please use the driver model LPUART driver in this series (http://patchwork.ozlabs.org/patch/567250/).
Regards,
Bin
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 2/4] armv8/ls1043aqds: Add lpuart defconfig
2016-01-20 4:29 ` Wenbin Song
@ 2016-01-20 5:32 ` Bin Meng
2016-01-22 2:50 ` Simon Glass
0 siblings, 1 reply; 16+ messages in thread
From: Bin Meng @ 2016-01-20 5:32 UTC (permalink / raw)
To: u-boot
Hi Wenbin,
On Wed, Jan 20, 2016 at 12:29 PM, Wenbin Song <wenbin.song@nxp.com> wrote:
> Hi: Bin,
>
> Could you tell me which tree your patches have been merged into ?
>
I believe it will be merged via u-boot-dm, cc Simon to confirm.
> Regards
>
> Wenbin Song
>
[snip]
Regards,
Bin
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 2/4] armv8/ls1043aqds: Add lpuart defconfig
2016-01-20 5:32 ` Bin Meng
@ 2016-01-22 2:50 ` Simon Glass
0 siblings, 0 replies; 16+ messages in thread
From: Simon Glass @ 2016-01-22 2:50 UTC (permalink / raw)
To: u-boot
Hi,
On 19 January 2016 at 22:32, Bin Meng <bmeng.cn@gmail.com> wrote:
> Hi Wenbin,
>
> On Wed, Jan 20, 2016 at 12:29 PM, Wenbin Song <wenbin.song@nxp.com> wrote:
>> Hi: Bin,
>>
>> Could you tell me which tree your patches have been merged into ?
>>
>
> I believe it will be merged via u-boot-dm, cc Simon to confirm.
>
>> Regards
>>
>> Wenbin Song
>>
>
> [snip]
>
> Regards,
> Bin
This should be in u-boot-dm now.
Regards,
Simon
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2016-01-22 2:50 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-19 6:48 [U-Boot] [PATCH 1/4] armv8/ls1043aqds: added lpuart support Wenbin Song
2016-01-19 6:48 ` [U-Boot] [PATCH 2/4] armv8/ls1043aqds: Add lpuart defconfig Wenbin Song
2016-01-19 8:02 ` Bin Meng
2016-01-20 4:29 ` Wenbin Song
2016-01-20 5:32 ` Bin Meng
2016-01-22 2:50 ` Simon Glass
2016-01-19 6:48 ` [U-Boot] [PATCH 3/4] armv8/ls1043aqds: Fix CONFIG_LPUART Wenbin Song
2016-01-19 7:06 ` Mingkai Hu
2016-01-19 8:04 ` Bin Meng
2016-01-19 6:48 ` [U-Boot] [PATCH 4/4] armv8/ls1043aqds: Initizlize NS16550 if enalbed LPUART Wenbin Song
2016-01-19 8:07 ` Bin Meng
2016-01-19 10:21 ` Wenbin Song
2016-01-19 10:42 ` Bin Meng
2016-01-19 12:12 ` Wenbin Song
2016-01-19 7:03 ` [U-Boot] [PATCH 1/4] armv8/ls1043aqds: added lpuart support Mingkai Hu
2016-01-19 8:00 ` Bin Meng
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.