Skip to contentSkip to conversation

OMAP3: Beagle: enable 800MHz for xm

PATCH Superseded Nishanth Menon 5 participants 15 messages Jan 5, 2011 – Feb 1, 2011

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover OMAP3: Beagle: enable 800MHz for xm

Source: git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git
branch: omap-for-linus (dc69d1a omap2: Make OMAP2PLUS select OMAP_DM_TIMER)

Nishanth Menon (2):
omap3|4: opp: make omapx_opp_init non-static
OMAP3: beagle xm: enable upto 800MHz OPP

 arch/arm/mach-omap2/board-omap3beagle.c |   52 +++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/opp3xxx_data.c      |    3 +-
 arch/arm/mach-omap2/opp4xxx_data.c      |    3 +-
 3 files changed, 56 insertions(+), 2 deletions(-)

Tested: Beagle XM with Angstrom

Regards,
Nishanth Menon

#1 lore raw

PATCH 1/2 omap3|4: opp: make omapx_opp_init non-static

omap3 and omap4 opp_init should be made non-static to allow for platform specific opp table tweaking. making these static conflicts with the definition in pm.h(global) as well. we include pm.h as well to ensure that there are no such prototype conflicts with actual implementation in the future.

---
 arch/arm/mach-omap2/opp3xxx_data.c |    3 ++-
 arch/arm/mach-omap2/opp4xxx_data.c |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/opp3xxx_data.c +2 -1
index 0486fce..fd3a1af 100644
@@ -21,6 +21,7 @@
 #include <plat/cpu.h>
 
 #include "omap_opp_data.h"
