| 1 | 
         1275 | 
         phoenix | 
         #
  | 
      
      
         | 2 | 
          | 
          | 
         # This file is subject to the terms and conditions of the GNU General Public
  | 
      
      
         | 3 | 
          | 
          | 
         # License.  See the file "COPYING" in the main directory of this archive
  | 
      
      
         | 4 | 
          | 
          | 
         # for more details.
  | 
      
      
         | 5 | 
          | 
          | 
         #
  | 
      
      
         | 6 | 
          | 
          | 
         # Copyright (C) 2002, 2003  Maciej W. Rozycki
  | 
      
      
         | 7 | 
          | 
          | 
         #
  | 
      
      
         | 8 | 
          | 
          | 
         # This file is included by the global makefile so that you can add your own
  | 
      
      
         | 9 | 
          | 
          | 
         # architecture-specific flags and dependencies. Remember to do have actions
  | 
      
      
         | 10 | 
          | 
          | 
         # for "archclean" and "archdep" for cleaning up and making dependencies for
  | 
      
      
         | 11 | 
          | 
          | 
         # this architecture
  | 
      
      
         | 12 | 
          | 
          | 
         #
  | 
      
      
         | 13 | 
          | 
          | 
          
  | 
      
      
         | 14 | 
          | 
          | 
         comma := ,
  | 
      
      
         | 15 | 
          | 
          | 
          
  | 
      
      
         | 16 | 
          | 
          | 
         #
  | 
      
      
         | 17 | 
          | 
          | 
         # Select the object file format to substitute into the linker script.
  | 
      
      
         | 18 | 
          | 
          | 
         #
  | 
      
      
         | 19 | 
          | 
          | 
         ifdef CONFIG_CPU_LITTLE_ENDIAN
  | 
      
      
         | 20 | 
          | 
          | 
         tool-prefix     = mips64el-linux-
  | 
      
      
         | 21 | 
          | 
          | 
         else
  | 
      
      
         | 22 | 
          | 
          | 
         tool-prefix     = mips64-linux-
  | 
      
      
         | 23 | 
          | 
          | 
         endif
  | 
      
      
         | 24 | 
          | 
          | 
          
  | 
      
      
         | 25 | 
          | 
          | 
         ifdef CONFIG_CROSSCOMPILE
  | 
      
      
         | 26 | 
          | 
          | 
         CROSS_COMPILE   = $(tool-prefix)
  | 
      
      
         | 27 | 
          | 
          | 
         endif
  | 
      
      
         | 28 | 
          | 
          | 
          
  | 
      
      
         | 29 | 
          | 
          | 
         #
  | 
      
      
         | 30 | 
          | 
          | 
         # The ELF GCC uses -G 0 -mabicalls -fpic as default.  We don't need PIC
  | 
      
      
         | 31 | 
          | 
          | 
         # code in the kernel since it only slows down the whole thing.  For the
  | 
      
      
         | 32 | 
          | 
          | 
         # old GCC these options are just the defaults.  At some point we might
  | 
      
      
         | 33 | 
          | 
          | 
         # make use of global pointer optimizations.
  | 
      
      
         | 34 | 
          | 
          | 
         #
  | 
      
      
         | 35 | 
          | 
          | 
         # The DECStation requires an ECOFF kernel for remote booting, other MIPS
  | 
      
      
         | 36 | 
          | 
          | 
         # machines may also.  Since BFD is incredibly buggy with respect to
  | 
      
      
         | 37 | 
          | 
          | 
         # crossformat linking we rely on the elf2ecoff tool for format conversion.
  | 
      
      
         | 38 | 
          | 
          | 
         #
  | 
      
      
         | 39 | 
          | 
          | 
         GCCFLAGS        := -I $(TOPDIR)/include/asm/gcc
  | 
      
      
         | 40 | 
          | 
          | 
         GCCFLAGS        += -mabi=64 -G 0 -mno-abicalls -fno-pic -Wa,--trap -pipe
  | 
      
      
         | 41 | 
          | 
          | 
         GCCFLAGS        += $(call check_gcc, -finline-limit=100000,)
  | 
      
      
         | 42 | 
          | 
          | 
         LINKFLAGS       += -G 0 -static # -N
  | 
      
      
         | 43 | 
          | 
          | 
         MODFLAGS        += -mlong-calls
  | 
      
      
         | 44 | 
          | 
          | 
          
  | 
      
      
         | 45 | 
          | 
          | 
         ifdef CONFIG_DEBUG_INFO
  | 
      
      
         | 46 | 
          | 
          | 
         GCCFLAGS        += -g
  | 
      
      
         | 47 | 
          | 
          | 
         ifdef CONFIG_SB1XXX_CORELIS
  | 
      
      
         | 48 | 
          | 
          | 
         GCCFLAGS        += -mno-sched-prolog -fno-omit-frame-pointer
  | 
      
      
         | 49 | 
          | 
          | 
         endif
  | 
      
      
         | 50 | 
          | 
          | 
         endif
  | 
      
      
         | 51 | 
          | 
          | 
          
  | 
      
      
         | 52 | 
          | 
          | 
         check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
  | 
      
      
         | 53 | 
          | 
          | 
         check_gas = $(shell if $(CC) $(1) -Wa,-Z -c -o /dev/null -xassembler /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
  | 
      
      
         | 54 | 
          | 
          | 
          
  | 
      
      
         | 55 | 
          | 
          | 
         #
  | 
      
      
         | 56 | 
          | 
          | 
         # Use: $(call set_gccflags,,,,)
  | 
      
      
         | 57 | 
          | 
          | 
         #
  | 
      
      
         | 58 | 
          | 
          | 
         # , -- preferred CPU and ISA designations (may require
  | 
      
      
         | 59 | 
          | 
          | 
         #                  recent tools)
  | 
      
      
         | 60 | 
          | 
          | 
         # , -- fallback CPU and ISA designations (have to work
  | 
      
      
         | 61 | 
          | 
          | 
         #                  with up to the oldest supported tools)
  | 
      
      
         | 62 | 
          | 
          | 
         #
  | 
      
      
         | 63 | 
          | 
          | 
         set_gccflags = $(shell \
  | 
      
      
         | 64 | 
          | 
          | 
         while :; do \
  | 
      
      
         | 65 | 
          | 
          | 
                 cpu=$(1); isa=-$(2); \
  | 
      
      
         | 66 | 
          | 
          | 
                 for gcc_opt in -march= -mcpu=; do \
  | 
      
      
         | 67 | 
          | 
          | 
                         $(CC) $$gcc_opt$$cpu $$isa -S -o /dev/null \
  | 
      
      
         | 68 | 
          | 
          | 
                                 -xc /dev/null > /dev/null 2>&1 && \
  | 
      
      
         | 69 | 
          | 
          | 
                                 break 2; \
  | 
      
      
         | 70 | 
          | 
          | 
                 done; \
  | 
      
      
         | 71 | 
          | 
          | 
                 cpu=$(3); isa=-$(4); \
  | 
      
      
         | 72 | 
          | 
          | 
                 for gcc_opt in -march= -mcpu=; do \
  | 
      
      
         | 73 | 
          | 
          | 
                         $(CC) $$gcc_opt$$cpu $$isa -S -o /dev/null \
  | 
      
      
         | 74 | 
          | 
          | 
                                 -xc /dev/null > /dev/null 2>&1 && \
  | 
      
      
         | 75 | 
          | 
          | 
                                 break 2; \
  | 
      
      
         | 76 | 
          | 
          | 
                 done; \
  | 
      
      
         | 77 | 
          | 
          | 
                 break; \
  | 
      
      
         | 78 | 
          | 
          | 
         done; \
  | 
      
      
         | 79 | 
          | 
          | 
         gcc_cpu=$$cpu; gcc_isa=$$isa; \
  | 
      
      
         | 80 | 
          | 
          | 
         gas_cpu=$$cpu; gas_isa=-Wa,$$isa; \
  | 
      
      
         | 81 | 
          | 
          | 
         while :; do \
  | 
      
      
         | 82 | 
          | 
          | 
                 for gas_opt in -Wa,-march= -Wa,-mcpu=; do \
  | 
      
      
         | 83 | 
          | 
          | 
                         $(CC) $$gas_opt$$cpu $$gas_isa -Wa,-Z -c -o /dev/null \
  | 
      
      
         | 84 | 
          | 
          | 
                                 -xassembler /dev/null > /dev/null 2>&1 && \
  | 
      
      
         | 85 | 
          | 
          | 
                                 break 2; \
  | 
      
      
         | 86 | 
          | 
          | 
                 done; \
  | 
      
      
         | 87 | 
          | 
          | 
                 gas_opt=; gas_cpu=; gas_isa=; \
  | 
      
      
         | 88 | 
          | 
          | 
                 break; \
  | 
      
      
         | 89 | 
          | 
          | 
         done; \
  | 
      
      
         | 90 | 
          | 
          | 
         echo $$gcc_opt$$gcc_cpu $$gcc_isa $$gas_opt$$gas_cpu $$gas_isa)
  | 
      
      
         | 91 | 
          | 
          | 
          
  | 
      
      
         | 92 | 
          | 
          | 
         #
  | 
      
      
         | 93 | 
          | 
          | 
         # CPU-dependent compiler/assembler options for optimization.
  | 
      
      
         | 94 | 
          | 
          | 
         #
  | 
      
      
         | 95 | 
          | 
          | 
         ifdef CONFIG_CPU_R4300
  | 
      
      
         | 96 | 
          | 
          | 
         GCCFLAGS        += $(call set_gccflags,r4300,mips3,r4300,mips3)
  | 
      
      
         | 97 | 
          | 
          | 
         endif
  | 
      
      
         | 98 | 
          | 
          | 
         ifdef CONFIG_CPU_R4X00
  | 
      
      
         | 99 | 
          | 
          | 
         GCCFLAGS        += $(call set_gccflags,r4600,mips3,r4600,mips3)
  | 
      
      
         | 100 | 
          | 
          | 
         endif
  | 
      
      
         | 101 | 
          | 
          | 
         ifdef CONFIG_CPU_R5000
  | 
      
      
         | 102 | 
          | 
          | 
         GCCFLAGS        += $(call set_gccflags,r5000,mips4,r8000,mips4)
  | 
      
      
         | 103 | 
          | 
          | 
         endif
  | 
      
      
         | 104 | 
          | 
          | 
         ifdef CONFIG_CPU_NEVADA
  | 
      
      
         | 105 | 
          | 
          | 
         GCCFLAGS        += $(call set_gccflags,rm5200,mips4,r8000,mips4)
  | 
      
      
         | 106 | 
          | 
          | 
         #GCCFLAGS       += $(call check_gcc,-mmad,)
  | 
      
      
         | 107 | 
          | 
          | 
         endif
  | 
      
      
         | 108 | 
          | 
          | 
         ifdef CONFIG_CPU_RM7000
  | 
      
      
         | 109 | 
          | 
          | 
         GCCFLAGS        += $(call set_gccflags,rm7000,mips4,r5000,mips4)
  | 
      
      
         | 110 | 
          | 
          | 
         endif
  | 
      
      
         | 111 | 
          | 
          | 
         ifdef CONFIG_CPU_RM9000
  | 
      
      
         | 112 | 
          | 
          | 
         GCCFLAGS        += $(call set_gccflags,rm9000,mips4,r5000,mips4)
  | 
      
      
         | 113 | 
          | 
          | 
         endif
  | 
      
      
         | 114 | 
          | 
          | 
         ifdef CONFIG_CPU_R8000
  | 
      
      
         | 115 | 
          | 
          | 
         GCCFLAGS        += $(call set_gccflags,r8000,mips4,r8000,mips4)
  | 
      
      
         | 116 | 
          | 
          | 
         endif
  | 
      
      
         | 117 | 
          | 
          | 
         ifdef CONFIG_CPU_R10000
  | 
      
      
         | 118 | 
          | 
          | 
         GCCFLAGS        += $(call set_gccflags,r10000,mips4,r8000,mips4)
  | 
      
      
         | 119 | 
          | 
          | 
         endif
  | 
      
      
         | 120 | 
          | 
          | 
         ifdef CONFIG_CPU_SB1
  | 
      
      
         | 121 | 
          | 
          | 
         GCCFLAGS        += $(call set_gccflags,sb1,mips64,r5000,mips4)
  | 
      
      
         | 122 | 
          | 
          | 
         ifdef CONFIG_SB1_PASS_1_WORKAROUNDS
  | 
      
      
         | 123 | 
          | 
          | 
         MODFLAGS        += -msb1-pass1-workarounds
  | 
      
      
         | 124 | 
          | 
          | 
         endif
  | 
      
      
         | 125 | 
          | 
          | 
         endif
  | 
      
      
         | 126 | 
          | 
          | 
         ifdef CONFIG_CPU_MIPS64
  | 
      
      
         | 127 | 
          | 
          | 
         GCCFLAGS        += $(call set_gccflags,mips64,mips64,r8000,mips4)
  | 
      
      
         | 128 | 
          | 
          | 
         endif
  | 
      
      
         | 129 | 
          | 
          | 
          
  | 
      
      
         | 130 | 
          | 
          | 
         #
  | 
      
      
         | 131 | 
          | 
          | 
         # We unconditionally build the math emulator
  | 
      
      
         | 132 | 
          | 
          | 
         #
  | 
      
      
         | 133 | 
          | 
          | 
         CORE_FILES      += arch/mips/math-emu/fpu_emulator.o
  | 
      
      
         | 134 | 
          | 
          | 
         SUBDIRS         += arch/mips/math-emu
  | 
      
      
         | 135 | 
          | 
          | 
          
  | 
      
      
         | 136 | 
          | 
          | 
         #
  | 
      
      
         | 137 | 
          | 
          | 
         # ramdisk/initrd support
  | 
      
      
         | 138 | 
          | 
          | 
         # You need a compressed ramdisk image, named ramdisk.gz in
  | 
      
      
         | 139 | 
          | 
          | 
         # arch/mips/ramdisk
  | 
      
      
         | 140 | 
          | 
          | 
         #
  | 
      
      
         | 141 | 
          | 
          | 
         ifdef CONFIG_EMBEDDED_RAMDISK
  | 
      
      
         | 142 | 
          | 
          | 
         CORE_FILES      += arch/mips/ramdisk/ramdisk.o
  | 
      
      
         | 143 | 
          | 
          | 
         SUBDIRS         += arch/mips/ramdisk
  | 
      
      
         | 144 | 
          | 
          | 
         endif
  | 
      
      
         | 145 | 
          | 
          | 
          
  | 
      
      
         | 146 | 
          | 
          | 
          
  | 
      
      
         | 147 | 
          | 
          | 
         #
  | 
      
      
         | 148 | 
          | 
          | 
         # Board-dependent options and extra files
  | 
      
      
         | 149 | 
          | 
          | 
         #
  | 
      
      
         | 150 | 
          | 
          | 
          
  | 
      
      
         | 151 | 
          | 
          | 
         #
  | 
      
      
         | 152 | 
          | 
          | 
         # Cobalt Server
  | 
      
      
         | 153 | 
          | 
          | 
         #
  | 
      
      
         | 154 | 
          | 
          | 
         ifdef CONFIG_MIPS_COBALT
  | 
      
      
         | 155 | 
          | 
          | 
         SUBDIRS         += arch/mips/cobalt
  | 
      
      
         | 156 | 
          | 
          | 
         CORE_FILES      += arch/mips/cobalt/cobalt.o
  | 
      
      
         | 157 | 
          | 
          | 
         LOADADDR        := 0x80080000
  | 
      
      
         | 158 | 
          | 
          | 
         endif
  | 
      
      
         | 159 | 
          | 
          | 
          
  | 
      
      
         | 160 | 
          | 
          | 
         #
  | 
      
      
         | 161 | 
          | 
          | 
         # DECstation family
  | 
      
      
         | 162 | 
          | 
          | 
         #
  | 
      
      
         | 163 | 
          | 
          | 
         ifdef CONFIG_DECSTATION
  | 
      
      
         | 164 | 
          | 
          | 
         CORE_FILES      += arch/mips/dec/dec.o
  | 
      
      
         | 165 | 
          | 
          | 
         SUBDIRS         += arch/mips/dec arch/mips/dec/prom
  | 
      
      
         | 166 | 
          | 
          | 
         LIBS            += arch/mips/dec/prom/rexlib.a
  | 
      
      
         | 167 | 
          | 
          | 
         LOADADDR        := 0x80040000
  | 
      
      
         | 168 | 
          | 
          | 
         endif
  | 
      
      
         | 169 | 
          | 
          | 
          
  | 
      
      
         | 170 | 
          | 
          | 
         #
  | 
      
      
         | 171 | 
          | 
          | 
         # Galileo EV64120 Board
  | 
      
      
         | 172 | 
          | 
          | 
         #
  | 
      
      
         | 173 | 
          | 
          | 
         ifdef CONFIG_MIPS_EV64120
  | 
      
      
         | 174 | 
          | 
          | 
         LIBS            += arch/mips/gt64120/common/gt64120.o \
  | 
      
      
         | 175 | 
          | 
          | 
                            arch/mips/gt64120/ev64120/ev64120.o
  | 
      
      
         | 176 | 
          | 
          | 
         SUBDIRS         += arch/mips/gt64120/common arch/mips/gt64120/ev64120
  | 
      
      
         | 177 | 
          | 
          | 
         LOADADDR        := 0x80100000
  | 
      
      
         | 178 | 
          | 
          | 
         endif
  | 
      
      
         | 179 | 
          | 
          | 
          
  | 
      
      
         | 180 | 
          | 
          | 
         #
  | 
      
      
         | 181 | 
          | 
          | 
         # MIPS Atlas board
  | 
      
      
         | 182 | 
          | 
          | 
         #
  | 
      
      
         | 183 | 
          | 
          | 
         ifdef CONFIG_MIPS_ATLAS
  | 
      
      
         | 184 | 
          | 
          | 
         LIBS            += arch/mips/mips-boards/atlas/atlas.o \
  | 
      
      
         | 185 | 
          | 
          | 
                            arch/mips/mips-boards/generic/mipsboards.o
  | 
      
      
         | 186 | 
          | 
          | 
         SUBDIRS         += arch/mips/mips-boards/generic arch/mips/mips-boards/atlas
  | 
      
      
         | 187 | 
          | 
          | 
         LOADADDR        := 0x80100000
  | 
      
      
         | 188 | 
          | 
          | 
         endif
  | 
      
      
         | 189 | 
          | 
          | 
          
  | 
      
      
         | 190 | 
          | 
          | 
         #
  | 
      
      
         | 191 | 
          | 
          | 
         # MIPS Malta board
  | 
      
      
         | 192 | 
          | 
          | 
         #
  | 
      
      
         | 193 | 
          | 
          | 
         ifdef CONFIG_MIPS_MALTA
  | 
      
      
         | 194 | 
          | 
          | 
         LIBS            += arch/mips/mips-boards/malta/malta.o \
  | 
      
      
         | 195 | 
          | 
          | 
                            arch/mips/mips-boards/generic/mipsboards.o
  | 
      
      
         | 196 | 
          | 
          | 
         SUBDIRS         += arch/mips/mips-boards/malta arch/mips/mips-boards/generic
  | 
      
      
         | 197 | 
          | 
          | 
         LOADADDR        := 0x80100000
  | 
      
      
         | 198 | 
          | 
          | 
         endif
  | 
      
      
         | 199 | 
          | 
          | 
          
  | 
      
      
         | 200 | 
          | 
          | 
         #
  | 
      
      
         | 201 | 
          | 
          | 
         # MIPS SEAD board
  | 
      
      
         | 202 | 
          | 
          | 
         #
  | 
      
      
         | 203 | 
          | 
          | 
         ifdef CONFIG_MIPS_SEAD
  | 
      
      
         | 204 | 
          | 
          | 
         LIBS            += arch/mips/mips-boards/sead/sead.o \
  | 
      
      
         | 205 | 
          | 
          | 
                            arch/mips/mips-boards/generic/mipsboards.o
  | 
      
      
         | 206 | 
          | 
          | 
         SUBDIRS         += arch/mips/mips-boards/generic arch/mips/mips-boards/sead
  | 
      
      
         | 207 | 
          | 
          | 
         LOADADDR        := 0x80100000
  | 
      
      
         | 208 | 
          | 
          | 
         endif
  | 
      
      
         | 209 | 
          | 
          | 
          
  | 
      
      
         | 210 | 
          | 
          | 
         #
  | 
      
      
         | 211 | 
          | 
          | 
         # Momentum Ocelot board
  | 
      
      
         | 212 | 
          | 
          | 
         #
  | 
      
      
         | 213 | 
          | 
          | 
         ifdef CONFIG_MOMENCO_OCELOT
  | 
      
      
         | 214 | 
          | 
          | 
         # The Ocelot setup.o must be linked early - it does the ioremap() for the
  | 
      
      
         | 215 | 
          | 
          | 
         # mips_io_port_base.
  | 
      
      
         | 216 | 
          | 
          | 
         CORE_FILES      += arch/mips/gt64120/common/gt64120.o \
  | 
      
      
         | 217 | 
          | 
          | 
                            arch/mips/gt64120/momenco_ocelot/momenco_ocelot.o
  | 
      
      
         | 218 | 
          | 
          | 
         SUBDIRS         += arch/mips/gt64120/common arch/mips/gt64120/momenco_ocelot
  | 
      
      
         | 219 | 
          | 
          | 
         LOADADDR        := 0x80100000
  | 
      
      
         | 220 | 
          | 
          | 
         endif
  | 
      
      
         | 221 | 
          | 
          | 
          
  | 
      
      
         | 222 | 
          | 
          | 
         #
  | 
      
      
         | 223 | 
          | 
          | 
         # Momentum Ocelot-G board
  | 
      
      
         | 224 | 
          | 
          | 
         #
  | 
      
      
         | 225 | 
          | 
          | 
         ifdef CONFIG_MOMENCO_OCELOT_G
  | 
      
      
         | 226 | 
          | 
          | 
         # The Ocelot-G setup.o must be linked early - it does the ioremap() for the
  | 
      
      
         | 227 | 
          | 
          | 
         # mips_io_port_base.
  | 
      
      
         | 228 | 
          | 
          | 
         CORE_FILES      += arch/mips/momentum/ocelot_g/ocelot_g.o
  | 
      
      
         | 229 | 
          | 
          | 
         SUBDIRS         += arch/mips/momentum/ocelot_g
  | 
      
      
         | 230 | 
          | 
          | 
         LOADADDR        := 0x80100000
  | 
      
      
         | 231 | 
          | 
          | 
         endif
  | 
      
      
         | 232 | 
          | 
          | 
          
  | 
      
      
         | 233 | 
          | 
          | 
         #
  | 
      
      
         | 234 | 
          | 
          | 
         # Momentum Ocelot-C and -CS boards
  | 
      
      
         | 235 | 
          | 
          | 
         #
  | 
      
      
         | 236 | 
          | 
          | 
         ifdef CONFIG_MOMENCO_OCELOT_C
  | 
      
      
         | 237 | 
          | 
          | 
         CORE_FILES      += arch/mips/momentum/ocelot_c/ocelot_c.o
  | 
      
      
         | 238 | 
          | 
          | 
         SUBDIRS         += arch/mips/momentum/ocelot_c
  | 
      
      
         | 239 | 
          | 
          | 
         LOADADDR        := 0x80100000
  | 
      
      
         | 240 | 
          | 
          | 
         endif
  | 
      
      
         | 241 | 
          | 
          | 
          
  | 
      
      
         | 242 | 
          | 
          | 
         ifdef CONFIG_MOMENCO_JAGUAR_ATX
  | 
      
      
         | 243 | 
          | 
          | 
         LIBS            += arch/mips/momentum/jaguar_atx/jaguar_atx.o
  | 
      
      
         | 244 | 
          | 
          | 
         SUBDIRS         += arch/mips/momentum/jaguar_atx
  | 
      
      
         | 245 | 
          | 
          | 
         ifdef CONFIG_JAGUAR_DMALOW
  | 
      
      
         | 246 | 
          | 
          | 
         LOADADDR        := 0x88000000
  | 
      
      
         | 247 | 
          | 
          | 
         else
  | 
      
      
         | 248 | 
          | 
          | 
         LOADADDR        := 0x80100000
  | 
      
      
         | 249 | 
          | 
          | 
         endif
  | 
      
      
         | 250 | 
          | 
          | 
         endif
  | 
      
      
         | 251 | 
          | 
          | 
          
  | 
      
      
         | 252 | 
          | 
          | 
         ifdef CONFIG_PCI
  | 
      
      
         | 253 | 
          | 
          | 
         CORE_FILES    += arch/mips/pci/pci-core.o
  | 
      
      
         | 254 | 
          | 
          | 
         SUBDIRS       += arch/mips/pci
  | 
      
      
         | 255 | 
          | 
          | 
         endif
  | 
      
      
         | 256 | 
          | 
          | 
          
  | 
      
      
         | 257 | 
          | 
          | 
         #
  | 
      
      
         | 258 | 
          | 
          | 
         # SGI IP22 (Indy/Indigo2)
  | 
      
      
         | 259 | 
          | 
          | 
         #
  | 
      
      
         | 260 | 
          | 
          | 
         ifdef CONFIG_SGI_IP22
  | 
      
      
         | 261 | 
          | 
          | 
         CORE_FILES      += arch/mips/sgi-ip22/ip22-kern.o
  | 
      
      
         | 262 | 
          | 
          | 
         LIBS            += arch/mips/arc/arclib.a
  | 
      
      
         | 263 | 
          | 
          | 
         SUBDIRS         += arch/mips/sgi-ip22 arch/mips/arc
  | 
      
      
         | 264 | 
          | 
          | 
         #
  | 
      
      
         | 265 | 
          | 
          | 
         # Set LOADADDR to >= 0x88069000 if you want to leave space for symmon,
  | 
      
      
         | 266 | 
          | 
          | 
         # 0x88004000 for production kernels.  Note that the value must be
  | 
      
      
         | 267 | 
          | 
          | 
         # 16kb aligned or the handling of the current variable will break.
  | 
      
      
         | 268 | 
          | 
          | 
         #
  | 
      
      
         | 269 | 
          | 
          | 
         LOADADDR        := 0x88004000
  | 
      
      
         | 270 | 
          | 
          | 
         endif
  | 
      
      
         | 271 | 
          | 
          | 
          
  | 
      
      
         | 272 | 
          | 
          | 
         #
  | 
      
      
         | 273 | 
          | 
          | 
         # SGI-IP27 (Origin200/2000)
  | 
      
      
         | 274 | 
          | 
          | 
         #
  | 
      
      
         | 275 | 
          | 
          | 
         ifdef CONFIG_SGI_IP27
  | 
      
      
         | 276 | 
          | 
          | 
         CORE_FILES      += arch/mips/sgi-ip27/ip27.o
  | 
      
      
         | 277 | 
          | 
          | 
         LIBS            += arch/mips/arc/arclib.a
  | 
      
      
         | 278 | 
          | 
          | 
         SUBDIRS         += arch/mips/sgi-ip27 arch/mips/arc
  | 
      
      
         | 279 | 
          | 
          | 
         #
  | 
      
      
         | 280 | 
          | 
          | 
         # Set LOADADDR to >= 0xc000000000300000 if you want to leave space for
  | 
      
      
         | 281 | 
          | 
          | 
         # symmon, 0xc00000000001c000 for production kernels.  Note that the value
  | 
      
      
         | 282 | 
          | 
          | 
         # must be 16kb aligned or the handling of the current variable will break.
  | 
      
      
         | 283 | 
          | 
          | 
         #
  | 
      
      
         | 284 | 
          | 
          | 
         #LOADADDR       := 0xa80000000001c000
  | 
      
      
         | 285 | 
          | 
          | 
         ifdef CONFIG_MAPPED_KERNEL
  | 
      
      
         | 286 | 
          | 
          | 
         LOADADDR        := 0xc001c000
  | 
      
      
         | 287 | 
          | 
          | 
         else
  | 
      
      
         | 288 | 
          | 
          | 
         LOADADDR        := 0x8001c000
  | 
      
      
         | 289 | 
          | 
          | 
         endif
  | 
      
      
         | 290 | 
          | 
          | 
         endif
  | 
      
      
         | 291 | 
          | 
          | 
          
  | 
      
      
         | 292 | 
          | 
          | 
         #
  | 
      
      
         | 293 | 
          | 
          | 
         # Sibyte SB1250 SOC and Broadcom (SiByte) BCM112x SOCs
  | 
      
      
         | 294 | 
          | 
          | 
         #
  | 
      
      
         | 295 | 
          | 
          | 
         ifneq ($(CONFIG_SIBYTE_SB1250)$(CONFIG_SIBYTE_BCM112X),)
  | 
      
      
         | 296 | 
          | 
          | 
         # This is a LIB so that it links at the end, and initcalls are later
  | 
      
      
         | 297 | 
          | 
          | 
         # the sequence; but it is built as an object so that modules don't get
  | 
      
      
         | 298 | 
          | 
          | 
         # removed (as happens, even if they have __initcall/module_init)
  | 
      
      
         | 299 | 
          | 
          | 
         LIBS            += arch/mips/sibyte/sb1250/sb1250.o
  | 
      
      
         | 300 | 
          | 
          | 
         SUBDIRS         += arch/mips/sibyte/sb1250
  | 
      
      
         | 301 | 
          | 
          | 
         ifdef CONFIG_MIPS_UNCACHED
  | 
      
      
         | 302 | 
          | 
          | 
         LOADADDR        := 0xa0100000
  | 
      
      
         | 303 | 
          | 
          | 
         else
  | 
      
      
         | 304 | 
          | 
          | 
         LOADADDR        := 0x80100000
  | 
      
      
         | 305 | 
          | 
          | 
         endif
  | 
      
      
         | 306 | 
          | 
          | 
         endif
  | 
      
      
         | 307 | 
          | 
          | 
          
  | 
      
      
         | 308 | 
          | 
          | 
         #
  | 
      
      
         | 309 | 
          | 
          | 
         # Sibyte boards:
  | 
      
      
         | 310 | 
          | 
          | 
         #
  | 
      
      
         | 311 | 
          | 
          | 
         # BCM91250A (SWARM),
  | 
      
      
         | 312 | 
          | 
          | 
         # BCM91250E (Sentosa),
  | 
      
      
         | 313 | 
          | 
          | 
         # BCM91120C (CRhine),
  | 
      
      
         | 314 | 
          | 
          | 
         # BCM91120x (Carmel),
  | 
      
      
         | 315 | 
          | 
          | 
         # BCM91125C (CRhone),
  | 
      
      
         | 316 | 
          | 
          | 
         # BCM91125E (Rhone).
  | 
      
      
         | 317 | 
          | 
          | 
         #
  | 
      
      
         | 318 | 
          | 
          | 
         ifdef CONFIG_SIBYTE_BOARD
  | 
      
      
         | 319 | 
          | 
          | 
         LIBS            += arch/mips/sibyte/swarm/sbswarm.a
  | 
      
      
         | 320 | 
          | 
          | 
         SUBDIRS         += arch/mips/sibyte/swarm
  | 
      
      
         | 321 | 
          | 
          | 
         endif
  | 
      
      
         | 322 | 
          | 
          | 
          
  | 
      
      
         | 323 | 
          | 
          | 
         #
  | 
      
      
         | 324 | 
          | 
          | 
         # Sibyte CFE firmware
  | 
      
      
         | 325 | 
          | 
          | 
         #
  | 
      
      
         | 326 | 
          | 
          | 
         ifdef CONFIG_SIBYTE_CFE
  | 
      
      
         | 327 | 
          | 
          | 
         LIBS            += arch/mips/sibyte/cfe/cfe.a
  | 
      
      
         | 328 | 
          | 
          | 
         SUBDIRS         += arch/mips/sibyte/cfe
  | 
      
      
         | 329 | 
          | 
          | 
         endif
  | 
      
      
         | 330 | 
          | 
          | 
          
  | 
      
      
         | 331 | 
          | 
          | 
         #
  | 
      
      
         | 332 | 
          | 
          | 
         # Some machines like the Indy need 32-bit ELF binaries for booting purposes.
  | 
      
      
         | 333 | 
          | 
          | 
         # Other need ECOFF, so we build a 32-bit ELF binary for them which we then
  | 
      
      
         | 334 | 
          | 
          | 
         # convert to ECOFF using elf2ecoff.
  | 
      
      
         | 335 | 
          | 
          | 
         #
  | 
      
      
         | 336 | 
          | 
          | 
         ifdef CONFIG_BOOT_ELF32
  | 
      
      
         | 337 | 
          | 
          | 
         GCCFLAGS += -Wa,-32 $(call check_gas,-Wa$(comma)-mgp64,)
  | 
      
      
         | 338 | 
          | 
          | 
         LINKFLAGS += -T arch/mips64/ld.script.elf32
  | 
      
      
         | 339 | 
          | 
          | 
         endif
  | 
      
      
         | 340 | 
          | 
          | 
         #
  | 
      
      
         | 341 | 
          | 
          | 
         # The 64-bit ELF tools are pretty broken so at this time we generate 64-bit
  | 
      
      
         | 342 | 
          | 
          | 
         # ELF files from 32-bit files by conversion.
  | 
      
      
         | 343 | 
          | 
          | 
         #
  | 
      
      
         | 344 | 
          | 
          | 
         ifdef CONFIG_BOOT_ELF64
  | 
      
      
         | 345 | 
          | 
          | 
         GCCFLAGS += -Wa,-32 $(call check_gas,-Wa$(comma)-mgp64,)
  | 
      
      
         | 346 | 
          | 
          | 
         LINKFLAGS += -T arch/mips64/ld.script.elf32
  | 
      
      
         | 347 | 
          | 
          | 
         #AS += -64
  | 
      
      
         | 348 | 
          | 
          | 
         #LD += -m elf64bmip
  | 
      
      
         | 349 | 
          | 
          | 
         #LINKFLAGS += -T arch/mips64/ld.script.elf64
  | 
      
      
         | 350 | 
          | 
          | 
         endif
  | 
      
      
         | 351 | 
          | 
          | 
          
  | 
      
      
         | 352 | 
          | 
          | 
         ifdef CONFIG_CPU_LITTLE_ENDIAN
  | 
      
      
         | 353 | 
          | 
          | 
         32bit-bfd = elf32-tradlittlemips
  | 
      
      
         | 354 | 
          | 
          | 
         64bit-bfd = elf64-tradlittlemips
  | 
      
      
         | 355 | 
          | 
          | 
         else
  | 
      
      
         | 356 | 
          | 
          | 
         32bit-bfd = elf32-tradbigmips
  | 
      
      
         | 357 | 
          | 
          | 
         64bit-bfd = elf64-tradbigmips
  | 
      
      
         | 358 | 
          | 
          | 
         endif
  | 
      
      
         | 359 | 
          | 
          | 
          
  | 
      
      
         | 360 | 
          | 
          | 
          
  | 
      
      
         | 361 | 
          | 
          | 
         AFLAGS          += $(GCCFLAGS)
  | 
      
      
         | 362 | 
          | 
          | 
         CFLAGS          += $(GCCFLAGS)
  | 
      
      
         | 363 | 
          | 
          | 
          
  | 
      
      
         | 364 | 
          | 
          | 
         LD              += --oformat $(32bit-bfd)
  | 
      
      
         | 365 | 
          | 
          | 
          
  | 
      
      
         | 366 | 
          | 
          | 
          
  | 
      
      
         | 367 | 
          | 
          | 
         LINKFLAGS += -Ttext $(LOADADDR)
  | 
      
      
         | 368 | 
          | 
          | 
          
  | 
      
      
         | 369 | 
          | 
          | 
         HEAD := arch/mips64/kernel/head.o arch/mips64/kernel/init_task.o
  | 
      
      
         | 370 | 
          | 
          | 
          
  | 
      
      
         | 371 | 
          | 
          | 
         SUBDIRS := $(addprefix arch/mips/, tools) $(SUBDIRS) $(addprefix arch/mips64/, kernel mm lib)
  | 
      
      
         | 372 | 
          | 
          | 
         CORE_FILES := arch/mips64/kernel/kernel.o arch/mips64/mm/mm.o $(CORE_FILES)
  | 
      
      
         | 373 | 
          | 
          | 
         LIBS := arch/mips64/lib/lib.a $(LIBS)
  | 
      
      
         | 374 | 
          | 
          | 
          
  | 
      
      
         | 375 | 
          | 
          | 
         MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
  | 
      
      
         | 376 | 
          | 
          | 
          
  | 
      
      
         | 377 | 
          | 
          | 
         vmlinux: arch/mips64/ld.script.elf32
  | 
      
      
         | 378 | 
          | 
          | 
         arch/mips64/ld.script.elf32: arch/mips64/ld.script.elf32.S
  | 
      
      
         | 379 | 
          | 
          | 
                 $(CPP) -C -P -I$(HPATH) -imacros $(HPATH)/asm-mips64/sn/mapped_kernel.h -Umips arch/mips64/ld.script.elf32.S > arch/mips64/ld.script.elf32
  | 
      
      
         | 380 | 
          | 
          | 
          
  | 
      
      
         | 381 | 
          | 
          | 
         ifdef CONFIG_MAPPED_KERNEL
  | 
      
      
         | 382 | 
          | 
          | 
         vmlinux.64: vmlinux
  | 
      
      
         | 383 | 
          | 
          | 
                 $(OBJCOPY) -O $(64bit-bfd) --remove-section=.reginfo --change-addresses=0xc000000080000000 $< $@
  | 
      
      
         | 384 | 
          | 
          | 
         else
  | 
      
      
         | 385 | 
          | 
          | 
         vmlinux.64: vmlinux
  | 
      
      
         | 386 | 
          | 
          | 
                 $(OBJCOPY) -O $(64bit-bfd) --remove-section=.reginfo --change-addresses=0xa800000080000000 $< $@
  | 
      
      
         | 387 | 
          | 
          | 
         endif
  | 
      
      
         | 388 | 
          | 
          | 
          
  | 
      
      
         | 389 | 
          | 
          | 
         vmlinux.ecoff: vmlinux
  | 
      
      
         | 390 | 
          | 
          | 
                 @$(MAKEBOOT) $@
  | 
      
      
         | 391 | 
          | 
          | 
          
  | 
      
      
         | 392 | 
          | 
          | 
         archclean:
  | 
      
      
         | 393 | 
          | 
          | 
                 @$(MAKEBOOT) clean
  | 
      
      
         | 394 | 
          | 
          | 
                 $(MAKE) -C arch/mips/tools clean
  | 
      
      
         | 395 | 
          | 
          | 
                 rm -f vmlinux.64 arch/$(ARCH)/ld.script.elf32
  | 
      
      
         | 396 | 
          | 
          | 
          
  | 
      
      
         | 397 | 
          | 
          | 
         archmrproper:
  | 
      
      
         | 398 | 
          | 
          | 
                 @$(MAKEBOOT) mrproper
  | 
      
      
         | 399 | 
          | 
          | 
                 $(MAKE) -C arch/mips/tools mrproper
  | 
      
      
         | 400 | 
          | 
          | 
                 $(RM) $(TOPDIR)/include/asm-$(ARCH)/offset.h
  | 
      
      
         | 401 | 
          | 
          | 
          
  | 
      
      
         | 402 | 
          | 
          | 
         archdep:
  | 
      
      
         | 403 | 
          | 
          | 
                 if [ ! -f $(TOPDIR)/include/asm-$(ARCH)/offset.h ]; then \
  | 
      
      
         | 404 | 
          | 
          | 
                         touch $(TOPDIR)/include/asm-$(ARCH)/offset.h; \
  | 
      
      
         | 405 | 
          | 
          | 
                 fi;
  | 
      
      
         | 406 | 
          | 
          | 
                 @$(MAKEBOOT) dep
  |