Booting from uSDcard is very slow

Post Reply
android_enthusiasts
Posts: 9
Joined: Thu Jan 30, 2020 2:04 pm
languages_spoken: english
ODROIDs: ODROID XU4
Has thanked: 2 times
Been thanked: 0
Contact:

Booting from uSDcard is very slow

Unread post by android_enthusiasts » Mon Feb 03, 2020 11:20 pm

Hi,

My odroid xu4 is taking almost 2 sec for loading u-boot.
Can someone help me to increase the speed of reading bootables from micro SD card.
I am using Sandisk 32GB Class 10 Ultra MicroSD UHS-U1A1 sd card.

User avatar
odroid
Site Admin
Posts: 33268
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 365 times
Been thanked: 445 times
Contact:

Re: Booting from uSDcard is very slow

Unread post by odroid » Tue Feb 04, 2020 9:52 am

Two seconds is much faster than my booting time.
My Ubuntu 18.04 OS on a 8GB eMMC stays over 5 seconds in the u-boot stage.
If I set "bootdelay" to 0 from 1, it may take around 4.x seconds though.

Code: Select all

grabserial -v -d "/dev/ttyUSB0" -b 115200 -w 8 -p N -s 1 -e 30 -t -m "U-Boot"
Opening serial port /dev/ttyUSB0
115200:8N1:xonxoff=0:rtscts=0
Program will end in 30 seconds
Printing timing information for each line
Matching pattern 'U-Boot' to set base time
Use Control-C to stop...
[0.000001 0.000001] 
[0.636939 0.636938] 
[0.637020 0.000081] U-Boot 2017.05-00005-ga917f39c3a (Dec 13 2019 - 06:44:32 -0300) for ODROID-XU4
[0.004644 0.004644] 
[0.004717 0.000073] CPU:   Exynos5422 @ 800 MHz
[0.006380 0.001663] Model: Odroid XU4 based on EXYNOS5422
[0.008679 0.002299] Board: Odroid XU4 based on EXYNOS5422
[0.011059 0.002380] Type:  xu4
[0.011552 0.000493] DRAM:  2 GiB
[0.176512 0.164960] MMC:   EXYNOS DWMMC: 0, EXYNOS DWMMC: 1
[0.287895 0.111383] MMC Device 0 (eMMC): 7.3 GiB
[0.290288 0.002393] Info eMMC rst_n_func status = enabled
[0.300987 0.010699] Card did not respond to voltage select!
[0.303054 0.002067] mmc_init: -95, time 11
[0.314601 0.011547] *** Warning - bad CRC, using default environment
[0.318369 0.003768] 
[0.532547 0.214178] In:    serial
[0.533593 0.001046] Out:   serial
[0.534597 0.001004] Err:   serial
[0.578614 0.044017] Net:   No ethernet found.
[0.611568 0.032954] Press quickly 'Enter' twice to stop autoboot:  0 
[1.588818 0.977250] reading boot.ini
[1.593489 0.004671] 9654 bytes read in 4 ms (2.3 MiB/s)
[1.607665 0.014176] cfgload addr = 0x50000000, Loading boot.ini from FAT
[1.610882 0.003217] cfgload: applying boot.ini...
[1.612277 0.001395] cfgload: setenv initrd_high "0xffffffff"
[1.614204 0.001927] cfgload: setenv fdt_high "0xffffffff"
[1.620260 0.006056] cfgload: setenv macaddr "00:1e:06:61:7a:39"
[1.630793 0.010533] cfgload: setenv vout "hdmi"
[1.638066 0.007273] cfgload: setenv cecenable "false" # false or true
[1.644440 0.006374] cfgload: setenv disable_vu7 "false" # false
[1.649739 0.005299] cfgload: setenv ddr_freq 825
[1.656194 0.006455] cfgload: setenv external_watchdog "false"
[1.663173 0.006979] cfgload: setenv external_watchdog_debounce "3"
[1.669167 0.005994] cfgload: setenv HPD "true"
[1.685094 0.015927] cfgload: setenv bootrootfs "console=tty1 console=ttySAC2,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro fsck.repair=yes net.ifnames=0"
[1.693082 0.007988] cfgload: fatload mmc 0:1 0x40008000 zImage
[1.695889 0.002807] reading zImage
[1.844284 0.148395] 5694304 bytes read in 149 ms (36.4 MiB/s)
[1.847725 0.003441] cfgload: fatload mmc 0:1 0x42000000 uInitrd
[1.849736 0.002011] reading uInitrd
[2.160969 0.311233] 12384022 bytes read in 321 ms (36.8 MiB/s)
[2.162706 0.001737] cfgload: setenv fdtloaded "false"
[2.170008 0.007302] cfgload: if test "x${board_name}" = "x"; then setenv board_name "xu4"; fi
[2.181717 0.011709] cfgload: if test "${board_name}" = "xu4"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu4.dtb; setenv fdtloaded "true"; fi
[2.187106 0.005389] reading exynos5422-odroidxu4.dtb
[2.205533 0.018427] 63484 bytes read in 8 ms (7.6 MiB/s)
[2.207186 0.001653] cfgload: if test "${board_name}" = "xu3"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu3.dtb; setenv fdtloaded "true"; fi
[2.218350 0.011164] cfgload: if test "${board_name}" = "xu3l"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu3-lite.dtb; setenv fdtloaded "true"; fi
[2.230650 0.012300] cfgload: if test "${fdtloaded}" = "false"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu4.dtb; setenv fdtloaded "true"; fi
[2.236070 0.005420] cfgload: fdt addr 0x44000000
[2.241844 0.005774] cfgload: setenv hdmi_phy_control "HPD=${HPD} vout=${vout}"
[2.252230 0.010386] cfgload: if test "${cecenable}" = "false"; then fdt rm /soc/cec@101B0000; fi
[2.294112 0.041882] cfgload: if test "${disable_vu7}" = "false"; then setenv hid_quirks "usbhid.quirks=0x0eef:0x0005:0x0004"; fi
[2.314574 0.020462] cfgload: if test "${external_watchdog}" = "true"; then setenv external_watchdog "external_watchdog=${external_watchdog} external_watchdog_debounce=${external_watchdog_debounce}"; fi
[2.328084 0.013510] cfgload: setenv bootargs "${bootrootfs} ${videoconfig} ${hdmi_phy_control} ${hid_quirks} smsc95xx.macaddr=${macaddr} ${external_watchdog}"
[2.353837 0.025753] cfgload: dmc ${ddr_freq}
[2.354914 0.001077] cfgload: bootz 0x40008000 0x42000000 0x44000000
[2.356921 0.002007] Kernel image @ 0x40008000 [ 0x000000 - 0x56e360 ]
[2.359101 0.002180] ## Loading init Ramdisk from Legacy Image at 42000000 ...
[2.361466 0.002365]    Image Name:   uInitrd
[2.362447 0.000981]    Image Type:   ARM Linux RAMDisk Image (uncompressed)
[2.365389 0.002942]    Data Size:    12383958 Bytes = 11.8 MiB
[2.367209 0.001820]    Load Address: 00000000
[2.368301 0.001092]    Entry Point:  00000000
[2.369393 0.001092]    Verifying Checksum ... OK
[4.908599 2.539206] ## Flattened Device Tree blob at 44000000
[4.911853 0.003254]    Booting using the fdt blob at 0x44000000
[4.918398 0.006545]    Using Device Tree in place at 44000000, end 440127fb
[6.091996 1.173598] 
[6.092133 0.000137] Starting kernel ...

