Commit 135b7040 authored by Grant Likely's avatar Grant Likely
Browse files

Move all platform support into separate files



All platform specific configuration is moved out into separate files so
that the main makefile only contains common code. Choose which files to
include based on the values of u-boot configuration variables. Currently
these four U-Boot variables are used:
   CONFIG_SYS_VENDOR ==> include scripts/vendor-$(CONFIG_SYS_VENDOR).mk
   CONFIG_SYS_SOC ==> include scripts/soc-$(CONFIG_SYS_SOC).mk
   CONFIG_SYS_BOARD ==> include scripts/board-$(CONFIG_SYS_BOARD).mk
   CONFIG_SYS_CONFIG_NAME ==> include scripts/config-$(CONFIG_SYS_CONFIG_NAME).mk

Signed-off-by: Grant Likely's avatarGrant Likely <grant.likely@arm.com>
parent 61024180
......@@ -2,10 +2,19 @@
#
# Copyright (C) Arm Limited, 2020
$(info Using Marvell Armada 8K support from board-$(subst ",,$(CONFIG_SYS_BOARD)).mk)
# Use precompiled Marvel BL2 binary
TFA_EXTRA += SCP_BL2=${CURDIR}/binaries-marvell/mrvl_scp_bl2.img
# Use the Marvell DDR training from an external repo
TFA_EXTRA += MV_DDR_PATH=${CURDIR}/mv-ddr
TFA_EXTRA += USE_COHERENT_MEM=0
ifeq ($(CONFIG_DEFAULT_DEVICE_TREE),"armada-8040-mcbin")
TFA_PLAT := a80x0_mcbin
endif
sdimage: $(FLASH_IMAGE)
dd if=/dev/zero of=$(SD_IMAGE) count=$$((128*1024*1024>>9))
echo "label: dos\n$$(($(ESP_OFFSET)>>9)) - 0xef -" | /sbin/sfdisk $(SD_IMAGE)
......
......@@ -5,7 +5,18 @@
# Build config for RockPro64
# Inspired by https://stikonas.eu/wordpress/2019/09/15/blobless-boot-with-rockpro64/
$(info Using Rockchip RK3399 support from soc-$(subst ",,$(CONFIG_SYS_BOARD)).mk)
FLASH_IMAGE_DEPS := u-boot/all
TFA_PLAT := $(CONFIG_SYS_SOC)
FLASH_IMAGE := $(UBOOT_OUTPUT)/flash_image.bin
# On the rk3399, U-Boot instead of TF-A builds the final firmware package, and
# only BL31 is taken from the TFA build. Swap around the dependencies so that
# U-Boot depends on tfa/bl31, and the BL31 image is passed to the U-Boot build
u-boot/all: tfa/bl31
UBOOT_EXTRA += BL31=$(TFA_OUTPUT)/$(TFA_PLAT)/release/bl31/bl31.elf
sdimage:
dd if=/dev/zero of=$(SD_IMAGE) seek=32M count=0
......
......@@ -103,29 +103,24 @@ else
ifeq ($(dot-config),1)
# Read in config
-include $(UBOOT_OUTPUT)/.config
include $(UBOOT_OUTPUT)/.config
# ===================================
# Platform/SOC specific configuration
ifdef CONFIG_ROCKCHIP_RK3399
TFA_PLAT := rk3399
UBOOT_EXTRA += BL31=$(TFA_PATH)/build/$(TFA_PLAT)/release/bl31/bl31.elf
FLASH_IMAGE := $(UBOOT_OUTPUT)/flash_image.bin
DTB_TARGET := src/arm64/$(CONFIG_DEFAULT_FDT_FILE)
u-boot: tfa-bl31
include $(CURDIR)/scripts/rk3399.mk
endif # CONFIG_ROCKCHIP_RK3399
ifdef CONFIG_ARMADA_8K
include scripts/mvebu-armada-8k.mk
DTB_TARGET := src/arm64/marvell/$(CONFIG_DEFAULT_DEVICE_TREE).dtb
ifeq ($(CONFIG_DEFAULT_DEVICE_TREE),"armada-8040-mcbin")
TFA_PLAT := a80x0_mcbin
endif
endif # CONFIG_ARMADA_8K
#
# Try including platform specific configs
# Platform specific config could be SOC, Vendor, or config
-include $(CURDIR)/scripts/vendor-$(subst ",,$(CONFIG_SYS_VENDOR)).mk
-include $(CURDIR)/scripts/soc-$(subst ",,$(CONFIG_SYS_SOC)).mk
-include $(CURDIR)/scripts/board-$(subst ",,$(CONFIG_SYS_BOARD)).mk
-include $(CURDIR)/scripts/config-$(subst ",,$(CONFIG_SYS_CONFIG_NAME)).mk
ifndef TFA_PLAT
$(info CONFIG_SYS_VENDOR=$(CONFIG_SYS_VENDOR))
$(info CONFIG_SYS_SOC=$(CONFIG_SYS_SOC))
$(info CONFIG_SYS_BOARD=$(CONFIG_SYS_BOARD))
$(info CONFIG_SYS_CONFIG_NAME=$(CONFIG_SYS_CONFIG_NAME))
$(warning TFA_PLAT is not set. Either TARGET=$(TARGET) is not yet supported)
$(error by this tool, or there is a bug)
endif
......
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