From cf5c3d8c5b70105af09e5791aada01030f551631 Mon Sep 17 00:00:00 2001 From: Corey Minyard Date: Wed, 28 Jun 2023 14:42:01 -0500 Subject: [PATCH] Update to the newest version of everything Update atf, rockpro, and u-boot. Also modify the default baud rate to be 115200 for better compatibility with other stuff. Signed-off-by: Corey Minyard --- Makefile | 11 ++++++++++- README.md | 26 +++++++++++++++++++++++--- RockPro64.config | 1 + atf | 2 +- rkbin | 2 +- u-boot | 2 +- u-boot-rockpro64-115200baud.patch | 13 +++++++++++++ 7 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 u-boot-rockpro64-115200baud.patch diff --git a/Makefile b/Makefile index 0827c97..ccd0625 100644 --- a/Makefile +++ b/Makefile @@ -53,6 +53,7 @@ arm-tf-clean: # u-boot ################################################################################ +U-BOOT_PATCHES = u-boot-rockpro64-115200baud.patch U-BOOT_PATH = $(ROOT)/u-boot U-BOOT_BUILD ?= $(U-BOOT_PATH)/build @@ -65,7 +66,13 @@ U-BOOT_EXPORTS ?= \ BL31=${TF_A_OUT}/bl31/bl31.elf \ ARCH=arm64 -u-boot: arm-tf +u-boot-patches-applied: + for i in $(U-BOOT_PATCHES); do \ + (cd $(U-BOOT_PATH); patch -p1 <../$$i); \ + done + touch u-boot-patches-applied + +u-boot: arm-tf u-boot-patches-applied if test ! -e $(U-BOOT_BUILD); then mkdir $(U-BOOT_BUILD); fi if test ! -e $(U-BOOT_BUILD)/.config; then \ cd $(U-BOOT_PATH) && \ @@ -76,6 +83,8 @@ u-boot: arm-tf u-boot-clean: rm -rf $(U-BOOT_BUILD) + (cd $(U-BOOT_PATH); git reset --hard) + rm -f u-boot-patches-applied ################################################################################ # u-boot diff --git a/README.md b/README.md index 21704df..7d09c78 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,10 @@ SystemReady OSes. ## Building -To build it, you will need to install an aarch64 compiler, probably in -a package named "gcc-aarch64-linux-gnu". Then check out this repository -and "cd" do it. Then do: +To build it, you will need to install an aarch64 and arm compiler, +probably in packages named "gcc-aarch64-linux-gnu" and +"gcc-arm-none-eabi". You will also need "python3-setuptools". Then +check out this repository and "cd" do it. Then do: ``` git submodule init @@ -26,6 +27,14 @@ files: The makefile will spit out instruction on how to burn it at the end of the run. +## Baud Rate + +The standard baud rate for these boards is 1500000 baud, for some +strange reason. The default baud rate for an ARM systemready image is +115200. So there are patches here to adjust the baud rate to 115200. +If you are following the instructions elsewhere, be sure to account +for this. + ## Installing The rk3399 boots from SPI first, followed by eMMC, followed by the SD @@ -82,6 +91,17 @@ where is the size (in hex) reported by the download. You can also "dd" it to /dev/mtdblock0 on Linux. Don't forget to sync before rebooting. +## Upgrading + +If you upgrade from an older version of this, in u-boot you may need +to run: + +``` + env default -a + env save +``` +and the reset. The older environment will not work. + ## Bypassing SPI boot If your SPI gets messed up or the boot process fails for some reason, diff --git a/RockPro64.config b/RockPro64.config index e69de29..331f558 100644 --- a/RockPro64.config +++ b/RockPro64.config @@ -0,0 +1 @@ +CONFIG_BAUDRATE=115200 diff --git a/atf b/atf index 35f4c72..d3e71ea 160000 --- a/atf +++ b/atf @@ -1 +1 @@ -Subproject commit 35f4c7295bafeb32c8bcbdfb6a3f2e74a57e732b +Subproject commit d3e71ead6ea5bc3555ac90a446efec84ef6c6122 diff --git a/rkbin b/rkbin index b0c100f..d6ccfe4 160000 --- a/rkbin +++ b/rkbin @@ -1 +1 @@ -Subproject commit b0c100f1a260d807df450019774993c761beb79d +Subproject commit d6ccfe401ca84a98ca3b85c12b9554a1a43a166c diff --git a/u-boot b/u-boot index 4debc57..fd4ed6b 160000 --- a/u-boot +++ b/u-boot @@ -1 +1 @@ -Subproject commit 4debc57a3da6c3f4d3f89a637e99206f4cea0a96 +Subproject commit fd4ed6b7e83ec3aea9a2ce21baea8ca9676f40dd diff --git a/u-boot-rockpro64-115200baud.patch b/u-boot-rockpro64-115200baud.patch new file mode 100644 index 0000000..ea0bf58 --- /dev/null +++ b/u-boot-rockpro64-115200baud.patch @@ -0,0 +1,13 @@ +diff --git a/arch/arm/dts/rk3399-rockpro64.dtsi b/arch/arm/dts/rk3399-rockpro64.dtsi +index 6bff8db7d3..6cde7a4d10 100644 +--- a/arch/arm/dts/rk3399-rockpro64.dtsi ++++ b/arch/arm/dts/rk3399-rockpro64.dtsi +@@ -17,7 +17,7 @@ + }; + + chosen { +- stdout-path = "serial2:1500000n8"; ++ stdout-path = "serial2:115200n8"; + }; + + clkin_gmac: external-gmac-clock {