+#include "pm.h"
 
 static struct omap_opp_def __initdata omap34xx_opp_def_list[] = {
 	/* MPU OPP1 */
@@ -88,7 +89,7 @@ static struct omap_opp_def __initdata omap36xx_opp_def_list[] = {
 /**
  * omap3_opp_init() - initialize omap3 opp table
  */
-static int __init omap3_opp_init(void)
+int __init omap3_opp_init(void)
 {
 	int r = -ENODEV;
 
arch/arm/mach-omap2/opp4xxx_data.c +2 -1
index a11fa56..f0e9939 100644
@@ -22,6 +22,7 @@
 #include <plat/cpu.h>
 
 #include "omap_opp_data.h"
+#include "pm.h"
 
 static struct omap_opp_def __initdata omap44xx_opp_def_list[] = {
 	/* MPU OPP1 - OPP50 */
@@ -42,7 +43,7 @@ static struct omap_opp_def __initdata omap44xx_opp_def_list[] = {
 /**
  * omap4_opp_init() - initialize omap4 opp table
  */
-static int __init omap4_opp_init(void)
+int __init omap4_opp_init(void)
 {
 	int r = -ENODEV;
 
Signature · 1 line
1.6.3.3
#2 lore raw

PATCH 1/2 omap3|4: opp: make omapx_opp_init non-static

Quoted 7 lines · Nishanth Menon

omap3 and omap4 opp_init should be made non-static to allow for platform specific opp table tweaking. making these static conflicts with the definition in pm.h(global) as well. we include pm.h as well to ensure that there are no such prototype conflicts with actual implementation in the future.

Thanks, queuing for 2.6.39 (branch: for_2.6.39/pm-misc)

Kevin

Quoted 46 lines
---
 arch/arm/mach-omap2/opp3xxx_data.c |    3 ++-
 arch/arm/mach-omap2/opp4xxx_data.c |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/opp3xxx_data.c +2 -1
index 0486fce..fd3a1af 100644
@@ -21,6 +21,7 @@
 #include <plat/cpu.h>
 
 #include "omap_opp_data.h"
+#include "pm.h"
 
 static struct omap_opp_def __initdata omap34xx_opp_def_list[] = {
 	/* MPU OPP1 */
@@ -88,7 +89,7 @@ static struct omap_opp_def __initdata omap36xx_opp_def_list[] = {
 /**
  * omap3_opp_init() - initialize omap3 opp table
  */
-static int __init omap3_opp_init(void)
+int __init omap3_opp_init(void)
 {
 	int r = -ENODEV;
 
arch/arm/mach-omap2/opp4xxx_data.c +2 -1
index a11fa56..f0e9939 100644
@@ -22,6 +22,7 @@
 #include <plat/cpu.h>
 
 #include "omap_opp_data.h"
+#include "pm.h"
 
 static struct omap_opp_def __initdata omap44xx_opp_def_list[] = {
 	/* MPU OPP1 - OPP50 */
@@ -42,7 +43,7 @@ static struct omap_opp_def __initdata omap44xx_opp_def_list[] = {
 /**
  * omap4_opp_init() - initialize omap4 opp table
  */
-static int __init omap4_opp_init(void)
+int __init omap4_opp_init(void)
 {
 	int r = -ENODEV;
#3 lore raw

PATCH 2/2 OMAP3: beagle xm: enable upto 800MHz OPP

In reply to Nishanth Menon

Beagle XM uses 3730 and the board design allows enabling 800MHz and 1GHz OPPs. However, We need Smart reflex class 1.5 and ABB to enable 1GHz safely. For the moment, we tweak the default table to allow for 800Mhz OPP usage.

---
 arch/arm/mach-omap2/board-omap3beagle.c |   50 +++++++++++++++++++++++++++++++
 1 files changed, 50 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-omap3beagle.c +50 -0
index 6c12760..0b99b80 100644
@@ -23,6 +23,7 @@
 #include <linux/gpio.h>
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
+#include <linux/opp.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
@@ -44,10 +45,12 @@
 #include <plat/gpmc.h>
 #include <plat/nand.h>
 #include <plat/usb.h>
+#include <plat/omap_device.h>
 
 #include "mux.h"
 #include "hsmmc.h"
 #include "timer-gp.h"
+#include "pm.h"
 
 #define NAND_BLOCK_SIZE		SZ_128K
 
@@ -556,6 +559,52 @@ static struct omap_musb_board_data musb_board_data = {
 	.power			= 100,
 };
 
+static void __init beagle_opp_init(void)
+{
+	int r = 0;
+
+	/* Initialize the omap3 opp table */
+	if (omap3_opp_init()) {
+		pr_err("%s: opp default init failed\n", __func__);
+		return;
+	}
+
+	/* Custom OPP enabled for XM */
+	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
+		struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
+		struct omap_hwmod *dh = omap_hwmod_lookup("iva");
+		struct device *dev;
+
+		if (!mh || !dh) {
+			pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
+				__func__, mh, dh);
+			r = -EINVAL;
+		} else {
+			/* Enable MPU 1GHz and lower opps */
+			dev = &mh->od->pdev.dev;
+			r = opp_enable(dev, 800000000);
+			/* TODO: MPU 1GHz needs SR and ABB */
+
+			/* Enable IVA 800MHz and lower opps */
+			dev = &dh->od->pdev.dev;
+			r |= opp_enable(dev, 660000000);
+			/* TODO: DSP 800MHz needs SR and ABB */
+		}
+		if (r) {
+			pr_err("%s: failed to enable higher opp %d\n",
+				__func__, r);
+			/*
+			 * Cleanup - disable the higher freqs - we dont care
+			 * about the results
+			 */
+			dev = &mh->od->pdev.dev;
+			opp_disable(dev, 800000000);
+			dev = &dh->od->pdev.dev;
+			opp_disable(dev, 660000000);
+		}
+	}
+}
+
 static void __init omap3_beagle_init(void)
 {
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -579,6 +628,7 @@ static void __init omap3_beagle_init(void)
 	omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
 
 	beagle_display_init();
+	beagle_opp_init();
 }
 
 MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
Signature · 1 line
1.6.3.3
#4 lore raw

PATCH 2/2 OMAP3: beagle xm: enable upto 800MHz OPP

Quoted 3 lines · Nishanth Menon

Beagle XM uses 3730 and the board design allows enabling 800MHz and 1GHz OPPs. However, We need Smart reflex class 1.5 and ABB to enable 1GHz safely. For the moment, we tweak the default table to allow for 800Mhz OPP usage.

Isn't this common to any board using 3730 (or 3630?)

IOW, what is Beagle specific about this?

Kevin

Quoted 94 lines
---
 arch/arm/mach-omap2/board-omap3beagle.c |   50 +++++++++++++++++++++++++++++++
 1 files changed, 50 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-omap3beagle.c +50 -0
index 6c12760..0b99b80 100644
@@ -23,6 +23,7 @@
 #include <linux/gpio.h>
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
+#include <linux/opp.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
@@ -44,10 +45,12 @@
 #include <plat/gpmc.h>
 #include <plat/nand.h>
 #include <plat/usb.h>
+#include <plat/omap_device.h>
 
 #include "mux.h"
 #include "hsmmc.h"
 #include "timer-gp.h"
+#include "pm.h"
 
 #define NAND_BLOCK_SIZE		SZ_128K
 
@@ -556,6 +559,52 @@ static struct omap_musb_board_data musb_board_data = {
 	.power			= 100,
 };
 
+static void __init beagle_opp_init(void)
+{
+	int r = 0;
+
+	/* Initialize the omap3 opp table */
+	if (omap3_opp_init()) {
+		pr_err("%s: opp default init failed\n", __func__);
+		return;
+	}
+
+	/* Custom OPP enabled for XM */
+	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
+		struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
+		struct omap_hwmod *dh = omap_hwmod_lookup("iva");
+		struct device *dev;
+
+		if (!mh || !dh) {
+			pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
+				__func__, mh, dh);
+			r = -EINVAL;
+		} else {
+			/* Enable MPU 1GHz and lower opps */
+			dev = &mh->od->pdev.dev;
+			r = opp_enable(dev, 800000000);
+			/* TODO: MPU 1GHz needs SR and ABB */
+
+			/* Enable IVA 800MHz and lower opps */
+			dev = &dh->od->pdev.dev;
+			r |= opp_enable(dev, 660000000);
+			/* TODO: DSP 800MHz needs SR and ABB */
+		}
+		if (r) {
+			pr_err("%s: failed to enable higher opp %d\n",
+				__func__, r);
+			/*
+			 * Cleanup - disable the higher freqs - we dont care
+			 * about the results
+			 */
+			dev = &mh->od->pdev.dev;
+			opp_disable(dev, 800000000);
+			dev = &dh->od->pdev.dev;
+			opp_disable(dev, 660000000);
+		}
+	}
+}
+
 static void __init omap3_beagle_init(void)
 {
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -579,6 +628,7 @@ static void __init omap3_beagle_init(void)
 	omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
 
 	beagle_display_init();
+	beagle_opp_init();
 }
 
 MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
#5 lore raw

PATCH 2/2 OMAP3: beagle xm: enable upto 800MHz OPP

Kevin Hilman wrote, on 01/05/2011 05:28 PM:

Quoted 7 lines
Quoted 3 lines · Nishanth Menon

Beagle XM uses 3730 and the board design allows enabling 800MHz and 1GHz OPPs. However, We need Smart reflex class 1.5 and ABB to enable 1GHz safely. For the moment, we tweak the default table to allow for 800Mhz OPP usage.

Isn't this common to any board using 3730 (or 3630?)

no it is not. only certain boards are capable of higher frequencies - there is a procedure called PDN analysis and vmin search that needs to be performed to guarentee this.

Quoted 2 lines

IOW, what is Beagle specific about this?

beagle is one of the boards capable of higher frequencies.

Quoted 97 lines

Kevin

Quoted 94 lines
---
  arch/arm/mach-omap2/board-omap3beagle.c |   50 +++++++++++++++++++++++++++++++
  1 files changed, 50 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-omap3beagle.c +50 -0
index 6c12760..0b99b80 100644
@@ -23,6 +23,7 @@
  #include<linux/gpio.h>
  #include<linux/input.h>
  #include<linux/gpio_keys.h>
+#include<linux/opp.h>
 
  #include<linux/mtd/mtd.h>
  #include<linux/mtd/partitions.h>
@@ -44,10 +45,12 @@
  #include<plat/gpmc.h>
  #include<plat/nand.h>
  #include<plat/usb.h>
+#include<plat/omap_device.h>
 
  #include "mux.h"
  #include "hsmmc.h"
  #include "timer-gp.h"
+#include "pm.h"
 
  #define NAND_BLOCK_SIZE		SZ_128K
 
@@ -556,6 +559,52 @@ static struct omap_musb_board_data musb_board_data = {
  	.power			= 100,
  };
 
+static void __init beagle_opp_init(void)
+{
+	int r = 0;
+
+	/* Initialize the omap3 opp table */
+	if (omap3_opp_init()) {
+		pr_err("%s: opp default init failed\n", __func__);
+		return;
+	}
+
+	/* Custom OPP enabled for XM */
+	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
+		struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
+		struct omap_hwmod *dh = omap_hwmod_lookup("iva");
+		struct device *dev;
+
+		if (!mh || !dh) {
+			pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
+				__func__, mh, dh);
+			r = -EINVAL;
+		} else {
+			/* Enable MPU 1GHz and lower opps */
+			dev =&mh->od->pdev.dev;
+			r = opp_enable(dev, 800000000);
+			/* TODO: MPU 1GHz needs SR and ABB */
+
+			/* Enable IVA 800MHz and lower opps */
+			dev =&dh->od->pdev.dev;
+			r |= opp_enable(dev, 660000000);
+			/* TODO: DSP 800MHz needs SR and ABB */
+		}
+		if (r) {
+			pr_err("%s: failed to enable higher opp %d\n",
+				__func__, r);
+			/*
+			 * Cleanup - disable the higher freqs - we dont care
+			 * about the results
+			 */
+			dev =&mh->od->pdev.dev;
+			opp_disable(dev, 800000000);
+			dev =&dh->od->pdev.dev;
+			opp_disable(dev, 660000000);
+		}
+	}
+}
+
  static void __init omap3_beagle_init(void)
  {
  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -579,6 +628,7 @@ static void __init omap3_beagle_init(void)
  	omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
 
  	beagle_display_init();
+	beagle_opp_init();
  }
 
  MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
Signature · 2 lines
Regards,
Nishanth Menon
#6 lore raw

PATCH 2/2 OMAP3: beagle xm: enable upto 800MHz OPP

Op 6 jan 2011, om 13:24 heeft Nishanth Menon het volgende geschreven:

Quoted 10 lines

Kevin Hilman wrote, on 01/05/2011 05:28 PM:

Quoted 7 lines
Quoted 3 lines · Nishanth Menon

Beagle XM uses 3730 and the board design allows enabling 800MHz and 1GHz OPPs. However, We need Smart reflex class 1.5 and ABB to enable 1GHz safely. For the moment, we tweak the default table to allow for 800Mhz OPP usage.

Isn't this common to any board using 3730 (or 3630?)

no it is not. only certain boards are capable of higher frequencies - there is a procedure called PDN analysis and vmin search that needs to be performed to guarentee this.

What about the "new" 3530s that can run at 720MHz? Those have been speed binned and given a different SKU. I'm using the attached 4 patches (Tony master + beagle patches _+ dvfs: http://dominion.thruhere.net/git/cgit.cgi/linux-omap/log/?h=koen/beagle-next) on my beagle C4 and overo tide to get 720MHz. They don't really work:

root at usrp-e1xx:~# cpufreq-set -f 720000

[  104.976318] platform iva.0: omap_voltage_scale: Already at the requestedrate 430000000
[  104.986236] platform mpu.0: omap_voltage_scale: Already at the requestedrate 600000000
[  104.996032] platform iva.0: omap_voltage_scale: Already at the requestedrate 430000000
[  105.006408] platform mpu.0: omap_voltage_scale: Already at the requestedrate 600000000

But:

root at usrp-e1xx:~# dmesg | grep 720

[    0.000000] OMAP3430/3530 ES3.1 (l2cache iva sgx neon isp 720mhz )
[    0.000000] Kernel command line: console=ttyO2,115200n8 mpurate=720 vram=16M mem=99M at 0x80000000 mem=384M at 0x88000000 omapfb.mode=dvi:1024x768MR-24 at 60 omapfb.vram=0:8M,1:4M,2:4M omapdss.def_disp=dvi root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait
[    0.000000] overo_opp_init: 720MHz MPU OPPs enabled!
[    0.000000] Switched to new clocking rate (Crystal/Core/MPU): 26.0/224/720 MHz

root at usrp-e1xx:~# cpufreq-info
cpufrequtils 006: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq at vger.kernel.org, please.
analyzing CPU 0:
driver: omap
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 300 us.
hardware limits: 125 MHz - 720 MHz
available frequency steps: 125 MHz, 250 MHz, 500 MHz, 550 MHz, 600 MHz, 720 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance current policy: frequency should be within 125 MHz and 720 MHz.
The governor "userspace" may decide which speed to use
within this range.
current CPU frequency is 600 MHz (asserted by call to hardware).
cpufreq stats: 125 MHz:0.00%, 250 MHz:0.00%, 500 MHz:0.00%, 550 MHz:0.00%, 600 MHz:100.00%, 720 MHz:0.00% (1)

So how do I "properly" get 720MHz on those parts?

regards,

Koen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-omap3-add-support-for-720MHz-MPU-OPP.patch
Type: application/octet-stream
Size: 1377 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110106/47da5059/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-OMAP35x-Add-support-for-720MHz-part.patch
Type: application/octet-stream
Size: 2710 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110106/47da5059/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-OMAP3-beagle-C4-enable-upto-720MHz-OPP.patch
Type: application/octet-stream
Size: 1881 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110106/47da5059/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-OMAP3-Overo-Tide-enable-upto-720MHz-OPP.patch
Type: application/octet-stream
Size: 2720 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110106/47da5059/attachment-0003.obj>

#7 lore raw

PATCH 2/2 OMAP3: beagle xm: enable upto 800MHz OPP

Koen Kooi had written, on 01/06/2011 07:00 AM, the following:

Quoted 5 lines

Op 6 jan 2011, om 13:24 heeft Nishanth Menon het volgende geschreven:

Quoted 3 lines

Kevin Hilman wrote, on 01/05/2011 05:28 PM:

Quoted 2 lines

Nishanth Menon<[email protected]> writes:

Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
Quoted 3 lines

Beagle XM uses 3730 and the board design allows enabling 800MHz and 1GHz OPPs. However, We need Smart reflex class 1.5 and ABB to enable 1GHz safely. For the moment, we tweak the default table to allow for 800Mhz OPP usage.

Isn't this common to any board using 3730 (or 3630?)

no it is not. only certain boards are capable of higher frequencies - there is a procedure called PDN analysis and vmin search that needs to be performed to guarentee this.

What about the "new" 3530s that can run at 720MHz? Those have been speed binned and given a different SKU. I'm using the attached 4 patches (Tony master + beagle patches _+ dvfs: http://dominion.thruhere.net/git/cgit.cgi/linux-omap/log/?h=koen/beagle-next) on my beagle C4 and overo tide to get 720MHz. They don't really work:

for 3530, keep in mind that not *all* boards can support 720MHz (esp the old 3430 boards, like my poor SDP3430).
since we consider 3530 as 3430 as well, add a default disabled 720MHz OPP in the 3430 table and enable it:
a) if this has anything to do with board behavior (which, unlike 36xx, I dont think is the case for 35xx), enable similar to this patch on the required boards on a need basis (e.g. based on board rev)
b) if this is a silicon behavior, then, you should modify the omap3_opp_init to ensure that for the right silicon this is enabled (e.g. only for 3530 rev X onwards or something similar) - but you will need some way to detect it in s/w (not through bootargs please!)

Quoted 6 lines

root at usrp-e1xx:~# cpufreq-set -f 720000

[  104.976318] platform iva.0: omap_voltage_scale: Already at the requestedrate 430000000
[  104.986236] platform mpu.0: omap_voltage_scale: Already at the requestedrate 600000000
[  104.996032] platform iva.0: omap_voltage_scale: Already at the requestedrate 430000000
[  105.006408] platform mpu.0: omap_voltage_scale: Already at the requestedrate 600000000

This is coz we dont have 720MHz and max enabled freq is 600MHz so it falls back to that freq.

Quoted 27 lines

But:

root at usrp-e1xx:~# dmesg | grep 720

[    0.000000] OMAP3430/3530 ES3.1 (l2cache iva sgx neon isp 720mhz )
[    0.000000] Kernel command line: console=ttyO2,115200n8 mpurate=720 vram=16M mem=99M at 0x80000000 mem=384M at 0x88000000 omapfb.mode=dvi:1024x768MR-24 at 60 omapfb.vram=0:8M,1:4M,2:4M omapdss.def_disp=dvi root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait
[    0.000000] overo_opp_init: 720MHz MPU OPPs enabled!
[    0.000000] Switched to new clocking rate (Crystal/Core/MPU): 26.0/224/720 MHz

root at usrp-e1xx:~# cpufreq-info
cpufrequtils 006: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq at vger.kernel.org, please.
analyzing CPU 0:
driver: omap
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 300 us.
hardware limits: 125 MHz - 720 MHz
available frequency steps: 125 MHz, 250 MHz, 500 MHz, 550 MHz, 600 MHz, 720 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance current policy: frequency should be within 125 MHz and 720 MHz.
The governor "userspace" may decide which speed to use
within this range.
current CPU frequency is 600 MHz (asserted by call to hardware).
cpufreq stats: 125 MHz:0.00%, 250 MHz:0.00%, 500 MHz:0.00%, 550 MHz:0.00%, 600 MHz:100.00%, 720 MHz:0.00% (1)

Quoted 1 line

So how do I "properly" get 720MHz on those parts?

as discussed above.

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

PATCH 2/2 OMAP3: beagle xm: enable upto 800MHz OPP

Quoted 38 lines

-----Original Message-----
From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-owner at vger.kernel.org] On Behalf Of Menon, Nishanth
Sent: Thursday, January 06, 2011 7:15 PM
To: Koen Kooi
Cc: Hilman, Kevin; l-o; l-a; Tony
Subject: Re: [PATCH 2/2] OMAP3: beagle xm: enable upto 800MHz OPP

Koen Kooi had written, on 01/06/2011 07:00 AM, the following:

Quoted 1 line

Op 6 jan 2011, om 13:24 heeft Nishanth Menon het volgende

geschreven:

Quoted 5 lines
Quoted 5 lines

Kevin Hilman wrote, on 01/05/2011 05:28 PM:

Quoted 3 lines
Quoted 1 line · Nishanth Menon

Beagle XM uses 3730 and the board design allows enabling

800MHz and 1GHz

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

OPPs. However, We need Smart reflex class 1.5 and ABB to

enable 1GHz safely.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

For the moment, we tweak the default table to allow for

800Mhz OPP usage.

Quoted 2 lines
Quoted 2 lines
Quoted 1 line

Isn't this common to any board using 3730 (or 3630?)

no it is not. only certain boards are capable of higher

frequencies - there is a procedure called PDN analysis and vmin search that needs to be performed to guarentee this.

Quoted 2 lines

What about the "new" 3530s that can run at 720MHz? Those

have been speed binned and given a different SKU. I'm using the attached 4 patches (Tony master + beagle patches _+ dvfs:
http://dominion.thruhere.net/git/cgit.cgi/linux-omap/log/?h=ko
en/beagle-next) on my beagle C4 and overo tide to get 720MHz. They don't really work:
for 3530, keep in mind that not *all* boards can support 720MHz (esp the
old 3430 boards, like my poor SDP3430).
since we consider 3530 as 3430 as well, add a default disabled 720MHz OPP in the 3430 table and enable it:
a) if this has anything to do with board behavior (which,

Quoted 8 lines

unlike 36xx, I
dont think is the case for 35xx), enable similar to this patch on the required boards on a need basis (e.g. based on board rev)
b) if this is a silicon behavior, then, you should modify the omap3_opp_init to ensure that for the right silicon this is enabled (e.g. only for 3530 rev X onwards or something similar) - but you will
need some way to detect it in s/w (not through bootargs please!)

