diff --git a/external/config/bootscripts/boot-sun50iw2-legacy.cmd b/external/config/bootscripts/boot-sun50iw2-legacy.cmd new file mode 100644 index 0000000..d3606b4 --- /dev/null +++ b/external/config/bootscripts/boot-sun50iw2-legacy.cmd @@ -0,0 +1,73 @@ +# DO NOT EDIT THIS FILE +# +# Please edit /boot/orangepiEnv.txt to set supported parameters +# + +# default values + +setenv rootdev "/dev/mmcblk0p1" +setenv verbosity "1" +setenv console "both" +setenv disp_mem_reserves "off" +setenv disp_mode "720p60" +setenv rootfstype "ext4" +setenv camera_type "none" + +if ext4load mmc ${boot_part} ${load_addr} /boot/orangepiEnv.txt || fatload mmc ${boot_part} ${load_addr} orangepiEnv.txt || ext4load mmc ${boot_part} ${load_addr} orangepiEnv.txt; then + env import -t ${load_addr} ${filesize} +fi + +if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=ttyS0,115200 console=tty1"; fi +if test "${console}" = "serial"; then setenv consoleargs "console=ttyS0,115200"; fi + +setenv bootargs "root=${rootdev} rootfstype=${rootfstype} rootwait ${consoleargs} no_console_suspend earlycon=uart,mmio32,0x01c28000 mac_addr=${ethaddr} panic=10 consoleblank=0 loglevel=${verbosity} ${extraargs} ${extraboardargs}" + +# ext4load mmc ${boot_part} ${fdt_addr} /boot/dtb/${fdtfile} + +# set display resolution from uEnv.txt or other environment file +# default to 1080p60 +if test "${disp_mode}" = "480i"; then setenv fdt_disp_mode "<0x00000000>" +elif test "${disp_mode}" = "576i"; then setenv fdt_disp_mode "<0x00000001>" +elif test "${disp_mode}" = "480p"; then setenv fdt_disp_mode "<0x00000002>" +elif test "${disp_mode}" = "576p"; then setenv fdt_disp_mode "<0x00000003>" +elif test "${disp_mode}" = "720p50"; then setenv fdt_disp_mode "<0x00000004>" +elif test "${disp_mode}" = "720p60"; then setenv fdt_disp_mode "<0x00000005>" +elif test "${disp_mode}" = "1080i50"; then setenv fdt_disp_mode "<0x00000006>" +elif test "${disp_mode}" = "1080i60"; then setenv fdt_disp_mode "<0x00000007>" +elif test "${disp_mode}" = "1080p24"; then setenv fdt_disp_mode "<0x00000008>" +elif test "${disp_mode}" = "1080p50"; then setenv fdt_disp_mode "<0x00000009>" +elif test "${disp_mode}" = "1080p60"; then setenv fdt_disp_mode "<0x0000000a>" +elif test "${disp_mode}" = "2160p30"; then setenv fdt_disp_mode "<0x0000001c>" +elif test "${disp_mode}" = "2160p25"; then setenv fdt_disp_mode "<0x0000001d>" +elif test "${disp_mode}" = "2160p24"; then setenv fdt_disp_mode "<0x0000001e>" +else setenv fdt_disp_mode "<0x00000005>" +fi + +fdt set /soc@01c00000/disp@01000000 screen0_output_mode ${fdt_disp_mode} +fdt set /soc@01c00000/disp@01000000 dev0_output_mode ${fdt_disp_mode} + +# default to 1280x720 +fdt set /soc@01c00000/disp@01000000 fb0_width <${fb0_width}> +fdt set /soc@01c00000/disp@01000000 fb0_height <${fb0_height}> + +# default, only set status +if test "${camera_type}" = "gc2035"; then + fdt set /soc@01c00000/vfe@0/dev@0/ csi0_dev0_mname "gc2035" + fdt set /soc@01c00000/vfe@0/ status "okay" + fdt set /soc@01c00000/vfe@0/dev@0/ status "okay" +fi + +# change name, i2c address and vdd voltage +if test "${camera_type}" = "ov5640"; then + fdt set /soc@01c00000/vfe@0/dev@0/ csi0_dev0_mname "ov5640" + fdt set /soc@01c00000/vfe@0/ status "okay" + fdt set /soc@01c00000/vfe@0/dev@0/ status "okay" +fi + +ext4load mmc ${boot_part} ${initrd_addr} /boot/uInitrd +ext4load mmc ${boot_part} ${kernel_addr} /boot/Image + +booti ${kernel_addr} ${initrd_addr} ${fdt_addr} + +# Recompile with: +# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr