Skip to content

Commit 80f2e4c

Browse files
gclementtsbogend
authored andcommitted
MIPS: Share generic kernel code with other architecture
Some architectures might seek to utilize a significant portion of the generic kernel code while maintaining independence from the generic kernel due to specific peculiarities. This patch allows for the reuse of core code, preventing unnecessary duplication. Suggested-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
1 parent 263909a commit 80f2e4c

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

arch/mips/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ obj- := $(platform-y)
1111
# mips object files
1212
# The object files are linked as core-y files would be linked
1313

14+
obj-y += generic/
1415
obj-y += kernel/
1516
obj-y += mm/
1617
obj-y += net/

arch/mips/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ config MIPS_FIXUP_BIGPHYS_ADDR
109109
config MIPS_GENERIC
110110
bool
111111

112+
config MACH_GENERIC_CORE
113+
bool
114+
112115
config MACH_INGENIC
113116
bool
114117
select SYS_SUPPORTS_32BIT_KERNEL
@@ -145,6 +148,7 @@ config MIPS_GENERIC_KERNEL
145148
select DMA_NONCOHERENT
146149
select HAVE_PCI
147150
select IRQ_MIPS_CPU
151+
select MACH_GENERIC_CORE
148152
select MIPS_AUTO_PFN_OFFSET
149153
select MIPS_CPU_SCACHE
150154
select MIPS_GIC
@@ -413,6 +417,7 @@ config MACH_INGENIC_SOC
413417
bool "Ingenic SoC based machines"
414418
select MIPS_GENERIC
415419
select MACH_INGENIC
420+
select MACH_GENERIC_CORE
416421
select SYS_SUPPORTS_ZBOOT_UART16550
417422
select CPU_SUPPORTS_CPUFREQ
418423
select MIPS_EXTERNAL_TIMER
@@ -599,6 +604,7 @@ config RALINK
599604
config MACH_REALTEK_RTL
600605
bool "Realtek RTL838x/RTL839x based machines"
601606
select MIPS_GENERIC
607+
select MACH_GENERIC_CORE
602608
select DMA_NONCOHERENT
603609
select IRQ_MIPS_CPU
604610
select CSRC_R4K

arch/mips/generic/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# Author: Paul Burton <paul.burton@mips.com>
55
#
66

7-
obj-y += init.o
8-
obj-y += irq.o
9-
obj-y += proc.o
7+
obj-$(CONFIG_MACH_GENERIC_CORE) += init.o
8+
obj-$(CONFIG_MACH_GENERIC_CORE) += irq.o
9+
obj-$(CONFIG_MACH_GENERIC_CORE) += proc.o
1010

1111
obj-$(CONFIG_YAMON_DT_SHIM) += yamon-dt.o
1212
obj-$(CONFIG_LEGACY_BOARD_SEAD3) += board-sead3.o

0 commit comments

Comments
 (0)