Wolfgang Denk | 6cb142f | 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 | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | # SPDX-License-Identifier: GPL-2.0+ |
Wolfgang Denk | 6cb142f | 2006-03-12 02:12:27 +0100 | [diff] [blame] | 6 | # |
| 7 | |
Mike Frysinger | 1ea6bcd | 2009-06-14 23:33:14 -0400 | [diff] [blame] | 8 | CROSS_COMPILE ?= bfin-uclinux- |
| 9 | |
Wolfgang Denk | 8ae86b7 | 2011-02-04 14:25:17 +0100 | [diff] [blame] | 10 | CONFIG_STANDALONE_LOAD_ADDR ?= 0x1000 -m elf32bfin |
Mike Frysinger | 262ae0a | 2009-09-03 23:12:47 -0400 | [diff] [blame] | 11 | |
Mike Frysinger | fbcf8e8 | 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 |
| 17 | CONFIG_BFIN_CPU := $(strip $(subst ",,$(CONFIG_BFIN_CPU))) |
| 18 | endif |
Mike Frysinger | 9171fc8 | 2008-03-30 15:46:13 -0400 | [diff] [blame] | 19 | CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE))) |
| 20 | |
Robin Getz | c4db335 | 2009-08-17 15:23:02 +0000 | [diff] [blame] | 21 | PLATFORM_RELFLAGS += -ffixed-P3 -fomit-frame-pointer -mno-fdpic |
Mike Frysinger | 0003613 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 22 | PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN |
Mike Frysinger | 0858b83 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 23 | |
Haiying Wang | 6dc1eceb | 2011-02-22 16:38:05 -0500 | [diff] [blame] | 24 | LDFLAGS_FINAL += --gc-sections |
Nobuhiro Iwamatsu | 8aba9dc | 2011-01-06 10:23:54 +0900 | [diff] [blame] | 25 | LDFLAGS += -m elf32bfin |
Mike Frysinger | 6957a62 | 2008-10-24 18:18:16 -0400 | [diff] [blame] | 26 | PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections |
| 27 | |
Mike Frysinger | f7ce12c | 2008-02-18 05:26:48 -0500 | [diff] [blame] | 28 | PLATFORM_RELFLAGS += -mcpu=$(CONFIG_BFIN_CPU) |
Mike Frysinger | f7ce12c | 2008-02-18 05:26:48 -0500 | [diff] [blame] | 29 | |
Mike Frysinger | 3e88337 | 2009-06-15 00:25:19 -0400 | [diff] [blame] | 30 | ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS) |
Daniel Schwierzeck | 4e0fbb9 | 2011-07-13 05:11:01 +0000 | [diff] [blame] | 31 | ALL-y += $(obj)u-boot.ldr |
Mike Frysinger | 3e88337 | 2009-06-15 00:25:19 -0400 | [diff] [blame] | 32 | endif |
Mike Frysinger | 76d8218 | 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 | e29ad97 | 2011-11-02 23:49:03 -0400 | [diff] [blame] | 35 | HOSTCFLAGS_NOPED_ADSP := \ |
Mike Frysinger | 48c00fe | 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 | e29ad97 | 2011-11-02 23:49:03 -0400 | [diff] [blame] | 38 | HOSTCFLAGS_NOPED += $(HOSTCFLAGS_NOPED_ADSP) |
Mike Frysinger | 76d8218 | 2009-07-21 22:17:36 -0400 | [diff] [blame] | 39 | else |
| 40 | CREATE_LDR_ENV = |
| 41 | endif |
Mike Frysinger | 3e88337 | 2009-06-15 00:25:19 -0400 | [diff] [blame] | 42 | |
Mike Frysinger | 0858b83 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 43 | SYM_PREFIX = _ |
Mike Frysinger | 94a91e2 | 2008-02-04 19:26:57 -0500 | [diff] [blame] | 44 | |
Mike Frysinger | 02778f2 | 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 | 746290d | 2008-08-07 18:55:30 -0400 | [diff] [blame] | 48 | LDR_FLAGS += --bmode $(subst BFIN_BOOT_,,$(CONFIG_BFIN_BOOT_MODE)) |
Mike Frysinger | 94a91e2 | 2008-02-04 19:26:57 -0500 | [diff] [blame] | 49 | LDR_FLAGS += --use-vmas |
Peter Tyser | 03b7004 | 2010-04-12 22:28:02 -0500 | [diff] [blame] | 50 | LDR_FLAGS += --initcode $(obj)$(CPUDIR)/initcode.o |
Mike Frysinger | 67c2829 | 2008-10-06 04:42:33 -0400 | [diff] [blame] | 51 | ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_UART) |
Mike Frysinger | 76d8218 | 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 | 67c2829 | 2008-10-06 04:42:33 -0400 | [diff] [blame] | 54 | endif |
Mike Frysinger | f7ce12c | 2008-02-18 05:26:48 -0500 | [diff] [blame] | 55 | ifneq (,$(findstring s,$(MAKEFLAGS))) |
Mike Frysinger | 94a91e2 | 2008-02-04 19:26:57 -0500 | [diff] [blame] | 56 | LDR_FLAGS += --quiet |
| 57 | endif |
Mike Frysinger | 02778f2 | 2009-04-24 23:39:41 -0400 | [diff] [blame] | 58 | |
| 59 | LDR_FLAGS += $(LDR_FLAGS-y) |
Mike Frysinger | 9ff67e5 | 2009-06-14 06:29:07 -0400 | [diff] [blame] | 60 | |
Mike Frysinger | ec4c693 | 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 | fbb21ff | 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 |