RE: [PATCH 1/3] OMAP4: prcm: Add temporarily helper functions for rmw and read inside the PRM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 

> -----Original Message-----
> From: Cousson, Benoit 
> Sent: Monday, August 09, 2010 11:04 PM
> To: Kevin Hilman
> Cc: linux-omap@xxxxxxxxxxxxxxx; paul@xxxxxxxxx; Nayak, 
> Rajendra; Shilimkar, Santosh
> Subject: Re: [PATCH 1/3] OMAP4: prcm: Add temporarily helper 
> functions for rmw and read inside the PRM
> 
> On 8/9/2010 7:30 PM, Kevin Hilman wrote:
> > Benoit Cousson<b-cousson@xxxxxx>  writes:
> >
> >> Since OMAP4 is using an absolute address, the current PRM accessors
> >> are not useable.
> >> OMAP4 adaptation for these API are currently ongoing, so
> define temp
> >> version until the proper ones are defined.
> >
> > Curious what we're waiting for for the final versions of these?
> 
> That should be soon... Rajendra is working on that... among hundreds 
> other stuff.
> 
> Benoit

I just posted a couple of RFC patches for these now which
can be found here
https://patchwork.kernel.org/patch/118566/
https://patchwork.kernel.org/patch/118568/

> 
> > Kevin
> >
> >> Signed-off-by: Benoit Cousson<b-cousson@xxxxxx>
> >> Cc: Paul Walmsley<paul@xxxxxxxxx>
> >> Cc: Kevin Hilman<khilman@xxxxxxxxxxxxxxxxxxx>
> >> ---
> >>   arch/arm/mach-omap2/prcm.c             |   24 
> ++++++++++++++++++++++++
> >>   arch/arm/plat-omap/include/plat/prcm.h |    2 ++
> >>   2 files changed, 26 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/arch/arm/mach-omap2/prcm.c 
> b/arch/arm/mach-omap2/prcm.c
> >> index 96f4616..d4388d3 100644
> >> --- a/arch/arm/mach-omap2/prcm.c
> >> +++ b/arch/arm/mach-omap2/prcm.c
> >> @@ -216,6 +216,30 @@ u32 prm_read_mod_bits_shift(s16 
> domain, s16 idx, u32 mask)
> >>   	return v;
> >>   }
> >>
> >> +/* Read a PRM register, AND it, and shift the result down 
> to bit 0 */
> >> +u32 omap4_prm_read_bits_shift(void __iomem *reg, u32 mask)
> >> +{
> >> +	u32 v;
> >> +
> >> +	v = __raw_readl(reg);
> >> +	v&= mask;
> >> +	v>>= __ffs(mask);
> >> +
> >> +	return v;
> >> +}
> >> +
> >> +/* Read-modify-write a register in a PRM module. Caller 
> must lock */
> >> +u32 omap4_prm_rmw_reg_bits(u32 mask, u32 bits, void __iomem *reg)
> >> +{
> >> +	u32 v;
> >> +
> >> +	v = __raw_readl(reg);
> >> +	v&= ~mask;
> >> +	v |= bits;
> >> +	__raw_writel(v, reg);
> >> +
> >> +	return v;
> >> +}
> >>   /* Read a register in a CM module */
> >>   u32 cm_read_mod_reg(s16 module, u16 idx)
> >>   {
> >> diff --git a/arch/arm/plat-omap/include/plat/prcm.h 
> b/arch/arm/plat-omap/include/plat/prcm.h
> >> index 9fbd914..ab77442 100644
> >> --- a/arch/arm/plat-omap/include/plat/prcm.h
> >> +++ b/arch/arm/plat-omap/include/plat/prcm.h
> >> @@ -38,6 +38,8 @@ u32 prm_read_mod_reg(s16 module, u16 idx);
> >>   void prm_write_mod_reg(u32 val, s16 module, u16 idx);
> >>   u32 prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, 
> s16 idx);
> >>   u32 prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask);
> >> +u32 omap4_prm_read_bits_shift(void __iomem *reg, u32 mask);
> >> +u32 omap4_prm_rmw_reg_bits(u32 mask, u32 bits, void __iomem *reg);
> >>   u32 cm_read_mod_reg(s16 module, u16 idx);
> >>   void cm_write_mod_reg(u32 val, s16 module, u16 idx);
> >>   u32 cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
> 
> --
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux