Commit 314d584c authored by Grant Likely's avatar Grant Likely
Browse files

Rework script so that TARGET==$TARGET_defconfig



This tool is all about building U-Boot images; so make the TARGET
variable match the name used in the U-Boot config directory.

Signed-off-by: Grant Likely's avatarGrant Likely <grant.likely@arm.com>
parent a99a24ab
DTB_TARGET := src/arm64/marvell/armada-8040-mcbin.dtb
UBOOT_CONFIG := mvebu_mcbin-88f8040
UBOOT_EXTRA := EXT_OS_DTB=${DT_PATH}/${DTB_TARGET}
TFA_PLAT := a80x0_mcbin
......
......@@ -11,8 +11,7 @@ TFA_PLAT := rk3399
TFA_EXTRA := bl31
TFA_DEPS := dtb
UBOOT_CONFIG := rockpro64-rk3399
UBOOT_EXTRA := BL31=${TFA_PATH}/build/${TFA_PLAT}/release/bl31/bl31.elf
u-boot: export UBOOT_EXTRA=BL31=$(TFA_PATH)/build/$(TFA_PLAT)/release/bl31/bl31.elf
UBOOT_EXTRA += EXT_DTB=${DT_PATH}/${DTB_TARGET}
UBOOT_DEPS := tfa
......
......@@ -2,18 +2,19 @@
#
# Copyright (C) Arm Limited, 2020
ifndef TARGET
$(error TARGET is not set)
endif
export CROSS_COMPILE=aarch64-linux-gnu-
MAKE=make
TARGET ?= mcbin
# Set some defaults that can be overridden by the target makefile include
TFA_PLAT := ${TARGET}
DT_PATH := ${CURDIR}/devicetree-rebasing
UBOOT_PATH := ${CURDIR}/u-boot
UBOOT_OUTPUT := ${UBOOT_PATH}/build-${TARGET}
TFA_PATH := ${CURDIR}/arm-trusted-firmware
DT_PATH := $(CURDIR)/devicetree-rebasing
TFA_PLAT := $(TARGET)
TFA_PATH := $(CURDIR)/arm-trusted-firmware
UBOOT_PATH := $(CURDIR)/u-boot
UBOOT_OUTPUT := $(UBOOT_PATH)/build-$(TARGET)
all: u-boot tfa
......@@ -22,11 +23,11 @@ include scripts/${TARGET}.mk
# Grab the platform specific variables into generic versions
UBOOT_EXTRA ?= EXT_DTB=${DT_PATH}/${DTB_TARGET}
UBOOT_EXTRA ?= EXT_DTB=$(DT_PATH)/$(DTB_TARGET)
UBOOT_DEPS ?= dtb
TFA_DEPS ?= u-boot
FLASH_IMAGE ?= ${TFA_PATH}/build/${TFA_PLAT}/release/flash-image.bin
FLASH_IMAGE ?= $(TFA_PATH)/build/$(TFA_PLAT)/release/flash-image.bin
.PHONY: dtb u-boot tfa clean
......@@ -42,12 +43,15 @@ dtb:
fdtput ${DT_PATH}/${DTB_TARGET} -t s / dt-ver `cd ${DT_PATH} && git describe`
#fdtput ${DT_PATH}/${DTB_TARGET} -t x /ap806/config-space@f0000000/serial@512000 clock-frequency 0xbebc200
u-boot: export KBUILD_OUTPUT=$(UBOOT_OUTPUT)
u-boot: dtb ${UBOOT_DEPS}
mkdir -p ${UBOOT_OUTPUT}
cd ${UBOOT_PATH} && ${MAKE} KBUILD_OUTPUT=${UBOOT_OUTPUT} ${UBOOT_CONFIG}_defconfig && ${MAKE} ${UBOOT_EXTRA} KBUILD_OUTPUT=${UBOOT_OUTPUT} -j4
${MAKE} -C ${UBOOT_PATH} ${UBOOT_EXTRA} ${TARGET}_defconfig
${MAKE} -C ${UBOOT_PATH} ${UBOOT_EXTRA} -j4
tfa: ${TFA_DEPS}
cd ${TFA_PATH} && ${MAKE} LOG_LEVEL=20 PLAT=${TFA_PLAT} ${TFA_EXTRA}
tfa: export PLAT=$(TFA_PLAT)
tfa: ${TFA_DEPS} ${TFA_PATH}/CACHETAG.DIR
cd ${TFA_PATH} && ${MAKE} LOG_LEVEL=20 ${TFA_EXTRA}
flash-to-sd:
sudo dd if=${FLASH_IMAGE} of=${FLASH_DEVICE} ${FLASH_EXTRA} conv=fdatasync status=progress
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment