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/66AK2E05: linux boot problem on custom board.

Part Number: 66AK2E05

Tool/software: Linux

Hi all!

I have u-boot.bin working on on my board. At this moment I can load and start u-boot.bin from CCS or boot board from SPI NOR flash via u-boot-spi.gph image. But only in u-boot console. Linux don't start properly, and spinning in kernel code. Here description of problem:

All software components from Processor SDK. All of them was properly configured and build without errors as stated in appropriate manuals:

u-boot-spi.gph

skern-k2e.bin - compile with #define DEBUG 

k2-fw-initrd.cpio.gz (not build - use from prebuilt images)

keystone-k2e-evm.dtb

zImage - compile with #define DEBUG in some files

Here the boot messages:

**** cut some output above ****

Hit any key to stop autoboot: 0

K2E_EMAC0 Waiting for SGMII auto negotiation to complete. done
K2E_EMAC0 Waiting for PHY auto negotiation to complete. done
Using K2E_EMAC0 device
TFTP from server 192.168.0.102; our IP address is 192.168.0.241
Filename 'swh101v/skern-k2e.bin'.
Load address: 0xc1f0000
Loading: #######
5.9 KiB/s
done
Bytes transferred = 32832 (8040 hex)
DEBUG: skern_init(): CPU0: from = 0x00000001 dsp_base = 0x01e80000 freq = 208333333

DEBUG: skern_init(): Secure Mode: Core freq - 208333333 Hz

K2_BM_15. 07-nogit SoC:k2e built:10:53:40, Mar 6 2017

## installed monitor @ 0xc1f0000, freq [208333333], status 203390975

K2E_EMAC0 Waiting for SGMII auto negotiation to complete. done
Using K2E_EMAC0 device
TFTP from server 192.168.0.102; our IP address is 192.168.0.241
Filename 'swh101v/k2-fw-initrd.cpio.gz'.
Load address: 0x88080000
Loading: #############
1.7 MiB/s
done
Bytes transferred = 64887 (fd77 hex)

K2E_EMAC0 Waiting for SGMII auto negotiation to complete. done
Using K2E_EMAC0 device
TFTP from server 192.168.0.102; our IP address is 192.168.0.241
Filename 'swh101v/keystone-k2e-evm.dtb'.
Load address: 0x88000000
Loading: #########
1.5 MiB/s
done
Bytes transferred = 44611 (ae43 hex)

K2E_EMAC0 Waiting for SGMII auto negotiation to complete. done
Using K2E_EMAC0 device
TFTP from server 192.168.0.102; our IP address is 192.168.0.241
Filename 'swh101v/zImage'.
Load address: 0x82000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
##############################
1.6 MiB/s
done
Bytes transferred = 3480832 (351d00 hex)
Kernel image @ 0x82000000 [ 0x000000 - 0x351d00 ]
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Ramdisk to 8fff0000, end 8ffffd77 ... OK
Loading Device Tree to 8ffe2000, end 8ffefe42 ... OK
ft_board_setup()
ft_board_setup_ex()

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

DEBUG: skern_poweron_cpu(): >>>> skern_poweron_cpu(1) >>>>

DEBUG: skern_123_init(): Secure Mode: Core freq - 208333333 Hz

DEBUG: skern_poweron_cpu(): >>>> skern_poweron_cpu(2) >>>>

DEBUG: skern_123_init(): Secure Mode: Core freq - 208333333 Hz

DEBUG: skern_poweron_cpu(): >>>> skern_poweron_cpu(3) >>>>

DEBUG: skern_123_init(): Secure Mode: Core freq - 208333333 Hz

Booting process stop here :(

I was try to debug this issue, and found that processor is working in linux area code and not hung. I can connect to A15 Core0 in CCS via JTAG.

1) Can you look into debug messages from boot monitor, and tell about monitor install errors? May be installed address not valid? In ti wiki address noted as 0x0C140000 but in boot-monitor code install address is 0x0C1F0000.

2) Can you tell me, please about possible reasons of such behavior and how I can debug this issue? If you need any additional information I will provide it.

3) Can you look into u-boot environment settings and compare it with EVM settings? May be some addresses are not valid? Thank you.

4) On my board installed less memory than on evm. No NAND, SD. Please can you tell me, how I can fix this issue in dtb?

