diff --git a/common.mk b/common.mk index aab8e8e89fa29cae673743965988d17ad0ff8227..c13f16c51d24d2fa265356f4ac489fd23530e2b8 100644 --- a/common.mk +++ b/common.mk @@ -195,8 +195,11 @@ edk2-common: $(EDK2_PATH)/Conf/target.txt edk2-clean-common: set -e && cd $(EDK2_PATH) && source edksetup.sh && \ $(call edk2-call) clean && \ - $(MAKE) -j1 -C $(EDK2_PATH)/BaseTools clean && \ + $(MAKE) -j1 -C $(EDK2_PATH)/BaseTools clean + rm -rf $(EDK2_PATH)/Build + rm -f $(EDK2_PATH)/Conf/build_rule.txt rm -f $(EDK2_PATH)/Conf/target.txt + rm -f $(EDK2_PATH)/Conf/tools_def.txt ################################################################################ # QEMU / QEMUv8 ################################################################################ diff --git a/docs/hikey.md b/docs/hikey.md index 811cdcf941d4cdc7eed0be0fad083b5ac4614f28..1548f3814250dace1c26375290434650340ad938 100644 --- a/docs/hikey.md +++ b/docs/hikey.md @@ -61,9 +61,7 @@ flash` step will tell you how you should set the jumpers on the board. The intention here was to do almost the same kind of build as the regular where the big difference is the kernel in use and the root fs. The kernel currently comes from the 96Boards team, but that might change soon again. The root fs is a -Debian based root file system. In this setup we're also using a pre-built UEFI -binary. In the long run we would like to change that so we build UEFI from -scratch in this setup just as we do in other OP-TEE setups. +Debian based root file system. In the root fs there is already a couple of OP-TEE binaries included. After building the solution one must replace those, since they are a bit dated (see diff --git a/hikey_debian.mk b/hikey_debian.mk index 590daea32c9b76c7124db2bf764efbe807b647ec..2043b9696e4b515fcede14a18d1d14acac9e4425 100644 --- a/hikey_debian.mk +++ b/hikey_debian.mk @@ -59,9 +59,10 @@ else EDK2_BIN ?= $(EDK2_PATH)/Build/HiKey/RELEASE_GCC49/FV/BL33_AP_UEFI.fd EDK2_BUILD ?= RELEASE endif +OPENPLATPKG_PATH ?= $(ROOT)/OpenPlatformPkg OUT_PATH ?= $(ROOT)/out -MCUIMAGE_BIN ?= $(EDK2_PATH)/HisiPkg/HiKeyPkg/NonFree/mcuimage.bin +MCUIMAGE_BIN ?= $(OPENPLATPKG_PATH)/Platforms/Hisilicon/HiKey/Binary/mcuimage.bin BOOT_IMG ?= $(OUT_PATH)/boot-fat.uefi.img NVME_IMG ?= $(OUT_PATH)/nvme.img SYSTEM_IMG ?= $(OUT_PATH)/debian_system.img @@ -123,26 +124,37 @@ arm-tf-clean: ################################################################################ # EDK2 / Tianocore ################################################################################ -EDK2_VARS ?= EDK2_ARCH=AARCH64 \ - EDK2_DSC=HisiPkg/HiKeyPkg/HiKey.dsc \ - EDK2_TOOLCHAIN=GCC49 \ - EDK2_BUILD=$(EDK2_BUILD) +EDK2_ARCH ?= AARCH64 +EDK2_DSC ?= OpenPlatformPkg/Platforms/Hisilicon/HiKey/HiKey.dsc +EDK2_TOOLCHAIN ?= GCC49 EDK2_CONSOLE_UART ?= $(CFG_NW_CONSOLE_UART) ifeq ($(EDK2_CONSOLE_UART),0) - EDK2_VARS += EDK2_MACROS="-DSERIAL_BASE=0xF8015000" + EDK2_BUILDFLAGS += -DSERIAL_BASE=0xF8015000 endif define edk2-call GCC49_AARCH64_PREFIX=$(LEGACY_AARCH64_CROSS_COMPILE) \ - $(MAKE) -j1 -C $(EDK2_PATH) \ - -f HisiPkg/HiKeyPkg/Makefile $(EDK2_VARS) + build -n 1 -a $(EDK2_ARCH) -t $(EDK2_TOOLCHAIN) -p $(EDK2_DSC) \ + -b $(EDK2_BUILD) $(EDK2_BUILDFLAGS) endef -edk2: edk2-common +.PHONY: edk2 +edk2: + cd $(EDK2_PATH) && rm -rf OpenPlatformPkg && \ + ln -s $(OPENPLATPKG_PATH) + set -e && cd $(EDK2_PATH) && source edksetup.sh BaseTools && \ + $(MAKE) -j1 -C $(EDK2_PATH)/BaseTools && \ + $(call edk2-call) .PHONY: edk2-clean -edk2-clean: edk2-clean-common +edk2-clean: + set -e && cd $(EDK2_PATH) && source edksetup.sh BaseTools && \ + $(MAKE) -j1 -C $(EDK2_PATH)/BaseTools clean + rm -rf $(EDK2_PATH)/Build + rm -f $(EDK2_PATH)/Conf/build_rule.txt + rm -f $(EDK2_PATH)/Conf/target.txt + rm -f $(EDK2_PATH)/Conf/tools_def.txt ################################################################################ # Linux kernel