* [PATCH 2/3] Runitme check for OMAP35x
@ 2009-01-10 20:00 Sanjeev Premi
2009-01-10 22:20 ` Felipe Balbi
0 siblings, 1 reply; 5+ messages in thread
From: Sanjeev Premi @ 2009-01-10 20:00 UTC (permalink / raw)
To: linux-omap; +Cc: Sanjeev Premi
Added runtime check via omap2_set_globals_35xx()
Signed-off-by: Sanjeev Premi <premi@ti.com>
---
arch/arm/plat-omap/common.c | 68 +++++++++++++++++++++++
arch/arm/plat-omap/include/mach/common.h | 1 +
arch/arm/plat-omap/include/mach/cpu.h | 88 +++++++++++++++++++++++++++++-
3 files changed, 155 insertions(+), 2 deletions(-)
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index 8c53125..7861a25 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -333,3 +333,71 @@ void __init omap2_set_globals_343x(void)
}
#endif
+#if defined(CONFIG_ARCH_OMAP35XX)
+
+#if defined(CONFIG_ARCH_OMAP3503)
+static struct omap_globals omap3503_globals = {
+ .class = OMAP35XX_CLASS,
+ .tap = OMAP2_IO_ADDRESS(0x4830A000),
+ .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
+ .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
+ .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
+ .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
+ .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
+};
+#endif /* if defined(CONFIG_ARCH_OMAP3503) */
+
+#if defined(CONFIG_ARCH_OMAP3515)
+static struct omap_globals omap3515_globals = {
+ .class = OMAP35XX_CLASS,
+ .tap = OMAP2_IO_ADDRESS(0x4830A000),
+ .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
+ .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
+ .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
+ .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
+ .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
+};
+#endif /* if defined(CONFIG_ARCH_OMAP3515) */
+
+#if defined(CONFIG_ARCH_OMAP3525)
+static struct omap_globals omap3525_globals = {
+ .class = OMAP35XX_CLASS,
+ .tap = OMAP2_IO_ADDRESS(0x4830A000),
+ .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
+ .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
+ .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
+ .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
+ .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
+};
+#endif /* if defined(CONFIG_ARCH_OMAP3525) */
+
+#if defined(CONFIG_ARCH_OMAP3530)
+static struct omap_globals omap3530_globals = {
+ .class = OMAP35XX_CLASS,
+ .tap = OMAP2_IO_ADDRESS(0x4830A000),
+ .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
+ .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
+ .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
+ .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
+ .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
+};
+#endif /* if defined(CONFIG_ARCH_OMAP3530) */
+
+void __init omap2_set_globals_35xx(void)
+{
+#if defined(CONFIG_ARCH_OMAP3503)
+ omap2_globals = &omap3503_globals;
+#endif
+#if defined(CONFIG_ARCH_OMAP3515)
+ omap2_globals = &omap3515_globals;
+#endif
+#if defined(CONFIG_ARCH_OMAP3525)
+ omap2_globals = &omap3525_globals;
+#endif
+#if defined(CONFIG_ARCH_OMAP3530)
+ omap2_globals = &omap3530_globals;
+#endif
+
+ __omap2_set_globals();
+}
+#endif /* if defined(CONFIG_ARCH_OMAP35XX) */
diff --git a/arch/arm/plat-omap/include/mach/common.h b/arch/arm/plat-omap/include/mach/common.h
index af4105f..f41cba2 100644
--- a/arch/arm/plat-omap/include/mach/common.h
+++ b/arch/arm/plat-omap/include/mach/common.h
@@ -60,6 +60,7 @@ struct omap_globals {
void omap2_set_globals_242x(void);
void omap2_set_globals_243x(void);
void omap2_set_globals_343x(void);
+void omap2_set_globals_35xx(void);
/* These get called from omap2_set_globals_xxxx(), do not call these */
void omap2_set_globals_tap(struct omap_globals *);
diff --git a/arch/arm/plat-omap/include/mach/cpu.h b/arch/arm/plat-omap/include/mach/cpu.h
index b2062f1..f583042 100644
--- a/arch/arm/plat-omap/include/mach/cpu.h
+++ b/arch/arm/plat-omap/include/mach/cpu.h
@@ -93,7 +93,7 @@ unsigned int omap_rev(void);
# define OMAP_NAME omap2430
# endif
#endif
-#ifdef CONFIG_ARCH_OMAP3430
+#if defined(CONFIG_ARCH_OMAP3430) && !defined(CONFIG_ARCH_OMAP35XX)
# ifdef OMAP_NAME
# undef MULTI_OMAP2
# define MULTI_OMAP2
@@ -102,6 +102,46 @@ unsigned int omap_rev(void);
# endif
#endif
+#ifdef CONFIG_ARCH_OMAP35XX
+# ifdef CONFIG_ARCH_OMAP3503
+# ifdef OMAP_NAME
+# undef MULTI_OMAP2
+# define MULTI_OMAP2
+# else
+# define OMAP_NAME omap3503
+# endif
+# endif /* ifdef CONFIG_ARCH_OMAP3503 */
+
+# ifdef CONFIG_ARCH_OMAP3515
+# ifdef OMAP_NAME
+# undef MULTI_OMAP2
+# define MULTI_OMAP2
+# else
+# define OMAP_NAME omap3515
+# endif
+# endif /* ifdef CONFIG_ARCH_OMAP3515 */
+
+# ifdef CONFIG_ARCH_OMAP3525
+# ifdef OMAP_NAME
+# undef MULTI_OMAP2
+# define MULTI_OMAP2
+# else
+# define OMAP_NAME omap3525
+# endif
+# endif /* ifdef CONFIG_ARCH_OMAP3525 */
+
+# ifdef CONFIG_ARCH_OMAP3530
+# ifdef OMAP_NAME
+# undef MULTI_OMAP2
+# define MULTI_OMAP2
+# else
+# define OMAP_NAME omap3530
+# endif
+# endif /* ifdef CONFIG_ARCH_OMAP3530 */
+
+#endif /* ifdef CONFIG_ARCH_OMAP35XX */
+
+
/*
* Macros to group OMAP into cpu classes.
* These can be used in most places.
@@ -112,6 +152,7 @@ unsigned int omap_rev(void);
* cpu_is_omap242x(): True for OMAP2420, OMAP2422, OMAP2423
* cpu_is_omap243x(): True for OMAP2430
* cpu_is_omap343x(): True for OMAP3430
+ * cpu_is_omap35xx(): True for OMAP35XX
*/
#define GET_OMAP_CLASS (omap_rev() & 0xff)
@@ -147,6 +188,7 @@ IS_OMAP_SUBCLASS(343x, 0x343)
#define cpu_is_omap243x() 0
#define cpu_is_omap34xx() 0
#define cpu_is_omap343x() 0
+#define cpu_is_omap35xx() 0
#if defined(MULTI_OMAP1)
# if defined(CONFIG_ARCH_OMAP730)
@@ -191,6 +233,10 @@ IS_OMAP_SUBCLASS(343x, 0x343)
# define cpu_is_omap34xx() is_omap34xx()
# define cpu_is_omap343x() is_omap343x()
# endif
+# if defined(CONFIG_ARCH_OMAP35XX)
+# undef cpu_is_omap35xx
+# define cpu_is_omap35xx() is_omap35xx()
+# endif
#else
# if defined(CONFIG_ARCH_OMAP24XX)
# undef cpu_is_omap24xx
@@ -212,6 +258,10 @@ IS_OMAP_SUBCLASS(343x, 0x343)
# undef cpu_is_omap343x
# define cpu_is_omap343x() 1
# endif
+# if defined(CONFIG_ARCH_OMAP35XX)
+# undef cpu_is_omap35xx
+# define cpu_is_omap35xx() 1
+# endif
#endif
/*
@@ -230,7 +280,11 @@ IS_OMAP_SUBCLASS(343x, 0x343)
* cpu_is_omap2423(): True for OMAP2423
* cpu_is_omap2430(): True for OMAP2430
* cpu_is_omap3430(): True for OMAP3430
- */
+ * cpu_is_omap3503(): True for OMAP3503
+ * cpu_is_omap3515(): True for OMAP3515
+ * cpu_is_omap3525(): True for OMAP3525
+ * cpu_is_omap3530(): True for OMAP3530
+ */;
#define GET_OMAP_TYPE ((omap_rev() >> 16) & 0xffff)
#define IS_OMAP_TYPE(type, id) \
@@ -252,6 +306,10 @@ IS_OMAP_TYPE(2422, 0x2422)
IS_OMAP_TYPE(2423, 0x2423)
IS_OMAP_TYPE(2430, 0x2430)
IS_OMAP_TYPE(3430, 0x3430)
+IS_OMAP_TYPE(3503, 0x3430)
+IS_OMAP_TYPE(3515, 0x3430)
+IS_OMAP_TYPE(3525, 0x3430)
+IS_OMAP_TYPE(3530, 0x3430)
#define cpu_is_omap310() 0
#define cpu_is_omap730() 0
@@ -266,6 +324,10 @@ IS_OMAP_TYPE(3430, 0x3430)
#define cpu_is_omap2423() 0
#define cpu_is_omap2430() 0
#define cpu_is_omap3430() 0
+#define cpu_is_omap3503() 0
+#define cpu_is_omap3515() 0
+#define cpu_is_omap3525() 0
+#define cpu_is_omap3530() 0
#if defined(MULTI_OMAP1)
# if defined(CONFIG_ARCH_OMAP730)
@@ -319,6 +381,26 @@ IS_OMAP_TYPE(3430, 0x3430)
# define cpu_is_omap3430() is_omap3430()
#endif
+#if defined(CONFIG_ARCH_OMAP35XX)
+# undef cpu_is_omap3503
+# undef cpu_is_omap3515
+# undef cpu_is_omap3525
+# undef cpu_is_omap3530
+
+# if defined(CONFIG_ARCH_OMAP3503)
+# define cpu_is_omap3503() 1
+# endif
+# if defined(CONFIG_ARCH_OMAP3515)
+# define cpu_is_omap3515() 1
+# endif
+# if defined(CONFIG_ARCH_OMAP3525)
+# define cpu_is_omap3525() 1
+# endif
+# if defined(CONFIG_ARCH_OMAP3525)
+# define cpu_is_omap3530() 1
+# endif
+#endif /* if defined(CONFIG_ARCH_OMAP35XX) */
+
/* Macros to detect if we have OMAP1 or OMAP2 */
#define cpu_class_is_omap1() (cpu_is_omap730() || cpu_is_omap15xx() || \
cpu_is_omap16xx())
@@ -340,6 +422,8 @@ IS_OMAP_TYPE(3430, 0x3430)
#define OMAP3430_REV_ES2_1 0x34302034
#define OMAP3430_REV_ES3_0 0x34303034
+#define OMAP35XX_CLASS 0x34300000
+
/*
* omap_chip bits
*
--
1.5.6
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 2/3] Runitme check for OMAP35x
2009-01-10 20:00 [PATCH 2/3] Runitme check for OMAP35x Sanjeev Premi
@ 2009-01-10 22:20 ` Felipe Balbi
2009-01-12 12:27 ` Tony Lindgren
0 siblings, 1 reply; 5+ messages in thread
From: Felipe Balbi @ 2009-01-10 22:20 UTC (permalink / raw)
To: Sanjeev Premi; +Cc: linux-omap
On Sun, Jan 11, 2009 at 01:30:54AM +0530, Sanjeev Premi wrote:
> Added runtime check via omap2_set_globals_35xx()
>
> Signed-off-by: Sanjeev Premi <premi@ti.com>
> ---
> arch/arm/plat-omap/common.c | 68 +++++++++++++++++++++++
> arch/arm/plat-omap/include/mach/common.h | 1 +
> arch/arm/plat-omap/include/mach/cpu.h | 88 +++++++++++++++++++++++++++++-
> 3 files changed, 155 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
> index 8c53125..7861a25 100644
> --- a/arch/arm/plat-omap/common.c
> +++ b/arch/arm/plat-omap/common.c
> @@ -333,3 +333,71 @@ void __init omap2_set_globals_343x(void)
> }
> #endif
>
> +#if defined(CONFIG_ARCH_OMAP35XX)
> +
> +#if defined(CONFIG_ARCH_OMAP3503)
use ifdef here
> +static struct omap_globals omap3503_globals = {
> + .class = OMAP35XX_CLASS,
> + .tap = OMAP2_IO_ADDRESS(0x4830A000),
> + .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
> + .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
> + .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
> + .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
> + .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
> +};
> +#endif /* if defined(CONFIG_ARCH_OMAP3503) */
traditionaly this would be:
#endif /* CONFIG_ARCH_OMAP3503 */
but that's a matter of taste...
> +
> +#if defined(CONFIG_ARCH_OMAP3515)
and here
> +static struct omap_globals omap3515_globals = {
> + .class = OMAP35XX_CLASS,
> + .tap = OMAP2_IO_ADDRESS(0x4830A000),
> + .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
> + .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
> + .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
> + .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
> + .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
> +};
> +#endif /* if defined(CONFIG_ARCH_OMAP3515) */
> +
> +#if defined(CONFIG_ARCH_OMAP3525)
> +static struct omap_globals omap3525_globals = {
> + .class = OMAP35XX_CLASS,
> + .tap = OMAP2_IO_ADDRESS(0x4830A000),
> + .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
> + .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
> + .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
> + .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
> + .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
> +};
> +#endif /* if defined(CONFIG_ARCH_OMAP3525) */
> +
> +#if defined(CONFIG_ARCH_OMAP3530)
> +static struct omap_globals omap3530_globals = {
> + .class = OMAP35XX_CLASS,
> + .tap = OMAP2_IO_ADDRESS(0x4830A000),
> + .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
> + .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
> + .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
> + .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
> + .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
> +};
> +#endif /* if defined(CONFIG_ARCH_OMAP3530) */
> +
> +void __init omap2_set_globals_35xx(void)
> +{
> +#if defined(CONFIG_ARCH_OMAP3503)
> + omap2_globals = &omap3503_globals;
> +#endif
> +#if defined(CONFIG_ARCH_OMAP3515)
> + omap2_globals = &omap3515_globals;
> +#endif
> +#if defined(CONFIG_ARCH_OMAP3525)
> + omap2_globals = &omap3525_globals;
> +#endif
> +#if defined(CONFIG_ARCH_OMAP3530)
> + omap2_globals = &omap3530_globals;
> +#endif
hmmm... so it's impossible to have multi-omap with 35xx ??
too bad...
You should probably provide omap2_set_globals_350x(),
omap2_set_globals_351x(), omap2_set_globals_352x() and
omap2_set_globals_353x().
Tony, what do you think ??
--
balbi
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 2/3] Runitme check for OMAP35x
2009-01-10 22:20 ` Felipe Balbi
@ 2009-01-12 12:27 ` Tony Lindgren
2009-01-12 12:46 ` Premi, Sanjeev
0 siblings, 1 reply; 5+ messages in thread
From: Tony Lindgren @ 2009-01-12 12:27 UTC (permalink / raw)
To: Felipe Balbi; +Cc: Sanjeev Premi, linux-omap
* Felipe Balbi <me@felipebalbi.com> [090111 00:21]:
> On Sun, Jan 11, 2009 at 01:30:54AM +0530, Sanjeev Premi wrote:
> > Added runtime check via omap2_set_globals_35xx()
> >
> > Signed-off-by: Sanjeev Premi <premi@ti.com>
> > ---
> > arch/arm/plat-omap/common.c | 68 +++++++++++++++++++++++
> > arch/arm/plat-omap/include/mach/common.h | 1 +
> > arch/arm/plat-omap/include/mach/cpu.h | 88 +++++++++++++++++++++++++++++-
> > 3 files changed, 155 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
> > index 8c53125..7861a25 100644
> > --- a/arch/arm/plat-omap/common.c
> > +++ b/arch/arm/plat-omap/common.c
> > @@ -333,3 +333,71 @@ void __init omap2_set_globals_343x(void)
> > }
> > #endif
> >
> > +#if defined(CONFIG_ARCH_OMAP35XX)
> > +
> > +#if defined(CONFIG_ARCH_OMAP3503)
>
> use ifdef here
>
> > +static struct omap_globals omap3503_globals = {
> > + .class = OMAP35XX_CLASS,
> > + .tap = OMAP2_IO_ADDRESS(0x4830A000),
> > + .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
> > + .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
> > + .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
> > + .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
> > + .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
> > +};
> > +#endif /* if defined(CONFIG_ARCH_OMAP3503) */
>
> traditionaly this would be:
>
> #endif /* CONFIG_ARCH_OMAP3503 */
>
> but that's a matter of taste...
>
> > +
> > +#if defined(CONFIG_ARCH_OMAP3515)
>
> and here
>
> > +static struct omap_globals omap3515_globals = {
> > + .class = OMAP35XX_CLASS,
> > + .tap = OMAP2_IO_ADDRESS(0x4830A000),
> > + .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
> > + .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
> > + .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
> > + .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
> > + .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
> > +};
> > +#endif /* if defined(CONFIG_ARCH_OMAP3515) */
> > +
> > +#if defined(CONFIG_ARCH_OMAP3525)
> > +static struct omap_globals omap3525_globals = {
> > + .class = OMAP35XX_CLASS,
> > + .tap = OMAP2_IO_ADDRESS(0x4830A000),
> > + .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
> > + .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
> > + .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
> > + .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
> > + .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
> > +};
> > +#endif /* if defined(CONFIG_ARCH_OMAP3525) */
> > +
> > +#if defined(CONFIG_ARCH_OMAP3530)
> > +static struct omap_globals omap3530_globals = {
> > + .class = OMAP35XX_CLASS,
> > + .tap = OMAP2_IO_ADDRESS(0x4830A000),
> > + .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
> > + .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
> > + .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
> > + .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
> > + .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
> > +};
> > +#endif /* if defined(CONFIG_ARCH_OMAP3530) */
What are the differences between these various omap35xx
processors? Maybe add a comment to each struct.
Also do we really need a separate struct for each 35xx?
> > +
> > +void __init omap2_set_globals_35xx(void)
> > +{
> > +#if defined(CONFIG_ARCH_OMAP3503)
> > + omap2_globals = &omap3503_globals;
> > +#endif
> > +#if defined(CONFIG_ARCH_OMAP3515)
> > + omap2_globals = &omap3515_globals;
> > +#endif
> > +#if defined(CONFIG_ARCH_OMAP3525)
> > + omap2_globals = &omap3525_globals;
> > +#endif
> > +#if defined(CONFIG_ARCH_OMAP3530)
> > + omap2_globals = &omap3530_globals;
> > +#endif
>
> hmmm... so it's impossible to have multi-omap with 35xx ??
> too bad...
This does not sounds right, the multi-omap should always work.
> You should probably provide omap2_set_globals_350x(),
> omap2_set_globals_351x(), omap2_set_globals_352x() and
> omap2_set_globals_353x().
>
> Tony, what do you think ??
Is there no way to detect them during runtime from the hardware?
If the answer is no, then yes we need a separate set_globals for
each omap35xx flavor.
Regards,
Tony
^ permalink raw reply [flat|nested] 5+ messages in thread* RE: [PATCH 2/3] Runitme check for OMAP35x
2009-01-12 12:27 ` Tony Lindgren
@ 2009-01-12 12:46 ` Premi, Sanjeev
2009-01-12 12:54 ` Tony Lindgren
0 siblings, 1 reply; 5+ messages in thread
From: Premi, Sanjeev @ 2009-01-12 12:46 UTC (permalink / raw)
To: Tony Lindgren, Felipe Balbi; +Cc: linux-omap@vger.kernel.org
> -----Original Message-----
> From: Tony Lindgren [mailto:tony@atomide.com]
> Sent: Monday, January 12, 2009 5:57 PM
> To: Felipe Balbi
> Cc: Premi, Sanjeev; linux-omap@vger.kernel.org
> Subject: Re: [PATCH 2/3] Runitme check for OMAP35x
>
> * Felipe Balbi <me@felipebalbi.com> [090111 00:21]:
> > On Sun, Jan 11, 2009 at 01:30:54AM +0530, Sanjeev Premi wrote:
> > > Added runtime check via omap2_set_globals_35xx()
> > >
> > > Signed-off-by: Sanjeev Premi <premi@ti.com>
> > > ---
> > > arch/arm/plat-omap/common.c | 68
> +++++++++++++++++++++++
> > > arch/arm/plat-omap/include/mach/common.h | 1 +
> > > arch/arm/plat-omap/include/mach/cpu.h | 88
> +++++++++++++++++++++++++++++-
> > > 3 files changed, 155 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/arch/arm/plat-omap/common.c
> > > b/arch/arm/plat-omap/common.c index 8c53125..7861a25 100644
> > > --- a/arch/arm/plat-omap/common.c
> > > +++ b/arch/arm/plat-omap/common.c
> > > @@ -333,3 +333,71 @@ void __init omap2_set_globals_343x(void) }
> > > #endif
> > >
> > > +#if defined(CONFIG_ARCH_OMAP35XX)
> > > +
> > > +#if defined(CONFIG_ARCH_OMAP3503)
> >
> > use ifdef here
> >
> > > +static struct omap_globals omap3503_globals = {
> > > + .class = OMAP35XX_CLASS,
> > > + .tap = OMAP2_IO_ADDRESS(0x4830A000),
> > > + .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
> > > + .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
> > > + .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
> > > + .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
> > > + .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
> > > +};
> > > +#endif /* if defined(CONFIG_ARCH_OMAP3503) */
> >
> > traditionaly this would be:
> >
> > #endif /* CONFIG_ARCH_OMAP3503 */
> >
> > but that's a matter of taste...
> >
> > > +
> > > +#if defined(CONFIG_ARCH_OMAP3515)
> >
> > and here
> >
> > > +static struct omap_globals omap3515_globals = {
> > > + .class = OMAP35XX_CLASS,
> > > + .tap = OMAP2_IO_ADDRESS(0x4830A000),
> > > + .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
> > > + .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
> > > + .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
> > > + .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
> > > + .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
> > > +};
> > > +#endif /* if defined(CONFIG_ARCH_OMAP3515) */
> > > +
> > > +#if defined(CONFIG_ARCH_OMAP3525)
> > > +static struct omap_globals omap3525_globals = {
> > > + .class = OMAP35XX_CLASS,
> > > + .tap = OMAP2_IO_ADDRESS(0x4830A000),
> > > + .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
> > > + .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
> > > + .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
> > > + .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
> > > + .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
> > > +};
> > > +#endif /* if defined(CONFIG_ARCH_OMAP3525) */
> > > +
> > > +#if defined(CONFIG_ARCH_OMAP3530)
> > > +static struct omap_globals omap3530_globals = {
> > > + .class = OMAP35XX_CLASS,
> > > + .tap = OMAP2_IO_ADDRESS(0x4830A000),
> > > + .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
> > > + .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
> > > + .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
> > > + .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
> > > + .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
> > > +};
> > > +#endif /* if defined(CONFIG_ARCH_OMAP3530) */
>
> What are the differences between these various omap35xx
> processors? Maybe add a comment to each struct.
[sp] Sure will do. Thought that link in PATCH0 was sufficient.
>
> Also do we really need a separate struct for each 35xx?
[sp] There was a comment to my initial patchset (AUG '08) that there should be a separate struct. Hence, I had made this change.
>
> > > +
> > > +void __init omap2_set_globals_35xx(void) { #if
> > > +defined(CONFIG_ARCH_OMAP3503)
> > > + omap2_globals = &omap3503_globals; #endif #if
> > > +defined(CONFIG_ARCH_OMAP3515)
> > > + omap2_globals = &omap3515_globals; #endif #if
> > > +defined(CONFIG_ARCH_OMAP3525)
> > > + omap2_globals = &omap3525_globals; #endif #if
> > > +defined(CONFIG_ARCH_OMAP3530)
> > > + omap2_globals = &omap3530_globals; #endif
> >
> > hmmm... so it's impossible to have multi-omap with 35xx ??
> > too bad...
>
> This does not sounds right, the multi-omap should always work.
>
[sp] If there is only one struct this multi-omap will still be a problem. Right?
Each of the OMAPs will need its own struct. (I haven't worked with multi-omap;
do correct me if my understanding is not right).
> > You should probably provide omap2_set_globals_350x(),
> > omap2_set_globals_351x(), omap2_set_globals_352x() and
> > omap2_set_globals_353x().
> >
> > Tony, what do you think ??
>
> Is there no way to detect them during runtime from the hardware?
[sp] The initial version of the TRM did not mention any specific means to do runtime detection. Had followed the same for this patchset. The new TRM does mention mechanism (also mentioned by Steve Sakoman in same mail thread). I am working to create a new patch set. I am trying to confirm if this will work on early versions of OMAP35x as well.
> If the answer is no, then yes we need a separate set_globals
> for each omap35xx flavor.
[sp] If check works for initial Si versions as well; I will submit patch with only one function omap2_set_globals_35xx (); Else, will go with multiple functions for each of 35x processors as suggest above.
>
> Regards,
>
> Tony
>
>
~sanjeev
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 2/3] Runitme check for OMAP35x
2009-01-12 12:46 ` Premi, Sanjeev
@ 2009-01-12 12:54 ` Tony Lindgren
0 siblings, 0 replies; 5+ messages in thread
From: Tony Lindgren @ 2009-01-12 12:54 UTC (permalink / raw)
To: Premi, Sanjeev; +Cc: Felipe Balbi, linux-omap@vger.kernel.org
* Premi, Sanjeev <premi@ti.com> [090112 14:47]:
> > -----Original Message-----
> > From: Tony Lindgren [mailto:tony@atomide.com]
> > Sent: Monday, January 12, 2009 5:57 PM
> > To: Felipe Balbi
> > Cc: Premi, Sanjeev; linux-omap@vger.kernel.org
> > Subject: Re: [PATCH 2/3] Runitme check for OMAP35x
> >
> > * Felipe Balbi <me@felipebalbi.com> [090111 00:21]:
> > > On Sun, Jan 11, 2009 at 01:30:54AM +0530, Sanjeev Premi wrote:
> > > > Added runtime check via omap2_set_globals_35xx()
> > > >
> > > > Signed-off-by: Sanjeev Premi <premi@ti.com>
> > > > ---
> > > > arch/arm/plat-omap/common.c | 68
> > +++++++++++++++++++++++
> > > > arch/arm/plat-omap/include/mach/common.h | 1 +
> > > > arch/arm/plat-omap/include/mach/cpu.h | 88
> > +++++++++++++++++++++++++++++-
> > > > 3 files changed, 155 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/arch/arm/plat-omap/common.c
> > > > b/arch/arm/plat-omap/common.c index 8c53125..7861a25 100644
> > > > --- a/arch/arm/plat-omap/common.c
> > > > +++ b/arch/arm/plat-omap/common.c
> > > > @@ -333,3 +333,71 @@ void __init omap2_set_globals_343x(void) }
> > > > #endif
> > > >
> > > > +#if defined(CONFIG_ARCH_OMAP35XX)
> > > > +
> > > > +#if defined(CONFIG_ARCH_OMAP3503)
> > >
> > > use ifdef here
> > >
> > > > +static struct omap_globals omap3503_globals = {
> > > > + .class = OMAP35XX_CLASS,
> > > > + .tap = OMAP2_IO_ADDRESS(0x4830A000),
> > > > + .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
> > > > + .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
> > > > + .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
> > > > + .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
> > > > + .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
> > > > +};
> > > > +#endif /* if defined(CONFIG_ARCH_OMAP3503) */
> > >
> > > traditionaly this would be:
> > >
> > > #endif /* CONFIG_ARCH_OMAP3503 */
> > >
> > > but that's a matter of taste...
> > >
> > > > +
> > > > +#if defined(CONFIG_ARCH_OMAP3515)
> > >
> > > and here
> > >
> > > > +static struct omap_globals omap3515_globals = {
> > > > + .class = OMAP35XX_CLASS,
> > > > + .tap = OMAP2_IO_ADDRESS(0x4830A000),
> > > > + .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
> > > > + .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
> > > > + .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
> > > > + .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
> > > > + .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
> > > > +};
> > > > +#endif /* if defined(CONFIG_ARCH_OMAP3515) */
> > > > +
> > > > +#if defined(CONFIG_ARCH_OMAP3525)
> > > > +static struct omap_globals omap3525_globals = {
> > > > + .class = OMAP35XX_CLASS,
> > > > + .tap = OMAP2_IO_ADDRESS(0x4830A000),
> > > > + .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
> > > > + .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
> > > > + .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
> > > > + .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
> > > > + .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
> > > > +};
> > > > +#endif /* if defined(CONFIG_ARCH_OMAP3525) */
> > > > +
> > > > +#if defined(CONFIG_ARCH_OMAP3530)
> > > > +static struct omap_globals omap3530_globals = {
> > > > + .class = OMAP35XX_CLASS,
> > > > + .tap = OMAP2_IO_ADDRESS(0x4830A000),
> > > > + .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
> > > > + .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
> > > > + .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
> > > > + .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
> > > > + .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
> > > > +};
> > > > +#endif /* if defined(CONFIG_ARCH_OMAP3530) */
> >
> > What are the differences between these various omap35xx
> > processors? Maybe add a comment to each struct.
>
> [sp] Sure will do. Thought that link in PATCH0 was sufficient.
> >
> > Also do we really need a separate struct for each 35xx?
>
> [sp] There was a comment to my initial patchset (AUG '08) that there should be a separate struct. Hence, I had made this change.
But if the data struct is the same for each 35xx, you can
use the same sturct, right?
If you need to add separate data there, just have separate
set_globals functions for each flavor.
> > > > +
> > > > +void __init omap2_set_globals_35xx(void) { #if
> > > > +defined(CONFIG_ARCH_OMAP3503)
> > > > + omap2_globals = &omap3503_globals; #endif #if
> > > > +defined(CONFIG_ARCH_OMAP3515)
> > > > + omap2_globals = &omap3515_globals; #endif #if
> > > > +defined(CONFIG_ARCH_OMAP3525)
> > > > + omap2_globals = &omap3525_globals; #endif #if
> > > > +defined(CONFIG_ARCH_OMAP3530)
> > > > + omap2_globals = &omap3530_globals; #endif
> > >
> > > hmmm... so it's impossible to have multi-omap with 35xx ??
> > > too bad...
> >
> > This does not sounds right, the multi-omap should always work.
> >
>
> [sp] If there is only one struct this multi-omap will still be a problem. Right?
> Each of the OMAPs will need its own struct. (I haven't worked with multi-omap;
> do correct me if my understanding is not right).
No, multi-omap should not be a problem, you just use the right struct
in set_globals function.
> > > You should probably provide omap2_set_globals_350x(),
> > > omap2_set_globals_351x(), omap2_set_globals_352x() and
> > > omap2_set_globals_353x().
> > >
> > > Tony, what do you think ??
> >
> > Is there no way to detect them during runtime from the hardware?
>
> [sp] The initial version of the TRM did not mention any specific means to do runtime detection. Had followed the same for this patchset. The new TRM does mention mechanism (also mentioned by Steve Sakoman in same mail thread). I am working to create a new patch set. I am trying to confirm if this will work on early versions of OMAP35x as well.
It might be worth confirming this.
> > If the answer is no, then yes we need a separate set_globals
> > for each omap35xx flavor.
>
> [sp] If check works for initial Si versions as well; I will submit patch with only one function omap2_set_globals_35xx (); Else, will go with multiple functions for each of 35x processors as suggest above.
Thanks,
Tony
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-01-12 12:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-10 20:00 [PATCH 2/3] Runitme check for OMAP35x Sanjeev Premi
2009-01-10 22:20 ` Felipe Balbi
2009-01-12 12:27 ` Tony Lindgren
2009-01-12 12:46 ` Premi, Sanjeev
2009-01-12 12:54 ` Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox