Skip to content

Commit

Permalink
add new family rk3576
Browse files Browse the repository at this point in the history
  • Loading branch information
amazingfate committed May 7, 2024
1 parent 45dd07d commit 1b43cd9
Show file tree
Hide file tree
Showing 8 changed files with 9,400 additions and 0 deletions.
9,195 changes: 9,195 additions & 0 deletions config/kernel/linux-rk3576-vendor.config

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions config/sources/families/include/rockchip64_common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ case "$BOOT_SOC" in
BL31_BLOB="${BL31_BLOB:-"rk35/rk3568_bl31_v1.32.elf"}"
;;

rk3576)
BOOT_SCENARIO="${BOOT_SCENARIO:=spl-blobs}"
DDR_BLOB="${DDR_BLOB:-"rk35/rk3576_ddr_lp4_2112MHz_lp5_2736MHz_v1.03.bin"}"
BL31_BLOB="${BL31_BLOB:-"rk35/rk3576_bl31_v1.04.elf"}"
;;

rk3588) #CPUMAX undefined?
BOOT_SCENARIO="${BOOT_SCENARIO:=spl-blobs}"
DDR_BLOB="${DDR_BLOB:-"rk35/rk3588_ddr_lp4_2112MHz_lp5_2736MHz_v1.08.bin"}"
Expand Down
30 changes: 30 additions & 0 deletions config/sources/families/rk3576.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2013-2023 Igor Pecovnik, [email protected]
#
# This file is a part of the Armbian Build Framework
# https://github.com/armbian/build/
#
source "${BASH_SOURCE%/*}/include/rockchip64_common.inc"

case $BRANCH in

vendor)
declare -g KERNEL_MAJOR_MINOR="6.1" # Major and minor versions of this kernel.
declare -g -i KERNEL_GIT_CACHE_TTL=120 # 2 minutes; this is a high-traffic repo
declare -g KERNELPATCHDIR='rk3576-vendor'
declare -g KERNELSOURCE='https://github.com/armbian/linux-rockchip.git'
declare -g KERNELBRANCH='tag:rk3576-6.1-2024_04_19'
declare -g BOOTSOURCE='https://github.com/ArmSoM/u-boot.git'
declare -g BOOTBRANCH="tag:rk3576"
declare -g BOOTPATCHDIR="legacy/u-boot-armsom-rk3576"
;;

esac

prepare_boot_configuration

family_tweaks_bsp() {
:
}
30 changes: 30 additions & 0 deletions patch/kernel/rk3576-vendor/0000.patching_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
config:

# Just some info stuff; not used by the patching scripts
name: rk3576-6.1
kind: kernel
type: vendor # or: vendor
tag: rk3576-6.1-2024_04_19
last-known-good-tag: v6.1.43

# .dts files in these directories will be copied as-is to the build tree; later ones overwrite earlier ones.
# This is meant to provide a way to "add a board DTS" without having to null-patch them in.
dts-directories:
- { source: "dt", target: "arch/arm64/boot/dts/rockchip" }

# the Makefile in each of these directories will be magically patched to include the dts files copied
# or patched-in; overlay subdir will be included "-y" if it exists.
# No more Makefile patching needed, yay!
# "incremental: true" changes the logic of the Makefile re-writing to only add the
# dts-directories's *.dts files to existing Makefile instead of
# full rewrite from *.dts in the dt dir at the end of patching.
auto-patch-dt-makefile:
- { incremental: true, directory: "arch/arm64/boot/dts/rockchip", config-var: "CONFIG_ARCH_ROCKCHIP" }

# configuration for when applying patches to git / auto-rewriting patches (development cycle helpers)
patches-to-git:
do-not-commit-files:
- "MAINTAINERS" # constant churn, drop them. sorry.
- "Documentation/devicetree/bindings/arm/rockchip.yaml" # constant churn, conflicts on every bump, drop it. sorry.
do-not-commit-regexes: # Python-style regexes
- "^arch/([a-zA-Z0-9]+)/boot/dts/([a-zA-Z0-9]+)/Makefile$" # ignore DT Makefile patches, we've an auto-patcher now
22 changes: 22 additions & 0 deletions patch/kernel/rk3576-vendor/disable-werror.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From 2d0eb7da6d0d65636e416f942af6880bb148a5a8 Mon Sep 17 00:00:00 2001
From: amazingfate <[email protected]>
Date: Mon, 22 May 2023 14:14:31 +0800
Subject: [PATCH] Makefile: disable -Werror for compiling error

---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 69cdd0d2946c3..6a212627b6456 100644
--- a/Makefile
+++ b/Makefile
@@ -866,7 +866,7 @@ stackp-flags-$(CONFIG_STACKPROTECTOR_STRONG) := -fstack-protector-strong

KBUILD_CFLAGS += $(stackp-flags-y)

