omap3: Add basic support for 720MHz part
Subsystems (3)
PATCH 1/1 omap3: Add basic support for 720MHz part
This patch adds support for new speed enhanced parts with ARM and IVA running at 720MHz and 520MHz respectively. These parts can be probed at run-time by reading PRODID.SKUID[3:0] at 0x4830A20C [1].
This patch specifically does following:
* Detect devices capable of 720MHz.
* Add new OPP
* Ensure that OPP is conditionally enabled.
The patch was tested on OMAP3EVM.
On 720MHz capable device:
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 720000
On other devices:
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 600000
[1] http://focus.ti.com/lit/ug/spruff1d/spruff1d.pdf
--- arch/arm/mach-omap2/control.h | 7 +++++++ arch/arm/mach-omap2/id.c | 10 ++++++++++ arch/arm/mach-omap2/opp3xxx_data.c | 19 ++++++++++++++++++- arch/arm/plat-omap/include/plat/cpu.h | 2 ++ 4 files changed, 37 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/control.h +7 -0
@@ -365,6 +365,13 @@#define FEAT_NEON 0#define FEAT_NEON_NONE 1 +/* +* Product ID register +*/ +#define OMAP3_PRODID 0x020C + +#define OMAP3_SKUID_MASK 0x0f +#define OMAP3_SKUID_720MHZ 0x08#ifndef __ASSEMBLY__#ifdef CONFIG_ARCH_OMAP2PLUS
arch/arm/mach-omap2/id.c +10 -0
@@ -195,6 +195,15 @@ static void __init omap3_check_features(void)* TODO: Get additional info (where applicable) * e.g. Size of L2 cache. */ + +/* +* Does it support 720MHz? +*/ + status = (OMAP3_SKUID_MASK &read_tap_reg (OMAP3_PRODID )); + +if (status &OMAP3_SKUID_720MHZ ) { + omap3_features |=OMAP3_HAS_720MHZ ; + } }static void __init omap3_check_revision (void )
@@ -445,6 +454,7 @@ static void __init omap3_cpuinfo(void)OMAP3_SHOW_FEATURE (neon);OMAP3_SHOW_FEATURE (isp); OMAP3_SHOW_FEATURE(192mhz_clk); + OMAP3_SHOW_FEATURE(720mhz);printk (")\n" ); }
arch/arm/mach-omap2/opp3xxx_data.c +18 -1
@@ -22,6 +22,9 @@#include "omap_opp_data.h" +#define INDEX_MPU_720MHZ 5 +#define INDEX_IVA_720MHZ 14 +static struct omap_opp_def __initdata omap34xx_opp_def_list[] = {/* MPU OPP1 */ OPP_INITIALIZER ("mpu" , true,125000000 ,975000 ),
@@ -33,6 +36,8 @@ static struct omap_opp_def __initdata omap34xx_opp_def_list[] = {OPP_INITIALIZER ("mpu" , true,550000000 ,1270000 ),/* MPU OPP5 */ OPP_INITIALIZER ("mpu" , true,600000000 ,1350000 ), +/* MPU OPP6 */ + OPP_INITIALIZER("mpu", false, 720000000, 1350000),/* * L3 OPP1 - 41.5 MHz is disabled because: The voltage for that OPP is
@@ -58,6 +63,8 @@ static struct omap_opp_def __initdata omap34xx_opp_def_list[] = {OPP_INITIALIZER ("iva" , true,400000000 ,1270000 ),/* DSP OPP5 */ OPP_INITIALIZER ("iva" , true,430000000 ,1350000 ), +/* DSP OPP6 */ + OPP_INITIALIZER("iva", false, 520000000, 1350000), }; static struct omap_opp_def __initdata omap36xx_opp_def_list[] = {
@@ -98,9 +105,19 @@ static int __init omap3_opp_init(void)if (cpu_is_omap3630 ()) r =omap_init_opp_table (omap36xx_opp_def_list,ARRAY_SIZE (omap36xx_opp_def_list)); -else +else { +if (omap3_has_720mhz ()) { +pr_info ("Enabled OPP corresponding to 720MHz\n" ); + + omap34xx_opp_def_list[INDEX_MPU_720MHZ ] + .default_available = true; + omap34xx_opp_def_list[INDEX_IVA_720MHZ ] + .default_available = true; + } + r =omap_init_opp_table (omap34xx_opp_def_list,ARRAY_SIZE (omap34xx_opp_def_list)); + }return r; }
arch/arm/plat-omap/include/plat/cpu.h +2 -0
@@ -455,6 +455,7 @@ extern u32 omap3_features;#define OMAP3_HAS_ISP BIT(4)#define OMAP3_HAS_192MHZ_CLK BIT(5)#define OMAP3_HAS_IO_WAKEUP BIT(6) +#define OMAP3_HAS_720MHZ BIT(7)#define OMAP3_HAS_FEATURE (feat,flag) \ static inline unsigned int omap3_has_ ##feat(void) \
@@ -469,5 +470,6 @@ OMAP3_HAS_FEATURE(neon, NEON) OMAP3_HAS_FEATURE(isp, ISP) OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK) OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP) +OMAP3_HAS_FEATURE(720mhz, 720MHZ)#endif
Signature · 1 line
1.7.2.2
Sanjeev Premi wrote, on 01/07/2011 07:07 AM:
arch/arm/mach-omap2/opp3xxx_data.c static int __init omap3_opp_init(void) · line 115
Quoted 7 lines
arch/arm/mach-omap2/opp3xxx_data.c +7
-0+if (omap3_has_720mhz ()) { +pr_info ("Enabled OPP corresponding to 720MHz\n" ); + + omap34xx_opp_def_list[INDEX_MPU_720MHZ ] + .default_available = true; + omap34xx_opp_def_list[INDEX_IVA_720MHZ ] + .default_available = true;
for many reasons, I dont like this indexing - I am ok with most part of the patch otherwise - how about opp_enable(dev, freq) instead?
Signature · 2 lines
Regards, Nishanth Menon
Quoted 11 lines
-----Original Message-----
From: Menon, Nishanth
Sent: Friday, January 07, 2011 7:04 PM
To: Premi, Sanjeev
Cc: [email protected]
Subject: Re: [PATCH] omap3: Add basic support for 720MHz partSanjeev Premi wrote, on 01/07/2011 07:07 AM:
Review
Quoted 2 lines
(quoted diff) +2
-0+ if (omap3_has_720mhz()) { + pr_info("Enabled OPP corresponding to720MHz\n");
Quoted 8 lines
arch/arm/mach-omap2/opp3xxx_data.c static int __init omap3_opp_init(void) · line 115
Quoted 5 lines
arch/arm/mach-omap2/opp3xxx_data.c +5
-0+ + omap34xx_opp_def_list[INDEX_MPU_720MHZ ] + .default_available = true; + omap34xx_opp_def_list[INDEX_IVA_720MHZ ] + .default_available = true;for many reasons, I dont like this indexing - I am ok with most part of
the patch otherwise - how aboutopp_enable(dev, freq)instead?
I had thought about it, but opp_enable would have to be done after omap_init_opp_table(). Two factors led me to current implementation:
1) Numer of lines of code required to get same thing done one the opp table has been initialized.
2) The index definition and usage are localized in same file.
Quoted 5 lines
Signature · 3 lines
-- Regards, Nishanth Menon
Premi, Sanjeev wrote, on 01/07/2011 07:50 AM:
Quoted 20 lines
Quoted 11 lines
-----Original Message-----
From: Menon, Nishanth
Sent: Friday, January 07, 2011 7:04 PM
To: Premi, Sanjeev
Cc: [email protected]
Subject: Re: [PATCH] omap3: Add basic support for 720MHz partSanjeev Premi wrote, on 01/07/2011 07:07 AM:
Review
Quoted 2 lines
(quoted diff) +2
-0+ if (omap3_has_720mhz()) { + pr_info("Enabled OPP corresponding to720MHz\n");
Quoted 8 lines
arch/arm/mach-omap2/opp3xxx_data.c static int __init omap3_opp_init(void) · line 115
Quoted 5 lines
arch/arm/mach-omap2/opp3xxx_data.c +5
-0+ + omap34xx_opp_def_list[INDEX_MPU_720MHZ ] + .default_available = true; + omap34xx_opp_def_list[INDEX_IVA_720MHZ ] + .default_available = true;for many reasons, I dont like this indexing - I am ok with most part of
the patch otherwise - how aboutopp_enable(dev, freq)instead?
Quoted 7 lines
I had thought about it, but
opp_enablewould have to be done afteromap_init_opp_table(). Two factors led me to current implementation:1) Numer of lines of code required to get same thing done one the opp table has been initialized.
2) The index definition and usage are localized in same file.
right - i will leave it to kevin to comment - IMHO both will work, though (1) might be a little more elgant and resistant to future changes to the table (I am not sure if there would be any, but what the heck.)
Signature · 2 lines
Regards, Nishanth Menon
Quoted 4 lines · Sanjeev Premi
This patch adds support for new speed enhanced parts with ARM and IVA running at 720MHz and 520MHz respectively. These parts can be probed at run-time by reading PRODID.SKUID[3:0] at
0x4830A20C[1].
Please expand this a little to describe exactly which parts have this feature. All OMAP3? 34xx? 35xx? what about 36xx/37xx? ISTR the runtime probing for this feature is available on 35xx but not on 34xx, but a summary of this should be here.
Quoted 6 lines
This patch specifically does following:
* Detect devices capable of 720MHz.
* Add new OPP
* Ensure that OPP is conditionally enabled.The patch was tested on OMAP3EVM.
nit: Unrelated to this patch, but OMAP3EVM ethernet is still broken due to missing GPIO configuration for the network reset. This has been broken since the GPIO hwmod merge and pointed out but nobody seems to be fixing it.
Quoted 101 lines
On 720MHz capable device:
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 720000On other devices:
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 600000[1] http://focus.ti.com/lit/ug/spruff1d/spruff1d.pdf
Signed-off-by Sanjeev Premi <[email protected]>--- arch/arm/mach-omap2/control.h | 7 +++++++ arch/arm/mach-omap2/id.c | 10 ++++++++++ arch/arm/mach-omap2/opp3xxx_data.c | 19 ++++++++++++++++++- arch/arm/plat-omap/include/plat/cpu.h | 2 ++ 4 files changed, 37 insertions(+), 1 deletions(-)arch/arm/mach-omap2/control.h +7
-0@@ -365,6 +365,13 @@#define FEAT_NEON 0#define FEAT_NEON_NONE 1 +/* +* Product ID register +*/ +#define OMAP3_PRODID 0x020C + +#define OMAP3_SKUID_MASK 0x0f +#define OMAP3_SKUID_720MHZ 0x08#ifndef __ASSEMBLY__#ifdef CONFIG_ARCH_OMAP2PLUS arch/arm/mach-omap2/id.c +10
-0@@ -195,6 +195,15 @@ static void __init omap3_check_features(void)* TODO: Get additional info (where applicable) * e.g. Size of L2 cache. */ + +/* +* Does it support 720MHz? +*/ + status = (OMAP3_SKUID_MASK &read_tap_reg (OMAP3_PRODID )); + +if (status &OMAP3_SKUID_720MHZ ) { + omap3_features |=OMAP3_HAS_720MHZ ; + } }static void __init omap3_check_revision (void )@@ -445,6 +454,7 @@ static void __init omap3_cpuinfo(void)OMAP3_SHOW_FEATURE (neon);OMAP3_SHOW_FEATURE (isp); OMAP3_SHOW_FEATURE(192mhz_clk); + OMAP3_SHOW_FEATURE(720mhz);printk (")\n" ); }arch/arm/mach-omap2/opp3xxx_data.c +7
-1@@ -22,6 +22,9 @@#include "omap_opp_data.h" +#define INDEX_MPU_720MHZ 5 +#define INDEX_IVA_720MHZ 14 +static struct omap_opp_def __initdata omap34xx_opp_def_list[] = {/* MPU OPP1 */ OPP_INITIALIZER ("mpu" , true,125000000 ,975000 ),@@ -33,6 +36,8 @@ static struct omap_opp_def __initdata omap34xx_opp_def_list[] = {OPP_INITIALIZER ("mpu" , true,550000000 ,1270000 ),/* MPU OPP5 */ OPP_INITIALIZER ("mpu" , true,600000000 ,1350000 ), +/* MPU OPP6 */ + OPP_INITIALIZER("mpu", false, 720000000, 1350000),/* * L3 OPP1 - 41.5 MHz is disabled because: The voltage for that OPP is @@ -58,6 +63,8 @@ static struct omap_opp_def __initdata omap34xx_opp_def_list[] = {OPP_INITIALIZER ("iva" , true,400000000 ,1270000 ),/* DSP OPP5 */ OPP_INITIALIZER ("iva" , true,430000000 ,1350000 ), +/* DSP OPP6 */ + OPP_INITIALIZER("iva", false, 520000000, 1350000), }; static struct omap_opp_def __initdata omap36xx_opp_def_list[] = {@@ -98,9 +105,19 @@ static int __init omap3_opp_init(void)if (cpu_is_omap3630 ()) r =omap_init_opp_table (omap36xx_opp_def_list,ARRAY_SIZE (omap36xx_opp_def_list)); -else
arch/arm/mach-omap2/opp3xxx_data.c static int __init omap3_opp_init(void) · line 117
Quoted 10 lines
arch/arm/mach-omap2/opp3xxx_data.c +10
-0+else { +if (omap3_has_720mhz ()) { +pr_info ("Enabled OPP corresponding to 720MHz\n" ); + + omap34xx_opp_def_list[INDEX_MPU_720MHZ ] + .default_available = true; + omap34xx_opp_def_list[INDEX_IVA_720MHZ ] + .default_available = true; + } +
I'm with Nishanth here. Please stick to the OPP API for enabling OPPs.
First, it is future proof to internal table changes, but it also sets a better precedent for others wanting to fiddle with OPPs.
Thanks,
Kevin
Quoted 25 lines
arch/arm/mach-omap2/opp3xxx_data.c +1
-0r =omap_init_opp_table (omap34xx_opp_def_list,ARRAY_SIZE (omap34xx_opp_def_list)); + }return r; }arch/arm/plat-omap/include/plat/cpu.h +2
-0@@ -455,6 +455,7 @@ extern u32 omap3_features;#define OMAP3_HAS_ISP BIT(4)#define OMAP3_HAS_192MHZ_CLK BIT(5)#define OMAP3_HAS_IO_WAKEUP BIT(6) +#define OMAP3_HAS_720MHZ BIT(7)#define OMAP3_HAS_FEATURE (feat,flag) \ static inline unsigned int omap3_has_ ##feat(void) \@@ -469,5 +470,6 @@ OMAP3_HAS_FEATURE(neon, NEON) OMAP3_HAS_FEATURE(isp, ISP) OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK) OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP) +OMAP3_HAS_FEATURE(720mhz, 720MHZ)#endif
Quoted 15 lines
-----Original Message-----
From: Kevin Hilman [mailto:[email protected]]
Sent: Friday, January 07, 2011 10:18 PM
To: Premi, Sanjeev
Cc: [email protected]
Subject: Re: [PATCH] omap3: Add basic support for 720MHz partQuoted 4 lines · Sanjeev Premi
This patch adds support for new speed enhanced parts with ARM and IVA running at 720MHz and 520MHz respectively. These parts can be probed at run-time by reading PRODID.SKUID[3:0] at
0x4830A20C[1].
Quoted 5 lines
Please expand this a little to describe exactly which parts have this feature. All OMAP3? 34xx? 35xx? what about 36xx/37xx? ISTR the runtime probing for this feature is available on 35xx but not on 34xx, but a summary of this should be here.
[sp] Will update...
[snip]...[snip]
Quoted 7 lines
nit: Unrelated to this patch, but OMAP3EVM ethernet is still broken due to
missing GPIO configuration for the network reset. This has been broken
since the GPIO hwmod merge and pointed out but nobody seems to be fixing
it.
[sp] It is currently in works.
[snip]...[snip]
Quoted 10 lines
arch/arm/mach-omap2/opp3xxx_data.c static int __init omap3_opp_init(void) · line 117
Quoted 6 lines
arch/arm/mach-omap2/opp3xxx_data.c +6
-0+ omap34xx_opp_def_list[INDEX_MPU_720MHZ ] + .default_available = true; + omap34xx_opp_def_list[INDEX_IVA_720MHZ ] + .default_available = true; + } +I'm with Nishanth here. Please stick to the OPP API for enabling OPPs.
Quoted 4 lines
First, it is future proof to internal table changes, but it also sets a
better precedent for others wanting to fiddle with OPPs.
[sp] Okay. I will have to revert the a patch on my repo
to to get there. Will send an update patch on MON.
Quoted 3 lines
Thanks,
Kevin
[snip]...[snip]