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.

TDA4VM: TDA4VM: kernel hang when DDR 4G changed to 1.5G

Part Number: TDA4VM

         We used 4GB of DDR memory before, and the linux system run normal, recently we changed the DDR 4GB to 1.5GB, and correspondingly modified the DDR memory node in uboot and kernel as follow:

update bootargs to  console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000  root=PARTUUID=3946f6eb-02 rootfs=ext4 rw rootwait loglevel=8 cma=32M mem=1536M.

      The error is printed as follows

   

   Compared with the DDR configuration of 4G, there are the following problems

  Question 1: 0xFC000000~0xFFFFFFFF. why Last 64MB is used by Linux

  Question 1: 0x80000000~0x9FFFFFFF. Is the above address reserved for Linux?

   The relevant files of 4G DDR configuration are shown in the figure below:

  • Hi Wang,

    Could you please remove all the reserved-memory nodes & their references in DTS? That should help booting.
    Also changes need to be done in U-Boot as well. Have you done that? Can you share the U-Boot logs as well?

    - Keerthy

  • hi  keerthy

        Could you please remove all the reserved-memory nodes & their references in DTS? That should help booting.

    >>>>I has modify kernel dts about  the reserved-memory nodes

    Also changes need to be done in U-Boot as well. Have you done that? Can you share the U-Boot logs as well?

    >>>>  At present, my DDR is 4G, but the kernel address is forcibly modified to 1.5g, so u-boot is not modify.

       Please explain the following two questions, thank you

      Question 1: 0xFC000000~0xFFFFFFFF. why Last 64MB is used by Linux

      Question 1: 0x80000000~0x9FFFFFFF. Is the above address reserved for Linux?

  •   Question 1: 0x80000000~0x9FFFFFFF. Is the above address reserved for Linux?

    Yes typically this will be used by Linux. Basically whatever is marked as reserved-memory in DT will not be touched by Linux but the rest will be used by Linux.

      Question 1: 0xFC000000~0xFFFFFFFF. why Last 64MB is used by Linux

    Why is this question being asked? There are custom boards with 1GB that have booted Linux. So what is the issue with last 64MB?

    - Keerthy

  •        Thank you for your answer, At present, I have remove all the reserved-memory nodes & their references in DTS,But the kernel still hang,

    If  the other customer can start it on 1g DDR, please guide how to modify it. Thank you

  • Hi Wang,

    This is on a slightly older SDK but similar changes should be done on latest to switch to 1GB DDR on U-Boot:

    From 4eddcabeb3a71909f5f1d4cbe17b6b9a64c88e68 Mon Sep 17 00:00:00 2001
    From: Vishal Mahaveer <vishalm@ti.com>
    Date: Wed, 22 Jan 2020 17:37:55 -0600
    Subject: [PATCH 2/2] Changes for 1GB DDR
    
    Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
    ---
     arch/arm/dts/k3-j721e-som-p0.dtsi       |  5 ++---
     arch/arm/dts/k3-j721e-som-tps65917.dtsi |  3 +--
     arch/arm/mach-k3/arm64-mmu.c            |  8 +-------
     board/ti/j721e/evm.c                    | 20 +++++---------------
     configs/j721e_evm_a72_defconfig         |  2 +-
     include/configs/j721e_evm.h             |  3 ---
     6 files changed, 10 insertions(+), 31 deletions(-)
    
    diff --git a/arch/arm/dts/k3-j721e-som-p0.dtsi b/arch/arm/dts/k3-j721e-som-p0.dtsi
    index ff6b141a30..c11097700b 100644
    --- a/arch/arm/dts/k3-j721e-som-p0.dtsi
    +++ b/arch/arm/dts/k3-j721e-som-p0.dtsi
    @@ -10,9 +10,8 @@
     / {
     	memory@80000000 {
     		device_type = "memory";
    -		/* 4G RAM */
    -		reg = <0x00000000 0x80000000 0x00000000 0x80000000>,
    -		      <0x00000008 0x80000000 0x00000000 0x80000000>;
    +		/* 1G RAM */
    +		reg = <0x00000000 0x80000000 0x00000000 0x40000000>;
     	};
     
     	reserved_memory: reserved-memory {
    diff --git a/arch/arm/dts/k3-j721e-som-tps65917.dtsi b/arch/arm/dts/k3-j721e-som-tps65917.dtsi
    index f614525f38..2c05c1d707 100644
    --- a/arch/arm/dts/k3-j721e-som-tps65917.dtsi
    +++ b/arch/arm/dts/k3-j721e-som-tps65917.dtsi
    @@ -11,8 +11,7 @@
     	memory@80000000 {
     		device_type = "memory";
     		/* 4G RAM */
    -		reg = <0x00000000 0x80000000 0x00000000 0x80000000>,
    -		      <0x00000008 0x80000000 0x00000000 0x80000000>;
    +		reg = <0x00000000 0x80000000 0x00000000 0x40000000>;
     	};
     
     	reserved_memory: reserved-memory {
    diff --git a/arch/arm/mach-k3/arm64-mmu.c b/arch/arm/mach-k3/arm64-mmu.c
    index f0ae671b09..2bc522e50f 100644
    --- a/arch/arm/mach-k3/arm64-mmu.c
    +++ b/arch/arm/mach-k3/arm64-mmu.c
    @@ -93,13 +93,7 @@ struct mm_region j721e_mem_map[NR_MMU_REGIONS] = {
     	}, {
     		.virt = 0xbbc00000UL,
     		.phys = 0xbbc00000UL,
    -		.size = 0x44400000UL,
    -		.attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
    -			 PTE_BLOCK_INNER_SHARE
    -	}, {
    -		.virt = 0x880000000UL,
    -		.phys = 0x880000000UL,
    -		.size = 0x80000000UL,
    +		.size = 0x04400000UL,
     		.attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
     			 PTE_BLOCK_INNER_SHARE
     	}, {
    diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
    index 3e92d0f87f..44e9409bf3 100644
    --- a/board/ti/j721e/evm.c
    +++ b/board/ti/j721e/evm.c
    @@ -38,15 +38,11 @@ int board_init(void)
     
     int dram_init(void)
     {
    -#ifdef CONFIG_PHYS_64BIT
    -	gd->ram_size = 0x100000000;
    -#else
    -	gd->ram_size = 0x80000000;
    -#endif
    -
    +	gd->ram_size = 0x40000000;
     	return 0;
     }
     
    +#if 0
     ulong board_get_usable_ram_top(ulong total_size)
     {
     #ifdef CONFIG_PHYS_64BIT
    @@ -57,20 +53,14 @@ ulong board_get_usable_ram_top(ulong total_size)
     
     	return gd->ram_top;
     }
    +#endif
     
     int dram_init_banksize(void)
     {
     	/* Bank 0 declares the memory available in the DDR low region */
     	gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
    -	gd->bd->bi_dram[0].size = 0x80000000;
    -	gd->ram_size = 0x80000000;
    -
    -#ifdef CONFIG_PHYS_64BIT
    -	/* Bank 1 declares the memory available in the DDR high region */
    -	gd->bd->bi_dram[1].start = CONFIG_SYS_SDRAM_BASE1;
    -	gd->bd->bi_dram[1].size = 0x80000000;
    -	gd->ram_size = 0x100000000;
    -#endif
    +	gd->bd->bi_dram[0].size = 0x40000000;
    +	gd->ram_size = 0x40000000;
     
     	return 0;
     }
    diff --git a/configs/j721e_evm_a72_defconfig b/configs/j721e_evm_a72_defconfig
    index e874be9dc6..ae1f5fe454 100644
    --- a/configs/j721e_evm_a72_defconfig
    +++ b/configs/j721e_evm_a72_defconfig
    @@ -15,7 +15,7 @@ CONFIG_SPL_LIBDISK_SUPPORT=y
     CONFIG_SPL_SPI_FLASH_SUPPORT=y
     CONFIG_SPL_SPI_SUPPORT=y
     CONFIG_DISTRO_DEFAULTS=y
    -CONFIG_NR_DRAM_BANKS=2
    +CONFIG_NR_DRAM_BANKS=1
     # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
     CONFIG_SPL_LOAD_FIT=y
     CONFIG_OF_BOARD_SETUP=y
    diff --git a/include/configs/j721e_evm.h b/include/configs/j721e_evm.h
    index e68920dc38..b8b53d990a 100644
    --- a/include/configs/j721e_evm.h
    +++ b/include/configs/j721e_evm.h
    @@ -18,9 +18,6 @@
     
     #define CONFIG_ENV_SIZE			(128 << 10)
     
    -/* DDR Configuration */
    -#define CONFIG_SYS_SDRAM_BASE1		0x880000000
    -
     /* SPL Loader Configuration */
     #if defined(CONFIG_TARGET_J721E_A72_EVM)
     #define CONFIG_SPL_TEXT_BASE		0x80080000
    -- 
    2.17.1
    
    

    Best Regards,
    Keerthy

  • U-Boot SPL 2020.01-g (Nov 29 2021 - 15:50:28 +0800)
    SYSFW ABI: 3.1 (firmware rev 0x0015 '21.1.1--v2021.01a (Terrific Lla')
    Reading on-board EEPROM at 0x50 failed 1
    Trying to boot from MMC2
    Starting ATF on ARM64 core...

    NOTICE: BL31: v2.4(release):2021.00.001-dirty
    NOTICE: BL31: Built : 18:29:40, Sep 30 2021

    U-Boot SPL 2020.01-g (Nov 29 2021 - 16:20:58 +0800)
    SYSFW ABI: 3.1 (firmware rev 0x0015 '21.1.1--v2021.01a (Terrific Lla')
    Reading on-board EEPROM at 0x50 failed 1
    Trying to boot from MMC2
    i2c_write: error waiting for data ACK (status=0x116)
    Error reading output register


    U-Boot 2020.01-g (Nov 29 2021 - 16:20:58 +0800)

    SoC: J721E SR2.0
    Model: Texas Instruments K3 J721E SoC
    Reading on-board EEPROM at 0x50 failed 1
    Board: J721EX-PM1-SOM rev E2
    DRAM: 1 GiB
    not found for dev hbmc-mux
    Flash: 0 Bytes
    MMC: sdhci@4f80000: 0, sdhci@4fb0000: 1
    In: serial@2800000
    Out: serial@2800000
    Err: serial@2800000
    Reading on-board EEPROM at 0x50 failed 1
    Net: Could not get PHY for ethernet@46000000: addr 0
    phy_connect() failed
    No ethernet found.

    Hit any key to stop autoboot: 0
    i2c_write: error waiting for data ACK (status=0x116)
    Error reading output register
    switch to partitions #0, OK
    mmc1 is current device
    i2c_write: error waiting for data ACK (status=0x116)
    Error reading output register
    SD/MMC found on device 1
    817 bytes read in 4 ms (199.2 KiB/s)
    Loaded env from uEnv.txt
    Importing environment from mmc1 ...
    Running uenvcmd ...
    12230664 bytes read in 511 ms (22.8 MiB/s)
    108100 bytes read in 9 ms (11.5 MiB/s)
    ## Flattened Device Tree blob at 88000000
    Booting using the fdt blob at 0x88000000
    Loading Device Tree to 000000008fee2000, end 000000008fffffff ... OK

    Starting kernel ...

    [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd080]
    [ 0.000000] Linux version 5.4.106+ (oe-user@oe-host) (gcc version 9.2.1 20191025 (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10))) #1 SMP PREEMPT Mon Nov 29 15:53:04 CST 2021
    [ 0.000000] Machine model: Texas Instruments K3 J721E SoC
    [ 0.000000] earlycon: ns16550a0 at MMIO32 0x0000000002800000 (options '')
    [ 0.000000] printk: bootconsole [ns16550a0] enabled
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a0000000, size 1 MiB
    [ 0.000000] OF: reserved mem: initialized node vision-apps-r5f-dma-memory@a0000000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a0100000, size 15 MiB
    [ 0.000000] OF: reserved mem: initialized node vision_apps-r5f-memory@a0100000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a2000000, size 1 MiB
    [ 0.000000] OF: reserved mem: initialized node vision-apps-r5f-dma-memory@a2000000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a2100000, size 31 MiB
    [ 0.000000] OF: reserved mem: initialized node vision-apps-r5f-memory@a2100000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000b2000000, size 96 MiB
    [ 0.000000] OF: reserved mem: initialized node vision-apps-dma-memory@b2000000, compatible id shared-dma-pool
    [ 0.000000] OF: reserved mem: initialized node vision_apps_shared-memories, compatible id dma-heap-carveout
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000b9000000, size 32 MiB
    [ 0.000000] OF: reserved mem: initialized node vision-apps-core-heap-memory-lo@b9000000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000008bb000000, size 32 MiB
    [ 0.000000] OF: reserved mem: initialized node vision-apps-core-heap-memory-hi@bb0000000, compatible id shared-dma-pool
    [ 0.000000] cma: Failed to reserve 512 MiB
    [ 0.000000] On node 0 totalpages: 18446744073709527424
    [ 0.000000] DMA zone: 16 pages used for memmap
    [ 0.000000] DMA zone: 0 pages reserved
    [ 0.000000] DMA zone: 16384 pages, LIFO batch:3
    [ 0.000000] DMA32 zone: 18446744073709511040 pages, LIFO batch:3
    [ 0.000000] psci: probing for conduit method from DT.
    [ 0.000000] psci: PSCIv1.1 detected in firmware.
    [ 0.000000] psci: Using standard PSCI v0.2 function IDs
    [ 0.000000] psci: Trusted OS migration not required
    [ 0.000000] psci: SMC Calling Convention v1.0
    [ 0.000000] percpu: Embedded 2 pages/cpu s48472 r8192 d74408 u131072
    [ 0.000000] pcpu-alloc: s48472 r8192 d74408 u131072 alloc=2*65536
    [ 0.000000] pcpu-alloc: [0] 0 [0] 1
    [ 0.000000] Detected PIPT I-cache on CPU0
    [ 0.000000] CPU features: detected: GIC system register CPU interface
    [ 0.000000] CPU features: detected: EL2 vector hardening
    [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: -24208
    [ 0.000000] Kernel command line: console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 video=vfb:1920x1080,1920x3240,18 root=PARTUUID=5b37039a-02 rootfs=ext4 rw rootwait loglevel=8

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

        Thank you for your reply, According to the modification of the patch file, uboot can recognize 1g DDR, But the kernel still hang, At present, I have remove all the reserved-memory nodes & their references in DTS for kernel, Does the kernel need any other changes?

  • [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a0000000, size 1 MiB
    [ 0.000000] OF: reserved mem: initialized node vision-apps-r5f-dma-memory@a0000000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a0100000, size 15 MiB
    [ 0.000000] OF: reserved mem: initialized node vision_apps-r5f-memory@a0100000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a2000000, size 1 MiB
    [ 0.000000] OF: reserved mem: initialized node vision-apps-r5f-dma-memory@a2000000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a2100000, size 31 MiB
    [ 0.000000] OF: reserved mem: initialized node vision-apps-r5f-memory@a2100000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000b2000000, size 96 MiB
    [ 0.000000] OF: reserved mem: initialized node vision-apps-dma-memory@b2000000, compatible id shared-dma-pool
    [ 0.000000] OF: reserved mem: initialized node vision_apps_shared-memories, compatible id dma-heap-carveout
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000b9000000, size 32 MiB
    [ 0.000000] OF: reserved mem: initialized node vision-apps-core-heap-memory-lo@b9000000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000008bb000000, size 32 MiB
    [ 0.000000] OF: reserved mem: initialized node vision-apps-core-heap-memory-hi@bb0000000, compatible id shared-dma-pool
    [ 0.000000] cma: Failed to reserve 512 MiB

    Wang,

    The above shows you are still reserving memories from vision_apps.dts Can you please remove them as well?

    Best Regards,
    Keerthy