Skip to content

Commit

Permalink
rpi3: dependency improvements
Browse files Browse the repository at this point in the history
From time to time it looks like the Raspberry Pi 3 build completes the
build with no errors, but it's still an incomplete build, since the
iamge for the SD card for example hasn't been created. This is most
likely due to a dependency error in the Makefile. After reviewing the
dependencies it looks like there were at least two dependencies that was
wrong/missing.

- Change so the boot filesystem also depends on linux and the U-boot
  environment file.
- Change so tf-a depends on u-boot and not u-boot-env.
- Change arm-tf targets to tf-a.
- Add .PHONY to a few more targets.

Fixes: OP-TEE/optee_os#6442
Signed-off-by: Joakim Bech <[email protected]>
  • Loading branch information
jbech-linaro committed Nov 27, 2023
1 parent d7c32d4 commit 3b09def
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions rpi3.mk
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ MODULE_OUTPUT ?= $(ROOT)/module_output
################################################################################
# Targets
################################################################################
all: arm-tf buildroot optee-os u-boot linux update_bootfs update_rootfs \
all: tf-a buildroot optee-os u-boot linux update_bootfs update_rootfs \
sdcard-image
clean: arm-tf-clean buildroot-clean u-boot-clean \
optee-os-clean

clean: tf-a-clean buildroot-clean u-boot-clean optee-os-clean

PHONY: all clean

include toolchain.mk

Expand All @@ -93,12 +95,14 @@ TF_A_FLAGS ?= \
RPI3_PRELOADED_DTB_BASE=0x00010000 \
SPD=opteed

arm-tf: optee-os u-boot-env
tf-a: optee-os u-boot
$(TF_A_EXPORTS) $(MAKE) -C $(TF_A_PATH) $(TF_A_FLAGS) all fip

arm-tf-clean:
tf-a-clean:
$(TF_A_EXPORTS) $(MAKE) -C $(TF_A_PATH) $(TF_A_FLAGS) clean

.PHONY: tf-a tf-a-clean

################################################################################
# Das U-Boot
################################################################################
Expand All @@ -107,7 +111,6 @@ U-BOOT_DEFCONFIG_COMMON_FILES := \
$(U-BOOT_PATH)/configs/rpi_3_defconfig \
$(CURDIR)/kconfigs/u-boot_rpi3.conf

.PHONY: u-boot
u-boot: u-boot-defconfig
$(U-BOOT_EXPORTS) $(MAKE) -C $(U-BOOT_PATH) all
$(U-BOOT_EXPORTS) $(MAKE) -C $(U-BOOT_PATH) tools
Expand All @@ -128,10 +131,12 @@ u-boot-defconfig: $(U-BOOT_DEFCONFIG_COMMON_FILES)
ARCH=arm64 \
scripts/kconfig/merge_config.sh $(U-BOOT_DEFCONFIG_COMMON_FILES)

.PHONY: u-boot-defconfig-clean
u-boot-defconfig-clean:
rm -f $(U-BOOT_PATH)/.config

.PHONY: u-boot u-boot-clean u-boot-defconfig u-boot-defconfig-clean u-boot-env \
u-boot-env-clean

################################################################################
# Linux kernel
################################################################################
Expand All @@ -157,6 +162,8 @@ LINUX_CLEANER_COMMON_FLAGS += ARCH=arm64

linux-cleaner: linux-cleaner-common

.PHONY: linux linux-defconfig-clean linux-clean linux-cleaner

################################################################################
# OP-TEE
################################################################################
Expand All @@ -174,7 +181,7 @@ update_rootfs: linux
@mkdir -p --mode=755 $(BUILDROOT_TARGET_ROOT)/usr/bin
@cd $(MODULE_OUTPUT) && find . | cpio -pudm $(BUILDROOT_TARGET_ROOT)

update_bootfs: arm-tf u-boot
update_bootfs: tf-a linux u-boot-env
@mkdir -p --mode=755 $(BOOT_PARTITION_FILES)
@install -v -p --mode=755 $(LINUX_DTB_RPI3_B) $(BOOT_PARTITION_FILES)/bcm2710-rpi-3-b.dtb
@install -v -p --mode=755 $(LINUX_DTB_RPI3_BPLUS) $(BOOT_PARTITION_FILES)/bcm2710-rpi-3-b-plus.dtb
Expand Down

0 comments on commit 3b09def

Please sign in to comment.