1 # SPDX-License-Identifier: GPL-2.0 !! 1 # 2 KBUILD_DEFCONFIG := mmu_defconfig !! 2 # alpha/Makefile 3 !! 3 # 4 UTS_SYSNAME = -DUTS_SYSNAME=\"Linux\" !! 4 # This file is subject to the terms and conditions of the GNU General Public 5 !! 5 # License. See the file "COPYING" in the main directory of this archive 6 # What CPU version are we building for, and cr !! 6 # for more details. 7 # as major.minor.rev !! 7 # 8 CPU_VER := $(CONFIG_XILINX_MICROBLAZE0_HW_VE !! 8 # Copyright (C) 1994 by Linus Torvalds 9 CPU_MAJOR := $(word 1, $(subst ., , $(CPU_VER) !! 9 # 10 CPU_MINOR := $(word 2, $(subst ., , $(CPU_VER) !! 10 11 CPU_REV := $(word 3, $(subst ., , $(CPU_VER) !! 11 NM := $(NM) -B 12 !! 12 13 export CPU_VER CPU_MAJOR CPU_MINOR CPU_REV !! 13 LINKFLAGS = -static -T arch/alpha/vmlinux.lds -N #-relax 14 !! 14 CFLAGS := $(CFLAGS) -pipe -mno-fp-regs -ffixed-8 15 # Use cpu-related CONFIG_ vars to set compile !! 15 16 # The various CONFIG_XILINX cpu features optio !! 16 # Determine if we can use the BWX instructions with GAS. 17 # rather than bools y/n !! 17 old_gas := $(shell if $(AS) --version 2>&1 | grep 'version 2.7' > /dev/null; then echo y; else echo n; fi) 18 !! 18 19 # Work out HW multipler support. This is trick !! 19 # Determine if GCC understands the -mcpu= option. 20 # 1. Spartan2 has no HW multipliers. !! 20 have_mcpu := $(shell if $(CC) -mcpu=ev5 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi) 21 # 2. MicroBlaze v3.x always uses them, except !! 21 22 # 3. All other FPGa/CPU ver combos, we can tru !! 22 have_mcpu_pca56 := $(shell if $(CC) -mcpu=pca56 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi) 23 ifeq (,$(findstring spartan2,$(CONFIG_XILINX_M !! 23 24 ifeq ($(CPU_MAJOR),3) !! 24 have_mcpu_ev6 := $(shell if $(CC) -mcpu=ev6 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi) 25 CPUFLAGS-1 += -mno-xl-soft-mul !! 25 26 else !! 26 have_mcpu_ev67 := $(shell if $(CC) -mcpu=ev67 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi) 27 # USE_HW_MUL can be 0, 1, or 2, defining a !! 27 28 CPUFLAGS-$(subst 1,,$(CONFIG_XILINX_MICROB !! 28 # Turn on the proper cpu optimizations. 29 CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_H !! 29 ifeq ($(have_mcpu),y) >> 30 # If GENERIC, make sure to turn off any instruction set extensions that >> 31 # the host compiler might have on by default. Given that EV4 and EV5 >> 32 # have the same instruction set, prefer EV5 because an EV5 schedule is >> 33 # more likely to keep an EV4 processor busy than vice-versa. >> 34 mcpu_done := n >> 35 ifeq ($(CONFIG_ALPHA_GENERIC),y) >> 36 CFLAGS := $(CFLAGS) -mcpu=ev5 >> 37 mcpu_done := y >> 38 endif >> 39 ifeq ($(mcpu_done)$(CONFIG_ALPHA_SX164)$(have_mcpu_pca56),nyy) >> 40 CFLAGS := $(CFLAGS) -mcpu=pca56 >> 41 mcpu_done := y >> 42 endif >> 43 ifeq ($(mcpu_done)$(CONFIG_ALPHA_POLARIS)$(have_mcpu_pca56),nyy) >> 44 CFLAGS := $(CFLAGS) -mcpu=pca56 >> 45 mcpu_done := y >> 46 endif >> 47 ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV4),ny) >> 48 CFLAGS := $(CFLAGS) -mcpu=ev4 >> 49 mcpu_done := y >> 50 endif >> 51 ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV56),ny) >> 52 CFLAGS := $(CFLAGS) -mcpu=ev56 >> 53 mcpu_done := y >> 54 endif >> 55 ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV5),ny) >> 56 CFLAGS := $(CFLAGS) -mcpu=ev5 >> 57 mcpu_done := y >> 58 endif >> 59 ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV67)$(have_mcpu_ev67),nyy) >> 60 CFLAGS := $(CFLAGS) -mcpu=ev67 >> 61 mcpu_done := y >> 62 endif >> 63 ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV6),ny) >> 64 ifeq ($(have_mcpu_ev6),y) >> 65 CFLAGS := $(CFLAGS) -mcpu=ev6 >> 66 else >> 67 ifeq ($(have_mcpu_pca56),y) >> 68 CFLAGS := $(CFLAGS) -mcpu=pca56 >> 69 else >> 70 CFLAGS := $(CFLAGS) -mcpu=ev56 >> 71 endif >> 72 endif >> 73 mcpu_done := y 30 endif 74 endif 31 endif 75 endif 32 CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_DIV) !! 76 33 CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_BARRE !! 77 # For TSUNAMI, we must have the assembler not emulate our instructions. 34 CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_ !! 78 # The same is true for IRONGATE, POLARIS, PYXIS. 35 !! 79 # BWX is most important, but we don't really want any emulation ever. 36 ifdef CONFIG_CPU_BIG_ENDIAN !! 80 37 KBUILD_CFLAGS += -mbig-endian !! 81 ifeq ($(old_gas),y) 38 KBUILD_AFLAGS += -mbig-endian !! 82 # How do we do #error in make? 39 KBUILD_LDFLAGS += -EB !! 83 CFLAGS := --error-please-upgrade-your-assembler 40 else << 41 KBUILD_CFLAGS += -mlittle-endian << 42 KBUILD_AFLAGS += -mlittle-endian << 43 KBUILD_LDFLAGS += -EL << 44 endif 84 endif >> 85 CFLAGS := $(CFLAGS) -Wa,-mev6 >> 86 >> 87 HEAD := arch/alpha/kernel/head.o >> 88 >> 89 SUBDIRS := $(SUBDIRS) arch/alpha/kernel arch/alpha/mm arch/alpha/lib \ >> 90 arch/alpha/math-emu >> 91 CORE_FILES := arch/alpha/kernel/kernel.o arch/alpha/mm/mm.o $(CORE_FILES) >> 92 >> 93 ifeq ($(CONFIG_MATHEMU),y) >> 94 CORE_FILES := $(CORE_FILES) arch/alpha/math-emu/math-emu.o >> 95 endif >> 96 >> 97 LIBS := $(TOPDIR)/arch/alpha/lib/lib.a $(LIBS) $(TOPDIR)/arch/alpha/lib/lib.a >> 98 >> 99 MAKEBOOT = $(MAKE) -C arch/alpha/boot >> 100 >> 101 rawboot: >> 102 @$(MAKEBOOT) rawboot >> 103 >> 104 # >> 105 # My boot writes directly to a specific disk partition, I doubt most >> 106 # people will want to do that without changes.. >> 107 # >> 108 msb my-special-boot: >> 109 @$(MAKEBOOT) msb >> 110 >> 111 bootimage: >> 112 @$(MAKEBOOT) bootimage >> 113 >> 114 srmboot: >> 115 @$(MAKEBOOT) srmboot >> 116 >> 117 archclean: >> 118 @$(MAKE) -C arch/alpha/kernel clean >> 119 @$(MAKEBOOT) clean >> 120 rm -f arch/alpha/vmlinux.lds 45 121 46 CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VE !! 122 archmrproper: 47 123 48 # r31 holds current when in kernel mode !! 124 archdep: 49 KBUILD_CFLAGS += -ffixed-r31 $(CPUFLAGS-y) $(C !! 125 @$(MAKEBOOT) dep 50 126 51 libs-y += arch/microblaze/lib/ !! 127 vmlinux: arch/alpha/vmlinux.lds 52 128 53 boot := arch/microblaze/boot !! 129 arch/alpha/vmlinux.lds: arch/alpha/vmlinux.lds.in >> 130 $(CPP) $(CPPFLAGS) -xc -P arch/alpha/vmlinux.lds.in -o arch/alpha/vmlinux.lds 54 131 55 # Are we making a simpleImage.<boardname> targ !! 132 bootpfile: 56 DTB:=$(subst simpleImage.,,$(filter simpleImag !! 133 @$(MAKEBOOT) bootpfile 57 << 58 export DTB << 59 << 60 all: linux.bin << 61 << 62 archheaders: << 63 $(Q)$(MAKE) $(build)=arch/microblaze/k << 64 << 65 PHONY += linux.bin linux.bin.gz linux.bin.ub << 66 linux.bin.ub linux.bin.gz: linux.bin << 67 linux.bin: vmlinux << 68 linux.bin linux.bin.gz linux.bin.ub: << 69 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$ << 70 @echo 'Kernel: $(boot)/$@ is ready' ' << 71 << 72 PHONY += simpleImage.$(DTB) << 73 simpleImage.$(DTB): vmlinux << 74 $(Q)$(MAKE) $(build)=$(boot) $(addpref << 75 @echo 'Kernel: $(boot)/$@ is ready' ' << 76 << 77 define archhelp << 78 echo '* linux.bin - Create raw binary' << 79 echo ' linux.bin.gz - Create compressed raw << 80 echo ' linux.bin.ub - Create U-Boot wrapped << 81 echo ' simpleImage.<dt> - Create the follow << 82 echo ' simpleImage.<dt> << 83 echo ' simpleImage.<dt>.u << 84 echo ' simpleImage.<dt>.u << 85 echo ' simpleImage.<dt>.s << 86 echo ' Targets with <dt> embed a device tre << 87 echo ' These targets support board with fir << 88 echo ' support passing a device tree direct << 89 echo ' name of a dts file from the arch/mic << 90 echo ' (minus the .dts extension).' << 91 endef << 92 134 93 MRPROPER_FILES += $(boot)/simpleImage.* !! 135 bootpzfile: >> 136 @$(MAKEBOOT) bootpzfile
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.