diff --git a/config/boards/rockpi-s.csc b/config/boards/rockpi-s.csc index 697f0ab144..3a08261ad9 100644 --- a/config/boards/rockpi-s.csc +++ b/config/boards/rockpi-s.csc @@ -4,6 +4,6 @@ BOARDFAMILY="rockpis" BOOTCONFIG="rock-pi-s-rk3308_defconfig" DEFAULT_CONSOLE="serial" MODULES_LEGACY="g_serial" -SERIALCON="ttyS2" +SERIALCON="ttyS0" KERNEL_TARGET="legacy,current,edge" BOOT_FDT_FILE="rockchip/rk3308-rock-pi-s.dtb" diff --git a/config/sources/families/rockpis.conf b/config/sources/families/rockpis.conf index e9efbc239a..a2f8184c18 100644 --- a/config/sources/families/rockpis.conf +++ b/config/sources/families/rockpis.conf @@ -2,6 +2,26 @@ 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 + case $BRANCH in @@ -17,6 +37,7 @@ case $BRANCH in KERNELSOURCE='https://github.com/piter75/rockchip-kernel' KERNELBRANCH='branch:rockpis-develop-4.4' KERNELDIR='linux-rockchip64' + unset IDBLOADER_BLOB ;; @@ -27,9 +48,17 @@ 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 - tools/mkimage -n rk3308 -T rksd -d $RKBIN_DIR/$DDR_BLOB idbloader.bin - cat $RKBIN_DIR/$MINILOADER_BLOB >> idbloader.bin + 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 } diff --git a/packages/blobs/rockchip/rk3308_idbloader_ddr589MHz_uart0_m0_v2.06.136sd.bin b/packages/blobs/rockchip/rk3308_idbloader_ddr589MHz_uart0_m0_v2.06.136sd.bin new file mode 100644 index 0000000000..b287863a2a Binary files /dev/null and b/packages/blobs/rockchip/rk3308_idbloader_ddr589MHz_uart0_m0_v2.06.136sd.bin differ diff --git a/packages/blobs/rockchip/rk3308_loader_ddr589MHz_uart0_m0_v2.06.136sd.bin b/packages/blobs/rockchip/rk3308_loader_ddr589MHz_uart0_m0_v2.06.136sd.bin new file mode 100644 index 0000000000..5534eab726 Binary files /dev/null and b/packages/blobs/rockchip/rk3308_loader_ddr589MHz_uart0_m0_v2.06.136sd.bin differ diff --git a/patch/u-boot/u-boot-rockchip64/board_rockpi-s/u-boot-rock-pi-s-console0.patch b/patch/u-boot/u-boot-rockchip64/board_rockpi-s/u-boot-rock-pi-s-console0.patch new file mode 100644 index 0000000000..afb94ec987 --- /dev/null +++ b/patch/u-boot/u-boot-rockchip64/board_rockpi-s/u-boot-rock-pi-s-console0.patch @@ -0,0 +1,39 @@ +diff --git a/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi b/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi +index 40bb917b..973c9b27 100644 +--- a/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi ++++ b/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi +@@ -10,7 +10,7 @@ + }; + }; + +-&uart2 { ++&uart0 { + u-boot,dm-pre-reloc; + clock-frequency = <24000000>; + status = "okay"; +diff --git a/arch/arm/dts/rk3308-rock-pi-s.dts b/arch/arm/dts/rk3308-rock-pi-s.dts +index 678e7d70..581892bd 100644 +--- a/arch/arm/dts/rk3308-rock-pi-s.dts ++++ b/arch/arm/dts/rk3308-rock-pi-s.dts +@@ -12,7 +12,7 @@ + compatible = "radxa,rockpis", "rockchip,rk3308"; + + chosen { +- stdout-path = "serial2:1500000n8"; ++ stdout-path = "serial0:1500000n8"; + }; + + leds { +diff --git a/configs/rock-pi-s-rk3308_defconfig b/configs/rock-pi-s-rk3308_defconfig +index 2b4ab51d..15a7e49a 100644 +--- a/configs/rock-pi-s-rk3308_defconfig ++++ b/configs/rock-pi-s-rk3308_defconfig +@@ -12,7 +12,7 @@ CONFIG_SPL_DRIVERS_MISC_SUPPORT=y + CONFIG_TARGET_EVB_RK3308=y + CONFIG_SPL_STACK_R_ADDR=0xc00000 + CONFIG_PRE_CON_BUF_ADDR=0x0f200000 +-CONFIG_DEBUG_UART_BASE=0xFF0C0000 ++CONFIG_DEBUG_UART_BASE=0xFF0A0000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_SPL_LIBDISK_SUPPORT=y + CONFIG_DEFAULT_DEVICE_TREE="rk3308-rock-pi-s"