I’m attempting to update our Linux code-base to run on the Apalis TK1 V1.2.
I’ve merged the latest Linux kernel source and script changes and I am able to build the zImage
and the dtb
files and I’ve also successfully deployed these to our target hardware containing the TK1 V1.2.
However, when trying to boot the module, the system refuses to boot from the eMMC and goes through all the other available boot devices before ultimately failing:
Booting from internal eMMC chip...
reading tegra124-apalis-v1.2-eval.dtb
53812 bytes read in 16 ms (3.2 MiB/s)
reading zImage
5473816 bytes read in 139 ms (37.6 MiB/s)
MMC: no card present
switch to partitions #0, OK
mmc2 is current device
Scanning mmc 2:1...
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
starting USB...
USB0: USB EHCI 1.10
USB1: USB EHCI 1.10
USB2: USB EHCI 1.10
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
USB device 0: unknown device
e1000: no NVM
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
DHCP client bound to address 192.168.0.158 (1143 ms)
*** Warning: no boot file name; using 'C0A8009E.img'
Using e1000#0 device
TFTP from server 192.168.0.4; our IP address is 192.168.0.158
Filename 'C0A8009E.img'.
Load address: 0x81000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/01-00-14-2d-63-0b-eb
Using e1000#0 device
TFTP from server 192.168.0.4; our IP address is 192.168.0.158
Filename 'pxelinux.cfg/01-00-14-2d-63-0b-eb'.
Load address: 0x90100000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
One thing I did notice is that the loadaddr=0x81000000
parameter was set differently to how our compile script was running (now changed LOADADDR to match the above):
make -j3 zImage LOADADDR=0x80008000
Here’s the printenv
output in case this helps with anything.
U-Boot 2016.11-2.8.6+g83a53c1c0c (Apr 01 2019 - 09:57:13 +0000)
SoC: tegra124
Reset cause: POR
DRAM: 2 GiB
MMC: Tegra SD/MMC: 0, Tegra SD/MMC: 1, Tegra SD/MMC: 2
In: serial
Out: serial
Err: serial
Model: Toradex Apalis TK1 2GB V1.2A, Serial# 06491115
Net: No ethernet found.
Hit any key to stop autoboot: 0
Apalis TK1 # printenv
arch=arm
baudrate=115200
board=apalis-tk1
board_name=apalis-tk1
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
boot_file=zImage
boot_net_pci_enum=pci enum
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_targets=mmc1 mmc2 mmc0 usb0 pxe dhcp
bootcmd=run emmcboot; setenv fdtfile ${soc}-${fdt_module}-${fdt_board}.dtb && run distro_bootcmd
bootcmd_dhcp=run boot_net_usb_start; run boot_net_pci_enum; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;
bootcmd_mmc0=setenv devnum 0; run mmc_boot
bootcmd_mmc1=setenv devnum 1; run mmc_boot
bootcmd_mmc2=setenv devnum 2; run mmc_boot
bootcmd_pxe=run boot_net_usb_start; run boot_net_pci_enum; dhcp; if pxe get; then pxe boot; fi
bootcmd_usb0=setenv devnum 0; run usb_boot
bootdelay=1
console=ttyS0
cpu=armv7
defargs=lp0_vec=2064@0xf46ff000 core_edp_mv=1150 core_edp_ma=4000 usb_port_owner_info=2 lane_owner_info=6 emc_max_dvfs=0 pcie_aspm=off user_debug=30
dfu_alt_info=apalis-tk1.img raw 0x0 0x500 mmcpart 1; boot part 0 1 mmcpart 0; rootfs part 0 2 mmcpart 0; zImage fat 0 1 mmcpart 0; tegra124-apalis-eval.dtb fat 0 1 mmcpart 0
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
emmcargs=ip=off root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait
emmcboot=run setup; setenv bootargs ${defargs} ${emmcargs} ${setupargs} ${vidargs}; echo Booting from internal eMMC chip...; run emmcdtbload; load mmc 0:1 ${kernel_addr_r} ${boot_file} && run fdt_fixup && bootz ${kernel_addr_r} - ${dtbparam}
emmcdtbload=setenv dtbparam; load mmc 0:1 ${fdt_addr_r} ${soc}-${fdt_module}-${fdt_board}.dtb && setenv dtbparam ${fdt_addr_r}
ethaddr=00:14:2d:63:0b:eb
fdt_addr_r=0x82000000
fdt_board=eval
fdt_fixup=;
fdt_high=ffffffff
fdt_module=apalis-v1.2
fdtcontroladdr=fda32a40
initrd_high=ffffffff
ipaddr=192.168.10.2
kernel_addr_r=0x81000000
loadaddr=0x81000000
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
netmask=255.255.255.0
nfsargs=ip=:::::eth0:on root=/dev/nfs rw
nfsboot=pci enum; run setup; setenv bootargs ${defargs} ${nfsargs} ${setupargs} ${vidargs}; echo Booting via DHCP/TFTP/NFS...; run nfsdtbload; dhcp ${kernel_addr_r} && run fdt_fixup && bootz ${kernel_addr_r} - ${dtbparam}
nfsdtbload=setenv dtbparam; tftp ${fdt_addr_r} ${soc}-${fdt_module}-${fdt_board}.dtb && setenv dtbparam ${fdt_addr_r}
pxefile_addr_r=0x90100000
ramdisk_addr_r=0x82100000
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x90000000
sdargs=ip=off root=/dev/mmcblk1p2 ro rootfstype=ext4 rootwait
sdboot=run setup; setenv bootargs ${defargs} ${sdargs} ${setupargs} ${vidargs}; echo Booting from MMC/SD card in 8-bit slot...; run sddtbload; load mmc 1:1 ${kernel_addr_r} ${boot_file} && run fdt_fixup && bootz ${kernel_addr_r} - ${dtbparam}
sddtbload=setenv dtbparam; load mmc 1:1 ${fdt_addr_r} ${soc}-${fdt_module}-${fdt_board}.dtb && setenv dtbparam ${fdt_addr_r}
serial#=06491115
serverip=192.168.10.1
setethupdate=if env exists ethaddr; then; else setenv ethaddr 00:14:2d:00:00:00; fi; pci enum && tftpboot ${loadaddr} flash_eth.img && source ${loadaddr}
setsdupdate=setenv interface mmc; setenv drive 1; mmc rescan; load ${interface} ${drive}:1 ${loadaddr} flash_blk.img || setenv drive 2; mmc rescan; load ${interface} ${drive}:1 ${loadaddr} flash_blk.img && source ${loadaddr}
setup=setenv setupargs igb_mac=${ethaddr} consoleblank=0 no_console_suspend=1 console=tty1 console=${console},${baudrate}n8 debug_uartport=lsport,0 ${memargs}
setupdate=run setsdupdate || run setusbupdate || run setethupdate
setusbupdate=usb start && setenv interface usb; setenv drive 0; load ${interface} ${drive}:1 ${loadaddr} flash_blk.img && source ${loadaddr}
soc=tegra124
stderr=serial
stdin=serial
stdout=serial
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
usbargs=ip=off root=/dev/sda2 ro rootfstype=ext4 rootwait
usbboot=run setup; setenv bootargs ${defargs} ${setupargs} ${usbargs} ${vidargs}; echo Booting from USB stick...; usb start && run usbdtbload; load usb 0:1 ${kernel_addr_r} ${boot_file} && run fdt_fixup && bootz ${kernel_addr_r} - ${dtbparam}
usbdtbload=setenv dtbparam; load usb 0:1 ${fdt_addr_r} ${soc}-${fdt_module}-${fdt_board}.dtb && setenv dtbparam ${fdt_addr_r}
vendor=toradex
ver=U-Boot 2016.11-2.8.6+g83a53c1c0c (Apr 01 2019 - 09:57:13 +0000)
vidargs=fbcon=map:1
Environment size: 5571/8188 bytes
Some additional info from u-boot:
Apalis TK1 # mmc dev 0 0
switch to partitions #0, OK
mmc0(part 0) is current device
Apalis TK1 # mmc part
Partition Map for MMC device 0 -- Partition Type: DOS
Part Start Sector Num Sectors UUID Type
1 8192 32768 9f808538-01 0c
2 40960 30679040 9f808538-02 83
Apalis TK1 # ls mmc 0:1
5473816 zimage
53812 tegra124-apalis-eval.dtb
53812 tegra124-apalis-v1.2-eval.dtb
3 file(s), 0 dir(s)
Apalis TK1 # ls mmc 0:2
<DIR> 4096 .
<DIR> 4096 ..
<DIR> 16384 lost+found
62 README.txt
<DIR> 4096 bin
<DIR> 4096 boot
<DIR> 4096 dev
<DIR> 12288 etc
<DIR> 4096 home
<DIR> 4096 lib
<DIR> 4096 media
<DIR> 4096 mnt
<DIR> 4096 opt
<DIR> 4096 proc
<DIR> 4096 root
<DIR> 4096 run
<DIR> 12288 sbin
<DIR> 4096 srv
<DIR> 4096 sys
<DIR> 4096 tmp
<DIR> 4096 usr
<DIR> 4096 var
And more info…
I can load in the zimage
and tegra124-apalis-v1.2-eval.dtb
files but when I try to boot from the ${loadaddr}
then the system just resets:
Apalis TK1 # load mmc 0:1 ${kernel_addr_r} zimage
reading zimage
5473816 bytes read in 139 ms (37.6 MiB/s)
Apalis TK1 # load mmc 0:1 ${kernel_addr_r} tegra124-apalis-v1.2-eval.dtb
reading tegra124-apalis-v1.2-eval.dtb
53812 bytes read in 17 ms (3 MiB/s)
Apalis TK1 # go ${loadaddr}
## Starting application at 0x81000000 ...
undefined instruction
pc : [<81000004>] lr : [<fff46840>]
reloc pc : [<011ce004>] lr : [<80114840>]
sp : fda327f0 ip : 00000030 fp : fff467f8
r10: 00000002 r9 : fda3fee0 r8 : fda43118
r7 : fffb014c r6 : 81000000 r5 : 00000002 r4 : fda4311c
r3 : 81000000 r2 : fda4311c r1 : fda4311c r0 : 00000001
Flags: nZCv IRQs off FIQs off Mode SVC_32
Resetting CPU ...
resetting ...