hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/arm/Makefile
....@@ -16,10 +16,6 @@
1616 KBUILD_LDFLAGS_MODULE += --be8
1717 endif
1818
19
-ifeq ($(CONFIG_ARM_MODULE_PLTS),y)
20
-KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/arm/kernel/module.lds
21
-endif
22
-
2319 GZFLAGS :=-9
2420 #KBUILD_CFLAGS +=-pipe
2521
....@@ -45,12 +41,10 @@
4541 ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
4642 KBUILD_CPPFLAGS += -mbig-endian
4743 CHECKFLAGS += -D__ARMEB__
48
-AS += -EB
4944 KBUILD_LDFLAGS += -EB
5045 else
5146 KBUILD_CPPFLAGS += -mlittle-endian
5247 CHECKFLAGS += -D__ARMEL__
53
-AS += -EL
5448 KBUILD_LDFLAGS += -EL
5549 endif
5650
....@@ -77,7 +71,7 @@
7771 arch-$(CONFIG_CPU_32v5) =-D__LINUX_ARM_ARCH__=5 -march=armv5te
7872 arch-$(CONFIG_CPU_32v4T) =-D__LINUX_ARM_ARCH__=4 -march=armv4t
7973 arch-$(CONFIG_CPU_32v4) =-D__LINUX_ARM_ARCH__=4 -march=armv4
80
-arch-$(CONFIG_CPU_32v3) =-D__LINUX_ARM_ARCH__=3 -march=armv3
74
+arch-$(CONFIG_CPU_32v3) =-D__LINUX_ARM_ARCH__=3 -march=armv3m
8175
8276 # Evaluate arch cc-option calls now
8377 arch-y := $(arch-y)
....@@ -123,13 +117,8 @@
123117 AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)
124118
125119 ifeq ($(CONFIG_THUMB2_KERNEL),y)
126
-AFLAGS_AUTOIT :=$(call as-option,-Wa$(comma)-mimplicit-it=always,-Wa$(comma)-mauto-it)
127
-CFLAGS_ISA :=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN)
120
+CFLAGS_ISA :=-mthumb -Wa,-mimplicit-it=always $(AFLAGS_NOWARN)
128121 AFLAGS_ISA :=$(CFLAGS_ISA) -Wa$(comma)-mthumb
129
-# Work around buggy relocation from gas if requested:
130
-ifeq ($(CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11),y)
131
-KBUILD_CFLAGS_MODULE +=-fno-optimize-sibling-calls
132
-endif
133122 else
134123 CFLAGS_ISA :=$(call cc-option,-marm,) $(AFLAGS_NOWARN)
135124 AFLAGS_ISA :=$(CFLAGS_ISA)
....@@ -146,29 +135,36 @@
146135
147136 # Text offset. This list is sorted numerically by address in order to
148137 # provide a means to avoid/resolve conflicts in multi-arch kernels.
138
+# Note: the 32kB below this value is reserved for use by the kernel
139
+# during boot, and this offset is critical to the functioning of
140
+# kexec-tools.
149141 textofs-y := 0x00008000
150142 # We don't want the htc bootloader to corrupt kernel during resume
151143 textofs-$(CONFIG_PM_H1940) := 0x00108000
144
+# RTD1195 has Boot ROM at start of address space
145
+textofs-$(CONFIG_ARCH_REALTEK) := 0x00108000
152146 # SA1111 DMA bug: we don't want the kernel to live in precious DMA-able memory
153147 ifeq ($(CONFIG_ARCH_SA1100),y)
154148 textofs-$(CONFIG_SA1111) := 0x00208000
155149 endif
150
+textofs-$(CONFIG_ARCH_IPQ40XX) := 0x00208000
156151 textofs-$(CONFIG_ARCH_MSM8X60) := 0x00208000
157152 textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000
158153 textofs-$(CONFIG_ARCH_MESON) := 0x00208000
159154 textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000
160155 textofs-$(CONFIG_CPU_RK3308) := 0x00058000
161
-textofs-$(CONFIG_CPU_RK3528) := 0x00208000
162
-textofs-$(CONFIG_CPU_PX30) := 0x00208000
163156 ifeq ($(CONFIG_ROCKCHIP_THUNDER_BOOT),y)
157
+textofs-$(CONFIG_CPU_RV1106) := 0x00208000
164158 textofs-$(CONFIG_CPU_RV1126) := 0x00608000
165159 endif
160
+textofs-$(CONFIG_RV1106_HPMCU_FAST_WAKEUP) := 0x00208000
166161
167162 # Machine directory name. This list is sorted alphanumerically
168163 # by CONFIG_* macro name.
169164 machine-$(CONFIG_ARCH_ACTIONS) += actions
170165 machine-$(CONFIG_ARCH_ALPINE) += alpine
171166 machine-$(CONFIG_ARCH_ARTPEC) += artpec
167
+machine-$(CONFIG_ARCH_ASPEED) += aspeed
172168 machine-$(CONFIG_ARCH_AT91) += at91
173169 machine-$(CONFIG_ARCH_AXXIA) += axxia
174170 machine-$(CONFIG_ARCH_BCM) += bcm
....@@ -187,12 +183,9 @@
187183 machine-$(CONFIG_ARCH_HIGHBANK) += highbank
188184 machine-$(CONFIG_ARCH_HISI) += hisi
189185 machine-$(CONFIG_ARCH_INTEGRATOR) += integrator
190
-machine-$(CONFIG_ARCH_IOP13XX) += iop13xx
191186 machine-$(CONFIG_ARCH_IOP32X) += iop32x
192
-machine-$(CONFIG_ARCH_IOP33X) += iop33x
193187 machine-$(CONFIG_ARCH_IXP4XX) += ixp4xx
194188 machine-$(CONFIG_ARCH_KEYSTONE) += keystone
195
-machine-$(CONFIG_ARCH_KS8695) += ks8695
196189 machine-$(CONFIG_ARCH_LPC18XX) += lpc18xx
197190 machine-$(CONFIG_ARCH_LPC32XX) += lpc32xx
198191 machine-$(CONFIG_ARCH_MESON) += meson
....@@ -203,8 +196,9 @@
203196 machine-$(CONFIG_ARCH_MVEBU) += mvebu
204197 machine-$(CONFIG_ARCH_MXC) += imx
205198 machine-$(CONFIG_ARCH_MEDIATEK) += mediatek
199
+machine-$(CONFIG_ARCH_MILBEAUT) += milbeaut
206200 machine-$(CONFIG_ARCH_MXS) += mxs
207
-machine-$(CONFIG_ARCH_NETX) += netx
201
+machine-$(CONFIG_ARCH_MSTARV7) += mstar
208202 machine-$(CONFIG_ARCH_NOMADIK) += nomadik
209203 machine-$(CONFIG_ARCH_NPCM) += npcm
210204 machine-$(CONFIG_ARCH_NSPIRE) += nspire
....@@ -215,13 +209,14 @@
215209 machine-$(CONFIG_ARCH_PICOXCELL) += picoxcell
216210 machine-$(CONFIG_ARCH_PXA) += pxa
217211 machine-$(CONFIG_ARCH_QCOM) += qcom
212
+machine-$(CONFIG_ARCH_RDA) += rda
213
+machine-$(CONFIG_ARCH_REALTEK) += realtek
218214 machine-$(CONFIG_ARCH_REALVIEW) += realview
219215 ifndef CONFIG_ARM_PSCI
220216 machine-$(CONFIG_ARCH_ROCKCHIP) += rockchip
221217 endif
222218 machine-$(CONFIG_ARCH_RPC) += rpc
223
-machine-$(CONFIG_ARCH_S3C24XX) += s3c24xx
224
-machine-$(CONFIG_ARCH_S3C64XX) += s3c64xx
219
+machine-$(CONFIG_PLAT_SAMSUNG) += s3c
225220 machine-$(CONFIG_ARCH_S5PV210) += s5pv210
226221 machine-$(CONFIG_ARCH_SA1100) += sa1100
227222 machine-$(CONFIG_ARCH_RENESAS) += shmobile
....@@ -237,21 +232,15 @@
237232 machine-$(CONFIG_ARCH_VERSATILE) += versatile
238233 machine-$(CONFIG_ARCH_VEXPRESS) += vexpress
239234 machine-$(CONFIG_ARCH_VT8500) += vt8500
240
-machine-$(CONFIG_ARCH_W90X900) += w90x900
241235 machine-$(CONFIG_ARCH_ZX) += zx
242236 machine-$(CONFIG_ARCH_ZYNQ) += zynq
243237 machine-$(CONFIG_PLAT_SPEAR) += spear
244238
245239 # Platform directory name. This list is sorted alphanumerically
246240 # by CONFIG_* macro name.
247
-plat-$(CONFIG_ARCH_EXYNOS) += samsung
248241 plat-$(CONFIG_ARCH_OMAP) += omap
249
-plat-$(CONFIG_ARCH_S3C64XX) += samsung
250
-plat-$(CONFIG_ARCH_S5PV210) += samsung
251
-plat-$(CONFIG_PLAT_IOP) += iop
252242 plat-$(CONFIG_PLAT_ORION) += orion
253243 plat-$(CONFIG_PLAT_PXA) += pxa
254
-plat-$(CONFIG_PLAT_S3C24XX) += samsung
255244 plat-$(CONFIG_PLAT_VERSATILE) += versatile
256245
257246 ifeq ($(CONFIG_ARCH_EBSA110),y)
....@@ -279,36 +268,19 @@
279268
280269 ifneq ($(CONFIG_ARCH_MULTIPLATFORM),y)
281270 ifneq ($(CONFIG_ARM_SINGLE_ARMV7M),y)
282
-ifeq ($(KBUILD_SRC),)
283
-KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(machdirs) $(platdirs))
284
-else
285271 KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs) $(platdirs))
286
-endif
287272 endif
288273 endif
289274
290275 export TEXT_OFFSET GZFLAGS MMUEXT
291276
292
-# Do we have FASTFPE?
293
-FASTFPE :=arch/arm/fastfpe
294
-ifeq ($(FASTFPE),$(wildcard $(FASTFPE)))
295
-FASTFPE_OBJ :=$(FASTFPE)/
296
-endif
297
-
298
-core-$(CONFIG_FPE_NWFPE) += arch/arm/nwfpe/
299
-core-$(CONFIG_FPE_FASTFPE) += $(FASTFPE_OBJ)
300
-core-$(CONFIG_VFP) += arch/arm/vfp/
301
-core-$(CONFIG_XEN) += arch/arm/xen/
302
-core-$(CONFIG_KVM_ARM_HOST) += arch/arm/kvm/
303
-core-$(CONFIG_VDSO) += arch/arm/vdso/
304
-
277
+core-y += arch/arm/
305278 # If we have a machine-specific directory, then include it in the build.
306
-core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/
307
-core-y += arch/arm/probes/
308
-core-y += arch/arm/net/
309
-core-y += arch/arm/crypto/
310
-core-y += arch/arm/firmware/
311279 core-y += $(machdirs) $(platdirs)
280
+
281
+# For cleaning
282
+core- += $(patsubst %,arch/arm/mach-%/, $(machine-))
283
+core- += $(patsubst %,arch/arm/plat-%/, $(plat-))
312284
313285 drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/
314286
....@@ -322,12 +294,21 @@
322294 KBUILD_IMAGE := $(boot)/zImage
323295 endif
324296
325
-# Build the DT binary blobs if we have OF configured
326
-ifeq ($(CONFIG_USE_OF),y)
327
-KBUILD_DTBS := dtbs
297
+ifeq ($(CONFIG_STACKPROTECTOR_PER_TASK),y)
298
+prepare: stack_protector_prepare
299
+stack_protector_prepare: prepare0
300
+ $(eval SSP_PLUGIN_CFLAGS := \
301
+ -fplugin-arg-arm_ssp_per_task_plugin-tso=$(shell \
302
+ awk '{if ($$2 == "THREAD_SZ_ORDER") print $$3;}'\
303
+ include/generated/asm-offsets.h) \
304
+ -fplugin-arg-arm_ssp_per_task_plugin-offset=$(shell \
305
+ awk '{if ($$2 == "TI_STACK_CANARY") print $$3;}'\
306
+ include/generated/asm-offsets.h))
307
+ $(eval KBUILD_CFLAGS += $(SSP_PLUGIN_CFLAGS))
308
+ $(eval GCC_PLUGINS_CFLAGS += $(SSP_PLUGIN_CFLAGS))
328309 endif
329310
330
-all: $(notdir $(KBUILD_IMAGE)) $(KBUILD_DTBS)
311
+all: $(notdir $(KBUILD_IMAGE))
331312
332313
333314 archheaders:
....@@ -355,17 +336,6 @@
355336 $(INSTALL_TARGETS):
356337 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
357338
358
-%.dtb: | scripts
359
- $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
360
-
361
-PHONY += dtbs dtbs_install
362
-
363
-dtbs: prepare scripts
364
- $(Q)$(MAKE) $(build)=$(boot)/dts
365
-
366
-dtbs_install:
367
- $(Q)$(MAKE) $(dtbinst)=$(boot)/dts
368
-
369339 PHONY += vdso_install
370340 vdso_install:
371341 ifeq ($(CONFIG_VDSO),y)
....@@ -387,8 +357,6 @@
387357 echo ' uImage - U-Boot wrapped zImage'
388358 echo ' bootpImage - Combined zImage and initial RAM disk'
389359 echo ' (supply initrd image via make variable INITRD=<path>)'
390
- echo '* dtbs - Build device tree blobs for enabled boards'
391
- echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'
392360 echo ' install - Install uncompressed kernel'
393361 echo ' zinstall - Install compressed kernel'
394362 echo ' uinstall - Install U-Boot wrapped compressed kernel'
....@@ -398,19 +366,14 @@
398366 echo ' vdso_install - Install unstripped vdso.so to $$(INSTALL_MOD_PATH)/vdso'
399367 endef
400368
401
-kernel.img: zImage
402
- $(Q)scripts/mkkrnlimg $(objtree)/arch/arm/boot/zImage $(objtree)/kernel.img >/dev/null
403
- @echo ' Image: kernel.img (with zImage) is ready'
404
-ifdef CONFIG_MODULES
405
- $(Q)if [ "$(srctree)" = "$(objtree)" ]; then $(MAKE) modules; fi
406
-endif
369
+MAKE_MODULES ?= y
407370
408
-ifdef CONFIG_DRM
409
-LOGO := $(notdir $(wildcard $(srctree)/logo.bmp))
410
-LOGO_KERNEL := $(notdir $(wildcard $(srctree)/logo_kernel.bmp))
371
+%.img:
372
+ifeq ("$(CONFIG_MODULES)$(MAKE_MODULES)$(srctree)","yy$(objtree)")
373
+ $(Q)$(MAKE) $*.dtb zImage Image.gz modules
374
+else
375
+ $(Q)$(MAKE) $*.dtb zImage Image.gz
411376 endif
412
-
413
-%.img: %.dtb kernel.img $(LOGO) $(LOGO_KERNEL)
414377 $(Q)$(srctree)/scripts/mkimg --dtb $*.dtb
415378
416379 CLEAN_DIRS += out