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.

AM3358: DDR3 memory issue with MT41K256M16TW-107

Other Parts Discussed in Thread: AM3358

Hello community,

I have a custom board with AM3358 similar with the BBB but without HDMI and without eMMC. I copied the layout from the DDR3 but I use the MT41K256M16TW-107 and not the MT41K512M16HA-125.

I've tried to bring up the board and calculate the DDR values and add them to the ddr_defs.h. After enter "#define DEBUG" to the file ti_am335x_common.h, I see that the bootup stops at the DDR. To find the mistake, I added printf to the file board/ti/am335x/board.c , but they never show in the terminal. Because of this, I have a few questions:

1. Did somebody bring up a AM3358 with MT41K256M16TW-107 and could share the calculated values?

2. I used these commands to build the u-boot:

- make CROSS_COMPILE=arm-linux-gnueabihf- distclean
- make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x_boneblack_defconfig
- make CROSS_COMPILE=arm-linux-gnueabihf- -j4

Why can't I see the printf from board.c during the bootup? Is this file not used in the u-boot?

3. It seems to me that the file ddr_defs.h is not the right file to set the ddr values for the u-boot. Could someone confirm this?

Thank you for your help.

I attache the ddr_configuration, ddr_defs.h, board.c and the output from the bootup

best regards

eric

AM335x_DDR_register_calc_tool_new.xlslog_am335x.txt1452.ddr_defs.h

24225.board.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
* board.c
*
* Board functions for TI AM335X based boards
*
* Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <dm.h>
#include <errno.h>
#include <spl.h>
#include <serial.h>
#include <asm/arch/cpu.h>
#include <asm/arch/hardware.h>
#include <asm/arch/omap.h>
#include <asm/arch/ddr_defs.h>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi Biser,

    thank you for your supply. I read and tried the links that you suggest before but without any success. In particular this site processors.wiki.ti.com/.../Sitara_Linux_Training:_Tuning_the_DDR3_Timings_on_BeagleBoneBlack seems not to be up to date.
    Also, I add a printf in the beginning of the sdram_init function but I never see the printf during the bootup. This seens to me, that this function never get called?!

    best regards
    eric
  • Which Linux, resp. U-boot version are you using?
  • Hi Eric,

    The ddr configurations should be placed in ddr_defs.h and then later used by board.c. Looking at your log file I see that the DDR is actually initialized:
    DRAM: initcall: 80801f79
    RAM Configuration:
    Bank #0: 80000000 512 MiB
    DRAM: 512 MiB

    The above console line comes from board_f.c:
    static int announce_dram_init(void)
    {
    puts("DRAM: ");
    return 0;
    }

    And the last line you see "dram_bank_mmu_setup: bank: 0" comes from dram_bank_mmu_setup().

    As you can see the MLO has configured the ddr and loaded u-boot. So the problem comes after that..

    Why can't I see the printf from board.c during the bootup? Is this file not used in the u-boot?

    This file is used in u-boot. Can you try using puts() instead?

    1. Did somebody bring up a AM3358 with MT41K256M16TW-107 and could share the calculated values?

    I've not done this, so I cannot share calculated ddr values..

    2. I used these commands to build the u-boot:

    - make CROSS_COMPILE=arm-linux-gnueabihf- distclean
    - make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x_boneblack_defconfig
    - make CROSS_COMPILE=arm-linux-gnueabihf- -j4


    After doing your custom modifications to the code, can you try using the top level commands:
    cd ~/ti-processor-sdk-linux-am335x-evm-04.02.00.09/
    make u-boot

    I think that you should use the am335x_evm_config (which is to include/configs/am335x_evm.h file) configure the u-boot.

    3. It seems to me that the file ddr_defs.h is not the right file to set the ddr values for the u-boot. Could someone confirm this?

    As I said, ddr configurations should be placed in ddr_defs.h and then later used by board.c. What you've done should be correct.

    One last comment: enabling "#define DEBUG" increases MLO & u-boot sizes.. and this may cause problems when relocating u-boot to the default address. It is useful for some debug purposes, but can you test without #define DEBUG and share the console output?

    Best Regards,
    Yordan
  • Hi Yordan,

    thank you for your help.

    Yordan Kovachev said:


    This file is used in u-boot. Can you try using puts() instead?

    I've tried it with puts, but it is the same result. Correct me if I am wrong, but that shows me, that the function never get called and the RAM configuration never gets loaded.

    Do you know what could be the reason?

    Yordan Kovachev said:

    After doing your custom modifications to the code, can you try using the top level commands:
    cd ~/ti-processor-sdk-linux-am335x-evm-04.02.00.09/
    make u-boot

    I think that you should use the am335x_evm_config (which is to include/configs/am335x_evm.h file) configure the u-boot.

    One last comment: enabling "#define DEBUG" increases MLO & u-boot sizes.. and this may cause problems when relocating u-boot to the default address. It is useful for some debug purposes, but can you test without #define DEBUG and share the console output?

    I've tried it it with am335x_evm_config, and also with and without #define DEBUG.

    log_am335x_evm_config.txt

    And here is the output without debug:

    CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
    U-Boot SPL 2017.11 (Mar 13 2018 - 17:04:21)
    Trying to boot from MMC1
    *** Warning - bad CRC, using default environment

    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img


    U-Boot 2017.11 (Mar 13 2018 - 17:04:21 +0100)

    CPU  : AM335X-GP rev 2.1
    Model: TI AM335x BeagleBone Black
    DRAM:  512 MiB

    And then it seems like it stops on the same position.

    I've also tried an very old MLO and u-boot from and angström image (2012). there I can bootup to the angström. Because of this fact I think that it has to be a configuration issue?!

    Do you have any other ideas?

    best regards

    eric

  • Can you share your dts? It is located in u-boot arch/arm/cpu/dts:
    am335x-bone-common.dtsi
    am335x-boneblack.dts

    Did you modify it to match your custom board? For example in am335x-bone-common.dtsi there is the following segment:
    memory {
    device_type = "memory";
    reg = <0x80000000 0x10000000>; /* 256 MB */
    };

    And you use 512MB of RAM.

    Best Regards,
    Yordan
  • Hi Yordan,

    I didn't modify this files. And why is there 256 MB, the BBB has 512MB? Could you please tell me which values there should be? I couldnt find any information.

    Best regards

    eric

    am335x_bone_common.zip

  • Hi Eric,

    Let me test something on my side and I will update.

    As for the memory node in the u-boot dts it seems that it is never reference (hence it is ignored).

    Best Regards,
    Yordan
  • Hi,

    Did you modify the am335x_evm.h, ti_am335x_common.h, ti_armv7_omap.h and ti_armv7_common.h located in include/configs?  

    You should have #define CONFIG_NR_DRAM_BANKS 1 in include/configs/ti_armv7_common.h.

    As I said it seems that your u-boot is initializing the RAM, but something is missing out.

    Also I see that you DO NOT use the u-boot from TI Processor SDK Linux. Can you try with the TI u-boot 2017.01 NOT u-boot 2017.11?

    Best Regards,

    Yordan

  • I didnt modify any of these files. I compared these files from (uboot2017.01) with the one from the last AM335xSDK and they have only slightly differences in am335x_evm.h and ti_armv7_common.h
    I also checked the file ti_armv7_common.h for the entry #define CONFIG_NR_DRAM_BANKS 1 and it is in line 75

    #ifndef CONFIG_NR_DRAM_BANKS
    #define CONFIG_NR_DRAM_BANKS 1
    #endif

    I didnt use the SDK, because I seems not to work properly with a virtual machine. I can't run the setup.sh properly. But in my opinion, it should also work with the default u-boot 2017.01, but I have the same result.
    Do you know which file calls the board.c file, respectively the function sdram_init? I would like to why I cant the any printfs/puts of these file.
    Thank you for your help

    best regards
    eric
  • Hi Eric,

    Do you know which file calls the board.c file, respectively the function sdram_init?

    The sdram_init() is called by arch/arm/mach-omap2/am33xx/board.c file:
    #ifdef CONFIG_SPL_BUILD
    void board_init_f(ulong dummy)
    {
    early_system_init();
    board_early_init_f();
    debug("==print from arch/arm/mach-omap2==\n");
    sdram_init();
    debug("==print from arch/arm/mach-omap2, after sdram_init==\n");
    /* dram_init must store complete ramsize in gd->ram_size */
    gd->ram_size = get_ram_size(
    (void *)CONFIG_SYS_SDRAM_BASE,
    CONFIG_MAX_RAM_BANK_SIZE);
    }
    #endif

    The reason printf/puts does not work is because this part of u-boot is too early in the SoC initialization (most likely prior to initializing the serial uart).
    You can try to connect to your board via JTag (if you have populated a JTAG header) and use CCS to step through u-boot code, as explained here:
    processors.wiki.ti.com/.../Sitara_Linux_Training:_uboot_linux_debug_with_ccsv5

    Best Regards,
    Yordan
  • Unfortunately, I have no JTAG header.

    I see in the board.c file in mach-omap2 that there are debug outputs. Does it make sense to create own of them and try to find the position where it stops, or will this not work?

    Best regards

    Eric

  • Hi Eric,

    Sorry for the delayed response.
    Yes, you should try to enable as much of the debug outputs as possible.

    Best Regards,
    Yordan