From: Peng Fan <[email protected]>

Enable CONFIG_DM_SERIAL, and `dm tree` could show:
 serial        1  [   ]   serial_mxc            |       |-- serial@30a80000

Signed-off-by: Peng Fan <[email protected]>
---

V2:
 Per Fabio's comments, drop board uart pinmux setting.
 Mark u-boot,dm-pre-reloc for dm serial

 arch/arm/dts/imx7d-sdb-u-boot.dtsi        | 36 +++++++++++++++++++++++
 board/freescale/mx7dsabresd/mx7dsabresd.c | 15 ----------
 configs/mx7dsabresd_defconfig             |  1 +
 configs/mx7dsabresd_qspi_defconfig        |  1 +
 4 files changed, 38 insertions(+), 15 deletions(-)

diff --git a/arch/arm/dts/imx7d-sdb-u-boot.dtsi 
b/arch/arm/dts/imx7d-sdb-u-boot.dtsi
index b78358fa139..d37dfe783f7 100644
--- a/arch/arm/dts/imx7d-sdb-u-boot.dtsi
+++ b/arch/arm/dts/imx7d-sdb-u-boot.dtsi
@@ -1,3 +1,39 @@
+&{/soc} {
+       u-boot,dm-pre-reloc;
+};
+
+&aips1 {
+       u-boot,dm-pre-reloc;
+};
+
+&aips3 {
+       u-boot,dm-pre-reloc;
+};
+
+&{/soc/bus@30800000/spba-bus@30800000} {
+       u-boot,dm-pre-reloc;
+};
+
+&iomuxc {
+       u-boot,dm-pre-reloc;
+};
+
+&iomuxc_lpsr {
+       u-boot,dm-pre-reloc;
+};
+
+&{/soc/bus@30000000/iomuxc@30330000/imx7d-sdb} {
+       u-boot,dm-pre-reloc;
+};
+
+&pinctrl_uart1 {
+       u-boot,dm-pre-reloc;
+};
+
+&uart1 {
+       u-boot,dm-pre-reloc;
+};
+
 &fec2 {
        status = "disable";
 };
diff --git a/board/freescale/mx7dsabresd/mx7dsabresd.c 
b/board/freescale/mx7dsabresd/mx7dsabresd.c
index 2777ae13bce..c19edd73c36 100644
--- a/board/freescale/mx7dsabresd/mx7dsabresd.c
+++ b/board/freescale/mx7dsabresd/mx7dsabresd.c
@@ -28,9 +28,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define UART_PAD_CTRL  (PAD_CTL_DSE_3P3V_49OHM | \
-       PAD_CTL_PUS_PU100KOHM | PAD_CTL_HYS)
-
 #define LCD_PAD_CTRL    (PAD_CTL_HYS | PAD_CTL_PUS_PU100KOHM | \
        PAD_CTL_DSE_3P3V_49OHM)
 
@@ -71,11 +68,6 @@ static iomux_v3_cfg_t const wdog_pads[] = {
        MX7D_PAD_GPIO1_IO00__WDOG1_WDOG_B | MUX_PAD_CTRL(NO_PAD_CTRL),
 };
 
-static iomux_v3_cfg_t const uart1_pads[] = {
-       MX7D_PAD_UART1_TX_DATA__UART1_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
-       MX7D_PAD_UART1_RX_DATA__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-
 #ifdef CONFIG_NAND_MXS
 static iomux_v3_cfg_t const gpmi_pads[] = {
        MX7D_PAD_SD3_DATA0__NAND_DATA00 | MUX_PAD_CTRL(NAND_PAD_CTRL),
@@ -167,11 +159,6 @@ static int setup_lcd(void)
 }
 #endif
 
-static void setup_iomux_uart(void)
-{
-       imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
-}
-
 int board_mmc_get_env_dev(int devno)
 {
        if (devno == 2)
@@ -228,8 +215,6 @@ int board_qspi_init(void)
 
 int board_early_init_f(void)
 {
-       setup_iomux_uart();
-
        return 0;
 }
 
diff --git a/configs/mx7dsabresd_defconfig b/configs/mx7dsabresd_defconfig
index 28fc36746f0..d8c5dbcc93a 100644
--- a/configs/mx7dsabresd_defconfig
+++ b/configs/mx7dsabresd_defconfig
@@ -67,6 +67,7 @@ CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_PFUZE100=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
diff --git a/configs/mx7dsabresd_qspi_defconfig 
b/configs/mx7dsabresd_qspi_defconfig
index 858d150a266..7aa35791089 100644
--- a/configs/mx7dsabresd_qspi_defconfig
+++ b/configs/mx7dsabresd_qspi_defconfig
@@ -71,6 +71,7 @@ CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_PFUZE100=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
-- 
2.35.1

Reply via email to