* [PATCH] OMAP35x: Add support for 720MHz part
@ 2009-10-12 12:44 Sanjeev Premi
2009-10-13 15:51 ` Tony Lindgren
2009-10-13 19:14 ` Kevin Hilman
0 siblings, 2 replies; 3+ messages in thread
From: Sanjeev Premi @ 2009-10-12 12:44 UTC (permalink / raw)
To: linux-omap; +Cc: Sanjeev Premi
This patch adds support for ARM running at 720MHz part.
The 720MHz capability can be probed run-time by reading the
PRODID.SKUID[3:0] at 0x4830A20C.
[1] http://focus.ti.com/lit/ug/spruff1d/spruff1d.pdf
Signed-off-by: Sanjeev Premi <premi@ti.com>
---
arch/arm/mach-omap2/clock34xx.c | 6 ++++++
arch/arm/mach-omap2/id.c | 11 +++++++++++
arch/arm/plat-omap/include/mach/control.h | 7 +++++++
arch/arm/plat-omap/include/mach/cpu.h | 2 ++
4 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index 489556e..9b56af3 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -1096,6 +1096,12 @@ static int __init omap2_clk_arch_init(void)
if (!mpurate)
return -EINVAL;
+ if ((mpurate == 720000000) && !omap3_has_720mhz()) {
+ printk(KERN_ERR "*** Silicon doesn't support 720MHz\n");
+
+ mpurate = 600000000; /* Set to highest supported */
+ }
+
/* REVISIT: not yet ready for 343x */
if (clk_set_rate(&dpll1_ck, mpurate))
printk(KERN_ERR "*** Unable to set MPU rate\n");
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index d4d563b..e0b427a 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -79,6 +79,7 @@ EXPORT_SYMBOL(omap_type);
#define OMAP_TAP_DIE_ID_2 0x0220
#define OMAP_TAP_DIE_ID_3 0x0224
+
#define read_tap_reg(reg) __raw_readl(tap_base + (reg))
struct omap_id {
@@ -180,6 +181,15 @@ 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;
+ }
}
void __init omap3_check_revision(void)
@@ -296,6 +306,7 @@ void __init omap3_cpuinfo(void)
OMAP3_SHOW_FEATURE(sgx);
OMAP3_SHOW_FEATURE(neon);
OMAP3_SHOW_FEATURE(isp);
+ OMAP3_SHOW_FEATURE(720mhz);
}
/*
diff --git a/arch/arm/plat-omap/include/mach/control.h b/arch/arm/plat-omap/include/mach/control.h
index fdb6300..e886bb6 100644
--- a/arch/arm/plat-omap/include/mach/control.h
+++ b/arch/arm/plat-omap/include/mach/control.h
@@ -238,6 +238,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__
#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
diff --git a/arch/arm/plat-omap/include/mach/cpu.h b/arch/arm/plat-omap/include/mach/cpu.h
index 8d0841b..12b91f7 100644
--- a/arch/arm/plat-omap/include/mach/cpu.h
+++ b/arch/arm/plat-omap/include/mach/cpu.h
@@ -472,6 +472,7 @@ extern u32 omap3_features;
#define OMAP3_HAS_SGX BIT(2)
#define OMAP3_HAS_NEON BIT(3)
#define OMAP3_HAS_ISP BIT(4)
+#define OMAP3_HAS_720MHZ BIT(5)
#define OMAP3_HAS_FEATURE(feat,flag) \
static inline unsigned int omap3_has_ ##feat(void) \
@@ -484,5 +485,6 @@ OMAP3_HAS_FEATURE(sgx, SGX)
OMAP3_HAS_FEATURE(iva, IVA)
OMAP3_HAS_FEATURE(neon, NEON)
OMAP3_HAS_FEATURE(isp, ISP)
+OMAP3_HAS_FEATURE(720mhz, 720MHZ)
#endif
--
1.6.2.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] OMAP35x: Add support for 720MHz part
2009-10-12 12:44 [PATCH] OMAP35x: Add support for 720MHz part Sanjeev Premi
@ 2009-10-13 15:51 ` Tony Lindgren
2009-10-13 19:14 ` Kevin Hilman
1 sibling, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2009-10-13 15:51 UTC (permalink / raw)
To: Sanjeev Premi; +Cc: linux-omap
Hi,
* Sanjeev Premi <premi@ti.com> [091012 06:00]:
> This patch adds support for ARM running at 720MHz part.
>
> The 720MHz capability can be probed run-time by reading the
> PRODID.SKUID[3:0] at 0x4830A20C.
>
> [1] http://focus.ti.com/lit/ug/spruff1d/spruff1d.pdf
>
> Signed-off-by: Sanjeev Premi <premi@ti.com>
> ---
> arch/arm/mach-omap2/clock34xx.c | 6 ++++++
> arch/arm/mach-omap2/id.c | 11 +++++++++++
> arch/arm/plat-omap/include/mach/control.h | 7 +++++++
> arch/arm/plat-omap/include/mach/cpu.h | 2 ++
> 4 files changed, 26 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
> index 489556e..9b56af3 100644
> --- a/arch/arm/mach-omap2/clock34xx.c
> +++ b/arch/arm/mach-omap2/clock34xx.c
> @@ -1096,6 +1096,12 @@ static int __init omap2_clk_arch_init(void)
> if (!mpurate)
> return -EINVAL;
>
> + if ((mpurate == 720000000) && !omap3_has_720mhz()) {
> + printk(KERN_ERR "*** Silicon doesn't support 720MHz\n");
> +
> + mpurate = 600000000; /* Set to highest supported */
> + }
> +
> /* REVISIT: not yet ready for 343x */
> if (clk_set_rate(&dpll1_ck, mpurate))
> printk(KERN_ERR "*** Unable to set MPU rate\n");
To me it seems like this should be limited in clk_set_rate()
instead.
> diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
> index d4d563b..e0b427a 100644
> --- a/arch/arm/mach-omap2/id.c
> +++ b/arch/arm/mach-omap2/id.c
> @@ -79,6 +79,7 @@ EXPORT_SYMBOL(omap_type);
> #define OMAP_TAP_DIE_ID_2 0x0220
> #define OMAP_TAP_DIE_ID_3 0x0224
>
> +
> #define read_tap_reg(reg) __raw_readl(tap_base + (reg))
>
> struct omap_id {
> @@ -180,6 +181,15 @@ 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;
> + }
> }
>
> void __init omap3_check_revision(void)
How would 720MHz speed be any different from other speeds?
> @@ -296,6 +306,7 @@ void __init omap3_cpuinfo(void)
> OMAP3_SHOW_FEATURE(sgx);
> OMAP3_SHOW_FEATURE(neon);
> OMAP3_SHOW_FEATURE(isp);
> + OMAP3_SHOW_FEATURE(720mhz);
> }
>
> /*
> diff --git a/arch/arm/plat-omap/include/mach/control.h b/arch/arm/plat-omap/include/mach/control.h
> index fdb6300..e886bb6 100644
> --- a/arch/arm/plat-omap/include/mach/control.h
> +++ b/arch/arm/plat-omap/include/mach/control.h
> @@ -238,6 +238,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__
> #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
> diff --git a/arch/arm/plat-omap/include/mach/cpu.h b/arch/arm/plat-omap/include/mach/cpu.h
> index 8d0841b..12b91f7 100644
> --- a/arch/arm/plat-omap/include/mach/cpu.h
> +++ b/arch/arm/plat-omap/include/mach/cpu.h
> @@ -472,6 +472,7 @@ extern u32 omap3_features;
> #define OMAP3_HAS_SGX BIT(2)
> #define OMAP3_HAS_NEON BIT(3)
> #define OMAP3_HAS_ISP BIT(4)
> +#define OMAP3_HAS_720MHZ BIT(5)
>
> #define OMAP3_HAS_FEATURE(feat,flag) \
> static inline unsigned int omap3_has_ ##feat(void) \
> @@ -484,5 +485,6 @@ OMAP3_HAS_FEATURE(sgx, SGX)
> OMAP3_HAS_FEATURE(iva, IVA)
> OMAP3_HAS_FEATURE(neon, NEON)
> OMAP3_HAS_FEATURE(isp, ISP)
> +OMAP3_HAS_FEATURE(720mhz, 720MHZ)
>
> #endif
I think we should rather implement a function omap_get_max_rate()
or similar, and then the clock framework initializes the clocks
based on that. This way clk_set_rate() can limit the speed
as needed.
Regards,
Tony
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] OMAP35x: Add support for 720MHz part
2009-10-12 12:44 [PATCH] OMAP35x: Add support for 720MHz part Sanjeev Premi
2009-10-13 15:51 ` Tony Lindgren
@ 2009-10-13 19:14 ` Kevin Hilman
1 sibling, 0 replies; 3+ messages in thread
From: Kevin Hilman @ 2009-10-13 19:14 UTC (permalink / raw)
To: Sanjeev Premi; +Cc: linux-omap
Sanjeev Premi <premi@ti.com> writes:
> This patch adds support for ARM running at 720MHz part.
>
> The 720MHz capability can be probed run-time by reading the
> PRODID.SKUID[3:0] at 0x4830A20C.
>
> [1] http://focus.ti.com/lit/ug/spruff1d/spruff1d.pdf
>
> Signed-off-by: Sanjeev Premi <premi@ti.com>
>
> ---
> arch/arm/mach-omap2/clock34xx.c | 6 ++++++
> arch/arm/mach-omap2/id.c | 11 +++++++++++
> arch/arm/plat-omap/include/mach/control.h | 7 +++++++
> arch/arm/plat-omap/include/mach/cpu.h | 2 ++
> 4 files changed, 26 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
> index 489556e..9b56af3 100644
> --- a/arch/arm/mach-omap2/clock34xx.c
> +++ b/arch/arm/mach-omap2/clock34xx.c
> @@ -1096,6 +1096,12 @@ static int __init omap2_clk_arch_init(void)
> if (!mpurate)
> return -EINVAL;
>
> + if ((mpurate == 720000000) && !omap3_has_720mhz()) {
> + printk(KERN_ERR "*** Silicon doesn't support 720MHz\n");
> +
> + mpurate = 600000000; /* Set to highest supported */
> + }
> +
This is very platform specific check here. We're not checking for any
other valid mpurate values here. I think we should leave it to the
(forthcoming) OPP layer to to validate the frequency etc.
I recommend just dropping the clock34xx.c changes and posting a patch
which just adds the new speed as a feature.
> /* REVISIT: not yet ready for 343x */
> if (clk_set_rate(&dpll1_ck, mpurate))
> printk(KERN_ERR "*** Unable to set MPU rate\n");
> diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
> index d4d563b..e0b427a 100644
> --- a/arch/arm/mach-omap2/id.c
> +++ b/arch/arm/mach-omap2/id.c
> @@ -79,6 +79,7 @@ EXPORT_SYMBOL(omap_type);
> #define OMAP_TAP_DIE_ID_2 0x0220
> #define OMAP_TAP_DIE_ID_3 0x0224
>
> +
stray whitespace change
> #define read_tap_reg(reg) __raw_readl(tap_base + (reg))
>
> struct omap_id {
> @@ -180,6 +181,15 @@ 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));
> +
Some comment here that the runtime detection of this feature is only
available on 35xx parts would be useful too.
Kevin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-10-13 19:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-12 12:44 [PATCH] OMAP35x: Add support for 720MHz part Sanjeev Premi
2009-10-13 15:51 ` Tony Lindgren
2009-10-13 19:14 ` Kevin Hilman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox