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.

TDA4VEN-Q1: Reduced memory for ddr

Part Number: TDA4VEN-Q1
Other Parts Discussed in Thread: AM62P

Tool/software:

Hi, experts ,

board: J722SXH01

sdk: 10_00_00_08

I want to use only 2 GiB of ram on evm board, default is 8 GiB. I have made the following changes:

--- a/ti-processor-sdk-linux-adas-j722s-evm-10_00_00_08/board-support/ti-u-boot-2024.04+git/arch/arm/dts/k3-j722s-evm.dts
+++ b/ti-processor-sdk-linux-adas-j722s-evm-10_00_00_08/board-support/ti-u-boot-2024.04+git/arch/arm/dts/k3-j722s-evm.dts
@@ -33,8 +33,8 @@

memory@80000000 {
/* 8G RAM */
- reg = <0x00000000 0x80000000 0x00000000 0x80000000>,
- <0x00000008 0x80000000 0x00000001 0x80000000>;
+ reg = <0x00000000 0x80000000 0x00000000 0x80000000>;
+ // <0x00000008 0x80000000 0x00000001 0x80000000>;
device_type = "memory";
bootph-all;
};

--- a/ti-processor-sdk-linux-adas-j722s-evm-10_00_00_08/board-support/ti-linux-kernel-6.6.32+git-ti/arch/arm64/boot/dts/ti/k3-j722s-evm.dts
+++ b/ti-processor-sdk-linux-adas-j722s-evm-10_00_00_08/board-support/ti-linux-kernel-6.6.32+git-ti/arch/arm64/boot/dts/ti/k3-j722s-evm.dts
@@ -31,8 +31,8 @@ chosen {

memory@80000000 {
/* 8G RAM */
- reg = <0x00000000 0x80000000 0x00000000 0x80000000>,
- <0x00000008 0x80000000 0x00000001 0x80000000>;
+ reg = <0x00000000 0x80000000 0x00000000 0x80000000>;
+ // <0x00000008 0x80000000 0x00000001 0x80000000>;
device_type = "memory";
bootph-all;
};

uboot has recognised 2 GiB but it is stuck in the kernel, please let me know if i need to change anything else?

evm_kernel_hang.logevm_start_ok.log

Best Regards,

Bing

  • Hi,

    FAQ: https://e2e.ti.com/f/791/t/1224003

    Default is for 16GB. The FAQ shows how to reduce it to 4GB. So similar steps can be followed to reduce to 2GB.

    Thanks,
    Keerthy

  • Hi,Keerthy

    The version of sdk I am using is 10_00_00_08,there is no dram_init_banksize function in evm.c.

    Best Regards,

    Bing

  • Hi Bing,

    The version of sdk I am using is 10_00_00_08,there is no dram_init_banksize function in evm.

    Skip that change, it is no longer needed.

    diff --git a/arch/arm/dts/k3-j721s2-ddr.dtsi b/arch/arm/dts/k3-j721s2-ddr.dtsi
    index 6a244fb7ac..7dabc2999b 100644
    --- a/arch/arm/dts/k3-j721s2-ddr.dtsi
    +++ b/arch/arm/dts/k3-j721s2-ddr.dtsi
    @@ -2230,6 +2230,7 @@
     		};
     
     		memorycontroller1: memorycontroller@29b0000 {
    +			status = "disabled";
     			compatible = "ti,j721s2-ddrss";
     			reg = <0x0 0x029b0000 0x0 0x4000>,
     			      <0x0 0x0114000 0x0 0x100>;
    diff --git a/arch/arm/dts/k3-j721s2-som-p0.dtsi b/arch/arm/dts/k3-j721s2-som-p0.dtsi
    index f3080e948e..9e91110d90 100644
    --- a/arch/arm/dts/k3-j721s2-som-p0.dtsi
    +++ b/arch/arm/dts/k3-j721s2-som-p0.dtsi
    @@ -13,9 +13,9 @@
     / {
     	memory@80000000 {
     		device_type = "memory";
    -		/* 16 GB RAM */
    +		/* 4 GB RAM */
     		reg = <0x00 0x80000000 0x00 0x80000000>,
    -		      <0x08 0x80000000 0x03 0x80000000>;
    +		      <0x08 0x80000000 0x00 0x80000000>;
     	};
    

    The above should suffice. Let me know if that helps.

    - Keerthy

  • Hi,Keerthy

    board: J722SXH01

    I am using j722sx and I checked all the associated device trees and there is no memorycontroller node.

    Best Regards,

    Bing

  • Hi Bing,

    Understood. Can you just do the U-Boot changes alone and try to boot with the default kernel DTB?

    - Keerthy

  • Hi,Keerthy

    I changed the uboot alone, and it still does the same thing.

    Best Regards,

    Bing

  • Okay. I will reproduce the issue and get back to you.

    Thanks for trying out the suggestions.

    - Keerthy

  • Hi,Keerthy

    You're welcome, please keep us posted if you get any new developments, thanks!

    Best Regards,

    Bing

  • Hello Bing,

    I have reproduced the issue. Even with 4GB DDR i am observing the issue. My first suspect is some of the reserved memories are still accessing
    beyond the reduced region. I will keep you posted.

    - Keerthy

  • HI Bing,

    Please use the patch below:

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/0001_2D00_arm_2D00_mach_2D00_k3_2D00_j722s_2D00_am62p_2D00_Fixup_2D00_TF_2D00_A_2D00_OP_2D00_TEE_2D00_reserved_2D00_m.patch

    Apply the above patch in U-Boot.

    Fix up the mmu as well:

    diff --git a/arch/arm/mach-k3/arm64-mmu.c b/arch/arm/mach-k3/arm64-mmu.c
    index 07edbde6..69ab06e9 100644
    --- a/arch/arm/mach-k3/arm64-mmu.c
    +++ b/arch/arm/mach-k3/arm64-mmu.c
    @@ -295,12 +295,14 @@ struct mm_region soc_mem_map[NR_MMU_REGIONS] = {
                    .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
                             PTE_BLOCK_INNER_SHARE
            }, {
    +#if 0
                    .virt = 0x880000000UL,
                    .phys = 0x880000000UL,
                    .size = 0x80000000UL,
                    .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
                             PTE_BLOCK_INNER_SHARE
            }, {
    +#endif
                    .virt = 0x500000000UL,
                    .phys = 0x500000000UL,
                    .size = 0x380000000UL,

    In the boot partition uEnv.txt:

    #dorprocboot=1
    #name_overlays=ti/k3-j722s-vision-apps.dtbo

    comment out the above as the default vision_apps needs bigger DDR footprint .

    With that I was able to go past the issue you have seen but remote cores are erring out and causes reset just before Linux command prompt.

    - Keerthy

    - Keerthy

  • Hi,Keerthy

    Yes, following your instructions I am now able to get to the linux shell, but the remote kernel load fails as follows:

    [ 11.123907] OF: graph: no port node found in /bus@f0000/dss@30220000/oldi-txes/oldi@1/ports
    [ 11.126338] remoteproc remoteproc4: powering up 78400000.r5f
    [ 11.140526] remoteproc remoteproc4: Booting fw image j722s-main-r5f0_0-fw, size 1084320
    [ 11.149562] OF: graph: no port node found in /bus@f0000/dss@30220000/oldi-txes/oldi@1/ports
    [ 11.152275] remoteproc remoteproc4: bad phdr da 0xa3ffec00 mem 0x1400
    [ 11.166166] remoteproc remoteproc4: Failed to load program segments: -22

    Is it because the device tree is missing the dss@30220000 node? How can I fix it, because later our project resource allocation will not allocate dss on A core.

    Best Regards,

    Bing

  • Hi Bing,

    Currently vision_apps is also disabled. So my first question is what is the end use case for this project?
    I believe you need vision_apps features right?

    - Keerthy

  • Hi,Keerthy

    I need vision_apps , but the dss resource will be used at main-r5f0_0.

    Best Regards,

    Bing

  • Hi Bing,

    Okay. I will let our vision_apps expert comment on how to change the memory map that fits into 2GB.
    Expect 1-2 days to analyze and get back. We will provide feedback here once we analyze.

    - Keerthy

  • Hi,

    Have you reduced the vision_apps memory map to fit into 2GB as well?

    Please refer the below documentation to modify the same.

    https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-j722s/10_00_00_05/exports/docs/psdk_rtos/docs/user_guide/developer_notes_memory_map.html

    Regards,

    Nikhil Dasan