Skip to contentSkip to conversation

powerpc: add kernel parameter to set l3cr for MPC745x

PATCH New Robert Brose 1 participant 1 message Mar 28, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: add kernel parameter to set l3cr for MPC745x

Sorry for the resend, the list software stripped my text attachment.

Old-world powermacs don't set L2CR or L3CR on processor upgrade cards. This simple patch allows the setting of L3CR via a kernel parameter (like the existing kernel parameter to set L2CR).

This is the first time I've posted a patch, please excuse me if I've broken protocol or done this improperly in any way.

arch/powerpc/kernel/setup_32.c renamed from arch/powerpc/kernel/setup_32.c.orig +12 -0
@@ -172,6 +172,18 @@ int __init ppc_setup_l2cr(char *str)
 }
 __setup("l2cr=", ppc_setup_l2cr);
 
+/* Checks "l3cr=xxxx" command-line option */
+int __init ppc_setup_l3cr(char *str)
+{
+	if (cpu_has_feature(CPU_FTR_L3CR)) {
+		unsigned long val = simple_strtoul(str, NULL, 0);
+		printk(KERN_INFO "l3cr set to %lx\n", val);
+		_set_L3CR(val);		/* and enable it */
+	}
+	return 1;
+}
+__setup("l3cr=", ppc_setup_l3cr);
+
 #ifdef CONFIG_GENERIC_NVRAM
 
 /* Generic nvram hooks used by drivers/char/gen_nvram.c */
Documentation/kernel-parameters.txt renamed from Documentation/kernel-parameters.txt.orig +2 -0
@@ -877,6 +877,8 @@ and is between 256 and 4096 characters. 
 
 	l2cr=		[PPC]
 
+	l3cr=		[PPC]
+
 	lapic		[X86-32,APIC] Enable the local APIC even if BIOS
 			disabled it.