diff mbox

[U-Boot,v2,3/3] armv8/ls1043aqds: Add lpuart support

Message ID 1453292744-36773-4-git-send-email-wenbin.song@nxp.com
State Superseded
Headers show

Commit Message

Wenbin song Jan. 20, 2016, 12:25 p.m. UTC
Add lpuart support using the driver model.

Signed-off-by: Wenbin Song <wenbin.song@nxp.com>
---
 arch/arm/dts/Makefile                   |  1 +
 arch/arm/dts/fsl-ls1043a-qds-lpuart.dts | 20 ++++++++++++
 arch/arm/dts/fsl-ls1043a.dtsi           | 54 +++++++++++++++++++++++++++++++++
 configs/ls1043aqds_lpuart_defconfig     | 10 ++++++
 include/configs/ls1043aqds.h            |  7 +++++
 5 files changed, 92 insertions(+)
 create mode 100644 arch/arm/dts/fsl-ls1043a-qds-lpuart.dts
 create mode 100644 configs/ls1043aqds_lpuart_defconfig

Comments

Bin Meng Jan. 21, 2016, 4:03 a.m. UTC | #1
Hi Wenbin,

On Wed, Jan 20, 2016 at 8:25 PM, Wenbin Song <wenbin.song@nxp.com> wrote:
> Add lpuart support using the driver model.
>
> Signed-off-by: Wenbin Song <wenbin.song@nxp.com>
> ---
>  arch/arm/dts/Makefile                   |  1 +
>  arch/arm/dts/fsl-ls1043a-qds-lpuart.dts | 20 ++++++++++++
>  arch/arm/dts/fsl-ls1043a.dtsi           | 54 +++++++++++++++++++++++++++++++++
>  configs/ls1043aqds_lpuart_defconfig     | 10 ++++++
>  include/configs/ls1043aqds.h            |  7 +++++
>  5 files changed, 92 insertions(+)
>  create mode 100644 arch/arm/dts/fsl-ls1043a-qds-lpuart.dts
>  create mode 100644 configs/ls1043aqds_lpuart_defconfig
>
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index 302456c..a51275c 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -97,6 +97,7 @@ dtb-$(CONFIG_LS102XA) += ls1021a-qds.dtb \
>  dtb-$(CONFIG_FSL_LSCH3) += fsl-ls2080a-qds.dtb \
>         fsl-ls2080a-rdb.dtb
>  dtb-$(CONFIG_FSL_LSCH2) += fsl-ls1043a-qds-duart.dtb \
> +       fsl-ls1043a-qds-lpuart.dtb \
>         fsl-ls1043a-rdb.dtb
>
>  dtb-$(CONFIG_MACH_SUN4I) += \
> diff --git a/arch/arm/dts/fsl-ls1043a-qds-lpuart.dts b/arch/arm/dts/fsl-ls1043a-qds-lpuart.dts
> new file mode 100644
> index 0000000..24168ad
> --- /dev/null
> +++ b/arch/arm/dts/fsl-ls1043a-qds-lpuart.dts
> @@ -0,0 +1,20 @@
> +/*
> + * Device Tree Include file for Freescale Layerscape-1043A family SoC.

This is not a 'Include file'.

> + *
> + * Copyright (C) 2015, Freescale Semiconductor
> + *
> + * Wenbin Song <wenbin.song@nxp.com>
> + *
> + * This file is licensed under the terms of the GNU General Public
> + * License version 2.  This program is licensed "as is" without any
> + * warranty of any kind, whether express or implied.
> + */
> +

Please use SPDX format.

