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.

SK-AM62B: How to reduce reserved memory?

Part Number: SK-AM62B
Other Parts Discussed in Thread: SK-AM62

Hi Ti

Our custom board used SK-AM62 with 512MB DDR.

The reserved memory printed on kernel message is 93MB.

[    0.000000] Memory: 411808K/524288K available (10558K kernel code, 1102K rwdata, 4024K rodata, 3968K init, 338K bss, 96096K reserved, 16384K cma-reserved)

As far as I know the reserved memory are rtos_ipc_memory_region/mcu_m4fss_dma_memory_region/mcu_m4fss_memory_region/wkup_r5fss0_core0_dma_memory_region/wkup_r5fss0_core0_memory_region/lpm_ctx_ddr/secure_tfa_ddr/secure_ddr.

They are total about 56MB. According to kernel message, there should be about 37M(96096/1024 - 56).

Where could I get the rest reserved memory information, and could I reduce them?

Thanks

  • Hello Iron Kang,

    You can start by checking the Linux devicetree files to see which memory regions are getting reserved there.

    In terms of how to reduce the size of the reserved memory regions, depending on the region that is certainly doable. Please give me another day or so to provide more details there. Feel free to ping the thread if I have not responded again by Friday.

    Regards,

    Nick

  • Hi Nick

    This is out dts content about reserved memory.

    reserved-memory {
    #address-cells = <2>;
    #size-cells = <2>;
    ranges;

    rtos_ipc_memory_region: ipc-memories@94700000 {
    compatible = "shared-dma-pool";
    reg = <0x00 0x94700000 0x00 0x00300000>;
    no-map;
    };

    mcu_m4fss_dma_memory_region: m4f-dma-memory@94a00000 {
    compatible = "shared-dma-pool";
    reg = <0x00 0x94a00000 0x00 0x100000>;
    no-map;
    };

    mcu_m4fss_memory_region: m4f-memory@94b00000 {
    compatible = "shared-dma-pool";
    reg = <0x00 0x94b00000 0x00 0xe00000>;
    no-map;
    };

    wkup_r5fss0_core0_dma_memory_region: r5f-dma-memory@95900000 {
    compatible = "shared-dma-pool";
    reg = <0x00 0x95900000 0x00 0x00100000>;
    no-map;
    };

    wkup_r5fss0_core0_memory_region: r5f-memory@95a00000 {
    compatible = "shared-dma-pool";
    reg = <0x00 0x95a00000 0x00 0x00c00000>;
    no-map;
    };

    lpm_ctx_ddr: lpm-memory@96600000 {
    reg = <0x00 0x96600000 0x00 0x80000>;
    alignment = <0x1000>;
    };

    secure_tfa_ddr: tfa@96680000 {
    reg = <0x00 0x96680000 0x00 0x80000>;
    alignment = <0x1000>;
    no-map;
    };


    secure_ddr: optee@96700000 {
    reg = <0x00 0x96700000 0x00 0x01800000>; /* for OP-TEE */
    alignment = <0x1000>;
    no-map;
    };
    };

    Thanks

    Iron

  • Hello Iron,

    For more discussion, reference this other e2e thread:
    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1192832/am625-optimize-reserved-memory-configuration-in-dts

    Going down the list of memory regions you provided

    rtos_ipc_memory_region - not used by Linux. Can remove if unused by your M4F / R5F firmwares

    mcu_m4fss_dma_memory_region - contains the Linux RPMsg VIRTIO buffers. Don't reduce unless reducing number of VIRTIO buffers

    mcu_m4fss_memory_region - the first 4kB of this region is reserved for the resource table. The rest of the region is optional DDR space for the remote core to use. If the remote core does not use DDR, then this can be reduced to 4kB.

    wkup_r5fss0_core0_dma_memory_region - contains the Linux RPMsg VIRTIO buffers. Don't reduce unless reducing number of VIRTIO buffers

    wkup_r5fss0_core0_memory_region - the first 4kB of this region is reserved for the resource table. The rest of the region is optional DDR space for the remote core to use. Off the top of my head, I am not sure if the device management code running on the AM62x R5F uses DDR or not.

    lpm_ctx_ddr - I need to check with some team members on whether this is required

    secure_tfa_ddr - not suggested to remove, see the linked e2e thread

    secure_ddr - not suggested to remove, see the linked e2e thread

    Regards,

    Nick