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.

debugging u-boot via jtag

Hallo,

Is it possible to debug u-boot using jtag? The images I need to debug are MLO (to boot from SD) and u-boot.min.spi (to boot from SPI NOR).

Both those images are less than 128KB to be executed from internal SRAM.

which gel file do I need (if I need one)? Does the BTMODE pin have a special configuration or I can leave them untouched? Reading the u-boot elf file it seems that whole image is placed at 0x80000000 that aren't addresses in SRAM, so how can I load the elf file?

best regards

Max

  • Hi Pavel,

    I am am a little bit cunfused. When I compile u-boot.min-spi and MLO the corresponding elf file has .text segment positioned in DDR (address 0x80000000)

    For example map file of the u-boot.min-spi (to boot from SPI NOR) is:

    Memory map
    
     ** file header
                    0x806ff000       0x34
     ** segment headers
                    0x806ff034       0x80
    
    .text           0x80700000    0x13da8
     .text          0x80700000      0x3c0 arch/arm/cpu/arm_cortexa8/start.o
                    0x80700000                _start
                    0x80700040                _end_vect
                    0x80700044                _armboot_start
                    0x80700048                _bss_start
                    0x8070004c                _bss_end
     .text          0x807003c0       0x5c arch/arm/cpu/arm_cortexa8/ti81xx/libti81xx.a(lowlevel_init.o)
                    0x807003c4                lowlevel_init
     .text          0x8070041c      0x1f4 arch/arm/lib/libarm.a(board.o)
                    0x807004b4                __coloured_LED_init
                    0x807004b4                coloured_LED_init
                    0x807004b8                __red_LED_on
                    0x807004b8                red_LED_on
                    0x807004bc                __red_LED_off
                    0x807004bc                red_LED_off
                    0x807004c0                __green_LED_on
                    0x807004c0                green_LED_on
                    0x807004c4                __green_LED_off
    [...]

    But the internal SRAM is located at 0x40400000 (or 0x40300000).

    I can upload u-boot binary image into internal RAM, but loading symbols from elf file doens't match addresses.

    I cannot find the right linker file. I have this file:

    /*
     * (C) Copyright 2002
     * Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
     *
     * See file CREDITS for list of people who contributed to this
     * project.
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License as
     * published by the Free Software Foundation; either version 2 of
     * the License, or (at your option) any later version.
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with this program; if not, write to the Free Software
     * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
     * MA 02111-1307 USA
     */
    
    OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
    OUTPUT_ARCH(arm)
    ENTRY(_start)
    SECTIONS
    {
    	. = 0x00000000;
    	. = ALIGN(4);
    	.text	:
    	{
    	  arch/arm/cpu/arm_cortexa8/start.o	(.text)
    	  arch/arm/cpu/arm_cortexa8/ti81xx/lowlevel_init.o	(.text)
    	  *(.text)
    	}
    	. = ALIGN(4);
    	.rodata : { *(.rodata) }
    	. = ALIGN(4);
    	.data : { *(.data) }
    	. = ALIGN(4);
    	.got : { *(.got) }
    
    	. = .;
    	__u_boot_cmd_start = .;
    	.u_boot_cmd : { *(.u_boot_cmd) }
    	__u_boot_cmd_end = .;
    
    	. = ALIGN(4);
    	__bss_start = .;
    	.bss (NOLOAD) : { *(.bss) . = ALIGN(4); }
    	_end = .;
    }
    
    

    best regards

    Max

  • Max,

    The TEXT_BASE is the addr where MLO code relocate itself and execute. The reset function will relocate the code from TI_LOAD_ADDR (0x40400000) to TEXT_BASE.

    You can change the TEXT_BASE addr (from 0x80700000 to 0x40410000) in two ways:

    1. Update file u-boot/board/ti/ti8168/config.mk

    # ROM code will load u-boot to this address

    TI_LOAD_ADDR = 0x40400000

    #TEXT_BASE = 0x80700000

    TEXT_BASE = 0x40410000

     

     

    2. Update u-boot/Makefile

    ti8168_evm_min_sd: unconfig

    elif [ "$(findstring _min_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 "TEXT_BASE = 0x40410000" >>$(obj)board/ti/ti8168/config.tmp; \

    echo "Setting up TI8168 SD boot minimal build..." ; \

     

    Regards,
    Pavel

  • Ok, Pavel,

    I changed Makefile, and now I can successfully debug, but when I try to execute without debug it seems to hang. Is it possible that setup for debug conflicts with setup for normal run?

    Another question: why do I need to set the TEXT_BASE to 0x40410000 and not 0x40400000 as I expect?

    I mean, reading the reference manual I find:

    And the mkimage is invoked with:

    $ tools/mkimage -T tiimage -e 0x40400000 -n ti81xx -d u-boot.bin u-boot.min.sd
    Image Type:   Texas Instruments ti81xx Boot Image
    Image Size:   93548 Bytes = 91.36 kB = 0.09 MB
    Load Address: 40400000
    Entry Point:  40400000
    

    It seems that the actual load address is 0x40400000.

    Please note that If I remove the two lines from Makefile it works again (but again I cannot debug)

    best regards

    Max

  • mastupristi said:
    but when I try to execute without debug it seems to hang.

    What do you mean exactly? How you execute without debug? Please provide me the steps and console log. If you want to run u-boot (MLO and u-boot.bin) from internal SRAM only, refer to the below e2e post:

    e2e.ti.com/.../721954

    mastupristi said:
    Another question: why do I need to set the TEXT_BASE to 0x40410000 and not 0x40400000 as I expect?

    Because it is obvious that TI_LOAD_ADDR is at that location, 0x40400000. TI_LOAD_ADDR is load address, TEXT_BASE is run address.

    Regards,
    Pavel

  • Pavel,

    I remove "TEXT_BASE" line from Makefile to compile in "legacy" way.

    I compile with:

    $ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- distclean
    $ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- ti8168_evm_min_sd
    $ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- u-boot.ti

    Taking binary and elf file I cannot debug, because all the symbols refers to 0x80000000. I can connect to the biard and write the binary file to right memory locations, but I cannot set any breakpoint and it cannot refers to source code. I am only able to execute in disassembly.

    Then, I copy u-boot.ti (renamed as MLO) in the root of first SD partition where already exist a working second stage u-boot image. I close CCS and unplug JTAG. I set the correct BTMODE pins and plug the SD card. I power on the board, on the console I have:

    Powersoft - x8 - ver. 123321
    
    DRAM:  1 GiB
    DCACHE:  Off
    MMC:   OMAP SD/MMC: 0
    Using default environment
    
    check Slot ...
    --> check Slot board = f
    Hit any key to stop autoboot:  0 
    raise: Signal # 8 caught
    reading u-boot.bin
    

    then I re-insert the "TEXT_BASE" line into Makefile and compile with the same command lines.

    Now I can debug: the source code is correlated with the disassembly and I can run step by step, and view variables. The only limitation is that I can set breakpoint only in disassembly view.

    The I retry to switch to the board following the same stemps ahead. I powerup the board but no character is displayed in console.

    Now, as counterproof, I remove again the lines from Makefile and recompile with (again) the same command lines: again the debug is impossible, but the board run correctly booting from SD without jtag

    best regards

  • Max,

    I am not sure what you are doing and what is your final goal, but for debug DM816x u-boot.min.sd/MLO with CCS/JTAG, you do not need to change the TEXT_BASE. The only difference between DM814x u-boot.min.sd/MLO and DM816x u-boot.min.sd/MLO is the TI_LOAD_ADDR (0x40300000 for DM814x, and 0x40400000 for DM816x).

    And I already provided to you the instructions to enable the debug for u-boot.min.sd/MLO. Once again, refer to the below link:
    e2e.ti.com/.../331762

    Regards,
    Pavel
  • Pavel,

    I want to debug some features like sw leveling, that my local FAE provide me.

    My hope was that one build could give me binary and elf file to debug with jtag and the image file (from mkimage) to be written to SD or NOR.

    unfortunately it seems that this is impossible, when I enable the debug I make the image . So wath I can debug is not the executable that neet to be debugged.

    I see a different behaviour also if I run the binary in debug and if I take the image and make run from SD.

    I still have not figured out if this is possible.

    best regards

    Max

  • why u-boot needs to be copied from TI_LOAD_ADDR to TEXT_BASE? Both are adresses into internal RAM. Why not execute from TI_LOAD_ADDR?

    My include/configs/ti8168.h doesn't define CONFIG_SKIP_RELOCATE_UBOOT. Can I assume that rom code load correctly u-boot into RAM at TI_LOAD_ADDR? In this case I could define the symbol CONFIG_SKIP_RELOCATE_UBOOT to avoid the copy. there are som pitfull with that?

    best regards

    Max

  • mastupristi said:

    My hope was that one build could give me binary and elf file to debug with jtag and the image file (from mkimage) to be written to SD or NOR.

    unfortunately it seems that this is impossible, when I enable the debug I make the image . So wath I can debug is not the executable that neet to be debugged.

    When you build the 1st stage bootloader, you have these files:

    u-boot.min.sd - stripped binary 1st stage image that can fit into the internal memory

    u-boot - Full 1st stage image containing all debug symbols. Too big for internal memory but can be used to load the symbols

    You are debugging u-boot.min.sd, u-boot is used only for loading the symbols

    Is it clear now?

    Regards,
    Pavel

  • mastupristi said:
    why u-boot needs to be copied from TI_LOAD_ADDR to TEXT_BASE? Both are adresses into internal RAM.

    No, by default TEXT_BASE is not addr into internal RAM. TEXT_BASE is addr from external DDR3 memory (0x80700000).

    See also the below wike page:

    mastupristi said:
    My include/configs/ti8168.h doesn't define CONFIG_SKIP_RELOCATE_UBOOT. Can I assume that rom code load correctly u-boot into RAM at TI_LOAD_ADDR?

    Yes

    mastupristi said:
    In this case I could define the symbol CONFIG_SKIP_RELOCATE_UBOOT to avoid the copy. there are som pitfull with that?

    See the below e2e thread:

    See also u-boot/README

    Regards,
    Pavel

  • Pavel Botev said:

    When you build the 1st stage bootloader, you have these files:

    u-boot.min.sd - stripped binary 1st stage image that can fit into the internal memory

    u-boot - Full 1st stage image containing all debug symbols. Too big for internal memory but can be used to load the symbols

    You are debugging u-boot.min.sd, u-boot is used only for loading the symbols

    Is it clear now?

    yes, Pavel,

    here is depicted my understanding of compile stage:

    the file elf contains both binary and debug info.

    the binary file is extracted from elf.

    The image is done from binary.

    When I debug with jtag I use binary+elf (or only elf). When I execute normally (boot from SD or NOR) i use the image. But the binary executed in both cases is the same, same instractions, same addresses.

    Is that right?

    best regards

    Max

  • Yes, you have the same binary u-boot.min.sd when boot from SD card and when debug with JTAG. The u-boot ELF is used only to load the debug symbols, to be able to put HW breakpoints.
  • Hi Pavel,

    I tried to disable relocation in MLO but it doesn't works. I read the post and now I know that is necessary to relocate in case of SD booting.

    I understood that binary executable is excracted from MLO on SD card by rom code. This binary is placed at 0x40400000, then it jumps to 0x40400000.

    u-boot do a number of initializations, including ddr. and then it relocate himself to ddr.

    Now my issue is to validate ddr calibration, that happens when it run in OCMC RAM. I tried to read DDR PHY registers and it seems that all values are all 0.

    In other words I need to debug MLO when it is placed in OCMC RAM. I cannot use directly elf because it has final address reference (in ddr)

    my hope is the chance to modify code and data offset

    maybe i can "modify" the elf address reference, but I don;t know how. Which values do I neet to set?

    I read this

    but it seems to me that it doesn't match my case.

    After that I will analyze spi 1st stage u-boot. My hope for that is to avoid relocation.

    best regards

    Max

  • mastupristi said:
    In other words I need to debug MLO when it is placed in OCMC RAM.

    I already provided the steps needed to create MLO (and u-boot ELF) for OCMC RAM only. For your convenience, I am giving the links again:

    Regards,
    Pavel

  • Pavel Botev said:

    I already provided the steps needed to create MLO (and u-boot ELF) for OCMC RAM only. For your convenience, I am giving the links again:

    I read, but I think my issue is not this.

    Also configuring u-boot with ti8168_evm_min_ocmc, the uboot is loaded and initially executed in 0x40400000, then it relocates to 0x40410000. The reference in my elf file are for final addresses (0x40410000) but I need to debug when run at 0x40400000.

    If I add

    		echo "#define CONFIG_SKIP_RELOCATE_UBOOT"    >>$(obj)include/config.h ; \
    

    in the makefile and change the TEXT_BASE to 0x40400000, I can debug but the stack is set in the wrong way:

    	/* Set up the stack */
    stack_setup:
    	ldr	r0, _TEXT_BASE		@ upper 128 KiB: relocated uboot
    	sub	r0, r0, #CONFIG_SYS_MALLOC_LEN @ malloc area
    	sub	r0, r0, #CONFIG_SYS_GBL_DATA_SIZE @ bdinfo
    #ifdef CONFIG_USE_IRQ
    	sub	r0, r0, #(CONFIG_STACKSIZE_IRQ + CONFIG_STACKSIZE_FIQ)
    #endif
    	sub	sp, r0, #12		@ leave 3 words for abort-stack
    	bic	sp, sp, #7		@ 8-byte alignment for ABI compliance
    

    the stack goes out of OCMC RAM.

    So this executable works well until it uses stack.

    Adn finally, In this way I debug a binary that I cannot use to boot from NOR and SD.

    How can I use code and data offset to change the reference of elf file?

    best regards

    MAx

  • Max,


    I tried this on the DM814x with 1st stage uart bootloader (u-boot.min.uart).


    By default u-boot.min.uart has TI_LOAD_ADDR of 0x40300000 and TEXT_BASE of 0x80700000. When I change TEXT_BASE from 0x80700000 to 0x40300000 (same as TI_LOAD_ADDR) I see u-boot.min.uart is still working fine.

    So, can you try to set TEXT_BASE to 0x40400000, will it work fine?

    BR
    Pavel

  • When I try with TEXT_BASE=0x40300000 and add CONFIG_SKIP_RELOCATE_UBOOT, my DM814x EVM also works fine.

    When I try with TEXT_BASE=0x80700000 and add CONFIG_SKIP_RELOCATE_UBOOT, my DM814x EVM does not work.

    BR
    Pavel
  • Pavel Botev said:

    By default u-boot.min.uart has TI_LOAD_ADDR of 0x40300000 and TEXT_BASE of 0x80700000. When I change TEXT_BASE from 0x80700000 to 0x40300000 (same as TI_LOAD_ADDR) I see u-boot.min.uart is still working fine.

    So, can you try to set TEXT_BASE to 0x40400000, will it work fine?

    Yes, Pavel,

    I tried, and it works fine until the stack pointer is setup. This happens at line 158 of start.S

    	/* Set up the stack */
    stack_setup:
    	ldr	r0, _TEXT_BASE		@ upper 128 KiB: relocated uboot
    	sub	r0, r0, #CONFIG_SYS_MALLOC_LEN @ malloc area
    	sub	r0, r0, #CONFIG_SYS_GBL_DATA_SIZE @ bdinfo
    #ifdef CONFIG_USE_IRQ
    	sub	r0, r0, #(CONFIG_STACKSIZE_IRQ + CONFIG_STACKSIZE_FIQ)
    #endif
    	sub	sp, r0, #12		@ leave 3 words for abort-stack
    	bic	sp, sp, #7		@ 8-byte alignment for ABI compliance
    

    _TEXT_BASE is 0x40400000, and then subracting MALLOC_LEN, DATA_SIZE, etc. the stack pointer goes out  of OCMC RAM (something like 0x402ff000).

    The first instruction that uses stack pointer, after this setup,  is the first instruction of  start_armboot(), that save some registers into stack. This trigger a fault.

    Pavel Botev said:
    When I try with TEXT_BASE=0x40300000 and add CONFIG_SKIP_RELOCATE_UBOOT, my DM814x EVM also works fine.

    When I try with TEXT_BASE=0x80700000 and add CONFIG_SKIP_RELOCATE_UBOOT, my DM814x EVM does not work.

    I cannot figure out how your setup can works. Which u-boot target is configured? What do you mean with "works fine"? How do you tried it? via jtag or booting from SD?

    I also read thet for SD booting u-boot cannot be configured with CONFIG_SKIP_RELOCATE_UBOOT.

    best regards

    Max

  • Max,

    mastupristi said:
    _TEXT_BASE is 0x40400000, and then subracting MALLOC_LEN, DATA_SIZE, etc. the stack pointer goes out  of OCMC RAM (something like 0x402ff000).

    Then you can calculate how much size you need for malloc, data_size, etc and adjust the TEXT_BASE, thus when subtracting you will go to 0x40400000. You need to set up TEXT_BASE = 0x40400000 + MALLOC + DATA_SIZE + etc. All this might result to TEXT_BASE =  0x40410000, what was the initial proposed value.

    Another approach can be to remove or reduce the size of malloc, data_size, etc.

    Have you also tried to reduce the size of the u-boot? See the below links

    mastupristi said:
    I cannot figure out how your setup can works. Which u-boot target is configured? What do you mean with "works fine"? How do you tried it? via jtag or booting from SD?

    I build u-boot with u-boot.min.uart (TI_LOAD_ADDR=TEXT_BASE=0x40300000). Then I load successfully the u-boot.min.uart on the DM814x TI EVM, I see all the boot messages and go into the u-boot min prompt (TI-MIN#). I am not using SD neither JTAG, I am using UART.

    I made the below modification in u-boot/arch/arm/cpu/arm_cortexa8/start.S

    /*#ifndef CONFIG_SKIP_RELOCATE_UBOOT
    relocate:                @ relocate U-Boot to RAM
        adr    r0, _start        @ r0 <- current position of code
        ldr    r1, _TEXT_BASE        @ test if we run from flash or RAM
        cmp    r0, r1            @ don't reloc during debug
        beq    stack_setup

        ldr    r2, _armboot_start
        ldr    r3, _bss_start
        sub    r2, r3, r2        @ r2 <- size of armboot
        add    r2, r0, r2        @ r2 <- source end address

    copy_loop:                @ copy 32 bytes at a time
        ldmia    r0!, {r3 - r10}        @ copy from source address [r0]
        stmia    r1!, {r3 - r10}        @ copy to   target address [r1]
        cmp    r0, r2            @ until source end addreee [r2]
        ble    copy_loop
    #endif  */   /* CONFIG_SKIP_RELOCATE_UBOOT */

  • Pavel,

    another issue I need for application purposes is to be able to use static variables in the very first stage of u-boot, when it run in RAM before relocation.

    unfortunately the static variable refers to ddr address (where they will be after relocation), so static variables may not be used before relocation.

    How can I modify u-boot to make it works with statics either before relocation or after?

    Reading u-boot README it seems that r8 register should contains address of static variable area, but in my case it contains a number that seems an address in ddr (but i am not sure about contents).

    best regards

    Max

  • Pavel Botev said:

    Then you can calculate how much size you need for malloc, data_size, etc and adjust the TEXT_BASE, thus when subtracting you will go to 0x40400000. You need to set up TEXT_BASE = 0x40400000 + MALLOC + DATA_SIZE + etc. All this might result to TEXT_BASE =  0x40410000, what was the initial proposed value.

    Another approach can be to remove or reduce the size of malloc, data_size, etc.

    I tried to change both TI_LOAD_ADDR and TEXT_BASE to 0x40410000, then I defined CONFIG_SKIP_RELOCATE_UBOOT and I reduced CONFIG_SYS_MALLOC_LEN to fit the RAM size.

    Now I have a problem in clear_bss: I have _bss_start set to 0x4042BE0C and _bss_end 0x4045CC80, so it is out of the OCMC RAM.

    linker file I use is:

    OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
    OUTPUT_ARCH(arm)
    ENTRY(_start)
    SECTIONS
    {
    	. = 0x00000000;
    	. = ALIGN(4);
    	.text	:
    	{
    	  arch/arm/cpu/arm_cortexa8/start.o	(.text)
    	  arch/arm/cpu/arm_cortexa8/ti81xx/lowlevel_init.o	(.text)
    	  *(.text)
    	}
    	. = ALIGN(4);
    	.rodata : { *(.rodata) }
    	. = ALIGN(4);
    	.data : { *(.data) }
    	. = ALIGN(4);
    	.got : { *(.got) }
    
    	. = .;
    	__u_boot_cmd_start = .;
    	.u_boot_cmd : { *(.u_boot_cmd) }
    	__u_boot_cmd_end = .;
    
    	. = ALIGN(4);
    	__bss_start = .;
    	.bss (NOLOAD) : { *(.bss) . = ALIGN(4); }
    	_end = .;
    }
    
    here is the map file:

    u-boot.map.txt

    it seems that fat support needs very much bss:

     .bss           0x4042ca54        0x0 arch/arm/lib/libarm.a(reset.o)
     .bss           0x4042ca54    0x30008 fs/fat/libfat.a(fat.o)
                    0x4044ca5c                do_fat_read_block
                    0x4043ca5c                get_dentfromdir_block
                    0x4042ca5c                get_vfatname_block
     .bss           0x4045ca5c        0x0 disk/libdisk.a(part.o)
     .bss           0x4045ca5c        0x0 disk/libdisk.a(part_dos.o)
     .bss           0x4045ca60      0x220 drivers/mmc/libmmc.a(omap_hsmmc.o)
    

    unfortunately fat is needed to boot the 2nd stage u-boot.

    it only remains to be seen whether, and how, to use static variables in very early u-boot execution.

    Pavel Botev said:

    Have you also tried to reduce the size of the u-boot? See the below links

    The link doesn't works, it seems that the site has a invalid security certificate.

    best regards

    Max

  • Max,

    Regarding static variables, we have info in the DM816x TRM, sections 25.3.2 RAM Memory Map and 25.3.2.5 Static Variables. Per mine calculations the start addr should be 0x4031D068.

    See also the below link:
    u-boot.denx.narkive.com/.../u-boot-users-using-static-variables

    "The link doesn't works, it seems that the site has a invalid security certificate."
    Try this link:
    processors.wiki.ti.com/.../Sitara_Linux_SDK_Training

    Then go to ppt file "Optimizing Linux boot time"

    Regards,
    Pavel
  • Pavel Botev said:
    Max,

    Regarding static variables, we have info in the DM816x TRM, sections 25.3.2 RAM Memory Map and 25.3.2.5 Static Variables. Per mine calculations the start addr should be 0x4031D068.

    I tryed modifing u-boot.lds:

    OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
    OUTPUT_ARCH(arm)
    ENTRY(_start)
    SECTIONS
    {
    	. = 0x00000000;
    	. = ALIGN(4);
    	.text	:
    	{
    	  arch/arm/cpu/arm_cortexa8/start.o	(.text)
    	  arch/arm/cpu/arm_cortexa8/ti81xx/lowlevel_init.o	(.text)
    	  *(.text)
    	}
    	. = ALIGN(4);
    	.rodata : { *(.rodata) }
    	. = ALIGN(4);
    	.data : { *(.data) }
    	. = ALIGN(4);
    	.got : { *(.got) }
    
    	. = .;
    	__u_boot_cmd_start = .;
    	.u_boot_cmd : { *(.u_boot_cmd) }
    	__u_boot_cmd_end = .;
    
    	. = ALIGN(4);
    	__bss_start = .;
    	.bss (NOLOAD) : { *(.bss) . = ALIGN(4); }
    	_end = .;
    	
    	/* added section */
    	.sram 0x4031D068 (NOLOAD) :
    	{
    		* (.sram)
    	}
    }
    

    then I tried to allocate a global variable into .sram section (in evm.c):

    #define	M7	7
    
    DECLARE_GLOBAL_DATA_PTR;
    
    /* added variable */
    static int g_dummy  __attribute__ ((section (".sram")));
    
    void walking_one_test(unsigned long start_addr, unsigned long end_addr);
    void data_walking_test(unsigned long addr, unsigned long mask);
    

    the map file tells me that the new variable is correctly allocated:

    Memory map
    
     ** file header
                    0x4031c000       0x34
     ** segment headers
                    0x4031c034       0xa0
    
    .sram           0x4031d068        0x4
     .sram          0x4031d068        0x4 board/ti/ti8168/libti8168.a(evm.o)
    
    .text           0x80700000    0x104e0
     .text          0x80700000      0x3c0 arch/arm/cpu/arm_cortexa8/start.o
                    0x80700000                _start
                    0x80700040                _end_vect
                    0x80700044                _armboot_start
     

    but as a side affect the binary file, and then MLO image becomes very big, more than 1GB:

    arm-none-linux-gnueabi-objcopy --gap-fill=0xff -O binary u-boot u-boot.bin
    tools/mkimage -T tiimage \
    		-e 0x40400000 -n ti81xx -d u-boot.bin u-boot.min.sd
    Image Type:   Texas Instruments ti81xx Boot Image
    Image Size:   1077905320 Bytes = 1052641.91 kB = 1027.97 MB
    Load Address: 40400000
    Entry Point:  40400000
    

    So I cannot try to boot with this image.

    Have yoou aby idea to correctly change linker script?

    Pavel Botev said:

    Already read, but it doesnt' help.

    Pavel Botev said:

    "The link doesn't works, it seems that the site has a invalid security certificate."
    Try this link:
    processors.wiki.ti.com/.../Sitara_Linux_SDK_Training

    Then go to ppt file "Optimizing Linux boot time"

    It is still unsecure.

    best regards

    max