AM625: 4GB memory access

Part Number: AM625

Tool/software:

I have a custom board design based on the AM6254.  It has 2 2GB SDRAM (MT40A2G8SA-062E IT:F) memories.  I can read/write both from u-boot.  I have added this to the device-tree:

memory@80000000 {
device_type = "memory";
    /* 4G RAM */
    reg = <0x00000000 0x80000000 0x00000000 0x80000000>,
             <0x00000008 0x80000000 0x00000000 0x80000000>;
};

But there was a kernel panic.  I also added this to the device-tree and now it boots but it only shows 2GB available:

upper_2gb: upper-2gb@880000000 {
reg = <0x00000008 0x80000000 0x00000000 0x80000000>;
alignment = <0x1000>;
no-map;
};

# cat /proc/meminfo
MemTotal: 1900324 kB
MemFree: 1813876 kB
MemAvailable: 1762648 kB

It looks like the other 2GB is reserved.  How do I fix this?  Here's the full dmesg:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 6.1.0-v0.07 (robotics@robotics-VirtualBox) (aarch64-buildroot-linux-gnu-gcc.br_real (Buildroot -gd87a181-dirty) 11.3.0, GNU ld (GNU Binutils) 2.38) #2 SMP PREEMPT Thu Dec 19 05:21:27 EST 2024
[ 0.000000] Machine model: Texas Instruments AM625 SK
[ 0.000000] earlycon: ns16550a0 at MMIO32 0x0000000002800000 (options '')
[ 0.000000] printk: bootconsole [ns16550a0] enabled
[ 0.000000] efi: UEFI not found.
[ 0.000000] Reserved memory: created DMA memory pool at 0x000000009db00000, size 12 MiB
[ 0.000000] OF: reserved mem: initialized node r5f-dma-memory@9db00000, compatible id shared-dma-pool
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem 0x0000000080000000-0x00000008ffffffff]
[ 0.000000] NUMA: NODE_DATA [mem 0xffbe0e00-0xffbe2fff]
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000080000000-0x00000000ffffffff]
[ 0.000000] DMA32 empty
[ 0.000000] Normal [mem 0x0000000100000000-0x00000008ffffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000080000000-0x000000009dafffff]
[ 0.000000] node 0: [mem 0x000000009db00000-0x000000009e6fffff]
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi Far,

    Please use the U-Boot and kernel from SDK10.0 on your board to see if you still have the kernel panic problem.

    I also added this to the device-tree and now it boots but it only shows 2GB available:

    upper_2gb: upper-2gb@880000000 {
    reg = <0x00000008 0x80000000 0x00000000 0x80000000>;
    alignment = <0x1000>;
    no-map;
    };

    This devicetree change is only for running memtester on the upper 2GB. It shouldn't be added for normal Linux use.

  • We're trying to resolve this quickly and switching to SDK10.0 is not an option.  Can you offer any other advice?  Here's the output if I remove the upper_2g:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    U-Boot 2022.10-rc1 (Dec 20 2024 - 11:22:44 -0500)
    SoC: AM62X SR1.0
    Model: Texas Instruments AM625 SK
    DRAM: 4 GiB
    Core: 32 devices, 16 uclasses, devicetree: separate
    MMC: mmc@fa10000: 2, mmc@fa00000: 1, mmc@fa20000: 3
    Loading Environment from nowhere... OK
    In: serial@2800000
    Out: serial@2800000
    Err: serial@2800000
    Net: Net Initialization Skipped
    No ethernet found.
    Hit any key to stop autoboot: 0
    => md.l 0x0f300020
    0f300020: 00000210 00000000 00000000 00000000 ................
    0f300030: 00000000 00000000 00000000 00000000 ................
    0f300040: 00000000 00000000 00000000 00000000 ................
    0f300050: 00000000 00000000 00000000 000003ff ................
    0f300060: 00000000 00000000 00000000 00000000 ................
    0f300070: 00000000 00000000 00000000 00000000 ................
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi Far,

    => md.l 0x0f300020
    0f300020: 00000210 00000000 00000000 00000000 ................

    Please modify the register 0x0f300020 to value 0x211 at U-Boot command line then boot into Linux to see if this resolves the issue.

    => mw.l f300020 211

  • I modified the register to 0x211 and still have the same issue:

    [ 0.000000] Mem abort info:
    [ 0.000000] ESR = 0x0000000096000006
    [ 0.000000] EC = 0x25: DABT (current EL), IL = 32 bits
    [ 0.000000] SET = 0, FnV = 0
    [ 0.000000] EA = 0, S1PTW = 0
    [ 0.000000] FSC = 0x06: level 2 translation fault
    [ 0.000000] Data abort info:
    [ 0.000000] ISV = 0, ISS = 0x00000006
    [ 0.000000] CM = 0, WnR = 0
    [ 0.000000] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000082de8000
    [ 0.000000] [ffff00087fff8108] pgd=18000008ffff8003, p4d=18000008ffff8003
    [ 0.000000] Insufficient stack space to handle exception!
    [ 0.000000] ESR: 0x0000000096000006 -- DABT (current EL)
    [ 0.000000] FAR: 0xffff00087fff8108
    [ 0.000000] Task stack: [0xffff800008fd0000..0xffff800008fd4000]
    [ 0.000000] IRQ stack: [0x0000000000000000..0x0000000000004000]
    [ 0.000000] Overflow stack: [0xffff00087f778300..0xffff00087f779300]
    [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 6.1.0-v0.07 #2
    [ 0.000000] Hardware name: Texas Instruments AM625 SK (DT)
    [ 0.000000] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    [ 0.000000] pc : die_kernel_fault+0x2b0/0x358
    [ 0.000000] lr : die_kernel_fault+0x244/0x358
    [ 0.000000] sp : ffff800008fcffc0
    [ 0.000000] x29: ffff800008fcffc0 x28: ffff800008fe3300 x27: 00000000fff7af40
    [ 0.000000] x26: 0000000000000000 x25: ffff800008d79000 x24: 18000008ffff8003
    [ 0.000000] x23: 0000000000000108 x22: ffff00087fff8000 x21: ffff800008fd00d0
    [ 0.000000] x20: ffff00087fff8108 x19: 0000000096000006 x18: ffffffffffffffff
    [ 0.000000] x17: 3030666666662073 x16: 736572646461206c x15: ffff8000090e5990
    [ 0.000000] x14: 0000000000000010 x13: 3330303866666666 x12: 3830303030303831
    [ 0.000000] x11: ffff800008ff2520 x10: ffff800008ff2520 x9 : 00000000ffffefff
    [ 0.000000] x8 : ffff80000904a520 x7 : 0000000000017fe8 x6 : fffffffffffe46b0
    [ 0.000000] x5 : 40000000fffff163 x4 : 0000000000000163 x3 : 0000000000000000
    [ 0.000000] x2 : 0000000000000000 x1 : 0000000080000000 x0 : ffff800008cbf320
    [ 0.000000] Kernel panic - not syncing: kernel stack overflow

  • Hi Far,

    Happy New Year!

    Please provide your DDR config in U-Boot devicetree, and I will let our DDR expert to review it.

  • memory@80000000 {
    device_type = "memory";
    /* 4G RAM */
    reg = <0x00000000 0x80000000 0x00000000 0x80000000>,
    <0x00000008 0x80000000 0x00000000 0x80000000>;
    };

    Using u-boot 2022.10-rc1, it's detected and can be read/written correctly.  However, I'm unable to boot Linux-6.1

  • Hi Far,

    Sorry, I meant the DDR config generated by the DDR config tool. For your reference, it is the U-Boot file arch/arm/dts/k3-am62x-sk-ddr4-1600MTs.dtsi for the SK EVM. Please provide the corresponding file for your board for 4GB DDR.

  • We are using the same file as the SK EVM.  I believe it's k3-am62-ddr.dtsi and k3-am64-ddr.dtsi in 2022.10-rc1:

    // SPDX-License-Identifier: GPL-2.0+
    /*
    * Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/
    */

    #include "k3-am64-ddr.dtsi"
    &memorycontroller {
    power-domains = <&k3_pds 170 TI_SCI_PD_SHARED>,
    <&k3_pds 55 TI_SCI_PD_SHARED>;
    clocks = <&k3_clks 170 0>, <&k3_clks 16 4>;

    We're using two MT40A2G8 chips:


    };

  • It appears your board DDR device is different from that on the SK EVM. You shouldn't reuse the DDR config for the EVM.

    I am looping in our DDR expert for additional comments about DDR config.

  • It is but it seems to work i.e. we can access both DDR devices from uboot.

  • Far, 

    with that DDR topology, you need to use the DDR register configuration tool: https://dev.ti.com/sysconfig/?product=Processor_DDR_Config&device=AM62x to generate an appropriate configuration for DDR.  Please check the README link in the tool for instructions.

    For the topology you have, ensure you set the following:

    Data Bus width (per device): 8

    Density (per device): 16Gb

    Chip Selects: 1

    Then build in the appropriate output file from the tool (*.dtsi) as described in the instructions. 

    To test 4GB access, ensure you can uniquely read/write addresses in the 0x80000000-0xFFFFFFFF range, and 0x880000000-0x8FFFFFFFF range.  Ensure these do not alias.  For example, write a value to 0x80000000 and ensure it doesn't affect the value at 0x880000000

    Regards,

    James

  • I replaced k3-am62x-sk-ddr4-1600MTs.dtsi file with the one below, regenerated the u-boot.img and the device no longer boots:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    // SPDX-License-Identifier: GPL-2.0+
    /*
    * This file was generated with the
    * AM623/AM625 SysConfig DDR Configuration Tool for AM64x, AM625, AM623, AM62Ax, AM62Px, AM62Dx v0.10.10
    * Wed Jan 08 2025 10:21:54 GMT-0500 (Eastern Standard Time)
    * DDR Type: DDR4
    * Frequency = 800MHz (1600MTs)
    * Density: 16Gb
    * Number of Ranks: 1
    */
    #define DDRSS_PLL_FHS_CNT 6
    #define DDRSS_PLL_FREQUENCY_1 400000000
    #define DDRSS_PLL_FREQUENCY_2 400000000
    #define DDRSS_SDRAM_IDX 16
    #define DDRSS_REGION_IDX 17
    #define DDRSS_CTL_0_DATA 0x00000A00
    #define DDRSS_CTL_1_DATA 0x00000000
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  • Need to ensure you replace the tiboot3.bin file as well.  This is what will contain the new DDR device tree info.

    It is but it seems to work i.e. we can access both DDR devices from uboot.

    Were you able to confirm that you can uniquely access all 4GB of memory with this working configuration?

    Regards,

    James

  • I still get a kernel panic with Linux 6.1

  • if you get a kernel panic, does this mean you can get to a u-boot prompt?  

    If so, please check you can uniquely access all 4GB from the u-boot prompt by reading/writing addresses 0x80000000 and 0x880000000

    Regards,

    James

  • => mw.l 80000000 1234
    => mw.l 880000000 abcd
    => md.l 80000000
    80000000: 00001234 ffff0000 ffff0000 ffff0000 4...............
    => md.l 880000000
    880000000: 0000abcd ffff0000 ffff0000 ffff0000 ................

  • Hi Far,

    Using u-boot 2022.10-rc1, it's detected and can be read/written correctly.  However, I'm unable to boot Linux-6.1

    The U-Boot doesn't sound like coming from the Processor SDK. The U-Boot provided in SDK v9.x is based on tag 2023.04, while the U-Boot provided in the SDK v10.x is based on tag 2024.04.

    Please use the U-Boot package provided in the Processor SDK to see if the kernel panic still happens.

  • Switched to 2023.04 and still have the same problem:

    U-Boot 2023.04 (Jan 09 2025 - 10:58:41 -0500)

    SoC: AM62X SR1.0 GP
    Model: Texas Instruments AM625 SK
    DRAM: 2 GiB (effective 4 GiB)
    Core: 50 devices, 20 uclasses, devicetree: separate
    MMC: mmc@fa10000: 0, mmc@fa00000: 1, mmc@fa20000: 2
    Loading Environment from nowhere... OK
    In: serial@2800000
    Out: serial@2800000
    Err: serial@2800000
    Net: eth0: ethernet@8000000port@1
    Hit any key to stop autoboot: 0
    switch to partitions #0, OK
    mmc1 is current device
    SD/MMC found on device 1
    Failed to load 'boot.scr'
    21 bytes read in 6 ms (2.9 KiB/s)
    Loaded env from uEnv.txt
    Importing environment from mmc1 ...
    17613312 bytes read in 766 ms (21.9 MiB/s)
    29167 bytes read in 7 ms (4 MiB/s)
    Working FDT set to 88000000
    ## Flattened Device Tree blob at 88000000
    Booting using the fdt blob at 0x88000000
    Working FDT set to 88000000
    Loading Device Tree to 000000008fef5000, end 000000008fffffff ... OK
    Working FDT set to 8fef5000

    Starting kernel ...

    [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
    [ 0.000000] Linux version 6.1.0-v0.06 (robotics@robotics-VirtualBox) (aarch64-buildroot-linux-gnu-gcc.br_real (Buildroot -gd87a181-dirty) 11.3.0, GNU ld (GNU Binutils) 2.38) #1 SMP PREEMPT Wed Jan 8 13:47:31 EST 2025
    [ 0.000000] Machine model: Texas Instruments AM625 SK
    [ 0.000000] earlycon: ns16550a0 at MMIO32 0x0000000002800000 (options '')
    [ 0.000000] printk: bootconsole [ns16550a0] enabled
    [ 0.000000] efi: UEFI not found.
    [ 0.000000] Reserved memory: created DMA memory pool at 0x000000009db00000, size 12 MiB
    [ 0.000000] OF: reserved mem: initialized node r5f-dma-memory@9db00000, compatible id shared-dma-pool
    [ 0.000000] NUMA: No NUMA configuration found
    [ 0.000000] NUMA: Faking a node at [mem 0x0000000080000000-0x00000008ffffffff]
    [ 0.000000] NUMA: NODE_DATA [mem 0x8ff7dee00-0x8ff7e0fff]
    [ 0.000000] Zone ranges:
    [ 0.000000] DMA [mem 0x0000000080000000-0x00000000ffffffff]
    [ 0.000000] DMA32 empty
    [ 0.000000] Normal [mem 0x0000000100000000-0x00000008ffffffff]
    [ 0.000000] Movable zone start for each node
    [ 0.000000] Early memory node ranges
    [ 0.000000] node 0: [mem 0x0000000080000000-0x000000009dafffff]
    [ 0.000000] node 0: [mem 0x000000009db00000-0x000000009e6fffff]
    [ 0.000000] node 0: [mem 0x000000009e700000-0x000000009e77ffff]
    [ 0.000000] node 0: [mem 0x000000009e780000-0x000000009fffffff]
    [ 0.000000] node 0: [mem 0x00000000a0000000-0x00000000ffffffff]
    [ 0.000000] node 0: [mem 0x0000000880000000-0x00000008ffffffff]
    [ 0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x00000008ffffffff]
    [ 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.4
    [ 0.000000] percpu: Embedded 20 pages/cpu s43240 r8192 d30488 u81920
    [ 0.000000] Detected VIPT I-cache on CPU0
    [ 0.000000] CPU features: detected: GIC system register CPU interface
    [ 0.000000] CPU features: detected: ARM erratum 845719
    [ 0.000000] alternatives: applying boot alternatives
    [ 0.000000] Fallback order for Node 0: 0
    [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 1032192
    [ 0.000000] Policy zone: Normal
    [ 0.000000] Kernel command line: console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 root=PARTUUID=c69d8c3e-02 rw rootfstype=ext4 rootwait
    [ 0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
    [ 0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
    [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
    [ 0.000000] software IO TLB: area num 4.
    [ 0.000000] Unable to handle kernel paging request at virtual address ffff00007fc10000
    [ 0.000000] Mem abort info:
    [ 0.000000] ESR = 0x0000000096000047
    [ 0.000000] EC = 0x25: DABT (current EL), IL = 32 bits
    [ 0.000000] SET = 0, FnV = 0
    [ 0.000000] EA = 0, S1PTW = 0
    [ 0.000000] FSC = 0x07: level 3 translation fault
    [ 0.000000] Data abort info:
    [ 0.000000] ISV = 0, ISS = 0x00000047
    [ 0.000000] CM = 0, WnR = 1
    [ 0.000000] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000082de8000
    [ 0.000000] [ffff00007fc10000] pgd=18000008ffff8003, p4d=18000008ffff8003
    [ 0.000000] Unable to handle kernel paging request at virtual address ffff00087fff8008