Patchwork Add cpu speed selection to Geode GX2 boards

login
register
about
Submitter Nils
Date 2010-11-02 21:33:44
Message ID <201011022233.44143.njacobs8@hetnet.nl>
Download mbox | patch
Permalink /patch/2231/
State Accepted
Headers show

Comments

Nils - 2010-11-02 21:33:44
This patch adds Kconfig cpu speed selection to Geode GX2 boards as requested by 
Uwe.

Signed-off-by: Nils Jacobs <njacobs8@hetnet.nl>

This is Abuild and boot tested.

Thanks, Nils.
Uwe Hermann - 2010-11-05 00:23:48
On Tue, Nov 02, 2010 at 10:33:44PM +0100, Nils wrote:
> This patch adds Kconfig cpu speed selection to Geode GX2 boards as requested by 
> Uwe.
> 
> Signed-off-by: Nils Jacobs <njacobs8@hetnet.nl>

Thanks, r6023.


Uwe.
Nils - 2010-11-05 23:51:11
Op vrijdag 5 november 2010 01:23:48 schreef u:
> On Tue, Nov 02, 2010 at 10:33:44PM +0100, Nils wrote:
> > This patch adds Kconfig cpu speed selection to Geode GX2 boards as
> > requested by Uwe.
> > 
> > Signed-off-by: Nils Jacobs <njacobs8@hetnet.nl>
> 
> Thanks, r6023.
> 
> 
> Uwe.

Thanks for the review and commit.

Nils.

Patch

Index: src/mainboard/wyse/s50/Kconfig
===================================================================
--- src/mainboard/wyse/s50/Kconfig	(revision 6011)
+++ src/mainboard/wyse/s50/Kconfig	(working copy)
@@ -29,6 +29,7 @@ 
 	select PIRQ_ROUTE
 	select BOARD_ROMSIZE_KB_256
 	select POWER_BUTTON_FORCE_DISABLE
+	select GX2_PROCESSOR_MHZ_366
 
 config MAINBOARD_DIR
 	string
Index: src/mainboard/amd/rumba/Kconfig
===================================================================
--- src/mainboard/amd/rumba/Kconfig	(revision 6011)
+++ src/mainboard/amd/rumba/Kconfig	(working copy)
@@ -28,6 +28,7 @@ 
 	select HAVE_PIRQ_TABLE
 	select BOARD_ROMSIZE_KB_256
 	select POWER_BUTTON_FORCE_ENABLE
+	select GX2_PROCESSOR_MHZ_366
 
 config MAINBOARD_DIR
 	string
Index: src/mainboard/lippert/frontrunner/Kconfig
===================================================================
--- src/mainboard/lippert/frontrunner/Kconfig	(revision 6011)
+++ src/mainboard/lippert/frontrunner/Kconfig	(working copy)
@@ -10,6 +10,7 @@ 
 	select UDELAY_TSC
 	select HAVE_PIRQ_TABLE
 	select BOARD_ROMSIZE_KB_256
+	select GX2_PROCESSOR_MHZ_366
 
 config MAINBOARD_DIR
 	string
Index: src/northbridge/amd/gx2/Kconfig
===================================================================
--- src/northbridge/amd/gx2/Kconfig	(revision 6011)
+++ src/northbridge/amd/gx2/Kconfig	(working copy)
@@ -21,9 +21,18 @@ 
 	bool
 	select GEODE_VSA
 
-# Valid PROCESSOR_MHZ options: 300/366/400 MHz.
-config PROCESSOR_MHZ
+# The GX2_PROCESSOR_MHZ options let you chose the processor speed in the mainboard/Kconfig.
+config GX2_PROCESSOR_MHZ_300
+	bool
+config GX2_PROCESSOR_MHZ_366
+	bool
+config GX2_PROCESSOR_MHZ_400
+	bool
+
+# Map the config names to an integer (Mhz).
+config GX2_PROCESSOR_MHZ
 	int
-	default 366
-	depends on NORTHBRIDGE_AMD_GX2
+	default 300 if GX2_PROCESSOR_MHZ_300
+	default 366 if GX2_PROCESSOR_MHZ_366
+	default 400 if GX2_PROCESSOR_MHZ_400
 
Index: src/northbridge/amd/gx2/pll_reset.c
===================================================================
--- src/northbridge/amd/gx2/pll_reset.c	(revision 6011)
+++ src/northbridge/amd/gx2/pll_reset.c	(working copy)
@@ -71,14 +71,14 @@ 
 	unsigned SyncBits;			/* store the sync bits in up ebx */
 	unsigned DEFAULT_FBDIV;
 
-	if (CONFIG_PROCESSOR_MHZ == 400) {
+	if (CONFIG_GX2_PROCESSOR_MHZ == 400) {
 		DEFAULT_FBDIV = 24;
-	} else if (CONFIG_PROCESSOR_MHZ == 366) {
+	} else if (CONFIG_GX2_PROCESSOR_MHZ == 366) {
 		DEFAULT_FBDIV = 22;
-	} else if (CONFIG_PROCESSOR_MHZ == 300) {
+	} else if (CONFIG_GX2_PROCESSOR_MHZ == 300) {
 		DEFAULT_FBDIV = 18;
 	} else {
-		printk(BIOS_ERR, "Unsupported PROCESSOR_MHZ setting!\n");
+		printk(BIOS_ERR, "Unsupported GX2_PROCESSOR_MHZ setting!\n");
 		post_code(POST_PLL_CPU_VER_FAIL);
 		__asm__ __volatile__("hlt\n");
 	}
@@ -195,6 +195,6 @@ 
 static unsigned int GeodeLinkSpeed(void)
 {
 	unsigned geodelinkspeed;
-	geodelinkspeed = ((CONFIG_PROCESSOR_MHZ * DEFAULT_VDIV) / DEFAULT_MDIV);
+	geodelinkspeed = ((CONFIG_GX2_PROCESSOR_MHZ * DEFAULT_VDIV) / DEFAULT_MDIV);
 	return (geodelinkspeed);
 }