This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/PROCESSOR-SDK-AM335X: Slow kernel boot from SD card

Part Number: PROCESSOR-SDK-AM335X

Tool/software: Linux

U-boot is very slow when reading from the micro SD card while booting when created by the bin/create-sdcard.sh script . I'm am using a BeaglBone Black as the my current hardware target and and using the TI pre-build image.

When use the 04.01.00.06 SDK to create the SD card I get the following output on boot up.

U-Boot SPL 2017.01-g590c7d7fe1 (Sep 26 2017 - 18:28:01)
Trying to boot from MMC1
reading uboot.env

** Unable to read "uboot.env" from mmc0:1 **
Using default environment

reading u-boot.img
reading u-boot.img
reading u-boot.img
reading u-boot.img


U-Boot 2017.01-g590c7d7fe1 (Sep 26 2017 - 18:28:01 -0400)

CPU  : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black
DRAM:  512 MiB
NAND:  0 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
reading uboot.env

** Unable to read "uboot.env" from mmc0:1 **
Using default environment

<ethaddr> not set. Validating first E-fuse MAC
Net:   cpsw, usb_ether
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
reading boot.scr
** Unable to read file boot.scr **
reading uEnv.txt
** Unable to read file uEnv.txt **
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
3607512 bytes read in 73885 ms (46.9 KiB/s)
37853 bytes read in 1782 ms (20.5 KiB/s)
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Device Tree to 8fff3000, end 8ffff3dc ... OK

Starting kernel ...

When I use the current BeagleBone Black community image of bone-debian-9.1-lxqt-armhf-2017-08-31-4gb.img on the same SD Card the read speed in U-boot is faster.

-Boot SPL 2017.09-rc2-00002-g7c9353e752 (Aug 31 2017 - 09:25:14)
Trying to boot from MMC1


U-Boot 2017.09-rc2-00002-g7c9353e752 (Aug 31 2017 - 09:25:14 -0500), Build: jenkins-github_Bootloader-Builder-596

CPU  : AM335X-GP rev 2.1
I2C:   ready
DRAM:  512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
Reset Source: Power-on reset has occurred.
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Using default environment

Board: BeagleBone Black
<ethaddr> not set. Validating first E-fuse MAC
BeagleBone Black:
BeagleBone: cape eeprom: i2c_probe: 0x54:
BeagleBone: cape eeprom: i2c_probe: 0x55:
BeagleBone: cape eeprom: i2c_probe: 0x56:
BeagleBone: cape eeprom: i2c_probe: 0x57:
Net:   eth0: MII MODE
cpsw
Press SPACE to abort autoboot in 2 seconds
board_name=[A335BNLT] ...
board_rev=[000B] ...
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
** Bad device 0:2 0x82000000 **
** Bad device 0:2 0x82000000 **
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
Checking for: /boot.scr ...
Checking for: /boot/boot.scr ...
Checking for: /boot/uEnv.txt ...
gpio: pin 55 (gpio 55) value is 1
2044 bytes read in 46 ms (43 KiB/s)
Loaded environment from /boot/uEnv.txt
Checking if uname_r is set in /boot/uEnv.txt...
gpio: pin 56 (gpio 56) value is 1
Running uname_boot ...
loading /boot/vmlinuz-4.9.45-ti-r57 ...
9464664 bytes read in 634 ms (14.2 MiB/s)
uboot_overlays: [uboot_base_dtb=am335x-boneblack-uboot.dtb] ...
uboot_overlays: Switching too: dtb=am335x-boneblack-uboot.dtb ...
loading /boot/dtbs/4.9.45-ti-r57/am335x-boneblack-uboot.dtb ...
55752 bytes read in 76 ms (715.8 KiB/s)
uboot_overlays: [fdt_buffer=0x60000] ...
uboot_overlays: loading /lib/firmware/AM335X-20-00A0.dtbo ...
378 bytes read in 87 ms (3.9 KiB/s)
uboot_overlays: loading /lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo ...
1105 bytes read in 207 ms (4.9 KiB/s)
uboot_overlays: loading /lib/firmware/BB-HDMI-TDA998x-00A0.dtbo ...
4169 bytes read in 318 ms (12.7 KiB/s)
uboot_overlays: loading /lib/firmware/BB-ADC-00A0.dtbo ...
695 bytes read in 219 ms (2.9 KiB/s)
uboot_overlays: loading /lib/firmware/AM335X-PRU-UIO-00A0.dtbo ...
853 bytes read in 120 ms (6.8 KiB/s)
uboot_overlays: loading /lib/firmware/univ-bbb-EVA-00A0.dtbo ...
54858 bytes read in 233 ms (229.5 KiB/s)
loading /boot/initrd.img-4.9.45-ti-r57 ...
5908180 bytes read in 414 ms (13.6 MiB/s)
debug: [console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet] ...
debug: [bootz 0x82000000 0x88080000:5a26d4 88000000] ...
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Ramdisk to 8fa5d000, end 8ffff6d4 ... OK
   reserving fdt memory region: addr=88000000 size=76000
   Loading Device Tree to 8f9e4000, end 8fa5cfff ... OK

