ARM: imx: dh-imx6: Enable DM GPIO
authorMarek Vasut <marex@denx.de>
Fri, 17 May 2019 14:58:50 +0000 (16:58 +0200)
committerStefano Babic <sbabic@denx.de>
Tue, 11 Jun 2019 08:42:48 +0000 (10:42 +0200)
Enable DM GPIO support on DHCOM iMX6 PDK2 and fix up board code
where applicable.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Ludwig Zenz <lzenz@dh-electronics.com>
Cc: Stefano Babic <sbabic@denx.de>
board/dhelectronics/dh_imx6/dh_imx6.c
configs/dh_imx6_defconfig

index f9ac5c10e1dc954b64605a1c4f84a6c819d183a7..44f4ef813080bee06171cbf5fce5689333bab3bc 100644 (file)
@@ -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);
index 86928707376079be378b7baac2d39e701563a643..2443156b87fe26a1d1b4a7a07937022fc83d3f04 100644 (file)
@@ -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