Skip to contentSkip to conversation

ARM: omap4: prm: Fix up swapped offset macros

PATCH In review Rajendra Nayak 2 participants 4 messages Nov 7, 2011 – Nov 8, 2011

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

PATCH 1/1 ARM: omap4: prm: Fix up swapped offset macros

The offset macros for OMAP4_RM_RSTST and OMAP4_RM_RSTTIME are wrongly swapped up.

Thanks to Gina Glaser for identifying and reporting this.

---
 arch/arm/mach-omap2/prm44xx.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/prm44xx.h +2 -2
index 3d66ccd..aa8593e 100644
@@ -62,8 +62,8 @@
 
 /* OMAP4 specific register offsets */
 #define OMAP4_RM_RSTCTRL				0x0000
-#define OMAP4_RM_RSTTIME				0x0004
-#define OMAP4_RM_RSTST					0x0008
+#define OMAP4_RM_RSTST					0x0004
+#define OMAP4_RM_RSTTIME				0x0008
 #define OMAP4_PM_PWSTCTRL				0x0000
 #define OMAP4_PM_PWSTST					0x0004
 
Signature · 1 line
1.7.1
#1 lore raw

Hi Rajendra,

Quoted 16 lines · Rajendra Nayak

The offset macros for OMAP4_RM_RSTST and OMAP4_RM_RSTTIME are wrongly swapped up.

Thanks to Gina Glaser for identifying and reporting this.

---
  arch/arm/mach-omap2/prm44xx.h |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/prm44xx.h +0 -0
index 3d66ccd..aa8593e 100644

arch/arm/mach-omap2/prm44xx.h line 68

Quoted 9 lines
arch/arm/mach-omap2/prm44xx.h +2 -2
@@ -62,8 +62,8 @@
 
  /* OMAP4 specific register offsets */
  #define OMAP4_RM_RSTCTRL				0x0000
-#define OMAP4_RM_RSTTIME				0x0004
-#define OMAP4_RM_RSTST				0x0008
+#define OMAP4_RM_RSTST				0x0004
+#define OMAP4_RM_RSTTIME				0x0008
  #define OMAP4_PM_PWSTCTRL				0x0000
  #define OMAP4_PM_PWSTST				0x0004

In fact these defines were already defined correctly later (with a slightly different name):

/* PRM.DEVICE_PRM register offsets */

[...]

#define OMAP4_PRM_RSTST_OFFSET 0x0004
#define OMAP4430_PRM_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0004)
#define OMAP4_PRM_RSTTIME_OFFSET 0x0008
#define OMAP4430_PRM_RSTTIME OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0008)

I don't know where these defines are used, but we'd better use the existing ones.

Benoit

#2 lore raw
Quoted 16 lines

arch/arm/mach-omap2/prm44xx.h line 68

Quoted 9 lines
   /* OMAP4 specific register offsets */
   #define OMAP4_RM_RSTCTRL				0x0000
arch/arm/mach-omap2/prm44xx.h +2 -2
-#define OMAP4_RM_RSTTIME				0x0004
-#define OMAP4_RM_RSTST				0x0008
+#define OMAP4_RM_RSTST				0x0004
+#define OMAP4_RM_RSTTIME				0x0008
   #define OMAP4_PM_PWSTCTRL				0x0000
   #define OMAP4_PM_PWSTST				0x0004

In fact these defines were already defined correctly later (with a slightly different name):

/* PRM.DEVICE_PRM register offsets */

[...]

Quoted 7 lines

#define OMAP4_PRM_RSTST_OFFSET 0x0004
#define OMAP4430_PRM_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0004)
#define OMAP4_PRM_RSTTIME_OFFSET 0x0008
#define OMAP4430_PRM_RSTTIME OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0008)

I don't know where these defines are used, but we'd better use the existing ones.

Yes, it looks like it makes sense to completely get rid of these and instead use the auto-generated ones.
I see there are these multiple defines for omap3 too, maybe its best to get rid of them for omap3 too?

Quoted 2 lines

Benoit

#3 lore raw
Quoted 25 lines · Rajendra Nayak
Quoted 25 lines
Quoted 9 lines

/* OMAP4 specific register offsets */
#define OMAP4_RM_RSTCTRL 0x0000

arch/arm/mach-omap2/prm44xx.h +2 -2
-#define OMAP4_RM_RSTTIME 0x0004
-#define OMAP4_RM_RSTST 0x0008
+#define OMAP4_RM_RSTST 0x0004
+#define OMAP4_RM_RSTTIME 0x0008

#define OMAP4_PM_PWSTCTRL 0x0000
#define OMAP4_PM_PWSTST 0x0004

In fact these defines were already defined correctly later (with a slightly different name):

/* PRM.DEVICE_PRM register offsets */

[...]

#define OMAP4_PRM_RSTST_OFFSET 0x0004
#define OMAP4430_PRM_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0004) #define OMAP4_PRM_RSTTIME_OFFSET 0x0008 #define OMAP4430_PRM_RSTTIME OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0008)

Quoted 7 lines
Quoted 2 lines

I don't know where these defines are used, but we'd better use the existing ones.

Yes, it looks like it makes sense to completely get rid of these and instead use the auto-generated ones.
I see there are these multiple defines for omap3 too, maybe its best to get rid of them for omap3 too?

Looking at it a little more closely, I now see why some of these are needed.

#define OMAP4_PM_PWSTCTRL 0x0000
#define OMAP4_PM_PWSTST 0x0004

These seem to be needed because the autogen output throws out offsets with the individual domain names embedded, which can't be used in generic powerdomain code, and since all of them are the same, the ones with the individual domain names never get used.
Maybe a case for the autogen script updates to get rid of all those and just generate something like the above. Should give some good -ve diffstat :)

#define OMAP4_RM_RSTCTRL 0x0000
#define OMAP4_RM_RSTTIME 0x0004

These don't seem to be used at all.

#define OMAP4_RM_RSTST 0x0008

The only instance of this being used I see is in omap_prcm_get_reset_sources() and seems completely wrong as its using a omap2/3 api (omap2_prm_read_mod_reg())
on omap4.

Quoted 4 lines
Quoted 3 lines

Benoit