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,28 +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_PX30) := 0x00208000
162156 ifeq ($(CONFIG_ROCKCHIP_THUNDER_BOOT),y)
157
+textofs-$(CONFIG_CPU_RV1106) := 0x00208000
163158 textofs-$(CONFIG_CPU_RV1126) := 0x00608000
164159 endif
160
+textofs-$(CONFIG_RV1106_HPMCU_FAST_WAKEUP) := 0x00208000
165161
166162 # Machine directory name. This list is sorted alphanumerically
167163 # by CONFIG_* macro name.
168164 machine-$(CONFIG_ARCH_ACTIONS) += actions
169165 machine-$(CONFIG_ARCH_ALPINE) += alpine
170166 machine-$(CONFIG_ARCH_ARTPEC) += artpec
167
+machine-$(CONFIG_ARCH_ASPEED) += aspeed
171168 machine-$(CONFIG_ARCH_AT91) += at91
172169 machine-$(CONFIG_ARCH_AXXIA) += axxia
173170 machine-$(CONFIG_ARCH_BCM) += bcm
....@@ -186,12 +183,9 @@
186183 machine-$(CONFIG_ARCH_HIGHBANK) += highbank
187184 machine-$(CONFIG_ARCH_HISI) += hisi
188185 machine-$(CONFIG_ARCH_INTEGRATOR) += integrator
189
-machine-$(CONFIG_ARCH_IOP13XX) += iop13xx
190186 machine-$(CONFIG_ARCH_IOP32X) += iop32x
191
-machine-$(CONFIG_ARCH_IOP33X) += iop33x
192187 machine-$(CONFIG_ARCH_IXP4XX) += ixp4xx
193188 machine-$(CONFIG_ARCH_KEYSTONE) += keystone
194
-machine-$(CONFIG_ARCH_KS8695) += ks8695
195189 machine-$(CONFIG_ARCH_LPC18XX) += lpc18xx
196190 machine-$(CONFIG_ARCH_LPC32XX) += lpc32xx
197191 machine-$(CONFIG_ARCH_MESON) += meson
....@@ -202,8 +196,9 @@
202196 machine-$(CONFIG_ARCH_MVEBU) += mvebu
203197 machine-$(CONFIG_ARCH_MXC) += imx
204198 machine-$(CONFIG_ARCH_MEDIATEK) += mediatek
199
+machine-$(CONFIG_ARCH_MILBEAUT) += milbeaut
205200 machine-$(CONFIG_ARCH_MXS) += mxs
206
-machine-$(CONFIG_ARCH_NETX) += netx
201
+machine-$(CONFIG_ARCH_MSTARV7) += mstar
207202 machine-$(CONFIG_ARCH_NOMADIK) += nomadik
208203 machine-$(CONFIG_ARCH_NPCM) += npcm
209204 machine-$(CONFIG_ARCH_NSPIRE) += nspire
....@@ -214,13 +209,14 @@
214209 machine-$(CONFIG_ARCH_PICOXCELL) += picoxcell
215210 machine-$(CONFIG_ARCH_PXA) += pxa
216211 machine-$(CONFIG_ARCH_QCOM) += qcom
212
+machine-$(CONFIG_ARCH_RDA) += rda
213
+machine-$(CONFIG_ARCH_REALTEK) += realtek
217214 machine-$(CONFIG_ARCH_REALVIEW) += realview
218215 ifndef CONFIG_ARM_PSCI
219216 machine-$(CONFIG_ARCH_ROCKCHIP) += rockchip
220217 endif
221218 machine-$(CONFIG_ARCH_RPC) += rpc
222
-machine-$(CONFIG_ARCH_S3C24XX) += s3c24xx
223
-machine-$(CONFIG_ARCH_S3C64XX) += s3c64xx
219
+machine-$(CONFIG_PLAT_SAMSUNG) += s3c
224220 machine-$(CONFIG_ARCH_S5PV210) += s5pv210
225221 machine-$(CONFIG_ARCH_SA1100) += sa1100
226222 machine-$(CONFIG_ARCH_RENESAS) += shmobile
....@@ -236,21 +232,15 @@
236232 machine-$(CONFIG_ARCH_VERSATILE) += versatile
237233 machine-$(CONFIG_ARCH_VEXPRESS) += vexpress
238234 machine-$(CONFIG_ARCH_VT8500) += vt8500
239
-machine-$(CONFIG_ARCH_W90X900) += w90x900
240235 machine-$(CONFIG_ARCH_ZX) += zx
241236 machine-$(CONFIG_ARCH_ZYNQ) += zynq
242237 machine-$(CONFIG_PLAT_SPEAR) += spear
243238
244239 # Platform directory name. This list is sorted alphanumerically
245240 # by CONFIG_* macro name.
246
-plat-$(CONFIG_ARCH_EXYNOS) += samsung
247241 plat-$(CONFIG_ARCH_OMAP) += omap
248
-plat-$(CONFIG_ARCH_S3C64XX) += samsung
249
-plat-$(CONFIG_ARCH_S5PV210) += samsung
250
-plat-$(CONFIG_PLAT_IOP) += iop
251242 plat-$(CONFIG_PLAT_ORION) += orion
252243 plat-$(CONFIG_PLAT_PXA) += pxa
253
-plat-$(CONFIG_PLAT_S3C24XX) += samsung
254244 plat-$(CONFIG_PLAT_VERSATILE) += versatile
255245
256246 ifeq ($(CONFIG_ARCH_EBSA110),y)
....@@ -278,36 +268,19 @@
278268
279269 ifneq ($(CONFIG_ARCH_MULTIPLATFORM),y)
280270 ifneq ($(CONFIG_ARM_SINGLE_ARMV7M),y)
281
-ifeq ($(KBUILD_SRC),)
282
-KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(machdirs) $(platdirs))
283
-else
284271 KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs) $(platdirs))
285
-endif
286272 endif
287273 endif
288274
289275 export TEXT_OFFSET GZFLAGS MMUEXT
290276
291
-# Do we have FASTFPE?
292
-FASTFPE :=arch/arm/fastfpe
293
-ifeq ($(FASTFPE),$(wildcard $(FASTFPE)))
294
-FASTFPE_OBJ :=$(FASTFPE)/
295
-endif
296
-
297
-core-$(CONFIG_FPE_NWFPE) += arch/arm/nwfpe/
298
-core-$(CONFIG_FPE_FASTFPE) += $(FASTFPE_OBJ)
299
-core-$(CONFIG_VFP) += arch/arm/vfp/
300
-core-$(CONFIG_XEN) += arch/arm/xen/
301
-core-$(CONFIG_KVM_ARM_HOST) += arch/arm/kvm/
302
-core-$(CONFIG_VDSO) += arch/arm/vdso/
303
-
277
+core-y += arch/arm/
304278 # If we have a machine-specific directory, then include it in the build.
305
-core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/
306
-core-y += arch/arm/probes/
307
-core-y += arch/arm/net/
308
-core-y += arch/arm/crypto/
309
-core-y += arch/arm/firmware/
310279 core-y += $(machdirs) $(platdirs)
280
+
281
+# For cleaning
282
+core- += $(patsubst %,arch/arm/mach-%/, $(machine-))
283
+core- += $(patsubst %,arch/arm/plat-%/, $(plat-))
311284
312285 drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/
313286
....@@ -321,12 +294,21 @@
321294 KBUILD_IMAGE := $(boot)/zImage
322295 endif
323296
324
-# Build the DT binary blobs if we have OF configured
325
-ifeq ($(CONFIG_USE_OF),y)
326
-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))
327309 endif
328310
329
-all: $(notdir $(KBUILD_IMAGE)) $(KBUILD_DTBS)
311
+all: $(notdir $(KBUILD_IMAGE))
330312
331313
332314 archheaders:
....@@ -354,17 +336,6 @@
354336 $(INSTALL_TARGETS):
355337 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
356338
357
-%.dtb: | scripts
358
- $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
359
-
360
-PHONY += dtbs dtbs_install
361
-
362
-dtbs: prepare scripts
363
- $(Q)$(MAKE) $(build)=$(boot)/dts
364
-
365
-dtbs_install:
366
- $(Q)$(MAKE) $(dtbinst)=$(boot)/dts
367
-
368339 PHONY += vdso_install
369340 vdso_install:
370341 ifeq ($(CONFIG_VDSO),y)
....@@ -386,8 +357,6 @@
386357 echo ' uImage - U-Boot wrapped zImage'
387358 echo ' bootpImage - Combined zImage and initial RAM disk'
388359 echo ' (supply initrd image via make variable INITRD=<path>)'
389
- echo '* dtbs - Build device tree blobs for enabled boards'
390
- echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'
391360 echo ' install - Install uncompressed kernel'
392361 echo ' zinstall - Install compressed kernel'
393362 echo ' uinstall - Install U-Boot wrapped compressed kernel'
....@@ -397,19 +366,14 @@
397366 echo ' vdso_install - Install unstripped vdso.so to $$(INSTALL_MOD_PATH)/vdso'
398367 endef
399368
400
-kernel.img: zImage
401
- $(Q)scripts/mkkrnlimg $(objtree)/arch/arm/boot/zImage $(objtree)/kernel.img >/dev/null
402
- @echo ' Image: kernel.img (with zImage) is ready'
403
-ifdef CONFIG_MODULES
404
- $(Q)if [ "$(srctree)" = "$(objtree)" ]; then $(MAKE) modules; fi
405
-endif
369
+MAKE_MODULES ?= y
406370
407
-ifdef CONFIG_DRM
408
-LOGO := $(notdir $(wildcard $(srctree)/logo.bmp))
409
-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
410376 endif
411
-
412
-%.img: %.dtb kernel.img $(LOGO) $(LOGO_KERNEL)
413377 $(Q)$(srctree)/scripts/mkimg --dtb $*.dtb
414378
415379 CLEAN_DIRS += out