[U-Boot] [PATCH 4/8] ARM: imx: dh-imx6: Enable DM GPIO
Marek Vasut
marex at denx.de
Sun May 12 00:57:11 UTC 2019
Enable DM GPIO support on DHCOM iMX6 PDK2 and fix up board code
where applicable.
Signed-off-by: Marek Vasut <marex at denx.de>
Cc: Fabio Estevam <fabio.estevam at nxp.com>
Cc: Ludwig Zenz <lzenz at dh-electronics.com>
Cc: Stefano Babic <sbabic at denx.de>
---
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 e048fb2459..9f6ebde777 100644
--- a/configs/dh_imx6_defconfig
+++ b/configs/dh_imx6_defconfig
@@ -43,6 +43,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_DWC_AHSATA=y
CONFIG_BOOTCOUNT_LIMIT=y
CONFIG_SYS_BOOTCOUNT_ADDR=0x00900000
+CONFIG_DM_GPIO=y
CONFIG_FSL_ESDHC=y
CONFIG_SPI_FLASH=y
CONFIG_SF_DEFAULT_MODE=0
--
2.20.1
More information about the U-Boot
mailing list