> +/dts-v1/;
> +#include "fsl-ls1043a-qds.dtsi"
> +
> +/ {
> +       chosen {
> +               stdout-path = &lpuart0;
> +       };
> +};
> diff --git a/arch/arm/dts/fsl-ls1043a.dtsi b/arch/arm/dts/fsl-ls1043a.dtsi
> index 85ea81e..12ea0ab 100644
> --- a/arch/arm/dts/fsl-ls1043a.dtsi
> +++ b/arch/arm/dts/fsl-ls1043a.dtsi
> @@ -182,5 +182,59 @@
>                         interrupts = <0 55 0x4>;
>                         clocks = <&clockgen 4 0>;
>                 };
> +
> +               lpuart0: serial@2950000 {
> +                       compatible = "fsl,ls1021a-lpuart";
> +                       reg = <0x0 0x2950000 0x0 0x1000>;
> +                       interrupts = <0 48 0x4>;
> +                       clocks = <&sysclk>;
> +                       clock-names = "ipg";
> +                       status = "disabled";
> +               };
> +
> +               lpuart1: serial@2960000 {
> +                       compatible = "fsl,ls1021a-lpuart";
> +                       reg = <0x0 0x2960000 0x0 0x1000>;
> +                       interrupts = <0 49 0x4>;
> +                       clocks = <&sysclk>;
> +                       clock-names = "ipg";
> +                       status = "disabled";
> +               };
> +
> +               lpuart2: serial@2970000 {
> +                       compatible = "fsl,ls1021a-lpuart";
> +                       reg = <0x0 0x2970000 0x0 0x1000>;
> +                       interrupts = <0 50 0x4>;
> +                       clock-names = "ipg";
> +                       clocks = <&sysclk>;
> +                       status = "disabled";
> +               };
> +
> +               lpuart3: serial@2980000 {
> +                       compatible = "fsl,ls1021a-lpuart";
> +                       reg = <0x0 0x2980000 0x0 0x1000>;
> +                       interrupts = <0 51 0x4>;
> +                       clocks = <&sysclk>;
> +                       clock-names = "ipg";
> +                       status = "disabled";
> +               };
> +
> +               lpuart4: serial@2990000 {
> +                       compatible = "fsl,ls1021a-lpuart";
> +                       reg = <0x0 0x2990000 0x0 0x1000>;
> +                       interrupts = <0 52 0x4>;
> +                       clocks = <&sysclk>;
> +                       clock-names = "ipg";
> +                       status = "disabled";
> +               };
> +
> +               lpuart5: serial@29a0000 {
> +                       compatible = "fsl,ls1021a-lpuart";
> +                       reg = <0x0 0x29a0000 0x0 0x1000>;
> +                       interrupts = <0 53 0x4>;
> +                       clocks = <&sysclk>;
> +                       clock-names = "ipg";
> +                       status = "disabled";
> +               };

You should also update fsl-ls1043a-qds.dtsi to mention below, to keep
consistency with duart.

&lpuart0 {
 status = "okay";
};

...


>         };
>  };
> diff --git a/configs/ls1043aqds_lpuart_defconfig b/configs/ls1043aqds_lpuart_defconfig
> new file mode 100644
> index 0000000..2d6bb7b
> --- /dev/null
> +++ b/configs/ls1043aqds_lpuart_defconfig
> @@ -0,0 +1,10 @@
> +CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4,LPUART"
> +CONFIG_ARM=y
> +CONFIG_TARGET_LS1043AQDS=y
> +CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1043a-qds-lpuart"
> +CONFIG_OF_CONTROL=y
> +CONFIG_DM=y
> +CONFIG_SPI_FLASH=y
> +CONFIG_DM_SPI=y
> +CONFIG_FSL_LPUART=y
> +CONFIG_DM_SERIAL=y

Please always create defconfig file with a sorted Kconfig option
order. You can do this via 'make savedefconfig'.

> diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h
> index 398f1c3..438476f 100644
> --- a/include/configs/ls1043aqds.h
> +++ b/include/configs/ls1043aqds.h
> @@ -88,6 +88,13 @@ unsigned long get_board_ddr_clk(void);
>  #define CONFIG_SYS_FSL_PBL_RCW board/freescale/ls1043aqds/ls1043aqds_rcw_sd_ifc.cfg
>  #endif
>
> +/*
> + * LPUART
> + */

nits: /* LPUART */

> +#ifdef CONFIG_LPUART
> +#define CONFIG_LPUART_32B_REG
> +#endif
> +
>  /* SATA */
>  #define CONFIG_LIBATA
>  #define CONFIG_SCSI_AHCI
> --

Regards,
Bin
diff mbox

Patch

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 302456c..a51275c 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -97,6 +97,7 @@  dtb-$(CONFIG_LS102XA) += ls1021a-qds.dtb \
 dtb-$(CONFIG_FSL_LSCH3) += fsl-ls2080a-qds.dtb \
 	fsl-ls2080a-rdb.dtb
 dtb-$(CONFIG_FSL_LSCH2) += fsl-ls1043a-qds-duart.dtb \
