From c6e7e99bacb6b34ed02bbfc30bac580a99656f9e Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Mon, 18 Mar 2019 23:29:42 +0100 Subject: [PATCH] imx6: wandboard: convert to DM_GPIO and enable pinctrl driver Enable DM_GPIO and pinctrl in defconfig and add gpio_request() calls where required. Signed-off-by: Anatolij Gustschin --- board/wandboard/wandboard.c | 12 ++++++++++++ configs/wandboard_defconfig | 3 +++ 2 files changed, 15 insertions(+) diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c index 6af1b45882..e0d5769131 100644 --- a/board/wandboard/wandboard.c +++ b/board/wandboard/wandboard.c @@ -131,12 +131,14 @@ static void setup_iomux_enet(void) if (with_pmic) { SETUP_IOMUX_PADS(enet_ar8035_power_pads); /* enable AR8035 POWER */ + gpio_request(ETH_PHY_AR8035_POWER, "PHY_POWER"); gpio_direction_output(ETH_PHY_AR8035_POWER, 0); } /* wait until 3.3V of PHY and clock become stable */ mdelay(10); /* Reset AR8031 PHY */ + gpio_request(ETH_PHY_RESET, "PHY_RESET"); gpio_direction_output(ETH_PHY_RESET, 0); mdelay(10); gpio_set_value(ETH_PHY_RESET, 1); @@ -170,6 +172,11 @@ int board_mmc_init(bd_t *bis) int ret; u32 index = 0; +#if !CONFIG_IS_ENABLED(DM_MMC) + gpio_request(USDHC1_CD_GPIO, "USDHC1_CD"); + gpio_request(USDHC3_CD_GPIO, "USDHC3_CD"); +#endif + /* * Following map is done: * (U-Boot device node) (Physical Port) @@ -356,6 +363,8 @@ static void enable_fwadapt_7wvga(struct display_info_t const *dev) { SETUP_IOMUX_PADS(fwadapt_7wvga_pads); + gpio_request(IMX_GPIO_NR(2, 10), "DISP0_BKLEN"); + gpio_request(IMX_GPIO_NR(2, 11), "DISP0_VDDEN"); gpio_direction_output(IMX_GPIO_NR(2, 10), 1); gpio_direction_output(IMX_GPIO_NR(2, 11), 1); } @@ -418,6 +427,7 @@ static void setup_display(void) /* Disable LCD backlight */ SETUP_IOMUX_PAD(PAD_DI0_PIN4__GPIO4_IO20); + gpio_request(IMX_GPIO_NR(4, 20), "LCD_BKLEN"); gpio_direction_input(IMX_GPIO_NR(4, 20)); } #endif /* CONFIG_VIDEO_IPUV3 */ @@ -548,6 +558,8 @@ int board_init(void) int checkboard(void) { + gpio_request(REV_DETECTION, "REV_DETECT"); + if (is_revd1()) puts("Board: Wandboard rev D1\n"); else if (is_revc1()) diff --git a/configs/wandboard_defconfig b/configs/wandboard_defconfig index 9307ea6c64..11cf4415ae 100644 --- a/configs/wandboard_defconfig +++ b/configs/wandboard_defconfig @@ -38,9 +38,12 @@ CONFIG_ENV_IS_IN_MMC=y CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_DM=y CONFIG_DWC_AHSATA=y +CONFIG_DM_GPIO=y CONFIG_FSL_ESDHC=y CONFIG_PHYLIB=y CONFIG_MII=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_IMX6=y CONFIG_DM_THERMAL=y CONFIG_USB=y CONFIG_VIDEO=y -- 2.39.5