[U-Boot] [PATCH 01/18] gpio: mpc8xxx: add support for Layerscape SoC

From: Zhang Ying-22455 ying.zhang22455@nxp.com
* Add mpc8xxx_gpio_plat for for Layerscape SoC * Make the mpc8xxx driver capable of handling Layerscape Soc.
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com --- arch/arm/include/asm/arch-fsl-layerscape/gpio.h | 24 ++++++++++++++++++++++ .../include/asm/arch-fsl-layerscape/immap_lsch2.h | 2 ++ arch/arm/include/asm/arch-ls102xa/gpio.h | 6 ++++++ drivers/gpio/mpc8xxx_gpio.c | 1 + 4 files changed, 33 insertions(+) create mode 100644 arch/arm/include/asm/arch-fsl-layerscape/gpio.h
diff --git a/arch/arm/include/asm/arch-fsl-layerscape/gpio.h b/arch/arm/include/asm/arch-fsl-layerscape/gpio.h new file mode 100644 index 0000000..b6afcaa --- /dev/null +++ b/arch/arm/include/asm/arch-fsl-layerscape/gpio.h @@ -0,0 +1,24 @@ +/* + * Copyright 2008-2016 Freescale Semiconductor, Inc. + * Copyright 2017-2018 NXP Semiconductor + * + * SPDX-License-Identifier: GPL-2.0 + */ + +#ifndef _ASM_ARCH_LAYERSCAPE_GPIO_H_ +#define _ASM_ARCH_LAYERSCAPE_GPIO_H_ + +#ifdef CONFIG_FSL_LSCH2 +#include <asm/arch/immap_lsch2.h> +#endif +#ifdef CONFIG_FSL_LSCH3 +#include <asm/arch/immap_lsch3.h> +#endif + +struct mpc8xxx_gpio_plat { + ulong addr; + unsigned long size; + uint ngpios; +}; + +#endif diff --git a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h index be0a6ae..18f6875 100644 --- a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h +++ b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h @@ -650,6 +650,7 @@ struct ccsr_serdes { u8 res_19a0[0x2000-0x19a0]; /* from 0x19a0 to 0x1fff */ };
+#ifndef CONFIG_MPC8XXX_GPIO struct ccsr_gpio { u32 gpdir; u32 gpodr; @@ -659,6 +660,7 @@ struct ccsr_gpio { u32 gpicr; u32 gpibe; }; +#endif
/* MMU 500 */ #define SMMU_SCR0 (SMMU_BASE + 0x0) diff --git a/arch/arm/include/asm/arch-ls102xa/gpio.h b/arch/arm/include/asm/arch-ls102xa/gpio.h index dad181e..63afb7f 100644 --- a/arch/arm/include/asm/arch-ls102xa/gpio.h +++ b/arch/arm/include/asm/arch-ls102xa/gpio.h @@ -13,4 +13,10 @@ #ifndef __ASM_ARCH_LS102XA_GPIO_H_ #define __ASM_ARCH_LS102XA_GPIO_H_
+struct mpc8xxx_gpio_plat { + ulong addr; + unsigned long size; + uint ngpios; +}; + #endif diff --git a/drivers/gpio/mpc8xxx_gpio.c b/drivers/gpio/mpc8xxx_gpio.c index c273c2c..50d372c 100644 --- a/drivers/gpio/mpc8xxx_gpio.c +++ b/drivers/gpio/mpc8xxx_gpio.c @@ -12,6 +12,7 @@ #include <dm.h> #include <mapmem.h> #include <asm/gpio.h> +#include <asm/io.h>
struct ccsr_gpio { u32 gpdir;

From: Zhang Ying-22455 ying.zhang22455@nxp.com
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com --- arch/arm/dts/fsl-ls1043a.dtsi | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
diff --git a/arch/arm/dts/fsl-ls1043a.dtsi b/arch/arm/dts/fsl-ls1043a.dtsi index ff40122..8238c73 100644 --- a/arch/arm/dts/fsl-ls1043a.dtsi +++ b/arch/arm/dts/fsl-ls1043a.dtsi @@ -148,6 +148,46 @@ clocks = <&clockgen 4 0>; };
+ gpio1: gpio@2300000 { + compatible = "fsl,ls1043a-gpio", "fsl,qoriq-gpio"; + reg = <0x0 0x2300000 0x0 0x10000>; + interrupts = <0 66 0x4>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio2: gpio@2310000 { + compatible = "fsl,ls1043a-gpio", "fsl,qoriq-gpio"; + reg = <0x0 0x2310000 0x0 0x10000>; + interrupts = <0 67 0x4>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio3: gpio@2320000 { + compatible = "fsl,ls1043a-gpio", "fsl,qoriq-gpio"; + reg = <0x0 0x2320000 0x0 0x10000>; + interrupts = <0 68 0x4>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio4: gpio@2330000 { + compatible = "fsl,ls1043a-gpio", "fsl,qoriq-gpio"; + reg = <0x0 0x2330000 0x0 0x10000>; + interrupts = <0 134 0x4>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + lpuart0: serial@2950000 { compatible = "fsl,ls1021a-lpuart"; reg = <0x0 0x2950000 0x0 0x1000>;

From: Zhang Ying-22455 ying.zhang22455@nxp.com
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com --- configs/ls1043ardb_SECURE_BOOT_defconfig | 2 ++ configs/ls1043ardb_defconfig | 2 ++ configs/ls1043ardb_nand_SECURE_BOOT_defconfig | 2 ++ configs/ls1043ardb_nand_defconfig | 2 ++ configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig | 2 ++ configs/ls1043ardb_sdcard_defconfig | 2 ++ 6 files changed, 12 insertions(+)
diff --git a/configs/ls1043ardb_SECURE_BOOT_defconfig b/configs/ls1043ardb_SECURE_BOOT_defconfig index 478fdc8..44b8702 100644 --- a/configs/ls1043ardb_SECURE_BOOT_defconfig +++ b/configs/ls1043ardb_SECURE_BOOT_defconfig @@ -44,3 +44,5 @@ CONFIG_USB_STORAGE=y CONFIG_RSA=y CONFIG_SPL_RSA=y CONFIG_RSA_SOFTWARE_EXP=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1043ardb_defconfig b/configs/ls1043ardb_defconfig index c308882..4ee6346 100644 --- a/configs/ls1043ardb_defconfig +++ b/configs/ls1043ardb_defconfig @@ -42,3 +42,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1043ardb_nand_SECURE_BOOT_defconfig b/configs/ls1043ardb_nand_SECURE_BOOT_defconfig index ec90e48..496f646 100644 --- a/configs/ls1043ardb_nand_SECURE_BOOT_defconfig +++ b/configs/ls1043ardb_nand_SECURE_BOOT_defconfig @@ -61,3 +61,5 @@ CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y CONFIG_RSA=y CONFIG_SPL_RSA=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1043ardb_nand_defconfig b/configs/ls1043ardb_nand_defconfig index 04d2934..413ef56 100644 --- a/configs/ls1043ardb_nand_defconfig +++ b/configs/ls1043ardb_nand_defconfig @@ -59,3 +59,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig b/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig index 4bce1a9..0e8e088 100644 --- a/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig +++ b/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig @@ -60,3 +60,5 @@ CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y CONFIG_RSA=y CONFIG_SPL_RSA=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1043ardb_sdcard_defconfig b/configs/ls1043ardb_sdcard_defconfig index 09ff4c3..05c73c4 100644 --- a/configs/ls1043ardb_sdcard_defconfig +++ b/configs/ls1043ardb_sdcard_defconfig @@ -57,3 +57,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y

On 08/22/2018 06:15 PM, ying.zhang22455@nxp.com wrote:
From: Zhang Ying-22455 ying.zhang22455@nxp.com
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com
configs/ls1043ardb_SECURE_BOOT_defconfig | 2 ++ configs/ls1043ardb_defconfig | 2 ++ configs/ls1043ardb_nand_SECURE_BOOT_defconfig | 2 ++ configs/ls1043ardb_nand_defconfig | 2 ++ configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig | 2 ++ configs/ls1043ardb_sdcard_defconfig | 2 ++ 6 files changed, 12 insertions(+)
diff --git a/configs/ls1043ardb_SECURE_BOOT_defconfig b/configs/ls1043ardb_SECURE_BOOT_defconfig index 478fdc8..44b8702 100644 --- a/configs/ls1043ardb_SECURE_BOOT_defconfig +++ b/configs/ls1043ardb_SECURE_BOOT_defconfig @@ -44,3 +44,5 @@ CONFIG_USB_STORAGE=y CONFIG_RSA=y CONFIG_SPL_RSA=y CONFIG_RSA_SOFTWARE_EXP=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1043ardb_defconfig b/configs/ls1043ardb_defconfig index c308882..4ee6346 100644 --- a/configs/ls1043ardb_defconfig +++ b/configs/ls1043ardb_defconfig @@ -42,3 +42,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1043ardb_nand_SECURE_BOOT_defconfig b/configs/ls1043ardb_nand_SECURE_BOOT_defconfig index ec90e48..496f646 100644 --- a/configs/ls1043ardb_nand_SECURE_BOOT_defconfig +++ b/configs/ls1043ardb_nand_SECURE_BOOT_defconfig @@ -61,3 +61,5 @@ CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y CONFIG_RSA=y CONFIG_SPL_RSA=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1043ardb_nand_defconfig b/configs/ls1043ardb_nand_defconfig index 04d2934..413ef56 100644 --- a/configs/ls1043ardb_nand_defconfig +++ b/configs/ls1043ardb_nand_defconfig @@ -59,3 +59,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig b/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig index 4bce1a9..0e8e088 100644 --- a/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig +++ b/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig @@ -60,3 +60,5 @@ CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y CONFIG_RSA=y CONFIG_SPL_RSA=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1043ardb_sdcard_defconfig b/configs/ls1043ardb_sdcard_defconfig index 09ff4c3..05c73c4 100644 --- a/configs/ls1043ardb_sdcard_defconfig +++ b/configs/ls1043ardb_sdcard_defconfig @@ -57,3 +57,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y
Please keep the config option sorted. You can use tools/moveconfig.py. This applies to all your patches to defconfig.
York

From: Zhang Ying-22455 ying.zhang22455@nxp.com
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com --- configs/ls1043aqds_defconfig | 2 ++ configs/ls1043aqds_lpuart_defconfig | 2 ++ configs/ls1043aqds_nand_defconfig | 2 ++ configs/ls1043aqds_nor_ddr3_defconfig | 2 ++ configs/ls1043aqds_qspi_defconfig | 2 ++ configs/ls1043aqds_sdcard_ifc_defconfig | 2 ++ configs/ls1043aqds_sdcard_qspi_defconfig | 2 ++ 7 files changed, 14 insertions(+)
diff --git a/configs/ls1043aqds_defconfig b/configs/ls1043aqds_defconfig index f6a8b74..c655ea0 100644 --- a/configs/ls1043aqds_defconfig +++ b/configs/ls1043aqds_defconfig @@ -46,3 +46,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1043aqds_lpuart_defconfig b/configs/ls1043aqds_lpuart_defconfig index b23ecf2..aecb536 100644 --- a/configs/ls1043aqds_lpuart_defconfig +++ b/configs/ls1043aqds_lpuart_defconfig @@ -48,3 +48,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1043aqds_nand_defconfig b/configs/ls1043aqds_nand_defconfig index 28131b2..2d6dec8 100644 --- a/configs/ls1043aqds_nand_defconfig +++ b/configs/ls1043aqds_nand_defconfig @@ -61,3 +61,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1043aqds_nor_ddr3_defconfig b/configs/ls1043aqds_nor_ddr3_defconfig index 800f884..e64b67c 100644 --- a/configs/ls1043aqds_nor_ddr3_defconfig +++ b/configs/ls1043aqds_nor_ddr3_defconfig @@ -47,3 +47,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1043aqds_qspi_defconfig b/configs/ls1043aqds_qspi_defconfig index fdbcf7c..b892f14 100644 --- a/configs/ls1043aqds_qspi_defconfig +++ b/configs/ls1043aqds_qspi_defconfig @@ -45,3 +45,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1043aqds_sdcard_ifc_defconfig b/configs/ls1043aqds_sdcard_ifc_defconfig index b6ad638..445d374 100644 --- a/configs/ls1043aqds_sdcard_ifc_defconfig +++ b/configs/ls1043aqds_sdcard_ifc_defconfig @@ -61,3 +61,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1043aqds_sdcard_qspi_defconfig b/configs/ls1043aqds_sdcard_qspi_defconfig index 054fc0d..e1a093f 100644 --- a/configs/ls1043aqds_sdcard_qspi_defconfig +++ b/configs/ls1043aqds_sdcard_qspi_defconfig @@ -58,3 +58,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y

From: Zhang Ying-22455 ying.zhang22455@nxp.com
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com --- arch/arm/dts/fsl-ls1046a.dtsi | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
diff --git a/arch/arm/dts/fsl-ls1046a.dtsi b/arch/arm/dts/fsl-ls1046a.dtsi index 4acbaf7..047887c 100644 --- a/arch/arm/dts/fsl-ls1046a.dtsi +++ b/arch/arm/dts/fsl-ls1046a.dtsi @@ -148,6 +148,46 @@ clocks = <&clockgen 4 0>; };
+ gpio0: gpio@2300000 { + compatible = "fsl,qoriq-gpio"; + reg = <0x0 0x2300000 0x0 0x10000>; + interrupts = <0 66 4>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio1: gpio@2310000 { + compatible = "fsl,qoriq-gpio"; + reg = <0x0 0x2310000 0x0 0x10000>; + interrupts = <0 67 4>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio2: gpio@2320000 { + compatible = "fsl,qoriq-gpio"; + reg = <0x0 0x2320000 0x0 0x10000>; + interrupts = <0 68 4>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio3: gpio@2330000 { + compatible = "fsl,qoriq-gpio"; + reg = <0x0 0x2330000 0x0 0x10000>; + interrupts = <0 134 4>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + lpuart0: serial@2950000 { compatible = "fsl,ls1021a-lpuart"; reg = <0x0 0x2950000 0x0 0x1000>;

From: Zhang Ying-22455 ying.zhang22455@nxp.com
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com --- configs/ls1046aqds_SECURE_BOOT_defconfig | 2 ++ configs/ls1046aqds_defconfig | 2 ++ configs/ls1046aqds_lpuart_defconfig | 2 ++ configs/ls1046aqds_nand_defconfig | 2 ++ configs/ls1046aqds_qspi_defconfig | 2 ++ configs/ls1046aqds_sdcard_ifc_defconfig | 2 ++ configs/ls1046aqds_sdcard_qspi_defconfig | 2 ++ configs/ls1046ardb_emmc_defconfig | 2 ++ configs/ls1046ardb_qspi_SECURE_BOOT_defconfig | 2 ++ configs/ls1046ardb_qspi_defconfig | 2 ++ configs/ls1046ardb_qspi_spl_defconfig | 2 ++ configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig | 2 ++ configs/ls1046ardb_sdcard_defconfig | 2 ++ 13 files changed, 26 insertions(+)
diff --git a/configs/ls1046aqds_SECURE_BOOT_defconfig b/configs/ls1046aqds_SECURE_BOOT_defconfig index 9649919..b3d8757 100644 --- a/configs/ls1046aqds_SECURE_BOOT_defconfig +++ b/configs/ls1046aqds_SECURE_BOOT_defconfig @@ -48,3 +48,5 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y CONFIG_RSA=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1046aqds_defconfig b/configs/ls1046aqds_defconfig index 6a3e4f8..2b100ab 100644 --- a/configs/ls1046aqds_defconfig +++ b/configs/ls1046aqds_defconfig @@ -48,3 +48,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1046aqds_lpuart_defconfig b/configs/ls1046aqds_lpuart_defconfig index cb4c5f0..20f493c 100644 --- a/configs/ls1046aqds_lpuart_defconfig +++ b/configs/ls1046aqds_lpuart_defconfig @@ -50,3 +50,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1046aqds_nand_defconfig b/configs/ls1046aqds_nand_defconfig index c6b6986..aa95c12 100644 --- a/configs/ls1046aqds_nand_defconfig +++ b/configs/ls1046aqds_nand_defconfig @@ -55,3 +55,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1046aqds_qspi_defconfig b/configs/ls1046aqds_qspi_defconfig index b2c1885..b05d652 100644 --- a/configs/ls1046aqds_qspi_defconfig +++ b/configs/ls1046aqds_qspi_defconfig @@ -48,3 +48,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1046aqds_sdcard_ifc_defconfig b/configs/ls1046aqds_sdcard_ifc_defconfig index b0538c1..deba1cc 100644 --- a/configs/ls1046aqds_sdcard_ifc_defconfig +++ b/configs/ls1046aqds_sdcard_ifc_defconfig @@ -64,3 +64,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1046aqds_sdcard_qspi_defconfig b/configs/ls1046aqds_sdcard_qspi_defconfig index d067ba9..fb8c595 100644 --- a/configs/ls1046aqds_sdcard_qspi_defconfig +++ b/configs/ls1046aqds_sdcard_qspi_defconfig @@ -63,3 +63,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1046ardb_emmc_defconfig b/configs/ls1046ardb_emmc_defconfig index 9e4f275..d84077a 100644 --- a/configs/ls1046ardb_emmc_defconfig +++ b/configs/ls1046ardb_emmc_defconfig @@ -59,3 +59,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig b/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig index 139e1ab..2c532a3 100644 --- a/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig +++ b/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig @@ -45,3 +45,5 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y CONFIG_RSA=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1046ardb_qspi_defconfig b/configs/ls1046ardb_qspi_defconfig index 45bef3d..abc1abf 100644 --- a/configs/ls1046ardb_qspi_defconfig +++ b/configs/ls1046ardb_qspi_defconfig @@ -45,3 +45,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1046ardb_qspi_spl_defconfig b/configs/ls1046ardb_qspi_spl_defconfig index 5a5ae3a..c9c9843 100644 --- a/configs/ls1046ardb_qspi_spl_defconfig +++ b/configs/ls1046ardb_qspi_spl_defconfig @@ -63,3 +63,5 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y CONFIG_SPL_GZIP=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig b/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig index 5c1ab6e..07893a3 100644 --- a/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig +++ b/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig @@ -61,3 +61,5 @@ CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y CONFIG_RSA=y CONFIG_SPL_RSA=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1046ardb_sdcard_defconfig b/configs/ls1046ardb_sdcard_defconfig index e82d389..183c8ae 100644 --- a/configs/ls1046ardb_sdcard_defconfig +++ b/configs/ls1046ardb_sdcard_defconfig @@ -58,3 +58,5 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y

From: Zhang Ying-22455 ying.zhang22455@nxp.com
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com --- arch/arm/dts/fsl-ls1088a.dtsi | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
diff --git a/arch/arm/dts/fsl-ls1088a.dtsi b/arch/arm/dts/fsl-ls1088a.dtsi index 077caf3..acc63be 100644 --- a/arch/arm/dts/fsl-ls1088a.dtsi +++ b/arch/arm/dts/fsl-ls1088a.dtsi @@ -80,6 +80,46 @@ interrupts = <0 21 0x4>; /* Level high type */ };
+ gpio0: gpio@2300000 { + compatible = "fsl,qoriq-gpio"; + reg = <0x0 0x2300000 0x0 0x10000>; + interrupts = <0 36 4>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio1: gpio@2310000 { + compatible = "fsl,qoriq-gpio"; + reg = <0x0 0x2310000 0x0 0x10000>; + interrupts = <0 36 4>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio2: gpio@2320000 { + compatible = "fsl,qoriq-gpio"; + reg = <0x0 0x2320000 0x0 0x10000>; + interrupts = <0 37 4>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio3: gpio@2330000 { + compatible = "fsl,qoriq-gpio"; + reg = <0x0 0x2330000 0x0 0x10000>; + interrupts = <0 37 4>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + usb0: usb3@3100000 { compatible = "fsl,layerscape-dwc3"; reg = <0x0 0x3100000 0x0 0x10000>;

From: Zhang Ying-22455 ying.zhang22455@nxp.com
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com --- configs/ls1088aqds_defconfig | 2 ++ configs/ls1088aqds_qspi_SECURE_BOOT_defconfig | 2 ++ configs/ls1088aqds_qspi_defconfig | 2 ++ configs/ls1088aqds_sdcard_ifc_defconfig | 2 ++ configs/ls1088aqds_sdcard_qspi_defconfig | 2 ++ configs/ls1088ardb_qspi_SECURE_BOOT_defconfig | 2 ++ configs/ls1088ardb_qspi_defconfig | 2 ++ configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig | 2 ++ configs/ls1088ardb_sdcard_qspi_defconfig | 2 ++ 9 files changed, 18 insertions(+)
diff --git a/configs/ls1088aqds_defconfig b/configs/ls1088aqds_defconfig index 8f9c491..73f31de 100644 --- a/configs/ls1088aqds_defconfig +++ b/configs/ls1088aqds_defconfig @@ -46,3 +46,5 @@ CONFIG_USB_XHCI_DWC3=y CONFIG_USB_DWC3=y CONFIG_USB_STORAGE=y CONFIG_USB_GADGET=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1088aqds_qspi_SECURE_BOOT_defconfig b/configs/ls1088aqds_qspi_SECURE_BOOT_defconfig index c761102..d59d1c6 100644 --- a/configs/ls1088aqds_qspi_SECURE_BOOT_defconfig +++ b/configs/ls1088aqds_qspi_SECURE_BOOT_defconfig @@ -53,3 +53,5 @@ CONFIG_USB_GADGET=y CONFIG_RSA=y CONFIG_RSA_SOFTWARE_EXP=y CONFIG_EFI_LOADER_BOUNCE_BUFFER=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1088aqds_qspi_defconfig b/configs/ls1088aqds_qspi_defconfig index a7bed8c..cf5a8f4 100644 --- a/configs/ls1088aqds_qspi_defconfig +++ b/configs/ls1088aqds_qspi_defconfig @@ -51,3 +51,5 @@ CONFIG_USB_DWC3=y CONFIG_USB_STORAGE=y CONFIG_USB_GADGET=y CONFIG_EFI_LOADER_BOUNCE_BUFFER=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1088aqds_sdcard_ifc_defconfig b/configs/ls1088aqds_sdcard_ifc_defconfig index a7efd68..39420d2 100644 --- a/configs/ls1088aqds_sdcard_ifc_defconfig +++ b/configs/ls1088aqds_sdcard_ifc_defconfig @@ -54,3 +54,5 @@ CONFIG_USB_XHCI_DWC3=y CONFIG_USB_DWC3=y CONFIG_USB_STORAGE=y CONFIG_USB_GADGET=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1088aqds_sdcard_qspi_defconfig b/configs/ls1088aqds_sdcard_qspi_defconfig index f724bd3..685159a 100644 --- a/configs/ls1088aqds_sdcard_qspi_defconfig +++ b/configs/ls1088aqds_sdcard_qspi_defconfig @@ -60,3 +60,5 @@ CONFIG_USB_XHCI_DWC3=y CONFIG_USB_DWC3=y CONFIG_USB_STORAGE=y CONFIG_USB_GADGET=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1088ardb_qspi_SECURE_BOOT_defconfig b/configs/ls1088ardb_qspi_SECURE_BOOT_defconfig index d0334a2..120527c 100644 --- a/configs/ls1088ardb_qspi_SECURE_BOOT_defconfig +++ b/configs/ls1088ardb_qspi_SECURE_BOOT_defconfig @@ -53,3 +53,5 @@ CONFIG_USB_GADGET=y CONFIG_RSA=y CONFIG_RSA_SOFTWARE_EXP=y CONFIG_EFI_LOADER_BOUNCE_BUFFER=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1088ardb_qspi_defconfig b/configs/ls1088ardb_qspi_defconfig index d806966..0517b98 100644 --- a/configs/ls1088ardb_qspi_defconfig +++ b/configs/ls1088ardb_qspi_defconfig @@ -51,3 +51,5 @@ CONFIG_USB_DWC3=y CONFIG_USB_STORAGE=y CONFIG_USB_GADGET=y CONFIG_EFI_LOADER_BOUNCE_BUFFER=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig b/configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig index 08b9cae..87d6799 100644 --- a/configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig +++ b/configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig @@ -64,3 +64,5 @@ CONFIG_USB_DWC3=y CONFIG_USB_STORAGE=y CONFIG_RSA=y CONFIG_SPL_RSA=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls1088ardb_sdcard_qspi_defconfig b/configs/ls1088ardb_sdcard_qspi_defconfig index bf1c0a2..e768b94 100644 --- a/configs/ls1088ardb_sdcard_qspi_defconfig +++ b/configs/ls1088ardb_sdcard_qspi_defconfig @@ -60,3 +60,5 @@ CONFIG_USB_XHCI_DWC3=y CONFIG_USB_DWC3=y CONFIG_USB_STORAGE=y CONFIG_USB_GADGET=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y

From: Zhang Ying-22455 ying.zhang22455@nxp.com
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com --- arch/arm/dts/fsl-ls2080a.dtsi | 44 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+)
diff --git a/arch/arm/dts/fsl-ls2080a.dtsi b/arch/arm/dts/fsl-ls2080a.dtsi index b0f8517..160600c 100644 --- a/arch/arm/dts/fsl-ls2080a.dtsi +++ b/arch/arm/dts/fsl-ls2080a.dtsi @@ -75,6 +75,50 @@ num-cs = <4>; };
+ gpio0: gpio@2300000 { + compatible = "fsl,ls2080a-gpio", "fsl,qoriq-gpio"; + reg = <0x0 0x2300000 0x0 0x10000>; + interrupts = <0 36 0x4>; /* Level high type */ + gpio-controller; + little-endian; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio1: gpio@2310000 { + compatible = "fsl,ls2080a-gpio", "fsl,qoriq-gpio"; + reg = <0x0 0x2310000 0x0 0x10000>; + interrupts = <0 36 0x4>; /* Level high type */ + gpio-controller; + little-endian; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio2: gpio@2320000 { + compatible = "fsl,ls2080a-gpio", "fsl,qoriq-gpio"; + reg = <0x0 0x2320000 0x0 0x10000>; + interrupts = <0 37 0x4>; /* Level high type */ + gpio-controller; + little-endian; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio3: gpio@2330000 { + compatible = "fsl,ls2080a-gpio", "fsl,qoriq-gpio"; + reg = <0x0 0x2330000 0x0 0x10000>; + interrupts = <0 37 0x4>; /* Level high type */ + gpio-controller; + little-endian; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + usb0: usb3@3100000 { compatible = "fsl,layerscape-dwc3"; reg = <0x0 0x3100000 0x0 0x10000>;

From: Zhang Ying-22455 ying.zhang22455@nxp.com
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com --- configs/ls2080aqds_SECURE_BOOT_defconfig | 2 ++ configs/ls2080aqds_defconfig | 2 ++ configs/ls2080aqds_nand_defconfig | 2 ++ configs/ls2080aqds_qspi_defconfig | 2 ++ configs/ls2080aqds_sdcard_defconfig | 2 ++ configs/ls2080ardb_SECURE_BOOT_defconfig | 2 ++ configs/ls2080ardb_defconfig | 2 ++ configs/ls2080ardb_nand_defconfig | 2 ++ configs/ls2081ardb_defconfig | 2 ++ configs/ls2088ardb_qspi_SECURE_BOOT_defconfig | 2 ++ configs/ls2088ardb_qspi_defconfig | 2 ++ 11 files changed, 22 insertions(+)
diff --git a/configs/ls2080aqds_SECURE_BOOT_defconfig b/configs/ls2080aqds_SECURE_BOOT_defconfig index c879f80..b3d2ec0 100644 --- a/configs/ls2080aqds_SECURE_BOOT_defconfig +++ b/configs/ls2080aqds_SECURE_BOOT_defconfig @@ -53,3 +53,5 @@ CONFIG_USB_STORAGE=y CONFIG_RSA=y CONFIG_RSA_SOFTWARE_EXP=y CONFIG_EFI_LOADER_BOUNCE_BUFFER=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls2080aqds_defconfig b/configs/ls2080aqds_defconfig index 9ee003d..8dc1956 100644 --- a/configs/ls2080aqds_defconfig +++ b/configs/ls2080aqds_defconfig @@ -52,3 +52,5 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y CONFIG_EFI_LOADER_BOUNCE_BUFFER=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls2080aqds_nand_defconfig b/configs/ls2080aqds_nand_defconfig index 039672f..0227bc3 100644 --- a/configs/ls2080aqds_nand_defconfig +++ b/configs/ls2080aqds_nand_defconfig @@ -61,3 +61,5 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y CONFIG_EFI_LOADER_BOUNCE_BUFFER=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls2080aqds_qspi_defconfig b/configs/ls2080aqds_qspi_defconfig index 53e55c8..613fd62 100644 --- a/configs/ls2080aqds_qspi_defconfig +++ b/configs/ls2080aqds_qspi_defconfig @@ -52,3 +52,5 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y CONFIG_EFI_LOADER_BOUNCE_BUFFER=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls2080aqds_sdcard_defconfig b/configs/ls2080aqds_sdcard_defconfig index efea22f..bf47a99 100644 --- a/configs/ls2080aqds_sdcard_defconfig +++ b/configs/ls2080aqds_sdcard_defconfig @@ -59,3 +59,5 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y CONFIG_EFI_LOADER_BOUNCE_BUFFER=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls2080ardb_SECURE_BOOT_defconfig b/configs/ls2080ardb_SECURE_BOOT_defconfig index 906fa9a..f258e63 100644 --- a/configs/ls2080ardb_SECURE_BOOT_defconfig +++ b/configs/ls2080ardb_SECURE_BOOT_defconfig @@ -53,3 +53,5 @@ CONFIG_USB_STORAGE=y CONFIG_RSA=y CONFIG_RSA_SOFTWARE_EXP=y CONFIG_EFI_LOADER_BOUNCE_BUFFER=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls2080ardb_defconfig b/configs/ls2080ardb_defconfig index ea54383..7d6844e 100644 --- a/configs/ls2080ardb_defconfig +++ b/configs/ls2080ardb_defconfig @@ -52,3 +52,5 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y CONFIG_EFI_LOADER_BOUNCE_BUFFER=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls2080ardb_nand_defconfig b/configs/ls2080ardb_nand_defconfig index 81d1b6c..9b30e2c 100644 --- a/configs/ls2080ardb_nand_defconfig +++ b/configs/ls2080ardb_nand_defconfig @@ -56,3 +56,5 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y CONFIG_EFI_LOADER_BOUNCE_BUFFER=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls2081ardb_defconfig b/configs/ls2081ardb_defconfig index 6a28120..2ac938e 100644 --- a/configs/ls2081ardb_defconfig +++ b/configs/ls2081ardb_defconfig @@ -52,3 +52,5 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y CONFIG_EFI_LOADER_BOUNCE_BUFFER=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls2088ardb_qspi_SECURE_BOOT_defconfig b/configs/ls2088ardb_qspi_SECURE_BOOT_defconfig index 9a9c33a..63038b6 100644 --- a/configs/ls2088ardb_qspi_SECURE_BOOT_defconfig +++ b/configs/ls2088ardb_qspi_SECURE_BOOT_defconfig @@ -51,3 +51,5 @@ CONFIG_USB_STORAGE=y CONFIG_RSA=y CONFIG_RSA_SOFTWARE_EXP=y CONFIG_EFI_LOADER_BOUNCE_BUFFER=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y diff --git a/configs/ls2088ardb_qspi_defconfig b/configs/ls2088ardb_qspi_defconfig index 1384768..d445264 100644 --- a/configs/ls2088ardb_qspi_defconfig +++ b/configs/ls2088ardb_qspi_defconfig @@ -53,3 +53,5 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y CONFIG_EFI_LOADER_BOUNCE_BUFFER=y +CONFIG_DM_GPIO=y +CONFIG_MPC8XXX_GPIO=y

From: Zhang Ying-22455 ying.zhang22455@nxp.com
Add DM capable code into the sys_eeprom driver. The legacy non-DM, non-DT support is retained as there are still systems in the tree which are not DM or DT capable.
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com --- board/freescale/common/sys_eeprom.c | 68 +++++++++++++++++++++++++++++++++++-- drivers/i2c/mxc_i2c.c | 8 +++++ 2 files changed, 73 insertions(+), 3 deletions(-)
diff --git a/board/freescale/common/sys_eeprom.c b/board/freescale/common/sys_eeprom.c index ab0fe0b..932b711 100644 --- a/board/freescale/common/sys_eeprom.c +++ b/board/freescale/common/sys_eeprom.c @@ -10,6 +10,7 @@ #include <command.h> #include <i2c.h> #include <linux/ctype.h> +#include <dm.h>
#ifdef CONFIG_SYS_I2C_EEPROM_CCID #include "../common/eeprom.h" @@ -154,13 +155,33 @@ static int read_eeprom(void) if (has_been_read) return 0;
+#ifdef CONFIG_DM_I2C + struct udevice *dev, *udev; + + if (uclass_get_device_by_name(UCLASS_I2C, + FSL_I2C_EEPROM_DM_NAME, &udev)) { + puts("Cannot find EEPROM bus\n"); + return false; + } + + ret = i2c_get_chip(udev, CONFIG_SYS_I2C_EEPROM_ADDR, 1, &dev); + if (ret) { + puts("Cannot get EEPROM chip\n"); + return false; + } +#endif + #ifdef CONFIG_SYS_EEPROM_BUS_NUM bus = i2c_get_bus_num(); i2c_set_bus_num(CONFIG_SYS_EEPROM_BUS_NUM); #endif
+#ifdef CONFIG_DM_I2C + ret = dm_i2c_read(dev, 0, (void *)&e, sizeof(e)); +#else ret = i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, CONFIG_SYS_I2C_EEPROM_ADDR_LEN, (void *)&e, sizeof(e)); +#endif
#ifdef CONFIG_SYS_EEPROM_BUS_NUM i2c_set_bus_num(bus); @@ -210,6 +231,21 @@ static int prog_eeprom(void) #endif update_crc();
+#ifdef CONFIG_DM_I2C + struct udevice *dev, *udev; + + if (uclass_get_device_by_name(UCLASS_I2C, + FSL_I2C_EEPROM_DM_NAME, &udev)) { + puts("Cannot find EEPROM bus\n"); + return false; + } + + ret = i2c_get_chip(udev, CONFIG_SYS_I2C_EEPROM_ADDR, 1, &dev); + if (ret) { + puts("Cannot get EEPROM chip\n"); + return false; + } +#endif #ifdef CONFIG_SYS_EEPROM_BUS_NUM bus = i2c_get_bus_num(); i2c_set_bus_num(CONFIG_SYS_EEPROM_BUS_NUM); @@ -221,8 +257,13 @@ static int prog_eeprom(void) * complete a given write. */ for (i = 0, p = &e; i < sizeof(e); i += 8, p += 8) { - ret = i2c_write(CONFIG_SYS_I2C_EEPROM_ADDR, i, CONFIG_SYS_I2C_EEPROM_ADDR_LEN, +#ifdef CONFIG_DM_I2C + ret = dm_i2c_write(dev, i, p, 8); +#else + ret = i2c_write(CONFIG_SYS_I2C_EEPROM_ADDR, i, + CONFIG_SYS_I2C_EEPROM_ADDR_LEN, p, min((int)(sizeof(e) - i), 8)); +#endif if (ret) break; udelay(5000); /* 5ms write cycle timing */ @@ -231,9 +272,12 @@ static int prog_eeprom(void) if (!ret) { /* Verify the write by reading back the EEPROM and comparing */ struct eeprom e2; - +#ifdef CONFIG_DM_I2C + ret = dm_i2c_read(dev, 0, (void *)&e2, sizeof(e2)); +#else ret = i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, CONFIG_SYS_I2C_EEPROM_ADDR_LEN, (void *)&e2, sizeof(e2)); +#endif if (!ret && memcmp(&e, &e2, sizeof(e))) ret = -1; } @@ -528,9 +572,27 @@ unsigned int get_cpu_board_revision(void) u8 minor; /* 0x05 Board revision, minor */ } be;
+#ifdef CONFIG_DM_I2C + struct udevice *dev, *udev; + + if (uclass_get_device_by_name(UCLASS_I2C, + FSL_I2C_EEPROM_DM_NAME, &udev)) { + puts("Cannot find EEPROM bus\n"); + return false; + } + + ret = i2c_get_chip(udev, CONFIG_SYS_I2C_EEPROM_ADDR, 1, &dev); + if (ret) { + puts("Cannot get EEPROM chip\n"); + return false; + } + + dm_i2c_read(dev, 0, (void *)&be, sizeof(be)); +#else + i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, CONFIG_SYS_I2C_EEPROM_ADDR_LEN, (void *)&be, sizeof(be)); - +#endif if (be.id != (('C' << 24) | ('C' << 16) | ('I' << 8) | 'D')) return MPC85XX_CPU_BOARD_REV(0, 0);
diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c index 9999d9f..9bf8984 100644 --- a/drivers/i2c/mxc_i2c.c +++ b/drivers/i2c/mxc_i2c.c @@ -795,6 +795,14 @@ U_BOOT_I2C_ADAP_COMPLETE(mxc7, mxc_i2c_init, mxc_i2c_probe,
#else
+int __enable_i2c_clk(unsigned char enable, unsigned int i2c_num) +{ + return 1; +} + +int enable_i2c_clk(unsigned char enable, unsigned int i2c_num) + __attribute__((weak, alias("__enable_i2c_clk"))); + static int mxc_i2c_set_bus_speed(struct udevice *bus, unsigned int speed) { struct mxc_i2c_bus *i2c_bus = dev_get_priv(bus);

From: Zhang Ying-22455 ying.zhang22455@nxp.com
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com --- arch/arm/dts/fsl-ls1046a-rdb.dts | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
diff --git a/arch/arm/dts/fsl-ls1046a-rdb.dts b/arch/arm/dts/fsl-ls1046a-rdb.dts index 136de24..90b5aa8 100644 --- a/arch/arm/dts/fsl-ls1046a-rdb.dts +++ b/arch/arm/dts/fsl-ls1046a-rdb.dts @@ -19,6 +19,40 @@
};
+&i2c0 { + status = "okay"; + + ina220@40 { + compatible = "ti,ina220"; + reg = <0x40>; + shunt-resistor = <1000>; + }; + + temp-sensor@4c { + compatible = "adi,adt7461"; + reg = <0x4c>; + }; + + eeprom@56 { + compatible = "atmel,24c512"; + reg = <0x52>; + }; + + eeprom@57 { + compatible = "atmel,24c512"; + reg = <0x53>; + }; +}; + +&i2c3 { + status = "okay"; + + rtc@51 { + compatible = "nxp,pcf2129"; + reg = <0x51>; + }; +}; + &qspi { bus-num = <0>; status = "okay";

From: Zhang Ying-22455 ying.zhang22455@nxp.com
Some CONFIG options that are not supported on SPL must be disabled because one .config is shared between SPL and U-Boot proper going forward.
Such as CONFIG_I2C_DM is not supported in SPL at this time, so we can only add a option CONFIG_I2C_DM in the image without SPL.
After supporting the option CONFIG_SPL_I2C_DM in the future, we can enable CONFIG_I2C_DM in all the image.
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com --- configs/ls1046ardb_qspi_SECURE_BOOT_defconfig | 3 +++ configs/ls1046ardb_qspi_defconfig | 3 +++ include/configs/ls1046a_common.h | 2 -- include/configs/ls1046aqds.h | 2 ++ include/configs/ls1046ardb.h | 7 +++++++ 5 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig b/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig index 2c532a3..c01949d 100644 --- a/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig +++ b/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig @@ -47,3 +47,6 @@ CONFIG_USB_STORAGE=y CONFIG_RSA=y CONFIG_DM_GPIO=y CONFIG_MPC8XXX_GPIO=y +CONFIG_DM_I2C=y +CONFIG_DM_I2C_COMPAT=y +CONFIG_DM_EEPROM=y diff --git a/configs/ls1046ardb_qspi_defconfig b/configs/ls1046ardb_qspi_defconfig index abc1abf..643b4cc 100644 --- a/configs/ls1046ardb_qspi_defconfig +++ b/configs/ls1046ardb_qspi_defconfig @@ -47,3 +47,6 @@ CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y CONFIG_DM_GPIO=y CONFIG_MPC8XXX_GPIO=y +CONFIG_DM_I2C=y +CONFIG_DM_I2C_COMPAT=y +CONFIG_DM_EEPROM=y diff --git a/include/configs/ls1046a_common.h b/include/configs/ls1046a_common.h index cdb73f6..72ca9fe 100644 --- a/include/configs/ls1046a_common.h +++ b/include/configs/ls1046a_common.h @@ -125,8 +125,6 @@ #define CONFIG_SYS_MONITOR_LEN 0xa0000 #endif
-/* I2C */ -#define CONFIG_SYS_I2C
/* PCIe */ #define CONFIG_PCIE1 /* PCIE controller 1 */ diff --git a/include/configs/ls1046aqds.h b/include/configs/ls1046aqds.h index e873682..758d388 100644 --- a/include/configs/ls1046aqds.h +++ b/include/configs/ls1046aqds.h @@ -127,6 +127,8 @@ unsigned long get_board_ddr_clk(void); #define CFG_LPUART_EN 0x2 #endif
+#define CONFIG_SYS_I2C + /* EEPROM */ #define CONFIG_ID_EEPROM #define CONFIG_SYS_I2C_EEPROM_NXID diff --git a/include/configs/ls1046ardb.h b/include/configs/ls1046ardb.h index 87d8cf5..4b783b6 100644 --- a/include/configs/ls1046ardb.h +++ b/include/configs/ls1046ardb.h @@ -139,6 +139,10 @@ #define CONFIG_SYS_CS2_FTIM2 CONFIG_SYS_CPLD_FTIM2 #define CONFIG_SYS_CS2_FTIM3 CONFIG_SYS_CPLD_FTIM3
+#ifdef CONFIG_SD_BOOT +#define CONFIG_SYS_I2C +#endif + /* EEPROM */ #define CONFIG_ID_EEPROM #define CONFIG_SYS_I2C_EEPROM_NXID @@ -148,6 +152,9 @@ #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5 #define I2C_RETIMER_ADDR 0x18 +#define FSL_I2C_EEPROM_DM_NAME "i2c@2180000" +#define CONFIG_I2C_SET_DEFAULT_BUS_NUM +#define CONFIG_I2C_DEFAULT_BUS_NUMBER 0
/* PMIC */ #define CONFIG_POWER

From: Zhang Ying-22455 ying.zhang22455@nxp.com
Some CONFIG options that are not supported on SPL must be disabled because one .config is shared between SPL and U-Boot proper going forward.
Such as CONFIG_I2C_DM is not supported in SPL at this time, so we can only add a option CONFIG_I2C_DM in the image without SPL.
After supporting the option CONFIG_SPL_I2C_DM in the future, we can enable CONFIG_I2C_DM in all the image.
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com --- configs/ls1043ardb_SECURE_BOOT_defconfig | 3 +++ configs/ls1043ardb_defconfig | 3 +++ include/configs/ls1043a_common.h | 3 --- include/configs/ls1043aqds.h | 2 ++ include/configs/ls1043ardb.h | 7 +++++++ 5 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/configs/ls1043ardb_SECURE_BOOT_defconfig b/configs/ls1043ardb_SECURE_BOOT_defconfig index 44b8702..131ee2c 100644 --- a/configs/ls1043ardb_SECURE_BOOT_defconfig +++ b/configs/ls1043ardb_SECURE_BOOT_defconfig @@ -46,3 +46,6 @@ CONFIG_SPL_RSA=y CONFIG_RSA_SOFTWARE_EXP=y CONFIG_DM_GPIO=y CONFIG_MPC8XXX_GPIO=y +CONFIG_DM_I2C=y +CONFIG_DM_I2C_COMPAT=y +CONFIG_DM_EEPROM=y diff --git a/configs/ls1043ardb_defconfig b/configs/ls1043ardb_defconfig index 4ee6346..221fc10 100644 --- a/configs/ls1043ardb_defconfig +++ b/configs/ls1043ardb_defconfig @@ -44,3 +44,6 @@ CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y CONFIG_DM_GPIO=y CONFIG_MPC8XXX_GPIO=y +CONFIG_DM_I2C=y +CONFIG_DM_I2C_COMPAT=y +CONFIG_DM_EEPROM=y diff --git a/include/configs/ls1043a_common.h b/include/configs/ls1043a_common.h index 656d10d..71cef41 100644 --- a/include/configs/ls1043a_common.h +++ b/include/configs/ls1043a_common.h @@ -141,9 +141,6 @@ #endif #endif
-/* I2C */ -#define CONFIG_SYS_I2C - /* PCIe */ #ifndef SPL_NO_PCIE #define CONFIG_PCIE1 /* PCIE controller 1 */ diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h index f4a0cc0..7dfcf68 100644 --- a/include/configs/ls1043aqds.h +++ b/include/configs/ls1043aqds.h @@ -87,6 +87,8 @@ unsigned long get_board_ddr_clk(void); /* SATA */ #define CONFIG_SCSI_AHCI_PLAT
+#define CONFIG_SYS_I2C + /* EEPROM */ #define CONFIG_ID_EEPROM #define CONFIG_SYS_I2C_EEPROM_NXID diff --git a/include/configs/ls1043ardb.h b/include/configs/ls1043ardb.h index 9b24056..80f06c7 100644 --- a/include/configs/ls1043ardb.h +++ b/include/configs/ls1043ardb.h @@ -211,6 +211,10 @@ #define CONFIG_SYS_CS2_FTIM2 CONFIG_SYS_CPLD_FTIM2 #define CONFIG_SYS_CS2_FTIM3 CONFIG_SYS_CPLD_FTIM3
+#if (defined(CONFIG_NAND_BOOT) || defined(CONFIG_SD_BOOT)) +#define CONFIG_SYS_I2C +#endif + /* EEPROM */ #ifndef SPL_NO_EEPROM #define CONFIG_ID_EEPROM @@ -220,6 +224,9 @@ #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5 +#define FSL_I2C_EEPROM_DM_NAME "i2c@2180000" +#define CONFIG_I2C_SET_DEFAULT_BUS_NUM +#define CONFIG_I2C_DEFAULT_BUS_NUMBER 0 #endif
/*

From: Zhang Ying-22455 ying.zhang22455@nxp.com
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com --- arch/arm/dts/fsl-ls1088a-qds.dts | 57 ++++++++++++++++++++++++++++++++++++++++ arch/arm/dts/fsl-ls1088a-rdb.dts | 40 ++++++++++++++++++++++++++++ arch/arm/dts/fsl-ls1088a.dtsi | 55 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 152 insertions(+)
diff --git a/arch/arm/dts/fsl-ls1088a-qds.dts b/arch/arm/dts/fsl-ls1088a-qds.dts index 36116f7..3913621 100644 --- a/arch/arm/dts/fsl-ls1088a-qds.dts +++ b/arch/arm/dts/fsl-ls1088a-qds.dts @@ -18,6 +18,63 @@ }; };
+&i2c0 { + status = "okay"; + + i2c-switch@77 { + compatible = "nxp,pca9547"; + reg = <0x77>; + #address-cells = <1>; + #size-cells = <0>; + + i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x2>; + + ina220@40 { + compatible = "ti,ina220"; + reg = <0x40>; + shunt-resistor = <1000>; + }; + + ina220@41 { + compatible = "ti,ina220"; + reg = <0x41>; + shunt-resistor = <1000>; + }; + }; + + i2c@3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x3>; + + temp-sensor@4c { + compatible = "adi,adt7461a"; + reg = <0x4c>; + }; + + rtc@51 { + compatible = "nxp,pcf2129"; + reg = <0x51>; + /* IRQ10_B */ + interrupts = <0 150 4>; + }; + + eeprom@56 { + compatible = "atmel,24c512"; + reg = <0x56>; + }; + + eeprom@57 { + compatible = "atmel,24c512"; + reg = <0x57>; + }; + }; + }; +}; + &ifc { #address-cells = <2>; #size-cells = <1>; diff --git a/arch/arm/dts/fsl-ls1088a-rdb.dts b/arch/arm/dts/fsl-ls1088a-rdb.dts index 0be3f8d..6eb0560 100644 --- a/arch/arm/dts/fsl-ls1088a-rdb.dts +++ b/arch/arm/dts/fsl-ls1088a-rdb.dts @@ -17,6 +17,46 @@ }; };
+&i2c0 { + status = "okay"; + + i2c-switch@77 { + compatible = "nxp,pca9547"; + reg = <0x77>; + #address-cells = <1>; + #size-cells = <0>; + + i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x2>; + + ina220@40 { + compatible = "ti,ina220"; + reg = <0x40>; + shunt-resistor = <1000>; + }; + }; + + i2c@3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x3>; + + temp-sensor@4c { + compatible = "adi,adt7461a"; + reg = <0x4c>; + }; + + rtc@51 { + compatible = "nxp,pcf2129"; + reg = <0x51>; + /* IRQ10_B */ + interrupts = <0 150 4>; + }; + }; + }; +}; &qspi { bus-num = <0>; status = "okay"; diff --git a/arch/arm/dts/fsl-ls1088a.dtsi b/arch/arm/dts/fsl-ls1088a.dtsi index acc63be..7178b68 100644 --- a/arch/arm/dts/fsl-ls1088a.dtsi +++ b/arch/arm/dts/fsl-ls1088a.dtsi @@ -26,6 +26,13 @@ interrupts = <1 9 0x4>; };
+ sysclk: sysclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + clock-output-names = "sysclk"; + }; + timer { compatible = "arm,armv8-timer"; interrupts = <1 13 0x8>, /* Physical Secure PPI, active-low */ @@ -34,6 +41,54 @@ <1 10 0x8>; /* Hypervisor PPI, active-low */ };
+ + clockgen: clocking@1300000 { + compatible = "fsl,ls1088a-clockgen"; + reg = <0 0x1300000 0 0xa0000>; + #clock-cells = <2>; + clocks = <&sysclk>; + }; + + i2c0: i2c@2000000 { + compatible = "fsl,vf610-i2c", "fsl,ls1088a-vf610-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0 0x2000000 0x0 0x10000>; + interrupts = <0 34 4>; + clocks = <&clockgen 4 7>; + status = "disabled"; + }; + + i2c1: i2c@2010000 { + compatible = "fsl,vf610-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0 0x2010000 0x0 0x10000>; + interrupts = <0 34 4>; + clocks = <&clockgen 4 7>; + status = "disabled"; + }; + + i2c2: i2c@2020000 { + compatible = "fsl,vf610-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0 0x2020000 0x0 0x10000>; + interrupts = <0 35 4>; + clocks = <&clockgen 4 7>; + status = "disabled"; + }; + + i2c3: i2c@2030000 { + compatible = "fsl,vf610-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0 0x2030000 0x0 0x10000>; + interrupts = <0 35 4>; + clocks = <&clockgen 4 7>; + status = "disabled"; + }; + serial0: serial@21c0500 { device_type = "serial"; compatible = "fsl,ns16550", "ns16550a";

On 08/22/2018 06:15 PM, ying.zhang22455@nxp.com wrote:
From: Zhang Ying-22455 ying.zhang22455@nxp.com
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com
arch/arm/dts/fsl-ls1088a-qds.dts | 57 ++++++++++++++++++++++++++++++++++++++++ arch/arm/dts/fsl-ls1088a-rdb.dts | 40 ++++++++++++++++++++++++++++ arch/arm/dts/fsl-ls1088a.dtsi | 55 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 152 insertions(+)
diff --git a/arch/arm/dts/fsl-ls1088a-qds.dts b/arch/arm/dts/fsl-ls1088a-qds.dts index 36116f7..3913621 100644 --- a/arch/arm/dts/fsl-ls1088a-qds.dts +++ b/arch/arm/dts/fsl-ls1088a-qds.dts @@ -18,6 +18,63 @@ }; };
+&i2c0 {
- status = "okay";
- i2c-switch@77 {
compatible = "nxp,pca9547";
reg = <0x77>;
#address-cells = <1>;
#size-cells = <0>;
i2c@2 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0x2>;
ina220@40 {
compatible = "ti,ina220";
reg = <0x40>;
shunt-resistor = <1000>;
};
ina220@41 {
compatible = "ti,ina220";
reg = <0x41>;
shunt-resistor = <1000>;
};
};
i2c@3 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0x3>;
temp-sensor@4c {
compatible = "adi,adt7461a";
reg = <0x4c>;
};
rtc@51 {
compatible = "nxp,pcf2129";
reg = <0x51>;
/* IRQ10_B */
interrupts = <0 150 4>;
};
eeprom@56 {
compatible = "atmel,24c512";
reg = <0x56>;
};
eeprom@57 {
compatible = "atmel,24c512";
reg = <0x57>;
};
};
- };
+};
&ifc { #address-cells = <2>; #size-cells = <1>; diff --git a/arch/arm/dts/fsl-ls1088a-rdb.dts b/arch/arm/dts/fsl-ls1088a-rdb.dts index 0be3f8d..6eb0560 100644 --- a/arch/arm/dts/fsl-ls1088a-rdb.dts +++ b/arch/arm/dts/fsl-ls1088a-rdb.dts @@ -17,6 +17,46 @@ }; };
+&i2c0 {
- status = "okay";
- i2c-switch@77 {
compatible = "nxp,pca9547";
reg = <0x77>;
#address-cells = <1>;
#size-cells = <0>;
i2c@2 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0x2>;
ina220@40 {
compatible = "ti,ina220";
reg = <0x40>;
shunt-resistor = <1000>;
};
};
i2c@3 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0x3>;
temp-sensor@4c {
compatible = "adi,adt7461a";
reg = <0x4c>;
};
rtc@51 {
compatible = "nxp,pcf2129";
reg = <0x51>;
/* IRQ10_B */
interrupts = <0 150 4>;
};
};
- };
+}; &qspi { bus-num = <0>; status = "okay"; diff --git a/arch/arm/dts/fsl-ls1088a.dtsi b/arch/arm/dts/fsl-ls1088a.dtsi index acc63be..7178b68 100644 --- a/arch/arm/dts/fsl-ls1088a.dtsi +++ b/arch/arm/dts/fsl-ls1088a.dtsi @@ -26,6 +26,13 @@ interrupts = <1 9 0x4>; };
- sysclk: sysclk {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <100000000>;
clock-output-names = "sysclk";
};
You have space instead of tab here.
- timer { compatible = "arm,armv8-timer"; interrupts = <1 13 0x8>, /* Physical Secure PPI, active-low */
@@ -34,6 +41,54 @@ <1 10 0x8>; /* Hypervisor PPI, active-low */ };
You have extra blank line here.
Did you run checkpatch?
York

From: Zhang Ying-22455 ying.zhang22455@nxp.com
Some CONFIG options that are not supported on SPL must be disabled because one .config is shared between SPL and U-Boot proper going forward.
Such as CONFIG_I2C_DM is not supported in SPL at this time, so we can only add a option CONFIG_I2C_DM in the image without SPL.
After supporting the option CONFIG_SPL_I2C_DM in the future, we can enable CONFIG_I2C_DM in all the image.
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com --- configs/ls1088ardb_qspi_SECURE_BOOT_defconfig | 3 +++ configs/ls1088ardb_qspi_defconfig | 3 +++ include/configs/ls1088a_common.h | 2 -- include/configs/ls1088aqds.h | 2 ++ include/configs/ls1088ardb.h | 8 ++++++++ 5 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/configs/ls1088ardb_qspi_SECURE_BOOT_defconfig b/configs/ls1088ardb_qspi_SECURE_BOOT_defconfig index 120527c..3ecd56f 100644 --- a/configs/ls1088ardb_qspi_SECURE_BOOT_defconfig +++ b/configs/ls1088ardb_qspi_SECURE_BOOT_defconfig @@ -55,3 +55,6 @@ CONFIG_RSA_SOFTWARE_EXP=y CONFIG_EFI_LOADER_BOUNCE_BUFFER=y CONFIG_DM_GPIO=y CONFIG_MPC8XXX_GPIO=y +CONFIG_DM_I2C=y +CONFIG_DM_I2C_COMPAT=y +CONFIG_DM_EEPROM=y diff --git a/configs/ls1088ardb_qspi_defconfig b/configs/ls1088ardb_qspi_defconfig index 0517b98..9d32261 100644 --- a/configs/ls1088ardb_qspi_defconfig +++ b/configs/ls1088ardb_qspi_defconfig @@ -53,3 +53,6 @@ CONFIG_USB_GADGET=y CONFIG_EFI_LOADER_BOUNCE_BUFFER=y CONFIG_DM_GPIO=y CONFIG_MPC8XXX_GPIO=y +CONFIG_DM_I2C=y +CONFIG_DM_I2C_COMPAT=y +CONFIG_DM_EEPROM=y diff --git a/include/configs/ls1088a_common.h b/include/configs/ls1088a_common.h index 031c311..6ebae31 100644 --- a/include/configs/ls1088a_common.h +++ b/include/configs/ls1088a_common.h @@ -63,8 +63,6 @@ /* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2048 * 1024)
-/* I2C */ -#define CONFIG_SYS_I2C
/* Serial Port */ #define CONFIG_SYS_NS16550_SERIAL diff --git a/include/configs/ls1088aqds.h b/include/configs/ls1088aqds.h index d2c80fc..a40054c 100644 --- a/include/configs/ls1088aqds.h +++ b/include/configs/ls1088aqds.h @@ -308,6 +308,8 @@ unsigned long get_board_ddr_clk(void);
#define PWM_CHANNEL0 0x0
+#define CONFIG_SYS_I2C + /* * RTC configuration */ diff --git a/include/configs/ls1088ardb.h b/include/configs/ls1088ardb.h index 36243f9..c7eb3a8 100644 --- a/include/configs/ls1088ardb.h +++ b/include/configs/ls1088ardb.h @@ -263,11 +263,16 @@ * RTC configuration */ #define RTC +#define CONFIG_SYS_RTC_BUS_NUM 0 #define CONFIG_RTC_PCF8563 1 #define CONFIG_SYS_I2C_RTC_ADDR 0x51 /* Channel 3*/ #define CONFIG_CMD_DATE #endif
+#ifdef CONFIG_SD_BOOT +#define CONFIG_SYS_I2C +#endif + /* EEPROM */ #define CONFIG_ID_EEPROM #define CONFIG_SYS_I2C_EEPROM_NXID @@ -276,6 +281,9 @@ #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5 +#define FSL_I2C_EEPROM_DM_NAME "i2c@2300000" +#define CONFIG_I2C_SET_DEFAULT_BUS_NUM +#define CONFIG_I2C_DEFAULT_BUS_NUMBER 0
#ifndef SPL_NO_QSPI /* QSPI device */

From: Zhang Ying-22455 ying.zhang22455@nxp.com
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com --- arch/arm/dts/fsl-ls2080a-rdb.dts | 44 ++++++++++++++++++++++++++++++ arch/arm/dts/fsl-ls2080a.dtsi | 58 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+)
diff --git a/arch/arm/dts/fsl-ls2080a-rdb.dts b/arch/arm/dts/fsl-ls2080a-rdb.dts index 541bcd3..3922dbc 100644 --- a/arch/arm/dts/fsl-ls2080a-rdb.dts +++ b/arch/arm/dts/fsl-ls2080a-rdb.dts @@ -18,6 +18,50 @@ }; };
+&i2c0 { + status = "okay"; + pca9547@75 { + compatible = "nxp,pca9547"; + reg = <0x75>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-never-disable; + + i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x01>; + rtc@68 { + compatible = "dallas,ds3232"; + reg = <0x68>; + }; + }; + + i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x02>; + + ina220@40 { + compatible = "ti,ina220"; + reg = <0x40>; + shunt-resistor = <500>; + }; + }; + + i2c@3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x3>; + + adt7481@4c { + compatible = "adi,adt7461"; + reg = <0x4c>; + }; + }; + }; +}; + &dspi { bus-num = <0>; status = "okay"; diff --git a/arch/arm/dts/fsl-ls2080a.dtsi b/arch/arm/dts/fsl-ls2080a.dtsi index 160600c..3a611e1 100644 --- a/arch/arm/dts/fsl-ls2080a.dtsi +++ b/arch/arm/dts/fsl-ls2080a.dtsi @@ -34,6 +34,64 @@ <1 10 0x8>; /* Hypervisor PPI, active-low */ };
+ sysclk: sysclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + clock-output-names = "sysclk"; + }; + + clockgen: clocking@1300000 { + compatible = "fsl,ls2080a-clockgen"; + reg = <0 0x1300000 0 0xa0000>; + #clock-cells = <2>; + clocks = <&sysclk>; + }; + + i2c0: i2c@2000000 { + status = "disabled"; + compatible = "fsl,vf610-i2c", "fsl,ls208xa-vf610-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0 0x2000000 0x0 0x10000>; + interrupts = <0 34 0x4>; /* Level high type */ + clock-names = "i2c"; + clocks = <&clockgen 4 1>; + }; + + i2c1: i2c@2010000 { + status = "disabled"; + compatible = "fsl,vf610-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0 0x2010000 0x0 0x10000>; + interrupts = <0 34 0x4>; /* Level high type */ + clock-names = "i2c"; + clocks = <&clockgen 4 1>; + }; + + i2c2: i2c@2020000 { + status = "disabled"; + compatible = "fsl,vf610-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0 0x2020000 0x0 0x10000>; + interrupts = <0 35 0x4>; /* Level high type */ + clock-names = "i2c"; + clocks = <&clockgen 4 1>; + }; + + i2c3: i2c@2030000 { + status = "disabled"; + compatible = "fsl,vf610-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0 0x2030000 0x0 0x10000>; + interrupts = <0 35 0x4>; /* Level high type */ + clock-names = "i2c"; + clocks = <&clockgen 4 1>; + }; + serial0: serial@21c0500 { device_type = "serial"; compatible = "fsl,ns16550", "ns16550a";

From: Zhang Ying-22455 ying.zhang22455@nxp.com
Some CONFIG options that are not supported on SPL must be disabled because one .config is shared between SPL and U-Boot proper going forward.
Such as CONFIG_I2C_DM is not supported in SPL at this time, so we can only add a option CONFIG_I2C_DM in the image without SPL.
After supporting the option CONFIG_SPL_I2C_DM in the future, we can enable CONFIG_I2C_DM in all the image.
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com --- configs/ls2080ardb_SECURE_BOOT_defconfig | 3 +++ configs/ls2080ardb_defconfig | 3 +++ configs/ls2081ardb_defconfig | 3 +++ include/configs/ls2080a_common.h | 2 -- include/configs/ls2080aqds.h | 2 ++ include/configs/ls2080ardb.h | 8 ++++++++ 6 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/configs/ls2080ardb_SECURE_BOOT_defconfig b/configs/ls2080ardb_SECURE_BOOT_defconfig index f258e63..0f43ca0 100644 --- a/configs/ls2080ardb_SECURE_BOOT_defconfig +++ b/configs/ls2080ardb_SECURE_BOOT_defconfig @@ -55,3 +55,6 @@ CONFIG_RSA_SOFTWARE_EXP=y CONFIG_EFI_LOADER_BOUNCE_BUFFER=y CONFIG_DM_GPIO=y CONFIG_MPC8XXX_GPIO=y +CONFIG_DM_I2C=y +CONFIG_DM_I2C_COMPAT=y +CONFIG_DM_EEPROM=y diff --git a/configs/ls2080ardb_defconfig b/configs/ls2080ardb_defconfig index 7d6844e..4fd792d 100644 --- a/configs/ls2080ardb_defconfig +++ b/configs/ls2080ardb_defconfig @@ -54,3 +54,6 @@ CONFIG_USB_STORAGE=y CONFIG_EFI_LOADER_BOUNCE_BUFFER=y CONFIG_DM_GPIO=y CONFIG_MPC8XXX_GPIO=y +CONFIG_DM_I2C=y +CONFIG_DM_I2C_COMPAT=y +CONFIG_DM_EEPROM=y diff --git a/configs/ls2081ardb_defconfig b/configs/ls2081ardb_defconfig index 2ac938e..2d10feb 100644 --- a/configs/ls2081ardb_defconfig +++ b/configs/ls2081ardb_defconfig @@ -54,3 +54,6 @@ CONFIG_USB_STORAGE=y CONFIG_EFI_LOADER_BOUNCE_BUFFER=y CONFIG_DM_GPIO=y CONFIG_MPC8XXX_GPIO=y +CONFIG_DM_I2C=y +CONFIG_DM_I2C_COMPAT=y +CONFIG_DM_EEPROM=y diff --git a/include/configs/ls2080a_common.h b/include/configs/ls2080a_common.h index 5024f97..6fd8271 100644 --- a/include/configs/ls2080a_common.h +++ b/include/configs/ls2080a_common.h @@ -73,8 +73,6 @@ /* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2048 * 1024)
-/* I2C */ -#define CONFIG_SYS_I2C
/* Serial Port */ #define CONFIG_SYS_NS16550_SERIAL diff --git a/include/configs/ls2080aqds.h b/include/configs/ls2080aqds.h index 81a092b..e8953a6 100644 --- a/include/configs/ls2080aqds.h +++ b/include/configs/ls2080aqds.h @@ -318,6 +318,8 @@ unsigned long get_board_ddr_clk(void); QIXIS_SDID_MASK) != QIXIS_ESDHC_NO_ADAPTER) #endif
+#define CONFIG_SYS_I2C + /* * RTC configuration */ diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h index 84c6b7b..35d34e4 100644 --- a/include/configs/ls2080ardb.h +++ b/include/configs/ls2080ardb.h @@ -292,6 +292,7 @@ unsigned long get_board_sys_clk(void); * RTC configuration */ #define RTC +#define CONFIG_SYS_RTC_BUS_NUM 0 #ifdef CONFIG_TARGET_LS2081ARDB #define CONFIG_RTC_PCF8563 1 #define CONFIG_SYS_I2C_RTC_ADDR 0x51 @@ -300,6 +301,10 @@ unsigned long get_board_sys_clk(void); #define CONFIG_SYS_I2C_RTC_ADDR 0x68 #endif
+#if defined(CONFIG_NAND_BOOT) || defined(CONFIG_FSL_QSPI) +#define CONFIG_SYS_I2C +#endif + /* EEPROM */ #define CONFIG_ID_EEPROM #define CONFIG_SYS_I2C_EEPROM_NXID @@ -308,6 +313,9 @@ unsigned long get_board_sys_clk(void); #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5 +#define FSL_I2C_EEPROM_DM_NAME "i2c@2000000" +#define CONFIG_I2C_SET_DEFAULT_BUS_NUM +#define CONFIG_I2C_DEFAULT_BUS_NUMBER 0
#define CONFIG_FSL_MEMAC

On 08/22/2018 06:15 PM, ying.zhang22455@nxp.com wrote:
From: Zhang Ying-22455 ying.zhang22455@nxp.com
- Add mpc8xxx_gpio_plat for for Layerscape SoC
- Make the mpc8xxx driver capable of handling Layerscape Soc.
This looks weird. Why don't you rename mpc8xxx_gpio driver to be generic?
York

On 08/23/2018 08:27 AM, York Sun wrote:
On 08/22/2018 06:15 PM, ying.zhang22455@nxp.com wrote:
From: Zhang Ying-22455 ying.zhang22455@nxp.com
- Add mpc8xxx_gpio_plat for for Layerscape SoC
- Make the mpc8xxx driver capable of handling Layerscape Soc.
This looks weird. Why don't you rename mpc8xxx_gpio driver to be generic?
Are you going to rename the driver?
York

Hi, York, I prefer not to rename it. This is consistent with Linux kernel.
-----Original Message----- From: York Sun Sent: 2018年9月22日 5:06 To: Ying Zhang ying.zhang22455@nxp.com Cc: u-boot@lists.denx.de Subject: Re: [PATCH 01/18] gpio: mpc8xxx: add support for Layerscape SoC
On 08/23/2018 08:27 AM, York Sun wrote:
On 08/22/2018 06:15 PM, ying.zhang22455@nxp.com wrote:
From: Zhang Ying-22455 ying.zhang22455@nxp.com
- Add mpc8xxx_gpio_plat for for Layerscape SoC
- Make the mpc8xxx driver capable of handling Layerscape Soc.
This looks weird. Why don't you rename mpc8xxx_gpio driver to be generic?
Are you going to rename the driver?
York

On 08/22/2018 06:15 PM, ying.zhang22455@nxp.com wrote:
From: Zhang Ying-22455 ying.zhang22455@nxp.com
- Add mpc8xxx_gpio_plat for for Layerscape SoC
- Make the mpc8xxx driver capable of handling Layerscape Soc.
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com
arch/arm/include/asm/arch-fsl-layerscape/gpio.h | 24 ++++++++++++++++++++++ .../include/asm/arch-fsl-layerscape/immap_lsch2.h | 2 ++ arch/arm/include/asm/arch-ls102xa/gpio.h | 6 ++++++ drivers/gpio/mpc8xxx_gpio.c | 1 + 4 files changed, 33 insertions(+) create mode 100644 arch/arm/include/asm/arch-fsl-layerscape/gpio.h
diff --git a/arch/arm/include/asm/arch-fsl-layerscape/gpio.h b/arch/arm/include/asm/arch-fsl-layerscape/gpio.h new file mode 100644 index 0000000..b6afcaa --- /dev/null +++ b/arch/arm/include/asm/arch-fsl-layerscape/gpio.h @@ -0,0 +1,24 @@ +/*
- Copyright 2008-2016 Freescale Semiconductor, Inc.
- Copyright 2017-2018 NXP Semiconductor
- SPDX-License-Identifier: GPL-2.0
- */
+#ifndef _ASM_ARCH_LAYERSCAPE_GPIO_H_ +#define _ASM_ARCH_LAYERSCAPE_GPIO_H_
+#ifdef CONFIG_FSL_LSCH2 +#include <asm/arch/immap_lsch2.h> +#endif +#ifdef CONFIG_FSL_LSCH3 +#include <asm/arch/immap_lsch3.h> +#endif
+struct mpc8xxx_gpio_plat {
- ulong addr;
- unsigned long size;
- uint ngpios;
+};
+#endif diff --git a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h index be0a6ae..18f6875 100644 --- a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h +++ b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h @@ -650,6 +650,7 @@ struct ccsr_serdes { u8 res_19a0[0x2000-0x19a0]; /* from 0x19a0 to 0x1fff */ };
+#ifndef CONFIG_MPC8XXX_GPIO struct ccsr_gpio { u32 gpdir; u32 gpodr; @@ -659,6 +660,7 @@ struct ccsr_gpio { u32 gpicr; u32 gpibe; }; +#endif
Why do you need to keep this code?
York

On 08/22/2018 06:15 PM, ying.zhang22455@nxp.com wrote:
From: Zhang Ying-22455 ying.zhang22455@nxp.com
- Add mpc8xxx_gpio_plat for for Layerscape SoC
- Make the mpc8xxx driver capable of handling Layerscape Soc.
Signed-off-by: Zhang Ying-22455 ying.zhang22455@nxp.com
arch/arm/include/asm/arch-fsl-layerscape/gpio.h | 24 ++++++++++++++++++++++ .../include/asm/arch-fsl-layerscape/immap_lsch2.h | 2 ++ arch/arm/include/asm/arch-ls102xa/gpio.h | 6 ++++++ drivers/gpio/mpc8xxx_gpio.c | 1 + 4 files changed, 33 insertions(+) create mode 100644 arch/arm/include/asm/arch-fsl-layerscape/gpio.h
diff --git a/arch/arm/include/asm/arch-fsl-layerscape/gpio.h b/arch/arm/include/asm/arch-fsl-layerscape/gpio.h new file mode 100644 index 0000000..b6afcaa --- /dev/null +++ b/arch/arm/include/asm/arch-fsl-layerscape/gpio.h @@ -0,0 +1,24 @@ +/*
- Copyright 2008-2016 Freescale Semiconductor, Inc.
- Copyright 2017-2018 NXP Semiconductor
- SPDX-License-Identifier: GPL-2.0
- */
Please use the new SPDX format.
York
participants (3)
-
Ying Zhang
-
ying.zhang22455@nxp.com
-
York Sun