+	fsl-ls1043a-qds-lpuart.dtb \
 	fsl-ls1043a-rdb.dtb
 
 dtb-$(CONFIG_MACH_SUN4I) += \
diff --git a/arch/arm/dts/fsl-ls1043a-qds-lpuart.dts b/arch/arm/dts/fsl-ls1043a-qds-lpuart.dts
new file mode 100644
index 0000000..24168ad
--- /dev/null
+++ b/arch/arm/dts/fsl-ls1043a-qds-lpuart.dts
@@ -0,0 +1,20 @@ 
+/*
+ * Device Tree Include file for Freescale Layerscape-1043A family SoC.
+ *
+ * Copyright (C) 2015, Freescale Semiconductor
+ *
+ * Wenbin Song <wenbin.song@nxp.com>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+/dts-v1/;
+#include "fsl-ls1043a-qds.dtsi"
+
+/ {
+       chosen {
+               stdout-path = &lpuart0;
+       };
+};
diff --git a/arch/arm/dts/fsl-ls1043a.dtsi b/arch/arm/dts/fsl-ls1043a.dtsi
index 85ea81e..12ea0ab 100644
--- a/arch/arm/dts/fsl-ls1043a.dtsi
+++ b/arch/arm/dts/fsl-ls1043a.dtsi
@@ -182,5 +182,59 @@ 
 			interrupts = <0 55 0x4>;
 			clocks = <&clockgen 4 0>;
 		};
+
+		lpuart0: serial@2950000 {
+			compatible = "fsl,ls1021a-lpuart";
+			reg = <0x0 0x2950000 0x0 0x1000>;
+			interrupts = <0 48 0x4>;
+			clocks = <&sysclk>;
+			clock-names = "ipg";
+			status = "disabled";
+		};
+
+		lpuart1: serial@2960000 {
+			compatible = "fsl,ls1021a-lpuart";
+			reg = <0x0 0x2960000 0x0 0x1000>;
+			interrupts = <0 49 0x4>;
+			clocks = <&sysclk>;
+			clock-names = "ipg";
+			status = "disabled";
+		};
+
+		lpuart2: serial@2970000 {
+			compatible = "fsl,ls1021a-lpuart";
+			reg = <0x0 0x2970000 0x0 0x1000>;
+			interrupts = <0 50 0x4>;
+			clock-names = "ipg";
+			clocks = <&sysclk>;
+			status = "disabled";
+		};
+
+		lpuart3: serial@2980000 {
+			compatible = "fsl,ls1021a-lpuart";
+			reg = <0x0 0x2980000 0x0 0x1000>;
+			interrupts = <0 51 0x4>;
+			clocks = <&sysclk>;
+			clock-names = "ipg";
+			status = "disabled";
+		};
+
+		lpuart4: serial@2990000 {
+			compatible = "fsl,ls1021a-lpuart";
+			reg = <0x0 0x2990000 0x0 0x1000>;
+			interrupts = <0 52 0x4>;
+			clocks = <&sysclk>;
+			clock-names = "ipg";
+			status = "disabled";
+		};
+
+		lpuart5: serial@29a0000 {
+			compatible = "fsl,ls1021a-lpuart";
+			reg = <0x0 0x29a0000 0x0 0x1000>;
+			interrupts = <0 53 0x4>;
+			clocks = <&sysclk>;
+			clock-names = "ipg";
+			status = "disabled";
+		};
 	};
 };
diff --git a/configs/ls1043aqds_lpuart_defconfig b/configs/ls1043aqds_lpuart_defconfig
new file mode 100644
index 0000000..2d6bb7b
--- /dev/null
+++ b/configs/ls1043aqds_lpuart_defconfig
@@ -0,0 +1,10 @@ 
+CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4,LPUART"
+CONFIG_ARM=y
+CONFIG_TARGET_LS1043AQDS=y
+CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1043a-qds-lpuart"
+CONFIG_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPI_FLASH=y
+CONFIG_DM_SPI=y
+CONFIG_FSL_LPUART=y
+CONFIG_DM_SERIAL=y
diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h
index 398f1c3..438476f 100644
--- a/include/configs/ls1043aqds.h
+++ b/include/configs/ls1043aqds.h
@@ -88,6 +88,13 @@  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_LPUART_32B_REG
+#endif
+
 /* SATA */
 #define CONFIG_LIBATA
 #define CONFIG_SCSI_AHCI