1# 2# (C) Copyright 2000-2013 3# Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4# 5# SPDX-License-Identifier: GPL-2.0+ 6# 7######################################################################### 8 9# This file is included from ./Makefile and spl/Makefile. 10# Clean the state to avoid the same flags added twice. 11# 12# (Tegra needs different flags for SPL. 13# That's the reason why this file must be included from spl/Makefile too. 14# If we did not have Tegra SoCs, build system would be much simpler...) 15PLATFORM_RELFLAGS := 16PLATFORM_CPPFLAGS := 17PLATFORM_LDFLAGS := 18LDFLAGS := 19LDFLAGS_FINAL := 20OBJCOPYFLAGS := 21# clear VENDOR for tcsh 22VENDOR := 23######################################################################### 24 25ARCH := $(CONFIG_SYS_ARCH:"%"=%) 26CPU := $(CONFIG_SYS_CPU:"%"=%) 27ifdef CONFIG_SPL_BUILD 28ifdef CONFIG_TEGRA 29CPU := arm720t 30endif 31endif 32BOARD := $(CONFIG_SYS_BOARD:"%"=%) 33ifneq ($(CONFIG_SYS_VENDOR),) 34VENDOR := $(CONFIG_SYS_VENDOR:"%"=%) 35endif 36ifneq ($(CONFIG_SYS_SOC),) 37SOC := $(CONFIG_SYS_SOC:"%"=%) 38endif 39 40# Some architecture config.mk files need to know what CPUDIR is set to, 41# so calculate CPUDIR before including ARCH/SOC/CPU config.mk files. 42# Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains 43# CPU-specific code. 44CPUDIR=arch/$(ARCH)/cpu$(if $(CPU),/$(CPU),) 45 46sinclude $(srctree)/arch/$(ARCH)/config.mk # include architecture dependend rules 47sinclude $(srctree)/$(CPUDIR)/config.mk # include CPU specific rules 48 49ifdef SOC 50sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules 51endif 52ifneq ($(BOARD),) 53ifdef VENDOR 54BOARDDIR = $(VENDOR)/$(BOARD) 55else 56BOARDDIR = $(BOARD) 57endif 58endif 59ifdef BOARD 60sinclude $(srctree)/board/$(BOARDDIR)/config.mk # include board specific rules 61endif 62 63ifdef FTRACE 64PLATFORM_CPPFLAGS += -finstrument-functions -DFTRACE 65endif 66 67# Allow use of stdint.h if available 68ifneq ($(USE_STDINT),) 69PLATFORM_CPPFLAGS += -DCONFIG_USE_STDINT 70endif 71 72######################################################################### 73 74RELFLAGS := $(PLATFORM_RELFLAGS) 75 76OBJCOPYFLAGS += --gap-fill=0xff 77 78PLATFORM_CPPFLAGS += $(RELFLAGS) 79PLATFORM_CPPFLAGS += -pipe 80 81LDFLAGS += $(PLATFORM_LDFLAGS) 82LDFLAGS_FINAL += -Bstatic 83 84export PLATFORM_CPPFLAGS 85export RELFLAGS 86export LDFLAGS_FINAL 87export CONFIG_STANDALONE_LOAD_ADDR 88