android_enthusiasts
Posts: 9
Joined: Thu Jan 30, 2020 2:04 pm
languages_spoken: english
ODROIDs: ODROID XU4
Has thanked: 2 times
Been thanked: 0
Contact:

Re: Booting from uSDcard is very slow

Unread post by android_enthusiasts » Tue Feb 04, 2020 1:01 pm

odroid wrote:
Tue Feb 04, 2020 9:52 am
Two seconds is much faster than my booting time.
My Ubuntu 18.04 OS on a 8GB eMMC stays over 5 seconds in the u-boot stage.
If I set "bootdelay" to 0 from 1, it may take around 4.x seconds though.

Code: Select all

grabserial -v -d "/dev/ttyUSB0" -b 115200 -w 8 -p N -s 1 -e 30 -t -m "U-Boot"
Opening serial port /dev/ttyUSB0
115200:8N1:xonxoff=0:rtscts=0
Program will end in 30 seconds
Printing timing information for each line
Matching pattern 'U-Boot' to set base time
Use Control-C to stop...
[0.000001 0.000001] 
[0.636939 0.636938] 
[0.637020 0.000081] U-Boot 2017.05-00005-ga917f39c3a (Dec 13 2019 - 06:44:32 -0300) for ODROID-XU4
[0.004644 0.004644] 
[0.004717 0.000073] CPU:   Exynos5422 @ 800 MHz
[0.006380 0.001663] Model: Odroid XU4 based on EXYNOS5422
[0.008679 0.002299] Board: Odroid XU4 based on EXYNOS5422
[0.011059 0.002380] Type:  xu4
[0.011552 0.000493] DRAM:  2 GiB
[0.176512 0.164960] MMC:   EXYNOS DWMMC: 0, EXYNOS DWMMC: 1
[0.287895 0.111383] MMC Device 0 (eMMC): 7.3 GiB
[0.290288 0.002393] Info eMMC rst_n_func status = enabled
[0.300987 0.010699] Card did not respond to voltage select!
[0.303054 0.002067] mmc_init: -95, time 11
[0.314601 0.011547] *** Warning - bad CRC, using default environment
[0.318369 0.003768] 
[0.532547 0.214178] In:    serial
[0.533593 0.001046] Out:   serial
[0.534597 0.001004] Err:   serial
[0.578614 0.044017] Net:   No ethernet found.
[0.611568 0.032954] Press quickly 'Enter' twice to stop autoboot:  0 
[1.588818 0.977250] reading boot.ini
[1.593489 0.004671] 9654 bytes read in 4 ms (2.3 MiB/s)
[1.607665 0.014176] cfgload addr = 0x50000000, Loading boot.ini from FAT
[1.610882 0.003217] cfgload: applying boot.ini...
[1.612277 0.001395] cfgload: setenv initrd_high "0xffffffff"
[1.614204 0.001927] cfgload: setenv fdt_high "0xffffffff"
[1.620260 0.006056] cfgload: setenv macaddr "00:1e:06:61:7a:39"
[1.630793 0.010533] cfgload: setenv vout "hdmi"
[1.638066 0.007273] cfgload: setenv cecenable "false" # false or true
[1.644440 0.006374] cfgload: setenv disable_vu7 "false" # false
[1.649739 0.005299] cfgload: setenv ddr_freq 825
[1.656194 0.006455] cfgload: setenv external_watchdog "false"
[1.663173 0.006979] cfgload: setenv external_watchdog_debounce "3"
[1.669167 0.005994] cfgload: setenv HPD "true"
[1.685094 0.015927] cfgload: setenv bootrootfs "console=tty1 console=ttySAC2,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro fsck.repair=yes net.ifnames=0"
[1.693082 0.007988] cfgload: fatload mmc 0:1 0x40008000 zImage
[1.695889 0.002807] reading zImage
[1.844284 0.148395] 5694304 bytes read in 149 ms (36.4 MiB/s)
[1.847725 0.003441] cfgload: fatload mmc 0:1 0x42000000 uInitrd
[1.849736 0.002011] reading uInitrd
[2.160969 0.311233] 12384022 bytes read in 321 ms (36.8 MiB/s)
[2.162706 0.001737] cfgload: setenv fdtloaded "false"
[2.170008 0.007302] cfgload: if test "x${board_name}" = "x"; then setenv board_name "xu4"; fi
[2.181717 0.011709] cfgload: if test "${board_name}" = "xu4"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu4.dtb; setenv fdtloaded "true"; fi
[2.187106 0.005389] reading exynos5422-odroidxu4.dtb
[2.205533 0.018427] 63484 bytes read in 8 ms (7.6 MiB/s)
[2.207186 0.001653] cfgload: if test "${board_name}" = "xu3"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu3.dtb; setenv fdtloaded "true"; fi
[2.218350 0.011164] cfgload: if test "${board_name}" = "xu3l"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu3-lite.dtb; setenv fdtloaded "true"; fi
[2.230650 0.012300] cfgload: if test "${fdtloaded}" = "false"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu4.dtb; setenv fdtloaded "true"; fi
[2.236070 0.005420] cfgload: fdt addr 0x44000000
[2.241844 0.005774] cfgload: setenv hdmi_phy_control "HPD=${HPD} vout=${vout}"
[2.252230 0.010386] cfgload: if test "${cecenable}" = "false"; then fdt rm /soc/cec@101B0000; fi
[2.294112 0.041882] cfgload: if test "${disable_vu7}" = "false"; then setenv hid_quirks "usbhid.quirks=0x0eef:0x0005:0x0004"; fi
[2.314574 0.020462] cfgload: if test "${external_watchdog}" = "true"; then setenv external_watchdog "external_watchdog=${external_watchdog} external_watchdog_debounce=${external_watchdog_debounce}"; fi
[2.328084 0.013510] cfgload: setenv bootargs "${bootrootfs} ${videoconfig} ${hdmi_phy_control} ${hid_quirks} smsc95xx.macaddr=${macaddr} ${external_watchdog}"
[2.353837 0.025753] cfgload: dmc ${ddr_freq}
[2.354914 0.001077] cfgload: bootz 0x40008000 0x42000000 0x44000000
[2.356921 0.002007] Kernel image @ 0x40008000 [ 0x000000 - 0x56e360 ]
[2.359101 0.002180] ## Loading init Ramdisk from Legacy Image at 42000000 ...
[2.361466 0.002365]    Image Name:   uInitrd
[2.362447 0.000981]    Image Type:   ARM Linux RAMDisk Image (uncompressed)
[2.365389 0.002942]    Data Size:    12383958 Bytes = 11.8 MiB
[2.367209 0.001820]    Load Address: 00000000
[2.368301 0.001092]    Entry Point:  00000000
[2.369393 0.001092]    Verifying Checksum ... OK
[4.908599 2.539206] ## Flattened Device Tree blob at 44000000
[4.911853 0.003254]    Booting using the fdt blob at 0x44000000
[4.918398 0.006545]    Using Device Tree in place at 44000000, end 440127fb
[6.091996 1.173598] 
[6.092133 0.000137] Starting kernel ...
But i really needs to optimize the boot time,Could you please tell me the max.possible read frequency?

User avatar
odroid
Site Admin
Posts: 33268
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 365 times
Been thanked: 445 times
Contact:

Re: Booting from uSDcard is very slow

Unread post by odroid » Tue Feb 04, 2020 4:26 pm

Did you measure the current clock frequency of the SD card interface with an oscilloscope?
According to my serial console output, the transfer rate is already over 36MB/sec.
What is the size of your loading blobs?

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 3 guests