-KBUILD_CFLAGS-$(CONFIG_WERROR) += -Werror
+#KBUILD_CFLAGS-$(CONFIG_WERROR) += -Werror
KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) += -Wno-array-bounds

KBUILD_RUSTFLAGS-$(CONFIG_WERROR) += -Dwarnings
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Stephen <[email protected]>
Date: Mon, 8 Nov 2021 14:30:00 +0800
Subject: cmd: source: fix the error that the command source failed to execute

Signed-off-by: Stephen <[email protected]>
---
cmd/source.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/source.c b/cmd/source.c
index 6b1c8b744b4..cf820c072af 100644
--- a/cmd/source.c
+++ b/cmd/source.c
@@ -87,7 +87,7 @@ source (ulong addr, const char *fit_uname)
* past the zero-terminated sequence of image lengths to get
* to the actual image data
*/
- while (*data++ != IMAGE_PARAM_INVAL);
+ while (*data++);
break;
#endif
#if defined(CONFIG_FIT)
--
Armbian

Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Stephen Chen <[email protected]>
Date: Tue, 21 Mar 2023 16:11:34 +0800
Subject: rockchip: allow passing of BL31 location via variable

Source link: https://github.com/piter75/armbian-build/blob/rock-3a-bring-up/patch/u-boot/u-boot-rk356x/general-configurable-bl31-path.patch

Signed-off-by: Stephen Chen <[email protected]>
---
arch/arm/mach-rockchip/decode_bl31.py | 12 ++++++++-
arch/arm/mach-rockchip/make_fit_atf.py | 13 +++++++++-
2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-rockchip/decode_bl31.py b/arch/arm/mach-rockchip/decode_bl31.py
index 301bd153753..42fa32d23d2 100755
--- a/arch/arm/mach-rockchip/decode_bl31.py
+++ b/arch/arm/mach-rockchip/decode_bl31.py
@@ -41,7 +41,17 @@ def generate_atf_binary(bl31_file_name):
atf.write(data)

def main():
- bl31_elf="./bl31.elf"
+ if "BL31" in os.environ:
+ bl31_elf=os.getenv("BL31");
+ elif os.path.isfile("./bl31.elf"):
+ bl31_elf = "./bl31.elf"
+ else:
+ os.system("echo 'int main(){}' > bl31.c")
+ os.system("${CROSS_COMPILE}gcc -c bl31.c -o bl31.elf")
+ bl31_elf = "./bl31.elf"
+ logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
+ logging.warning(' BL31 file bl31.elf NOT found, resulting binary is non-functional')
+ logging.warning(' Please read Building section in doc/README.rockchip')
generate_atf_binary(bl31_elf);

if __name__ == "__main__":
diff --git a/arch/arm/mach-rockchip/make_fit_atf.py b/arch/arm/mach-rockchip/make_fit_atf.py
index 27b6ef75970..fac8d6f1219 100755
--- a/arch/arm/mach-rockchip/make_fit_atf.py
+++ b/arch/arm/mach-rockchip/make_fit_atf.py
@@ -212,9 +212,20 @@ def get_bl31_segments_info(bl31_file_name):

def main():
uboot_elf="./u-boot"
- bl31_elf="./bl31.elf"
FIT_ITS=sys.stdout

+ if "BL31" in os.environ:
+ bl31_elf=os.getenv("BL31");
+ elif os.path.isfile("./bl31.elf"):
+ bl31_elf = "./bl31.elf"
+ else:
+ os.system("echo 'int main(){}' > bl31.c")
+ os.system("${CROSS_COMPILE}gcc -c bl31.c -o bl31.elf")
+ bl31_elf = "./bl31.elf"
+ logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
+ logging.warning(' BL31 file bl31.elf NOT found, resulting binary is non-functional')
+ logging.warning(' Please read Building section in doc/README.rockchip')
+
opts, args = getopt.getopt(sys.argv[1:], "o:u:b:h")
for opt, val in opts:
if opt == "-o":
--
Armbian

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Stephen Chen <[email protected]>
Date: Tue, 21 Mar 2023 16:09:11 +0800
Subject: rockchip: disable gen_bl32_node

Signed-off-by: Stephen Chen <[email protected]>
---
arch/arm/mach-rockchip/make_fit_atf.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-rockchip/make_fit_atf.sh b/arch/arm/mach-rockchip/make_fit_atf.sh
index 32ef33b8b02..045273e3bd0 100755
--- a/arch/arm/mach-rockchip/make_fit_atf.sh
+++ b/arch/arm/mach-rockchip/make_fit_atf.sh
@@ -10,7 +10,7 @@ source ./${srctree}/arch/arm/mach-rockchip/fit_nodes.sh
gen_header
gen_uboot_node
gen_bl31_node
-gen_bl32_node
+#gen_bl32_node
gen_mcu_node
gen_loadable_node
gen_kfdt_node
--
Armbian

0 comments on commit 1b43cd9

Please sign in to comment.