uscript: match L4T in function and style

Enhancements:
- Allow invalid panel
- Add popular clone panels
- Add check for L4T-Loader version
- Add sanity check for super partition
- Add ddr200_mode option
- Apply USB3 recovery WAR unconditionally
- Misc. logic fixes
- Add comments

Co-authored-by: Thomas Makin <halorocker89@gmail.com>

Change-Id: I7bd9d7204d172bb13dedda160e8385a6411b2206
(cherry picked from commit f1705ff1520b1376677e32943150ce9060e7d271)
This commit is contained in:
CTCaer authored and Nolen Johnson committed 2024-12-26 17:57:24 +00:00
1 parent 23411a7ac1
commit 618307b822
1 file changed
+138 -125
+138 -125
View File
@@ -1,4 +1,4 @@
# Set defaults env variables if they do not exist.
# Set defaults for missing env variables.
setenv boot_dir ${prefix}
test -n ${loader_rev} || setenv loader_rev 0
test -n ${id} || setenv id SWANDR
@@ -15,39 +15,40 @@ test -n ${dvfsb} || setenv dvfsb 0
test -n ${gpu_dvfsc} || setenv gpu_dvfsc 0
test -n ${limit_gpu_clk} || setenv limit_gpu_clk 0
test -n ${jc_rail_disable} || setenv jc_rail_disable 0
test -n ${cec_disable} || setenv cec_disable 0
test -n ${touch_skip_tuning} || setenv touch_skip_tuning 0
test -n ${bt_ertm_disable} || setenv bt_ertm_disable 0
test -n ${wifi_disable_vht80} || setenv wifi_disable_vht80 0
test -n ${alarms_disable} || setenv alarms_disable 0
test -n ${ddr200_enable} || setenv ddr200_enable 0
test -n ${cec_disable} || setenv cec_disable 0
test -n ${acc_cal_off_x} || setenv acc_cal_off_x 0x0
test -n ${acc_cal_off_y} || setenv acc_cal_off_y 0x0
test -n ${acc_cal_off_z} || setenv acc_cal_off_z 0x0
test -n ${acc_cal_scl_x} || setenv acc_cal_scl_x 0x0
test -n ${acc_cal_scl_y} || setenv acc_cal_scl_y 0x0
test -n ${acc_cal_scl_z} || setenv acc_cal_scl_z 0x0
test -n ${gyr_cal_off_x} || setenv gyr_cal_off_x 0x0
test -n ${gyr_cal_off_y} || setenv gyr_cal_off_y 0x0
test -n ${gyr_cal_off_z} || setenv gyr_cal_off_z 0x0
test -n ${gyr_cal_scl_x} || setenv gyr_cal_scl_x 0x0
test -n ${gyr_cal_scl_y} || setenv gyr_cal_scl_y 0x0
test -n ${gyr_cal_scl_z} || setenv gyr_cal_scl_z 0x0
# Built-in IMU.
test -n ${acc_cal_off_x} || setenv acc_cal_off_x 0x0
test -n ${acc_cal_off_y} || setenv acc_cal_off_y 0x0
test -n ${acc_cal_off_z} || setenv acc_cal_off_z 0x0
test -n ${acc_cal_scl_x} || setenv acc_cal_scl_x 0x0
test -n ${acc_cal_scl_y} || setenv acc_cal_scl_y 0x0
test -n ${acc_cal_scl_z} || setenv acc_cal_scl_z 0x0
test -n ${gyr_cal_off_x} || setenv gyr_cal_off_x 0x0
test -n ${gyr_cal_off_y} || setenv gyr_cal_off_y 0x0
test -n ${gyr_cal_off_z} || setenv gyr_cal_off_z 0x0
test -n ${gyr_cal_scl_x} || setenv gyr_cal_scl_x 0x0
test -n ${gyr_cal_scl_y} || setenv gyr_cal_scl_y 0x0
test -n ${gyr_cal_scl_z} || setenv gyr_cal_scl_z 0x0
test -n ${lite_cal_lx_lof} || setenv lite_cal_lx_lof 0x0
test -n ${lite_cal_lx_cnt} || setenv lite_cal_lx_cnt 0x0
test -n ${lite_cal_lx_rof} || setenv lite_cal_lx_rof 0x0
test -n ${lite_cal_ly_dof} || setenv lite_cal_ly_dof 0x0
test -n ${lite_cal_ly_cnt} || setenv lite_cal_ly_cnt 0x0
test -n ${lite_cal_ly_uof} || setenv lite_cal_ly_uof 0x0
# Lite Gamepad analog sticks calibration.
test -n ${lite_cal_lx_lof} || setenv lite_cal_lx_lof 0x0
test -n ${lite_cal_lx_cnt} || setenv lite_cal_lx_cnt 0x0
test -n ${lite_cal_lx_rof} || setenv lite_cal_lx_rof 0x0
test -n ${lite_cal_ly_dof} || setenv lite_cal_ly_dof 0x0
test -n ${lite_cal_ly_cnt} || setenv lite_cal_ly_cnt 0x0
test -n ${lite_cal_ly_uof} || setenv lite_cal_ly_uof 0x0
test -n ${lite_cal_rx_lof} || setenv lite_cal_rx_lof 0x0
test -n ${lite_cal_rx_cnt} || setenv lite_cal_rx_cnt 0x0
test -n ${lite_cal_rx_rof} || setenv lite_cal_rx_rof 0x0
test -n ${lite_cal_ry_dof} || setenv lite_cal_ry_dof 0x0
test -n ${lite_cal_ry_cnt} || setenv lite_cal_ry_cnt 0x0
test -n ${lite_cal_ry_uof} || setenv lite_cal_ry_uof 0x0
test -n ${lite_cal_rx_lof} || setenv lite_cal_rx_lof 0x0
test -n ${lite_cal_rx_cnt} || setenv lite_cal_rx_cnt 0x0
test -n ${lite_cal_rx_rof} || setenv lite_cal_rx_rof 0x0
test -n ${lite_cal_ry_dof} || setenv lite_cal_ry_dof 0x0
test -n ${lite_cal_ry_cnt} || setenv lite_cal_ry_cnt 0x0
test -n ${lite_cal_ry_uof} || setenv lite_cal_ry_uof 0x0
# Set logging params for each serial type.
setenv uarta "no_console_suspend console=ttyS0,115200,8n1 loglevel=8 androidboot.console=ttyS0"
@@ -59,11 +60,6 @@ setenv uarta_early "earlycon=uart,mmio32,0x70006000"
setenv uartb_early "earlycon=uart,mmio32,0x70006040"
setenv uartc_early "earlycon=uart,mmio32,0x70006200"
# Default read addresses.
# fdt_addr_r 0x8d000000
# scriptaddr 0x8fe00000
# ramdisk_addr_r 0x92000000
# Set important addresses.
setenv kernload 0xA0000000
setenv initaddr 0x92000000
@@ -74,60 +70,85 @@ setenv fdtraddr 0x8d000000
setenv enviraddr 0x8d100000
setenv fdtovaddr 0x8d200000
# L4T Loader check. Minimum rev 4.
if test "${loader_rev}" < 4; then echoe L4T Loader is old! Update bootloader folder!; echoe Rebooting in 10s..; sleep 10; reset; fi
# L4T Loader check. Min rev 4.
if test "${loader_rev}" < 4; then echoe Old L4T Loader! Update bootloader folder!; echoe Rebooting in 10s..; sleep 10; reset; fi
# Set SoC info.
if test ${t210b01} = 1; then setenv plat_info T210B01; else setenv plat_info T210; fi
# Set SKU info. Frig is used instead of Fric for compatibility reasons.
if test ${sku} = 0; then setenv sku_info ODIN; setenv variant odin; setenv sku_rev a00
elif test ${sku} = 1; then setenv sku_info ODIN; setenv variant modin; setenv sku_rev b01
elif test ${sku} = 2; then setenv sku_info VALI; setenv variant vali; setenv sku_rev a00
elif test ${sku} = 3; then setenv sku_info FRIG; setenv variant fric; setenv sku_rev a00
if test ${sku} = 0; then setenv sku_info ODIN; setenv sku_rev a00; setenv variant odin
elif test ${sku} = 1; then setenv sku_info ODIN; setenv sku_rev b01; setenv variant modin
elif test ${sku} = 2; then setenv sku_info VALI; setenv sku_rev a00; setenv variant vali
elif test ${sku} = 3; then setenv sku_info FRIG; setenv sku_rev a00; setenv variant fric
fi
# Print platform info.
echo PLAT: ${plat_info} SKU: ${sku_info}
echo PLAT: ${plat_info} SKU: ${sku_info}
echo Serial: ${device_serial_restricted}
echo GEN BT MAC: ${device_bt_mac}
echo GEN WF MAC: ${device_wifi_mac}
echo BT MAC: ${device_bt_mac}
echo WF MAC: ${device_wifi_mac}
setenv mmcdev 1
# Set MMC device.
setenv mmcnum 1
if test ${emmc} = 1; then
echoe emmc enabled
setenv mmcdev 0
setenv mmcnum 0
fi
mmc dev ${mmcnum}
mmc dev ${mmcdev}
# Load Kernel.
if gpio input 190 && test ${recovery} = "0"; then
# Normal Kernel.
if part start mmc ${mmcnum} boot boot_start; then echo Boot partition found
else echoe Boot partition not found!; echoe Rebooting in 10s..; sleep 10; reset; fi
part size mmc ${mmcnum} boot boot_size
else
# Recovery.
if part start mmc ${mmcnum} recovery boot_start; then echo Recovery partition found
else echoe Recovery partition not found!; echoe Rebooting in 10s..; sleep 10; reset; fi
part size mmc ${mmcnum} recovery boot_size
part start mmc ${mmcdev} dtb dtb_start
part size mmc ${mmcdev} dtb dtb_size
echo Applying WAR: USB3 required for recovery
setenv usb3_enable 1
fi
mmc read ${kernload} ${boot_start} ${boot_size};
# Load DT img.
if part start mmc ${mmcnum} dtb dtb_start; then echo DTB partition found
else echoe DTB partition not found!; echoe Rebooting in 10s..; sleep 10; reset; fi
part size mmc ${mmcnum} dtb dtb_size
mmc read ${fdtrload} ${dtb_start} ${dtb_size}
# Get DT from image. If failed, reset.
# Check for Super.
if part start mmc ${mmcnum} super super_start; then echo Super partition found
else echoe Super partition not found!; echoe Rebooting in 10s..; sleep 10; reset; fi
# Get DT from image.
if dtimg load ${fdtrload} ${sku} ${fdtraddr} fdtrsize; then echo Device Tree for SKU ${sku_info} loaded
else echoe Device Tree load for SKU ${sku_info} failed!; echoe Rebooting in 10s..; sleep 10; reset; fi
# Set dtb address and size from above and resize it enough to fit any change.
# Load dtb and resize to fit overlays.
fdt addr ${fdtraddr} ${fdtrsize}
fdt resize 16384
# Sanity checks for dtb info.
# Dtb sanity checks.
if test ${sku_info} != ${fdt_id_text} -o ${sku_rev} != ${fdt_rev}; then
echoe Device Tree loaded not correct! (SKU: ${fdt_id_text}, Rev: ${fdt_rev})
echoe Expected SKU: ${sku_info}, Rev: ${sku_rev}
echoe Rebooting in 10s..; sleep 10; reset
fi
# Patch dtb with overlays if they exist.
if test -n ${dtb_overlays}; then
echo loading dtb overlays: ${dtb_overlays}
for ov in ${dtb_overlays}; do
echo Setting ${ov}...
# Check if DT overlay and apply it.
if load mmc ${devnum}:${distro_bootpart} ${fdtovaddr} ${boot_dir}/overlays/${ov}.dtbo; then
if fdt apply ${fdtovaddr}; then echo Successfully loaded ${ov}.dtbo...
@@ -136,7 +157,7 @@ if test -n ${dtb_overlays}; then
done
fi
# Add additional bootargs for UART Logging.
# UART Logging.
if test ${uart_port} = 1; then
echoe UART-A logging enabled
setenv bootargs_extra ${bootargs_extra} ${uarta}
@@ -171,13 +192,11 @@ elif test ${uart_port} = 3; then
fdt set /serial@70006200 reset-names noreset
fi
else
setenv bootargs_extra ${bootargs_extra} ${no_args}
setenv bootargs_extra ${bootargs_extra} ${no_args}
fi
# Add additional bootargs for Serial USB.
if test ${uart_port} = 4; then
setenv bootargs_extra ${usblg} ${bootargs_extra}; echoe USB Serial logging enabled
fi
# USB Serial Logging.
if test ${uart_port} = 4; then setenv bootargs_extra ${usblg} ${bootargs_extra}; echoe USB Serial logging enabled; fi
# Disable Joycon Rails.
if test ${jc_rail_disable} = 1; then
@@ -188,20 +207,20 @@ if test ${jc_rail_disable} = 1; then
fdt set /serial@70006200/joyconl status disabled
fi
# Disable CEC.
if test ${sku} = 2 -o ${cec_disable} = 1; then setenv bootargs_extra ${bootargs_extra} "androidboot.cec_disable=1"; fi
# Disable Touch panel tuning.
if test ${touch_skip_tuning} = 1; then
setenv bootargs_extra ${bootargs_extra} "ftm4.skip_tuning=1"
fi
if test ${touch_skip_tuning} = 1; then setenv bootargs_extra ${bootargs_extra} "ftm4.skip_tuning=1"; fi
# Disable Bluetooth ERTM.
if test ${bt_ertm_disable} = 1; then
setenv bootargs_extra ${bootargs_extra} "bluetooth.disable_ertm=1"
fi
if test ${bt_ertm_disable} = 1; then setenv bootargs_extra ${bootargs_extra} "bluetooth.disable_ertm=1"; fi
# Enable eMMC.
if test ${emmc} = 1; then
fdt set /sdhci@700b0600 status okay
fdt set /firmware/android boot_devices sdhci-tegra.3
fdt set /firmware/android boot_devices sdhci-tegra.3
# Check if eMMC is initialized in 1-bit mode.
if test "${mmc_1bit}" = 1; then
@@ -210,7 +229,7 @@ if test ${emmc} = 1; then
fdt set /sdhci@700b0600 uhs-mask <0x7F>
fi
else
fdt set /firmware/android boot_devices sdhci-tegra.0
fdt set /firmware/android boot_devices sdhci-tegra.0
fi
# Check if SD is initialized in 1-bit mode.
@@ -221,26 +240,32 @@ if test "${sd_1bit}" = 1; then
fi
# Check if SD DDR200 mode can be enabled.
if test "${loader_rev}" != 0 -a ${ddr200_enable} = 1; then
if test -n ${ddr200_enable}; then
setenv ddr200_enable 0
# Set ddr200 if Samsung.
if mmc 1 && mmc info manid && test ${manid} = 1b; then
setenv ddr200_enable 1
fi
fi
if test "${ddr200_enable}" != 0; then
echo SD DDR200 mode enabled
fdt set /sdhci@700b0000 enable-ddr200
fi
if test ${sku} = 2 -o ${cec_disable} = 1; then
echo HDMI-CEC disabled
setenv bootargs_extra ${bootargs_extra} cec_disable=1 androidboot.cec_disable=1
# Force PLLP for 408/204MHz Host/Card clock if set.
if test "${ddr200_mode}" = 2; then
echoe SD DDR200 PLLP enabled
fdt set /sdhci@700b0000 ddr200-clk-limit 210000000
fi
# Disable WiFi VHT80 bonding.
if test ${wifi_disable_vht80} = 1; then
echo WiFi VHT80 bonding disabled
setenv bootargs_extra ${bootargs_extra} "brcmfmac.vht_mask=12"
fi
if test ${wifi_disable_vht80} = 1; then setenv bootargs_extra ${bootargs_extra} "brcmfmac.vht_mask=12"; fi
# Set Sio calibration data.
if test ${sku} = 2; then
if load mmc ${devnum}:${distro_bootpart} ${enviraddr} /switchroot/switch.cal; then
env import -t -r ${enviraddr} ${filesize}
# Set calibration data.
if load mmc ${devnum}:${distro_bootpart} ${enviraddr} /switchroot/switch.cal; then
env import -t -r ${enviraddr} ${filesize}
if test ${sku} = 2; then
echo Sio Calibration set
fdt set /serial@70006200/sio sio-stick-cal-l <$lite_cal_lx_lof $lite_cal_lx_cnt $lite_cal_lx_rof $lite_cal_ly_dof $lite_cal_ly_cnt $lite_cal_ly_uof>
fdt set /serial@70006200/sio sio-stick-cal-r <$lite_cal_rx_lof $lite_cal_rx_cnt $lite_cal_rx_rof $lite_cal_ry_dof $lite_cal_ry_cnt $lite_cal_ry_uof>
@@ -249,7 +274,7 @@ if test ${sku} = 2; then
fi
fi
# Get display panel handle.
# Get display handle.
if test ${display_id} = f20; then echo Display is INN 6.2; fdt get value DHANDLE /host1x/dsi/panel-i-720p-6-2 phandle
elif test ${display_id} = f30; then echo Display is AUO 6.2; fdt get value DHANDLE /host1x/dsi/panel-a-720p-6-2 phandle
elif test ${display_id} = 10; then echo Display is JDI 6.2; fdt get value DHANDLE /host1x/dsi/panel-j-720p-6-2 phandle
@@ -257,10 +282,13 @@ elif test ${display_id} = 1020; then echo Display is INN 5.5; fdt get value DHAN
elif test ${display_id} = 1030; then echo Display is AUO 5.5; fdt get value DHANDLE /host1x/dsi/panel-a-720p-5-5 phandle
elif test ${display_id} = 1040; then echo Display is SHP 5.5; fdt get value DHANDLE /host1x/dsi/panel-s-720p-5-5 phandle
elif test ${display_id} = 2050; then echo Display is SAM 7.0
else echoe Unknown Display ID: ${display_id}!; fi
elif test ${display_id} = f83; then echo Display is Clone 6.2
elif test ${display_id} = B3; then echo Display is Clone 5.5
elif test ${display_id} = 0; then echo Display is Clone 5.5
else echoe Unknown Display ID: ${display_id}! Please report it!; fi
# Set new active display panel handle.
if test -n ${DHANDLE} -a ${sku} != 3; then echo Setting Display panel; fdt set /host1x/dsi nvidia,active-panel <$DHANDLE>; fi
# Set active display handle.
if test -n "${DHANDLE}" -a ${sku} != 3; then echo Setting Display panel; fdt set /host1x/dsi nvidia,active-panel <$DHANDLE>; fi
# Disable USB3.
if test ${usb3_enable} = 0; then
@@ -274,7 +302,7 @@ if test ${usb3_enable} = 0; then
fdt set /xusb_padctl@7009f000/ports/usb2-0 nvidia,usb3-port-fake <0xffffffff>
fdt set /xusb_padctl@7009f000/ports/usb3-0 status disabled
else
echo USB3 enabled
echoe USB3 enabled
fi
# Disable 4 DP lanes (4K@60) on Fric.
@@ -300,12 +328,13 @@ if test ${sku} = 2 -a -n "${VLIM}"; then
fi
fi
# Enable DVFS B-Side.
# DVFS B-Side.
if test ${t210b01} = 1 -a ${dvfsb} = 1; then
echoe DVFS B-Side enabled
setenv bootargs_extra ${bootargs_extra} "speedo_tegra210.sku_id=0x83 speedo_tegra210.cspd_id=2 speedo_tegra210.sspd_id=2"
fdt set /cpufreq/cpu-scaling-data max-frequency <0x249348>
if test ${gpu_dvfsc} != 1; then
if test ${gpu_dvfsc} = 0; then
setenv bootargs_extra ${bootargs_extra} "speedo_tegra210.gspd_id=2"
fi
@@ -316,7 +345,7 @@ if test ${t210b01} = 1 -a ${dvfsb} = 1; then
fi
fi
# Enable GPU DVFS C-Side.
# GPU DVFS C-Side.
if test ${t210b01} = 1 -a ${gpu_dvfsc} = 1; then
echoe DVFS C-Side GPU enabled
@@ -329,15 +358,14 @@ fi
# Limit GPU clock.
if test ${t210b01} = 1 -a ${limit_gpu_clk} = 1; then
if test ${sku} != 2; then
# If not Vali set GPU hard limit to 1075 MHz.
echoe GPU clock limit enabled
echoe GPU clock limited
fdt set /dvfs nvidia,gpu-max-freq-khz <0x106800>
fi
fi
# Set pmic type if special (devboard).
# Set pmic type if devboard.
if test ${t210b01} = 1 -a -n "${pmic_type}" -a ${pmic_type} = 1; then
echoe GPU 15A Regulator enabled
fdt set /i2c@7000d000/max77812@33 reg <0x31>
@@ -346,71 +374,56 @@ if test ${t210b01} = 1 -a -n "${pmic_type}" -a ${pmic_type} = 1; then
fdt set /dvfs nvidia,gpu-max-volt-mv <0x3B6>
fi
# Set ptsa rework.
echo PTSA rework done
setenv bootargs_extra ${bootargs_extra} "latency_allowance.ptsa_rework"
# Disable Wake up from RTC.
if test ${alarms_disable} = 1; then
echoe Wakeup Alarms disabled
fdt set /rtc nvidia,pmc-wakeup <0>
fdt set /pcie@1003000 nvidia,wake-gpio <0>
fdt set /brcmfmac@0 nvidia,pmc-wakeup <0>
fi
# Set serial number.
if test -n ${device_serial_restricted}; then fdt set / serial-number ${device_serial_restricted}; fi
# Load mac address info file from sd
if fatload mmc 1:1 ${enviraddr} switchroot/joycon_mac.ini; then
echo Parsing JoyCon pairing info
ini "joycon_00" ${enviraddr}
fi
# We only get BT MAC from JoyCons, so use BT MAC with FF as the last byte for Wi-Fi
if test ! -n "${wifi_mac}"; then
if test -n "${host}" -a "${host}" != "00:00:00:00:00:00"; then setexpr wifi_mac sub "\:..$" ":FF" ${host}; else setenv wifi_mac ${device_wifi_mac}; fi;
if ini "joycon_00" ${enviraddr}; then echo Found Joycon Pairing Info; else echoe Malformed joycon_mac.ini!; fi
if test -n "${host}" -a "${host}" = "00:00:00:00:00:00"; then ini "joycon_01" ${enviraddr}; fi
fi
# Set BT mac.
if test ! -n "${bt_mac}"; then
if test -n "${host}" -a "${host}" != "00:00:00:00:00:00"; then setenv bt_mac ${host}; else setenv bt_mac ${device_bt_mac}; fi;
fi
echo BT MAC: ${bt_mac}
echo WF MAC: ${wifi_mac}
# Set Wi-Fi mac. Use BT MAC with FF as the last byte.
if test ! -n "${wifi_mac}"; then
if test -n "${host}" -a "${host}" != "00:00:00:00:00:00"; then setexpr wifi_mac sub "\:..$" ":FF" ${host}; else setenv wifi_mac ${device_wifi_mac}; fi;
fi
# insert mac address dtb node
echo CAL0 BT MAC: ${bt_mac}
echo CAL0 WF MAC: ${wifi_mac}
# Import to DT.
fdt set /chosen nvidia,wifi-mac ${wifi_mac}
fdt set /chosen nvidia,bluetooth-mac ${bt_mac}
if test ${alarms_disable} = 1; then
# disable wakeup alarms
echoe Wakeup alarms disabled
fdt set /rtc nvidia,pmc-wakeup <0>
fdt set /pcie@1003000 nvidia,wake-gpio <0>
fdt set /brcmfmac@0 nvidia,pmc-wakeup <0>
fi
# Set kernel cmdline.
setenv bootargs ${bootargs_extra} "ro init=/init nvdec_enabled=0 \
firmware_class.path=/vendor/firmware tegra_fbmem=0x800000@0xf5a00000 \
setenv bootargs ${bootargs_extra} "ro init=/init firmware_class.path=/vendor/firmware \
pmc_r2p.enabled=1 pmc_r2p.action=${r2p_action} \
pmc_r2p.param1=${autoboot} pmc_r2p.param2=${autoboot_list} \
fbcon=map:${fbconsole} consoleblank=0 \
latency_allowance.ptsa_rework \
nvdec_enabled=0 tegra_fbmem=0x800000@0xf5a00000 \
androidboot.bootloader=${blver} androidboot.hardware=nx \
androidboot.hardware.sku=${variant} androidboot.serialno=${device_serial_restricted} \
androidboot.modem=none androidboot.dtb_idx=${sku} "
# Boot kernel.
if gpio input 190 && test ${recovery} = "0"; then
# Load Kernel.
if part start mmc ${mmcdev} boot boot_start; then echo Boot partition found
else echoe Boot partition not found!; echoe Rebooting in 10s..; sleep 10; reset; fi
part size mmc ${mmcdev} boot boot_size
else
# Load Recovery.
if part start mmc ${mmcdev} recovery boot_start; then echo Recovery partition found
else echoe Recovery partition not found!; echoe Rebooting in 10s..; sleep 10; reset; fi
part size mmc ${mmcdev} recovery boot_size
fi
mmc read ${kernload} ${boot_start} ${boot_size};
echo Launching Kernel!
if bootm ${kernload} ${kernload} ${fdtraddr}; then echo Kernel loaded
else echoe Kernel read failed!; echoe Rebooting in 10s..; sleep 10; reset; fi
bootm ${kernload} ${kernload} ${fdtraddr}
echoe Failed to launch Kernel!
echoe