Nishanth,

Some of the patches generic that Koen attached are based on my submissions. As part of migration to 2.6.37, I am in process of validating them on internal integration tree. Will post them soon... may be end of tomorrow.

I will be testing them on OMAP3EVM.

~sanjeev

[snip]...[snip]

#9 lore raw

PATCH 2/2 OMAP3: beagle xm: enable upto 800MHz OPP

Premi, Sanjeev had written, on 01/06/2011 07:58 AM, the following:
[..]

Quoted 6 lines

Some of the patches generic that Koen attached are based on my submissions. As part of migration to 2.6.37, I am in process of validating them on internal integration tree. Will post them soon... may be end of tomorrow.

I will be testing them on OMAP3EVM.

Sure. please do post them to l-o and cc l-a - I suppose until then, they are unofficial if they are lying around in some private tree(even if viewable over internet ;) ).

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

PATCH 2/2 OMAP3: beagle xm: enable upto 800MHz OPP

Quoted 15 lines

-----Original Message-----
From: Menon, Nishanth
Sent: Thursday, January 06, 2011 7:31 PM
To: Premi, Sanjeev
Cc: Koen Kooi; Hilman, Kevin; l-o; l-a; Tony
Subject: Re: [PATCH 2/2] OMAP3: beagle xm: enable upto 800MHz OPP

Premi, Sanjeev had written, on 01/06/2011 07:58 AM, the following:
[..]

Quoted 5 lines

Some of the patches generic that Koen attached are based on my submissions. As part of migration to 2.6.37, I am in process of validating them on internal integration tree. Will post them soon... may be end of tomorrow.

Quoted 5 lines
Quoted 1 line

I will be testing them on OMAP3EVM.

Sure. please do post them to l-o and cc l-a - I suppose until then, they
are unofficial if they are lying around in some private tree(even if viewable over internet ;) ).

That's what I meant by submitting :)

My plans were tomorrow/MON - wasn't expecting this thread to happen!!

~sanjeev

Quoted 5 lines
Signature · 3 lines
-- 
Regards,
Nishanth Menon
#11 lore raw

PATCH 2/2 OMAP3: beagle xm: enable upto 800MHz OPP

In reply to Nishanth Menon

Op 6 jan 2011, om 14:44 heeft Nishanth Menon het volgende geschreven:

Quoted 5 lines

Koen Kooi had written, on 01/06/2011 07:00 AM, the following:

Quoted 4 lines

Op 6 jan 2011, om 13:24 heeft Nishanth Menon het volgende geschreven:

Quoted 3 lines

Kevin Hilman wrote, on 01/05/2011 05:28 PM:

