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.

How to change Linux kernel runing address

Hollow Faq!

          I use the TCI6638. My Linux kernel (K2_LINUX_0.3.10.72_15  downed from TI) runing in  0x80000000 .Now I want to change this address to 0x60000000. How can I do?

        I haved read this wiki:http://processors.wiki.ti.com/index.php/HOWTO_Change_the_Linux_Kernel_Start_Address, but It not work.

        I haved do to this for 3 days. Please help!

       

  • As per latest linux, you need make changes in device tree files. Please refer the MCSDK exploring wiki for more information,

    Thank you.

  • Can you please refer to this section ?
    processors.wiki.ti.com/.../MCSDK_UG_Chapter_Exploring

    Please let us know if any issue.
  • Thank you! I try it new.

  • Hellow,I haved follow the wiki, but it not work.

    My kernel is K2_LINUX_03.10.72_15.08; My u-boot is u-boot-keystone(tag K2_UBOOT_2013-01_13.11).The CPU is TCI6638-k2k.
    Linux is runing at address 0x80008000(DDR3A) by default. But this address is used by DSP progamme,os Linux have to runing at address 0xF6008000(DDR3B), mem size is 128M.

     
    The following is I do:

    Linux part:

    K2_LINUX_03.10.72_15.08/arch/arm/mach-keystone/Makefile.boot
    - zreladdr-y ?= 0x80008000
    + zreladdr-y ?= 0xF6000000

    K2_LINUX_03.10.72_15.08/arch/arm/boot/dts/keystone.dtsi,
    no change.
    memory {
    reg = <0x00000000 0x80000000 0x00000000 0x20000000>;
    };

    at "K2_LINUX_03.10.72_15.08/arch/arm/mach-keystone/include/mach/memory.h" file, is so differet from the wiki describe, so I didn't change this file.

    static inline phys_addr_t __virt_to_idmap(unsigned long x)
    {
    #ifdef CONFIG_KEYSTONE_RECOVERY_KERNEL
    return __virt_to_phys(x) - KEYSTONE_HIGH_PHYS_START +
    #else
    return (phys_addr_t)(x) - CONFIG_PAGE_OFFSET +
    #endif
    KEYSTONE_LOW_PHYS_START;
    }

    #define virt_to_idmap(x) __virt_to_idmap((unsigned long)(x))


    U-boot part:

    no change
    #define CONFIG_NR_DRAM_BANKS 1
    #define CONFIG_SYS_SDRAM_BASE 0x80000000
    #define CONFIG_SYS_LPAE_SDRAM_BASE 0x800000000
    #define CONFIG_MAX_RAM_BANK_SIZE (2 << 30) /* 2GB */
    #define CONFIG_STACKSIZE (512 << 10) /* 512 KiB */
    #define CONFIG_SYS_MALLOC_LEN (1024 << 10) /* 1 MiB */
    #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
    #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + 32 << 20)
    #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_TEXT_BASE - \
    GENERATED_GBL_DATA_SIZE)

    I didn't change the env of kernel and fdt:
    TCI6638 EVM # printenv addr_kern
    addr_kern=0x81008000
    TCI6638 EVM # printenv addr_fdt
    addr_fdt=0x87000000

    I changed the env of bootags as:
    console=ttyS0,115200n8 rootwait=1 rootfstype=ubifs root=ubi0:rootfs rootflags=sync rw ubi.mtd=2,2048 mem=128M

    At last, I run the system:

    U-Boot 2013.01-dirty (Sep 27 2016 - 14:29:31)

    I2C: ready
    Detected SO-DIMM [SQR-SD3T-2G1333SED]
    gd->ram_size:80000000
    DRAM: 2 GiB
    NAND: 512 MiB
    *** Warning - bad CRC, using default environment

    Net: TCI6638_EMAC
    Warning: TCI6638_EMAC using MAC address from net device
    , TCI6638_EMAC1
    Hit any key to stop autoboot: 0
    Using TCI6638_EMAC device
    TFTP from server 192.168.3.30; our IP address is 192.168.3.235
    Filename 'uImage-hrst-lte.dtb'.
    Load address: 0x87000000
    Loading: T ####
    10.7 KiB/s
    done
    Bytes transferred = 55893 (da55 hex)
    Using TCI6638_EMAC device
    TFTP from server 192.168.3.30; our IP address is 192.168.3.235
    Filename 'skern-keystone-evm.bin'.
    Load address: 0xc5f0000
    Loading: ####
    2.3 MiB/s
    done
    Bytes transferred = 45056 (b000 hex)
    Using TCI6638_EMAC device
    TFTP from server 192.168.3.30; our IP address is 192.168.3.235
    Filename 'uImage'.
    Load address: 0x81008000
    Loading: #################################################################
    #################################################################
    #################################################################
    #################################################################
    ###################
    2.3 MiB/s
    done
    Bytes transferred = 4086616 (3e5b58 hex)
    ## installed monitor, freq [204800000], status 0
    ## Booting kernel from Legacy Image at 81008000 ...
    Image Name: Linux-3.10.72
    Created: 2016-09-27 6:08:10 UTC
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 4086552 Bytes = 3.9 MiB
    Load Address: 60008000
    Entry Point: 60008000
    Verifying Checksum ... OK
    ## Flattened Device Tree blob at 87000000
    Booting using the fdt blob at 0x87000000
    comp 0 load:60008000 image_start:81008040
    blob_start:81008000 image_start:81008040
    Loading Kernel Image ... OK
    OK
    do_bootm_linux:0
    Using Device Tree in place at 87000000, end 87010a54
    tree addree:87000000
    lpae:1
    nbanks:1
    start[0]:a size:0
    ## Transferring control to Linux (at address 60008000)...

    Starting kernel ...


    The Linux kernel init fail.
    I debug the with ccs. I found that: The kernel haved runing
    start_kernel() --->
           setup_arch() --->
                   paging_init() --->
                          dma_contiguous_remap --->
                                   iotable_init --->
                                           iotable_init (kenel runaway here )

    I have some question:

    1    the vmlinux have runing at specifying phy address?

    2   If the ddram base address is 0x80000000, the kernel can runing at 0x81000000?

    3 The kernel's ram sourece,is just decideing by the fdt file?

  • You should change the new kernel and fdt address in u-boot.
    Also you should change it in device tree source include file (keystone.dtsi)

    I suggest you to use the latest processor SDK linux which has the latest kernel version 4.4, so that I can try to reproduce your issue,
  • Thank you,very much!

    I do you suggest.

  • Hellow! Dear FAQ.
    I haved download the SDK(ti-processor-sdk-linux-k2e-evm-03.00.00.04-Linux-x86-Install.bin) as your suggested.
    I haved builded the boot monitor,u-boot and kernel firmware. I can start u-boot success with CCS.But I was fail when start the kernel.
    I found that: before the u-boot starting kernel,u-boot stop runing while runing the Boot monitor(skern-k2hk.bin)

    It looks like:

    => run get_mon_net

    netcp@2000000 Waiting for SGMII auto negotiation to complete. done
    Using netcp@2000000 device
    TFTP from server 192.168.3.30; our IP address is 192.168.3.235
    Filename 'skern-k2hk.bin'.
    Load address: 0xc5f0000
    Loading: ####
    1.4 MiB/s
    done
    Bytes transferred = 45056 (b000 hex)
    => run run_mon
    K2_BM_15. 07-nogit SoC:k2hk built:20:15:22, Sep 28 2016

    Stop here.

    I build the skern-k2hk.bin like that:

    proton@proton-Lenovo:~/tmp/board-support/boot-monitor-3.0+gitAUTOINC+035329caed$ export CROSS_COMPILE=arm-linux-gnueabihf-
    proton@proton-Lenovo:~/tmp/board-support/boot-monitor-3.0+gitAUTOINC+035329caed$ make
    Building for SoC=k2e
    CC ../soc/k2e/skern.o
    CC ../soc/k2e/psci.o
    CC ../soc/k2e/debug.o
    CC ../soc/k2e/skernel.o
    LINK ../soc/k2e/s-kernel.out
    BIN ../soc/k2e/s-kernel.bin
    OBJCOPY ../soc/k2e/s-kernel_pad.bin
    CC ../soc/k2e/init.o
    LINK ../soc/k2e/nonsec.out
    BIN ../soc/k2e/nonsec.bin
    OBJCOPY ../soc/k2e/nonsec_pad.bin
    Generating skern-k2e.bin
    Building for SoC=k2g
    CC ../soc/k2g/skern.o
    CC ../soc/k2g/psci.o
    CC ../soc/k2g/debug.o
    CC ../soc/k2g/skernel.o
    LINK ../soc/k2g/s-kernel.out
    BIN ../soc/k2g/s-kernel.bin
    OBJCOPY ../soc/k2g/s-kernel_pad.bin
    CC ../soc/k2g/init.o
    LINK ../soc/k2g/nonsec.out
    BIN ../soc/k2g/nonsec.bin
    OBJCOPY ../soc/k2g/nonsec_pad.bin
    Generating skern-k2g.bin
    Building for SoC=k2hk
    CC ../soc/k2hk/skern.o
    CC ../soc/k2hk/psci.o
    CC ../soc/k2hk/debug.o
    CC ../soc/k2hk/skernel.o
    LINK ../soc/k2hk/s-kernel.out
    BIN ../soc/k2hk/s-kernel.bin
    OBJCOPY ../soc/k2hk/s-kernel_pad.bin
    CC ../soc/k2hk/init.o
    LINK ../soc/k2hk/nonsec.out
    BIN ../soc/k2hk/nonsec.bin
    OBJCOPY ../soc/k2hk/nonsec_pad.bin
    Generating skern-k2hk.bin
    Building for SoC=k2l
    CC ../soc/k2l/skern.o
    CC ../soc/k2l/psci.o
    CC ../soc/k2l/debug.o
    CC ../soc/k2l/skernel.o
    LINK ../soc/k2l/s-kernel.out
    BIN ../soc/k2l/s-kernel.bin
    OBJCOPY ../soc/k2l/s-kernel_pad.bin
    CC ../soc/k2l/init.o
    LINK ../soc/k2l/nonsec.out
    BIN ../soc/k2l/nonsec.bin
    OBJCOPY ../soc/k2l/nonsec_pad.bin
    Generating skern-k2l.bin

    Where I haved do worng? Please!
    An other auestion: Can the kernel runing at DDR3B(address 0x60000000)
  • Instead of using the your own built images, can you please try the pre-built images (skern, u-boot and uImage/zImage (kernel) ) of your platform ?