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.

TIDEP-01002: Load DSP1 firmware by bootloader fail

Part Number: TIDEP-01002

hello,

i can load IPU2 firmware by bootlader and run very well, now i want to load DSP1 too,

but encounter an error of out memroy:

[TICK 00252] Trying to boot from MMC1
spl: loading remote core image dra7-ipu2-fw.xem4
[TICK 00260] spl_mmc_find_device: mmc_initialize cost 0
load_elf_image_phdr_rproc : found resource table
rsc: type 3
vdev rsc: id 7, dfeatures 1, cfg len 0, 2 vrings
vdev rsc: vring0: da 60000000, qsz 256, align 4096
alloc_mem(0x3000, 1): 99000000
vdev rsc: vring1: da 60004000, qsz 256, align 4096
alloc_mem(0x3000, 1): 99004000
vring buffer alloc_mem(0x40000, 6): 99040000
rsc: type 0
carveout rsc: da 0, pa 0, len 100000, flags 0
carveout mapped 0x0 to 0x99100000
rsc: type 0
carveout rsc: da a0440000, pa 0, len f0000, flags 0
carveout mapped 0xa0440000 to 0x99200000
rsc: type 0
carveout rsc: da 99000000, pa 0, len 1c00000, flags 0
carveout mapped 0x99000000 to 0x9b000000
rsc: type 2
trace rsc: da 0xa0440000, len 0x8000
rsc: type 1
devmem rsc: pa 0x99000000, da 0x60000000, len 0x100000
mapped devmem pa 0x99000000, da 0x60000000, len 0x100000
rsc: type 1
devmem rsc: pa 0x60000000, da 0xa0000000, len 0x100000
mapped devmem pa 0x60000000, da 0xa0000000, len 0x100000
rsc: type 1
devmem rsc: pa 0x70000000, da 0xb0000000, len 0x8000000
mapped devmem pa 0x70000000, da 0xb0000000, len 0x8000000
rsc: type 1
devmem rsc: pa 0x78000000, da 0xb8000000, len 0x8000000
mapped devmem pa 0x78000000, da 0xb8000000, len 0x8000000
rsc: type 1
devmem rsc: pa 0x40100000, da 0x60100000, len 0x1ff00000
mapped devmem pa 0x40100000, da 0x60100000, len 0x1ff00000
rsc: type 1
devmem rsc: pa 0x40000000, da 0x40000000, len 0x20000000
mapped devmem pa 0x40000000, da 0x40000000, len 0x20000000
rsc: type 1
devmem rsc: pa 0x54000000, da 0x74000000, len 0x1000000
mapped devmem pa 0x54000000, da 0x74000000, len 0x1000000
rsc: type 1
devmem rsc: pa 0x5a000000, da 0x5a000000, len 0x1000000
mapped devmem pa 0x5a000000, da 0x5a000000, len 0x1000000
rsc: type 1
devmem rsc: pa 0x5b000000, da 0x5b000000, len 0x1000000
mapped devmem pa 0x5b000000, da 0x5b000000, len 0x1000000
rsc: type 1
devmem rsc: pa 0xa0100000, da 0xa0100000, len 0x340000
mapped devmem pa 0xa0100000, da 0xa0100000, len 0x340000
rsc: type 1
devmem rsc: pa 0x84203000, da 0x84203000, len 0x7a00000
mapped devmem pa 0x84203000, da 0x84203000, len 0x7a00000
rsc: type 1
devmem rsc: pa 0x84000000, da 0x84000000, len 0x200000
mapped devmem pa 0x84000000, da 0x84000000, len 0x200000
rsc: type 1
devmem rsc: pa 0xa9000000, da 0xa9000000, len 0x4000000
mapped devmem pa 0xa9000000, da 0xa9000000, len 0x4000000
rsc: type 1
devmem rsc: pa 0xa6000000, da 0xa6000000, len 0x1000000
mapped devmem pa 0xa6000000, da 0xa6000000, len 0x1000000
rsc: type 1
devmem rsc: pa 0xa7000000, da 0xa7000000, len 0x800000
mapped devmem pa 0xa7000000, da 0xa7000000, len 0x800000
rsc: type 1
devmem rsc: pa 0xa7800000, da 0xa7800000, len 0x800000
mapped devmem pa 0xa7800000, da 0xa7800000, len 0x800000
Loading phdr 0 to 0x99100000 (68 bytes)
Loading phdr 1 to 0x99100400 (320 bytes)
Loading phdr 2 to 0x9b000000 (1280 bytes)
Loading phdr 3 to 0x9b000500 (1612666 bytes)
Loading phdr 4 to 0x9b800000 (0 bytes)
Loading phdr 5 to 0x9be9cca0 (1418998 bytes)
Loading phdr 6 to 0x9bffb398 (100 bytes)
Loading phdr 7 to 0x99200000 (0 bytes)
loading remote core IPU2 successful
spl: loading remote core image dra7-dsp1-fw.xe66
[TICK 00724] spl_mmc_find_device: mmc_initialize cost 0
load_elf_image_phdr_rproc : found resource table
rsc: type 3
vdev rsc: id 7, dfeatures 1, cfg len 0, 2 vrings
vdev rsc: vring0: da a0000000, qsz 256, align 4096
alloc_mem(0x3000, 1): a1000000
vdev rsc: vring1: da a0004000, qsz 256, align 4096
alloc_mem(0x3000, 1): a1004000
vring buffer alloc_mem(0x40000, 6): a1040000
rsc: type 0
carveout rsc: da a1000000, pa 0, len 200000, flags 0
carveout mapped 0xa1000000 to 0xa1200000
rsc: type 0
carveout rsc: da a1200000, pa 0, len 1800000, flags 0
failed to allocate carveout rsc: da a1200000, pa 0, len 1800000, flags 0
handle_resources failed: -12
load_elf_image_phdr returned error for core DSP1
Error loading remotecore DSP1!,Continuing with boot ...
[TICK 00872] spl_mmc_find_device: mmc_initialize cost 0
[TICK 00877] spl_mmc_load_image: mmc_init cost 0
spl: mmc boot mode: fs
[TICK 00914] spl_mmc_do_fs_boot: load u-boot.img err 0 cost 31
Jumping to U-Boot
loaded - jumping to U-Boot...
[TICK 00924] image entry point: 0x80800000
[TICK 00927] uboot init
[TICK 01020] serial cost 85
[TICK 01024] DRAM:  2 GiB
[TICK 01038] begin init r
[TICK 01060] initr_dm cost 10
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1