Quoted 2 lines

Nishanth Menon<[email protected]> writes:

Quoted 7 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines
Quoted 3 lines

Beagle XM uses 3730 and the board design allows enabling 800MHz and 1GHz OPPs. However, We need Smart reflex class 1.5 and ABB to enable 1GHz safely. For the moment, we tweak the default table to allow for 800Mhz OPP usage.

Isn't this common to any board using 3730 (or 3630?)

no it is not. only certain boards are capable of higher frequencies - there is a procedure called PDN analysis and vmin search that needs to be performed to guarentee this.

What about the "new" 3530s that can run at 720MHz? Those have been speed binned and given a different SKU. I'm using the attached 4 patches (Tony master + beagle patches _+ dvfs: http://dominion.thruhere.net/git/cgit.cgi/linux-omap/log/?h=koen/beagle-next) on my beagle C4 and overo tide to get 720MHz. They don't really work:

for 3530, keep in mind that not *all* boards can support 720MHz (esp the old 3430 boards, like my poor SDP3430).

Right, that's why it's a different SKU and we can probe for it, see the 0002 patch I attached.

Quoted 1 line

since we consider 3530 as 3430 as well, add a default disabled 720MHz OPP in the 3430 table

That's what 0001 does :)

Quoted 2 lines

and enable it:
a) if this has anything to do with board behavior (which, unlike 36xx, I dont think is the case for 35xx), enable similar to this patch on the required boards on a need basis (e.g. based on board rev)

