[U-Boot] Question: booting Linux from ext4 mmc partition

nidalpres nidalpres at gmail.com
Tue Jan 7 23:45:58 CET 2014


In this e-mail you can find a session with latest (from a day ago or
so) u-boot from git on mx23-olinuxino.

On boot I can access partition 3 on mmc card (ext4) and load files
(/boot/uEnv.txt) off of it into memory.
However, once I try to load zImage (4MB in size) error appears and
after that you can't do anything with mmc.

To get back on feet you have to do "mmc rescan", access is restored,
but still loading zImage messes things up.

It may be a bug or just a build misconfiguration, I really don't know,
but I am hoping this might help you if it is a bug.

Regards,
Nidal.


Here is the full session (longest lines are cut, minicom terminal was
just that much wide :)

------------------ session start
----------------------------------------------------------------------------------------------

HTLCLC

U-Boot 2014.01-rc2-00028-gfef24f4-dirty (Jan 06 2014 - 10:31:34)

CPU:   Freescale i.MX23 rev1.4 at 454 MHz
BOOT:  SSP SD/MMC #0
DRAM:  64 MiB
MMC:   MXS MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   Net Initialization Skipped
No ethernet found.
Hit any key to stop autoboot:  0
=> version

U-Boot 2014.01-rc2-00028-gfef24f4-dirty (Jan 06 2014 - 10:31:34)
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.7.4
20130913 (release) [ARM/embedded-4_7-branch revi]
GNU ld (GNU Tools for ARM Embedded Processors) 2.22.0.20130913
=> env print
baudrate=115200
boot_fdt=try
bootcmd=mmc dev ${mmcdev};if mmc rescan; then echo SD/MMC found on
device ${mmcdev};if run loadbootenv; then run;
bootdelay=1
bootfile=uImage
bootscript=echo Running bootscript from mmc ...; source
console=ttyAMA0
fdt_addr=0x41000000
fdt_file=/dtbs/imx23-olinuxino.dtb
importbootenv=echo Importing environment from mmc (uenv.txt)...; env
import -t ${loadaddr} ${filesize}
ip_dyn=yes
loadaddr=0x42000000
loadbootenv=load mmc ${mmcdev}:${mmcpart} ${loadaddr} /uenv.txt
loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};
loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}
loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}
loadzimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} /zimage
mmcargs=setenv bootargs console=${console},${baudrate} ${optargs}
root=${mmcroot} rootfstype=${mmcrootfstype} vi}
mmcboot=echo Booting from mmc ...; run mmcargs; bootz ${loadaddr} - ${fdt_addr}
mmcdefault=echo Booting from mmc ...; run mmcargs; if test ${boot_fdt}
= yes || test ${boot_fdt} = try; then if ;
mmcdev=0
mmcpart=2
mmcroot=/dev/mmcblk0p2 ro
mmcrootfstype=vfat rootwait fixrtc
netargs=setenv bootargs console=${console},${baudrate} root=/dev/nfs
ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tp
netboot=echo Booting from net ...; usb start; run netargs; if test
${ip_dyn} = yes; then setenv get_cmd dhcp; el;
script=boot.scr
stderr=serial
stdin=serial
stdout=serial
uimage=uImage
update_sd_firmware=if mmc rescan ; then if tftp
${update_sd_firmware_filename} ; then setexpr fw_sz ${filesize} i
update_sd_firmware_filename=u-boot.sd
ver=U-Boot 2014.01-rc2-00028-gfef24f4-dirty (Jan 06 2014 - 10:31:34)

Environment size: 2451/16380 bytes
=> ls mmc 0:3 /boot
<DIR>       4096 .
<DIR>       4096 ..
             221 uEnv.txt
         4039976 zImage
