linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: OMAP3+: am33xx id: Add new am33xx specific function to check dev_feature
@ 2013-05-08  6:58 Vaibhav Hiremath
  2013-05-13 21:53 ` Kevin Hilman
  0 siblings, 1 reply; 3+ messages in thread
From: Vaibhav Hiremath @ 2013-05-08  6:58 UTC (permalink / raw)
  To: linux-arm-kernel

Layout of DEV_FEATURE register (offset = 0x604) is different
between TI81xx and AM33xx device, so create separate function
which will check for features available on specific AM33xx SoC
and set the flags accordingly.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
---
 arch/arm/mach-omap2/control.h |    5 +++++
 arch/arm/mach-omap2/id.c      |   13 +++++++++++++
 arch/arm/mach-omap2/io.c      |    2 +-
 arch/arm/mach-omap2/soc.h     |    1 +
 4 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index e6c3281..4acdfc5 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -358,6 +358,11 @@
 #define AM33XX_CONTROL_STATUS_SYSBOOT1_WIDTH		0x2
 #define AM33XX_CONTROL_STATUS_SYSBOOT1_MASK		(0x3 << 22)
 
+/* DEV Feature register to identify AM33XX features */
+#define AM33XX_DEV_FEATURE		0x604
+#define AM33XX_SGX_SHIFT		29
+#define AM33XX_SGX_MASK			(1 << AM33XX_SGX_SHIFT)
+
 /* CONTROL OMAP STATUS register to identify OMAP3 features */
 #define OMAP3_CONTROL_OMAP_STATUS	0x044c
 
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 9bc5a18..02feef7 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -302,6 +302,19 @@ void __init ti81xx_check_features(void)
 	omap3_cpuinfo();
 }
 
+void __init am33xx_check_features(void)
+{
+	u32 status;
+
+	omap_features = OMAP3_HAS_NEON;
+
+	status = omap_ctrl_readl(AM33XX_DEV_FEATURE);
+	if (status & AM33XX_SGX_MASK)
+		omap_features |= OMAP3_HAS_SGX;
+
+	omap3_cpuinfo();
+}
+
 void __init omap3xxx_check_revision(void)
 {
 	const char *cpu_rev;
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 09abf99..06a8946 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -576,7 +576,7 @@ void __init am33xx_init_early(void)
 	omap2_set_globals_prm(AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRCM_BASE));
 	omap2_set_globals_cm(AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRCM_BASE), NULL);
 	omap3xxx_check_revision();
-	ti81xx_check_features();
+	am33xx_check_features();
 	am33xx_voltagedomains_init();
 	am33xx_powerdomains_init();
 	am33xx_clockdomains_init();
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
index ccef2dd..7d8722c 100644
--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -424,6 +424,7 @@ void omap4xxx_check_revision(void);
 void omap5xxx_check_revision(void);
 void omap3xxx_check_features(void);
 void ti81xx_check_features(void);
+void am33xx_check_features(void);
 void omap4xxx_check_features(void);
 
 /*
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] ARM: OMAP3+: am33xx id: Add new am33xx specific function to check dev_feature
  2013-05-08  6:58 [PATCH] ARM: OMAP3+: am33xx id: Add new am33xx specific function to check dev_feature Vaibhav Hiremath
@ 2013-05-13 21:53 ` Kevin Hilman
  2013-05-17 10:15   ` Hiremath, Vaibhav
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Hilman @ 2013-05-13 21:53 UTC (permalink / raw)
  To: linux-arm-kernel

Vaibhav Hiremath <hvaibhav@ti.com> writes:

> Layout of DEV_FEATURE register (offset = 0x604) is different
> between TI81xx and AM33xx device, so create separate function
> which will check for features available on specific AM33xx SoC
> and set the flags accordingly.
>
> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>

Minor nit below, otherwise...

Reviewed-by: Kevin Hilman <khilman@linaro.org>

> ---
>  arch/arm/mach-omap2/control.h |    5 +++++
>  arch/arm/mach-omap2/id.c      |   13 +++++++++++++
>  arch/arm/mach-omap2/io.c      |    2 +-
>  arch/arm/mach-omap2/soc.h     |    1 +
>  4 files changed, 20 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
> index e6c3281..4acdfc5 100644
> --- a/arch/arm/mach-omap2/control.h
> +++ b/arch/arm/mach-omap2/control.h
> @@ -358,6 +358,11 @@
>  #define AM33XX_CONTROL_STATUS_SYSBOOT1_WIDTH		0x2
>  #define AM33XX_CONTROL_STATUS_SYSBOOT1_MASK		(0x3 << 22)
>  
> +/* DEV Feature register to identify AM33XX features */
> +#define AM33XX_DEV_FEATURE		0x604
> +#define AM33XX_SGX_SHIFT		29

You don't need the shift value anywhere in the code, so...

> +#define AM33XX_SGX_MASK			(1 << AM33XX_SGX_SHIFT)

#define AM33XX_SGX_MASK		BIT(29)

instead?

Otherwise, rest of patch looks fine.

Kevin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] ARM: OMAP3+: am33xx id: Add new am33xx specific function to check dev_feature
  2013-05-13 21:53 ` Kevin Hilman
@ 2013-05-17 10:15   ` Hiremath, Vaibhav
  0 siblings, 0 replies; 3+ messages in thread
From: Hiremath, Vaibhav @ 2013-05-17 10:15 UTC (permalink / raw)
  To: linux-arm-kernel


> -----Original Message-----
> From: Kevin Hilman [mailto:khilman at linaro.org]
> Sent: Tuesday, May 14, 2013 3:23 AM
> To: Hiremath, Vaibhav
> Cc: linux-omap at vger.kernel.org; tony at atomide.com; linux-arm-
> kernel at lists.infradead.org
> Subject: Re: [PATCH] ARM: OMAP3+: am33xx id: Add new am33xx specific
> function to check dev_feature
> 
> Vaibhav Hiremath <hvaibhav@ti.com> writes:
> 
> > Layout of DEV_FEATURE register (offset = 0x604) is different
> > between TI81xx and AM33xx device, so create separate function
> > which will check for features available on specific AM33xx SoC
> > and set the flags accordingly.
> >
> > Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> 
> Minor nit below, otherwise...
> 
> Reviewed-by: Kevin Hilman <khilman@linaro.org>
> 
> > ---
> >  arch/arm/mach-omap2/control.h |    5 +++++
> >  arch/arm/mach-omap2/id.c      |   13 +++++++++++++
> >  arch/arm/mach-omap2/io.c      |    2 +-
> >  arch/arm/mach-omap2/soc.h     |    1 +
> >  4 files changed, 20 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-
> omap2/control.h
> > index e6c3281..4acdfc5 100644
> > --- a/arch/arm/mach-omap2/control.h
> > +++ b/arch/arm/mach-omap2/control.h
> > @@ -358,6 +358,11 @@
> >  #define AM33XX_CONTROL_STATUS_SYSBOOT1_WIDTH		0x2
> >  #define AM33XX_CONTROL_STATUS_SYSBOOT1_MASK		(0x3 << 22)
> >
> > +/* DEV Feature register to identify AM33XX features */
> > +#define AM33XX_DEV_FEATURE		0x604
> > +#define AM33XX_SGX_SHIFT		29
> 
> You don't need the shift value anywhere in the code, so...
> 
> > +#define AM33XX_SGX_MASK			(1 << AM33XX_SGX_SHIFT)
> 
> #define AM33XX_SGX_MASK		BIT(29)
> 
> instead?
> 
> Otherwise, rest of patch looks fine.
> 
Thanks for the review Kevin.
I just sent out V2 version of the patch with your reviewed-by
With changes you mentioned.

Thanks,
Vaibhav

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-17 10:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-08  6:58 [PATCH] ARM: OMAP3+: am33xx id: Add new am33xx specific function to check dev_feature Vaibhav Hiremath
2013-05-13 21:53 ` Kevin Hilman
2013-05-17 10:15   ` Hiremath, Vaibhav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).