That's what 0003 and 0004 are doing for overo and beagle

Quoted 1 line

b) if this is a silicon behavior, then, you should modify the omap3_opp_init to ensure that for the right silicon this is enabled (e.g. only for 3530 rev X onwards or something similar) - but you will need some way to detect it in s/w (not through bootargs please!)

See 0002, it does it as an omap feature.

Quoted 7 lines
Quoted 6 lines

root at usrp-e1xx:~# cpufreq-set -f 720000

[  104.976318] platform iva.0: omap_voltage_scale: Already at the requestedrate 430000000
[  104.986236] platform mpu.0: omap_voltage_scale: Already at the requestedrate 600000000
[  104.996032] platform iva.0: omap_voltage_scale: Already at the requestedrate 430000000
[  105.006408] platform mpu.0: omap_voltage_scale: Already at the requestedrate 600000000

This is coz we dont have 720MHz and max enabled freq is 600MHz so it falls back to that freq.

Even after 0001 adds it to the table and 0004 enables it?

regards,

Koen

#12 lore raw

PATCH 2/2 OMAP3: beagle xm: enable upto 800MHz OPP

Koen Kooi had written, on 01/06/2011 08:01 AM, the following:

Quoted 10 lines

Op 6 jan 2011, om 14:44 heeft Nishanth Menon het volgende geschreven:

Quoted 8 lines

Koen Kooi had written, on 01/06/2011 07:00 AM, the following:

Quoted 7 lines

Op 6 jan 2011, om 13:24 heeft Nishanth Menon het volgende geschreven:

Quoted 6 lines

Kevin Hilman wrote, on 01/05/2011 05:28 PM:

Quoted 5 lines
Quoted 3 lines · Nishanth Menon

Beagle XM uses 3730 and the board design allows enabling 800MHz and 1GHz OPPs. However, We need Smart reflex class 1.5 and ABB to enable 1GHz safely. For the moment, we tweak the default table to allow for 800Mhz OPP usage.

Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
Quoted 2 lines
Quoted 1 line

Isn't this common to any board using 3730 (or 3630?)

no it is not. only certain boards are capable of higher frequencies - there is a procedure called PDN analysis and vmin search that needs to be performed to guarentee this.

What about the "new" 3530s that can run at 720MHz? Those have been speed binned and given a different SKU. I'm using the attached 4 patches (Tony master + beagle patches _+ dvfs: http://dominion.thruhere.net/git/cgit.cgi/linux-omap/log/?h=koen/beagle-next) on my beagle C4 and overo tide to get 720MHz. They don't really work:

for 3530, keep in mind that not *all* boards can support 720MHz (esp the old 3430 boards, like my poor SDP3430).

Right, that's why it's a different SKU and we can probe for it, see the 0002 patch I attached.

please discuss with Sanjeev on patch ownership and post required series using git send-email :)

Quoted 8 lines
Quoted 1 line

since we consider 3530 as 3430 as well, add a default disabled 720MHz OPP in the 3430 table

That's what 0001 does :)

Quoted 2 lines

and enable it:
a) if this has anything to do with board behavior (which, unlike 36xx, I dont think is the case for 35xx), enable similar to this patch on the required boards on a need basis (e.g. based on board rev)

That's what 0003 and 0004 are doing for overo and beagle

then it is wrong. see below

Quoted 4 lines
Quoted 2 lines

b) if this is a silicon behavior, then, you should modify the omap3_opp_init to ensure that for the right silicon this is enabled (e.g. only for 3530 rev X onwards or something similar) - but you will need some way to detect it in s/w (not through bootargs please!)

See 0002, it does it as an omap feature.

if it is OMAP feature, you should be doing this in omap3_opp_init instead of each and every board file! (basically patches 3 and 4 are wrong!).

Quoted 9 lines
Quoted 7 lines
Quoted 6 lines

root at usrp-e1xx:~# cpufreq-set -f 720000

[  104.976318] platform iva.0: omap_voltage_scale: Already at the requestedrate 430000000
[  104.986236] platform mpu.0: omap_voltage_scale: Already at the requestedrate 600000000
[  104.996032] platform iva.0: omap_voltage_scale: Already at the requestedrate 430000000
[  105.006408] platform mpu.0: omap_voltage_scale: Already at the requestedrate 600000000

