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.

[FAQ] AM6548: How to configure 512MB*2 DDR ram in uboot?

Part Number: AM6548

Hi Ti,

We will use AM6548 SR2.0 to bring up our evm board, and there will be 512MB*2, total is 1GB ddr4 in our evm.

In this case, we have two question want to confirm with you.

1. How to modify the memory region in k3-am654-board-board.dts? The SDK is default for 4G.

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

2. In evm.c, we modify the ram_size as below, is that correct? I'm not sure if we need gd->bd->bi_dram[1] setting or not.

int dram_init(void)
{
#ifdef CONFIG_PHYS_64BIT
gd->ram_size = 0x40000000;//ERIC*
#else
gd->ram_size = 0x80000000;
#endif

return 0;
}

ulong board_get_usable_ram_top(ulong total_size)
{
#ifdef CONFIG_PHYS_64BIT
/* Limit RAM used by U-Boot to the DDR low region */
if (gd->ram_top > 0x40000000)
return 0x40000000;
#endif

return gd->ram_top;
}

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 = 0x40000000;
gd->ram_size = 0x40000000;

#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 = 0x40000000;//ERIC*
gd->ram_size = 0x40000000;//ERIC*
#endif

return 0;
}

Please help this.

Thanks.

  • Hi Eric,

    Will this be contiguous 1GB space starting 0x80000000?

    Best Regards,
    Keerthy

  • Hi

    yes, it will be contiguous 1GB space. And the bandwidth is 16bit*2.

    Thanks.

    Eric

  • Hi Eric,

    Here is the diff with which i reduced AM654 memory to 1GB.

    am65-1gb-diff.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    diff --git a/arch/arm/dts/k3-am654-base-board.dts b/arch/arm/dts/k3-am654-base-board.dts
    index afa7b5a353..e13eac4c15 100644
    --- a/arch/arm/dts/k3-am654-base-board.dts
    +++ b/arch/arm/dts/k3-am654-base-board.dts
    @@ -24,9 +24,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 {
    diff --git a/arch/arm/mach-k3/arm64-mmu.c b/arch/arm/mach-k3/arm64-mmu.c
    index a0da3df593..d708c97f70 100644
    --- a/arch/arm/mach-k3/arm64-mmu.c
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    With the above patch I can see that u-boot recognizes 1GB.

    U-Boot 2020.01-dirty (Mar 11 2021 - 13:02:48 +0530)

    SoC:   AM65X SR2.0
    Model: Texas Instruments AM654 Base Board
    Board: AM6-COMPROCEVM rev A
    DRAM:  1 GiB
    MMC:   sdhci@4f80000: 0, sdhci@4fa0000: 1
    Loading Environment from MMC... OK
    In:    serial
    Out:   serial
    Err:   serial
    Detected: AM6-IDKAPPEVM rev A
    Detected: SER-PCIE2LEVM rev A
    Net:   
    Warning: ethernet@46000000 using MAC address from ROM
    eth0: ethernet@46000000

    Best Regards,
    Keerthy

  • Hi

    I have verified the solution on Ti AM654 evm board, and it works.

    I will port it after we get our evm board in the future.

    Many thanks for your help.

    Eric

  • Hi Eric

    We also want to modify the DDR memory to 1GB. I would like to ask if we need to modify the code or configuration of the kernel? Thank you!

    James