[U-Boot] [PATCH] powerpc/esdhc: force the bus width to 4bit
Jaehoon Chung
jh80.chung at samsung.com
Wed Oct 31 11:43:24 CET 2012
Hi Lukasz,
width = ((mmc->host_caps & MMC_MODE_MASK_WIDTH_BITS) >>
MMC_MODE_WIDTH_BITS_SHIFT);
This code has the problem. If width is set to 0x3,
then BUS_WIDTH field of ext_csd register is set to 0x3.
Value 0x3 is nothing.(It's reserved)
If we want to set 4-bit, then that value is set to 0x2.
This problem need to fix.
I will send the patch for this problem.
Best Regards,
Jaehoon Chung
On 10/31/2012 05:20 PM, Lukasz Majewski wrote:
> Hi Jaehoon,
>
>> Hi, Lukasz,
>>>>>>>> For the current u-boot codes, only 4bit/1bit SD/SDHC bus width
>>>>>>>> is
>>>>>>>
>>>>>>> support.
>>>>>>>
>>>>>>>> So for MMC card, we also support 4bit bus width, otherwiase, we
>>>>>>>> will
>>>>>>>
>>>>>>>> get the 12bit bus width, which is not correct:
>>>>>>> Andy ... can you please explain? I don't quite understand the
>>>>>>> problem, I thought we had no problem supporting 8bit mmc (esp.
>>>>>>> if the controller handles that for us mostly).
>>>>>>
>>>>>> Yes, the controller support 8bit MMC.
>>>>>>
>>>>>> FSL ESDHC driver set the host_caps = MMC_MODE_4BIT |
>>>>>> MMC_MODE_8BIT; But, the current codes for MMC card has been
>>>>>> changed to:
>>>>>>
>>>>>> } else {
>>>>>> width = ((mmc->host_caps & MMC_MODE_MASK_WIDTH_BITS) >>
>>>>>> MMC_MODE_WIDTH_BITS_SHIFT);
>>>
>>> Hmm... looks like it is code done by me :-)
>>> So little explanation shall be given.
>>>
>>> This code is necessary for some targets (like Samsung's Goni) which
>>> can only support 4 bit MMC mode.
>>>
>>>>>> for (; width >= 0; width--) {
>>>>>> ....
>>>>>>
>>>>>> So for FSL ESDHC, the width = 3, after implement mmc_switch
>>>>>> successfully, will set the bus to 4 * width. Therefore, I will
>>>>>> get the 12bit (4 x 3) bus width.
>>>> This problem is MMC subsystem's bug.
>>>> I think good that will modify the code in mmc.c.
>>>> If caps is set to MMC_MODE_4BIT | MMC_MODE_8BIT,
>>>> we can see the 12bit support with using "mmcinfo" command
>>>>
>>>
>>> The mmc_set_bus_width(mmc, 4 * width) in conjunction to above code
>>> causes the problem.
>> then how about using the width[idx] like kernel?
>
> I don't mind :-) if it works at kernel.
>
>>
>> Best Regards,
>> Jaehoon Chung
>>>
>>> I agree, that this code shall be refactored.
>>> Lei, what do you think?
>>>
>>>
>>>> Best Regards,
>>>> Jaehoon Chung
>>>>
>>>>>>
>>>>>> Below is the old codes (width = 2):
>>>>>> } else {
>>>>>> for (width = EXT_CSD_BUS_WIDTH_8; width >= 0;
>>>>>> width--) {
>>>>> [...]
>>>>>
>>>>>
>>>>> Uh, so it's a bug in the MMC subsystem?
>>>>> Best regards,
>>>>> Marek Vasut
>>>>> _______________________________________________
>>>>> U-Boot mailing list
>>>>> U-Boot at lists.denx.de
>>>>> http://lists.denx.de/mailman/listinfo/u-boot
>>>>>
>>>>
>>>> _______________________________________________
>>>> 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