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.

u-boot internal memory

Hello,

We are planning to customize u-boot in order to implement some DDR memory test.

We are compiling u-boot by using ti8168_evm_min_ocmc to make it run  out from internal memory only.

But , unfortunately, we don't seeing any reply from uart. When we compile with ti8168_config everything runs OK.

Few days of investigation didn't  bring us to understanding where the source of the  problem.

Does somebody has it running?

We need a solution ASAP and will be  appreciated for any help.

Thanks 

  • Hello, Yuri Gusko

    I am using EZSDK 5_04 for dm816, and I was able to build u-boot with "ti8168_evm_min_ocmc" configuration and then to run it successfully.

    Only change line 166 in <EZSDK_home>/Makefile:

    From something like:

    165    u-boot: u-boot-min
    166        $(MAKE) -C $(PSP_INSTALL_DIR)/u-boot-* $(UBOOT_BUILD_VARS) $(DEFAULT_UBOOT_CONFIG)
    167        $(MAKE) -C $(PSP_INSTALL_DIR)/u-boot-* $(UBOOT_BUILD_VARS) u-boot.ti

    to:

    165    u-boot: u-boot-min
    166        $(MAKE) -C $(PSP_INSTALL_DIR)/u-boot-* $(UBOOT_BUILD_VARS) ti8168_evm_min_ocmc
    167        $(MAKE) -C $(PSP_INSTALL_DIR)/u-boot-* $(UBOOT_BUILD_VARS) u-boot.ti

    Or change the value of the variable, or use another variable... That's the only thing that I've changed to the base EZSDK code to make it working.

    I've added some prints to verify that exatly ti8168_evm_min_ocmc configuration takes place.

    ti8168_evm_min_ocmc configuration is described in <EZSDK_home>/board-support/u-boot-xxxx/Makefile. That's a place where the configurations could be altered. Check is there some unintended changes in the elif clause where the _ocmc substring is detected; i.e. booting the wrong way (from uart, etc.), disabling some features; check is there any unwanted changes overall.  Or just try it without any modifications to the u-boot, except the one above.

    BR

  • Vladimir,

    Thanks a lot for quick response!

    Currently we don't use EZSDK.  Is it way to install it on CentOS?

    Now the Makefile looks as following

    ti8168_evm_config \
    ti8168_evm_config_nand \
    ti8168_evm_config_nor \
    ti8168_evm_config_spi \
    ti8168_evm_min_ocmc \
    ti8168_evm_min_sd: unconfig
    @mkdir -p $(obj)include
    @echo "#define CONFIG_TI81XX" >>$(obj)include/config.h
    @echo "#define CONFIG_TI816X" >>$(obj)include/config.h
    @if [ "$(findstring _nand,$@)" ] ; then \
    echo "#define CONFIG_SYS_NO_FLASH" >>$(obj)include/config.h ; \
    echo "#define CONFIG_NAND_ENV" >>$(obj)include/config.h ; \
    echo "Setting up TI8168 NAND build with ENV in NAND..." ; \
    elif [ "$(findstring _nor,$@)" ] ; then \
    echo "#define CONFIG_NOR" >>$(obj)include/config.h ; \
    echo "#define CONFIG_NOR_BOOT" >>$(obj)include/config.h ; \
    echo "Setting up TI8168 NOR build with ENV in NOR..." ; \
    elif [ "$(findstring _spi,$@)" ] ; then \
    echo "#define CONFIG_SYS_NO_FLASH" >>$(obj)include/config.h ; \
    echo "#define CONFIG_SPI_ENV" >>$(obj)include/config.h ; \
    echo "#define CONFIG_TI81XX_SPI_BOOT" >>$(obj)include/config.h ; \
    echo "Setting up TI8168 SPI build with ENV in SPI..." ; \
    elif [ "$(findstring _sd,$@)" ] ; then \
    echo "#define CONFIG_SYS_NO_FLASH" >>$(obj)include/config.h ; \
    echo "#define CONFIG_SD_BOOT" >>$(obj)include/config.h ; \
    echo "TI_IMAGE = u-boot.min.sd" >>$(obj)board/ti/ti8168/config.tmp; \
    echo "Setting up TI8168 SD boot minimal build..." ; \
    elif [ "$(findstring _ocmc,$@)" ] ; then \
    echo "#define CONFIG_SYS_NO_FLASH" >>$(obj)include/config.h ; \
    echo "#define CONFIG_MINIMAL" >>$(obj)include/config.h ; \
    echo "TEXT_BASE = 0x40410000" >>$(obj)board/ti/ti8168/config.tmp; \
    echo "Setting up TI8168 minimal build..." ; \
    else \
    echo "#define CONFIG_SYS_NO_FLASH" >>$(obj)include/config.h ; \
    echo "#define CONFIG_NAND_ENV" >>$(obj)include/config.h ; \
    echo "Setting up TI8168 defualt build with NAND..." ; \
    fi;
    @$(MKCONFIG) -a ti8168_evm arm arm_cortexa8 ti8168 ti ti81xx

    Do you see something wrong there ?

    Best Regards,

    Yuri

  • Hello,

    OK, the entire EZSDK is not needed for your task, it's all about the u-boot. Your ti8168_evm_min_ocmc looks just like mine, but we will unable to compare everything else.  My u-boot version is u-boot-2010.06-psp04.04.00.01; just try to build fresh source code (make sure it is fresh) and only change the passed configuration in a way similar to that mentioned in my previous post, if you didn't already. I hope this helps.

    EZSDK is intended for Ubuntu 10.04 LTS, perhaps it is possible to port it on your own for other UNIX-like systems, but still installing Ubuntu is the way to go. That is quick and easy and EZSDK is useful for many other things, so you could try it.

    BR

  • Vladimir,

    I've downloaded 


    u-boot-2010.06-psp04.04.00.01.tar.gz
    28-May-2012 16:34 12M  

    from https://source.ridgerun.net/packages/ but didn't find there nothing mentioned in the your first post.

    Something misunderstood...

    BR,

  • Hello,

    It is OK. That's because my fist post is about the EZSDK approach, I said something "similar". I mean that you should try to build that fresh source code, without any change to it, only, instead of building it normally, change the configuration to ti8168_evm_min_ocmc. I don't know what is the strict build procedure for you case (I mean outside EZSDK), but within that procedure there should be something like this:

    make -C <path_to_u-boot>/u-boot-* CROSS_COMPILE=<cross_compile_dir> ti8168_evm_config

    and you have to change it to something like this:

    make -C <path_to_u-boot>/u-boot-* CROSS_COMPILE=<cross_compile_dir> ti8168_evm_min_ocmc

    Then run that u-boot. Tell me what is happening when you try that out. It is possible that this generic u-boot (form source.ridgerun.net/packages) doesn't have this configurations at all. Inform me what is going on.

    BR

  • Hi Vladimir,

    I've installed EZSDK_5_04 and arm-2009q1_203-arm-none-linux-gnuebai toolchain on Ubuntu 10.4.

    As I known, this toolchain is not so suitable for compiling u-boot due to "undefined reference to 'raise'" issue, for instance.

    What toolchain do you recommend to use ?

  • Hello, Yuri Gusko

    This is the exactly toolchain I am using for compiling everything in EZSDK, even u-boot; and I am not aware of such issue, because I am building u-boot without any problems. Just try to follow my instructions from the post made on Jul 3, 2012 3:04 PM. You can build it using either "make u-boot" or "make all" from the main EZSDK folder. Please inform me what is going on.

    BR

  • Vladimir,

    OK.It still doesn't work. I'll describe exactly what I do...

    1. I compile u-boot with default configuration by running make u-boot from ~/ti-ezsdk_dm816x-evm_5_04_00_11

    and get

    ......

    tools/mkimage -T tiimage \
    -e 0x40400000 -n ti81xx -d u-boot.bin u-boot.noxip.bin
    Image Type: Texas Instruments ti81xx Boot Image
    Image Size: 210312 Bytes = 205.38 kB = 0.20 MB
    Load Address: 40400000
    Entry Point: 40400000
    make[1]: Leaving directory `/home/yuri/ti-ezsdk_dm816x-evm_5_04_00_11/board-support/u-boot-2010.06-psp04.04.00.01'

    Everything works fine.

    2. I do changes posted by you on Jul 3, 2012 3:04 PM  then  run make u-boot again

    and get  

    .......

    tools/mkimage -T tiimage \
    -e 0x40400000 -n ti81xx -d u-boot.bin u-boot.noxip.bin
    Image Type: Texas Instruments ti81xx Boot Image
    Image Size: 86152 Bytes = 84.13 kB = 0.08 MB
    Load Address: 40400000
    Entry Point: 40400000
    make[1]: Leaving directory `/home/yuri/ti-ezsdk_dm816x-evm_5_04_00_11/board-support/u-boot-2010.06-psp04.04.00.01

    Doesn't work

    The u-boot .map looks like following

    Memory Configuration

    Name Origin Length Attributes
    *default* 0x00000000 0xffffffff

    Linker script and memory map

    0x00000000 . = 0x0
    0x00000000 . = ALIGN (0x4)

    .text 0x40410000 0xfe9c
    arch/arm/cpu/arm_cortexa8/start.o(.text)
    .text 0x40410000 0x3a0 arch/arm/cpu/arm_cortexa8/start.o
    0x40410040 _end_vect
    0x40410048 _bss_start
    0x4041004c _bss_end
    0x40410044 _armboot_start
    0x40410000 _start

    .....

    .bss 0x40425bd8 0x8 arch/arm/cpu/arm_cortexa8/ti81xx/libti81xx.a(timer.o)
    .bss 0x40425be0 0x0 arch/arm/cpu/arm_cortexa8/ti81xx/libti81xx.a(syslib.o)
    .bss 0x40425be0 0x0 arch/arm/cpu/arm_cortexa8/ti81xx/libti81xx.a(sys_info.o)
    .bss 0x40425be0 0x0 arch/arm/cpu/arm_cortexa8/ti81xx/libti81xx.a(cache.o)
    .bss 0x40425be0 0x4 arch/arm/lib/libarm.a(bootm.o)
    .bss 0x40425be4 0x0 arch/arm/lib/libarm.a(cache.o)
    .bss 0x40425be4 0x0 arch/arm/lib/libarm.a(reset.o)
    .bss 0x40425be4 0x0 arch/arm/cpu/arm_cortexa8/libarm_cortexa8.a(cpu.o)
    .bss 0x40425be4 0x0 arch/arm/lib/libarm.a(cache-cp15.o)
    .bss 0x40425be4 0x0 /home/yuri/ti-ezsdk_dm816x-evm_5_04_00_11/board-support/u-boot-2010.06-psp04.04.00.01/arch/arm/lib/eabi_compat.o
    .bss 0x40425be4 0x0 /home/yuri/opt/codesourcery/gnueabi/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/libgcc.a(_udivsi3.o)
    .bss 0x40425be4 0x0 /home/yuri/opt/codesourcery/gnueabi/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/libgcc.a(_divsi3.o)
    .bss 0x40425be4 0x0 /home/yuri/opt/codesourcery/gnueabi/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/libgcc.a(_lshrdi3.o)
    .bss 0x40425be4 0x0 /home/yuri/opt/codesourcery/gnueabi/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/libgcc.a(_ashldi3.o)
    .bss 0x40425be4 0x0 /home/yuri/opt/codesourcery/gnueabi/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/libgcc.a(_dvmd_lnx.o)
    0x40425be4 . = ALIGN (0x4)
    0x40425be4 _end = .

    ....

     

  • Hello, Yuri Gusko

    What is the behaviour of the board when you copy the ti8168_evm_min_ocmc u-boot.bin on the SD card. No reply on the UART? That's strange because if is working with the normal one, you should at least see prints from the MLO.

    So, what's the behaviour? My  ti8168_evm_min_ocmc u-boot.bin has the same size, I guess we are near. Ho do you bring up the board? Is it SD card actually? Are sure that you flash it properly?

    BR

  • Yuri,

    Could you please send the u-boot.map file to my mail id renjith.thomas@pathpartnertech.com? 

  • Renjith,

    Yes of course. The email has been sent

    Thanks.

  • Vladimir,

    Yes, I don't see any reply from UART.

    I don't use SD, but load the u-boot to target via ftp.

    In order to check the u-boot is running, I just added some GPIO toggling function inside ti/ti8168/evm.c. It's start toggling, but get stuck, where exactly, it will be known soon, I hope. 

    You've mentioned SD.... May be my problem is that ti8168_evm_min_ocmc allows booting from SD only?

    Anyway, if it possible, could you send me your u-boot.bin please? 

    ygusko@gmail.com


    Many thanks

  • Hello, Yuri Gusko

    OK, there was some missunderstanding. In order to implement a RAM test in the u-boot, your goal is to have an u-boot that is using internal memory ONLY, so it has to be either single-staged, either the 1st stage to load the 2nd stage into the internal memory (I am not sure is the second thing is possible or at least easy doable). So in that way I am not sure that my u-boot is working. I am not sure that the ocmc configuration will actually do this, further configuration could be needed.

    So, please confirm: are you using EMAC boot, something like this:

    http://processors.wiki.ti.com/index.php?title=DM816x_AM389x_EMAC_Boot

    And your passing the ocmc u-boot only?

    BR

  • Hello, Yuri Gusko

    So, after little research I found out the following:

    http://processors.wiki.ti.com/index.php/DM816x_AM389x_PSP_U-Boot#U-Boot

    It says:

    "In case of NAND/SPI/SD boot mode, the ROM code loads the U-Boot image from the flash memory into OCMC RAM1."

    So you can easily accomplish you goal to use the internal RAM only and to implement a DDR test, just by using NAND or SPI boot (with their normal configurations). This is valid for DM816x only. Please inform me if that helps.

    BR

  • PS:

    For your EMAC boot you can use NAND or SPI configured u-boot, as you probably know.

  • I'd like to explain our setup and goal again in order to avoid misunderstanding. 

    So, we have some custom board (CB) connected to the EVM DM8168.

    The u-boot binary is stored on the Flash of the CB. We put it there by ftp.

    The u-boot is loaded to the EVM's Netra DSP via PCI Express.

    The CB's PowerQuicc processor manages this process.

    The DSP MBOOT configuration is 01000, which set up according to the  table 25-8 from sprugx8.pdf.

    In order to implement an external memory and connectivity tests, we'd like to run out the u-boot from the DM8168 ARM's internal memory only.

    As I've mentioned before, there is no any problem, when we use the u-boot compiled with ti8168_evm_config option (we are manage to boot and load kernel). But this option makes the u-boot running from external memory, thus we have to find something else.

    The u-boot compiled by using  ti8168_evm_min_ocmc or ti8168_evm_config_nand options is not succeeded.

    Doesn't matter what we trying to load,  u-boot.bin or u-boot.noxip.bin, the UART reply nothing. 

    Unfortunately the Lauterbach emulator  is currently not available...

    BR,

    Yuri 

    T

  • Hello, Yuri Gusko

    As I told you before this link says:

    http://processors.wiki.ti.com/index.php/DM816x_AM389x_PSP_U-Boot#U-Boot

    that NAND flash and SPI flash boots are from the internal memory. This is a possible way to solve the issue. Can you use i.e. the SPI flash for you boot? Or you have to use you custom boot procedure for your project?

    Both u-boot.bin and u-boot.noxip.bin have file size of 205,4KB which fits into the size of OCMC RAM1 which is 256KB. They could be there. How do you verify that they are not loaded in the OCMC RAM?

    Also, your problem could be something little in your custom boot procedure, try first NAND/SPI/EMAC boot as described in board-support/doc U-BOOT documentation, as they all are from the internal memory and they are verified.

    Write back and we will continue to investigate. Sorry for the long time without a clear solution.

    BR



  • Hi Vladimir,

    Actually I have to use my custom booting procedure, but currently I'm trying of SD boot.
    I do following...

    1. Compile u-boot.bin (84.13KB) according to your post at Jul 3, 2012 3:04 PM
    2. Compile MLO by using u-boot-min (99.37KB)
    3. Put both of them on SD and re-boot

    The reply that I get from serial is

    U-Boot 2010.06 (Jul 18 2012 - 13:33:08)

    DRAM: 2 GiB
    MMC: OMAP SD/MMC: 0
    Using default environment

    Hit any key to stop autoboot: 0
    raise: Signal # 8 caught
    reading u-boot.bin

    86152 bytes read
    ## Starting application at 0x80800000 ...


    U-Boot 2010.06 (Jul 19 2012 - 10:31:59)

    TI8168-GP rev 2.1

    ARM clk: 987MHz
    DDR clk: 796MHz

    DRAM: 2 GiB
    Using default environment

    The ## Starting application at 0x80800000 ...confused me

    Does it mean that booting procedure still uses an external memory?

    BTW When I short DDR and reboot the serial replies nothing...

    Does MLO used by SD booting only?

    It just looks like MLO's piece of code is what is lack in my custom booting procedure.

    Please confirm

    Thanks

    Yuri

  • Hello, Yuri Gusko

    At last I have it; u-boot from internal memory only, running and truly verified. I'll explain everything here at this post, without referencing other posts, to avoid misunderstandings; there could be some inaccurate statements in the past. It is for EZSKD 5.04 (ti816x).

    1. How to build u-boot with ocmc configuration (internal memory only):

    In a fresh source code only change line 166 in <EZSDK_home>/Makefile:

    From:

    165    u-boot: u-boot-min
    166        $(MAKE) -C $(PSP_INSTALL_DIR)/u-boot-* $(UBOOT_BUILD_VARS) $(DEFAULT_UBOOT_CONFIG)
    167        $(MAKE) -C $(PSP_INSTALL_DIR)/u-boot-* $(UBOOT_BUILD_VARS) u-boot.ti

    to:

    165    u-boot: u-boot-min
    166        $(MAKE) -C $(PSP_INSTALL_DIR)/u-boot-* $(UBOOT_BUILD_VARS) ti8168_evm_min_ocmc
    167        $(MAKE) -C $(PSP_INSTALL_DIR)/u-boot-* $(UBOOT_BUILD_VARS) u-boot.ti

    Or change the value of the variable, or use another variable... That's the only thing that should be changed to the base EZSDK code to make it working.


    Make it:
    $ cd <EZSDK_home>
    $ make u-boot_clean
    $ make u-boot

    2. How to run it:
    Enter <EZSDK_home>/board-support/u-boot-2010.06-psp04.04.00.01.
    Copy u-boot.noxip.bin to some folder (i.e. ~/install) and rename it to.


    Copy to the empty boot partition of a SD card MLO from <EZSDK_home>/board-support/prebuilt-images, and the renamed u-boot.bin from ~/install.

    Boot the board from that SD card.


    3. How to verify it (important).

    An inaccurate thing that I've said before is that NAND/SPI boot configs for u-boot are internal memory only; that's not true: they are loaded into the OCMC RAM (located at 0x40400000) at first but after that the u-boot is copied to the DDR. The only internal memory configuration is ti8168_evm_min_ocmc. Very important thing of that configuration (but not the only important thing) is the line ~3342 in <EZSDK_home>/board-support/u-boot-2010.06-psp04.04.00.01/Makefile

            echo "TEXT_BASE = 0x40410000" >>$(obj)board/ti/ti8168/config.tmp; \

    It says where in the memory map u-boot to be located.

    The verification:

    When you try a SD card with both MLO and u-boot.bin from <EZSDK_home>/board-support/prebuilt-images (or any other NOT ocmc u-boot) and type the these two commands in the running u-boot:

    mw.b 0x40410000 0xFF 0x10000
    mw.b 0x80700000 0xFF 0x10000

    The first one will take no effect, while the second one will make u-boot to freeze. That's because u-boot is currently loaded at 0x80700000 (DDR).

    But when you try a SD card with MLO from <EZSDK_home>/board-support/prebuilt-images and ocmc u-boot (from ~/install, acquired as described earlier here) and type:

    mw.b 0x40410000 0xFF 0x10000
    mw.b 0x80700000 0xFF 0x10000

    This time the second one will take no effect, while the first one will make u-boot to freeze. That's an evidence of internal memory u-boot.


    It is working, that's it.


    I also have a print that says "## Starting application at 0x80800000 ...", this is because the prebuilt MLO file is configured to load the image this way at first but the correct ocmc u-boot goes to 0x40410000 after that, so that's OK.

    WARNING: mw command could harm your system! Use it only this way and only for that verification. You don't want to write undesired things to important places with mw.


    4. (Additional) Another approach to run it:

    You can load internal memory only u-boot form a running u-boot, you could find this helpful. Flash normally a SD card (i.e. with mksdboot.sh). Rename ocmc u-boot held in ~/install (as mention earlier) from "u-boot.bin" to "u-boot.bin.ocmc" and copy it to that SD card (rename files on your hard drive, not on the SD card FAT boot partition, because they could get corrupted). Boot with that card and then at the u-boot prompt type:

    mmc rescan 0; fatload mmc 0 40410000 u-boot.bin.ocmc; go 40410000


    ====================================================

    Now we clarify that ocmc configuration is working, but there is one problem that is still present. How to make it working for your custom boot procedure? Here is one approach. You probably need 2-staged boot loader implementation for that ocmc configuration and for your boot sequence. Your 2nd stage boot loader will be of course ocmc u-boot (u-boot.bin from ~/install). But how about the 1st stage boot loader (MLO)? You should make it on your own. You have to modify one of the existing configurations. I can not tell how to implement that exactly, it depends on many things on your side. All of the following till the end of the post is not a guide how to modify it, it is just a hint how to figure it out yourself.


    Let say you want to modify SPI configuration to become your 1st stage boot loader.

    In board-support/u-boot-2010.06-psp04.04.00.01/include/configs/ti8168_evm.h
    there is some piece of code for 1st stage boot loader (MLO) for the SD card: lines 71-83.
    You, for your SPI modification, have to add in the same file something similar, i.e.:



    #ifdef CONFIG_TI81XX_SPI_BOOT
    # undef CONFIG_TI816X_ASCIIART
    # undef CONFIG_DISPLAY_CPUINFO

    # define CONFIG_BOOTDELAY    0
    # define CONFIG_SYS_AUTOLOAD    "yes"
    # define CONFIG_BOOTCOMMAND    "tftp 0x81000000 u-boot.bin;go 0x81000000"
    # define CONFIG_ENV_IS_NOWHERE
    #endif




    In that line:
    # define CONFIG_BOOTCOMMAND    "tftp 0x81000000 u-boot.bin;go 0x81000000"
    u-boot.bin is 2nd stage ocmc u-boot from ~/install, the load address (0x81000000) doesn't matter what actually is, because ocmc will move to 0x40410000 in any case. If you don't use tftp, use here what is required.


    Change line 166 in <EZSDK_home>/Makefile again:

    166        $(MAKE) -C $(PSP_INSTALL_DIR)/u-boot-* $(UBOOT_BUILD_VARS) ti8168_evm_config_spi


    Rebuild u-boot:
    $ cd <EZSDK_home>
    $ make u-boot_clean
    $ make u-boot

    Use u-boot.noxip.bin.spi from <EZSDK_home>/board-support/u-boot-2010.06-psp04.04.00.01/ as your 1st stage boot loader: pass this first to the Netra board; then pass to the board your 2nd stage.

    BR

  • Hi Vladimir,

     I've verified and that's works exactly as you've described.

    So, as you've mentioned, the next challenge is to make working  the custom boot sequence.

    Much obliged to you for the  help !