-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
khadas-edge2: add vendor uboot to images #6754
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
104 changes: 104 additions & 0 deletions
104
patch/u-boot/legacy/u-boot-khadas-edge2-rk3588/0001-fix-tee.bin-not-found-error.patch
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,104 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Muhammed Efe Cetin <efectn@protonmail.com> | ||
Date: Thu, 13 Jun 2024 16:46:31 +0300 | ||
Subject: fix tee.bin not found error | ||
|
||
--- | ||
arch/arm/mach-rockchip/decode_bl31.py | 14 +++++++-- | ||
arch/arm/mach-rockchip/fit_nodes.sh | 10 ++----- | ||
arch/arm/mach-rockchip/make_fit_atf.py | 15 ++++++++-- | ||
3 files changed, 27 insertions(+), 12 deletions(-) | ||
|
||
diff --git a/arch/arm/mach-rockchip/decode_bl31.py b/arch/arm/mach-rockchip/decode_bl31.py | ||
index 111111111111..222222222222 100755 | ||
--- a/arch/arm/mach-rockchip/decode_bl31.py | ||
+++ b/arch/arm/mach-rockchip/decode_bl31.py | ||
@@ -41,8 +41,18 @@ 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__": | ||
- main() | ||
+ main() | ||
\ No newline at end of file | ||
diff --git a/arch/arm/mach-rockchip/fit_nodes.sh b/arch/arm/mach-rockchip/fit_nodes.sh | ||
index 111111111111..222222222222 100755 | ||
--- a/arch/arm/mach-rockchip/fit_nodes.sh | ||
+++ b/arch/arm/mach-rockchip/fit_nodes.sh | ||
@@ -171,16 +171,10 @@ function gen_bl32_node() | ||
# If not AArch32 mode | ||
if ! grep -q '^CONFIG_ARM64_BOOT_AARCH32=y' .config ; then | ||
ENTRY="entry = <"${TEE_LOAD_ADDR}">;" | ||
- | ||
- # if disable packing tee.bin | ||
- if ! grep -q '^CONFIG_SPL_OPTEE=y' .config ; then | ||
- return | ||
- fi | ||
- | ||
fi | ||
fi | ||
|
||
- TEE="tee.bin" | ||
+ TEE="${BL32:-"tee.bin"}" | ||
echo " optee { | ||
description = \"OP-TEE\"; | ||
data = /incbin/(\"${TEE}${SUFFIX}\"); | ||
@@ -204,7 +198,7 @@ function gen_bl32_node() | ||
};" | ||
LOADABLE_OPTEE=", \"optee\"" | ||
FIRMWARE_OPTEE="firmware = \"optee\";" | ||
- FIRMWARE_SIGN="\"firmware\"" | ||
+ FIRMWARE_SIGN=", \"firmware\"" | ||
} | ||
|
||
function gen_mcu_node() | ||
diff --git a/arch/arm/mach-rockchip/make_fit_atf.py b/arch/arm/mach-rockchip/make_fit_atf.py | ||
index 111111111111..222222222222 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": | ||
@@ -235,4 +246,4 @@ def main(): | ||
generate_atf_binary(bl31_elf); | ||
|
||
if __name__ == "__main__": | ||
- main() | ||
+ main() | ||
\ No newline at end of file | ||
-- | ||
Armbian | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff. I suppose we can remove the
SRC_EXTLINUX
here and use boot.cmd/scr like other boards? kedge2 was different in this aspect; using boot.scr enables armbianEnv.txt, overlay selection, etc.