1e2211743Swdenk# 2eca3aeb3SWolfgang Denk# (C) Copyright 2000-2013 3e2211743Swdenk# Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4e2211743Swdenk# 5eca3aeb3SWolfgang Denk# SPDX-License-Identifier: GPL-2.0+ 6e2211743Swdenk# 7e2211743Swdenk######################################################################### 8e2211743Swdenk 9026f9cf2SMasahiro Yamada# This file is included from ./Makefile and spl/Makefile. 10026f9cf2SMasahiro Yamada# Clean the state to avoid the same flags added twice. 11026f9cf2SMasahiro Yamada# 12026f9cf2SMasahiro Yamada# (Tegra needs different flags for SPL. 13026f9cf2SMasahiro Yamada# That's the reason why this file must be included from spl/Makefile too. 14026f9cf2SMasahiro Yamada# If we did not have Tegra SoCs, build system would be much simpler...) 15026f9cf2SMasahiro YamadaPLATFORM_RELFLAGS := 16026f9cf2SMasahiro YamadaPLATFORM_CPPFLAGS := 17026f9cf2SMasahiro YamadaPLATFORM_LDFLAGS := 18026f9cf2SMasahiro YamadaLDFLAGS := 19026f9cf2SMasahiro YamadaLDFLAGS_FINAL := 20026f9cf2SMasahiro YamadaOBJCOPYFLAGS := 21e2211743Swdenk######################################################################### 22c4e5f52aSWolfgang Denk 23*51148790SMasahiro YamadaARCH := $(CONFIG_SYS_ARCH:"%"=%) 24*51148790SMasahiro YamadaCPU := $(CONFIG_SYS_CPU:"%"=%) 25*51148790SMasahiro YamadaBOARD := $(CONFIG_SYS_BOARD:"%"=%) 26*51148790SMasahiro Yamadaifneq ($(CONFIG_SYS_VENDOR),) 27*51148790SMasahiro YamadaVENDOR := $(CONFIG_SYS_VENDOR:"%"=%) 28*51148790SMasahiro Yamadaendif 29*51148790SMasahiro Yamadaifneq ($(CONFIG_SYS_SOC),) 30*51148790SMasahiro YamadaSOC := $(CONFIG_SYS_SOC:"%"=%) 31*51148790SMasahiro Yamadaendif 32*51148790SMasahiro Yamada 3303b7004dSPeter Tyser# Some architecture config.mk files need to know what CPUDIR is set to, 3403b7004dSPeter Tyser# so calculate CPUDIR before including ARCH/SOC/CPU config.mk files. 358d1f2682SPeter Tyser# Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains 368d1f2682SPeter Tyser# CPU-specific code. 37a8b0f9b6SMasahiro YamadaCPUDIR=arch/$(ARCH)/cpu$(if $(CPU),/$(CPU),) 3803b7004dSPeter Tyser 394379ac61SMasahiro Yamadasinclude $(srctree)/arch/$(ARCH)/config.mk # include architecture dependend rules 404379ac61SMasahiro Yamadasinclude $(srctree)/$(CPUDIR)/config.mk # include CPU specific rules 4103b7004dSPeter Tyser 42c4e5f52aSWolfgang Denkifdef SOC 434379ac61SMasahiro Yamadasinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules 44c4e5f52aSWolfgang Denkendif 4533a02da0SMasahiro Yamadaifneq ($(BOARD),) 46c4e5f52aSWolfgang Denkifdef VENDOR 47c4e5f52aSWolfgang DenkBOARDDIR = $(VENDOR)/$(BOARD) 48c4e5f52aSWolfgang Denkelse 49c4e5f52aSWolfgang DenkBOARDDIR = $(BOARD) 50c4e5f52aSWolfgang Denkendif 5133a02da0SMasahiro Yamadaendif 52c4e5f52aSWolfgang Denkifdef BOARD 534379ac61SMasahiro Yamadasinclude $(srctree)/board/$(BOARDDIR)/config.mk # include board specific rules 54c4e5f52aSWolfgang Denkendif 55c4e5f52aSWolfgang Denk 56c4e5f52aSWolfgang Denk######################################################################### 57c4e5f52aSWolfgang Denk 58026f9cf2SMasahiro YamadaRELFLAGS := $(PLATFORM_RELFLAGS) 5983b7e2a7SScott Wood 6095ddcd68SMasahiro YamadaOBJCOPYFLAGS += --gap-fill=0xff 61e2211743Swdenk 62026f9cf2SMasahiro YamadaPLATFORM_CPPFLAGS += $(RELFLAGS) 63026f9cf2SMasahiro YamadaPLATFORM_CPPFLAGS += -pipe 644a30f1e8STom Rini 658aba9dceSNobuhiro IwamatsuLDFLAGS += $(PLATFORM_LDFLAGS) 666dc1ecebSHaiying WangLDFLAGS_FINAL += -Bstatic 67026f9cf2SMasahiro Yamada 68026f9cf2SMasahiro Yamadaexport PLATFORM_CPPFLAGS 69026f9cf2SMasahiro Yamadaexport RELFLAGS 70026f9cf2SMasahiro Yamadaexport LDFLAGS_FINAL 71026f9cf2SMasahiro Yamadaexport CONFIG_STANDALONE_LOAD_ADDR 72