forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
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,20 +135,26 @@
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
165160
....@@ -168,6 +163,7 @@
168163 machine-$(CONFIG_ARCH_ACTIONS) += actions
169164 machine-$(CONFIG_ARCH_ALPINE) += alpine
170165 machine-$(CONFIG_ARCH_ARTPEC) += artpec
166
+machine-$(CONFIG_ARCH_ASPEED) += aspeed
171167 machine-$(CONFIG_ARCH_AT91) += at91
172168 machine-$(CONFIG_ARCH_AXXIA) += axxia
173169 machine-$(CONFIG_ARCH_BCM) += bcm
....@@ -186,12 +182,9 @@
186182 machine-$(CONFIG_ARCH_HIGHBANK) += highbank
187183 machine-$(CONFIG_ARCH_HISI) += hisi
188184 machine-$(CONFIG_ARCH_INTEGRATOR) += integrator
189
-machine-$(CONFIG_ARCH_IOP13XX) += iop13xx
190185 machine-$(CONFIG_ARCH_IOP32X) += iop32x
191
-machine-$(CONFIG_ARCH_IOP33X) += iop33x
192186 machine-$(CONFIG_ARCH_IXP4XX) += ixp4xx
193187 machine-$(CONFIG_ARCH_KEYSTONE) += keystone
194
-machine-$(CONFIG_ARCH_KS8695) += ks8695
195188 machine-$(CONFIG_ARCH_LPC18XX) += lpc18xx
196189 machine-$(CONFIG_ARCH_LPC32XX) += lpc32xx
197190 machine-$(CONFIG_ARCH_MESON) += meson
....@@ -202,8 +195,9 @@
202195 machine-$(CONFIG_ARCH_MVEBU) += mvebu
203196 machine-$(CONFIG_ARCH_MXC) += imx
204197 machine-$(CONFIG_ARCH_MEDIATEK) += mediatek
198
+machine-$(CONFIG_ARCH_MILBEAUT) += milbeaut
205199 machine-$(CONFIG_ARCH_MXS) += mxs
206
-machine-$(CONFIG_ARCH_NETX) += netx
200
+machine-$(CONFIG_ARCH_MSTARV7) += mstar
207201 machine-$(CONFIG_ARCH_NOMADIK) += nomadik
208202 machine-$(CONFIG_ARCH_NPCM) += npcm
209203 machine-$(CONFIG_ARCH_NSPIRE) += nspire
....@@ -214,13 +208,14 @@
214208 machine-$(CONFIG_ARCH_PICOXCELL) += picoxcell
215209 machine-$(CONFIG_ARCH_PXA) += pxa
216210 machine-$(CONFIG_ARCH_QCOM) += qcom
211
+machine-$(CONFIG_ARCH_RDA) += rda
212
+machine-$(CONFIG_ARCH_REALTEK) += realtek
217213 machine-$(CONFIG_ARCH_REALVIEW) += realview
218214 ifndef CONFIG_ARM_PSCI
219215 machine-$(CONFIG_ARCH_ROCKCHIP) += rockchip
220216 endif
221217 machine-$(CONFIG_ARCH_RPC) += rpc
222
-machine-$(CONFIG_ARCH_S3C24XX) += s3c24xx
223
-machine-$(CONFIG_ARCH_S3C64XX) += s3c64xx
218
+machine-$(CONFIG_PLAT_SAMSUNG) += s3c
224219 machine-$(CONFIG_ARCH_S5PV210) += s5pv210
225220 machine-$(CONFIG_ARCH_SA1100) += sa1100
226221 machine-$(CONFIG_ARCH_RENESAS) += shmobile
....@@ -236,21 +231,15 @@
236231 machine-$(CONFIG_ARCH_VERSATILE) += versatile
237232 machine-$(CONFIG_ARCH_VEXPRESS) += vexpress
238233 machine-$(CONFIG_ARCH_VT8500) += vt8500
239
-machine-$(CONFIG_ARCH_W90X900) += w90x900
240234 machine-$(CONFIG_ARCH_ZX) += zx
241235 machine-$(CONFIG_ARCH_ZYNQ) += zynq
242236 machine-$(CONFIG_PLAT_SPEAR) += spear
243237
244238 # Platform directory name. This list is sorted alphanumerically
245239 # by CONFIG_* macro name.
246
-plat-$(CONFIG_ARCH_EXYNOS) += samsung
247240 plat-$(CONFIG_ARCH_OMAP) += omap
248
-plat-$(CONFIG_ARCH_S3C64XX) += samsung
249
-plat-$(CONFIG_ARCH_S5PV210) += samsung
250
-plat-$(CONFIG_PLAT_IOP) += iop
251241 plat-$(CONFIG_PLAT_ORION) += orion
252242 plat-$(CONFIG_PLAT_PXA) += pxa
253
-plat-$(CONFIG_PLAT_S3C24XX) += samsung
254243 plat-$(CONFIG_PLAT_VERSATILE) += versatile
255244
256245 ifeq ($(CONFIG_ARCH_EBSA110),y)
....@@ -278,36 +267,19 @@
278267
279268 ifneq ($(CONFIG_ARCH_MULTIPLATFORM),y)
280269 ifneq ($(CONFIG_ARM_SINGLE_ARMV7M),y)
281
-ifeq ($(KBUILD_SRC),)
282
-KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(machdirs) $(platdirs))
283
-else
284270 KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs) $(platdirs))
285
-endif
286271 endif
287272 endif
288273
289274 export TEXT_OFFSET GZFLAGS MMUEXT
290275
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
-
276
+core-y += arch/arm/
304277 # 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/
310278 core-y += $(machdirs) $(platdirs)
279
+
280
+# For cleaning
281
+core- += $(patsubst %,arch/arm/mach-%/, $(machine-))
282
+core- += $(patsubst %,arch/arm/plat-%/, $(plat-))
311283
312284 drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/
313285
....@@ -321,12 +293,21 @@
321293 KBUILD_IMAGE := $(boot)/zImage
322294 endif
323295
324
-# Build the DT binary blobs if we have OF configured
325
-ifeq ($(CONFIG_USE_OF),y)
326
-KBUILD_DTBS := dtbs
296
+ifeq ($(CONFIG_STACKPROTECTOR_PER_TASK),y)
297
+prepare: stack_protector_prepare
298
+stack_protector_prepare: prepare0
299
+ $(eval SSP_PLUGIN_CFLAGS := \
300
+ -fplugin-arg-arm_ssp_per_task_plugin-tso=$(shell \
301
+ awk '{if ($$2 == "THREAD_SZ_ORDER") print $$3;}'\
302
+ include/generated/asm-offsets.h) \
303
+ -fplugin-arg-arm_ssp_per_task_plugin-offset=$(shell \
304
+ awk '{if ($$2 == "TI_STACK_CANARY") print $$3;}'\
305
+ include/generated/asm-offsets.h))
306
+ $(eval KBUILD_CFLAGS += $(SSP_PLUGIN_CFLAGS))
307
+ $(eval GCC_PLUGINS_CFLAGS += $(SSP_PLUGIN_CFLAGS))
327308 endif
328309
329
-all: $(notdir $(KBUILD_IMAGE)) $(KBUILD_DTBS)
310
+all: $(notdir $(KBUILD_IMAGE))
330311
331312
332313 archheaders:
....@@ -354,17 +335,6 @@
354335 $(INSTALL_TARGETS):
355336 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
356337
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
-
368338 PHONY += vdso_install
369339 vdso_install:
370340 ifeq ($(CONFIG_VDSO),y)
....@@ -386,8 +356,6 @@
386356 echo ' uImage - U-Boot wrapped zImage'
387357 echo ' bootpImage - Combined zImage and initial RAM disk'
388358 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)'
391359 echo ' install - Install uncompressed kernel'
392360 echo ' zinstall - Install compressed kernel'
393361 echo ' uinstall - Install U-Boot wrapped compressed kernel'
....@@ -397,19 +365,14 @@
397365 echo ' vdso_install - Install unstripped vdso.so to $$(INSTALL_MOD_PATH)/vdso'
398366 endef
399367
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
368
+MAKE_MODULES ?= y
406369
407
-ifdef CONFIG_DRM
408
-LOGO := $(notdir $(wildcard $(srctree)/logo.bmp))
409
-LOGO_KERNEL := $(notdir $(wildcard $(srctree)/logo_kernel.bmp))
370
+%.img:
371
+ifeq ("$(CONFIG_MODULES)$(MAKE_MODULES)$(srctree)","yy$(objtree)")
372
+ $(Q)$(MAKE) $*.dtb zImage Image.gz modules
373
+else
374
+ $(Q)$(MAKE) $*.dtb zImage Image.gz
410375 endif
411
-
412
-%.img: %.dtb kernel.img $(LOGO) $(LOGO_KERNEL)
413376 $(Q)$(srctree)/scripts/mkimg --dtb $*.dtb
414377
415378 CLEAN_DIRS += out