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.

TMDS64GPEVM: Custom memory for am64x

Part Number: TMDS64GPEVM
Other Parts Discussed in Thread: SYSCONFIG

Hi everyone , 

We are trying to build custom board containing am642 process , emmc and Ram . So i want to know what modifications that we need to make in bootloader/Kernel source code ?

Is there any documentation provided by Ti for integration of emmc and Ram ?

  • Hi Paras,

    In Linux kernel, you don't need to modify kernel source code for eMMC and RAM for your custom board, but you would need to modify your board DTS file for your board eMMC and RAM design. You can use the AM64x GPEVM or StarterKit DTS file as an reference.
    <kernel-source>/arch/arm64/boot/dts/ti/k3-am642-evm.dts
    <kernel-source>/arch/arm64/boot/dts/ti/k3-am642-sk.dts

    The "memory" node in the DTS file defines the RAM size, while the eMMC is specified in sdhci0 or sdhci1 node, depending on which MMC interface you use. The details of MMC interface devicetree bindings is documented in kernel:
    <kernel-source>/Documentation/devicetree/bindings/mmc/sdhci-am654.yaml

    I am routing your query to our U-Boot expert for comment about U-Boot modification.

  • Hi Paras,
    On DDR configuration in SPL/u-boot, please refer to this e2e post
    e2e.ti.com/.../3852740
    Best,
    -Hong

  • Hi hong , 

    i am using sysconfig / DDR subsystem configuration tool to generate files for uboot for am64x Evm board but i am not sure which values should i put in tool according to datasheet of DDR4 . 

    Can you share values that i can use in sysconfig/ddr config tool to generate files for am64x Evm board ?  

    is there any document / webinar provided by Ti about DDR config tool ?

  • Hi Paras,
    Have you looked at the README.md?
    dev.ti.com/.../README.md
    ## Procedure:
    1) Select Add button at the top and choose the DDR Memory Type. Fields will be populated with default values for AM64x\AM243x EVMs<br>
    2) Modify parameters based on your DDR device. Hover mouse pointer over each parameter and choose the help icon (?) for more explanation<br>
    3) The 'Generated Files' section on the right has output files for your software (uboot, RTOS, or GEL) that can be saved. A SysConfig configuration script can also be saved and then reloaded at a later time using File->Open in Sysconfg.
    Best,
    -Hong

  • How can i decrease the size of Ram form 2GB to 1GB from Kernel dts file ? 

  • Hi Paras,
    One option to re-size the kernel DDR size is by modifying "bootargs"
    I'm listing below an example for SD boot on AM64x GP EVM (2GB DDR) by appending "mem=1024M" into "args_mmc".

    => pri args_mmc
    args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
    => editenv args_mmc
    edit: run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype} mem=1024M
    => pri args_mmc
    args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype} mem=1024M
    => boot

    Best,

    -Hong

  • Hi Hong , 

    thanks for the reply , i am now able to resize the ram using the uboot args . 

    Since i am working on custom carrier board/SOM based on am64x evm and i plan to use "AS4C512M16D4" DDR4 ram which is 1Gb. 

    I am also planing to use eeprom on i2c0 bus So i also want to know what values we need to store on eeprom corresponding to DDR4 ram  to make it functional. 

  • Hi Paras,
    It is good to know your DDR resizing works by modifying bootargs.
    As discussed in an early e2e post on DDR configuration in R5 SPL.
    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1041451/am6442-build-uboot-for-am42x/3852740#3852740

    - AM64x EVM:
    /arch/arm/dts/k3-am642-r5-evm.dts
    #include "k3-am642.dtsi"
    #include "k3-am64-evm-ddr4-1600MTs.dtsi"
    #include "k3-am64-ddr.dtsi"
    
    - AM64x SK:
    /arch/arm/dts/k3-am642-r5-sk.dts
    #include "k3-am642.dtsi"
    #include "k3-am64-sk-lp4-1333MTs.dtsi"
    #include "k3-am64-ddr.dtsi"

    - The DDR configurations for AM64x EVM is built into "k3-am642-r5-evm.dtb", and for AM64x SK into "k3-am642-r5-sk.dtb".
    - When building R5 SPL "tiboot3.bin" in the default TI SDK, multiple TI reference board DTBs are appended into R5 SPL.
    - During R5 SPL boot, the matching board dtb file is loaded depending on the detected board_ID via reading EEPROM pre-programmed on TI reference boards.
    - The EEPROM board_ID info can be referenced in "u-boot/board/ti/common/board_detect.h" file.
    I'm attaching a log file I captured on AM64x EVM for reading EEPROM board_ID via I2C cmds @u-boot prompt for your reference.
    Best,
    -Hong

    => i2c dev 0
    Setting bus to 0
    => i2c md 0x50 0x0.2 0x100
    0000: aa 55 33 ee 01 fc 00 10 2e 00 41 4d 36 34 2d 47    .U3.......AM64-G
    0010: 50 45 56 4d 00 00 00 00 00 00 45 32 30 31 30 31    PEVM......E20101
    0020: 30 31 45 32 00 00 30 31 30 31 30 38 32 31 00 00    01E2..01010821..
    0030: 00 00 00 00 30 31 33 36 11 02 00 10 29 13 c2 00    ....0136....)...
    0040: 08 00 70 f1 0f 76 ff 0d 70 f1 0f 76 ff 0e 70 f1    ..p..v..p..v..p.
    0050: 0f 76 ff 0d 70 f1 0f 76 ff 0d 00 00 00 00 00 00    .v..p..v........
    0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    0090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    00a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    00b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    00c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    00d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    00e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    00f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    => 

  • Hi, 

    Thanks for the info . I also want to know how can i reduce the size of ram for SPL . I cannot find the configuration for Ram size in sysconfig tool . i want to reduce the size fo Ram from 2GB to 1GB . 

  • Hi Paras,
    I'm attaching two files for your reference:
    - sdk8.0_ddr_size_512MiB.patch: the u-boot patch I made to resize DDR to 512MiB with SDK 8.0
    - am6_8.0.0_ddr_512MiB.txt: the u-boot log with the patch running on AM64x GP EVM.
    Best,
    -Hong

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/sdk8.0_5F00_ddr_5F00_size_5F00_512MiB.patch

    U-Boot 2021.01-00001-g911f54274e-dirty (Jan 11 2022 - 21:52:34 -0600)
    
    SoC:   AM64X SR1.0
    Model: Texas Instruments AM642 EVM
    Board: AM64-GPEVM rev E2
    DRAM:  512 MiB
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1
    In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    Net:   eth0: ethernet@8000000
    Hit any key to stop autoboot:  2  0 
    => bdinfo
    boot_params = 0x0000000000000000
    DRAM bank   = 0x0000000000000000
    -> start    = 0x0000000080000000
    -> size     = 0x0000000020000000
    flashstart  = 0x0000000000000000
    flashsize   = 0x0000000000000000
    flashoffset = 0x0000000000000000
    baudrate    = 115200 bps
    relocaddr   = 0x000000009fefa000
    reloc off   = 0x000000001f6fa000
    Build       = 64-bit
    current eth = ethernet@8000000
    ethaddr     = f4:84:4c:f9:59:eb
    IP addr     = <NULL>
    fdt_blob    = 0x000000009ded0a60
    new_fdt     = 0x000000009ded0a60
    fdt_size    = 0x0000000000009380
    multi_dtb_fit= 0x0000000000000000
    ERROR: reserving fdt memory region failed (addr=9e800000 size=1800000)
    lmb_dump_all:
        memory.cnt		   = 0x1
        memory.size		   = 0x0
        memory.reg[0x0].base   = 0x80000000
    		   .size   = 0x20000000
    
        reserved.cnt	   = 0x1
        reserved.size	   = 0x0
        reserved.reg[0x0].base = 0x9decf660
    		     .size = 0x21309a0
    arch_number = 0x0000000000000000
    TLB addr    = 0x000000009fff0000
    irq_sp      = 0x000000009ded0a50
    sp start    = 0x000000009ded0a50
    Early malloc usage: 2798 / 8000
    => 

  • Hi, hong 

    I have modified the board/ti/am64x/evm.c as given below for 1GB DDR: 

    int dram_init(void)
    {
    gd->ram_size = 0x40000000;

    return 0;
    }

    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;

    return 0;
    }

    But when i ran bd command from u-boot terminal i still get following output -> 

    => bdinfo 


    boot_params = 0x0000000000000000
    DRAM bank = 0x0000000000000000
    -> start = 0x0000000080000000
    -> size = 0x0000000080000000
    flashstart = 0x0000000000000000
    flashsize = 0x0000000000000000
    flashoffset = 0x0000000000000000
    baudrate = 115200 bps
    relocaddr = 0x00000000ffefa000
    reloc off = 0x000000007f6fa000
    Build = 64-bit
    current eth = ethernet@8000000
    ethaddr = f4:84:4c:f9:7c:b4
    IP addr = <NULL>
    fdt_blob = 0x00000000fded0a00
    new_fdt = 0x00000000fded0a00
    fdt_size = 0x00000000000093e0
    multi_dtb_fit= 0x0000000000000000
    lmb_dump_all:
    memory.cnt = 0x1
    memory.size = 0x0
    memory.reg[0x0].base = 0x80000000
    .size = 0x80000000

    reserved.cnt = 0x2
    reserved.size = 0x0
    reserved.reg[0x0].base = 0x9e800000
    .size = 0x1800000
    reserved.reg[0x1].base = 0xfdecf600
    .size = 0x2130a00
    arch_number = 0x0000000000000000
    TLB addr = 0x00000000ffff0000
    irq_sp = 0x00000000fded09f0
    sp start = 0x00000000fded09f0
    Early malloc usage: 2798 / 8000

    Am i missing something ? 

    Please note that i have used the pre-built image for bl31.bin and bl32.bin given in SDK 8.00.21

    $ make ARCH=arm CROSS_COMPILE=aarch64-none-linux-gnu- am64x_evm_a53_defconfig O=<output directory>/a53
    $ make ARCH=arm CROSS_COMPILE=aarch64-none-linux-gnu- ATF=<path to tisdk>/board-support/prebuilt-images/bl31.bin TEE=<path to tisdk>/board-support/prebuilt-images/bl32.bin O=<output directory>/a53
    $ cd <path to K3-image-gen project>
    $ make ARCH=arm CROSS_COMPILE=aarch64-none-linux-gnu- SOC=am64x SBL=<output directory>/r5/spl/u-boot-spl.bin

  • Hi Paras,
    Just in case, have we checked the u-boot time stamp from the boot log to match your new u-boot build time?
    Another option is adding something like "printf("@@@@function: %s\n", __func__);" in dram_init().
    Best,
    -Hong

  • Hi Hong,  

    After replacing uboot.img size of Dram becomes 1Gb. 

  • I also want to remove eeprom dependency for the custom carrier board .

    How can I achieve this ?

    I also want to know if ti provides eeprom image .

  • Hi Paras,
    You may refer to EEPROM board_ID data programmed on TI AM64x reference boards in my reply on Jan-04.
    - The EEPROM board_ID info can be referenced in "u-boot/board/ti/common/board_detect.h" file.
    - A sample log file I captured on AM64x EVM for reading EEPROM board_ID via I2C cmds @u-boot prompt for your reference.
    Best,
    -Hong

  • Hi, hong 

    Can we remove the eeprom dependency  for uboot using the menuconfig /defconfig ? 

    In the final board we want to remove the eeprom. 

    So what modifications do we need to make in the uboot source code ?

  • Hi Paras,
    I replied a e2e post on some options to bypassing EEPROM read for board_ID for AM335x/AM43xx SoC based boards.
    e2e.ti.com/.../3964662
    Some of options would apply to bypassing EEPROM read on other TI boards, ie. AM64x SoC based boards.
    Best,
    -Hong

  • Hi, hong , 

    when i disabled the eeprom read by setting the 'CONFIG_TI_I2C_BOARD_DETECT = N '  i got  the following error message during system reset

    U-Boot SPL 2021.01-00001-g911f54274e-dirty (Jan 24 2022 - 12:57:37 +0530)
    i am in board_fit_config_name_match

    SYSFW ABI: 3.1 (firmware rev 0x0015 '21.5.0--v2021.05 (Terrific Llam')
    SPL initial stack usage: 13392 bytes
    Trying to boot from MMC2

    Starting ATF on ARM64 core...

    NOTICE: BL31: v2.5(release):08.00.00.004-dirty
    NOTICE: BL31: Built : 21:46:29, Aug 10 2021

    U-Boot SPL 2021.01-00001-g911f54274e-dirty (Jan 24 2022 - 12:59:05 +0530)
    SYSFW ABI: 3.1 (firmware rev 0x0015 '21.5.0--v2021.05 (Terrific Llam')
    Trying to boot from MMC2
    U-Boot 2021.01-00001-g911f54274e-dirty (Jan 24 2022 - 12:59:05 +0530)

    SoC: AM64X SR1.0
    Model: Texas Instruments AM642 EVM
    DRAM: 2 GiB
    MMC: mmc@fa10000: 0, mmc@fa00000: 1
    In: serial@2800000
    Out: serial@2800000
    Err: serial@2800000
    Net: eth0: ethernet@8000000
    Hit any key to stop autoboot: 0
    WARNING: Could not determine device tree to use
    switch to partitions #0, OK
    mmc1 is current device
    SD/MMC found on device 1
    Failed to load 'boot.scr'
    Failed to load 'uEnv.txt'
    19137024 bytes read in 730 ms (25 MiB/s)
    Failed to load '/boot/'
    ERROR: Did not find a cmdline Flattened Device Tree
    Could not find a valid device tree
    =>

    Then i set the fdtfile env variable of uboot as given below  

    setenv fdtfile k3-am642-evm.dtb

    Now linux kernel , device tree and Rootfs are booting . 

    is this the correct way to bypass the eeprom ?

  • Hi Paras,
    It looks like you're using AM64x GP EVM board ID/name as an substitute for your customized board ID/name.
    You may want to check
    - Your customized HW configuration structure in SPL/u-boot are modified based on the AM64x GP EVM board ID/name.
    - Your DTB files (SPL/u-boot/kernel) are customized based off the AM64x GP EVM board ID/name.
    Best,
    -Hong

  • Yes I a. using AM64x GP EVM board ID/name as an substitute for my. customized board ID/name.

    What is stored in HW configuration structure in SPL/u-boot that I need to modify to complete the boot process of my custom board ?

    Our board is based on Am64x Gp evm board with the exception of custo. 1gb ram and phy . 

    I also want to know if we could use uEnv.txt to set the board ID. 

  • Hi Paras,
    - For the newer K3 SoC (i.e. AM64x), HW setup (i.e. clock, DDR etc...) is configured via R5 DTS file, for example, it is "k3-am642-r5-evm.dts" for the board_ID "am64x_gpevm".
    - The board_ID is used for selecting the matching DTB file during u-boot boot flow: R5 SPL, A53 SPL, A53 u-boot.
    - In the TI Linux SDK build, the kernel DTB file is selected and loaded by u-boot via boot environment variable, "board_name".
    Best,
    -Hong

  • Hi, Hong 

    Our board is based on Am64x Gp evm board with the exception of custom. 1GB ram and phy for ethernet 0 port . So we intend to keep the clock frequencies similar to that of EVM board .

    I understand for DDR configuration we need to generate the dtsi file via sysconfig tool but for everything etse do you think we need to further modify the .k3-am642-r5-evm.dts file ?

    I also want to know how set the correct dtb file via spl code . i have made the following modification to evm.c and i can see that the message "i am in borad fit config name match" is printed 12 time before it loads uboot.img . 

    ########################## modification ###########################

    int board_fit_config_name_match(const char *name)
    {
    printf("i am in board_fit_config_name_match\n");

    bool eeprom_read = board_ti_was_eeprom_read();

    if (!eeprom_read || board_is_am64x_gpevm()) {
    if (!strcmp(name, "k3-am642-r5-evm") || !strcmp(name, "k3-am642-evm"))
    return 0;
    } else if (board_is_am64x_skevm()) {
    if (!strcmp(name, "k3-am642-r5-sk") || !strcmp(name, "k3-am642-sk"))
    return 0;
    }

    return -1;
    }

    ########################### uboot log #################################

    U-Boot SPL 2021.01-00001-g911f54274e-dirty (Jan 25 2022 - 11:44:15 +0530)
    i am in board_fit_config_name_match
    SYSFW ABI: 3.1 (firmware rev 0x0015 '21.5.0--v2021.05 (Terrific Llam')
    SPL initial stack usage: 13392 bytes
    alpha fired
    Trying to boot from MMC2
    i am in board_fit_config_name_match
    i am in board_fit_config_name_match
    i am in board_fit_config_name_match
    i am in board_fit_config_name_match
    i am in board_fit_config_name_match
    i am in board_fit_config_name_match
    i am in board_fit_config_name_match
    i am in board_fit_config_name_match
    Starting ATF on ARM64 core...

    NOTICE: BL31: v2.5(release):08.00.00.004-dirty
    NOTICE: BL31: Built : 21:46:29, Aug 10 2021

    U-Boot SPL 2021.01-00001-g911f54274e-dirty (Jan 25 2022 - 11:45:40 +0530)
    SYSFW ABI: 3.1 (firmware rev 0x0015 '21.5.0--v2021.05 (Terrific Llam')
    Trying to boot from MMC2
    i am in board_fit_config_name_match
    i am in board_fit_config_name_match
    i am in board_fit_config_name_match
    i am in board_fit_config_name_match


    U-Boot 2021.01-00001-g911f54274e-dirty (Jan 25 2022 - 11:45:40 +0530)

    SoC: AM64X SR1.0
    Model: Texas Instruments AM642 EVM
    DRAM: 2 GiB
    MMC: mmc@fa10000: 0, mmc@fa00000: 1
    In: serial@2800000
    Out: serial@2800000
    Err: serial@2800000
    Net: eth0: ethernet@8000000
    Hit any key to stop autoboot: 0

    => 

    i have tried commenting the board_is_am64x_gpevm() and set its new value as 1 as given below :  

    #define board_is_am64x_gpevm()  1

    but still board_fit_config_name_match() function is fired 12 times and correct dts is not set . 

    is there any cleaner solution to this issue?

  • Hi Paras,
    There are three stages in u-boot boot flow: R5 SPL, A53 SPL, A53 u-boot on K3 SoC.
    There's three dtb files associated with each of the above three binaries in the boot flow, and loading of each dtb is via calling the referenced function for the matching board_ID from the FIT image.

    In fact the board function board_fit_config_name_match() is called by u-boot FDT functions.
    refer to "$u-boot/doc/EADME.multi-dtb-fit" and "$u-boot/doc/README.fdt-control"
    Best,
    -Hong

  • Hi hong, 

    In our custom board which is using the same DDR as that of am64x evm board we are getting the following error : 

    U-Boot SPL 2021.01-00001-g911f54274e-dirty (Jan 25 2022 - 11:44:15 +0530)
    i am in board_fit_config_name_match
    SYSFW ABI: 3.1 (firmware rev 0x0015 '21.5.0--v2021.05 (Terrific Llam')
    SPL initial stack usage: 13392 bytes
    Trying to boot from MMC2
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.5(release):08.00.00.004-dirty
    NOTICE:  BL31: Built : 21:46:29, Aug 10 2021
    
    U-Boot SPL 2021.01-00001-g911f54274e-dirty (Jan 25 2022 - 11:45:40 +0530)
    SYSFW ABI: 3.1 (firmware rev 0x0015 '21.5.0--v2021.05 (Terrific Llam')
    Trying to boot from MMC2
    
    
    
    U-Boot 2021.01-00001-g911f54274e-dirty (Jan 25 2022 - 11:45:40 +0530)
    
    SoC:   AM64X SR1.0
    Model: Texas Instruments AM642 EVM
    DRAM:  dram init fired
    dram init banksize fired
    2 GiB
    board init fired
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1
    In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    beta fired
    Net:   Could not get PHY for ethernet@8000000: addr 0
    am65_cpsw_nuss_slave ethernet@8000000: phy_connect() failed
    No ethernet found.
    
    Hit any key to stop autoboot:  2  1  0 
    WARNING: Could not determine device tree to use
    switch to partitions #0, OK
    mmc1 is current device
    SD/MMC found on device 1
    Failed to load 'boot.scr'
    49 bytes read in 1 ms (47.9 KiB/s)
    Loaded env from uEnv.txt
    Importing environment from mmc1 ...
    19137024 bytes read in 994 ms (18.4 MiB/s)
    53223 bytes read in 5 ms (10.2 MiB/s)
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 000000008fff0000, end 000000008fffffe6 ... OK
    
    Starting kernel ...
    
    [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
    [    0.000000] Linux version 5.10.41-g4c2eade9f7 (oe-user@oe-host) (aarch64-none-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 9.2.1 20191025, GNU ld (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 2.33.1.20191209) #1 SMP PREEMPT Tue Aug 10 21:52:40 UTC 2021
    [    0.000000] Machine model: Texas Instruments AM642 EVM
    [    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 0x00000000a0000000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node 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 r5f-memory@a0100000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a1000000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@a1000000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a1100000, size 15 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-memory@a1100000, 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 r5f-dma-memory@a2000000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a2100000, size 15 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-memory@a2100000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a3000000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@a3000000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a3100000, size 15 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-memory@a3100000, compatible id shared-dma-pool
    [    0.000000] Zone ranges:
    [    0.000000]   DMA      [mem 0x0000000080000000-0x00000000ffffffff]
    [    0.000000]   DMA32    empty
    [    0.000000]   Normal   empty
    [    0.000000] Movable zone start for each node
    [    0.000000] Early memory node ranges
    [    0.000000]   node   0: [mem 0x0000000080000000-0x000000009e7fffff]
    [    0.000000]   node   0: [mem 0x000000009e800000-0x00000000a3ffffff]
    [    0.000000]   node   0: [mem 0x00000000a4000000-0x00000000a4ffffff]
    [    0.000000]   node   0: [mem 0x00000000a5000000-0x00000000a57fffff]
    [    0.000000]   node   0: [mem 0x00000000a5800000-0x00000000ffffffff]
    [    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x00000000ffffffff]
    [    0.000000] cma: Reserved 512 MiB at 0x00000000c0000000
    [    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.2
    [    0.000000] percpu: Embedded 2 pages/cpu s49880 r8192 d73000 u131072
    [    0.000000] Detected VIPT I-cache on CPU0
    [    0.000000] CPU features: detected: ARM erratum 845719
    [    0.000000] CPU features: detected: GIC system register CPU interface
    [    0.000000] Built 1 zonelists, mobility grouping off.  Total pages: 32736
    [    0.000000] Kernel command line: console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 mtdparts=fc40000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),57088k@8m(ospi.rootfs),256k(ospi.phypattern) root=PARTUUID=355e696d-02 rw rootfstype=ext4 rootwait
    [    0.000000] Dentry cache hash table entries: 262144 (order: 5, 2097152 bytes, linear)
    [    0.000000] Inode-cache hash table entries: 131072 (order: 4, 1048576 bytes, linear)
    [    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
    [    0.000000] Memory: 1448896K/2097152K available (10816K kernel code, 1344K rwdata, 4288K rodata, 1856K init, 758K bss, 123968K reserved, 524288K cma-reserved)
    [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
    [    0.000000] rcu: Preemptible hierarchical RCU implementation.
    [    0.000000] rcu: 	RCU event tracing is enabled.
    [    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=2.
    [    0.000000] 	Trampoline variant of Tasks RCU enabled.
    [    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
    [    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
    [    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
    [    0.000000] GICv3: GIC: Using split EOI/Deactivate mode
    [    0.000000] GICv3: 256 SPIs implemented
    [    0.000000] GICv3: 0 Extended SPIs implemented
    [    0.000000] GICv3: Distributor has no Range Selector support
    [    0.000000] GICv3: 16 PPIs implemented
    [    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x0000000001840000
    [    0.000000] ITS [mem 0x01820000-0x0182ffff]
    [    0.000000] GIC: enabling workaround for ITS: Socionext Synquacer pre-ITS
    [    0.000000] ITS@0x0000000001820000: allocated 1048576 Devices @a4000000 (flat, esz 8, psz 64K, shr 0)
    [    0.000000] ITS: using cache flushing for cmd queue
    [    0.000000] GICv3: using LPI property table @0x00000000a58c0000
    [    0.000000] GIC: using cache flushing for LPI property table
    [    0.000000] GICv3: CPU0: using allocated LPI pending table @0x00000000a58d0000
    [    0.000000] random: get_random_bytes called from start_kernel+0x32c/0x4d4 with crng_init=0
    [    0.000000] arch_timer: cp15 timer(s) running at 200.00MHz (phys).
    [    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x2e2049d3e8, max_idle_ns: 440795210634 ns
    [    0.000005] sched_clock: 56 bits at 200MHz, resolution 5ns, wraps every 4398046511102ns
    [    0.008525] Console: colour dummy device 80x25
    [    0.013120] Calibrating delay loop (skipped), value calculated using timer frequency.. 400.00 BogoMIPS (lpj=800000)
    [    0.023793] pid_max: default: 32768 minimum: 301
    [    0.028593] LSM: Security Framework initializing
    [    0.033401] Mount-cache hash table entries: 8192 (order: 0, 65536 bytes, linear)
    [    0.040992] Mountpoint-cache hash table entries: 8192 (order: 0, 65536 bytes, linear)
    [    0.051341] rcu: Hierarchical SRCU implementation.
    [    0.056605] Platform MSI: msi-controller@1820000 domain created
    [    0.062978] PCI/MSI: /bus@f4000/interrupt-controller@1800000/msi-controller@1820000 domain created
    [    0.072265] EFI services will not be available.
    [    0.077264] smp: Bringing up secondary CPUs ...
    [    0.082654] Detected VIPT I-cache on CPU1
    [    0.082691] GICv3: CPU1: found redistributor 1 region 0:0x0000000001860000
    [    0.082706] GICv3: CPU1: using allocated LPI pending table @0x00000000a58e0000
    [    0.082770] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
    [    0.082903] smp: Brought up 1 node, 2 CPUs
    [    0.112296] SMP: Total of 2 processors activated.
    [    0.117109] CPU features: detected: 32-bit EL0 Support
    [    0.122382] CPU features: detected: CRC32 instructions
    [    0.135636] CPU: All CPU(s) started at EL2
    [    0.139845] alternatives: patching kernel code
    [    0.145627] devtmpfs: initialized
    [    0.157003] KASLR disabled due to lack of seed
    [    0.161848] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
    [    0.171819] futex hash table entries: 512 (order: -1, 32768 bytes, linear)
    [    0.180861] pinctrl core: initialized pinctrl subsystem
    [    0.186854] DMI not present or invalid.
    [    0.191464] NET: Registered protocol family 16
    [    0.203791] DMA: preallocated 256 KiB GFP_KERNEL pool for atomic allocations
    [    0.211465] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
    [    0.219490] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
    [    0.228218] thermal_sys: Registered thermal governor 'step_wise'
    [    0.228223] thermal_sys: Registered thermal governor 'power_allocator'
    [    0.234874] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
    [    0.248573] ASID allocator initialised with 65536 entries
    [    0.282619] HugeTLB registered 16.0 GiB page size, pre-allocated 0 pages
    [    0.289492] HugeTLB registered 512 MiB page size, pre-allocated 0 pages
    [    0.296255] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
    [    0.305112] cryptd: max_cpu_qlen set to 1000
    [    0.313369] k3-chipinfo 43000014.chipid: Family:AM64X rev:SR1.0 JTAGID[0x0bb3802f] Detected
    [    0.322658] vsys_5v0: supplied by evm_12v0
    [    0.327307] vsys_3v3: supplied by evm_12v0
    [    0.331869] vddb_3v3_display: supplied by vsys_3v3
    [    0.337897] iommu: Default domain type: Translated 
    [    0.343362] SCSI subsystem initialized
    [    0.348152] mc: Linux media interface: v0.10
    [    0.352564] videodev: Linux video capture interface: v2.00
    [    0.358310] pps_core: LinuxPPS API ver. 1 registered
    [    0.363393] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [    0.372747] PTP clock support registered
    [    0.376789] EDAC MC: Ver: 3.0.0
    [    0.380838] omap-mailbox 29020000.mailbox: omap mailbox rev 0x66fc9100
    [    0.387752] omap-mailbox 29040000.mailbox: omap mailbox rev 0x66fc9100
    [    0.394561] omap-mailbox 29060000.mailbox: omap mailbox rev 0x66fc9100
    [    0.402058] FPGA manager framework
    [    0.405657] Advanced Linux Sound Architecture Driver Initialized.
    [    0.413048] clocksource: Switched to clocksource arch_sys_counter
    [    0.419812] VFS: Disk quotas dquot_6.6.0
    [    0.423951] VFS: Dquot-cache hash table entries: 8192 (order 0, 65536 bytes)
    [    0.437654] NET: Registered protocol family 2
    [    0.442374] IP idents hash table entries: 32768 (order: 2, 262144 bytes, linear)
    [    0.451409] tcp_listen_portaddr_hash hash table entries: 4096 (order: 0, 65536 bytes, linear)
    [    0.460312] TCP established hash table entries: 16384 (order: 1, 131072 bytes, linear)
    [    0.468543] TCP bind hash table entries: 16384 (order: 2, 262144 bytes, linear)
    [    0.476269] TCP: Hash tables configured (established 16384 bind 16384)
    [    0.483175] UDP hash table entries: 2048 (order: 0, 65536 bytes, linear)
    [    0.490116] UDP-Lite hash table entries: 2048 (order: 0, 65536 bytes, linear)
    [    0.497655] NET: Registered protocol family 1
    [    0.502745] RPC: Registered named UNIX socket transport module.
    [    0.508834] RPC: Registered udp transport module.
    [    0.513674] RPC: Registered tcp transport module.
    [    0.518483] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    0.525080] PCI: CLS 0 bytes, default 64
    [    0.529878] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available
    [    0.543268] Initialise system trusted keyrings
    [    0.548179] workingset: timestamp_bits=46 max_order=15 bucket_order=0
    [    0.559813] squashfs: version 4.0 (2009/01/31) Phillip Lougher
    [    0.566511] NFS: Registering the id_resolver key type
    [    0.571740] Key type id_resolver registered
    [    0.576040] Key type id_legacy registered
    [    0.580219] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
    [    0.587070] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
    [    0.594862] 9p: Installing v9fs 9p2000 file system support
    [    0.644071] Key type asymmetric registered
    [    0.648277] Asymmetric key parser 'x509' registered
    [    0.653317] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 243)
    [    0.660877] io scheduler mq-deadline registered
    [    0.665511] io scheduler kyber registered
    [    0.672109] pinctrl-single f4000.pinctrl: 180 pins, size 720
    [    0.679097] pinctrl-single a40000.timesync-router: 512 pins, size 2048
    [    0.695478] Serial: 8250/16550 driver, 10 ports, IRQ sharing enabled
    [    0.719060] brd: module loaded
    [    0.730453] loop: module loaded
    [    0.734610] megasas: 07.714.04.00-rc1
    [    0.741324] libphy: Fixed MDIO Bus: probed
    [    0.747051] tun: Universal TUN/TAP device driver, 1.6
    [    0.752992] igbvf: Intel(R) Gigabit Virtual Function Network Driver
    [    0.759415] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
    [    0.765516] sky2: driver version 1.30
    [    0.770489] VFIO - User Level meta-driver version: 0.3
    [    0.776850] i2c /dev entries driver
    [    0.781659] sdhci: Secure Digital Host Controller Interface driver
    [    0.787994] sdhci: Copyright(c) Pierre Ossman
    [    0.792837] sdhci-pltfm: SDHCI platform and OF driver helper
    [    0.799883] ledtrig-cpu: registered to indicate activity on CPUs
    [    0.806503] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, skipping ....
    [    0.814554] optee: probing for conduit method.
    [    0.819183] optee: revision 3.12 (3d47a131)
    [    0.819823] optee: initialized driver
    [    0.830577] NET: Registered protocol family 17
    [    0.835324] 9pnet: Installing 9P2000 support
    [    0.839783] Key type dns_resolver registered
    [    0.844391] Loading compiled-in X.509 certificates
    [    0.864009] ti-sci 44043000.dmsc: ABI: 3.1 (firmware rev 0x0015 '21.5.0--v2021.05 (Terrific Llam')
    [    0.906970] random: fast init done
    [    0.914964] omap_i2c 20000000.i2c: bus 0 rev0.12 at 100 kHz
    [    0.922761] pca953x 1-0022: supply vcc not found, using dummy regulator
    [    0.929720] pca953x 1-0022: using AI
    [    0.957092] pca953x 1-0022: failed writing register
    [    0.962252] pca953x: probe of 1-0022 failed with error -121
    [    0.968812] ssd1307fb 1-003c: failed to get reset gpio: -517
    [    0.974732] omap_i2c 20010000.i2c: bus 1 rev0.12 at 400 kHz
    [    0.981774] omap_i2c 20020000.i2c: bus 2 rev0.12 at 100 kHz
    [    0.988716] omap_i2c 20030000.i2c: bus 3 rev0.12 at 100 kHz
    [    0.994855] ti-sci-intr bus@f4000:bus@4000000:interrupt-controller1: Interrupt Router 5 domain created
    [    1.004541] ti-sci-intr bus@f4000:interrupt-controller0: Interrupt Router 3 domain created
    [    1.013251] ti-sci-inta 48000000.interrupt-controller: Interrupt Aggregator domain 28 created
    [    1.032286] j721e-pcie f102000.pcie: host bridge /bus@f4000/pcie@f102000 ranges:
    [    1.039992] j721e-pcie f102000.pcie:       IO 0x0068001000..0x0068010fff -> 0x0068001000
    [    1.048317] j721e-pcie f102000.pcie:      MEM 0x0068011000..0x006fffffff -> 0x0068011000
    [    1.056621] j721e-pcie f102000.pcie:   IB MEM 0x0000000000..0x0fffffffff -> 0x0000000000
    [    1.065777] ti-bcdma 485c0100.dma-controller: Number of rings: 68
    [    1.073512] ti-bcdma 485c0100.dma-controller: Channels: 24 (bchan: 12, tchan: 6, rchan: 6)
    [    1.083837] ti-pktdma 485c0000.dma-controller: Number of rings: 288
    [    1.097938] ti-pktdma 485c0000.dma-controller: Channels: 44 (tchan: 29, rchan: 15)
    [    1.109213] printk: console [ttyS2] disabled
    [    1.113676] 2800000.serial: ttyS2 at MMIO 0x2800000 (irq = 16, base_baud = 3000000) is a 8250
    [    1.122436] printk: console [ttyS2] enabled
    [    1.122436] printk: console [ttyS2] enabled
    [    1.130879] printk: bootconsole [ns16550a0] disabled
    [    1.130879] printk: bootconsole [ns16550a0] disabled
    [    1.143415] spi-nor spi0.0: unrecognized JEDEC id bytes: ff ff ff ff ff ff
    [    1.150343] spi-nor: probe of spi0.0 failed with error -2
    [    1.205058] davinci_mdio 8000f00.mdio: davinci mdio revision 9.7, bus freq 1000000
    [    1.212656] libphy: 8000f00.mdio: probed
    [    1.216816] mdio_bus 8000f00.mdio: MDIO device at address 0 is missing.
    [    1.223571] am65-cpsw-nuss 8000000.ethernet: initializing am65 cpsw nuss version 0x6BA00903, cpsw version 0x6BA80903 Ports: 3 quirks:00000002
    [    1.236803] am65-cpsw-nuss 8000000.ethernet: set new flow-id-base 16
    [    1.243656] am65-cpsw-nuss 8000000.ethernet: Use random MAC address
    [    1.249953] am65-cpsw-nuss 8000000.ethernet: initialized cpsw ale version 1.4
    [    1.257082] am65-cpsw-nuss 8000000.ethernet: ALE Table size 512
    [    1.263653] pps pps0: new PPS source ptp0
    [    1.268093] am65-cpsw-nuss 8000000.ethernet: CPTS ver 0x4e8a010c, freq:500000000, add_val:1 pps:1
    [    1.280662] am65-cpts 39000000.cpts: CPTS ver 0x4e8a010c, freq:500000000, add_val:1 pps:0
    [    1.291809] mmc0: CQHCI version 5.10
    [    1.303348] ssd1307fb 1-003c: failed to get reset gpio: -517
    [    1.309802] j721e-pcie f102000.pcie: host bridge /bus@f4000/pcie@f102000 ranges:
    [    1.317299] j721e-pcie f102000.pcie:       IO 0x0068001000..0x0068010fff -> 0x0068001000
    [    1.325402] j721e-pcie f102000.pcie:      MEM 0x0068011000..0x006fffffff -> 0x0068011000
    [    1.333500] j721e-pcie f102000.pcie:   IB MEM 0x0000000000..0x0fffffffff -> 0x0000000000
    [    1.337103] mmc0: SDHCI controller on fa10000.mmc [fa10000.mmc] using ADMA 64-bit
    [    1.350905] ssd1307fb 1-003c: failed to get reset gpio: -517
    [    1.357584] j721e-pcie f102000.pcie: host bridge /bus@f4000/pcie@f102000 ranges:
    [    1.365179] j721e-pcie f102000.pcie:       IO 0x0068001000..0x0068010fff -> 0x0068001000
    [    1.373351] j721e-pcie f102000.pcie:      MEM 0x0068011000..0x006fffffff -> 0x0068011000
    [    1.381567] j721e-pcie f102000.pcie:   IB MEM 0x0000000000..0x0fffffffff -> 0x0000000000
    [    1.394854] debugfs: Directory 'pd:114' with parent 'pm_genpd' already present!
    [    1.409816] ALSA device list:
    [    1.412794]   No soundcards found.
    [    1.416798] Waiting for root device PARTUUID=355e696d-02...
    [    1.466578] mmc0: new HS400 MMC card at address 0001
    [    1.472407] mmcblk0: mmc0:0001 W62704 3.53 GiB 
    [    1.477283] mmcblk0boot0: mmc0:0001 W62704 partition 1 2.00 MiB
    [    1.483482] mmcblk0boot1: mmc0:0001 W62704 partition 2 2.00 MiB
    [    1.489660] mmcblk0rpmb: mmc0:0001 W62704 partition 3 512 KiB, chardev (237:0)
    [    1.502152] ssd1307fb 1-003c: failed to get reset gpio: -517
    [    1.508585] j721e-pcie f102000.pcie: host bridge /bus@f4000/pcie@f102000 ranges:
    [    1.516041] j721e-pcie f102000.pcie:       IO 0x0068001000..0x0068010fff -> 0x0068001000
    [    1.524168] j721e-pcie f102000.pcie:      MEM 0x0068011000..0x006fffffff -> 0x0068011000
    [    1.532267] j721e-pcie f102000.pcie:   IB MEM 0x0000000000..0x0fffffffff -> 0x0000000000
    [  316.513201] Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: sched_move_task+0x1a0/0x1a0
    [  316.523552] CPU: 0 PID: 121 Comm: kworker/dying Not tainted 5.10.41-g4c2eade9f7 #1
    [  316.531103] Hardware name: Texas Instruments AM642 EVM (DT)
    [  316.536662] Call trace:
    [  316.539106]  dump_backtrace+0x0/0x1a0
    [  316.542759]  show_stack+0x18/0x68
    [  316.546068]  dump_stack+0xd0/0x12c
    [  316.549459]  panic+0x16c/0x334
    [  316.552507]  __stack_chk_fail+0x30/0x40
    [  316.556332]  cpu_cgroup_attach+0x0/0x70
    [  316.560160]  sched_autogroup_exit_task+0x10/0x20
    [  316.564766]  do_exit+0x300/0x9c8
    [  316.567986]  kthread+0x100/0x160
    [  316.571206]  ret_from_fork+0x10/0x34
    [  316.574776] SMP: stopping secondary CPUs
    [  316.578697] Kernel Offset: disabled
    [  316.582176] CPU features: 0x0040002,2000200c
    [  316.586432] Memory Limit: none
    [  316.589486] ---[ end Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: sched_move_task+0x1a0/0x1a0 ]---

    We are using the same image which is provided by Ti as part of SDK 8 which is working fine on evm board .

    But for some reason we are getting the above error. Also we have modified the source code of uboot to bypass the eeprom.

    Are we doing something wrong?

    Please Note that uboot shell is working fine .
    does that mean DDR is property initialized ?

  • Hi Paras,
    We discussed previously on how to resize DDR either by modifying u-boot code or updating bootargs before launching kernel.
    Have you resized your DDR size as my understanding is you have 1GiB DDR on your HW?
    You log seems showing DDR=2GiB.
    Best,
    -Hong

  • Hi Hong, 

    We have 2 variants of the custom board which are based on evm. 

    Right now we are working on 2gb variant in which we have used same ddr which is used in evm .

    So I did not think any more modification were required other than bypassing the eeprom ..

  • Hi Hong, 

    Is there any way to  know which driver is causing the kernel crash .

  • Hi paras,
    I'm passing it to my colleague for kernel debugging...
    Best,
    -Hong

  • Hi hong, 

    We have enable the mtest in uboot but as soon as we run "mtest 0x80000000 0x90000000 0xaa55aa55 1" we get the following errors : 

    Mem error @ 0x800061E8: found AA55F693, expected AA55B692

    Mem error @ 0x800061F0: found AA55B69B, expected AA55B693

    Mem error @ 0x800061F8: found AA55F694, expected AA55B694

    Mem error @ 0x80006208: found AA55B697, expected AA55B696

    Mem error @ 0x80006210: found AA55B69F, expected AA55B697

    Mem error @ 0x80006220: found AA55B69B, expected AA55B699

    Mem error @ 0x80006228: found AA55B69B, expected AA55B69A

    Mem error @ 0x80006240: found AA55B69F, expected AA55B69D

    Mem error @ 0x80006248: found AA55B69F, expected AA55B69E

    Mem error @ 0x800062A8: found AA55B6AB, expected AA55B6AA

    Mem error @ 0x800062B8: found AA55F6AC, expected AA55B6AC

    Mem error @ 0x800062C0: found AA55B6BF, expected AA55B6AD

    Since we are using the same DDR ram as that of am64x evm board so i am not sure if we need to configure something . 

  • Hi Paras,

    Is this the same issue now as in the following thread?

    e2e.ti.com/.../tmds64gpevm-unable-to-boot-from-sd-card

  • Hi Bin Liu, 

    Yes it is the same issue. 

  • Okay, let's close this thread and continue the communication on that new thread.