Starting kernel ...

I have tried numerous micro SD cards and I'm getting similar results, it appears that the Processor SDK 04.01.00.06 U-boot has an issue with reading from the SD Card. The Processor's U-boot reports a speed of less than 50KB/s when reading the kernel, when compared to the BeagleBone Black's community image read speed of 14MB/s.

Is this a known issue in Processor SDK 04.01.00.06?

  • The software team have been notified. They will respond here.
  • Can you stop at the u-boot prompt and type in mmcinfo and copy/paste the output.

    I just built two cards with the processor sdk, one is class 10 while the other is class 4. I get
    Class 4 card - 3607512 bytes read in 417 ms (8.3 MiB/s)
    Class 10 card - 3607512 bytes read in 354 ms (9.7 MiB/s)

    Steve K.
  • The output of the mmcinfo command is the following with the TI Processor SDK pre-built image.

    Device: OMAP SD/MMC
    Manufacturer ID: 9f
    OEM: 5449
    Name: SD8GB
    Tran Speed: 25000000
    Rd Block Len: 512
    SD version 1.0
    High Capacity: Yes
    Capacity: 7.3 GiB
    Bus Width: 1-bit
    Erase Group Size: 512 Bytes
    read 44 KB/s. error 0/6 (0%)
    write ### MB/s. error 0/0 (0%)

    With the BeagleBone Black community release installed on the same card the output of mmcinfo is the following.

    Device: OMAP SD/MMC
    Manufacturer ID: 9f
    OEM: 5449
    Name: SD8GB
    Tran Speed: 25000000
    Rd Block Len: 512
    SD version 1.0
    High Capacity: Yes
    Capacity: 7.3 GiB
    Bus Width: 4-bit
    Erase Group Size: 512 Bytes
  • It looks like the SDK is negotiating to a bus width of 1-bit while the community release negotiates to 4-bit. I'll look around the code. The card you used is SD version 1.0. Do you have any newer cards to try? Even my oldest shows SD version 3.0:

    => mmcinfo
    Device: OMAP SD/MMC
    Manufacturer ID: 2
    OEM: 544d
    Name: SA04G
    Tran Speed: 50000000
    Rd Block Len: 512
    SD version 3.0
    High Capacity: Yes
    Capacity: 3.7 GiB
    Bus Width: 4-bit
    Erase Group Size: 512 Bytes
    read 600 KB/s. error 0/6 (0%)
    write ### MB/s. error 0/0 (0%)
    =>

    Steve K.
  • Hi Sean,
    I'm also curious how the Linux kernel negotiates. Can you build the card with the SDK, boot the kernel, and type in
    cat /sys/kernel/debug/mmc0/ios

    For one of my cards I see
    root@am335x-evm:~# cat /sys/kernel/debug/mmc0/ios
    clock: 50000000 Hz
    vdd: 21 (3.3 ~ 3.4 V)
    bus mode: 2 (push-pull)
    chip select: 0 (don't care)
    power mode: 2 (on)
    bus width: 2 (4 bits)
    timing spec: 2 (sd high-speed)
    signal voltage: 0 (3.30 V)
    driver type: 0 (driver type B)
    root@am335x-evm:~#

    Thanks,
    Steve K.
  • The output from the kernel is the following.

    cat /sys/kernel/debug/mmc0/ios
    clock:          25000000 Hz
    vdd:            21 (3.3 ~ 3.4 V)
    bus mode:       2 (push-pull)
    chip select:    0 (don't care)
    power mode:     2 (on)
    bus width:      2 (4 bits)
    timing spec:    0 (legacy)
    signal voltage: 0 (3.30 V)
    driver type:    0 (driver type B)

    You hypothesis about how U-boot negotiates the bus width may have some merit. Can you point me where in u-boot this occurs, perhaps I can add some debugging to assist in determining what is occurring.

  • I started looking around and in omap_hsmmc.c, the routine
    static int omap_hsmmc_set_ios(struct mmc *mmc)

    calls
    if (priv->bus_width != mmc->bus_width)
    omap_hsmmc_set_bus_width(mmc);

    The omap_hsmmc_set_bus_width sets the bus width.

    I also wonder if 1-bit might be set by the generic code. In mmc.c I saw some SD_VERSION checking. At the top of both files, add
    #define DEBUG
    Before the very first #include that should enable some of the debug(...) that are in both files.

    Steve K.
  • We are currently using TI's Processor SDK 01.00.00.00 as the base to our products and the U-boot it provides is reading these microSD cards at appropriate speeds. We have just begun the process  of migrating to a newer TI SDK and discovered this issue of slow U-boot read speed on the type of microSD card we use.

    Here's the output from SDK 01.00.00.00 U-boot slowing that the speed is over 9 MB/S

    U-Boot SPL 2014.07-g7e537bf (Apr 10 2015 - 15:00:57)
    reading args
    spl_load_image_fat_os: error reading image args, err - -1
    reading u-boot.img
    reading u-boot.img
    
    
    U-Boot 2014.07-g7e537bf (Apr 10 2015 - 15:00:57)
    
    I2C:   ready
    DRAM:  512 MiB
    NAND:  0 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    reading uboot.env
    
    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment
    
    Net:   <ethaddr> not set. Validating first E-fuse MAC
    cpsw, usb_ether
    Hit any key to stop autoboot:  0
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    reading uEnv.txt
    ** Unable to read file uEnv.txt **
    4283064 bytes read in 433 ms (9.4 MiB/s)
    32138 bytes read in 64 ms (490.2 KiB/s)
    Kernel image @ 0x82000000 [ 0x000000 - 0x415ab8 ]
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 8fff5000, end 8ffffd89 ... OK
    
    Starting kernel ...

    Here is the output of the mmcinfo from the 01.00.00.00 U-boot release

    mmcinfo
    Device: OMAP SD/MMC
    Manufacturer ID: 9f
    OEM: 5449
    Name: SD8GB
    Tran Speed: 25000000
    Rd Block Len: 512
    SD version 1.0
    High Capacity: Yes
    Capacity: 7.3 GiB
    Bus Width: 4-bit

    Then by testing each TI Processor SDK release it appears the slow down for these SD card began in SDK v. 03.01.00.06 with the following boot up output indicated the read speed is less than 3MB/s.

    U-Boot SPL 2016.05-g2f757e5b2c (Oct 03 2016 - 17:53:44)
    Trying to boot from MMC1
    reading args
    spl_load_image_fat_os: error reading image args, err - -1
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    
    
    U-Boot 2016.05-g2f757e5b2c (Oct 03 2016 - 17:53:44 -0400)
    
           Watchdog enabled
    DRAM:  512 MiB
    NAND:  0 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    reading uboot.env
    
    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment
    
    <ethaddr> not set. Validating first E-fuse MAC
    Net:   eth0: ethernet@4a100000
    Warning: usb_ether MAC addresses don't match:
    Address in SROM is         de:ad:be:ef:00:01
    Address in environment is  1c:ba:8c:a2:ef:59
    , eth1: usb_ether
    Press SPACE to abort autoboot in 2 seconds
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    reading boot.scr
    ** Unable to read file boot.scr **
    reading uEnv.txt
    ** Unable to read file uEnv.txt **
    switch to partitions #0, OK
    mmc0 is current device
    Scanning mmc 0:1...
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    reading boot.scr
    ** Unable to read file boot.scr **
    reading uEnv.txt
    ** Unable to read file uEnv.txt **
    3451352 bytes read in 1239 ms (2.7 MiB/s)
    37004 bytes read in 96 ms (376 KiB/s)
    Kernel image @ 0x82000000 [ 0x000000 - 0x34a9d8 ]
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 8fff3000, end 8ffff08b ... OK
    
    Starting kernel ...
    

    The mmcinfo from SDK 03.01.00.06 U-boot.

    mmcinfo
    Device: OMAP SD/MMC
    Manufacturer ID: 9f
    OEM: 5449
    Name: SD8GB
    Tran Speed: 25000000
    Rd Block Len: 512
    SD version 1.0
    High Capacity: Yes
    Capacity: 7.3 GiB
    Bus Width: 1-bit
    Erase Group Size: 512 Bytes

    Finally becoming unacceptable in SDK v.04.00.00.04. with a read speed of 48KB/s  as you can see from the following boot up.

    U-Boot SPL 2017.01-g9fd60700db (Jun 28 2017 - 17:18:56)
    Trying to boot from MMC1
    reading uboot.env
    
    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment
    
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    
    
    U-Boot 2017.01-g9fd60700db (Jun 28 2017 - 17:18:56 -0400)
    
    CPU  : AM335X-GP rev 2.1
    Model: TI AM335x BeagleBone Black
    DRAM:  512 MiB
    NAND:  0 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    reading uboot.env
    
    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment
    
    <ethaddr> not set. Validating first E-fuse MAC
    Net:   cpsw, usb_ether
    Hit any key to stop autoboot:  0
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    reading boot.scr
    ** Unable to read file boot.scr **
    reading uEnv.txt
    ** Unable to read file uEnv.txt **
    switch to partitions #0, OK
    mmc0 is current device
    Scanning mmc 0:1...
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    3593544 bytes read in 73287 ms (47.9 KiB/s)
    37806 bytes read in 1810 ms (19.5 KiB/s)
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 8fff3000, end 8ffff3ad ... OK
    
    Starting kernel ...
    


    Here is the output of the mmcinfo for U-boot from SDK V.04.00.00.04

    mmcinfo
    Device: OMAP SD/MMC
    Manufacturer ID: 9f
    OEM: 5449
    Name: SD8GB
    Tran Speed: 25000000
    Rd Block Len: 512
    SD version 1.0
    High Capacity: Yes
    Capacity: 7.3 GiB
    Bus Width: 1-bit
    Erase Group Size: 512 Bytes
    read 44 KB/s. error 0/6 (0%)
    write ### MB/s. error 0/0 (0%)

    It would appears with SDK v. 03.01.00.06 some changes to U-boot mmc code decreased read performance of some microSD cards, but in SDK v. 04.00.00.04 the decreased read speed is aggravated.

    While investigating with SDK 04.01.00.06 the drivers/mmc/mmc.c sd_change_freq function, it appears our the microSD cards reports that it's a Version 1.0 card but that it supports SD_DATA_4BIT, and sets the card_caps MMC_MODE_4BIT flag. It appears though that this flag is not being currently used to set the Bus width, like in the previous releases. So using the U-boot from SDK 01.00.00.00 drivers/mmc/mmc.c mmc_startup as a starting point I added the following to drivers/mmc/mmc.c mmc_startup and got a read speed of 185 KB/s which is an improvement but no where near what the read speed should be.

    err = mmc_set_capacity(mmc, mmc_get_blk_desc(mmc)->hwpart);
        if (err)
            return err;
    
        if (IS_SD(mmc))
            err = sd_change_freq(mmc);
        else
            err = mmc_change_freq(mmc);
    
        if (err)
            return err;
    
        /* Restrict card's capabilities by what the host can do */
        mmc->card_caps &= mmc->cfg->host_caps;
    
        if (IS_SD(mmc)) {
           
            if (mmc->card_caps & MMC_MODE_4BIT) {
                cmd.cmdidx = MMC_CMD_APP_CMD;
                cmd.resp_type = MMC_RSP_R1;
                cmd.cmdarg = mmc->rca << 16;
    
                err = mmc_send_cmd(mmc, &cmd, NULL);
                if (err)
                    return err;
    
                cmd.cmdidx = SD_CMD_APP_SET_BUS_WIDTH;
                cmd.resp_type = MMC_RSP_R1;
                cmd.cmdarg = 2;
                err = mmc_send_cmd(mmc, &cmd, NULL);
                if (err)
                    return err;
    
                mmc_set_bus_width(mmc, MMC_BUS_WIDTH_4);
            }
           
            err = sd_read_ssr(mmc);
            if (err)
                return err;
        } else if (mmc->version >= MMC_VERSION_4) {
            mmc_set_clock(mmc, mmc->tran_speed, false);
            if (mmc->timing == MMC_TIMING_MMC_HS200) {
                err = mmc_execute_tuning(mmc,
                            MMC_SEND_TUNING_BLOCK_HS200);
                if (err) {
                    printf("Tuning failed, dropping HS200 mode.\n");
                    mmc->host_ok_caps &= ~MMC_MODE_HS200;
                    return -EAGAIN;
                }
            } else if (mmc->timing == MMC_TIMING_MMC_HS) {
                err = mmc_select_bus_width(mmc);
                if (err)
                    return err;
    
                err = mmc_select_hs_ddr(mmc);
                if (err) {
                    printf("dropping DDR52 mode.\n");
                    mmc->host_ok_caps &= ~MMC_MODE_DDR_52MHz;
                    return -EAGAIN;
                }
            }
        }

    The output with the change for setting the the bus width based on the card's capabilities.

    U-Boot SPL 2017.01 (Dec 06 2017 - 13:21:12)
    Trying to boot from MMC1
    reading uboot.env
    
    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment
    
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    
    
    U-Boot 2017.01 (Dec 06 2017 - 13:21:12 -0400)
    
    CPU  : AM335X-GP rev 2.1
    Model: TI AM335x BeagleBone Black
    DRAM:  512 MiB
    NAND:  0 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    reading uboot.env
    
    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment
    
    <ethaddr> not set. Validating first E-fuse MAC
    Net:   cpsw, usb_ether
    Hit any key to stop autoboot:  0
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    reading boot.scr
    ** Unable to read file boot.scr **
    reading uEnv.txt
    ** Unable to read file uEnv.txt **
    switch to partitions #0, OK
    mmc0 is current device
    Scanning mmc 0:1...
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    3593544 bytes read in 18846 ms (185.5 KiB/s)
    37806 bytes read in 553 ms (66.4 KiB/s)
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 8fff3000, end 8ffff3ad ... OK
    
    Starting kernel ...

  • As a test we downloaded the U-Boot source from the U-Boot FTP at release 2017.11 and built it with the am335x_evm_defconfig and the read speed is at around 9MB/s.

    Here's the output below.

    U-Boot SPL 2017.11 (Dec 06 2017 - 13:34:45)
    Trying to boot from MMC1
    *** Warning - bad CRC, using default environment
    
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    
    
    U-Boot 2017.11 (Dec 06 2017 - 13:34:45 -0400)
    
    CPU  : AM335X-GP rev 2.1
    Model: TI AM335x BeagleBone Black
    DRAM:  512 MiB
    NAND:  0 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    *** Warning - bad CRC, using default environment
    
    No USB device found
    <ethaddr> not set. Validating first E-fuse MAC
    Net:   eth0: ethernet@4a100000
    Hit any key to stop autoboot:  0
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    ** Unable to read file boot.scr **
    ** Unable to read file uEnv.txt **
    switch to partitions #0, OK
    mmc0 is current device
    Scanning mmc 0:1...
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    3593544 bytes read in 375 ms (9.1 MiB/s)
    37806 bytes read in 81 ms (455.1 KiB/s)
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 8fff3000, end 8ffff3ad ... OK
    
    Starting kernel ...
    

  • Any update from TI on this issue?

  • Sorry for the delay, I'm still looking at this.

    Steve K.
  • Has any progress been made in the investigation of this issue?

  • I still cannot reproduce this problem. Even my cheapest, oldest card gets around 10 MiB/s. I've even tried several BBB and cannot reproduce. Can you try another BBB?

    Steve K.
  • I can confirmed locally the issue appears to follow particular set of microsd card. I've managed to some additional cards from a different manufacturer that do not exhibit the slow reading speed. I have also tested with a couple of different Beaglebone black boards and the issue follows the microsd card, not the board.

    As I stated previously in the forum post, the issue appears to be related to TI specific changes as the vanilla u-boot source does not have this issue and it appears to have begun back in SDK v. 03.01.00.06.

    I could ship one of the cards that exhibit the problem, if you could provide an address and details of who to ship it to to assist in resolving this issue.

  • Instead of shipping a card, can you post who makes the card, it's size, any model number. I will see if I can get one locally.

    Steve K.

  • The cards that exhibit the issue are Kingston Brand 8GB MicroSD Class 4 SDC4/8GB 31560-017.A00LF
  • Thanks. The cards I ordered arrive next week.

    Steve K.
  • I have two of these cards and neither exhibit the slowness.

    Steve K.
  • Would you be able to provide an address where I could ship a card that exhibits the issue?

    Also can you compare against the previous results of the mmcinfo command? It appears that in more recent TI SDK the detection of the card's busy width was incorrect.
  • I sent you a friend request so that I can send you my address to send the card to.

    Steve K.
  • Hi Sean,
    I received the card yesterday and will be looking at it today.

    Steve K.
  • Hi Sean,
    I tried the card you sent me on 2 Beaglebone Blacks. I get 4-bit, SD 3.0 when I use mmcinfo in u-boot

    => mmcinfo
    Device: OMAP SD/MMC
    Manufacturer ID: 2
    OEM: 544d
    Name: SA08G
    Tran Speed: 50000000
    Rd Block Len: 512
    SD version 3.0
    High Capacity: Yes
    Capacity: 7.2 GiB
    Bus Width: 4-bit
    Erase Group Size: 512 Bytes
    read 750 KB/s. error 0/6 (0%)
    write ### MB/s. error 0/0 (0%)
    =>

    And loading the kernel I get

    3621296 bytes read in 413 ms (8.4 MiB/s)
    37853 bytes read in 113 ms (326.2 KiB/s)

    Steve K.
  • Steve,

    Can you confirm the brand of card I sent is Kingston? It's very possible the wrong card was sent.

    Every Kingston card I have locally on hand that exhibits the slow read issue has a Manufacturer ID of 9F with an OEM of 5449.

    mmcinfo
    Device: OMAP SD/MMC
    Manufacturer ID: 9f
    OEM: 5449
    Name: SD8GB
    Tran Speed: 25000000
    Rd Block Len: 512
    SD version 1.0
    High Capacity: Yes
    Capacity: 7.3 GiB
    Bus Width: 1-bit
    Erase Group Size: 512 Bytes
    read 44 KB/s. error 0/6 (0%)
    write ### MB/s. error 0/0 (0%)

  • I see these from the card you sent me
    Manufacturer ID: 2
    OEM: 544d
    Name: SA08G

    Which are different than what you posted.

    Steve K.
  • I received the card you sent and it shows what you've posted earlier.

    Steve K.
  • Sorry for the delay, I'm still working on this. I think instead of focusing on the slowness of the card I'm going to focus on why the performance decreased from release to release.

    Steve K.
  • Steve do you have an update on this issue?

    I was wondering if it will be resolved in a future PROCESSOR-SDK release.

  • I have re-created the slowdown of successive releases and will be filing a but ticket with the software team.

    Steve K.
  • Steve,

    Can you provide us a link to the ticket created with the software team? Or some notification which release could have the issue resolve?

    Thanks,

    Sean

  • Hi Sean,
    Sorry, but it is an internal system. All I can do is post when I have more details.

    Steve K.
  • 0001-arm-mach-omap2-cache-Explicitly-enable-I-cache.patch.gzHi Sean,

    This will be fixed in a future release. In the meantime, the attached patch should give you a performance boost. It is not a gzip file so just remove the .gz.

    Steve K.

  • Steve applying the patch has not improved the read speed from the microsd card.

    From Processor SDK v.04.03.00.05 default u-boot output.

    U-Boot SPL 2017.01-gc68ed086bd (Mar 26 2018 - 15:08:11)
    Trying to boot from MMC1
    reading uboot.env
    
    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment
    
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    
    
    U-Boot 2017.01-gc68ed086bd (Mar 26 2018 - 15:08:11 -0400)
    
    CPU  : AM335X-GP rev 2.1
    Model: TI AM335x BeagleBone Black
    DRAM:  512 MiB
    NAND:  0 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    reading uboot.env
    
    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment
    
    <ethaddr> not set. Validating first E-fuse MAC
    Net:   cpsw, usb_ether
    Hit any key to stop autoboot:  0
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    reading boot.scr
    ** Unable to read file boot.scr **
    reading uEnv.txt
    ** Unable to read file uEnv.txt **
    switch to partitions #0, OK
    mmc0 is current device
    Scanning mmc 0:1...
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    3627816 bytes read in 74121 ms (46.9 KiB/s)
    37889 bytes read in 1824 ms (19.5 KiB/s)
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 8fff3000, end 8ffff400 ... OK
    
    Starting kernel ...
    

    The same source with the applied patch produced the same read speed of 19.5 KB/S.

    U-Boot SPL 2017.01-gc68ed086bd (Mar 26 2018 - 15:08:11)
    Trying to boot from MMC1
    reading uboot.env
    
    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment
    
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    
    
    U-Boot 2017.01-gc68ed086bd (Mar 26 2018 - 15:08:11 -0400)
    
    CPU  : AM335X-GP rev 2.1
    Model: TI AM335x BeagleBone Black
    DRAM:  512 MiB
    NAND:  0 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    reading uboot.env
    
    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment
    
    <ethaddr> not set. Validating first E-fuse MAC
    Net:   cpsw, usb_ether
    Hit any key to stop autoboot:  0
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    reading boot.scr
    ** Unable to read file boot.scr **
    reading uEnv.txt
    ** Unable to read file uEnv.txt **
    switch to partitions #0, OK
    mmc0 is current device
    Scanning mmc 0:1...
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    3627816 bytes read in 74121 ms (46.9 KiB/s)
    37889 bytes read in 1824 ms (19.5 KiB/s)
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 8fff3000, end 8ffff400 ... OK
    
    Starting kernel ...
    

  • The u-boot in the SDK 4.3 release still thinks the card you sent me is in 1-bit mode. I just tried the 2018.01 u-boot and see
    3834368 bytes read in 397 ms (9.2 MiB/s)
    u-boot 2018.01 sees your card as 4-bit.

    I'm not sure the change was in the omap_hsmmc.c driver since I did a grep between 2017 and 2018.01 and did not see anything related to 1-bit vs. 4-bit.

    This u-boot will be in an upcoming release.

    Steve K.
  • What performance did you see with 2018.01 u-boot?

    Steve K.
  • We previously used U-Boot from the community source at release 2017.11 and did not see the issue with read performance. See my post on Dec 6 2017 for details.

    It appears the issues was not present in the community source version of U-Boot but was introduce in the TI source, somewhere back in TI SDK 03.01.00.6, and became exacerbated in TI SDK 04.01.00.06.

    We tested U-Boot 2018.01 from the U-Boot FTP built with the config of am335x_evm_defconfig and had a read speed of 8.9MB/S.

    Here's the output.

    U-Boot 2018.01 (May 11 2018 - 10:38:56 -0300)
    
    CPU  : AM335X-GP rev 2.1
    Model: TI AM335x BeagleBone Black
    DRAM:  512 MiB
    NAND:  0 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    *** Warning - bad CRC, using default environment
    
    No USB device found
    <ethaddr> not set. Validating first E-fuse MAC
    Net:   eth0: ethernet@4a100000
    Hit any key to stop autoboot:  0
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    ** Unable to read file boot.scr **
    ** Unable to read file uEnv.txt **
    switch to partitions #0, OK
    mmc0 is current device
    Scanning mmc 0:1...
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    3627816 bytes read in 389 ms (8.9 MiB/s)
    37889 bytes read in 83 ms (445.3 KiB/s)
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 8fff3000, end 8ffff400 ... OK
    
    Starting kernel ...
    

    Is the next release of the TI SDK's U-Boot  going to be based on the community U-Boot 2018.01? If so it should resolve this issue.

  • The next release will have a 2018.01 u-boot. The 9.2MiB/s I showed in my previous post is from an internal build of the next SDK release.

    Steve K.