From 3a05eb8fee1330caf891fd3f6d12b6316559ca3b Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Fri, 17 May 2019 16:58:50 +0200 Subject: [PATCH] ARM: imx: dh-imx6: Enable DM GPIO Enable DM GPIO support on DHCOM iMX6 PDK2 and fix up board code where applicable. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Ludwig Zenz Cc: Stefano Babic --- board/dhelectronics/dh_imx6/dh_imx6.c | 10 ++++++++++ configs/dh_imx6_defconfig | 1 + 2 files changed, 11 insertions(+) diff --git a/board/dhelectronics/dh_imx6/dh_imx6.c b/board/dhelectronics/dh_imx6/dh_imx6.c index f9ac5c10e1..44f4ef8130 100644 --- a/board/dhelectronics/dh_imx6/dh_imx6.c +++ b/board/dhelectronics/dh_imx6/dh_imx6.c @@ -167,6 +167,9 @@ int board_eth_init(bd_t *bis) struct mii_dev *bus = NULL; struct phy_device *phydev = NULL; + gpio_request(IMX_GPIO_NR(5, 0), "PHY-reset"); + gpio_request(IMX_GPIO_NR(1, 7), "VIO"); + setup_fec_clock(); eth_phy_reset(); @@ -224,6 +227,8 @@ int board_mmc_init(bd_t *bis) * mmc1 micro SD * mmc2 eMMC */ + gpio_request(USDHC2_CD_GPIO, "SD2-CD"); + gpio_request(USDHC3_CD_GPIO, "SD3-CD"); gpio_direction_input(USDHC2_CD_GPIO); gpio_direction_input(USDHC3_CD_GPIO); @@ -244,6 +249,7 @@ int board_mmc_init(bd_t *bis) #ifdef CONFIG_USB_EHCI_MX6 static void setup_usb(void) { + gpio_request(IMX_GPIO_NR(3, 31), "USB-VBUS"); /* * Set daisy chain for otg_pin_id on MX6Q. * For MX6DL, this bit is reserved. @@ -379,6 +385,10 @@ static int board_get_hwcode(void) { int hw_code; + gpio_request(HW_CODE_BIT_0, "HW-code-bit-0"); + gpio_request(HW_CODE_BIT_1, "HW-code-bit-1"); + gpio_request(HW_CODE_BIT_2, "HW-code-bit-2"); + gpio_direction_input(HW_CODE_BIT_0); gpio_direction_input(HW_CODE_BIT_1); gpio_direction_input(HW_CODE_BIT_2); diff --git a/configs/dh_imx6_defconfig b/configs/dh_imx6_defconfig index 8692870737..2443156b87 100644 --- a/configs/dh_imx6_defconfig +++ b/configs/dh_imx6_defconfig @@ -10,6 +10,7 @@ CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_NR_DRAM_BANKS=1 CONFIG_SPL=y CONFIG_SYS_BOOTCOUNT_ADDR=0x00900000 +CONFIG_DM_GPIO=y CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y CONFIG_DISTRO_DEFAULTS=y -- 2.39.5