Skip to content
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

nanopc-t6: add fit_wrapper.sh with TEE_LOAD_ADDR=0x30000000 #814

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

edtubbs
Copy link
Contributor

@edtubbs edtubbs commented Jan 30, 2025

Switch the NanoPC-T6 TEE load address from 0x08400000 to 0x30000000 by adding a local fit_args.sh and updating the device tree overlay. This aligns with optee_os#7254, so merge this after that PR.

nanopc-t6.mk Outdated
@@ -132,12 +134,16 @@ u-boot-proper: $(TPL_BIN) $(UBOOT_PATH)/.config u-boot-config
u-boot-apply-bootcmd:
cp $(BOOT_CMD) $(UBOOT_HEADER)

.PHONY: u-boot-apply-fit-args
u-boot-apply-fit-args:
cp $(FIT_ARGS) $(UBOOT_FIT_ARGS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that you re using the same pattern as u-boot-apply-bootcmd, but I think it's a bad pattern. The good one would be:

$(U_BOOT_FIT_ARGS): $(FIT_ARGS)
	cp $< $@

nanopc-t6.mk Outdated
.PHONY: u-boot-loader
u-boot-loader: u-boot-proper
$(UBOOT_PATH)/tools/mkimage -n rk3588 -T rksd -d $(UBOOT_PATH)/tpl/u-boot-tpl.bin:$(UBOOT_PATH)/spl/u-boot-spl.bin $(UBOOT_PATH)/idbloader.img

.PHONY: u-boot
u-boot: u-boot-apply-bootcmd $(TPL_BIN) $(UBOOT_PATH)/.config u-boot-loader
u-boot: u-boot-apply-bootcmd u-boot-apply-fit-args $(TPL_BIN) $(UBOOT_PATH)/.config u-boot-loader
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And $(U_BOOT_FIT_ARGS) should be added instead of u-boot-apply-fit-args.

#
# Copyright (c) 2020 Rockchip Electronics Co., Ltd
#
# SPDX-License-Identifier: GPL-2.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GPL license is somewhat problematic. Besides, you are copying the whole file (link) only to change TEE_OFFSET. Isn't there another way to specify the TEE load address?

Adds fit_wrapper.sh to export TEE_LOAD_ADDR=0x30000000
Updates DTB overlay to use 0x30000000
Updates u-boot_nanopc-t6.conf to reference fit_wrapper.sh
Updates nanopc-t6.mk to copy and reference fit_wrapper.sh

Signed-off by: Ed Tubbs <[email protected]>
@edtubbs edtubbs changed the title nanopc-t6: add fit_args.sh with TEE_OFFSET=0x30000000 nanopc-t6: add fit_wrapper.sh with TEE_LOAD_ADDR=0x30000000 Jan 31, 2025
@edtubbs
Copy link
Contributor Author

edtubbs commented Jan 31, 2025

Thanks @jforissier! I’ve added fit_wrapper.sh to export TEE_LOAD_ADDR and updated the U-Boot config and Makefile to reference it instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants