Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Gregory CLEMENT and committed by
Thomas Bogendoerfer
80f2e4cd 263909a7

+10 -3
+1
arch/mips/Kbuild
··· 11 11 # mips object files 12 12 # The object files are linked as core-y files would be linked 13 13 14 + obj-y += generic/ 14 15 obj-y += kernel/ 15 16 obj-y += mm/ 16 17 obj-y += net/
+6
arch/mips/Kconfig
··· 109 109 config MIPS_GENERIC 110 110 bool 111 111 112 + config MACH_GENERIC_CORE 113 + bool 114 + 112 115 config MACH_INGENIC 113 116 bool 114 117 select SYS_SUPPORTS_32BIT_KERNEL ··· 148 145 select DMA_NONCOHERENT 149 146 select HAVE_PCI 150 147 select IRQ_MIPS_CPU 148 + select MACH_GENERIC_CORE 151 149 select MIPS_AUTO_PFN_OFFSET 152 150 select MIPS_CPU_SCACHE 153 151 select MIPS_GIC ··· 417 413 bool "Ingenic SoC based machines" 418 414 select MIPS_GENERIC 419 415 select MACH_INGENIC 416 + select MACH_GENERIC_CORE 420 417 select SYS_SUPPORTS_ZBOOT_UART16550 421 418 select CPU_SUPPORTS_CPUFREQ 422 419 select MIPS_EXTERNAL_TIMER ··· 604 599 config MACH_REALTEK_RTL 605 600 bool "Realtek RTL838x/RTL839x based machines" 606 601 select MIPS_GENERIC 602 + select MACH_GENERIC_CORE 607 603 select DMA_NONCOHERENT 608 604 select IRQ_MIPS_CPU 609 605 select CSRC_R4K
+3 -3
arch/mips/generic/Makefile
··· 4 4 # Author: Paul Burton <paul.burton@mips.com> 5 5 # 6 6 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 10 10 11 11 obj-$(CONFIG_YAMON_DT_SHIM) += yamon-dt.o 12 12 obj-$(CONFIG_LEGACY_BOARD_SEAD3) += board-sead3.o