2006-03-12 10:12:27 +09:00
|
|
|
#
|
|
|
|
# (C) Copyright 2000-2002
|
|
|
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
#
|
2013-07-08 16:37:19 +09:00
|
|
|
# SPDX-License-Identifier: GPL-2.0+
|
2006-03-12 10:12:27 +09:00
|
|
|
#
|
|
|
|
|
2014-02-28 14:33:30 +09:00
|
|
|
ifeq ($(CROSS_COMPILE),)
|
|
|
|
CROSS_COMPILE := bfin-uclinux-
|
|
|
|
endif
|
2009-06-15 12:33:14 +09:00
|
|
|
|
2011-02-04 22:25:17 +09:00
|
|
|
CONFIG_STANDALONE_LOAD_ADDR ?= 0x1000 -m elf32bfin
|
2009-09-04 12:12:47 +09:00
|
|
|
|
2010-12-24 04:58:37 +09:00
|
|
|
ifeq ($(CONFIG_BFIN_CPU),)
|
|
|
|
CONFIG_BFIN_CPU := \
|
|
|
|
$(shell awk '$$2 == "CONFIG_BFIN_CPU" { print $$3 }' \
|
2014-02-04 17:24:24 +09:00
|
|
|
$(srctree)/include/configs/$(BOARD).h)
|
2010-12-24 04:58:37 +09:00
|
|
|
else
|
2013-12-05 15:08:31 +09:00
|
|
|
CONFIG_BFIN_CPU := $(strip $(CONFIG_BFIN_CPU:"%"=%))
|
2010-12-24 04:58:37 +09:00
|
|
|
endif
|
2013-12-05 15:08:31 +09:00
|
|
|
CONFIG_BFIN_BOOT_MODE := $(strip $(CONFIG_BFIN_BOOT_MODE:"%"=%))
|
2008-03-31 04:46:13 +09:00
|
|
|
|
2009-08-18 00:23:02 +09:00
|
|
|
PLATFORM_RELFLAGS += -ffixed-P3 -fomit-frame-pointer -mno-fdpic
|
2008-02-05 09:26:55 +09:00
|
|
|
|
2011-02-23 06:38:05 +09:00
|
|
|
LDFLAGS_FINAL += --gc-sections
|
2011-01-06 10:23:54 +09:00
|
|
|
LDFLAGS += -m elf32bfin
|
2008-10-25 07:18:16 +09:00
|
|
|
PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
|
|
|
|
|
2008-02-18 19:26:48 +09:00
|
|
|
PLATFORM_RELFLAGS += -mcpu=$(CONFIG_BFIN_CPU)
|
|
|
|
|
2009-06-15 13:25:19 +09:00
|
|
|
ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
|
2014-02-04 17:24:24 +09:00
|
|
|
ALL-y += u-boot.ldr
|
2009-06-15 13:25:19 +09:00
|
|
|
endif
|
2009-07-22 11:17:36 +09:00
|
|
|
ifeq ($(CONFIG_ENV_IS_EMBEDDED_IN_LDR),y)
|
2014-02-04 17:24:24 +09:00
|
|
|
CREATE_LDR_ENV = tools/envcrc --binary > env-ldr.o
|
2011-11-03 12:49:03 +09:00
|
|
|
HOSTCFLAGS_NOPED_ADSP := \
|
2010-09-26 16:00:38 +09:00
|
|
|
$(shell $(CPP) -dD - -mcpu=$(CONFIG_BFIN_CPU) </dev/null \
|
|
|
|
| awk '$$2 ~ /ADSP/ { print "-D" $$2 }')
|
2011-11-03 12:49:03 +09:00
|
|
|
HOSTCFLAGS_NOPED += $(HOSTCFLAGS_NOPED_ADSP)
|
2009-07-22 11:17:36 +09:00
|
|
|
else
|
|
|
|
CREATE_LDR_ENV =
|
|
|
|
endif
|
2009-06-15 13:25:19 +09:00
|
|
|
|
2008-02-05 09:26:55 +09:00
|
|
|
SYM_PREFIX = _
|
2014-03-05 16:59:40 +09:00
|
|
|
export SYM_PREFIX
|
2008-02-05 09:26:57 +09:00
|
|
|
|
2009-04-25 12:39:41 +09:00
|
|
|
LDR_FLAGS-y :=
|
|
|
|
LDR_FLAGS-$(CONFIG_BFIN_BOOTROM_USES_EVT1) += -J
|
|
|
|
|
2008-08-08 07:55:30 +09:00
|
|
|
LDR_FLAGS += --bmode $(subst BFIN_BOOT_,,$(CONFIG_BFIN_BOOT_MODE))
|
2008-02-05 09:26:57 +09:00
|
|
|
LDR_FLAGS += --use-vmas
|
2014-02-04 17:24:24 +09:00
|
|
|
LDR_FLAGS += --initcode $(CPUDIR)/initcode.o
|
2008-10-06 17:42:33 +09:00
|
|
|
ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_UART)
|
2009-07-22 11:17:36 +09:00
|
|
|
LDR_FLAGS-$(CONFIG_ENV_IS_EMBEDDED_IN_LDR) += \
|
2014-02-04 17:24:24 +09:00
|
|
|
--punchit $$(($(CONFIG_ENV_OFFSET))):$$(($(CONFIG_ENV_SIZE))):env-ldr.o
|
2008-10-06 17:42:33 +09:00
|
|
|
endif
|
2008-02-18 19:26:48 +09:00
|
|
|
ifneq (,$(findstring s,$(MAKEFLAGS)))
|
2008-02-05 09:26:57 +09:00
|
|
|
LDR_FLAGS += --quiet
|
|
|
|
endif
|
2009-04-25 12:39:41 +09:00
|
|
|
|
|
|
|
LDR_FLAGS += $(LDR_FLAGS-y)
|
2009-06-14 19:29:07 +09:00
|
|
|
|
2010-12-24 04:19:23 +09:00
|
|
|
# Set some default LDR flags based on boot mode.
|
|
|
|
LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
|
|
|
|
|
2010-12-24 04:13:41 +09:00
|
|
|
ifneq ($(CONFIG_SYS_TEXT_BASE),)
|
|
|
|
$(error do not set CONFIG_SYS_TEXT_BASE for Blackfin boards)
|
|
|
|
endif
|