diff --git a/config/boards/rock-s0.conf b/config/boards/rock-s0.conf index 3c9b9f154..4ee215579 100644 --- a/config/boards/rock-s0.conf +++ b/config/boards/rock-s0.conf @@ -1,15 +1,13 @@ # Rockchip RK3308 quad core 512MB SoC WiFi # https://radxa.com/products/rocks/s0 + +# This board is very similar to the older RockPi-S model +source "${SRC}/config/boards/rockpi-s.conf" + BOARD_NAME="Rock S0" -BOARDFAMILY="rock-s0" BOARD_MAINTAINER="brentr" +BOARDFAMILY="rockchip64" BOOTCONFIG="rock-s0-rk3308_defconfig" -DEFAULT_CONSOLE="serial" -SERIALCON="ttyS0" +BOOT_FDT_FILE="rockchip/rk3308-rock-s0.dtb" KERNEL_TARGET="current,edge" KERNEL_TEST_TARGET="current" -BOOT_FDT_FILE="rockchip/rk3308-rock-s0.dtb" -MODULES_BLACKLIST="rockchipdrm analogix_dp dw_mipi_dsi dw_hdmi gpu_sched lima hantro_vpu panfrost" -HAS_VIDEO_OUTPUT="no" -BOOTBRANCH_BOARD="tag:v2022.04" -BOOTPATCHDIR="u-boot-rockchip64-v2022.04" diff --git a/config/boards/rockpi-s.conf b/config/boards/rockpi-s.conf index 4f5ab0393..e564d018b 100644 --- a/config/boards/rockpi-s.conf +++ b/config/boards/rockpi-s.conf @@ -1,15 +1,15 @@ # Rockchip RK3308 quad core 256-512MB SoC WiFi +# https://radaxa.com/products/rockpi/pis BOARD_NAME="Rockpi S" BOARDFAMILY="rockchip64" BOARD_MAINTAINER="brentr" BOOTCONFIG="rock-pi-s-rk3308_defconfig" +BOOT_FDT_FILE="rockchip/rk3308-rock-pi-s.dtb" DEFAULT_CONSOLE="serial" -MODULES_LEGACY="g_serial" SERIALCON="ttyS0" KERNEL_TARGET="current,edge" KERNEL_TEST_TARGET="current" -BOOT_FDT_FILE="rockchip/rk3308-rock-pi-s.dtb" MODULES_BLACKLIST="rockchipdrm analogix_dp dw_mipi_dsi dw_hdmi gpu_sched lima hantro_vpu panfrost" HAS_VIDEO_OUTPUT="no" BOOTBRANCH_BOARD="tag:v2022.04" @@ -40,8 +40,7 @@ function post_family_config___uboot_config() { display_alert "$BOARD" "u-boot ${BOOTBRANCH_BOARD} overrides" "info" unset uboot_custom_postprocess family_tweaks_bsp # disable stuff from rockchip64_common - BOOTSCRIPT=boot-rockpis.cmd:boot.cmd - BOOTENV_FILE='rockpis.txt' + BOOTSCRIPT=boot-rockchip64-ttyS0.cmd:boot.cmd uboot_custom_postprocess() { diff --git a/config/bootenv/rockpis.txt b/config/bootenv/rockpis.txt deleted file mode 100644 index 6cdeff828..000000000 --- a/config/bootenv/rockpis.txt +++ /dev/null @@ -1,2 +0,0 @@ -verbosity=1 -extraargs=swiotlb=1024 diff --git a/config/bootscripts/boot-rock-s0.cmd b/config/bootscripts/boot-rockchip64-ttyS0.cmd similarity index 56% rename from config/bootscripts/boot-rock-s0.cmd rename to config/bootscripts/boot-rockchip64-ttyS0.cmd index d35d131f6..905f56d55 100644 --- a/config/bootscripts/boot-rock-s0.cmd +++ b/config/bootscripts/boot-rockchip64-ttyS0.cmd @@ -3,22 +3,23 @@ # Please edit /boot/armbianEnv.txt to set supported parameters # -setenv load_addr "0x9000000" -# Ensure the ever expanding kernel never overlaps initial device tree load area -setenv fdt_addr_r "0x7800000" +setenv load_addr "0x9000000" setenv overlay_error "false" # default values setenv rootdev "/dev/mmcblk0p1" setenv verbosity "1" setenv console "both" +setenv bootlogo "false" setenv rootfstype "ext4" setenv docker_optimizations "on" setenv earlycon "off" -echo "Boot script loaded from ${devtype} ${devnum}" +test -n "${distro_bootpart}" || distro_bootpart=1 -if test -e ${devtype} ${devnum} ${prefix}armbianEnv.txt; then - load ${devtype} ${devnum} ${load_addr} ${prefix}armbianEnv.txt +echo "Boot script loaded from ${devtype} ${devnum}:${distro_bootpart}" + +if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}armbianEnv.txt; then + load ${devtype} ${devnum}:${distro_bootpart} ${load_addr} ${prefix}armbianEnv.txt env import -t ${load_addr} ${filesize} fi @@ -27,46 +28,53 @@ if test "${logo}" = "disabled"; then setenv logo "logo.nologo"; fi if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "console=ttyS0,1500000 ${consoleargs}"; fi if test "${earlycon}" = "on"; then setenv consoleargs "earlycon ${consoleargs}"; fi +if test "${bootlogo}" = "true"; then + setenv consoleargs "splash plymouth.ignore-serial-consoles ${consoleargs}" +else + setenv consoleargs "splash=verbose ${consoleargs}" +fi # get PARTUUID of first partition on SD/eMMC the boot script was loaded from -if test "${devtype}" = "mmc"; then part uuid mmc ${devnum}:1 partuuid; fi +if test "${devtype}" = "mmc"; then part uuid mmc ${devnum}:${distro_bootpart} partuuid; fi setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs}" if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory"; fi -load ${devtype} ${devnum} ${ramdisk_addr_r} ${prefix}uInitrd -load ${devtype} ${devnum} ${kernel_addr_r} ${prefix}Image +load ${devtype} ${devnum}:${distro_bootpart} ${ramdisk_addr_r} ${prefix}uInitrd +load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${prefix}Image -load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile} +load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}dtb/${fdtfile} fdt addr ${fdt_addr_r} fdt resize 65536 for overlay_file in ${overlays}; do - if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/rockchip/overlay/${overlay_prefix}-${overlay_file}.dtbo; then + if load ${devtype} ${devnum}:${distro_bootpart} ${load_addr} ${prefix}dtb/rockchip/overlay/${overlay_prefix}-${overlay_file}.dtbo; then echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo" fdt apply ${load_addr} || setenv overlay_error "true" fi done for overlay_file in ${user_overlays}; do - if load ${devtype} ${devnum} ${load_addr} ${prefix}overlay-user/${overlay_file}.dtbo; then + if load ${devtype} ${devnum}:${distro_bootpart} ${load_addr} ${prefix}overlay-user/${overlay_file}.dtbo; then echo "Applying user provided DT overlay ${overlay_file}.dtbo" fdt apply ${load_addr} || setenv overlay_error "true" fi done if test "${overlay_error}" = "true"; then echo "Error applying DT overlays, restoring original DT" - load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile} + load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}dtb/${fdtfile} else - if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/rockchip/overlay/${overlay_prefix}-fixup.scr; then + if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}dtb/rockchip/overlay/${overlay_prefix}-fixup.scr; then + load ${devtype} ${devnum}:${distro_bootpart} ${load_addr} ${prefix}dtb/rockchip/overlay/${overlay_prefix}-fixup.scr echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)" source ${load_addr} fi - if test -e ${devtype} ${devnum} ${prefix}fixup.scr; then - load ${devtype} ${devnum} ${load_addr} ${prefix}fixup.scr + if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}fixup.scr; then + load ${devtype} ${devnum}:${distro_bootpart} ${load_addr} ${prefix}fixup.scr echo "Applying user provided fixup script (fixup.scr)" source ${load_addr} fi fi + booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r} # Recompile with: diff --git a/config/bootscripts/boot-rockpis.cmd b/config/bootscripts/boot-rockpis.cmd deleted file mode 100644 index d35d131f6..000000000 --- a/config/bootscripts/boot-rockpis.cmd +++ /dev/null @@ -1,73 +0,0 @@ -# DO NOT EDIT THIS FILE -# -# Please edit /boot/armbianEnv.txt to set supported parameters -# - -setenv load_addr "0x9000000" -# Ensure the ever expanding kernel never overlaps initial device tree load area -setenv fdt_addr_r "0x7800000" -setenv overlay_error "false" -# default values -setenv rootdev "/dev/mmcblk0p1" -setenv verbosity "1" -setenv console "both" -setenv rootfstype "ext4" -setenv docker_optimizations "on" -setenv earlycon "off" - -echo "Boot script loaded from ${devtype} ${devnum}" - -if test -e ${devtype} ${devnum} ${prefix}armbianEnv.txt; then - load ${devtype} ${devnum} ${load_addr} ${prefix}armbianEnv.txt - env import -t ${load_addr} ${filesize} -fi - -if test "${logo}" = "disabled"; then setenv logo "logo.nologo"; fi - -if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi -if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "console=ttyS0,1500000 ${consoleargs}"; fi -if test "${earlycon}" = "on"; then setenv consoleargs "earlycon ${consoleargs}"; fi - -# get PARTUUID of first partition on SD/eMMC the boot script was loaded from -if test "${devtype}" = "mmc"; then part uuid mmc ${devnum}:1 partuuid; fi - -setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs}" - -if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory"; fi - -load ${devtype} ${devnum} ${ramdisk_addr_r} ${prefix}uInitrd -load ${devtype} ${devnum} ${kernel_addr_r} ${prefix}Image - -load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile} -fdt addr ${fdt_addr_r} -fdt resize 65536 -for overlay_file in ${overlays}; do - if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/rockchip/overlay/${overlay_prefix}-${overlay_file}.dtbo; then - echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo" - fdt apply ${load_addr} || setenv overlay_error "true" - fi -done -for overlay_file in ${user_overlays}; do - if load ${devtype} ${devnum} ${load_addr} ${prefix}overlay-user/${overlay_file}.dtbo; then - echo "Applying user provided DT overlay ${overlay_file}.dtbo" - fdt apply ${load_addr} || setenv overlay_error "true" - fi -done -if test "${overlay_error}" = "true"; then - echo "Error applying DT overlays, restoring original DT" - load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile} -else - if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/rockchip/overlay/${overlay_prefix}-fixup.scr; then - echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)" - source ${load_addr} - fi - if test -e ${devtype} ${devnum} ${prefix}fixup.scr; then - load ${devtype} ${devnum} ${load_addr} ${prefix}fixup.scr - echo "Applying user provided fixup script (fixup.scr)" - source ${load_addr} - fi -fi -booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r} - -# Recompile with: -# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr diff --git a/config/sources/families/rock-s0.conf b/config/sources/families/rock-s0.conf deleted file mode 100644 index dca45de39..000000000 --- a/config/sources/families/rock-s0.conf +++ /dev/null @@ -1,65 +0,0 @@ -# -# SPDX-License-Identifier: GPL-2.0 -# -# Copyright (c) 2013-2024 Igor Pecovnik, igor@armbian.com -# -# This file is a part of the Armbian Build Framework -# https://github.com/armbian/build/ -# -# shellcheck source=config/sources/families/include/rockchip64_common.inc -source "${BASH_SOURCE%/*}/include/rockchip64_common.inc" -BOOTENV_FILE='rockpis.txt' -OVERLAY_PREFIX='rk3308' -BOOTSCRIPT=boot-rock-s0.cmd:boot.cmd - -#comment out line below for an image that will NOT boot from the built-in SDNAND -IDBLOADER_BLOB=$SRC/packages/blobs/rockchip/rk3308_idbloader_ddr589MHz_uart0_m0_v2.06.136sd.bin - -#The SDNAND capabilty IDBLOADER_BLOB requires the U-Boot and Linux serial console on UART0 -#Linux will hang on reboot if the console remains on UART2 - -#Note: IDBLOADER_BLOB is derived from -# https://dl.radxa.com/rockpis/images/loader/rk3308_loader_ddr589MHz_uart0_m0_v2.06.136sd.bin -#by using the rkdeveloptool to "upgrade" the previous DDR_BLOB loader on the SDNAND -#To recreate it, build the image with IDBLOADER_BLOB unset and boot Rock PI-S in MASKROM mode -#On your host (connected to the RockPi-S's USB-C port): -# rdeveloptool db rk3308_loader_ddr589MHz_uart0_m0_v2.06.136sd.bin -# rdeveloptool wl 0 newly_built_image.img -# rdeveloptool ul rk3308_loader_ddr589MHz_uart0_m0_v2.06.136sd.bin #this writes 280 sectors - -#Then, reset the RockPi-S to boot from SDNAND. Using that running image: -# dd if=/dev/mmcblk0 of=rk3308_idbloader_ddr589MHz_uart0_m0_v2.06.136sd.bin skip=64 count=280 - -case $BRANCH in - legacy) - echo "Legacy not supported for rock-s0 board" - exit 99 - ;; -esac - -prepare_boot_configuration - -uboot_custom_postprocess() { - # TODO: remove this diversion from common caused by different loaderimage params - loaderimage --pack --uboot ./u-boot-dtb.bin uboot.img 0x600000 --size 1024 1 && - if [ -r "$IDBLOADER_BLOB" ]; then - echo "Installing $IDBLOADER_BLOB" - echo "Capable of booting from built-in SDNAND" - cp $IDBLOADER_BLOB idbloader.bin - else - [ "$IDBLOADER_BLOB" ] && echo "Missing $IDBLOADER_BLOB" - echo "WARNING: This image will not boot from built-in SDNAND" - tools/mkimage -n rk3308 -T rksd -d $RKBIN_DIR/$DDR_BLOB idbloader.bin && - cat $RKBIN_DIR/$MINILOADER_BLOB >> idbloader.bin - fi && - trust_merger --replace bl31.elf $RKBIN_DIR/$BL31_BLOB trust.ini -} - -family_tweaks_bsp() { #Install udev script that derives fixed, unique MAC addresses for net interfaces - #that are assigned random ones -- like RockPI-S's WiFi network interfaces - bsp=$SRC/packages/bsp/rockpis - rules=etc/udev/rules.d - - install -m 755 $bsp/lib/udev/fixEtherAddr $destination/lib/udev && - install -m 644 $bsp/$rules/05-fixMACaddress.rules $destination/$rules -} diff --git a/config/sources/families/rockpis.conf b/config/sources/families/rockpis.conf deleted file mode 100644 index b984897e5..000000000 --- a/config/sources/families/rockpis.conf +++ /dev/null @@ -1,61 +0,0 @@ -# -# SPDX-License-Identifier: GPL-2.0 -# -# Copyright (c) 2013-2023 Igor Pecovnik, igor@armbian.com -# -# This file is a part of the Armbian Build Framework -# https://github.com/armbian/build/ -# -# shellcheck source=config/sources/families/include/rockchip64_common.inc -source "${BASH_SOURCE%/*}/include/rockchip64_common.inc" -#BOOTPATCHDIR="u-boot-rockchip64" -BOOTENV_FILE='rockpis.txt' -OVERLAY_PREFIX='rk3308' -BOOTSCRIPT=boot-rockpis.cmd:boot.cmd - -#comment out line below for an image that will NOT boot from the built-in SDNAND -IDBLOADER_BLOB=$SRC/packages/blobs/rockchip/rk3308_idbloader_ddr589MHz_uart0_m0_v2.06.136sd.bin - -#The SDNAND capabilty IDBLOADER_BLOB requires the U-Boot and Linux serial console on UART0 -#Linux will hang on reboot if the console remains on UART2 - -#Note: IDBLOADER_BLOB is derived from -# https://dl.radxa.com/rockpis/images/loader/rk3308_loader_ddr589MHz_uart0_m0_v2.06.136sd.bin -#by using the rkdeveloptool to "upgrade" the previous DDR_BLOB loader on the SDNAND -#To recreate it, build the image with IDBLOADER_BLOB unset and boot Rock PI-S in MASKROM mode -#On your host (connected to the RockPi-S's USB-C port): -# rdeveloptool db rk3308_loader_ddr589MHz_uart0_m0_v2.06.136sd.bin -# rdeveloptool wl 0 newly_built_image.img -# rdeveloptool ul rk3308_loader_ddr589MHz_uart0_m0_v2.06.136sd.bin #this writes 280 sectors - -#Then, reset the RockPi-S to boot from SDNAND. Using that running image: -# dd if=/dev/mmcblk0 of=rk3308_idbloader_ddr589MHz_uart0_m0_v2.06.136sd.bin skip=64 count=280 - -# Supported branches are 'current' and 'edge', see rockchip64_common.inc - -prepare_boot_configuration - -uboot_custom_postprocess() { - # TODO: remove this diversion from common caused by different loaderimage params - loaderimage --pack --uboot ./u-boot-dtb.bin uboot.img 0x600000 --size 1024 1 && - if [ -r "$IDBLOADER_BLOB" ]; then - echo "Installing $IDBLOADER_BLOB" - echo "Capable of booting from built-in SDNAND" - cp $IDBLOADER_BLOB idbloader.bin - else - [ "$IDBLOADER_BLOB" ] && echo "Missing $IDBLOADER_BLOB" - echo "WARNING: This image will not boot from built-in SDNAND" - tools/mkimage -n rk3308 -T rksd -d $RKBIN_DIR/$DDR_BLOB idbloader.bin && - cat $RKBIN_DIR/$MINILOADER_BLOB >> idbloader.bin - fi && - trust_merger --replace bl31.elf $RKBIN_DIR/$BL31_BLOB trust.ini -} - -family_tweaks_bsp() { #Install udev script that derives fixed, unique MAC addresses for net interfaces - #that are assigned random ones -- like RockPI-S's WiFi network interfaces - bsp=$SRC/packages/bsp/rockpis - rules=etc/udev/rules.d - - install -m 755 $bsp/lib/udev/fixEtherAddr $destination/lib/udev && - install -m 644 $bsp/$rules/05-fixMACaddress.rules $destination/$rules -}