This is coz we dont have 720MHz and max enabled freq is 600MHz so it falls back to that freq.

Even after 0001 adds it to the table and 0004 enables it?

a) have you checked if the clock framework has the required bits?
b) voltage layer maintains it's own voltage table as well (surprise :D).. so you need to add to that as well!
see the secret table in arch/arm/mach-omap2/voltage.c - I prefer all voltage and frequency information to be in a centralized location to prevent mess like this from happening, but sorry we gotta merge these two tables at some point ahead IMHO, we are not there yet.

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

PATCH 2/2 OMAP3: beagle xm: enable upto 800MHz OPP

In reply to Nishanth Menon

Hi,

Quoted 31 lines · Nishanth Menon
arch/arm/mach-omap2/board-omap3beagle.c +31 -0
+static void __init beagle_opp_init(void)
+{
+	int r = 0;
+
+	/* Initialize the omap3 opp table */
+	if (omap3_opp_init()) {
+		pr_err("%s: opp default init failed\n", __func__);
+		return;
+	}
+
+	/* Custom OPP enabled for XM */
+	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
+		struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
+		struct omap_hwmod *dh = omap_hwmod_lookup("iva");
+		struct device *dev;
+
+		if (!mh || !dh) {
+			pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
+				__func__, mh, dh);
+			r = -EINVAL;
+		} else {
+			/* Enable MPU 1GHz and lower opps */
+			dev = &mh->od->pdev.dev;
+			r = opp_enable(dev, 800000000);
+			/* TODO: MPU 1GHz needs SR and ABB */
+
+			/* Enable IVA 800MHz and lower opps */
+			dev = &dh->od->pdev.dev;
+			r |= opp_enable(dev, 660000000);
+			/* TODO: DSP 800MHz needs SR and ABB */
+		}

arch/arm/mach-omap2/board-omap3beagle.c static struct omap_musb_board_data musb_board_data = { · line 602

Quoted 10 lines
arch/arm/mach-omap2/board-omap3beagle.c +10 -0
+		if (r) {
+			pr_err("%s: failed to enable higher opp %d\n",
+				__func__, r);
+			/*
+			 * Cleanup - disable the higher freqs - we dont care
+			 * about the results
+			 */
+			dev = &mh->od->pdev.dev;
+			opp_disable(dev, 800000000);
+			dev = &dh->od->pdev.dev;

This branch will be reached also when !mh || !dh, so it won't work.

arch/arm/mach-omap2/board-omap3beagle.c static struct omap_musb_board_data musb_board_data = { · line 606

Quoted 4 lines
arch/arm/mach-omap2/board-omap3beagle.c +4 -0
+			opp_disable(dev, 660000000);
+		}
+	}
+}

A.

#14 lore raw

PATCH 2/2 OMAP3: beagle xm: enable upto 800MHz OPP

Aaro Koskinen wrote, on 01/07/2011 07:04 AM:

Quoted 36 lines · Nishanth Menon
Quoted 35 lines
arch/arm/mach-omap2/board-omap3beagle.c +35 -0
+static void __init beagle_opp_init(void)
+{
+ int r = 0;
+
+ /* Initialize the omap3 opp table */
+ if (omap3_opp_init()) {
+ pr_err("%s: opp default init failed\n", __func__);
+ return;
+ }
+
+ /* Custom OPP enabled for XM */
+ if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
+ struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
+ struct omap_hwmod *dh = omap_hwmod_lookup("iva");
+ struct device *dev;
+
+ if (!mh || !dh) {
+ pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
+ __func__, mh, dh);
+ r = -EINVAL;
+ } else {
+ /* Enable MPU 1GHz and lower opps */
+ dev = &mh->od->pdev.dev;
+ r = opp_enable(dev, 800000000);
+ /* TODO: MPU 1GHz needs SR and ABB */
+
+ /* Enable IVA 800MHz and lower opps */
+ dev = &dh->od->pdev.dev;
+ r |= opp_enable(dev, 660000000);
+ /* TODO: DSP 800MHz needs SR and ABB */
+ }
+ if (r) {
+ pr_err("%s: failed to enable higher opp %d\n",
+ __func__, r);
+ /*
Quoted 8 lines
Quoted 6 lines

+ * Cleanup - disable the higher freqs - we dont care
+ * about the results
+ */
+ dev = &mh->od->pdev.dev;
+ opp_disable(dev, 800000000);
+ dev = &dh->od->pdev.dev;

This branch will be reached also when !mh || !dh, so it won't work.

arrgh.. thanks for catching it - will fix and repost.

Signature · 2 lines
Regards,
Nishanth Menon