This patch adds support for both 4ksc and 4ksd cpus. These cpu are mainly used in embedded system such as smartcard or point of sell devices as they provide some extra security features. Signed-off-by: Franck <vagabon.xyz@xxxxxxxxx>
diff -Nurp linux-2.6.14-rc2-mipscvs/arch/mips/Kconfig linux-2.6.14-rc2-mipscvs-4KSx/arch/mips/Kconfig --- linux-2.6.14-rc2-mipscvs/arch/mips/Kconfig 2005-09-23 22:02:44.000000000 +0200 +++ linux-2.6.14-rc2-mipscvs-4KSx/arch/mips/Kconfig 2005-10-04 09:52:43.000000000 +0200 @@ -1123,6 +1123,20 @@ config CPU_SB1 select CPU_SUPPORTS_64BIT_KERNEL select CPU_SUPPORTS_HIGHMEM +config CPU_4KSC + bool "4KSC" + select CPU_SUPPORTS_32BIT_KERNEL + select CPU_HAS_PREFETCH + help + MIPS Technologies 4KSc-series processors. + +config CPU_4KSD + bool "4KSD" + select CPU_SUPPORTS_32BIT_KERNEL + select CPU_HAS_PREFETCH + help + MIPS Technologies 4KSd-series processors. + endchoice endmenu diff -Nurp linux-2.6.14-rc2-mipscvs/arch/mips/kernel/cpu-probe.c linux-2.6.14-rc2-mipscvs-4KSx/arch/mips/kernel/cpu-probe.c --- linux-2.6.14-rc2-mipscvs/arch/mips/kernel/cpu-probe.c 2005-08-16 19:50:43.000000000 +0200 +++ linux-2.6.14-rc2-mipscvs-4KSx/arch/mips/kernel/cpu-probe.c 2005-10-04 09:41:42.000000000 +0200 @@ -552,6 +552,7 @@ static inline void cpu_probe_mips(struct c->cputype = CPU_4KEC; break; case PRID_IMP_4KSC: + case PRID_IMP_4KSD: c->cputype = CPU_4KSC; break; case PRID_IMP_5KC: diff -Nurp linux-2.6.14-rc2-mipscvs/arch/mips/kernel/Makefile linux-2.6.14-rc2-mipscvs-4KSx/arch/mips/kernel/Makefile --- linux-2.6.14-rc2-mipscvs/arch/mips/kernel/Makefile 2005-09-01 22:42:46.000000000 +0200 +++ linux-2.6.14-rc2-mipscvs-4KSx/arch/mips/kernel/Makefile 2005-10-04 09:30:29.000000000 +0200 @@ -31,6 +31,8 @@ obj-$(CONFIG_CPU_SB1) += r4k_fpu.o r4k_ obj-$(CONFIG_CPU_MIPS32_R1) += r4k_fpu.o r4k_switch.o obj-$(CONFIG_CPU_MIPS64_R1) += r4k_fpu.o r4k_switch.o obj-$(CONFIG_CPU_R6000) += r6000_fpu.o r4k_switch.o +obj-$(CONFIG_CPU_4KSC) += r4k_switch.o +obj-$(CONFIG_CPU_4KSD) += r4k_switch.o obj-$(CONFIG_SMP) += smp.o diff -Nurp linux-2.6.14-rc2-mipscvs/arch/mips/lib-32/Makefile linux-2.6.14-rc2-mipscvs-4KSx/arch/mips/lib-32/Makefile --- linux-2.6.14-rc2-mipscvs/arch/mips/lib-32/Makefile 2005-07-11 12:03:27.000000000 +0200 +++ linux-2.6.14-rc2-mipscvs-4KSx/arch/mips/lib-32/Makefile 2005-10-04 09:44:09.000000000 +0200 @@ -21,5 +21,7 @@ obj-$(CONFIG_CPU_SB1) += dump_tlb.o obj-$(CONFIG_CPU_TX39XX) += r3k_dump_tlb.o obj-$(CONFIG_CPU_TX49XX) += dump_tlb.o obj-$(CONFIG_CPU_VR41XX) += dump_tlb.o +obj-$(CONFIG_CPU_4KSC) += dump_tlb.o +obj-$(CONFIG_CPU_4KSD) += dump_tlb.o EXTRA_AFLAGS := $(CFLAGS) diff -Nurp linux-2.6.14-rc2-mipscvs/arch/mips/Makefile linux-2.6.14-rc2-mipscvs-4KSx/arch/mips/Makefile --- linux-2.6.14-rc2-mipscvs/arch/mips/Makefile 2005-09-15 10:53:10.000000000 +0200 +++ linux-2.6.14-rc2-mipscvs-4KSx/arch/mips/Makefile 2005-10-04 09:25:21.000000000 +0200 @@ -237,6 +237,14 @@ cflags-$(CONFIG_CPU_R10000) += \ $(call set_gccflags,r10000,mips4,r8000,mips4,mips2) \ -Wa,--trap +cflags-$(CONFIG_CPU_4KSC) += \ + $(call set_gccflags,4kec,mips32r2,r4600,mips3,mips2) \ + -msmartmips -Wa,--trap + +cflags-$(CONFIG_CPU_4KSD) += \ + $(call set_gccflags,4kec,mips32r2,r4600,mips3,mips2) \ + -msmartmips -Wa,--trap + ifdef CONFIG_CPU_SB1 ifdef CONFIG_SB1_PASS_1_WORKAROUNDS MODFLAGS += -msb1-pass1-workarounds diff -Nurp linux-2.6.14-rc2-mipscvs/arch/mips/mm/cache.c linux-2.6.14-rc2-mipscvs-4KSx/arch/mips/mm/cache.c --- linux-2.6.14-rc2-mipscvs/arch/mips/mm/cache.c 2005-07-06 14:08:14.000000000 +0200 +++ linux-2.6.14-rc2-mipscvs-4KSx/arch/mips/mm/cache.c 2005-10-04 09:46:56.000000000 +0200 @@ -120,7 +120,8 @@ void __init cpu_cache_init(void) defined(CONFIG_CPU_NEVADA) || defined(CONFIG_CPU_R5432) || \ defined(CONFIG_CPU_R5500) || defined(CONFIG_CPU_MIPS32_R1) || \ defined(CONFIG_CPU_MIPS64_R1) || defined(CONFIG_CPU_TX49XX) || \ - defined(CONFIG_CPU_RM7000) || defined(CONFIG_CPU_RM9000) + defined(CONFIG_CPU_RM7000) || defined(CONFIG_CPU_RM9000) || \ + defined(CONFIG_CPU_4KSC) || defined(CONFIG_CPU_4KSD) ld_mmu_r4xx0(); #endif } else switch (current_cpu_data.cputype) { diff -Nurp linux-2.6.14-rc2-mipscvs/arch/mips/mm/Makefile linux-2.6.14-rc2-mipscvs-4KSx/arch/mips/mm/Makefile --- linux-2.6.14-rc2-mipscvs/arch/mips/mm/Makefile 2005-07-14 14:05:06.000000000 +0200 +++ linux-2.6.14-rc2-mipscvs-4KSx/arch/mips/mm/Makefile 2005-10-04 09:45:17.000000000 +0200 @@ -26,6 +26,8 @@ obj-$(CONFIG_CPU_SB1) += c-sb1.o cerr-s obj-$(CONFIG_CPU_TX39XX) += c-tx39.o pg-r4k.o tlb-r3k.o obj-$(CONFIG_CPU_TX49XX) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o obj-$(CONFIG_CPU_VR41XX) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o +obj-$(CONFIG_CPU_4KSC) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o +obj-$(CONFIG_CPU_4KSD) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o obj-$(CONFIG_IP22_CPU_SCACHE) += sc-ip22.o obj-$(CONFIG_R5000_CPU_SCACHE) += sc-r5k.o diff -Nurp linux-2.6.14-rc2-mipscvs/include/asm-mips/module.h linux-2.6.14-rc2-mipscvs-4KSx/include/asm-mips/module.h --- linux-2.6.14-rc2-mipscvs/include/asm-mips/module.h 2005-09-14 12:35:37.000000000 +0200 +++ linux-2.6.14-rc2-mipscvs-4KSx/include/asm-mips/module.h 2005-10-04 09:55:34.000000000 +0200 @@ -113,7 +113,11 @@ search_module_dbetables(unsigned long ad #define MODULE_PROC_FAMILY "RM9000" #elif defined CONFIG_CPU_SB1 #define MODULE_PROC_FAMILY "SB1" -#elif +#elif defined CONFIG_CPU_4KSC +#define MODULE_PROC_FAMILY "4KSC" +#elif defined CONFIG_CPU_4KSD +#define MODULE_PROC_FAMILY "4KSD" +#else #error MODULE_PROC_FAMILY undefined for your processor configuration #endif