Booting from SD-Card on efusA7Ul-V1 module

  • Hi everyone,


    I have efusA7Ul-V1-Lin module which supports 2 sd-cards. I can very well boot my image from Macro-sdcard but not from Micro sd-card. I do the following:


    1- I change only 3 u-boot environment variables to boot from Macro sd-card as follows:


    Code
    1. setenv kernel ${.kernel_mmc}
    2. setenv fdt ${.fdt_mmc}
    3. setenv rootfs ${.rootfs_mmc}
    4. saveenv

    doing so is not enough to get the image to boot from (Macro sd-card slot). I have to change "rootfs" after performing the steps above from "root=/dev/mmcblk0p2 rootwait" to "root=/dev/mmcblk1p2 rootwait", I must change "rootfs" to


    Code
    1. setenv rootfs 'root=/dev/mmcblk1p2 rootwait'
    2. saveenv

    When kernel boots, I can see that Macro sd-card is read as slot 1 on the development board.


    Code
    1. This line is from kernel logs--->
    2. mmcblk1: mmc1:1234 SA04G 3.63 GiB
    3. mmcblk1: p1 p2 p3 p4

    Till now it is ok. If I insert the sd-card in (Micro sd-card slot) on the development board and try to perform the same trick as in step 1 above, the image does not boot at all.


    is slot 0 meant for Micro sd-card?


    Please any idea how can I get an image written on an sd-card to boot from Micro sd-card on the efus-development board ? what needs to be correctly changed in u-boot environment variables or do i have to recompile the kernel image to enable the recognition of 2 sd-cards?


    Thanks alot.

    Ahmed

  • I did the following simple test.


    * Connect sd-card in Micro-slot on the development card. When checking the active slot on u-boot console

    Code
    1. mmc dev 0
    2. --> Card did not respond to voltage select!
    3. mmc dev 1
    4. --> switch to partitions #0, OK
    5. mmc1 is current device


    * Connect sd-card in Macro-slot on the development board. Then checking the active slot on u-boot console


    Code
    1. mmc dev 0
    2. --> No thing is showed on the console
    3. mmc dev 1
    4. --> MMC: no card present


    Please can you confirm if this is correct ?


    Thanks

    Ahmed

  • Dear Ahmed,


    in U-Boot the normal sized SD-Card is mmc dev 0. The µSD-Card is mmc dev 1.


    To read the SD-Card in U-Boot you can use the following commands:


    normal sized SD-Card:

    • put in SD-Card
    • command: mmc rescan
    • command: mmc dev 0
    • command: ls mmc 0


    µSD-Card:

    • put in µSD-Card
    • command: mmc rescan
    • command: mmc dev 1
    • command: ls mmc 1


    If you want to boot the rootfs from SD-Card then you have to modify the device-tree. By default the WLAN and EMMC is enabled so no SD-Card Slots are available in Linux. V1 of efusA7UL don´t have WLAN and EMMC.


    1. Navigate to your linux kernel folder
    2. Open file arch/arm/boot/dts/efusa7ul.dts
    3. Comment out the line "#define CONFIG_EFUSA7UL_EMMC" and "#define CONFIG_EFUSA7UL_WLAN" now it should be look like this "//#define CONFIG_EFUSA7UL_EMMC" and "//#define CONFIG_EFUSA7UL_WLAN"
    4. Recompile the device-tree and install it on your board
    5. After that save the rootfs on your SD-Card
    6. Then put in the SD-Card and go to U-Boot
    7. Now you can call "run .rootfs_mmc", mmcblk0 => µSD-Card and mmcblk1 => SD-Card. Maybe you have to modify the variable rootfs for the correct mmcblk device
    8. Boot the system


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Just an additional hint:


    MMC slots may be numbered differently in U-Boot and Linux. In U-Boot they are numbered in the sequence of initialization. We always start with the normal sized SD slot, then the Micro-SD slot and finally the eMMC. The intention is that the update and install scripts will look at mmc 0 by default, so this port is the port that is used for updates if you do not configure something else. And installation is done the easiest from a normal sized SD card, or from Micro-SD slot if there is no normal sized slot. On the other hand a non-removable eMMC is most probably not meaningful for a first time software installation in your production. This is why we add it as last device.


    Of course IDs can be differently if a slot type does not exist. So if an efusA7UL has WLAN and eMMC, then no regular SD card port is available. Then eMMC is actually mmc 0 in U-Boot. So in U-Boot the devices are always numbered starting with 0 without any gap.


    In Linux, the ports are named after the hardware index of the unit. On i.MX6, this is actually one less than the hardware number because hardware numbers start with 1 but Linux mmc device numbers start with 0. So if the slot is handled by MMC hardware port 3 of the i.MX6, then it will get the Linux device name mmcblk2. The initialization sequence does not matter and it will get this number even if there is no mmcblk0 and no mmcblk1.


    So you have to take care that you use the right number (device ID) in U-Boot and Linux, and, as I said, these numbers may differ.


    If you do not want this naming scheme in Linux, you can change this in the device tree by modifying the device aliases.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

    Edited 3 times, last by fs-support_HK ().