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.

Linux/TCIEVMK2X: How to run linux kernel from a different physical address than the default booting address

Part Number: TCIEVMK2X

Tool/software: Linux

Hi,


I  am currently working on the TCIEVMK2X board with the ti-processor-sdk-linux-rt-k2hk-evm-05.00.00.15.

I need to change the boot address from 0x80000000 to 0xA0000000 (using 512MB for Linux at this address) and let the 512MB from 0x80000000 to 0xA0000000 for the DSP.


I did some changes in the device tree sources and in the U-boot sources.

I tried to get help from the following link, however, it doesn't really help me.

processors.wiki.ti.com/.../MCSDK_UG_Chapter_Exploring

For U-boot, i did the following changes:

in include/configs/ti_armv7_keystone2.h

#define CONFIG_SYS_LPAE_SDRAM_BASE    0x800000000 --> #define CONFIG_SYS_LPAE_SDRAM_BASE    0x820000000

#define CONFIG_MAX_RAM_BANK_SIZE    (2 << 30)  --> #define CONFIG_MAX_RAM_BANK_SIZE    (2 << 29)  to reduce size used from 2 GB to 1 GB

in include/configs/ti_armv7_common.h

#define CONFIG_SYS_LOAD_ADDR        0x82000000 --> #define CONFIG_SYS_LOAD_ADDR        0xA2000000

I didn't change "#define CONFIG_SYS_SDRAM_BASE        0x80000000" because it makes u-boot stocked.

About device tree source, until now, I placed all area (cmem and reserved area) after 0xA0000000. However, the purpose is to place dsp_common_mpm_memory at address 0x80000000 as explain before.


I also changed all the addresses defined in U-boot (environment variables).

Doing all these changes, I got stocked on  "Starting Kernel..." as below:

Flattened Device Tree blob at a8000000
Booting using the fdt blob at 0xa8000000
Loading Device Tree to 8fff3000, end 8ffff881 ... OK

Starting kernel ...

Would you have any idea about my problem, about what I miss here or any procedure to change the default address as I want?


Thank you in advance for your help.

Best Regards.

  • Hi,

    In ti_armv7_common.h you have the following defines:
    */
    #define DEFAULT_LINUX_BOOT_ENV \
    "loadaddr=0x82000000\0" \
    "kernel_addr_r=0x82000000\0" \
    "fdtaddr=0x88000000\0" \
    "fdt_addr_r=0x88000000\0" \
    "rdaddr=0x88080000\0" \
    "ramdisk_addr_r=0x88080000\0" \
    "scriptaddr=0x80000000\0" \
    "pxefile_addr_r=0x80100000\0" \
    "bootm_size=0x10000000\0" \
    "boot_fdt=try\0

    You need to change the laodaddr, kernel_addr_r and so on to the exact memory addresses that fit your needs. Furthermore in ti_armv7_keystone2.h you have #define CONFIG_EXTRA_ENV_SETTINGS which also describe some load address, i.e.:
    addr_ubi=0x82000000\0" \
    "addr_secdb_key=0xc000000\0" \
    "name_kern=zImage\0" \
    "addr_mon=0x87000000\0" \
    "addr_non_sec_mon=0x0c087fc0\0" \
    "addr_load_sec_bm=0x0c08c000\0"

    Those should be modified as well.


    Best Regards,
    Yordan
  • Hi,


    Firstly, thank you for your answer.

    I changed all the 0x8xxxxxxx addresses to 0xAxxxxxxx to follow my needs. However, what you are telling me is something I did when i change the variable directly in U-boot, isn't it right? The addresses you show me are the one used by default, no?

    However, I tried toI change these addresses too but it doesn't change anything. I am still stuck at same point:

    ## installed monitor @ 0xc5f0000, freq [200000000], status 207552512
    device 0 offset 0x530000, size 0xa6d9
    SF: 42713 bytes @ 0x530000 Read: OK
    ## Flattened Device Tree blob at a8000000
       Booting using the fdt blob at 0xa8000000
       Loading Device Tree to 8fff3000, end 8ffff8a1 ... OK

    Starting kernel ...

    I also did same change as I told you in my first post:

    in include/configs/ti_armv7_keystone2.h

    #define CONFIG_SYS_LPAE_SDRAM_BASE    0x800000000 --> #define CONFIG_SYS_LPAE_SDRAM_BASE    0x820000000

    #define CONFIG_MAX_RAM_BANK_SIZE    (2 << 30)  --> #define CONFIG_MAX_RAM_BANK_SIZE    (2 << 29)  to reduce size used from 2 GB to 1 GB

    in include/configs/ti_armv7_common.h

    #define CONFIG_SYS_LOAD_ADDR        0x82000000 --> #define CONFIG_SYS_LOAD_ADDR        0xA2000000

     

    Concerning kernel, I didn't change anything so i didn't compile a new kernel for this case. Should I change something in kernel source?

    Concerning the device tree, I tried the following change in keystone.dtsi:

    memory {
             instead of  reg = <0x00000000 0x80000000 0x00000000 0x80000000>;
     };

    replaced by

    reg = <0x00000000 0xA0000000 0x00000000 0x60000000>;

    Is it right? What should be done in device tree source to follow my case? (I placed all area from 0xA0000000 to 0xFFFFFFFF)


    Thank you for your help.

    Best regards.

  • Hi,

    Concerning kernel, I didn't change anything so i didn't compile a new kernel for this case. Should I change something in kernel source?


    No, kernel source code shouldn't be changed as far as I know. It seems that for some reason u-boot is not booting fdt from the correct address
    Flattened Device Tree blob at a8000000
    Booting using the fdt blob at 0xa8000000
    Loading Device Tree to 8fff3000, end 8ffff881 ... OK

    Or it is relocating it for some reason.
    When booting with the modified u-boot, changed all addresses in ti_armv7_common.h & ti_armv7_keystone2.h & k2hk_evm.h, can you stop at u-boot stage and execute printenv and see if the modifications have been accepted?

    Best Regards,
    Yordan
  • Hi,

    The configuration were well applied to my u-boot variables (if i'am doing a "env default -f -a" in u-boot). However, I always modified the environment variable directly under u-boot so that was not the problem. The environment variable that I set in files are not the one I really used.

    Finally, after many tests and many compilation/flash of U-boot on board, I resolved my problem that was comming from the variable bootm_size that was set to 0x10000000.
    I can set it for instance to 0x40000000. It then solves the problem:

    ## Flattened Device Tree blob at a8000000
    Booting using the fdt blob at 0xa8000000
    Loading Device Tree to bdec5000, end bded18a1 ... OK

    And it is not stuck anymore on "Starting Kernel...".

    Thank you for your help.

    Best regards.
  • Thanks for updating the thread. I am closing this discussion.

    Best Regards,
    Yordan