Thank you.

P.S. U-boot environment settings:

addr_mon=0x0C1F0000
addr_secdb_key=0xc000000
addr_ubi=0x82000000
arch=arm
args_all=setenv bootargs console=ttyS0,115200n8 rootwait=1
args_net=setenv bootargs ${bootargs} rootfstype=nfs root=/dev/nfs rw nfsroot=${serverip}:${nfs_root},${nfs_options} ip=dhcp
args_ramfs=setenv bootargs ${bootargs} rdinit=/sbin/init rw root=/dev/ram0 initrd=0x808080000,80M
args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs root=ubi0:rootfs rootflags=sync rw ubi.mtd=ubifs,2048
baudrate=115200
board=ks2_evm
board_name=ks2_evm
boot=net
boot_fdt=try
bootargs=console=ttyS0,115200n8 rootwait=1 rootfstype=nfs root=/dev/nfs rw nfsroot=192.168.0.102:/home/karak/targetfs-swh101v,v3,tcp,rsize=4096,wsize=4096 ip=dhcp
bootcmd=run init_${boot} get_mon_${boot} run_mon init_fw_rd_${boot} get_fdt_${boot} get_kern_${boot} run_kern
bootcmd_old=run init_${boot} get_mon_${boot} run_mon init_fw_rd_${boot} get_fdt_${boot} get_kern_${boot} run_kern
bootdelay=2
bootdir=/boot
bootm_size=0x10000000
burn_ubi=nand erase.part ubifs; nand write ${addr_ubi} ubifs ${filesize}
burn_uboot_nand=nand erase 0 0x100000; nand write ${loadaddr} 0 ${filesize}
burn_uboot_spi=sf probe; sf erase 0 0x90000; sf write ${loadaddr} 0 ${filesize}
cpu=armv7
ethact=K2E_EMAC0
ethaddr=b4:99:4c:11:64:36
fdt_addr_r=0x88000000
fdtaddr=0x88000000
fdtcontroladdr=beef3388
fileaddr=88000000
filesize=ae43
get_fdt_net=tftp ${fdtaddr} ${tftp_root}/${name_fdt}
get_fdt_nfs=nfs ${fdtaddr} ${nfs_root}/boot/${name_fdt}
get_fdt_ramfs=dhcp ${fdtaddr} ${tftp_root}/${name_fdt}
get_fdt_ubi=ubifsload ${fdtaddr} ${bootdir}/${name_fdt}
get_fs_ramfs=dhcp ${rdaddr} ${tftp_root}/${name_fs}
get_kern_net=tftp ${loadaddr} ${tftp_root}/${name_kern}
get_kern_nfs=nfs ${loadaddr} ${nfs_root}/boot/${name_kern}
get_kern_ramfs=dhcp ${loadaddr} ${tftp_root}/${name_kern}
get_kern_ubi=ubifsload ${loadaddr} ${bootdir}/${name_kern}
get_mon_net=tftp ${addr_mon} ${tftp_root}/${name_mon}
get_mon_nfs=nfs ${addr_mon} ${nfs_root}/boot/${name_mon}
get_mon_ramfs=dhcp ${addr_mon} ${tftp_root}/${name_mon}
get_mon_ubi=ubifsload ${addr_mon} ${bootdir}/${name_mon}
get_ubi_net=dhcp ${addr_ubi} ${tftp_root}/${name_ubi}
get_ubi_nfs=nfs ${addr_ubi} ${nfs_root}/boot/${name_ubi}
get_uboot_net=tftp ${loadaddr} ${tftp_root}/${name_uboot}
get_uboot_nfs=nfs ${loadaddr} ${nfs_root}/boot/${name_uboot}
init_fw_rd_net=tftp ${rdaddr} ${tftp_root}/${name_fw_rd}; run set_rd_spec
init_fw_rd_ramfs=setenv rd_spec -
init_fw_rd_ubi=ubifsload ${rdaddr} ${bootdir}/${name_fw_rd}; run set_rd_spec
init_net=run args_all args_net
init_nfs=setenv autoload no; dhcp; run args_all args_net
init_ramfs=run args_all args_ramfs get_fs_ramfs
init_ubi=run args_all args_ubi; ubi part ubifs; ubifsmount ubi:rootfs;
ipaddr=192.168.0.241
kernel_addr_r=0x82000000
loadaddr=0x82000000
mem_lpae=0
mtdparts=mtdparts=davinci_nand.0:1024k(bootloader)ro,512k(params)ro,-(ubifs)
name_fdt=keystone-k2e-evm.dtb
name_fs=arago-console-image-k2e-evm.cpio.gz
name_fw_rd=k2-fw-initrd.cpio.gz
name_kern=zImage
name_mon=skern-k2e.bin
name_ubi=k2e-evm-ubifs.ubi
name_uboot=u-boot-spi.gph
nfs_options=v3,tcp,rsize=4096,wsize=4096
nfs_root=/home/karak/targetfs-swh101v
no_post=1
pxefile_addr_r=0x80100000
ramdisk_addr_r=0x88080000
rd_spec=0x88080000:8040
rdaddr=0x88080000
run_kern=bootz ${loadaddr} ${rd_spec} ${fdtaddr}
run_mon=mon_install ${addr_mon}
scriptaddr=0x80000000
serverip=192.168.0.102
set_rd_spec=setenv rd_spec ${rdaddr}:${filesize}
soc=keystone
stderr=serial@02530c00
stdin=serial@02530c00
stdout=serial@02530c00
tftp_root=swh101v
vendor=ti
ver=U-Boot 2016.05-00304-ged00144-dirty (Mar 02 2017 - 16:51:47 +0300)

  • Hi Vladimir,

    I've forwarded this to the Linux experts. Their feedback should be posted here.

    BR
    Tsvetolin Shulev
  • Hi Vladimir,

    First of all, from the log you shared, I was not able to see how did you run the boot command from u-boot. When I flashed my board I used this wiki:
    processors.wiki.ti.com/.../Program_EVM_UG
    You can see that after you transfer the the u-boot & ubi filesystem you need to take the following steps:
    env default –f –a
    setenv boot ubi
    boot

    Second, if you've followed the above procedure, to burn & boot your board, then can you share how did you build the zImage? Which defconfig file you used?

    Best Regards,
    Yordan
  • Hi Yordan!

    Thank you for your answer!

    1) I burn u-boot-spi.gph image in SPI flash from u-boot, that was loaded via JTAG and CCS.

    2) In u-boot variables, boot=net and bootcmd is:

    bootcmd = run init_${boot} get_mon_${boot} run_mon init_fw_rd_${boot} get_fdt_${boot} get_kern_${boot} run_kern

    and

    run_kern = bootz ${loadaddr} ${rd_spec} ${fdtaddr}

    All software components placed in tftpboot directory on local network. I will try to boot my board with rootfs mounted on NFS.  But linux spinning in very closer moment from start after "Uncompressing ... done".

    3) I build linux kernel using this commands:

    source ./environment-swh101v <--- set ARCH, CROSS_COMPILE, and PATH

    (I try to build linux as stated in PSDK wiki, define all macroses in command line, but result is the same )

    make distclean && make tisdk_k2e-evm_defconfig && make zImage && make keystone-k2e-evm.dtb

    4) DTB, Linux and all other software components was not modified at all. May be here the error. I mention in previous message that my board have a differences from EVM. 

    Thank you!

  • Hi,

    4) DTB, Linux and all other software components was not modified at all. May be here the error. I mention in previous message that my board have a differences from EVM


    This is strange. Ok, then can you try rebuilding your setup with:
    cd ~/ti-processor-sdk-linux-am57xx-evm-03.02.00.05

    And then use the top-level makefile to build zImage & dtb:
    make linux
    This should do all the exports, create zImage & dtb file.

    Best Regards,
    Yordan
  • Hi, Yordan!
    I do all steps as you say.

    cd ~/ti-processor-sdk-linux-k2e-evm-03.02.00.05
    make boot-monitor_clean boot-monitor
    make linux_clean linux

    I have no any build errors.
    I have symbolic links in tftpboot/swh101v directory on all created files.
    Than I power up my board with the same result, as before. See boot log below.

    Do you have any assumptions? Thank you.

    Boot log:

    U-Boot SPL 2016.05-00305-gc6b76ec-dirty (Mar 21 2017 - 12:48:31)
    Trying to boot from SPI

    U-Boot 2016.05-00305-gc6b76ec-dirty (Mar 21 2017 - 12:48:31 +0300)

    CPU: 66AK2Ex SR1.0
    Model: Texas Instruments Keystone 2 Edison EVM
    I2C: ready
    DRAM: Configure DDR3A from static params.
    DDR3 speed 1600
    DRAM: 1 GiB
    1 GiB
    SF: Detected N25Q256A with page size 256 Bytes, erase size 4 KiB, total 32 MiB
    Net: K2E_EMAC0, K2E_EMAC1
    Warning: K2E_EMAC1 (eth1) using random MAC address - 22:e2:24:89:27:14

    Hit any key to stop autoboot: 0

    K2E_EMAC0 Waiting for SGMII auto negotiation to complete. done
    K2E_EMAC0 Waiting for PHY auto negotiation to complete.. done
    Using K2E_EMAC0 device
    TFTP from server 192.168.0.102; our IP address is 192.168.0.241
    Filename 'swh101v/skern-k2e.bin'.
    Load address: 0xc1f0000
    Loading: #######
    5.9 KiB/s
    done
    Bytes transferred = 32832 (8040 hex)
    DEBUG: Message2 from Secure Mode: Core freq - 208333333Hz

    K2_BM_15. 07-nogit SoC:k2e built:13:32:17, Mar 23 2017

    ## installed monitor @ 0xc1f0000, freq [208333333], status 203390975

    K2E_EMAC0 Waiting for SGMII auto negotiation to complete. done
    Using K2E_EMAC0 device
    TFTP from server 192.168.0.102; our IP address is 192.168.0.241
    Filename 'swh101v/k2-fw-initrd.cpio.gz'.
    Load address: 0x88080000
    Loading: #############
    1.3 MiB/s
    done
    Bytes transferred = 64887 (fd77 hex)

    K2E_EMAC0 Waiting for SGMII auto negotiation to complete. done
    Using K2E_EMAC0 device
    TFTP from server 192.168.0.102; our IP address is 192.168.0.241
    Filename 'swh101v/keystone-k2e-evm.dtb'.
    Load address: 0x88000000
    Loading: #########
    1.3 MiB/s
    done
    Bytes transferred = 44611 (ae43 hex)

    K2E_EMAC0 Waiting for SGMII auto negotiation to complete. done
    Using K2E_EMAC0 device
    TFTP from server 192.168.0.102; our IP address is 192.168.0.241
    Filename 'swh101v/zImage'.
    Load address: 0x82000000
    Loading: #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    ##############################
    1.4 MiB/s
    done
    Bytes transferred = 3479080 (351628 hex)
    Kernel image @ 0x82000000 [ 0x000000 - 0x351628 ]
    ## Flattened Device Tree blob at 88000000
    Booting using the fdt blob at 0x88000000
    Loading Device Tree to 8fff2000, end 8ffffe42 ... OK

    Starting kernel ...

    DEBUG: >>>> skern_poweron_cpu(1) >>>>

    DEBUG: Message2 from Secure Mode: Core freq - 208333333Hz

    DEBUG: >>>> skern_poweron_cpu(2) >>>>

    DEBUG: Message2 from Secure Mode: Core freq - 208333333Hz

    DEBUG: >>>> skern_poweron_cpu(3) >>>>

    DEBUG: Message2 from Secure Mode: Core freq - 208333333Hz
  • Hi, Yourdan!

    I will try to bring up my board. I don't know how I can debug my issue. I read all related documents for PSDK. And found on boot monitor page  this information:

    • At Linux start up, primary core make smc call to power on each of the secondary core. smc call is issued with r0 pointing to the command (0 - power ON). r1 points to the CPU number and r2 to secondary core kernel entry point address. Primary core wait for secondary cores to boot up and then proceeds to rest of booting sequence.

    1) Please, can you explain me that event primary core is waiting? How I can disable such behavior? I try rebuild kernel with disabled CONFIG_SMP settings, but have no result. 

    2) Please, can you give me how I can properly setup device tree for u-boot and linux kernel? I correct only phy addresses and don't know where I can fix memory layout.

    Thank you!

  • Hi, to All!
    I found the problem, but don't found a decision.
    Linux not boot because I load incorrect device tree file.