Back to home page

LXR

 
 

    


0001 KBUILD_DEFCONFIG := mmu_defconfig
0002 
0003 ifeq ($(CONFIG_MMU),y)
0004 UTS_SYSNAME = -DUTS_SYSNAME=\"Linux\"
0005 else
0006 UTS_SYSNAME = -DUTS_SYSNAME=\"uClinux\"
0007 endif
0008 
0009 # What CPU vesion are we building for, and crack it open
0010 # as major.minor.rev
0011 CPU_VER   := $(shell echo $(CONFIG_XILINX_MICROBLAZE0_HW_VER))
0012 CPU_MAJOR := $(shell echo $(CPU_VER) | cut -d '.' -f 1)
0013 CPU_MINOR := $(shell echo $(CPU_VER) | cut -d '.' -f 2)
0014 CPU_REV   := $(shell echo $(CPU_VER) | cut -d '.' -f 3)
0015 
0016 export CPU_VER CPU_MAJOR CPU_MINOR CPU_REV
0017 
0018 # Use cpu-related CONFIG_ vars to set compile options.
0019 # The various CONFIG_XILINX cpu features options are integers 0/1/2...
0020 # rather than bools y/n
0021 
0022 # Work out HW multipler support. This is tricky.
0023 # 1. Spartan2 has no HW multipliers.
0024 # 2. MicroBlaze v3.x always uses them, except in Spartan 2
0025 # 3. All other FPGa/CPU ver combos, we can trust the CONFIG_ settings
0026 ifeq (,$(findstring spartan2,$(CONFIG_XILINX_MICROBLAZE0_FAMILY)))
0027   ifeq ($(CPU_MAJOR),3)
0028     CPUFLAGS-1 += -mno-xl-soft-mul
0029   else
0030     # USE_HW_MUL can be 0, 1, or 2, defining a hierarchy of HW Mul support.
0031     CPUFLAGS-$(subst 1,,$(CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL)) += -mxl-multiply-high
0032     CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL) += -mno-xl-soft-mul
0033   endif
0034 endif
0035 CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_DIV) += -mno-xl-soft-div
0036 CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_BARREL) += -mxl-barrel-shift
0037 CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare
0038 
0039 CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER))
0040 
0041 # r31 holds current when in kernel mode
0042 KBUILD_CFLAGS += -ffixed-r31 $(CPUFLAGS-1) $(CPUFLAGS-2)
0043 
0044 LDFLAGS         :=
0045 LDFLAGS_vmlinux :=
0046 
0047 head-y := arch/microblaze/kernel/head.o
0048 libs-y += arch/microblaze/lib/
0049 core-y += arch/microblaze/kernel/
0050 core-y += arch/microblaze/mm/
0051 core-$(CONFIG_PCI) += arch/microblaze/pci/
0052 
0053 drivers-$(CONFIG_OPROFILE) += arch/microblaze/oprofile/
0054 
0055 boot := arch/microblaze/boot
0056 
0057 # Are we making a simpleImage.<boardname> target? If so, crack out the boardname
0058 DTB:=$(subst simpleImage.,,$(filter simpleImage.%, $(MAKECMDGOALS)))
0059 
0060 ifneq ($(DTB),)
0061         core-y  += $(boot)/dts/
0062 endif
0063 
0064 # defines filename extension depending memory management type
0065 ifeq ($(CONFIG_MMU),)
0066 MMU := -nommu
0067 endif
0068 
0069 export MMU DTB
0070 
0071 all: linux.bin
0072 
0073 archclean:
0074         $(Q)$(MAKE) $(clean)=$(boot)
0075 
0076 linux.bin linux.bin.gz linux.bin.ub: vmlinux
0077         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
0078 
0079 simpleImage.%: vmlinux
0080         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
0081 
0082 define archhelp
0083   echo '* linux.bin    - Create raw binary'
0084   echo '  linux.bin.gz - Create compressed raw binary'
0085   echo '  linux.bin.ub - Create U-Boot wrapped raw binary'
0086   echo '  simpleImage.<dt> - ELF image with $(arch)/boot/dts/<dt>.dts linked in'
0087   echo '                   - stripped elf with fdt blob'
0088   echo '  simpleImage.<dt>.unstrip - full ELF image with fdt blob'
0089   echo '  *_defconfig      - Select default config from arch/microblaze/configs'
0090   echo ''
0091   echo '  Targets with <dt> embed a device tree blob inside the image'
0092   echo '  These targets support board with firmware that does not'
0093   echo '  support passing a device tree directly. Replace <dt> with the'
0094   echo '  name of a dts file from the arch/microblaze/boot/dts/ directory'
0095   echo '  (minus the .dts extension).'
0096 endef
0097 
0098 MRPROPER_FILES += $(boot)/simpleImage.*