#
# 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.
#
ifeq ($(CROSS_COMPILE),)
CROSS_COMPILE := bfin-uclinux-
endif
LDFLAGS_vmlinux := -X
OBJCOPYFLAGS := -O binary -R .note -R .comment -S
GZFLAGS := -9
KBUILD_CFLAGS += $(call cc-option,-mno-fdpic)
ifeq ($([31mCONFIG_ROMKERNEL[0m),y)
KBUILD_CFLAGS += -mlong-calls
endif
KBUILD_AFLAGS += $(call cc-option,-mno-fdpic)
KBUILD_CFLAGS_MODULE += -mlong-calls
LDFLAGS += -m elf32bfin
KBUILD_DEFCONFIG := BF537-STAMP_defconfig
# setup the machine name and the machine dependent settings
machine-$([31mCONFIG_BF512[0m) := bf518
machine-$([31mCONFIG_BF514[0m) := bf518
machine-$([31mCONFIG_BF516[0m) := bf518
machine-$([31mCONFIG_BF518[0m) := bf518
machine-$([31mCONFIG_BF522[0m) := bf527
machine-$([31mCONFIG_BF523[0m) := bf527
machine-$([31mCONFIG_BF524[0m) := bf527
machine-$([31mCONFIG_BF525[0m) := bf527
machine-$([31mCONFIG_BF526[0m) := bf527
machine-$([31mCONFIG_BF527[0m) := bf527
machine-$([31mCONFIG_BF531[0m) := bf533
machine-$([31mCONFIG_BF532[0m) := bf533
machine-$([31mCONFIG_BF533[0m) := bf533
machine-$([31mCONFIG_BF534[0m) := bf537
machine-$([31mCONFIG_BF536[0m) := bf537
machine-$([31mCONFIG_BF537[0m) := bf537
machine-$([31mCONFIG_BF538[0m) := bf538
machine-$([31mCONFIG_BF539[0m) := bf538
machine-$([31mCONFIG_BF542[0m) := bf548
machine-$([31mCONFIG_BF542M[0m) := bf548
machine-$([31mCONFIG_BF544[0m) := bf548
machine-$([31mCONFIG_BF544M[0m) := bf548
machine-$([31mCONFIG_BF547[0m) := bf548
machine-$([31mCONFIG_BF547M[0m) := bf548
machine-$([31mCONFIG_BF548[0m) := bf548
machine-$([31mCONFIG_BF548M[0m) := bf548
machine-$([31mCONFIG_BF549[0m) := bf548
machine-$([31mCONFIG_BF549M[0m) := bf548
machine-$([31mCONFIG_BF561[0m) := bf561
machine-$([31mCONFIG_BF609[0m) := bf609
MACHINE := $(machine-y)
export MACHINE
cpu-$([31mCONFIG_BF512[0m) := bf512
cpu-$([31mCONFIG_BF514[0m) := bf514
cpu-$([31mCONFIG_BF516[0m) := bf516
cpu-$([31mCONFIG_BF518[0m) := bf518
cpu-$([31mCONFIG_BF522[0m) := bf522
cpu-$([31mCONFIG_BF523[0m) := bf523
cpu-$([31mCONFIG_BF524[0m) := bf524
cpu-$([31mCONFIG_BF525[0m) := bf525
cpu-$([31mCONFIG_BF526[0m) := bf526
cpu-$([31mCONFIG_BF527[0m) := bf527
cpu-$([31mCONFIG_BF531[0m) := bf531
cpu-$([31mCONFIG_BF532[0m) := bf532
cpu-$([31mCONFIG_BF533[0m) := bf533
cpu-$([31mCONFIG_BF534[0m) := bf534
cpu-$([31mCONFIG_BF536[0m) := bf536
cpu-$([31mCONFIG_BF537[0m) := bf537
cpu-$([31mCONFIG_BF538[0m) := bf538
cpu-$([31mCONFIG_BF539[0m) := bf539
cpu-$([31mCONFIG_BF542[0m) := bf542
cpu-$([31mCONFIG_BF542M[0m) := bf542m
cpu-$([31mCONFIG_BF544[0m) := bf544
cpu-$([31mCONFIG_BF544M[0m) := bf544m
cpu-$([31mCONFIG_BF547[0m) := bf547
cpu-$([31mCONFIG_BF547M[0m) := bf547m
cpu-$([31mCONFIG_BF548[0m) := bf548
cpu-$([31mCONFIG_BF548M[0m) := bf548m
cpu-$([31mCONFIG_BF549[0m) := bf549
cpu-$([31mCONFIG_BF549M[0m) := bf549m
cpu-$([31mCONFIG_BF561[0m) := bf561
cpu-$([31mCONFIG_BF609[0m) := bf609
rev-$([31mCONFIG_BF_REV_0_0[0m) := 0.0
rev-$([31mCONFIG_BF_REV_0_1[0m) := 0.1
rev-$([31mCONFIG_BF_REV_0_2[0m) := 0.2
rev-$([31mCONFIG_BF_REV_0_3[0m) := 0.3
rev-$([31mCONFIG_BF_REV_0_4[0m) := 0.4
rev-$([31mCONFIG_BF_REV_0_5[0m) := 0.5
rev-$([31mCONFIG_BF_REV_0_6[0m) := 0.6
rev-$([31mCONFIG_BF_REV_NONE[0m) := none
rev-$([31mCONFIG_BF_REV_ANY[0m) := any
CPU_REV := $(cpu-y)-$(rev-y)
export CPU_REV
KBUILD_CFLAGS += -mcpu=$(CPU_REV)
KBUILD_AFLAGS += -mcpu=$(CPU_REV)
# - we utilize the silicon rev from the toolchain, so move it over to the checkflags
CHECKFLAGS_SILICON = $(shell echo "" | $(CPP) $(KBUILD_CFLAGS) -dD - 2>/dev/null | awk '$$2 == "__SILICON_REVISION__" { print $$3 }')
CHECKFLAGS += -D__SILICON_REVISION__=$(CHECKFLAGS_SILICON) -D__bfin__
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
ifeq ($([31mCONFIG_MPU[0m),y)
core-y += arch/$(ARCH)/kernel/cplb-mpu/
else
core-y += arch/$(ARCH)/kernel/cplb-nompu/
endif
drivers-$([31mCONFIG_OPROFILE[0m) += arch/$(ARCH)/oprofile/
libs-y += arch/$(ARCH)/lib/
machdirs := $(patsubst %,arch/blackfin/mach-%/, $(machine-y))
KBUILD_CFLAGS += -Iarch/$(ARCH)/include/
KBUILD_CFLAGS += -Iarch/$(ARCH)/mach-$(MACHINE)/include
KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
CLEAN_FILES += \
arch/$(ARCH)/kernel/asm-offsets.s \
archclean:
$(Q)$(MAKE) $(clean)=$(boot)
INSTALL_PATH ?= /tftpboot
boot := arch/$(ARCH)/boot
BOOT_TARGETS = uImage uImage.bin uImage.bz2 uImage.gz uImage.lzma uImage.lzo uImage.xip
PHONY += $(BOOT_TARGETS) install
KBUILD_IMAGE := $(boot)/uImage
all: uImage
$(BOOT_TARGETS): vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
install:
$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
define archhelp
echo '* vmImage - Alias to selected kernel format (vmImage.gz by default)'
echo ' vmImage.bin - Uncompressed Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.bin)'
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)'
echo ' vmImage.lzo - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.lzo)'
echo ' vmImage.xip - XIP Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.xip)'
echo ' install - Install kernel using'
echo ' (your) ~/bin/$(INSTALLKERNEL) or'
echo ' (distribution) PATH: $(INSTALLKERNEL) or'
echo ' install to $$(INSTALL_PATH)'
endef