Skip to contentSkip to conversation

ARMV7: Overo: Automatically set clock rate to maximum if mpurate env variable is "auto"

PATCH New Steve Sakoman 4 participants 4 messages Nov 6, 2010 – Nov 8, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARMV7: Overo: Automatically set clock rate to maximum if mpurate env variable is "auto"

The maximum clock rate for the OMAP3 processors on Overo depends on the processor type and revision. This patch sets the clock rate to the spec sheet maximum if the mpurate environment variable is set to "auto". Otherwise it passes the mpurate variable unchanged on the kernel command line.

---

board/overo/overo.c +16 -0
index f917e40..3c9e4a6 100644
@@ -281,6 +281,22 @@ int misc_init_r(void)
 
 	dieid_num_r();
 
+	if (strcmp(getenv("mpurate"), "auto") == 0)
+		switch (get_cpu_family()) {
+		case CPU_OMAP34XX:
+			if ((get_cpu_rev() >= CPU_3XX_ES31) &&
+			    (get_sku_id() == SKUID_CLK_720MHZ))
+				setenv("mpurate", "720");
+			else
+				setenv("mpurate", "600");
+			break;
+		case CPU_OMAP36XX:
+			setenv("mpurate", "720");
+			break;
+		default:
+			setenv("mpurate", "500");
+		}
+
 	return 0;
 }
 
include/configs/omap3_overo.h +1 -1
index 79a5b85..dbdfd9a 100644
@@ -156,7 +156,7 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"loadaddr=0x82000000\0" \
 	"console=ttyS2,115200n8\0" \
-	"mpurate=500\0" \
+	"mpurate=auto\0" \
 	"vram=12M\0" \
 	"dvimode=1024x768MR-16 at 60\0" \
 	"defaultdisplay=dvi\0" \
#1 lore raw

PATCH 1/1 ARMV7: Overo: Automatically set clock rate to maximum if mpurate env variable is "auto"

just a minor crib - $subject length is around 88 characters, it'd look better with around 50 character length.

Steve Sakoman wrote, on 11/05/2010 10:59 PM:

Quoted 41 lines

The maximum clock rate for the OMAP3 processors on Overo depends on the processor type and revision. This patch sets the clock rate to the spec sheet maximum if the mpurate environment variable is set to "auto". Otherwise it passes the mpurate variable unchanged on the kernel command line.

---

board/overo/overo.c +16 -0
index f917e40..3c9e4a6 100644
@@ -281,6 +281,22 @@ int misc_init_r(void)
 
  	dieid_num_r();
 
+	if (strcmp(getenv("mpurate"), "auto") == 0)
+		switch (get_cpu_family()) {
+		case CPU_OMAP34XX:
+			if ((get_cpu_rev()>= CPU_3XX_ES31)&&
+			    (get_sku_id() == SKUID_CLK_720MHZ))
+				setenv("mpurate", "720");
+			else
+				setenv("mpurate", "600");
+			break;
+		case CPU_OMAP36XX:
+			setenv("mpurate", "720");
+			break;
+		default:
+			setenv("mpurate", "500");
+		}
+
  	return 0;
  }
 
include/configs/omap3_overo.h +0 -0
index 79a5b85..dbdfd9a 100644

include/configs/omap3_overo.h line 162

Quoted 8 lines
include/configs/omap3_overo.h +1 -1
@@ -156,7 +156,7 @@
  #define CONFIG_EXTRA_ENV_SETTINGS \
  	"loadaddr=0x82000000\0" \
  	"console=ttyS2,115200n8\0" \
-	"mpurate=500\0" \
+	"mpurate=auto\0" \
  	"vram=12M\0" \
  	"dvimode=1024x768MR-16 at 60\0" \
  	"defaultdisplay=dvi\0" \

yep, this does look like a nice way to do it. thanks.

Signature · 2 lines
Regards,
Nishanth Menon
#2 lore raw

PATCH 1/1 ARMV7: Overo: Automatically set clock rate to maximum if mpurate env variable is "auto"

In reply to Steve Sakoman

Dear Steve Sakoman,

Quoted 5 lines · In message <1289012370.18546.66.camel@quadra> you wrote:

The maximum clock rate for the OMAP3 processors on Overo depends on the processor type and revision. This patch sets the clock rate to the spec sheet maximum if the mpurate environment variable is set to "auto". Otherwise it passes the mpurate variable unchanged on the kernel command line.

I don't think this is a good idea.

This logic does not belong into U-Boot; if anywhere, it belongs into the Linux kernel code. If I want to pass any specific value to the Linux kernel I want that U-Boot does not get in my way. And if I decide to set the mpurate to "auto" I want that U-Boot keeps this setting and does not change it silently behind my back into something else.

Both looks conceptually broken to me.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It became apparent that one reason why the Ice Giants were  known  as
the  Ice  Giants  was  because they were, well, giants. The other was
that they were made of ice.              -Terry Pratchett, _Sourcery_
#3 lore raw

PATCH 1/1 ARMV7: Overo: Automatically set clock rate to maximum if mpurate env variable is "auto"

Quoted 19 lines

-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Wolfgang Denk
Sent: Monday, November 08, 2010 3:14 AM
To: Steve Sakoman
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH] ARMV7: Overo: Automatically set clock rate to maximum if mpurate env variable is "auto"

Dear Steve Sakoman,

Quoted 1 line · In message <1289012370.18546.66.camel@quadra> you wrote:

The maximum clock rate for the OMAP3 processors on Overo

depends on the

Quoted 4 lines

processor type and revision. This patch sets the clock rate to the spec sheet maximum if the mpurate environment variable is set to "auto". Otherwise it passes the mpurate variable unchanged on the kernel command line.

Quoted 8 lines

I don't think this is a good idea.

This logic does not belong into U-Boot; if anywhere, it belongs into the Linux kernel code. If I want to pass any specific value to the Linux kernel I want that U-Boot does not get in my way. And if I decide to set the mpurate to "auto" I want that U-Boot keeps this setting and does not change it silently behind my back into something else.

[sp] I am in full agreement.
It is too difficult to find root cause for transparent changes - usually lead to long debug times first in kernel an then in u-boot.

~sanjeev

Quoted 19 lines

Both looks conceptually broken to me.

Best regards,

Wolfgang Denk

Signature · 10 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It became apparent that one reason why the Ice Giants were  known  as
the  Ice  Giants  was  because they were, well, giants. The other was
that they were made of ice.              -Terry Pratchett, _Sourcery_
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot