[U-Boot] [PATCH v2 14/22] mx6sabresd: Add DM_GPIO support

Peng Fan peng.fan at nxp.com
Tue Jan 29 13:40:42 UTC 2019



> -----Original Message-----
> From: Abel Vesa
> Sent: 2019年1月29日 19:35
> To: Tom Rini <trini at konsulko.com>; Fabio Estevam
> <fabio.estevam at nxp.com>; u-boot at lists.denx.de; dl-uboot-imx
> <uboot-imx at nxp.com>; Peng Fan <peng.fan at nxp.com>
> Cc: Nitin Garg <nitin.garg at nxp.com>; Abel Vesa <abel.vesa at nxp.com>
> Subject: [PATCH v2 14/22] mx6sabresd: Add DM_GPIO support
> 
> Add the DM_GPIO related config for mx6sabresd.
> Also add the gpio request calls.
> 
> Signed-off-by: Abel Vesa <abel.vesa at nxp.com>
> ---
>  board/freescale/mx6sabresd/mx6sabresd.c | 5 +++++
>  configs/mx6sabresd_defconfig            | 1 +
>  2 files changed, 6 insertions(+)
> 
> diff --git a/board/freescale/mx6sabresd/mx6sabresd.c
> b/board/freescale/mx6sabresd/mx6sabresd.c
> index 4688095..99002bd 100644
> --- a/board/freescale/mx6sabresd/mx6sabresd.c
> +++ b/board/freescale/mx6sabresd/mx6sabresd.c
> @@ -96,6 +96,7 @@ static void setup_iomux_enet(void)
>  	SETUP_IOMUX_PADS(enet_pads);
> 
>  	/* Reset AR8031 PHY */
> +	gpio_request(IMX_GPIO_NR(1, 25), "ENET PHY Reset");
>  	gpio_direction_output(IMX_GPIO_NR(1, 25) , 0);
>  	mdelay(10);
>  	gpio_set_value(IMX_GPIO_NR(1, 25), 1); @@ -189,6 +190,7 @@ static
> iomux_v3_cfg_t const bl_pads[] = {  static void enable_backlight(void)  {
>  	SETUP_IOMUX_PADS(bl_pads);
> +	gpio_request(DISP0_PWR_EN, "Display Power Enable");
>  	gpio_direction_output(DISP0_PWR_EN, 1);  }
> 
> @@ -307,11 +309,13 @@ int board_mmc_init(bd_t *bis)
>  		switch (i) {
>  		case 0:
>  			SETUP_IOMUX_PADS(usdhc2_pads);
> +			gpio_request(USDHC2_CD_GPIO, "USDHC2 CD");
>  			gpio_direction_input(USDHC2_CD_GPIO);
>  			usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
>  			break;
>  		case 1:
>  			SETUP_IOMUX_PADS(usdhc3_pads);
> +			gpio_request(USDHC3_CD_GPIO, "USDHC3 CD");
>  			gpio_direction_input(USDHC3_CD_GPIO);
>  			usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
>  			break;
> @@ -729,6 +733,7 @@ int checkboard(void)  #ifdef CONFIG_SPL_OS_BOOT
> int spl_start_uboot(void)  {
> +	gpio_request(KEY_VOL_UP, "KEY Volume UP");
>  	gpio_direction_input(KEY_VOL_UP);
> 
>  	/* Only enter in Falcon mode if KEY_VOL_UP is pressed */ diff --git
> a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig index
> 2b585b2..4f3a619 100644
> --- a/configs/mx6sabresd_defconfig
> +++ b/configs/mx6sabresd_defconfig
> @@ -71,6 +71,7 @@ CONFIG_FASTBOOT_BUF_ADDR=0x12000000
>  CONFIG_FASTBOOT_BUF_SIZE=0x10000000
>  CONFIG_FASTBOOT_FLASH=y
>  CONFIG_FASTBOOT_FLASH_MMC_DEV=2
> +CONFIG_DM_GPIO=y
>  CONFIG_DM_MMC=y
>  CONFIG_FSL_ESDHC=y
>  CONFIG_SPI_FLASH=y

Reviewed-by: Peng Fan <peng.fan at nxp.com>

> --
> 2.7.4



More information about the U-Boot mailing list