[U-Boot] [PATCH 4/6 v2] arm:exynos4:trats: Use pinmux for mmc configuration

Jaehoon Chung jh80.chung at samsung.com
Fri Aug 24 10:19:54 CEST 2012


Hi Piotr,

>>> -	for (i = 0; i < 7; i++) {
>>> -		if (i == 2)
>>> -			continue;
>>> -		/* GPK0[0:6] special function 2 */
>>> -		s5p_gpio_cfg_pin(&gpio->k0, i, 0x2);
>>> -		/* GPK0[0:6] pull disable */
>>> -		s5p_gpio_set_pull(&gpio->k0, i, GPIO_PULL_NONE);
>>> -		/* GPK0[0:6] drv 4x */
>>> -		s5p_gpio_set_drv(&gpio->k0, i, GPIO_DRV_4X);
>>> -	}
>>> -
>>> -	for (i = 3; i < 7; i++) {
>>> -		/* GPK1[3:6] special function 3 */
>>> -		s5p_gpio_cfg_pin(&gpio->k1, i, 0x3);
>>> -		/* GPK1[3:6] pull disable */
>>> -		s5p_gpio_set_pull(&gpio->k1, i, GPIO_PULL_NONE);
>>> -		/* GPK1[3:6] drv 4x */
>>> -		s5p_gpio_set_drv(&gpio->k1, i, GPIO_DRV_4X);
>>> +	err = exynos_pinmux_config(PERIPH_ID_SDMMC0,
>> PINMUX_FLAG_8BIT_MODE);
>>> +	if (err) {
>>> +		debug("SDMMC0 not configured\n");
>>> +		return err;
>>>  	}
>> if err, return? then how can sd-card init?
>> SD/eMMC card didn't have the dependency.
> exynos_pinmux_config() returns err only if given peripheral and/or mode (or
> cpu) are not supported. Then gpio pins are not configured and MMC cannot be
> initiated. Err is returned to indicate this situation and it is essential to
> init MMC0 correctly.
> The dependency didn't exist in trats nor universal but exists when pinmux is
> used ex: smdk5250 board.
You're Right. it returned error, as you mentioned.
But if eMMC init is failed, could you ensure that sd init is also failed?
I didn't think so.
Although eMMC card init is failed, i think that sd-card init should be succeed.
1) eMMC init failed -> return error. : this is your code.
2) eMMC init failed -> if SD card detect, then try to init SD-card.
: this is my opinion.

If my thinking is wrong, plz let me know.

Best Regards,
Jaehoon Chung
> 
> Best regards
> Piotr Wilczek
> 
>>
>> Best Regards,
>> Jaehoon Chung
>>>
>>>  	/*
>>> @@ -198,23 +169,12 @@ int board_mmc_init(bd_t *bis)
>>>  	 * GPX3[4] T-flash detect pin
>>>  	 */
>>>  	if (!s5p_gpio_get_value(&gpio->x3, 4)) {
>>> -		/*
>>> -		 * SD card GPIO:
>>> -		 * GPK2[0]	SD_2_CLK(2)
>>> -		 * GPK2[1]	SD_2_CMD(2)
>>> -		 * GPK2[2]	SD_2_CDn	-> Not used
>>> -		 * GPK2[3:6]	SD_2_DATA[0:3](2)
>>> -		 */
>>> -		for (i = 0; i < 7; i++) {
>>> -			if (i == 2)
>>> -				continue;
>>> -			/* GPK2[0:6] special function 2 */
>>> -			s5p_gpio_cfg_pin(&gpio->k2, i, 0x2);
>>> -			/* GPK2[0:6] pull disable */
>>> -			s5p_gpio_set_pull(&gpio->k2, i, GPIO_PULL_NONE);
>>> -			/* GPK2[0:6] drv 4x */
>>> -			s5p_gpio_set_drv(&gpio->k2, i, GPIO_DRV_4X);
>>> +		err = exynos_pinmux_config(PERIPH_ID_SDMMC2,
>> PINMUX_FLAG_NONE);
>>> +		if (err) {
>>> +			debug("SDMMC2 not configured\n");
>>> +			return err;
>>>  		}
>>> +
>>>  		err = s5p_mmc_init(2, 4);
>>>  	}
>>>
>>>
> 
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
> 



More information about the U-Boot mailing list