[U-Boot] [UBOOT PATCH v2 2/2] arm64: zynqmp: mmc: Added Kconfig support for CONFIG_ZYNQ_SDHCI1
Michal Simek
michal.simek at xilinx.com
Fri Mar 2 09:18:01 UTC 2018
On 2.3.2018 10:01, Jaehoon Chung wrote:
> On 03/02/2018 04:44 PM, Michal Simek wrote:
>> On 2.3.2018 07:27, Jaehoon Chung wrote:
>>> On 03/02/2018 12:13 AM, Michal Simek wrote:
>>>> On 28.2.2018 08:42, Jaehoon Chung wrote:
>>>>> Hi,
>>>>>
>>>>> On 02/28/2018 03:28 PM, Vipul Kumar wrote:
>>>>>> This patch added Kconfig support for CONFIG_ZYNQ_SDHCI1 and
>>>>>> enabled it in defconfig.
>>>>>
>>>>> I think that CONFIG_ZYNQ_SDHCI1 is meaningful when CONFIG_ZYNQ_SDHCI0 is enabled.
>>>>> It's used in zynqmp.c and spl.c ..like below..
>>>>>
>>>>> #if defined(CONFIG_ZYNQ_SDHCI0) && defined(CONFIG_ZYNQ_SDHCI1)
>>>>> ....
>>>>> #endif
>>>>>
>>>>> If CONFIG_ZYNQ_SDHCI0 isn't enabled, doesn't it need to set CONFIG_ZYNQ_SDHCI1 in defconfigs.
>>>>>
>>>>> If i missed something, let me know, plz.
>>>>
>>>> you are right. Dependency should be
>>>>
>>>> config ZYNQ_SDHCI1
>>>> ...
>>>> depends on ZYNQ_SDHCI0
>>>
>>> Hmm. I didn't check fully, but it seems that it's possible to use only one config.
>>> I will check in more detail. After that, resend the email. :)
>>
>> I can't also see any issue with using just one symbol with proper name.
>
> Maybe you know more than me about zynq boards.
> In SPL, it seems that it needs to add some config in spl.c for distinguishing boot device.
> But in not SPL, if zynq boards are supported the device-tree, then can you use the below concept?
>
> commit 02ad33aa3a84821c8d9a6c4f167f143f6248b084
> Author: Jaehoon Chung <jh80.chung at samsung.com>
> Date: Thu Feb 2 13:41:14 2017 +0900
>
> mmc: mmc-uclass: use the fixed devnum with alias node
>
> If there are alias nodes as "mmc", use the devnum as alias index
> number.
> This patch is for fixing a problem of Exynos4 series.
> Problem is the below thing.
>
> Current legacy mode:
> EXYNOS DWMMC: 0, SAMSUNG SDHCI: 1
>
> After using DM:
> SAMSUNG SDHCI: 0, EXYNOS DWMMC: 1
>
> Dev index is swapped.
> Then u-boot can't find the kernel image..because it is already set to 0 as mmcdev.
> If change from legacy to DM, also needs to touch all exynos4 config file.
> For using simply, just supporting the fixed devnum with alias node is better than it.
>
> Usage:
> alaise {
> ....
> mmc0 = &sdhci2; /* eMMC */
> mmc1 = &sdhci1; /* SD */
> ...
> }
>
Chips are supporting booting from SD0 or SD1 controller.
#define SD_MODE 0x00000003 /* sd 0 */
#define SD_MODE1 0x00000005 /* sd 1 */
#define EMMC_MODE 0x00000006
#define SD1_LSHFT_MODE 0x0000000E /* SD1 Level shifter */
It means on systems which has only sd0 or sd1 we are setting up alias as
mmc0 = &sdhci0; (sd0)
or
mmc0 = &sdhci1; (sd1)
It means dev 0 is used all the time.
In case of system with both controllers on the same board you need to
have two aliases. Normally like this.
mmc0 = &sdhci0; (sd0)
mmc1 = &sdhci1; (sd1)
In case you choose to boot from sd1 default behavior should be that all
images are on sd1 that's why boot device needs to be setup.
When you load the same u-boot to sd0 it should boot from sd0.
Changing aliases for certain boot mode configuration should just work
but that's not intention. Normally the same boot files can be loaded to
sd, qspi, nand, jtag, you setup boot mode and they should primary boot
from that boot device and that's what that logic is about.
Thanks,
Michal
More information about the U-Boot
mailing list