you can see that IPU2 was loaded success, but DSP1 can not be loaded as out of memroy?

i use tool print_macros_for_mlo to dump the CMA pool of DSP1 form my DTS as following:

#define DRA7_RPROC_CMA_BASE_IPU1                      0x9e000000
#define DRA7_RPROC_CMA_BASE_IPU2                      0x99000000
#define DRA7_RPROC_CMA_BASE_DSP1                      0xa1000000
#define DRA7_RPROC_CMA_SIZE_IPU1                      0x02000000
#define DRA7_RPROC_CMA_SIZE_IPU2                      0x05000000
#define DRA7_RPROC_CMA_SIZE_DSP1                      0x02000000
#define DRA7_PGTBL_BASE_ADDR                          0xbfc00000
DTS in kernel reserve dma memory for DSP1:
&dsp1_cma_pool {
       reg = <0x0 0xa1000000 0x0 0x2000000>;
};
so i dont know why the following memory can not alloc success:
failed to allocate carveout rsc: da a1200000, pa 0, len 1800000, flags 0
handle_resources failed: -12
could anyone help me figure out this issue?
best regards!
  • Hi Fanok,

    the experts has been notified but some delay in the response might be expected due to the holidays in India.

    Regards,

    Yordan

  • Hi,

    Please make sure that the memory map used by the DSP1 firmware has the reserved mem carveout entries in the DTS file for kernel and u-boot

    NIkhil D

  • HI NIkhil D,

    i enlarge thte reserved mem for DSP1 to 64M, but not work too.

    &dsp1_cma_pool {
           reg = <0x0 0xa1000000 0x0 0x4000000>;
    };

    best regards!

  • Is this done only for kernel or for u-boot as well?

    Nikhil D

  • hi,

    yes, the definition in lateattach.c of u-boot has modified too:

    #define DRA7_RPROC_CMA_BASE_IPU1                      0x9e000000
    #define DRA7_RPROC_CMA_BASE_IPU2                      0x99000000
    #define DRA7_RPROC_CMA_BASE_DSP1                      0xa1000000
    #define DRA7_RPROC_CMA_BASE_DSP2                      0xA3000000
    #define DRA7_RPROC_CMA_SIZE_IPU1                      0x02000000
    #define DRA7_RPROC_CMA_SIZE_IPU2                      0x05000000
    #define DRA7_RPROC_CMA_SIZE_DSP1                      0x02000000
    #define DRA7_RPROC_CMA_SIZE_DSP2                      0x02000000
    best regards!
  • Hi fanok,

    From the code snippets you shared, it looks like the kernel DTS describes the CMA for DSP1 as 0xa1000000 + 64MB and the the same for DSP starts at 0xa3000000

    Does this mean you have overlapping reserved memory entries. Please check your bootlog for message like "overlap detected"

    You need to make sure that all CMA regions are exclusive of each other.

    Regards,

    Nikhil D

  • hi Nikhil D,

    In DTS, dsp1 cmem pool config is :

    &dsp1_cma_pool {
           reg = <0x0 0xa1000000 0x0 0x2000000>;
    };

    it is 32 M not overlap 0xa3000000

    best regards!

  • Hi fanok,

    I am not sure why you are getting the ENOMEM error from the driver.

    Please try to boot only the DSP1 core and see if the behavior changes

    Nikhil D

  • hi NiKhil D,

    i try only boot DSP1, the same error occured.

    best regards!

  • Hi fanok,

    Do you have more info on the debug?

  • hi Nikhil D,

    it is the same error log:

    carveout rsc: da a1200000, pa 0, len 1800000, flags 0
    failed to allocate carveout rsc: da a1200000, pa 0, len 1800000, flags 0
    handle_resources failed: -12
    load_elf_image_phdr returned error for core DSP1
    Error loading remotecore DSP1!,Continuing with boot ...

    best regards!

  • HI Nikhil D,

    I get memory config from vision_sdk_ipu2_release.xem4.map, as following:

    MEMORY CONFIGURATION
             name            origin    length      used     unused   attr    fill
    ----------------------  --------  ---------  --------  --------  ----  --------
      L2_ROM                00000000   00004000  00000184  00003e7c  RWIX
      L2_RAM                20000000   00010000  00000000  00010000  RWIX
      OCMC_RAM1             40300000   00080000  00000000  00080000  RWIX
      OCMC_RAM2             40400000   00100000  00000000  00100000  RWIX
      OCMC_RAM3             40500000   00100000  00000000  00100000  RWIX
      DSP1_L2_SRAM          40800000   00048000  00000000  00048000  RWIX
      NDK_MEM               84000000   00200000  00000000  00200000  RWIX
      SR1_BUFF_ECC_ASIL_MEM 84200000   00001000  00000000  00001000  RWIX
      SR1_BUFF_ECC_QM_MEM   84201000   00001000  00000000  00001000  RWIX
      SR1_BUFF_NON_ECC_ASIL 84202000   00001000  00000000  00001000  RWIX
      SR1_FRAME_BUFFER_MEM  84203000   07a00000  00000000  07a00000  RWIX
      IPU2_CODE_MEM         99000000   00800000  0018f69f  00670961  RWIX
      IPU2_DATA_MEM         99800000   01400000  00596e18  00e691e8  RWIX
      IPU1_0_CODE_MEM       9e000000   00800000  00000000  00800000  RWIX
      IPU1_0_DATA_MEM       9e800000   01400000  00000000  01400000  RWIX
      SR0                   a0100000   00100000  00100000  00000000  RWIX
      REMOTE_LOG_MEM        a0200000   00040000  000278a0  00018760  RWIX
      LINK_STATS_MEM        a0240000   00080000  00024df4  0005b20c  RWIX
      SYSTEM_IPC_SHM_MEM    a02c0000   00080000  00062100  0001df00  RWIX
      HDVPSS_DESC_MEM       a0340000   00100000  0001b6c0  000e4940  RWIX
      TRACE_BUF             a0440000   00060000  00008000  00058000  RWIX
      EXC_DATA              a04a0000   00010000  00000000  00010000  RWIX
      PM_DATA               a04b0000   00080000  00000000  00080000  RWIX
      DSP1_CODE_MEM         a1000000   00200000  00000000  00200000  RWIX
      DSP1_DATA_MEM         a1200000   01800000  00000000  01800000  RWIX
      FALLBACK_CLUSTER_PNG_ a6000000   01000000  00000000  01000000  RWIX
      VSDK_RESOURCE_ARRAY_M a7000000   02000000  00000000  02000000  RWIX
      SR2_MEM               a9000000   04000000  00000000  04000000  RWIX
    and i setting the temp load adress in spl as following:
    #define MAX_REMOTECORE_BIN_SIZE (8*0x100000)
    /* Define the address to which the IPU1 binary is
     * loaded from persistent storage
     * 0xa0000000 ~ 0xa1000000 (16M) for IPU1 and IPU2
     * 0xa5000000 ~ 0xa6000000 (16M) for DSP1 and DSP2
     * This change is according to VsionSDK sample_app/build/tda2ex/mem_segment_definition_linux.xs
     */
    #define IPU1_LOAD_ADDR          (0xa0000000)
    /*
     * Set load address  for each core 8 MB after load
     * address for the previous core
     */
    #define IPU2_LOAD_ADDR          (IPU1_LOAD_ADDR+MAX_REMOTECORE_BIN_SIZE)
    #define DSP1_LOAD_ADDR          (0xa5000000)
    #define DSP2_LOAD_ADDR          (DSP1_LOAD_ADDR+MAX_REMOTECORE_BIN_SIZE)
    this setting has problem? i think this DSP1 load address is not overlap any occupied address.
    best regards!
  • Hi fanok,

    I could not get any clue now. Will get back to you on this issue.

    Thanks

    RamPrasad

  • Hi Fanok,

    Early boot late attach is tested for DSP cores with VisionSDK v3.7.

    Can you check with his version of SDK if there are any changes in memory maps?

    Thanks

    RamPrasad

  • Hi fanok,

    Please increase DRA7_RPROC_MAX_CMA_SIZE in lateatach.c from 96MB and try. Looks like 96MB is not sufficient to allocate your firmwares.

    Thanks

    RamPrasad

  • hi RamPrasad,

    i enlarge DRA7_RPROC_MAX_CMA_SIZE to 192M, but also fail.

    U-Boot SPL 2018.01-00430-ga502eda-dirty (Oct 22 2019 - 18:25:03)
    DRA722-GP ES2.1
    [TICK 00020] spl_board_init: i2c begin
    [TICK 00026] spl_board_init: i2c end
    [TICK 00046] Trying to boot from MMC1
    spl: loading remote core image dra7-ipu2-fw.xem4
    no pinctrl state for default mode
    i2c_write: error waiting for addr ACK (status=0x116)
    tps65903x: could not set LDO1 voltage.
    [TICK 00064] spl_mmc_find_device: mmc_initialize cost 11
    spl: loading remote core image dra7-dsp1-fw.xe66
    [TICK 00326] spl_mmc_find_device: mmc_initialize cost 0
    failed to allocate carveout rsc: da a1200000, pa 0, len 1800000, flags 0
    handle_resources failed: -12
    load_elf_image_phdr returned error for core DSP1
    Error loading remotecore DSP1!,Continuing with boot ...
    [TICK 00429] spl_mmc_find_device: mmc_initialize cost 0
    [TICK 00434] spl_mmc_load_image: mmc_init cost 0
    spl: mmc boot mode: fs
    [TICK 00466] spl_mmc_do_fs_boot: load u-boot.img err 0 cost 26
    [TICK 00471] spl_mmc_load_resource begin
    SPL Load resource IN....
    [TICK 00477] spl_mmc_find_device: mmc_initialize cost 0
    >>>>>>>> SPL Load: png_res.data, size = 1527576 in phyaddr: 0xa6000000
    [TICK 00557] spl_mmc_load_resource end
    [TICK 00560] image entry point: 0x80800000
    [TICK 00564] uboot init
    [TICK 00659] serial cost 88
    [TICK 00664] DRAM:  2 GiB
    [TICK 00679] begin init r
    [TICK 00704] initr_dm cost 11
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1

    best regards!

  • hi RamPrasad,

    i had fix this problem, modify the code in lateattach.c

    from

    mem_count = (cfg->cma_size >> PAGE_SHIFT);

    to

    mem_count = (DRA7_RPROC_MAX_CMA_SIZE >> PAGE_SHIFT);