Wolfgang Denk | 97caf67 | 2006-03-12 02:12:27 +0100 | [diff] [blame] | 1 | # |
| 2 | # (C) Copyright 2000-2002 |
| 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | # |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | # SPDX-License-Identifier: GPL-2.0+ |
Wolfgang Denk | 97caf67 | 2006-03-12 02:12:27 +0100 | [diff] [blame] | 6 | # |
| 7 | |
Mike Frysinger | 8378ba4 | 2009-06-14 23:33:14 -0400 | [diff] [blame] | 8 | CROSS_COMPILE ?= bfin-uclinux- |
| 9 | |
Wolfgang Denk | 33a5734 | 2011-02-04 14:25:17 +0100 | [diff] [blame] | 10 | CONFIG_STANDALONE_LOAD_ADDR ?= 0x1000 -m elf32bfin |
Mike Frysinger | 5b66044 | 2009-09-03 23:12:47 -0400 | [diff] [blame] | 11 | |
Mike Frysinger | 5b0c128 | 2010-12-23 14:58:37 -0500 | [diff] [blame] | 12 | ifeq ($(CONFIG_BFIN_CPU),) |
| 13 | CONFIG_BFIN_CPU := \ |
| 14 | $(shell awk '$$2 == "CONFIG_BFIN_CPU" { print $$3 }' \ |
| 15 | $(src)include/configs/$(BOARD).h) |
| 16 | else |
Masahiro Yamada | 7c9c744 | 2013-12-05 15:08:31 +0900 | [diff] [blame] | 17 | CONFIG_BFIN_CPU := $(strip $(CONFIG_BFIN_CPU:"%"=%)) |
Mike Frysinger | 5b0c128 | 2010-12-23 14:58:37 -0500 | [diff] [blame] | 18 | endif |
Masahiro Yamada | 7c9c744 | 2013-12-05 15:08:31 +0900 | [diff] [blame] | 19 | CONFIG_BFIN_BOOT_MODE := $(strip $(CONFIG_BFIN_BOOT_MODE:"%"=%)) |
Mike Frysinger | 94bae5c | 2008-03-30 15:46:13 -0400 | [diff] [blame] | 20 | |
Robin Getz | 2773d5f | 2009-08-17 15:23:02 +0000 | [diff] [blame] | 21 | PLATFORM_RELFLAGS += -ffixed-P3 -fomit-frame-pointer -mno-fdpic |
Mike Frysinger | 5837ed6 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 22 | PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN |
Mike Frysinger | a13ad8e | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 23 | |
Haiying Wang | 3935873 | 2011-02-22 16:38:05 -0500 | [diff] [blame] | 24 | LDFLAGS_FINAL += --gc-sections |
Nobuhiro Iwamatsu | b859b8c | 2011-01-06 10:23:54 +0900 | [diff] [blame] | 25 | LDFLAGS += -m elf32bfin |
Mike Frysinger | 26bf0cbe | 2008-10-24 18:18:16 -0400 | [diff] [blame] | 26 | PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections |
| 27 | |
Mike Frysinger | f0dd792 | 2008-02-18 05:26:48 -0500 | [diff] [blame] | 28 | PLATFORM_RELFLAGS += -mcpu=$(CONFIG_BFIN_CPU) |
Mike Frysinger | f0dd792 | 2008-02-18 05:26:48 -0500 | [diff] [blame] | 29 | |
Mike Frysinger | 57047e0 | 2009-06-15 00:25:19 -0400 | [diff] [blame] | 30 | ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS) |
Daniel Schwierzeck | 12052d6 | 2011-07-13 05:11:01 +0000 | [diff] [blame] | 31 | ALL-y += $(obj)u-boot.ldr |
Mike Frysinger | 57047e0 | 2009-06-15 00:25:19 -0400 | [diff] [blame] | 32 | endif |
Mike Frysinger | 45b57bd | 2009-07-21 22:17:36 -0400 | [diff] [blame] | 33 | ifeq ($(CONFIG_ENV_IS_EMBEDDED_IN_LDR),y) |
| 34 | CREATE_LDR_ENV = $(obj)tools/envcrc --binary > $(obj)env-ldr.o |
Mike Frysinger | d16452b | 2011-11-02 23:49:03 -0400 | [diff] [blame] | 35 | HOSTCFLAGS_NOPED_ADSP := \ |
Mike Frysinger | 6ca3e8a | 2010-09-26 07:00:38 +0000 | [diff] [blame] | 36 | $(shell $(CPP) -dD - -mcpu=$(CONFIG_BFIN_CPU) </dev/null \ |
| 37 | | awk '$$2 ~ /ADSP/ { print "-D" $$2 }') |
Mike Frysinger | d16452b | 2011-11-02 23:49:03 -0400 | [diff] [blame] | 38 | HOSTCFLAGS_NOPED += $(HOSTCFLAGS_NOPED_ADSP) |
Mike Frysinger | 45b57bd | 2009-07-21 22:17:36 -0400 | [diff] [blame] | 39 | else |
| 40 | CREATE_LDR_ENV = |
| 41 | endif |
Mike Frysinger | 57047e0 | 2009-06-15 00:25:19 -0400 | [diff] [blame] | 42 | |
Mike Frysinger | a13ad8e | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 43 | SYM_PREFIX = _ |
Mike Frysinger | 908e776 | 2008-02-04 19:26:57 -0500 | [diff] [blame] | 44 | |
Mike Frysinger | a48e0ed | 2009-04-24 23:39:41 -0400 | [diff] [blame] | 45 | LDR_FLAGS-y := |
| 46 | LDR_FLAGS-$(CONFIG_BFIN_BOOTROM_USES_EVT1) += -J |
| 47 | |
Mike Frysinger | 10e86e7 | 2008-08-07 18:55:30 -0400 | [diff] [blame] | 48 | LDR_FLAGS += --bmode $(subst BFIN_BOOT_,,$(CONFIG_BFIN_BOOT_MODE)) |
Mike Frysinger | 908e776 | 2008-02-04 19:26:57 -0500 | [diff] [blame] | 49 | LDR_FLAGS += --use-vmas |
Peter Tyser | d53e8fd | 2010-04-12 22:28:02 -0500 | [diff] [blame] | 50 | LDR_FLAGS += --initcode $(obj)$(CPUDIR)/initcode.o |
Mike Frysinger | bcb71c2 | 2008-10-06 04:42:33 -0400 | [diff] [blame] | 51 | ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_UART) |
Mike Frysinger | 45b57bd | 2009-07-21 22:17:36 -0400 | [diff] [blame] | 52 | LDR_FLAGS-$(CONFIG_ENV_IS_EMBEDDED_IN_LDR) += \ |
| 53 | --punchit $$(($(CONFIG_ENV_OFFSET))):$$(($(CONFIG_ENV_SIZE))):$(obj)env-ldr.o |
Mike Frysinger | bcb71c2 | 2008-10-06 04:42:33 -0400 | [diff] [blame] | 54 | endif |
Mike Frysinger | f0dd792 | 2008-02-18 05:26:48 -0500 | [diff] [blame] | 55 | ifneq (,$(findstring s,$(MAKEFLAGS))) |
Mike Frysinger | 908e776 | 2008-02-04 19:26:57 -0500 | [diff] [blame] | 56 | LDR_FLAGS += --quiet |
| 57 | endif |
Mike Frysinger | a48e0ed | 2009-04-24 23:39:41 -0400 | [diff] [blame] | 58 | |
| 59 | LDR_FLAGS += $(LDR_FLAGS-y) |
Mike Frysinger | 37f4870 | 2009-06-14 06:29:07 -0400 | [diff] [blame] | 60 | |
Mike Frysinger | 785ce79 | 2010-12-23 14:19:23 -0500 | [diff] [blame] | 61 | # Set some default LDR flags based on boot mode. |
| 62 | LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE)) |
| 63 | |
Mike Frysinger | d6a28fa | 2010-12-23 14:13:41 -0500 | [diff] [blame] | 64 | ifneq ($(CONFIG_SYS_TEXT_BASE),) |
| 65 | $(error do not set CONFIG_SYS_TEXT_BASE for Blackfin boards) |
| 66 | endif |