| 1 |
|
| 2 | KBUILD_DEFCONFIG := mmu_defconfig
|
| 3 |
|
| 4 | UTS_SYSNAME = -DUTS_SYSNAME=\"Linux\"
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 | CPU_VER := $(CONFIG_XILINX_MICROBLAZE0_HW_VER)
|
| 9 | CPU_MAJOR := $(word 1, $(subst ., , $(CPU_VER)))
|
| 10 | CPU_MINOR := $(word 2, $(subst ., , $(CPU_VER)))
|
| 11 | CPU_REV := $(word 3, $(subst ., , $(CPU_VER)))
|
| 12 |
|
| 13 | export CPU_VER CPU_MAJOR CPU_MINOR CPU_REV
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 | ifeq (,$(findstring spartan2,$(CONFIG_XILINX_MICROBLAZE0_FAMILY)))
|
| 24 | ifeq ($(CPU_MAJOR),3)
|
| 25 | CPUFLAGS-1 += -mno-xl-soft-mul
|
| 26 | else
|
| 27 |
|
| 28 | CPUFLAGS-$(subst 1,,$(CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL)) += -mxl-multiply-high
|
| 29 | CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL) += -mno-xl-soft-mul
|
| 30 | endif
|
| 31 | endif
|
| 32 | CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_DIV) += -mno-xl-soft-div
|
| 33 | CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_BARREL) += -mxl-barrel-shift
|
| 34 | CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare
|
| 35 |
|
| 36 | ifdef CONFIG_CPU_BIG_ENDIAN
|
| 37 | KBUILD_CPPFLAGS += -mbig-endian
|
| 38 | KBUILD_LDFLAGS += -EB
|
| 39 | else
|
| 40 | KBUILD_CPPFLAGS += -mlittle-endian
|
| 41 | KBUILD_LDFLAGS += -EL
|
| 42 | endif
|
| 43 |
|
| 44 | CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER))
|
| 45 |
|
| 46 |
|
| 47 | KBUILD_CFLAGS += -ffixed-r31 $(CPUFLAGS-y) $(CPUFLAGS-1) $(CPUFLAGS-2)
|
| 48 |
|
| 49 | libs-y += arch/microblaze/lib/
|
| 50 |
|
| 51 | boot := arch/microblaze/boot
|
| 52 |
|
| 53 |
|
| 54 | DTB:=$(subst simpleImage.,,$(filter simpleImage.%, $(MAKECMDGOALS)))
|
| 55 |
|
| 56 | export DTB
|
| 57 |
|
| 58 | all: linux.bin
|
| 59 |
|
| 60 | archheaders:
|
| 61 | $(Q)$(MAKE) $(build)=arch/microblaze/kernel/syscalls all
|
| 62 |
|
| 63 | PHONY += linux.bin linux.bin.gz linux.bin.ub
|
| 64 | linux.bin.ub linux.bin.gz: linux.bin
|
| 65 | linux.bin: vmlinux
|
| 66 | linux.bin linux.bin.gz linux.bin.ub:
|
| 67 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
|
| 68 | @echo 'Kernel: $(boot)/$@ is ready' ' (#'$(or $(KBUILD_BUILD_VERSION),`cat .version`)')'
|
| 69 |
|
| 70 | PHONY += simpleImage.$(DTB)
|
| 71 | simpleImage.$(DTB): vmlinux
|
| 72 | $(Q)$(MAKE) $(build)=$(boot) $(addprefix $(boot)/$@., ub unstrip strip)
|
| 73 | @echo 'Kernel: $(boot)/$@ is ready' ' (#'$(or $(KBUILD_BUILD_VERSION),`cat .version`)')'
|
| 74 |
|
| 75 | define archhelp
|
| 76 | echo '* linux.bin - Create raw binary'
|
| 77 | echo ' linux.bin.gz - Create compressed raw binary'
|
| 78 | echo ' linux.bin.ub - Create U-Boot wrapped raw binary'
|
| 79 | echo ' simpleImage.<dt> - Create the following images with <dt>.dtb linked in'
|
| 80 | echo ' simpleImage.<dt> : raw image'
|
| 81 | echo ' simpleImage.<dt>.ub : raw image with U-Boot header'
|
| 82 | echo ' simpleImage.<dt>.unstrip: ELF (identical to vmlinux)'
|
| 83 | echo ' simpleImage.<dt>.strip : stripped ELF'
|
| 84 | echo ' Targets with <dt> embed a device tree blob inside the image'
|
| 85 | echo ' These targets support board with firmware that does not'
|
| 86 | echo ' support passing a device tree directly. Replace <dt> with the'
|
| 87 | echo ' name of a dts file from the arch/microblaze/boot/dts/ directory'
|
| 88 | echo ' (minus the .dts extension).'
|
| 89 | endef
|
| 90 |
|
| 91 | MRPROPER_FILES += $(boot)/simpleImage.*
|