[U-Boot] [PATCH 2/2] imx: mx6slevk: Add support for USDHC1 and USDHC3 slots

Fabio Estevam festevam at gmail.com
Mon Oct 13 17:34:09 CEST 2014


On Mon, Oct 13, 2014 at 4:51 AM, Ye.Li <B37916 at freescale.com> wrote:

>  int board_mmc_init(bd_t *bis)
>  {
> -       imx_iomux_v3_setup_multiple_pads(usdhc2_pads, ARRAY_SIZE(usdhc2_pads));
> +       int i;
> +
> +       /*
> +        * According to the board_mmc_init() the following map is done:
> +        * (U-boot device node)    (Physical Port)
> +        * mmc0                    USDHC1
> +        * mmc1                    USDHC2
> +        * mmc2                    USDHC3
> +        */
> +       for (i = 0; i < CONFIG_SYS_FSL_USDHC_NUM; i++) {
> +               switch (i) {
> +               case 0:
> +                       imx_iomux_v3_setup_multiple_pads(
> +                               usdhc1_pads, ARRAY_SIZE(usdhc1_pads));
> +                       gpio_direction_input(USDHC1_CD_GPIO);
> +                       usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
> +                       break;
> +               case 1:
> +                       imx_iomux_v3_setup_multiple_pads(
> +                               usdhc2_pads, ARRAY_SIZE(usdhc2_pads));
> +                       gpio_direction_input(USDHC2_CD_GPIO);
> +                       usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
> +                       break;
> +               case 2:
> +                       imx_iomux_v3_setup_multiple_pads(
> +                               usdhc3_pads, ARRAY_SIZE(usdhc3_pads));
> +                       gpio_direction_input(USDHC3_CD_GPIO);
> +                       usdhc_cfg[2].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
> +                       break;
> +               default:
> +                       printf("Warning: you configured more USDHC controllers"
> +                               "(%d) than supported by the board\n", i + 1);
> +                       return 0;

No, you should 'return -EINVAL' here.

> +                       }
> +
> +                       if (fsl_esdhc_initialize(bis, &usdhc_cfg[i]))
> +                               printf("Warning: failed to initialize mmc dev %d\n", i);
> +       }

ret = fsl_esdhc_initialize(bis, &usdhc_cfg[i])
if (ret) {
   printf("Warning: failed to initialize mmc dev %d\n", i);
   return ret;
}


More information about the U-Boot mailing list