diff mbox

[15/15] ARM: OMAP5: PM: handle device instance for for coldreset

Message ID 1362139864-9233-16-git-send-email-santosh.shilimkar@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Santosh Shilimkar March 1, 2013, 12:11 p.m. UTC
From: Nishanth Menon <nm@ti.com>

OMAP5 and OMAP4 have different device instance offsets.

So to handle them properly, use a runtime detected instance offset
Other bit offsets and register offsets remained constant.

Creating a new function is not really worthwhile here as the logic
will be replicated without much benefit.

Signed-off-by: Nishanth Menon <nm@ti.com>
santosh.shilimkar@ti.com: Refreshed patch against 3.8
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 arch/arm/mach-omap2/prminst44xx.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Nishanth Menon March 1, 2013, 1:04 p.m. UTC | #1
$subject - warm reset

On 17:41-20130301, Santosh Shilimkar wrote:
> From: Nishanth Menon <nm@ti.com>
> 
> OMAP5 and OMAP4 have different device instance offsets.
> 
> So to handle them properly, use a runtime detected instance offset
> Other bit offsets and register offsets remained constant.
> 
> Creating a new function is not really worthwhile here as the logic
> will be replicated without much benefit.
> 
> Signed-off-by: Nishanth Menon <nm@ti.com>
> santosh.shilimkar@ti.com: Refreshed patch against 3.8
[santosh.shilimkar@ti.com: Refreshed patch against 3.8]
?
> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> ---
>  arch/arm/mach-omap2/prminst44xx.c |   10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/prminst44xx.c b/arch/arm/mach-omap2/prminst44xx.c
> index c12320c..430fb1d 100644
> --- a/arch/arm/mach-omap2/prminst44xx.c
> +++ b/arch/arm/mach-omap2/prminst44xx.c
> @@ -20,10 +20,12 @@
>  #include "common.h"
>  #include "prcm-common.h"
>  #include "prm44xx.h"
> +#include "prm54xx.h"
>  #include "prminst44xx.h"
>  #include "prm-regbits-44xx.h"
>  #include "prcm44xx.h"
>  #include "prcm_mpu44xx.h"
> +#include "soc.h"
>  
>  static void __iomem *_prm_bases[OMAP4_MAX_PRCM_PARTITIONS];
>  
> @@ -165,17 +167,19 @@ int omap4_prminst_deassert_hardreset(u8 shift, u8 part, s16 inst,
>  void omap4_prminst_global_warm_sw_reset(void)
>  {
>  	u32 v;
> +	s16 dev_inst = cpu_is_omap44xx() ? OMAP4430_PRM_DEVICE_INST :
> +					   OMAP54XX_PRM_DEVICE_INST;
>  
>  	v = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
> -				    OMAP4430_PRM_DEVICE_INST,
> +				    dev_inst,
>  				    OMAP4_PRM_RSTCTRL_OFFSET);
>  	v |= OMAP4430_RST_GLOBAL_WARM_SW_MASK;
>  	omap4_prminst_write_inst_reg(v, OMAP4430_PRM_PARTITION,
> -				 OMAP4430_PRM_DEVICE_INST,
> +				 dev_inst,
>  				 OMAP4_PRM_RSTCTRL_OFFSET);
>  
>  	/* OCP barrier */
>  	v = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
> -				    OMAP4430_PRM_DEVICE_INST,
> +				    dev_inst,
>  				    OMAP4_PRM_RSTCTRL_OFFSET);
>  }
> -- 
> 1.7.9.5
>
Santosh Shilimkar March 1, 2013, 1:09 p.m. UTC | #2
On Friday 01 March 2013 06:34 PM, Nishanth Menon wrote:
> $subject - warm reset
> 
ok
> On 17:41-20130301, Santosh Shilimkar wrote:
>> From: Nishanth Menon <nm@ti.com>
>>
>> OMAP5 and OMAP4 have different device instance offsets.
>>
>> So to handle them properly, use a runtime detected instance offset
>> Other bit offsets and register offsets remained constant.
>>
>> Creating a new function is not really worthwhile here as the logic
>> will be replicated without much benefit.
>>
>> Signed-off-by: Nishanth Menon <nm@ti.com>
>> santosh.shilimkar@ti.com: Refreshed patch against 3.8
> [santosh.shilimkar@ti.com: Refreshed patch against 3.8]
> ?
#include "soc.h" :)

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Nishanth Menon March 1, 2013, 1:13 p.m. UTC | #3
On 18:39-20130301, Santosh Shilimkar wrote:
> On Friday 01 March 2013 06:34 PM, Nishanth Menon wrote:
> > $subject - warm reset
> > 
> ok
> > On 17:41-20130301, Santosh Shilimkar wrote:
> >> From: Nishanth Menon <nm@ti.com>
> >>
> >> OMAP5 and OMAP4 have different device instance offsets.
> >>
> >> So to handle them properly, use a runtime detected instance offset
> >> Other bit offsets and register offsets remained constant.
> >>
> >> Creating a new function is not really worthwhile here as the logic
> >> will be replicated without much benefit.
> >>
> >> Signed-off-by: Nishanth Menon <nm@ti.com>
> >> santosh.shilimkar@ti.com: Refreshed patch against 3.8
> > [santosh.shilimkar@ti.com: Refreshed patch against 3.8]
> > ?
> #include "soc.h" :)
I should have been clear: Did you mean to have it in [] to indicate
contribution? A style comment based on Documentation/SubmittingPatches
+360
Santosh Shilimkar March 1, 2013, 1:16 p.m. UTC | #4
On Friday 01 March 2013 06:43 PM, Nishanth Menon wrote:
> On 18:39-20130301, Santosh Shilimkar wrote:
>> On Friday 01 March 2013 06:34 PM, Nishanth Menon wrote:
>>> $subject - warm reset
>>>
>> ok
>>> On 17:41-20130301, Santosh Shilimkar wrote:
>>>> From: Nishanth Menon <nm@ti.com>
>>>>
>>>> OMAP5 and OMAP4 have different device instance offsets.
>>>>
>>>> So to handle them properly, use a runtime detected instance offset
>>>> Other bit offsets and register offsets remained constant.
>>>>
>>>> Creating a new function is not really worthwhile here as the logic
>>>> will be replicated without much benefit.
>>>>
>>>> Signed-off-by: Nishanth Menon <nm@ti.com>
>>>> santosh.shilimkar@ti.com: Refreshed patch against 3.8
>>> [santosh.shilimkar@ti.com: Refreshed patch against 3.8]
>>> ?
>> #include "soc.h" :)
> I should have been clear: Did you mean to have it in [] to indicate
> contribution? A style comment based on Documentation/SubmittingPatches
> +360
> 
Ahhh. I mean that to be in []. Just missed to add the bracket.
Regards
santosh

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/prminst44xx.c b/arch/arm/mach-omap2/prminst44xx.c
index c12320c..430fb1d 100644
--- a/arch/arm/mach-omap2/prminst44xx.c
+++ b/arch/arm/mach-omap2/prminst44xx.c
@@ -20,10 +20,12 @@ 
 #include "common.h"
 #include "prcm-common.h"
 #include "prm44xx.h"
