Blackfin arch: BF538/9 Linux kernel Support
[sfrench/cifs-2.6.git] / arch / blackfin / Makefile
1 #
2 # arch/blackfin/Makefile
3 #
4 # This file is subject to the terms and conditions of the GNU General Public
5 # License.  See the file "COPYING" in the main directory of this archive
6 # for more details.
7 #
8
9 ifeq ($(CROSS_COMPILE),)
10 CROSS_COMPILE    := bfin-uclinux-
11 endif
12 LDFLAGS_vmlinux  := -X
13 OBJCOPYFLAGS     := -O binary -R .note -R .comment -S
14 GZFLAGS          := -9
15
16 KBUILD_CFLAGS           += $(call cc-option,-mno-fdpic)
17 KBUILD_AFLAGS           += $(call cc-option,-mno-fdpic)
18 CFLAGS_MODULE    += -mlong-calls
19 KALLSYMS         += --symbol-prefix=_
20
21 KBUILD_DEFCONFIG := BF537-STAMP_defconfig
22
23 # setup the machine name and the machine dependent settings
24 machine-$(CONFIG_BF522) := bf527
25 machine-$(CONFIG_BF523) := bf527
26 machine-$(CONFIG_BF524) := bf527
27 machine-$(CONFIG_BF525) := bf527
28 machine-$(CONFIG_BF526) := bf527
29 machine-$(CONFIG_BF527) := bf527
30 machine-$(CONFIG_BF531) := bf533
31 machine-$(CONFIG_BF532) := bf533
32 machine-$(CONFIG_BF533) := bf533
33 machine-$(CONFIG_BF534) := bf537
34 machine-$(CONFIG_BF536) := bf537
35 machine-$(CONFIG_BF537) := bf537
36 machine-$(CONFIG_BF538) := bf538
37 machine-$(CONFIG_BF539) := bf538
38 machine-$(CONFIG_BF542) := bf548
39 machine-$(CONFIG_BF544) := bf548
40 machine-$(CONFIG_BF547) := bf548
41 machine-$(CONFIG_BF548) := bf548
42 machine-$(CONFIG_BF549) := bf548
43 machine-$(CONFIG_BF561) := bf561
44 MACHINE := $(machine-y)
45 export MACHINE
46
47 cpu-$(CONFIG_BF522) := bf522
48 cpu-$(CONFIG_BF523) := bf523
49 cpu-$(CONFIG_BF524) := bf524
50 cpu-$(CONFIG_BF525) := bf525
51 cpu-$(CONFIG_BF526) := bf526
52 cpu-$(CONFIG_BF527) := bf527
53 cpu-$(CONFIG_BF531) := bf531
54 cpu-$(CONFIG_BF532) := bf532
55 cpu-$(CONFIG_BF533) := bf533
56 cpu-$(CONFIG_BF534) := bf534
57 cpu-$(CONFIG_BF536) := bf536
58 cpu-$(CONFIG_BF537) := bf537
59 cpu-$(CONFIG_BF538) := bf538
60 cpu-$(CONFIG_BF539) := bf539
61 cpu-$(CONFIG_BF542) := bf542
62 cpu-$(CONFIG_BF544) := bf544
63 cpu-$(CONFIG_BF547) := bf547
64 cpu-$(CONFIG_BF548) := bf548
65 cpu-$(CONFIG_BF549) := bf549
66 cpu-$(CONFIG_BF561) := bf561
67
68 rev-$(CONFIG_BF_REV_0_0)  := 0.0
69 rev-$(CONFIG_BF_REV_0_1)  := 0.1
70 rev-$(CONFIG_BF_REV_0_2)  := 0.2
71 rev-$(CONFIG_BF_REV_0_3)  := 0.3
72 rev-$(CONFIG_BF_REV_0_4)  := 0.4
73 rev-$(CONFIG_BF_REV_0_5)  := 0.5
74 rev-$(CONFIG_BF_REV_0_6)  := 0.6
75 rev-$(CONFIG_BF_REV_NONE) := none
76 rev-$(CONFIG_BF_REV_ANY)  := any
77
78 KBUILD_CFLAGS += -mcpu=$(cpu-y)-$(rev-y)
79 KBUILD_AFLAGS += -mcpu=$(cpu-y)-$(rev-y)
80
81 # - we utilize the silicon rev from the toolchain, so move it over to the checkflags
82 # - the l1_text attribute is Blackfin specific, so fake it out as used to kill warnings
83 CHECKFLAGS_SILICON = $(shell echo "" | $(CPP) $(KBUILD_CFLAGS) -dD - 2>/dev/null | awk '$$2 == "__SILICON_REVISION__" { print $$3 }')
84 CHECKFLAGS += -D__SILICON_REVISION__=$(CHECKFLAGS_SILICON) -Dl1_text=__used__
85
86 head-y   := arch/$(ARCH)/mach-$(MACHINE)/head.o arch/$(ARCH)/kernel/init_task.o
87
88 core-y   += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ arch/$(ARCH)/mach-common/
89
90 # If we have a machine-specific directory, then include it in the build.
91 ifneq ($(machine-y),)
92 core-y   += arch/$(ARCH)/mach-$(MACHINE)/
93 core-y   += arch/$(ARCH)/mach-$(MACHINE)/boards/
94 endif
95
96 ifeq ($(CONFIG_MPU),y)
97 core-y  += arch/$(ARCH)/kernel/cplb-mpu/
98 else
99 core-y  += arch/$(ARCH)/kernel/cplb-nompu/
100 endif
101
102 libs-y   += arch/$(ARCH)/lib/
103
104 drivers-$(CONFIG_OPROFILE) += arch/$(ARCH)/oprofile/
105
106 machdirs        := $(patsubst %,arch/blackfin/mach-%/, $(machine-y))
107
108 KBUILD_CFLAGS += -Iarch/$(ARCH)/include/
109 KBUILD_CFLAGS += -Iarch/$(ARCH)/mach-$(MACHINE)/include
110
111 KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
112
113 CLEAN_FILES += \
114         arch/$(ARCH)/include/asm/asm-offsets.h \
115         arch/$(ARCH)/kernel/asm-offsets.s \
116
117 archclean:
118         $(Q)$(MAKE) $(clean)=$(boot)
119
120 INSTALL_PATH ?= /tftpboot
121 boot := arch/$(ARCH)/boot
122 BOOT_TARGETS = vmImage
123 PHONY += $(BOOT_TARGETS) install
124 KBUILD_IMAGE := $(boot)/vmImage
125
126 all: vmImage
127
128 $(BOOT_TARGETS): vmlinux
129         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
130
131 install:
132         $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
133
134 define archhelp
135   echo  '* vmImage         - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage)'
136   echo  '  install         - Install kernel using'
137   echo  '                     (your) ~/bin/$(CROSS_COMPILE)installkernel or'
138   echo  '                     (distribution) PATH: $(CROSS_COMPILE)installkernel or'
139   echo  '                     install to $$(INSTALL_PATH)'
140 endef