Makefile 5.21 KB
Newer Older
Bryan Wu's avatar
Bryan Wu committed
1 2 3 4 5 6 7 8
#
# arch/blackfin/Makefile
#
# This file is subject to the terms and conditions of the GNU General Public
# License.  See the file "COPYING" in the main directory of this archive
# for more details.
#

9 10 11
ifeq ($(CROSS_COMPILE),)
CROSS_COMPILE    := bfin-uclinux-
endif
Bryan Wu's avatar
Bryan Wu committed
12 13 14 15
LDFLAGS_vmlinux  := -X
OBJCOPYFLAGS     := -O binary -R .note -R .comment -S
GZFLAGS          := -9

16 17
KBUILD_CFLAGS           += $(call cc-option,-mno-fdpic)
KBUILD_AFLAGS           += $(call cc-option,-mno-fdpic)
18 19
KBUILD_CFLAGS_MODULE    += -mlong-calls
KBUILD_LDFLAGS_MODULE   += -m elf32bfin
Bryan Wu's avatar
Bryan Wu committed
20 21
KALLSYMS         += --symbol-prefix=_

22
KBUILD_DEFCONFIG := BF537-STAMP_defconfig
Bryan Wu's avatar
Bryan Wu committed
23 24

# setup the machine name and the machine dependent settings
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
machine-$(CONFIG_BF512)  := bf518
machine-$(CONFIG_BF514)  := bf518
machine-$(CONFIG_BF516)  := bf518
machine-$(CONFIG_BF518)  := bf518
machine-$(CONFIG_BF522)  := bf527
machine-$(CONFIG_BF523)  := bf527
machine-$(CONFIG_BF524)  := bf527
machine-$(CONFIG_BF525)  := bf527
machine-$(CONFIG_BF526)  := bf527
machine-$(CONFIG_BF527)  := bf527
machine-$(CONFIG_BF531)  := bf533
machine-$(CONFIG_BF532)  := bf533
machine-$(CONFIG_BF533)  := bf533
machine-$(CONFIG_BF534)  := bf537
machine-$(CONFIG_BF536)  := bf537
machine-$(CONFIG_BF537)  := bf537
machine-$(CONFIG_BF538)  := bf538
machine-$(CONFIG_BF539)  := bf538
machine-$(CONFIG_BF542)  := bf548
44
machine-$(CONFIG_BF542M) := bf548
45
machine-$(CONFIG_BF544)  := bf548
46
machine-$(CONFIG_BF544M) := bf548
47
machine-$(CONFIG_BF547)  := bf548
48
machine-$(CONFIG_BF547M) := bf548
49
machine-$(CONFIG_BF548)  := bf548
50
machine-$(CONFIG_BF548M) := bf548
51
machine-$(CONFIG_BF549)  := bf548
52
machine-$(CONFIG_BF549M) := bf548
53
machine-$(CONFIG_BF561)  := bf561
Bryan Wu's avatar
Bryan Wu committed
54 55 56
MACHINE := $(machine-y)
export MACHINE

57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
cpu-$(CONFIG_BF512)  := bf512
cpu-$(CONFIG_BF514)  := bf514
cpu-$(CONFIG_BF516)  := bf516
cpu-$(CONFIG_BF518)  := bf518
cpu-$(CONFIG_BF522)  := bf522
cpu-$(CONFIG_BF523)  := bf523
cpu-$(CONFIG_BF524)  := bf524
cpu-$(CONFIG_BF525)  := bf525
cpu-$(CONFIG_BF526)  := bf526
cpu-$(CONFIG_BF527)  := bf527
cpu-$(CONFIG_BF531)  := bf531
cpu-$(CONFIG_BF532)  := bf532
cpu-$(CONFIG_BF533)  := bf533
cpu-$(CONFIG_BF534)  := bf534
cpu-$(CONFIG_BF536)  := bf536
cpu-$(CONFIG_BF537)  := bf537
cpu-$(CONFIG_BF538)  := bf538
cpu-$(CONFIG_BF539)  := bf539
cpu-$(CONFIG_BF542)  := bf542
76
cpu-$(CONFIG_BF542M) := bf542m
77
cpu-$(CONFIG_BF544)  := bf544
78
cpu-$(CONFIG_BF544M) := bf544m
79
cpu-$(CONFIG_BF547)  := bf547
80
cpu-$(CONFIG_BF547M) := bf547m
81
cpu-$(CONFIG_BF548)  := bf548
82
cpu-$(CONFIG_BF548M) := bf548m
83
cpu-$(CONFIG_BF549)  := bf549
84
cpu-$(CONFIG_BF549M) := bf549m
85
cpu-$(CONFIG_BF561)  := bf561
86 87 88 89 90 91 92

