From ec096357501a2c4915ada4135c3e4c4e299c17ba Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Fri, 5 Jun 2020 16:42:28 +0900 Subject: [PATCH] rpi: tizen-boot: rpi: tizen-boot: add tizen boot script for rpi4 64bit Add tizen boot script for rpi4 64bit. Change-Id: I5ea641bccfa38dbabf666a783c2c3446daad4992 Signed-off-by: Seung-Woo Kim --- board/raspberrypi/rpi/tizen-boot-rpi4.scr | 72 +++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 board/raspberrypi/rpi/tizen-boot-rpi4.scr diff --git a/board/raspberrypi/rpi/tizen-boot-rpi4.scr b/board/raspberrypi/rpi/tizen-boot-rpi4.scr new file mode 100644 index 0000000000..3a199dc513 --- /dev/null +++ b/board/raspberrypi/rpi/tizen-boot-rpi4.scr @@ -0,0 +1,72 @@ +# U-boot script for tizen RPI4 + +if test -e $bootdev $mmcbootdev:$mmcinformpart $rebootparamfile; then; + ext4load $bootdev $mmcbootdev:$mmcinformpart $rebootparam_addr $rebootparamfile; + if itest.l *${rebootparam_addr} == ${upgrade_val}; then; + setenv ramdiskpart 8 + setenv ramdisksize c00000 + setenv bootmode fota + elif itest.l *${rebootparam_addr} == ${recovery_val}; then; + setenv ramdiskpart 8 + setenv ramdisksize c00000 + setenv bootmode recovery + elif itest.l *${rebootparam_addr} == ${download_val}; then; + setenv ramdiskpart 8 + setenv ramdisksize c00000 + setenv bootmode flash + elif itest.l *${rebootparam_addr} == ${nodef_val}; then; + echo "This reboot parameter is not supported..."; + fi +fi + +# This is for jumping to flash mode on u-boot. +if test "${bootmode}" = "download"; then; + setenv ramdiskpart 8 + setenv ramdisksize c00000 + setenv bootmode flash +fi + +if test "${bootmode}" = "flash"; then; + if test -n "${ipaddr}"; then; + ip_opt=\"ip=${ipaddr}::${gateway}:${netmask}\" + fi +fi + +# boot from ram0 if there is sbin +if test -e $bootdev $mmcrootdev:$ramdiskpart sbin/init; then; + setenv rootdev ram0 +else + setenv rootdev mmcblk${mmcrootdev}p${mmcrootpart} + setenv bootmode normal +fi + +# setting console device if noting is set +if test -z "${console}"; then; + setenv console "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0xfe215040" +fi +echo "console: ${console}" + +# Kernel image +kernel=Image +# DT image by model +setenv fdtfile \"bcm2711-rpi-4-b.dtb\" +setenv boot_prefixes \"/\" + +# To use cmdline for using serial console. /* Normal mode */ +setenv bootargs \"${tizen_bootarg} root=/dev/${rootdev} rw bootmode=${bootmode} rootwait ${console} ${opts} ${ip_opt}\" + +# Find the ramdisk offset and block count +part start $bootdev $mmcrootdev $ramdiskpart ramdisk_start +part size $bootdev $mmcrootdev $ramdiskpart ramdisk_size + +echo "Searching for kernel in"; for prefix in $boot_prefixes; do +if load $bootdev $mmcbootdev:$mmcbootpart $tizen_kernel_addr_r $prefix$kernel; then; + echo ${bootmode} "boot"; + load $bootdev $mmcbootdev:$mmcbootpart $fdt_addr_r $fdtfile; + if test -e mmc $mmcrootdev:$ramdiskpart sbin/init; then; + echo "Loading Ramdisk from partition"${ramdiskpart}; + mmc read $ramdisk_addr_r $ramdisk_start $ramdisk_size; + fi + booti $tizen_kernel_addr_r $ramdisk_addr_r:$ramdisksize $fdt_addr_r; +fi +done -- 2.34.1