Makefile 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. #
  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) 1994, 95, 96, 2003 by Ralf Baechle
  7. # DECStation modifications by Paul M. Antoine, 1996
  8. # Copyright (C) 2002, 2003, 2004 Maciej W. Rozycki
  9. #
  10. # This file is included by the global makefile so that you can add your own
  11. # architecture-specific flags and dependencies.
  12. #
  13. archscripts: scripts_basic
  14. $(Q)$(MAKE) $(build)=arch/mips/tools elf-entry
  15. ifeq ($(CONFIG_CPU_LOONGSON3_WORKAROUNDS),y)
  16. $(Q)$(MAKE) $(build)=arch/mips/tools loongson3-llsc-check
  17. endif
  18. $(Q)$(MAKE) $(build)=arch/mips/boot/tools relocs
  19. KBUILD_DEFCONFIG := 32r2el_defconfig
  20. KBUILD_DTBS := dtbs
  21. #
  22. # Select the object file format to substitute into the linker script.
  23. #
  24. ifdef CONFIG_CPU_LITTLE_ENDIAN
  25. 32bit-tool-archpref = mipsel
  26. 64bit-tool-archpref = mips64el
  27. 32bit-bfd = elf32-tradlittlemips
  28. 64bit-bfd = elf64-tradlittlemips
  29. 32bit-emul = elf32ltsmip
  30. 64bit-emul = elf64ltsmip
  31. else
  32. 32bit-tool-archpref = mips
  33. 64bit-tool-archpref = mips64
  34. 32bit-bfd = elf32-tradbigmips
  35. 64bit-bfd = elf64-tradbigmips
  36. 32bit-emul = elf32btsmip
  37. 64bit-emul = elf64btsmip
  38. endif
  39. ifdef CONFIG_32BIT
  40. tool-archpref = $(32bit-tool-archpref)
  41. UTS_MACHINE := mips
  42. endif
  43. ifdef CONFIG_64BIT
  44. tool-archpref = $(64bit-tool-archpref)
  45. UTS_MACHINE := mips64
  46. endif
  47. ifdef cross_compiling
  48. ifeq ($(CROSS_COMPILE),)
  49. CROSS_COMPILE := $(call cc-cross-prefix, $(tool-archpref)-linux- $(tool-archpref)-linux-gnu- $(tool-archpref)-unknown-linux-gnu-)
  50. endif
  51. endif
  52. ifdef CONFIG_FUNCTION_GRAPH_TRACER
  53. ifndef KBUILD_MCOUNT_RA_ADDRESS
  54. ifeq ($(call cc-option-yn,-mmcount-ra-address), y)
  55. cflags-y += -mmcount-ra-address -DKBUILD_MCOUNT_RA_ADDRESS
  56. endif
  57. endif
  58. endif
  59. cflags-y += $(call cc-option, -mno-check-zero-division)
  60. ifdef CONFIG_32BIT
  61. ld-emul = $(32bit-emul)
  62. vmlinux-32 = vmlinux
  63. vmlinux-64 = vmlinux.64
  64. cflags-y += -mabi=32
  65. endif
  66. ifdef CONFIG_64BIT
  67. ld-emul = $(64bit-emul)
  68. vmlinux-32 = vmlinux.32
  69. vmlinux-64 = vmlinux
  70. cflags-y += -mabi=64
  71. endif
  72. all-$(CONFIG_BOOT_ELF32) := $(vmlinux-32)
  73. all-$(CONFIG_BOOT_ELF64) := $(vmlinux-64)
  74. all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlinuz
  75. #
  76. # GCC uses -G 0 -mabicalls -fpic as default. We don't want PIC in the kernel
  77. # code since it only slows down the whole thing. At some point we might make
  78. # use of global pointer optimizations but their use of $28 conflicts with
  79. # the current pointer optimization.
  80. #
  81. # The DECStation requires an ECOFF kernel for remote booting, other MIPS
  82. # machines may also. Since BFD is incredibly buggy with respect to
  83. # crossformat linking we rely on the elf2ecoff tool for format conversion.
  84. #
  85. cflags-y += -G 0 -mno-abicalls -fno-pic -pipe
  86. cflags-y += -msoft-float
  87. LDFLAGS_vmlinux += -G 0 -static -n -nostdlib
  88. KBUILD_AFLAGS_MODULE += -mlong-calls
  89. KBUILD_CFLAGS_MODULE += -mlong-calls
  90. ifeq ($(CONFIG_RELOCATABLE),y)
  91. LDFLAGS_vmlinux += --emit-relocs
  92. endif
  93. #
  94. # pass -msoft-float to GAS if it supports it. However on newer binutils
  95. # (specifically newer than 2.24.51.20140728) we then also need to explicitly
  96. # set ".set hardfloat" in all files which manipulate floating point registers.
  97. #
  98. ifneq ($(call cc-option,$(cflags-y) -Wa$(comma)-msoft-float,),)
  99. cflags-y += -DGAS_HAS_SET_HARDFLOAT -Wa,-msoft-float
  100. endif
  101. cflags-y += -ffreestanding
  102. cflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB
  103. cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -EL
  104. cflags-$(CONFIG_SB1XXX_CORELIS) += $(call cc-option,-mno-sched-prolog) \
  105. -fno-omit-frame-pointer
  106. # Some distribution-specific toolchains might pass the -fstack-check
  107. # option during the build, which adds a simple stack-probe at the beginning
  108. # of every function. This stack probe is to ensure that there is enough
  109. # stack space, else a SEGV is generated. This is not desirable for MIPS
  110. # as kernel stacks are small, placed in unmapped virtual memory, and do not
  111. # grow when overflowed. Especially on SGI IP27 platforms, this check will
  112. # lead to a NULL pointer dereference in _raw_spin_lock_irq.
  113. #
  114. # In disassembly, this stack probe appears at the top of a function as:
  115. # sd zero,<offset>(sp)
  116. # Where <offset> is a negative value.
  117. #
  118. cflags-y += -fno-stack-check
  119. # binutils from v2.35 when built with --enable-mips-fix-loongson3-llsc=yes,
  120. # supports an -mfix-loongson3-llsc flag which emits a sync prior to each ll
  121. # instruction to work around a CPU bug (see __SYNC_loongson3_war in asm/sync.h
  122. # for a description).
  123. #
  124. # We disable this in order to prevent the assembler meddling with the
  125. # instruction that labels refer to, ie. if we label an ll instruction:
  126. #
  127. # 1: ll v0, 0(a0)
  128. #
  129. # ...then with the assembler fix applied the label may actually point at a sync
  130. # instruction inserted by the assembler, and if we were using the label in an
  131. # exception table the table would no longer contain the address of the ll
  132. # instruction.
  133. #
  134. # Avoid this by explicitly disabling that assembler behaviour.
  135. #
  136. cflags-y += $(call cc-option,-Wa$(comma)-mno-fix-loongson3-llsc,)
  137. #
  138. # CPU-dependent compiler/assembler options for optimization.
  139. #
  140. cflags-$(CONFIG_CPU_R3000) += -march=r3000
  141. cflags-$(CONFIG_CPU_R4300) += -march=r4300 -Wa,--trap
  142. cflags-$(CONFIG_CPU_R4X00) += -march=r4600 -Wa,--trap
  143. cflags-$(CONFIG_CPU_TX49XX) += -march=r4600 -Wa,--trap
  144. cflags-$(CONFIG_CPU_MIPS32_R1) += -march=mips32 -Wa,--trap
  145. cflags-$(CONFIG_CPU_MIPS32_R2) += -march=mips32r2 -Wa,--trap
  146. cflags-$(CONFIG_CPU_MIPS32_R5) += -march=mips32r5 -Wa,--trap -modd-spreg
  147. cflags-$(CONFIG_CPU_MIPS32_R6) += -march=mips32r6 -Wa,--trap -modd-spreg
  148. cflags-$(CONFIG_CPU_MIPS64_R1) += -march=mips64 -Wa,--trap
  149. cflags-$(CONFIG_CPU_MIPS64_R2) += -march=mips64r2 -Wa,--trap
  150. cflags-$(CONFIG_CPU_MIPS64_R5) += -march=mips64r5 -Wa,--trap
  151. cflags-$(CONFIG_CPU_MIPS64_R6) += -march=mips64r6 -Wa,--trap
  152. cflags-$(CONFIG_CPU_P5600) += -march=p5600 -Wa,--trap -modd-spreg
  153. cflags-$(CONFIG_CPU_R5000) += -march=r5000 -Wa,--trap
  154. cflags-$(CONFIG_CPU_R5500) += $(call cc-option,-march=r5500,-march=r5000) \
  155. -Wa,--trap
  156. cflags-$(CONFIG_CPU_NEVADA) += $(call cc-option,-march=rm5200,-march=r5000) \
  157. -Wa,--trap
  158. cflags-$(CONFIG_CPU_RM7000) += $(call cc-option,-march=rm7000,-march=r5000) \
  159. -Wa,--trap
  160. cflags-$(CONFIG_CPU_SB1) += $(call cc-option,-march=sb1,-march=r5000) \
  161. -Wa,--trap
  162. cflags-$(CONFIG_CPU_SB1) += $(call cc-option,-mno-mdmx)
  163. cflags-$(CONFIG_CPU_SB1) += $(call cc-option,-mno-mips3d)
  164. cflags-$(CONFIG_CPU_R10000) += $(call cc-option,-march=r10000,-march=r8000) \
  165. -Wa,--trap
  166. cflags-$(CONFIG_CPU_CAVIUM_OCTEON) += $(call cc-option,-march=octeon) -Wa,--trap
  167. ifeq (,$(findstring march=octeon, $(cflags-$(CONFIG_CPU_CAVIUM_OCTEON))))
  168. cflags-$(CONFIG_CPU_CAVIUM_OCTEON) += -Wa,-march=octeon
  169. endif
  170. cflags-$(CONFIG_CAVIUM_CN63XXP1) += -Wa,-mfix-cn63xxp1
  171. cflags-$(CONFIG_CPU_BMIPS) += -march=mips32 -Wa,-mips32 -Wa,--trap
  172. cflags-$(CONFIG_CPU_LOONGSON2E) += $(call cc-option,-march=loongson2e) -Wa,--trap
  173. cflags-$(CONFIG_CPU_LOONGSON2F) += $(call cc-option,-march=loongson2f) -Wa,--trap
  174. cflags-$(CONFIG_CPU_LOONGSON64) += $(call cc-option,-march=loongson3a,-march=mips64r2) -Wa,--trap
  175. # Some -march= flags enable MMI instructions, and GCC complains about that
  176. # support being enabled alongside -msoft-float. Thus explicitly disable MMI.
  177. cflags-$(CONFIG_CPU_LOONGSON2EF) += $(call cc-option,-mno-loongson-mmi)
  178. cflags-$(CONFIG_CPU_LOONGSON64) += $(call cc-option,-mno-loongson-mmi)
  179. cflags-$(CONFIG_CPU_R4000_WORKAROUNDS) += $(call cc-option,-mfix-r4000,)
  180. cflags-$(CONFIG_CPU_R4400_WORKAROUNDS) += $(call cc-option,-mfix-r4400,)
  181. cflags-$(CONFIG_CPU_DADDI_WORKAROUNDS) += $(call cc-option,-mno-daddi,)
  182. ifdef CONFIG_CPU_LOONGSON2F_WORKAROUNDS
  183. cflags-$(CONFIG_CPU_NOP_WORKAROUNDS) += -Wa,-mfix-loongson2f-nop
  184. cflags-$(CONFIG_CPU_JUMP_WORKAROUNDS) += -Wa,-mfix-loongson2f-jump
  185. endif
  186. #
  187. # Some versions of binutils, not currently mainline as of 2019/02/04, support
  188. # an -mfix-loongson3-llsc flag which emits a sync prior to each ll instruction
  189. # to work around a CPU bug (see __SYNC_loongson3_war in asm/sync.h for a
  190. # description).
  191. #
  192. # We disable this in order to prevent the assembler meddling with the
  193. # instruction that labels refer to, ie. if we label an ll instruction:
  194. #
  195. # 1: ll v0, 0(a0)
  196. #
  197. # ...then with the assembler fix applied the label may actually point at a sync
  198. # instruction inserted by the assembler, and if we were using the label in an
  199. # exception table the table would no longer contain the address of the ll
  200. # instruction.
  201. #
  202. # Avoid this by explicitly disabling that assembler behaviour. If upstream
  203. # binutils does not merge support for the flag then we can revisit & remove
  204. # this later - for now it ensures vendor toolchains don't cause problems.
  205. #
  206. cflags-$(CONFIG_CPU_LOONGSON64) += $(call as-option,-Wa$(comma)-mno-fix-loongson3-llsc,)
  207. # For smartmips configurations, there are hundreds of warnings due to ISA overrides
  208. # in assembly and header files. smartmips is only supported for MIPS32r1 onwards
  209. # and there is no support for 64-bit. Various '.set mips2' or '.set mips3' or
  210. # similar directives in the kernel will spam the build logs with the following warnings:
  211. # Warning: the `smartmips' extension requires MIPS32 revision 1 or greater
  212. # or
  213. # Warning: the 64-bit MIPS architecture does not support the `smartmips' extension
  214. # Pass -Wa,--no-warn to disable all assembler warnings until the kernel code has
  215. # been fixed properly.
  216. mips-cflags := $(cflags-y)
  217. ifeq ($(CONFIG_CPU_HAS_SMARTMIPS),y)
  218. smartmips-ase := $(call cc-option-yn,$(mips-cflags) -msmartmips)
  219. cflags-$(smartmips-ase) += -msmartmips -Wa,--no-warn
  220. endif
  221. ifeq ($(CONFIG_CPU_MICROMIPS),y)
  222. micromips-ase := $(call cc-option-yn,$(mips-cflags) -mmicromips)
  223. cflags-$(micromips-ase) += -mmicromips
  224. endif
  225. ifeq ($(CONFIG_CPU_HAS_MSA),y)
  226. toolchain-msa := $(call cc-option-yn,$(mips-cflags) -mhard-float -mfp64 -Wa$(comma)-mmsa)
  227. cflags-$(toolchain-msa) += -DTOOLCHAIN_SUPPORTS_MSA
  228. endif
  229. toolchain-virt := $(call cc-option-yn,$(mips-cflags) -mvirt)
  230. cflags-$(toolchain-virt) += -DTOOLCHAIN_SUPPORTS_VIRT
  231. # For -mmicromips, use -Wa,-fatal-warnings to catch unsupported -mxpa which
  232. # only warns
  233. xpa-cflags-y := $(mips-cflags)
  234. xpa-cflags-$(micromips-ase) += -mmicromips -Wa$(comma)-fatal-warnings
  235. toolchain-xpa := $(call cc-option-yn,$(xpa-cflags-y) -mxpa)
  236. cflags-$(toolchain-xpa) += -DTOOLCHAIN_SUPPORTS_XPA
  237. toolchain-crc := $(call cc-option-yn,$(mips-cflags) -Wa$(comma)-mcrc)
  238. cflags-$(toolchain-crc) += -DTOOLCHAIN_SUPPORTS_CRC
  239. toolchain-dsp := $(call cc-option-yn,$(mips-cflags) -Wa$(comma)-mdsp)
  240. cflags-$(toolchain-dsp) += -DTOOLCHAIN_SUPPORTS_DSP
  241. toolchain-ginv := $(call cc-option-yn,$(mips-cflags) -Wa$(comma)-mginv)
  242. cflags-$(toolchain-ginv) += -DTOOLCHAIN_SUPPORTS_GINV
  243. #
  244. # Firmware support
  245. #
  246. libs-$(CONFIG_FW_ARC) += arch/mips/fw/arc/
  247. libs-$(CONFIG_FW_CFE) += arch/mips/fw/cfe/
  248. libs-$(CONFIG_FW_SNIPROM) += arch/mips/fw/sni/
  249. libs-y += arch/mips/fw/lib/
  250. #
  251. # Kernel compression
  252. #
  253. ifdef CONFIG_SYS_SUPPORTS_ZBOOT
  254. COMPRESSION_FNAME = vmlinuz
  255. else
  256. COMPRESSION_FNAME = vmlinux
  257. endif
  258. #
  259. # Board-dependent options and extra files
  260. #
  261. include $(srctree)/arch/mips/Kbuild.platforms
  262. ifdef CONFIG_PHYSICAL_START
  263. load-y = $(CONFIG_PHYSICAL_START)
  264. endif
  265. entry-y = $(shell $(objtree)/arch/mips/tools/elf-entry vmlinux)
  266. cflags-y += -I$(srctree)/arch/mips/include/asm/mach-generic
  267. drivers-$(CONFIG_PCI) += arch/mips/pci/
  268. #
  269. # Automatically detect the build format. By default we choose
  270. # the elf format according to the load address.
  271. # We can always force a build with a 64-bits symbol format by
  272. # passing 'KBUILD_SYM32=no' option to the make's command line.
  273. #
  274. ifdef CONFIG_64BIT
  275. ifndef KBUILD_SYM32
  276. ifeq ($(shell expr $(load-y) \< 0xffffffff80000000), 0)
  277. KBUILD_SYM32 = y
  278. endif
  279. endif
  280. ifeq ($(KBUILD_SYM32), y)
  281. cflags-$(KBUILD_SYM32) += -msym32 -DKBUILD_64BIT_SYM32
  282. else
  283. ifeq ($(CONFIG_CPU_DADDI_WORKAROUNDS), y)
  284. $(error CONFIG_CPU_DADDI_WORKAROUNDS unsupported without -msym32)
  285. endif
  286. endif
  287. endif
  288. # When linking a 32-bit executable the LLVM linker cannot cope with a
  289. # 32-bit load address that has been sign-extended to 64 bits. Simply
  290. # remove the upper 32 bits then, as it is safe to do so with other
  291. # linkers.
  292. ifdef CONFIG_64BIT
  293. load-ld = $(load-y)
  294. else
  295. load-ld = $(subst 0xffffffff,0x,$(load-y))
  296. endif
  297. KBUILD_AFLAGS += $(cflags-y)
  298. KBUILD_CFLAGS += $(cflags-y)
  299. KBUILD_CPPFLAGS += -DVMLINUX_LOAD_ADDRESS=$(load-y) -DLINKER_LOAD_ADDRESS=$(load-ld)
  300. KBUILD_CPPFLAGS += -DDATAOFFSET=$(if $(dataoffset-y),$(dataoffset-y),0)
  301. bootvars-y = VMLINUX_LOAD_ADDRESS=$(load-y) \
  302. LINKER_LOAD_ADDRESS=$(load-ld) \
  303. VMLINUX_ENTRY_ADDRESS=$(entry-y) \
  304. PLATFORM="$(platform-y)" \
  305. ITS_INPUTS="$(its-y)"
  306. ifdef CONFIG_32BIT
  307. bootvars-y += ADDR_BITS=32
  308. endif
  309. ifdef CONFIG_64BIT
  310. bootvars-y += ADDR_BITS=64
  311. endif
  312. # This is required to get dwarf unwinding tables into .debug_frame
  313. # instead of .eh_frame so we don't discard them.
  314. KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
  315. KBUILD_LDFLAGS += -m $(ld-emul)
  316. ifdef need-compiler
  317. CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \
  318. grep -E -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \
  319. sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/" -e 's/\$$/&&/g')
  320. endif
  321. OBJCOPYFLAGS += --remove-section=.reginfo
  322. libs-y += arch/mips/lib/
  323. libs-$(CONFIG_MIPS_FP_SUPPORT) += arch/mips/math-emu/
  324. drivers-y += arch/mips/crypto/
  325. # suspend and hibernation support
  326. drivers-$(CONFIG_PM) += arch/mips/power/
  327. # boot image targets (arch/mips/boot/)
  328. boot-y := vmlinux.bin
  329. boot-y += vmlinux.ecoff
  330. boot-y += vmlinux.srec
  331. boot-y += uImage
  332. boot-y += uImage.bin
  333. boot-y += uImage.bz2
  334. boot-y += uImage.gz
  335. boot-y += uImage.lzma
  336. boot-y += uImage.lzo
  337. boot-y += vmlinux.itb
  338. boot-y += vmlinux.gz.itb
  339. boot-y += vmlinux.bz2.itb
  340. boot-y += vmlinux.lzma.itb
  341. boot-y += vmlinux.lzo.itb
  342. # compressed boot image targets (arch/mips/boot/compressed/)
  343. bootz-y := vmlinuz
  344. bootz-y += vmlinuz.bin
  345. bootz-y += vmlinuz.ecoff
  346. bootz-y += vmlinuz.srec
  347. bootz-y += uzImage.bin
  348. bootz-y += vmlinuz.itb
  349. #
  350. # Some machines like the Indy need 32-bit ELF binaries for booting purposes.
  351. # Other need ECOFF, so we build a 32-bit ELF binary for them which we then
  352. # convert to ECOFF using elf2ecoff.
  353. #
  354. quiet_cmd_32 = OBJCOPY $@
  355. cmd_32 = $(OBJCOPY) -O $(32bit-bfd) $(OBJCOPYFLAGS) $< $@
  356. vmlinux.32: vmlinux
  357. $(call cmd,32)
  358. #
  359. # The 64-bit ELF tools are pretty broken so at this time we generate 64-bit
  360. # ELF files from 32-bit files by conversion.
  361. #
  362. quiet_cmd_64 = OBJCOPY $@
  363. cmd_64 = $(OBJCOPY) -O $(64bit-bfd) $(OBJCOPYFLAGS) $< $@
  364. vmlinux.64: vmlinux
  365. $(call cmd,64)
  366. all: $(all-y) $(KBUILD_DTBS)
  367. # boot
  368. $(boot-y): $(vmlinux-32) FORCE
  369. $(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) \
  370. $(bootvars-y) arch/mips/boot/$@
  371. ifdef CONFIG_SYS_SUPPORTS_ZBOOT
  372. # boot/compressed
  373. $(bootz-y): $(vmlinux-32) FORCE
  374. $(Q)$(MAKE) $(build)=arch/mips/boot/compressed \
  375. $(bootvars-y) 32bit-bfd=$(32bit-bfd) arch/mips/boot/$@
  376. else
  377. vmlinuz: FORCE
  378. @echo ' CONFIG_SYS_SUPPORTS_ZBOOT is not enabled'
  379. /bin/false
  380. endif
  381. CLEAN_FILES += vmlinux.32 vmlinux.64
  382. # device-trees
  383. core-y += arch/mips/boot/dts/
  384. archprepare:
  385. ifdef CONFIG_MIPS32_N32
  386. @$(kecho) ' Checking missing-syscalls for N32'
  387. $(Q)$(MAKE) $(build)=. missing-syscalls missing_syscalls_flags="-mabi=n32"
  388. endif
  389. ifdef CONFIG_MIPS32_O32
  390. @$(kecho) ' Checking missing-syscalls for O32'
  391. $(Q)$(MAKE) $(build)=. missing-syscalls missing_syscalls_flags="-mabi=32"
  392. endif
  393. install:
  394. $(Q)install -D -m 755 vmlinux $(INSTALL_PATH)/vmlinux-$(KERNELRELEASE)
  395. ifdef CONFIG_SYS_SUPPORTS_ZBOOT
  396. $(Q)install -D -m 755 vmlinuz $(INSTALL_PATH)/vmlinuz-$(KERNELRELEASE)
  397. endif
  398. $(Q)install -D -m 644 .config $(INSTALL_PATH)/config-$(KERNELRELEASE)
  399. $(Q)install -D -m 644 System.map $(INSTALL_PATH)/System.map-$(KERNELRELEASE)
  400. archheaders:
  401. $(Q)$(MAKE) $(build)=arch/mips/kernel/syscalls all
  402. define archhelp
  403. echo ' install - install kernel into $(INSTALL_PATH)'
  404. echo ' vmlinux.ecoff - ECOFF boot image'
  405. echo ' vmlinux.bin - Raw binary boot image'
  406. echo ' vmlinux.srec - SREC boot image'
  407. echo ' vmlinux.32 - 64-bit boot image wrapped in 32bits (IP22/IP32)'
  408. echo ' vmlinuz - Compressed boot(zboot) image'
  409. echo ' vmlinuz.ecoff - ECOFF zboot image'
  410. echo ' vmlinuz.bin - Raw binary zboot image'
  411. echo ' vmlinuz.srec - SREC zboot image'
  412. echo ' uImage - U-Boot image'
  413. echo ' uImage.bin - U-Boot image (uncompressed)'
  414. echo ' uImage.bz2 - U-Boot image (bz2)'
  415. echo ' uImage.gz - U-Boot image (gzip)'
  416. echo ' uImage.lzma - U-Boot image (lzma)'
  417. echo ' uImage.lzo - U-Boot image (lzo)'
  418. echo ' uzImage.bin - U-Boot image (self-extracting)'
  419. echo
  420. echo ' These will be default as appropriate for a configured platform.'
  421. echo
  422. echo ' If you are targeting a system supported by generic kernels you may'
  423. echo ' configure the kernel for a given architecture target like so:'
  424. echo
  425. echo ' {micro32,32,64}{r1,r2,r6}{el,}_defconfig <BOARDS="list of boards">'
  426. echo
  427. echo ' Where BOARDS is some subset of the following:'
  428. for board in $(sort $(BOARDS)); do echo " $${board}"; done
  429. echo
  430. echo ' Specifically the following generic default configurations are'
  431. echo ' supported:'
  432. echo
  433. $(foreach cfg,$(generic_defconfigs),
  434. printf " %-24s - Build generic kernel for $(call describe_generic_defconfig,$(cfg))\n" $(cfg);)
  435. echo
  436. echo ' The following legacy default configurations have been converted to'
  437. echo ' generic and can still be used:'
  438. echo
  439. $(foreach cfg,$(sort $(legacy_defconfigs)),
  440. printf " %-24s - Build $($(cfg)-y)\n" $(cfg);)
  441. echo
  442. echo ' Otherwise, the following default configurations are available:'
  443. endef
  444. generic_config_dir = $(srctree)/arch/$(ARCH)/configs/generic
  445. generic_defconfigs :=
  446. #
  447. # If the user generates a generic kernel configuration without specifying a
  448. # list of boards to include the config fragments for, default to including all
  449. # available board config fragments.
  450. #
  451. ifeq ($(BOARDS),)
  452. BOARDS = $(patsubst board-%.config,%,$(notdir $(wildcard $(generic_config_dir)/board-*.config)))
  453. endif
  454. #
  455. # Generic kernel configurations which merge generic_defconfig with the
  456. # appropriate config fragments from arch/mips/configs/generic/, resulting in
  457. # the ability to easily configure the kernel for a given architecture,
  458. # endianness & set of boards without duplicating the needed configuration in
  459. # hundreds of defconfig files.
  460. #
  461. define gen_generic_defconfigs
  462. $(foreach bits,$(1),$(foreach rev,$(2),$(foreach endian,$(3),
  463. target := $(bits)$(rev)$(filter el,$(endian))_defconfig
  464. generic_defconfigs += $$(target)
  465. $$(target): $(generic_config_dir)/$(bits)$(rev).config
  466. $$(target): $(generic_config_dir)/$(endian).config
  467. )))
  468. endef
  469. $(eval $(call gen_generic_defconfigs,32 64,r1 r2 r6,eb el))
  470. $(eval $(call gen_generic_defconfigs,micro32,r2,eb el))
  471. define describe_generic_defconfig
  472. $(subst 32r,MIPS32 r,$(subst 64r,MIPS64 r,$(subst el, little endian,$(patsubst %_defconfig,%,$(1)))))
  473. endef
  474. .PHONY: $(generic_defconfigs)
  475. $(generic_defconfigs):
  476. $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \
  477. -m -O $(objtree) $(srctree)/arch/$(ARCH)/configs/generic_defconfig $^ | \
  478. grep -Ev '^#'
  479. $(Q)cp $(KCONFIG_CONFIG) $(objtree)/.config.$@
  480. $(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig \
  481. KCONFIG_CONFIG=$(objtree)/.config.$@ >/dev/null
  482. $(Q)$(CONFIG_SHELL) $(srctree)/arch/$(ARCH)/tools/generic-board-config.sh \
  483. $(srctree) $(objtree) $(objtree)/.config.$@ $(KCONFIG_CONFIG) \
  484. "$(origin BOARDS)" $(BOARDS)
  485. $(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
  486. #
  487. # Prevent generic merge_config rules attempting to merge single fragments
  488. #
  489. $(generic_config_dir)/%.config: ;
  490. #
  491. # Prevent direct use of generic_defconfig, which is intended to be used as the
  492. # basis of the various ISA-specific targets generated above.
  493. #
  494. .PHONY: generic_defconfig
  495. generic_defconfig:
  496. $(Q)echo "generic_defconfig is not intended for direct use, but should instead be"
  497. $(Q)echo "used via an ISA-specific target from the following list:"
  498. $(Q)echo
  499. $(Q)for cfg in $(generic_defconfigs); do echo " $${cfg}"; done
  500. $(Q)echo
  501. $(Q)false
  502. #
  503. # Legacy defconfig compatibility - these targets used to be real defconfigs but
  504. # now that the boards have been converted to use the generic kernel they are
  505. # wrappers around the generic rules above.
  506. #
  507. legacy_defconfigs += ocelot_defconfig
  508. ocelot_defconfig-y := 32r2el_defconfig BOARDS=ocelot
  509. legacy_defconfigs += sead3_defconfig
  510. sead3_defconfig-y := 32r2el_defconfig BOARDS=sead-3
  511. legacy_defconfigs += sead3micro_defconfig
  512. sead3micro_defconfig-y := micro32r2el_defconfig BOARDS=sead-3
  513. legacy_defconfigs += xilfpga_defconfig
  514. xilfpga_defconfig-y := 32r2el_defconfig BOARDS=xilfpga
  515. legacy_defconfigs += pistachio_defconfig
  516. pistachio_defconfig-y := 32r2el_defconfig BOARDS=marduk
  517. .PHONY: $(legacy_defconfigs)
  518. $(legacy_defconfigs):
  519. $(Q)$(MAKE) -f $(srctree)/Makefile $($@-y)