forked from armbian/build
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial support for Radxa Rock S0 board (armbian#6261)
* Initial support for Radxa Rock S0 board * Lets start this board as a WIP target --------- Co-authored-by: Igor Pecovnik <igor.pecovnik@gmail.com>
- Loading branch information
Showing
12 changed files
with
1,385 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Rockchip RK3308 quad core 512MB SoC WiFi | ||
# https://radxa.com/products/rocks/s0 | ||
BOARD_NAME="Rock S0" | ||
BOARDFAMILY="rock-s0" | ||
BOARD_MAINTAINER="brentr" | ||
BOOTCONFIG="rock-s0-rk3308_defconfig" | ||
DEFAULT_CONSOLE="serial" | ||
SERIALCON="ttyS0" | ||
KERNEL_TARGET="current,edge" | ||
KERNEL_TEST_TARGET=$KERNEL_TARGET | ||
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# 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 swapaccount=1"; 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# | ||
# 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/ | ||
# | ||
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 | ||
} |
Oops, something went wrong.