<DIR>       4096 dtbs
<DIR>       4096 uboot
=> load mmc 0:3 ${loadaddr} /boot/uEnv.txt
221 bytes read in 141 ms (1000 Bytes/s)
=> md ${loadaddr}
42000000: 65685423 61206573 74206572 64206568    #These are the d
42000010: 75616665 7320746c 69747465 2073676e    efault settings
42000020: 20726f66 656d6f73 65737520 206c7566    for some useful
42000030: 6f622d75 7620746f 61697261 73656c62    u-boot variables
42000040: 66230a3a 665f7464 3d656c69 6f6f622f    :.#fdt_file=/boo
42000050: 74642f74 692f7362 3332786d 696c6f2d    t/dtbs/imx23-oli
42000060: 6978756e 642e6f6e 200a6274 706f230a    nuxino.dtb. .#op
42000070: 67726174 6f0a3d73 72617470 713d7367    targs=.optargs=q
42000080: 74656975 696e6920 6c2f3d74 732f6269    uiet init=/lib/s
42000090: 65747379 732f646d 65747379 6d0a646d    ystemd/systemd.m
420000a0: 6f72636d 2f3d746f 2f766564 62636d6d    mcroot=/dev/mmcb
420000b0: 70306b6c 6f722033 636d6d0a 746f6f72    lk0p3 ro.mmcroot
420000c0: 79747366 653d6570 20347478 746f6f72    fstype=ext4 root
420000d0: 74696177 78696620 0a637472 e15a000a    wait fixrtc...Z.
420000e0: 9a000013 e28aaa02 e3caa0ff e24f5064    ............dPO.
420000f0: e3c5501f e0469001 e289901f e3c9901f    .P....F.........
=> ls mmc 0:3 /boot
<DIR>       4096 .
<DIR>       4096 ..
             221 uEnv.txt
         4039976 zImage
<DIR>       4096 dtbs
<DIR>       4096 uboot
=> load mmc 0:3 ${loadaddr} /boot/zImage
MMC0: Data error with command 18 (status 0xf0302020)!
 ** ext4fs_devread read error - block
=> ls mmc 0:3 /boot
MMC0: Command 16 timeout (status 0xf0204020)
** Can't read partition table on 0:0 **
** Invalid partition 3 **
=> md ${loadaddr}
42000000: e1a00000 e1a00000 e1a00000 e1a00000    ................
42000010: e1a00000 e1a00000 e1a00000 e1a00000    ................
42000020: ea000002 016f2818 00000000 003da528    .....(o.....(.=.
42000030: e10f9000 e1a07001 e1a08002 e10f2000    .....p....... ..
42000040: e3120003 1a000001 e3a00017 ef123456    ............V4..
42000050: e321f0d3 e16ff009 00000000 00000000    ..!...o.........
42000060: e1a0400f e204433e e2844902 e1a0000f    . at ..>C...I......
42000070: e1500004 359f0168 3080000f 31540000    ..P.h..5...0..T1
42000080: 33844001 2b00005d e28f0f4d e8901c4e    . at .3]..+M...N...
42000090: e590d01c e0400001 e0866000 e08aa000    ...... at ..`......
420000a0: e5da9000 e5dae001 e189940e e5dae002    ................
420000b0: e5daa003 e189980e e1899c0a e08dd000    ................
420000c0: e28da801 e3a05000 e28aa901 e154000a    .....P........T.
420000d0: 2a000017 e084a009 e28f9054 e15a0009    ...*....T.....Z.
420000e0: 9a000013 e28aab02 e3caa0ff e24f506c    ............lPO.
420000f0: e3c5501f e0469005 e289901f e3c9901f    .P....F.........
=> mmc rescan
=> ls mmc 0:3 /boot
<DIR>       4096 .
<DIR>       4096 ..
             221 uEnv.txt
         4039976 zImage
<DIR>       4096 dtbs
<DIR>       4096 uboot
=> load mmc 0:3 ${loadaddr} /boot/uEnv.txt
221 bytes read in 142 ms (1000 Bytes/s)
=> md ${loadaddr}
42000000: 65685423 61206573 74206572 64206568    #These are the d
42000010: 75616665 7320746c 69747465 2073676e    efault settings
42000020: 20726f66 656d6f73 65737520 206c7566    for some useful
42000030: 6f622d75 7620746f 61697261 73656c62    u-boot variables
42000040: 66230a3a 665f7464 3d656c69 6f6f622f    :.#fdt_file=/boo
42000050: 74642f74 692f7362 3332786d 696c6f2d    t/dtbs/imx23-oli
42000060: 6978756e 642e6f6e 200a6274 706f230a    nuxino.dtb. .#op
42000070: 67726174 6f0a3d73 72617470 713d7367    targs=.optargs=q
42000080: 74656975 696e6920 6c2f3d74 732f6269    uiet init=/lib/s
42000090: 65747379 732f646d 65747379 6d0a646d    ystemd/systemd.m
420000a0: 6f72636d 2f3d746f 2f766564 62636d6d    mcroot=/dev/mmcb
420000b0: 70306b6c 6f722033 636d6d0a 746f6f72    lk0p3 ro.mmcroot
420000c0: 79747366 653d6570 20347478 746f6f72    fstype=ext4 root
420000d0: 74696177 78696620 0a637472 e15a000a    wait fixrtc...Z.
420000e0: 9a000013 e28aab02 e3caa0ff e24f506c    ............lPO.
420000f0: e3c5501f e0469005 e289901f e3c9901f    .P....F.........
=> bdinfo
arch_number = 0x00001009
boot_params = 0x40000100
DRAM bank   = 0x00000000
-> start    = 0x40000000
-> size     = 0x04000000
current eth = unknown
ip_addr     = <NULL>
baudrate    = 115200 bps
TLB addr    = 0x43FF0000
relocaddr   = 0x43F6F000
reloc off   = 0x03F6EF00
irq_sp      = 0x43B6AF40
sp start    = 0x43B6AF30

----------------------- session end
-----------------------------------------------------------------------------------------





On Tue, Jan 7, 2014 at 7:58 AM, Robert Nelson <robertcnelson at gmail.com> wrote:
> On Mon, Jan 6, 2014 at 8:56 AM, nidalpres <nidalpres at gmail.com> wrote:
>> Hi all!
>>
>> I was following instructions from
>> http://eewiki.net/display/linuxonarm/iMX233-OLinuXino in order to get
>> mainline kernel to boot off of my olinuxino micro board.
>>
>> I have created two partitions on my SD card:
>>    Device Boot      Start         End      Blocks   Id  System
>> /dev/sde1            2048       67583       32768   53  OnTrack DM6 Aux3
>> /dev/sde2           67584     7829503     3880960   83  Linux
>>
>> and installed everything as per instructions. However on boot this is
>> what I get on console:
>> HTLLCLC
>>
>> U-Boot 2013.10-dirty (Jan 05 2014 - 19:38:28)
>>
>> CPU:   Freescale i.MX23 rev1.4 at 454 MHz
>> BOOT:  SSP SD/MMC #0
>> DRAM:  64 MiB
>> MMC:   MXS MMC: 0
>> *** Warning - bad CRC, using default environment
>>
>> In:    serial
>> Out:   serial
>> Err:   serial
>> Net:   Net Initialization Skipped
>> No ethernet found.
>> Hit any key to stop autoboot:  0
>> mmc0 is current device
>> SD/MMC found on device 0
>> 221 bytes read in 149 ms (1000 Bytes/s)
>> Importing environment from mmc (uEnv.txt)...
>> Checking if uenvcmd is set ...
>> Running default loadzimage ...
>> MMC0: Data error with command 18 (status 0xf0302020)!
>>  ** ext4fs_devread read error - block
>> =>
>>
>>
>> I couldn't find anywhere what "ext4fs_devread read error - block"
>> means. Found message origin in ext4fs_devread() function in u-boot
>> source after some time but I really can't get my head around on what
>> it means just by reading code. I suspect it doesn't like block sizes
>> or something, not sure.
>>
>> So I changed second partition to ext2 (instead of ext4) an changed env
>> parameters to instruct uboot that it is ext2 partition, nothing
>> changed.
>>
>> Then I changed source header file include/configs/mx23_olinuxino.h and
>> removed #define CONFIG_CMD_EXT4 from it hoping it will remove ext4
>> support. I also changed hardcoded env parameters in same file from
>> mmcrootfstype=ext4 to mmcrootfstype=ext2.
>> Recompiled u-boot, dd it to sd card, rinse and repeat, got exactly the
>> same response on console you see above.
>>
>> I give up for today after 3 hours of battling with it.
>>
>> I plan to make 3 partitions: amtrak, vfat (for kernel) and ext4 (for
>> rootfs). But if ext4fs_devread persists to complain (and I apparently
>> haven't removed it from code) I don't think it would work either.
>>
>> What is going on?
>> Can anyone give me some pointers what to do next?
>
> Just for sanity sake, have you tried try a different (brand) microSD card?
>
> Regards,
>
> --
> Robert Nelson
> http://www.rcn-ee.com/


More information about the U-Boot mailing list