Skip to content

Commit

Permalink
mvebu: fix initramfs/kernel image for CZNIC Turris Omnia
Browse files Browse the repository at this point in the history
This adds DTB to kernel and that way makes it possible to easily boot
initramfs image and also kernel.

The sequence to boot initramfs on Omnia is then just:
  env set bootargs earlyprintk console=ttyS0,115200
  dhcp 0x1000000 192.168.1.1:openwrt-mvebu-cortexa9-cznic_turris-omnia-initramfs-kernel.bin
  bootz 0x1000000

Without this change kernel boot won't proceed and is stuck on "Starting
kernel".

Signed-off-by: Karel Kočí <karel.koci@nic.cz>
[fixed From: to match with SoB:]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
  • Loading branch information
Cynerd authored and ynezz committed Dec 11, 2020
1 parent 52aa201 commit e401a2a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions target/linux/mvebu/image/cortexa9.mk
Expand Up @@ -32,8 +32,7 @@ define Device/cznic_turris-omnia
DEVICE_VENDOR := CZ.NIC
DEVICE_MODEL := Turris Omnia
KERNEL_INSTALL := 1
KERNEL := kernel-bin
KERNEL_INITRAMFS := kernel-bin
KERNEL := kernel-bin | append-dtb
DEVICE_PACKAGES := \
mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \
wpad-basic-wolfssl kmod-ath9k kmod-ath10k-ct ath10k-firmware-qca988x-ct \
Expand Down

8 comments on commit e401a2a

@finasfinas
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried flashing a custom built build from today and it doesn't boot. It is stuck in "Starting kernel". I tried to reset the env with no luck.
I was able to bring it back to life with the generated medkit and 4-led recovery procedure and tried flashing the official snapshot build from today. Again same problem. I had to resort to the latest 19.07 version to be able to boot it, and avoid being killed by my entire family.

my uboot is:
U-Boot 2015.10-rc2 (Aug 18 2016 - 20:43:35 +0200), Build: jenkins-omnia-master-23

`=> printenv
baudrate=115200
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_prefixes=/ /boot/
boot_scripts=boot.scr
boot_targets=mmc0 scsi0
bootargs=earlyprintk console=ttyS0,115200 rootfstype=btrfs rootdelay=2 root=b301 rootflags=subvol=@,commit=5 rw
bootcmd=i2c dev 1; i2c read 0x2a 0x9 1 0x00FFFFF0; setexpr.b rescue 0x00FFFFF0; if test $rescue -ge 1; then echo BOOT RESCUE; run rescueboot; else echo BOOT eMMC FS; run mmcboot; sei
bootcmd_mmc0=devnum=0; run mmc_boot
bootcmd_scsi0=devnum=0; run scsi_boot
bootdelay=3
distro_bootcmd=scsi_need_init=true; for target in ${boot_targets}; do run bootcmd_${target}; done
ethact=neta2
ethaddr=d8:58:d7:00:73:f6
factory_mmcload=setenv bootargs "$bootargs cfg80211.freg=$regdomain"; btrload mmc 0 0x01000000 boot/zImage @; btrload mmc 0 0x02000000 boot/dtb @
fdt_addr_r=0x2000000
fdt_high=0x10000000
initrd_high=0x10000000
kernel_addr_r=0x1000000
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
mmcboot=btrload mmc 0 ${kernel_addr_r} boot/zImage @ && btrload mmc 0 ${fdt_addr_r} boot/dtb @ && setenv bootargs ${bootargs} cfg80211.freg=${regdomain} && bootz ${kernel_addr_r} - $}
openwrt_bootargs=earlyprintk console=ttyS0,115200 root=/dev/mmcblk0p2 rootfstype=auto rootwait
openwrt_mmcload=setenv bootargs "$openwrt_bootargs cfg80211.freg=$regdomain"; fatload mmc 0 0x01000000 zImage; fatload mmc 0 0x02000000 armada-385-turris-omnia.dtb
regdomain=
*
rescueboot=i2c mw 0x2a.1 0x3 0x1c 1; i2c mw 0x2a.1 0x4 0x1c 1; mw.l 0x01000000 0x00ff000c; i2c write 0x01000000 0x2a.1 0x5 4 -s; setenv bootargs "$bootargs omniarescue=$rescue"; sf p0
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_scripts; done
scan_dev_for_boot_part=for distro_bootpart in 1; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
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 boe
scriptaddr=0x1800000
scsi_boot=run scsi_init; if scsi dev ${devnum}; then devtype=scsi; run scan_dev_for_boot_part; fi
scsi_init=if ${scsi_need_init}; then scsi_need_init=false; scsi scan; fi
stderr=serial@12000
stdin=serial@12000
stdout=serial@12000

Environment size: 2626/65532 bytes`

@finasfinas
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any suggestion?

@ynezz
Copy link
Member

@ynezz ynezz commented on e401a2a Dec 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any suggestion?

@Cynerd I plan to revert that commit today.

@finasfinas
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please notice that I don't know what exact commit broke my device. I suspect it was one of the many regarding booting the omnia that were made in the last month.

@ynezz
Copy link
Member

@ynezz ynezz commented on e401a2a Dec 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@finasfinas
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ynezz Thanks!

@Cynerd
Copy link
Contributor Author

@Cynerd Cynerd commented on e401a2a Dec 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to revert it. I do not have Omnia available to me at the moment so i can't test it. I am going to look in to it but if you want to fix it for holidays then revert is fine with me.

@CHKDSK88
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe FIT image will resolve this problem.
Is Turris u-boot supporting boot from FIT image?

Please sign in to comment.