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.

AM5708: EMMC boot with RAW writes for image size greater than 128kb

Part Number: AM5708

HI All,

I was trying emmc boot using raw writes referred section 3.1.1.6.4 on Am5708 custom board.

It crashed because of sector 300

sectorr 300 was mentioned in uboot config so changed it to 0x100 after which uboot booted successfully. Is this correct fix?

CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x1000

Raw writes commands are as follows:

mmc dev 1
fatload mmc 0 ${loadaddr} MLO
mmc write ${loadaddr} 0x100 0x400
fatload mmc 0 ${loadaddr} u-boot.img
mmc write ${loadaddr} 0x1000 0xB00

size of MLO is 181kb and uboot is 613kb.

From TRM, it is mentioned as size of booting imge should not cross 128k, but my images exceed that? will it be a problem?


crash log as found below:

software-dl.ti.com/.../Foundational_Components_U-Boot.html

  • Hello Sriraksha,

    I can not see the crash logs image. Can you attach the text file of the crash logs?

    Best Regards,
    Keerthy

  • Hi Keerthy,

    Sorry may be

    sectorcrashlog.txt
    => 
    PPA 4.6.4 (GCC Build - Sep 24 2020 - 14:45:29)
    Supports ALL DRA7x, TDA2x, and AM57x devices
    Detected device: 05841e21 HS
    PPA load address: 0x004a633c
    !FULL DEBUG ON!
    !OBFUSCATOR ON!
    !TEE Load API SUPPORTED!
    SEC_STATUS = 0x23820081
    SEC_CTRL   = 0x00010203
    SEC_EMU    = 0x000037ff
    SEC_TAP    = 0x00002607
    
    U-Boot SPL 2019.01-g0e9b2ed-dirty (Sep 24 2020 - 14:45:48 +0530)
    DRA722-HS ES2.1
    uclass_find_device_by_seq: 0 0
       - 0 -1 'ipu@58820000'
       - not found
    uclass_find_device_by_seq: 1 0
       - 0 -1 'ipu@58820000'
       - found
    uclass_find_device_by_seq: 0 0
       - 0 -1 'ipu@58820000'
       - not found
    rproc_pre_probe: 'ipu@58820000': using fdt
    fdtdec_get_bool: remoteproc-internal-memory-mapped
    fdtdec_get_addr_size_auto_noparent: fdtdec_get_addr_size_auto_parent: na=1, ns=1, fdtdec_get_addr_size_fixed: reg: addr=58820000, size=10000
    OF: ** translation for device ipu@58820000 **
    OF: bus is default (na=1, ns=1) on ocp
    OF: translating address: 00008258
    OF: parent bus is default (na=2, ns=2) on 
    OF: walking ranges...
    OF: default map, cp=0, s=c0000000, da=58820000
    OF: parent translation for: 00000000 00000000
    OF: with offset: 1484914688
    OF: one level translation: 00000000 00008258
    OF: reached root node
    reset_get_by_index(dev=4037ee38, index=2, reset_ctl=81fffe64)
    fdtdec_get_int: #reset-cells: 0x1 (1)
    fdtdec_get_int: #reset-cells: 0x1 (1)
    fdtdec_get_int: #reset-cells: 0x1 (1)
    uclass_find_device_by_seq: 0 -1
    uclass_find_device_by_seq: 0 0
       - -1 0 'ocp'
       - found
    uclass_find_device_by_seq: 0 1
       - -1 0 'ocp'
       - -1 -1 'l4@4a000000'
       - -1 -1 'scm@2000'
       - -1 -1 'l4@4ae00000'
       - -1 -1 'prm@6000'
       - -1 -1 'ocp2scp@4a080000'
       - not found
    uclass_find_device_by_seq: 0 -1
    uclass_find_device_by_seq: 0 0
       - -1 0 'ocp'
       - found
    uclass_find_device_by_seq: 0 1
       - -1 0 'ocp'
       - -1 -1 'l4@4a000000'
       - -1 -1 'scm@2000'
       - -1 1 'l4@4ae00000'
       - found
    uclass_find_device_by_seq: 0 2
       - -1 0 'ocp'
       - -1 -1 'l4@4a000000'
       - -1 -1 'scm@2000'
       - -1 1 'l4@4ae00000'
       - -1 -1 'prm@6000'
       - -1 -1 'ocp2scp@4a080000'
       - not found
    uclass_find_device_by_seq: 0 -1
    uclass_find_device_by_seq: 0 0
       - -1 -1 'ipu1_rst@510'
       - not found
    OF: ** translation for device ipu1_rst@510 **
    OF: bus is default (na=1, ns=1) on prm@6000
    OF: translating address: 10050000
    OF: parent bus is default (na=1, ns=1) on l4@4ae00000
    OF: walking ranges...
    OF: default map, cp=0, s=3000, da=510
    OF: parent translation for: 00600000
    OF: with offset: 1296
    OF: one level translation: 10650000
    OF: parent bus is default (na=1, ns=1) on ocp
    OF: walking ranges...
    OF: default map, cp=0, s=3f000, da=6510
    OF: parent translation for: 0000e04a
    OF: with offset: 25872
    OF: one level translation: 1065e04a
    OF: parent bus is default (na=2, ns=2) on 
    OF: walking ranges...
    OF: default map, cp=0, s=c0000000, da=4ae06510
    OF: parent translation for: 00000000 00000000
    OF: with offset: 1256219920
    OF: one level translation: 00000000 1065e04a
    OF: reached root node
    ofnode_read_u32: ti,nresets: 0x3 (3)
    reset_of_xlate_default(reset_ctl=81fffe64)
    reset_deassert(reset_ctl=81fffe64)
    OF: ** translation for device ipu@58820000 **
    OF: bus is default (na=1, ns=1) on ocp
    OF: translating address: 00008258
    OF: parent bus is default (na=2, ns=2) on 
    OF: walking ranges...
    OF: default map, cp=0, s=c0000000, da=58820000
    OF: parent translation for: 00000000 00000000
    OF: with offset: 1484914688
    OF: one level translation: 00000000 00008258
    OF: reached root node
    uclass_find_device_by_seq: 0 -1
    uclass_find_device_by_seq: 0 0
       - -1 -1 'fs_loader@0'
       - not found
    ofnode_read_string: firmware-loader: /fs_loader@0
    ofnode_read_u32_array: phandlepart: fdtdec_get_int_array: phandlepart
    get_prop_check_min_len: phandlepart
    ofnode_read_string: mtdpart: <not found>
    ofnode_read_string: ubivol: <not found>
    uclass_find_device_by_seq: 0 -1
    uclass_find_device_by_seq: 0 0
       - -1 -1 'mmc@4809c000'
       - -1 -1 'mmc@480b4000'
       - not found
    OF: ** translation for device mmc@4809c000 **
    OF: bus is default (na=1, ns=1) on ocp
    OF: translating address: 00c00948
    OF: parent bus is default (na=2, ns=2) on 
    OF: walking ranges...
    OF: default map, cp=0, s=c0000000, da=4809c000
    OF: parent translation for: 00000000 00000000
    OF: with offset: 1208598528
    OF: one level translation: 00000000 00c00948
    OF: reached root node
    ofnode_read_u32: bus-width: 0x4 (4)
    ofnode_read_u32: max-frequency: 0xb71b000 (192000000)
    ofnode_read_bool: cap-sd-highspeed: false
    ofnode_read_bool: cap-mmc-highspeed: false
    ofnode_read_bool: sd-uhs-sdr12: true
    ofnode_read_bool: sd-uhs-sdr25: true
    ofnode_read_bool: sd-uhs-sdr50: true
    ofnode_read_bool: sd-uhs-sdr104: true
    ofnode_read_bool: sd-uhs-ddr50: true
    ofnode_read_bool: mmc-ddr-1_8v: false
    ofnode_read_bool: mmc-ddr-1_2v: false
    ofnode_read_bool: mmc-hs200-1_8v: false
    ofnode_read_bool: mmc-hs200-1_2v: false
    ofnode_read_bool: mmc-hs400-1_8v: false
    ofnode_read_bool: mmc-hs400-1_2v: false
    fdtdec_get_bool: ti,dual-volt
    fdtdec_get_bool: no-1-8-v
    OF: ** translation for device mmc@4809c000 **
    OF: bus is default (na=1, ns=1) on ocp
    OF: translating address: 00c00948
    OF: parent bus is default (na=2, ns=2) on 
    OF: walking ranges...
    OF: default map, cp=0, s=c0000000, da=4809c000
    OF: parent translation for: 00000000 00000000
    OF: with offset: 1208598528
    OF: one level translation: 00000000 00c00948
    OF: reached root node
    fail to find default mode FDT_ERR_NOTFOUND
    no pinctrl state for default mode
    uclass_find_device_by_seq: 0 0
       - 0 0 'i2c@48070000'
       - found
    i2c_get_chip_for_busnum: bus='i2c@48070000', address 58, ret=0
    i2c_get_chip: Searching bus 'i2c@48070000' for address 58: found, ret=0
    i2c_xfer: 1 messages
    i2c_xfer: chip=0x58, len=0x2
    uclass_find_device_by_seq: 0 0
       - 0 0 'i2c@48070000'
       - found
    i2c_get_chip_for_busnum: bus='i2c@48070000', address 58, ret=0
    i2c_get_chip: Searching bus 'i2c@48070000' for address 58: found, ret=0
    i2c_xfer: 1 messages
    i2c_xfer: chip=0x58, len=0x2
    uclass_find_device_by_seq: 0 -1
    uclass_find_device_by_seq: 0 0
       - -1 -1 'mmc@4809c000.blk'
       - -1 -1 'mmc@480b4000.blk'
       - not found
    clock is disabled (0Hz)
    clock is enabled (400000Hz)
    Card did not respond to voltage select!
    mmc_blk_probe: mmc_init() failed (err=-95)
    fs_loader: No block device: -95
    Firmware loading failed
    rproc_dev_init: Unknown remote processor id '0' requested(-22)
    spl_boot_ipu: IPU1 failed to initialize on rproc (-22)
    Trying to boot from MMC2_2
    uclass_find_device_by_seq: 0 0
       - -1 0 'mmc@4809c000'
       - found
    uclass_find_device_by_seq: 0 1
       - -1 0 'mmc@4809c000'
       - -1 -1 'mmc@480b4000'
       - not found
    uclass_find_device_by_seq: 1 1
       - -1 0 'mmc@4809c000'
       - -1 -1 'mmc@480b4000'
       - not found
    uclass_find_device_by_seq: 0 -1
    uclass_find_device_by_seq: 0 0
       - -1 0 'mmc@4809c000'
       - found
    uclass_find_device_by_seq: 0 1
       - -1 0 'mmc@4809c000'
       - -1 -1 'mmc@480b4000'
       - not found
    OF: ** translation for device mmc@480b4000 **
    OF: bus is default (na=1, ns=1) on ocp
    OF: translating address: 00400b48
    OF: parent bus is default (na=2, ns=2) on 
    OF: walking ranges...
    OF: default map, cp=0, s=c0000000, da=480b4000
    OF: parent translation for: 00000000 00000000
    OF: with offset: 1208696832
    OF: one level translation: 00000000 00400b48
    OF: reached root node
    ofnode_read_u32: bus-width: 0x8 (8)
    ofnode_read_u32: max-frequency: 0x5b8d800 (96000000)
    ofnode_read_bool: cap-sd-highspeed: false
    ofnode_read_bool: cap-mmc-highspeed: false
    ofnode_read_bool: sd-uhs-sdr12: true
    ofnode_read_bool: sd-uhs-sdr25: true
    ofnode_read_bool: sd-uhs-sdr50: false
    ofnode_read_bool: sd-uhs-sdr104: false
    ofnode_read_bool: sd-uhs-ddr50: false
    ofnode_read_bool: mmc-ddr-1_8v: true
    ofnode_read_bool: mmc-ddr-1_2v: false
    ofnode_read_bool: mmc-hs200-1_8v: false
    ofnode_read_bool: mmc-hs200-1_2v: false
    ofnode_read_bool: mmc-hs400-1_8v: false
    ofnode_read_bool: mmc-hs400-1_2v: false
    fdtdec_get_bool: ti,dual-volt
    fdtdec_get_bool: no-1-8-v
    OF: ** translation for device mmc@480b4000 **
    OF: bus is default (na=1, ns=1) on ocp
    OF: translating address: 00400b48
    OF: parent bus is default (na=2, ns=2) on 
    OF: walking ranges...
    OF: default map, cp=0, s=c0000000, da=480b4000
    OF: parent translation for: 00000000 00000000
    OF: with offset: 1208696832
    OF: one level translation: 00000000 00400b48
    OF: reached root node
    fail to find default mode FDT_ERR_NOTFOUND
    no pinctrl state for default mode
    clock is disabled (0Hz)
    clock is enabled (400000Hz)
    clock is enabled (25000000Hz)
    clock is enabled (52000000Hz)
    spl: mmc boot mode: raw
    blk_find_device: if_type=6, devnum=1: mmc@4809c000.blk, 6, 0
    blk_find_device: if_type=6, devnum=1: mmc@480b4000.blk, 6, 1
    hdr read sector 300, count=1
    mkimage signature not found - ih_magic = 1904e6fb
    blk_find_device: if_type=6, devnum=1: mmc@4809c000.blk, 6, 0
    blk_find_device: if_type=6, devnum=1: mmc@480b4000.blk, 6, 1
    read 190 sectors to 80800000
    Jumping to U-Boot
    loaded - jumping to U-Boot...
    image entry point: 0x80800000
    
    -- NON SECURE CODE GENERATED A SECURITY VIOLATION --
    -- WARNING: violation might be due to speculative accesses. Check L3 interconnect
    -- PPA cleans FW and CONTROL module registers & let the NS alive.
    CONTROL_SEC_ERR_STATUS_FUNC = 00000800
    CONTROL_SEC_ERR_STATUS_FUNC_2 = 00000000
    
    Interrupted context:
    r0=4037f064, r1=00000000, r2=00000000, r3=00000000, 
    r4=80800000, r5=4037f064, r6=00000000, r7=403299cc, 
    r8=81fffee0, r9=00000000, r10=00000000, r11=00000018, 
    r12=00000000, lr_fiq=00000000, spsr_fiq=00000013
    
    
    SCM FW: violation description
      Code Fetch Violation  Data Read Violation
    
    SCM FW Error Log:
      [Register Addr (32b)] = Err log value (32b)
      [0x48280000] = 0x00000000
      [0x48280004] = 0x00000000
      [0x48280008] = 0x00000000
      [0x48280010] = 0x00300004
      [0x48280014] = 0x00000000
      [0x48280018] = 0xffffffff
    -- NON SECURE CODE GENERATED A SECURITY VIOLATION --
    -- WARNING: violation might be due to speculative accesses. Check L3 interconnect
    -- PPA cleans FW and CONTROL module registers & let the NS alive.
    CONTROL_SEC_ERR_STATUS_FUNC = 00000800
    CONTROL_SEC_ERR_STATUS_FUNC_2 = 00000000
    
    Interrupted context:
    r0=4037f064, r1=00000000, r2=00000000, r3=00000000, 
    r4=80800000, r5=4037f064, r6=00000000, r7=403299cc, 
    r8=81fffee0, r9=00000000, r10=00000000, r11=00000018, 
    r12=00000000, lr_fiq=40301370, spsr_fiq=00000197
    
    Before Violation, SW was in abort handler
    SP_abt=00000000, LR_abt=00000008, spsr_abt=00000013
    
    
    SCM FW: violation description
      Code Fetch Violation
    
    SCM FW Error Log:
      [Register Addr (32b)] = Err log value (32b)
      [0x48280000] = 0x00000000
      [0x48280004] = 0x00000000
      [0x48280008] = 0x00000000
      [0x48280010] = 0x00100004
      [0x48280014] = 0x00000000
      [0x48280018] = 0xffffffff
    
    
    i missed it.

    Attaching the crash log. Have enabled debug in inlude/common.h in uboot source.

    Regards,
    Sriraksha

  • Hi Sriraksha,

    This looks fine from the top level. I am just getting the logs reviewed from our security expert
    to get the detailed view. I will get back in couple of days.

    Best Regards,
    Keerthy

  • Hello Sriraksha,

    CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x1000

    Is telling the SPL(MLO) to read u-boot at sector 0x1000 in the raw mode.

    I confirmed this is fine.

    Hope you can resolve this thread.

    Best Regards,
    Keerthy