forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 10ebd8556b7990499c896a550e3d416b444211e6
kernel/arch/sh/Makefile
....@@ -11,15 +11,11 @@
1111 #
1212 ifneq ($(SUBARCH),$(ARCH))
1313 ifeq ($(CROSS_COMPILE),)
14
- CROSS_COMPILE := $(call cc-cross-prefix, $(UTS_MACHINE)-linux- $(UTS_MACHINE)-linux-gnu- $(UTS_MACHINE)-unknown-linux-gnu-)
14
+ CROSS_COMPILE := $(call cc-cross-prefix, sh-linux- sh-linux-gnu- sh-unknown-linux-gnu-)
1515 endif
1616 endif
1717
18
-ifeq ($(ARCH),sh)
1918 KBUILD_DEFCONFIG := shx3_defconfig
20
-else
21
-KBUILD_DEFCONFIG := cayman_defconfig
22
-endif
2319
2420 isa-y := any
2521 isa-$(CONFIG_SH_DSP) := sh
....@@ -29,12 +25,9 @@
2925 isa-$(CONFIG_CPU_SH4) := sh4
3026 isa-$(CONFIG_CPU_SH4A) := sh4a
3127 isa-$(CONFIG_CPU_SH4AL_DSP) := sh4al
32
-isa-$(CONFIG_CPU_SH5) := shmedia
3328
34
-ifeq ($(CONFIG_SUPERH32),y)
3529 isa-$(CONFIG_SH_DSP) := $(isa-y)-dsp
3630 isa-y := $(isa-y)-up
37
-endif
3831
3932 cflags-$(CONFIG_CPU_SH2) := $(call cc-option,-m2,)
4033 cflags-$(CONFIG_CPU_J2) += $(call cc-option,-mj2,)
....@@ -47,7 +40,6 @@
4740 cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \
4841 $(call cc-option,-m4a-nofpu,)
4942 cflags-$(CONFIG_CPU_SH4AL_DSP) += $(call cc-option,-m4al,)
50
-cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,)
5143
5244 ifeq ($(cflags-y),)
5345 #
....@@ -88,7 +80,7 @@
8880 -R .stab -R .stabstr -S
8981
9082 # Give the various platforms the opportunity to set default image types
91
-defaultimage-$(CONFIG_SUPERH32) := zImage
83
+defaultimage-y := zImage
9284 defaultimage-$(CONFIG_SH_SH7785LCR) := uImage
9385 defaultimage-$(CONFIG_SH_RSK) := uImage
9486 defaultimage-$(CONFIG_SH_URQUELL) := uImage
....@@ -107,31 +99,22 @@
10799 # Choosing incompatible machines durings configuration will result in
108100 # error messages during linking.
109101 #
110
-ifdef CONFIG_SUPERH32
111102 UTS_MACHINE := sh
112
-BITS := 32
113103 LDFLAGS_vmlinux += -e _stext
114
-else
115
-UTS_MACHINE := sh64
116
-BITS := 64
117
-LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \
118
- --defsym phys_stext_shmedia=phys_stext+1 \
119
- -e phys_stext_shmedia
120
-endif
121104
122105 ifdef CONFIG_CPU_LITTLE_ENDIAN
123
-ld-bfd := elf32-$(UTS_MACHINE)-linux
106
+ld-bfd := elf32-sh-linux
124107 LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld-bfd)
125108 KBUILD_LDFLAGS += -EL
126109 else
127
-ld-bfd := elf32-$(UTS_MACHINE)big-linux
110
+ld-bfd := elf32-shbig-linux
128111 LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd)
129112 KBUILD_LDFLAGS += -EB
130113 endif
131114
132
-export ld-bfd BITS
115
+export ld-bfd
133116
134
-head-y := arch/sh/kernel/head_$(BITS).o
117
+head-y := arch/sh/kernel/head_32.o
135118
136119 core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/
137120 core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/
....@@ -156,7 +139,6 @@
156139 machdir-$(CONFIG_SH_SH4202_MICRODEV) += mach-microdev
157140 machdir-$(CONFIG_SH_LANDISK) += mach-landisk
158141 machdir-$(CONFIG_SH_LBOX_RE2) += mach-lboxre2
159
-machdir-$(CONFIG_SH_CAYMAN) += mach-cayman
160142 machdir-$(CONFIG_SH_RSK) += mach-rsk
161143
162144 ifneq ($(machdir-y),)
....@@ -185,14 +167,13 @@
185167 cpuincdir-$(CONFIG_CPU_SH3) += cpu-sh3
186168 cpuincdir-$(CONFIG_CPU_SH4A) += cpu-sh4a
187169 cpuincdir-$(CONFIG_CPU_SH4) += cpu-sh4
188
-cpuincdir-$(CONFIG_CPU_SH5) += cpu-sh5
189170 cpuincdir-y += cpu-common # Must be last
190171
191172 drivers-y += arch/sh/drivers/
192173 drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/
193174
194
-cflags-y += $(foreach d, $(cpuincdir-y), -Iarch/sh/include/$(d)) \
195
- $(foreach d, $(machdir-y), -Iarch/sh/include/$(d))
175
+cflags-y += $(foreach d, $(cpuincdir-y), -I $(srctree)/arch/sh/include/$(d)) \
176
+ $(foreach d, $(machdir-y), -I $(srctree)/arch/sh/include/$(d))
196177
197178 KBUILD_CFLAGS += -pipe $(cflags-y)
198179 KBUILD_CPPFLAGS += $(cflags-y)
....@@ -206,8 +187,7 @@
206187 KBUILD_CFLAGS += -fasynchronous-unwind-tables
207188 endif
208189
209
-libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y)
210
-libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y)
190
+libs-y := arch/sh/lib/ $(libs-y)
211191
212192 BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.xz uImage.lzo \
213193 uImage.srec uImage.bin zImage vmlinux.bin vmlinux.srec \
....@@ -228,6 +208,9 @@
228208 $(Q)$(MAKE) $(clean)=$(boot)
229209 $(Q)$(MAKE) $(clean)=arch/sh/kernel/vsyscall
230210
211
+archheaders:
212
+ $(Q)$(MAKE) $(build)=arch/sh/kernel/syscalls all
213
+
231214 define archhelp
232215 @echo ' zImage - Compressed kernel image'
233216 @echo ' romImage - Compressed ROM image, if supported'