Skip to contentSkip to conversation

ARM: OMAP3+: am33xx id: Add new am33xx specific function to check dev_feature

PATCH New Vaibhav Hiremath 2 participants 2 messages May 17, 2013 – Jun 18, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM: OMAP3+: am33xx id: Add new am33xx specific function to check dev_feature

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.

---
Changes from V1:
- Removed SHIFT value, as it never gets used in code
- Used BIT() macro for MASK definition

 arch/arm/mach-omap2/control.h |    4 ++++
 arch/arm/mach-omap2/id.c      |   13 +++++++++++++
 arch/arm/mach-omap2/io.c      |    2 +-
 arch/arm/mach-omap2/soc.h     |    1 +
 4 files changed, 19 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/control.h +4 -0
index e6c3281..174eb41 100644
@@ -358,6 +358,10 @@
 #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_MASK			BIT(29)
+
 /* CONTROL OMAP STATUS register to identify OMAP3 features */
 #define OMAP3_CONTROL_OMAP_STATUS	0x044c
 
arch/arm/mach-omap2/id.c +13 -0
index 1272c41..44be835 100644
@@ -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;
arch/arm/mach-omap2/io.c +1 -1
index 09abf99..06a8946 100644
@@ -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();
arch/arm/mach-omap2/soc.h +1 -0
index 197cc16..fd4507b 100644
@@ -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

maintainer
#1 lore raw

PATCH v2 1/1 ARM: OMAP3+: am33xx id: Add new am33xx specific function to check dev_feature

Quoted 7 lines · Vaibhav Hiremath

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.

Thanks, applying into omap-for-v3.11/soc.

Regards,

Tony