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