+#include "prm54xx.h"
 #include "prminst44xx.h"
 #include "prm-regbits-44xx.h"
 #include "prcm44xx.h"
 #include "prcm_mpu44xx.h"
+#include "soc.h"
 
 static void __iomem *_prm_bases[OMAP4_MAX_PRCM_PARTITIONS];
 
@@ -165,17 +167,19 @@  int omap4_prminst_deassert_hardreset(u8 shift, u8 part, s16 inst,
 void omap4_prminst_global_warm_sw_reset(void)
 {
 	u32 v;
+	s16 dev_inst = cpu_is_omap44xx() ? OMAP4430_PRM_DEVICE_INST :
+					   OMAP54XX_PRM_DEVICE_INST;
 
 	v = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
-				    OMAP4430_PRM_DEVICE_INST,
+				    dev_inst,
 				    OMAP4_PRM_RSTCTRL_OFFSET);
 	v |= OMAP4430_RST_GLOBAL_WARM_SW_MASK;
 	omap4_prminst_write_inst_reg(v, OMAP4430_PRM_PARTITION,
-				 OMAP4430_PRM_DEVICE_INST,
+				 dev_inst,
 				 OMAP4_PRM_RSTCTRL_OFFSET);
 
 	/* OCP barrier */
 	v = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
-				    OMAP4430_PRM_DEVICE_INST,
+				    dev_inst,
 				    OMAP4_PRM_RSTCTRL_OFFSET);
 }