Hello,
I have tried to build the kernel myself, but the self-built image just won't boot. If I use a pre-built image, it boots (at least the 3.10.x version kernels) alright with the same HW and configuration.
I have been reading forums about this topic for 2 weeks while trying to boot my own in parallel, but so far I have not found any solution or seen anybody in the forums has got it finally working which is not too encouraging.
I have read the "common problems booting linux" guide where the console settings and machine IDs are discussed about.
I cannot see any mistake in neither of them. The u-boot sets console be ttyS0,115200n8 and the machine id is -1 (0xffffffff) which I am not sure about but at least the prebuilt images boot with it alright. I have also tried with the machine ID 0x1126 (4390) which is for "Keystone" according to the arch/arm/tools/mach-types.
I have also built my kernel image with the earlyprintk and DEBUG_LL options enabled, but the kernel just won't print any single character.
I have debugged so far with the CCS that I see it really jumps to the entry point at 0x80008000 and it has similar looking code there when compared with a working prebuilt image vs mine.
I use a custom K2L board. The kernel versions I have tried so far:
3.10.10:
Prebuilt uImage obtained from the TI: Boots OK
Self built uImage: Not booting.
3.10.72:
Prebuilt uImage obtained from the TI: Boots OK
Self built uImage: Not booting.
3.1.3 for K2H board:
Prebuilt uImage obtained from the TI: Boots OK. I know it is not wise to use an image for a different hw, but tried anyway because too curious.
Self built uImage: Not built nor tried.
4.4.19:
Prebuilt uImage obtained from the TI: Not booting. There was no existing prebuilt uImage.bin, so I made one from zImage using the mkimage tool. This is not good at all!
Self built uImage: Not booting (, of course).
The test procedure used:
I built the u-boot from the 3.10.10 sources and burnt it to NOR Flash where it boots nicely after powering on the board. I then stop the autoboot by hitting a key and connect to the target with Code Composer Studio.
1. Halt the ARM CPU through the CCS
2. Load uImage into DDR3 at address 0x88000000
3. Load boot monitor (skern) to internal RAM at address 0x0c140000
4. Load device tree into DDR3 at address 0x87000000
5. Set ARM to free run
When trying with different images I do all the other steps exactly with the same files every time except the step 2 where I select a different uImage to test with. The version 4.4 I tested also with the device tree and boot-monitor built for the 4.4 kernel, but they provided no help either.
Here is the console contents with a self-built image try:
U-Boot SPL 2013.01-00003-g9ee5306-dirty (Nov 09 2016 - 09:46:21)
SF: Detected N25Q128A with page size 64 KiB, total 16 MiB
U-Boot 2013.01-00003-g9ee5306-dirty (Nov 09 2016 - 09:46:21)
I2C: ready
DRAM: 2 GiB
Reseting entire DDR3 memory to 0 ...
DRAM: 2 GiB
NAND: 512 MiB
Using default environment
Net: K2L_EMAC0
Warning: K2L_EMAC0 using MAC address from net device
, K2L_EMAC1, K2L_EMAC2, K2L_EMAC3
Hit any key to stop autoboot: 0
K2L EVM # printenv
addr_fdt=0x87000000
addr_fs=0x82000000
addr_kern=0x88000000
addr_mon=0x0c140000
addr_secdb_key=0xc000000
addr_ubi=0x82000000
addr_uboot=0x87000000
addr_uinitrd=-
args_all=setenv bootargs console=ttyS0,115200n8 rootwait=1
args_net=setenv bootargs ${bootargs} rootfstype=nfs root=/dev/nfs rw nfsroot=${s
erverip}:${nfs_root},${nfs_options} ip=dhcp
args_ramfs=setenv bootargs ${bootargs} earlyprintkrdinit=/sbin/init rw root=/dev
/ram0 initrd=0x802000000,38M
args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs root=ubi0:rootfs rootflags
=sync rw ubi.mtd=2,2048
args_uinitrd=setenv bootargs ${bootargs} earlyprintk rdinit=/sbin/init rw
baudrate=115200
boot=ubi
bootargs=console=ttyS0,115200n8 rootwait=1 rootfstype=ubifs root=ubi0:rootfs roo
tflags=sync rw ubi.mtd=2,2048
bootcmd=run init_${boot} get_fdt_${boot} get_mon_${boot} get_kern_${boot} run_mo
n run_kern
bootdelay=3
bootfile=uImage
burn_ubi=nand erase.part ubifs; nand write ${addr_ubi} ubifs ${filesize}
burn_uboot=sf probe; sf erase 0 0x100000; sf write ${addr_uboot} 0 ${filesize}
debug_options=1
ethact=K2L_EMAC0
ethaddr=74:da:ea:24:d3:8d
fdt_high=0xffffffff
get_fdt_net=dhcp ${addr_fdt} ${tftp_root}/${name_fdt}
get_fdt_ramfs=dhcp ${addr_fdt} ${tftp_root}/${name_fdt}
get_fdt_ubi=ubifsload ${addr_fdt} ${name_fdt}
get_fdt_uinitrd=dhcp ${addr_fdt} ${tftp_root}/${name_fdt}
get_fs_ramfs=dhcp ${addr_fs} ${tftp_root}/${name_fs}
get_fs_uinitrd=dhcp ${addr_fs} ${tftp_root}/${name_uinitrd}
get_kern_net=dhcp ${addr_kern} ${tftp_root}/${name_kern}
get_kern_ramfs=dhcp ${addr_kern} ${tftp_root}/${name_kern}
get_kern_ubi=ubifsload ${addr_kern} ${name_kern}
get_kern_uinitrd=dhcp ${addr_kern} ${tftp_root}/${name_kern}
get_mon_net=dhcp ${addr_mon} ${tftp_root}/${name_mon}
get_mon_ramfs=dhcp ${addr_mon} ${tftp_root}/${name_mon}
get_mon_ubi=ubifsload ${addr_mon} ${name_mon}
get_mon_uinitrd=dhcp ${addr_mon} ${tftp_root}/${name_mon}
get_tftp_ubi=dhcp ${addr_fs} ${tftp_root}/${name_ubi}
get_ubi_net=dhcp ${addr_ubi} ${tftp_root}/${name_ubi}
get_uboot_net=dhcp ${addr_uboot} ${tftp_root}/${name_uboot}
has_mdio=0
init_net=run set_fs_none args_all args_net
init_ramfs=run set_fs_none args_all args_ramfs get_fs_ramfs
init_ubi=run set_fs_none args_all args_ubi; ubi part ubifs; ubifsmount boot
init_uinitrd=run set_fs_uinitrd args_all args_uinitrd get_fs_uinitrd
initrd_high=0xffffffff
mem_lpae=1
mem_reserve=512M
mtddevname=bootloader
mtddevnum=0
mtdids=nand0=davinci_nand.0
mtdparts=mtdparts=davinci_nand.0:1024k(bootloader)ro,512k(params)ro,522752k(ubif
s)
name_fdt=uImage-k2l-evm.dtb
name_fs=tisdk-rootfs.cpio.gz
name_kern=sri-k2l-uImage.bin
name_mon=skern-k2l.bin
name_ubi=k2l-evm-ubifs.ubi
name_uboot=u-boot-spi.gph
name_uinitrd=uinitrd.bin
nfs_options=v3,tcp,rsize=4096,wsize=4096
nfs_root=/export
no_post=1
partition=nand0,0
root=/dev/ram0
run_kern=bootm ${addr_kern} ${addr_uinitrd} ${addr_fdt}
run_mon=mon_install ${addr_mon}
serverip=157.87.43.15
set_fs_none=setenv addr_uinitrd -
set_fs_uinitrd=setenv addr_uinitrd ${addr_fs}
setenv=bootargs console=ttyS0,115200n8 rootwait=1 rootfstype=ubifs root=ubi0:roo
tfs rootflags=sync rw ubi.mtd=2,2048 earlyprintk rdinit=/sbin/init rw root=/dev/
ram0
size_ubi=0xCD6000
stderr=serial
stdin=serial
stdout=serial
tftp_root=/
uinitrd_fixup=1
ver=U-Boot 2013.01-00003-g9ee5306-dirty (Nov 09 2016 - 09:46:21)
Environment size: 3461/262140 bytes
K2L EVM # iminfo
## Checking Image at 88000000 ...
Legacy image found
Image Name:
Created: 2016-11-11 11:06:15 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3462440 Bytes = 3.3 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
K2L EVM # mon_install 0x0c140000
## installed monitor, freq [199680000], status 0
K2L EVM # bootm 0x88000000 - 0x87000000
## Booting kernel from Legacy Image at 88000000 ...
Image Name:
Created: 2016-11-11 11:06:15 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3462440 Bytes = 3.3 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 87000000
Booting using the fdt blob at 0x87000000
Loading Kernel Image ... OK
OK
Using Device Tree in place at 87000000, end 8700e50b
Starting kernel ...
Nothing more is never seen although waited for even 30 minutes. The prebuilt images start printing out the normal Linux boot output within 5 seconds, but the self-built image just halts.
The build procedure of the kernel image:
1. Obtain the codes 3.10.x from the TI git (or the kernel 4.4 from the SDK repository)
2. Follow the common instructions for building the kernel:
make keystone2_defconfig
make menuconfig
make zImage
3. Make the uImage from zImage:
../u-boot/tools/mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -d arch/arm/boot/zImage uImage.bin
I am really lost. Any help is really appreciated.
Best regards,
Ari