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