rev-$(CONFIG_BF_REV_0_0)  := 0.0
rev-$(CONFIG_BF_REV_0_1)  := 0.1
rev-$(CONFIG_BF_REV_0_2)  := 0.2
rev-$(CONFIG_BF_REV_0_3)  := 0.3
rev-$(CONFIG_BF_REV_0_4)  := 0.4
rev-$(CONFIG_BF_REV_0_5)  := 0.5
93
rev-$(CONFIG_BF_REV_0_6)  := 0.6
94 95 96
rev-$(CONFIG_BF_REV_NONE) := none
rev-$(CONFIG_BF_REV_ANY)  := any

97
KBUILD_CFLAGS += -mcpu=$(cpu-y)-$(rev-y)
98
KBUILD_AFLAGS += -mcpu=$(cpu-y)-$(rev-y)
Bryan Wu's avatar
Bryan Wu committed
99

100 101 102 103 104
# - we utilize the silicon rev from the toolchain, so move it over to the checkflags
# - the l1_text attribute is Blackfin specific, so fake it out as used to kill warnings
CHECKFLAGS_SILICON = $(shell echo "" | $(CPP) $(KBUILD_CFLAGS) -dD - 2>/dev/null | awk '$$2 == "__SILICON_REVISION__" { print $$3 }')
CHECKFLAGS += -D__SILICON_REVISION__=$(CHECKFLAGS_SILICON) -Dl1_text=__used__

105
head-y   := arch/$(ARCH)/kernel/init_task.o
Bryan Wu's avatar
Bryan Wu committed
106 107 108 109 110 111 112 113 114

core-y   += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ arch/$(ARCH)/mach-common/

# If we have a machine-specific directory, then include it in the build.
ifneq ($(machine-y),)
core-y   += arch/$(ARCH)/mach-$(MACHINE)/
core-y   += arch/$(ARCH)/mach-$(MACHINE)/boards/
endif

115 116 117 118 119
ifeq ($(CONFIG_MPU),y)
core-y	+= arch/$(ARCH)/kernel/cplb-mpu/
else
core-y	+= arch/$(ARCH)/kernel/cplb-nompu/
endif
120

Bryan Wu's avatar
Bryan Wu committed
121 122
drivers-$(CONFIG_OPROFILE) += arch/$(ARCH)/oprofile/

123 124
libs-y   += arch/$(ARCH)/lib/

125
machdirs	:= $(patsubst %,arch/blackfin/mach-%/, $(machine-y))
Bryan Wu's avatar
Bryan Wu committed
126

127 128
KBUILD_CFLAGS += -Iarch/$(ARCH)/include/
KBUILD_CFLAGS += -Iarch/$(ARCH)/mach-$(MACHINE)/include
Bryan Wu's avatar
Bryan Wu committed
129

130
KBUILD_CPPFLAGS	+= $(patsubst %,-I$(srctree)/%include,$(machdirs))
Bryan Wu's avatar
Bryan Wu committed
131 132

CLEAN_FILES += \
133
	arch/$(ARCH)/include/asm/asm-offsets.h \
Bryan Wu's avatar
Bryan Wu committed
134 135 136 137 138
	arch/$(ARCH)/kernel/asm-offsets.s \

archclean:
	$(Q)$(MAKE) $(clean)=$(boot)

139
INSTALL_PATH ?= /tftpboot
Bryan Wu's avatar
Bryan Wu committed
140
boot := arch/$(ARCH)/boot
141
BOOT_TARGETS = vmImage vmImage.bin vmImage.bz2 vmImage.gz vmImage.lzma
142 143 144 145 146
PHONY += $(BOOT_TARGETS) install
KBUILD_IMAGE := $(boot)/vmImage

all: vmImage

Bryan Wu's avatar
Bryan Wu committed
147 148
$(BOOT_TARGETS): vmlinux
	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
149 150 151 152

install:
	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install

Bryan Wu's avatar
Bryan Wu committed
153
define archhelp
154
  echo  '* vmImage         - Alias to selected kernel format (vmImage.gz by default)'
155
  echo  '  vmImage.bin     - Uncompressed Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.bin)'
156 157 158
  echo  '  vmImage.bz2     - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.bz2)'
  echo  '* vmImage.gz      - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.gz)'
  echo  '  vmImage.lzma    - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.lzma)'
159
  echo  '  install         - Install kernel using'
160 161
  echo  '                     (your) ~/bin/$(INSTALLKERNEL) or'
  echo  '                     (distribution) PATH: $(INSTALLKERNEL) or'
162
  echo  '                     install to $$(INSTALL_PATH)'
Bryan Wu's avatar
Bryan Wu committed
163
endef