[PATCH v4 01/11] ARM: OMAP2+: CM: cm_inst offset s16->u16

Paul Walmsley paul at pwsan.com
Sun Sep 29 23:23:29 EDT 2013


Hi

On Thu, 26 Sep 2013, Afzal Mohammed wrote:

> Most of the AM43x CM reg address offsets are with MSB bit '1' (on
> 16-bit value) leading to arithmetic miscalculations while calculating
> CLOCK ENABLE register's address because cm_inst field was a type of
> "const s16", so make it "const u16".
> 
> Also modify relevant functions so as to take care of the above.
> 
> [afzal at ti.com: fixup and cleanup]
> 
> Signed-off-by: Ankur Kishore <a-kishore at ti.com>
> Signed-off-by: Afzal Mohammed <afzal at ti.com>
> ---
>  arch/arm/mach-omap2/clockdomain.h |  2 +-
>  arch/arm/mach-omap2/cm33xx.c      | 16 ++++++++--------
>  arch/arm/mach-omap2/cm33xx.h      | 10 +++++-----
>  arch/arm/mach-omap2/cminst44xx.c  | 20 ++++++++++----------
>  arch/arm/mach-omap2/cminst44xx.h  | 26 +++++++++++++-------------
>  5 files changed, 37 insertions(+), 37 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/clockdomain.h b/arch/arm/mach-omap2/clockdomain.h
> index 4b03394..5431b0c 100644
> --- a/arch/arm/mach-omap2/clockdomain.h
> +++ b/arch/arm/mach-omap2/clockdomain.h
> @@ -132,7 +132,7 @@ struct clockdomain {
>  	u8 _flags;
>  	const u8 dep_bit;
>  	const u8 prcm_partition;
> -	const s16 cm_inst;
> +	const u16 cm_inst;
>  	const u16 clkdm_offs;
>  	struct clkdm_dep *wkdep_srcs;
>  	struct clkdm_dep *sleepdep_srcs;

OMAP3 has at least one CM_INST that's negative:

./prcm-common.h:40:#define OMAP3430_IVA2_MOD				-0x800

Have you tested this on OMAP34xx/35xx to ensure that the generated 
addresses for IVA2_MOD-based addresses doesn't change?  Seems like there's 
a risk that they might change, due to sign extension.


- Paul



More information about the linux-arm-kernel mailing list