All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@ti.com>
To: "Hiremath, Vaibhav" <hvaibhav@ti.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"tony@atomide.com" <tony@atomide.com>,
	"Nayak, Rajendra" <rnayak@ti.com>
Subject: Re: [PATCH-V2 3/3] arm:omap:omap4: Hook-up am33xx support to existing prm code
Date: Wed, 01 Feb 2012 09:33:56 -0800	[thread overview]
Message-ID: <87obtifofv.fsf@ti.com> (raw)
In-Reply-To: <79CD15C6BA57404B839C016229A409A8317BB167@DBDE01.ent.ti.com> (Vaibhav Hiremath's message of "Wed, 1 Feb 2012 06:48:46 +0000")

"Hiremath, Vaibhav" <hvaibhav@ti.com> writes:

> On Tue, Jan 24, 2012 at 04:05:32, Hilman, Kevin wrote:
>> "Hiremath, Vaibhav" <hvaibhav@ti.com> writes:
>> 
>> > On Wed, Jan 11, 2012 at 21:48:25, Hiremath, Vaibhav wrote:
>> >> On Tue, Jan 10, 2012 at 23:39:22, Hilman, Kevin wrote:
>> >> > Vaibhav Hiremath <hvaibhav@ti.com> writes:
>> >> > 
>> >> > > AM33XX PRM module (L4_WK domain) will be treated as another seperate
>> >> > > partition in _prm_bases[] table.
>> >> > >
>> >> > > Also, since cpu_is_omap34xx check is true for am33xx family of
>> >> > > devices, we must check cpu_is_am33xx fisrt, in order to follow
>> >> > > omap4 execution path.
>> >> > 
>> >> > Can you remind me why cpu_is_omap34xx() is true for AM33xx family?
>> >> 
>> >> Yeah sure...
>> >> 
>> >> Kevin,
>> >> As mentioned before, the main idea behind bringing am33xx under omap34xx
>> >> was mainly due to "cortex-A8 family of devices".
>> >> 
>> >> It has been discussed and aligned long time back, so
>> >> please refer to the thread -
>> >> 
>> >> http://www.spinics.net/lists/linux-omap/msg41046.html
>> >> Multiple versions of -
>> >> http://www.spinics.net/lists/linux-omap/msg45505.html
>> >> 
>> >> Thanks,
>> >> Vaibhav
>> >> 
>> >> > These AM3xxx devices make my brain hurt.
>> >> > 
>> >> > > Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
>> >> > > Cc: Kevin Hilman <khilman@ti.com>
>> >> > > Cc: Rajendra Nayak <rnayak@ti.com>
>> >> > 
>> >> > [...]
>> >> > 
>> >> > > diff --git a/arch/arm/mach-omap2/prminst44xx.c b/arch/arm/mach-omap2/prminst44xx.c
>> >> > > index 3d9894f..fcc4123 100644
>> >> > > --- a/arch/arm/mach-omap2/prminst44xx.c
>> >> > > +++ b/arch/arm/mach-omap2/prminst44xx.c
>> >> > > @@ -19,6 +19,7 @@
>> >> > >  #include "common.h"
>> >> > >
>> >> > >  #include "prm44xx.h"
>> >> > > +#include "prm33xx.h"
>> >> > >  #include "prminst44xx.h"
>> >> > >  #include "prm-regbits-44xx.h"
>> >> > >  #include "prcm44xx.h"
>> >> > > @@ -31,6 +32,7 @@ static u32 _prm_bases[OMAP4_MAX_PRCM_PARTITIONS] = {
>> >> > >  	[OMAP4430_CM2_PARTITION]		= 0,
>> >> > >  	[OMAP4430_SCRM_PARTITION]		= 0,
>> >> > >  	[OMAP4430_PRCM_MPU_PARTITION]		= OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE),
>> >> > > +	[AM33XX_PRM_PARTITION]			= AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRM_BASE),
>> >> > >  };
>> >> > 
>> >> > I'm not crazy about just extending the "normal" OMAP4 table.  
>> >> 
>> >> If it is required then yes (with proper comment).
>> >> 
>> >> > That would
>> >> > imply that with each OMAP4 derivatve we keep extending this table.
>> >> > 
>> >> 
>> >> I would say anyway we will end up adding
>> >> Cpu_is_xxx everywhere as we add new table for derivatives.
>> >> 
>> >> > Instead, how about rename this to one to omap44xx_prm_bases[], then
>> >> > create a new one called am33xx_prm_bases[].  Then, at init time, assing
>> >> > _prm_bases to the right one based on cpu_is_.
>> >> > 
>> >> 
>> >> Just wanted to avoid cpu_is_xxxx check here. Will specific comment wouldn't
>> >> help here (I have clearly mentioned in patch description), may be in c file
>> >> it is required?
>> >> OR 
>> >> you want to be clearly separate table for code readability.
>> >> 
>> >
>> > Kevin,
>> >
>> > Any comments on this? Should I stick to what is implemented now?
>> >
>> 
>> cpu_is_* checks are acceptable at init time, and we use them often to
>> initialize SoC-dependent tables/arrays etc.
>> 
> Kevin,
>
> Sorry for delayed response,
>
> Here is the ugly part, which I was referring to -
>
> 1) "_prm_bases" variable is static variable to the prminst44xx.c
>
> 2) prminst44xx.c file doesn't contain any boot time __init function,
>    So I have to either add exported __init function OR extern __prm_bases
>    variable and initialize somewhere outside this file.
>
> 3) Even if I create 2 separate variables, for example,
>
> static u32 omap44xx_prm_bases[OMAP4_MAX_PRCM_PARTITIONS] = {
> ...
> };
>
> static u32 omap33xx_prm_bases[AM33XX_MAX_PRCM_PARTITIONS] = {
> ...
> };
>
> Makes it difficult and messy to handle inside below code, 
> BUG_ON doesn't make sense from AM335x perspective.

Then you can change the BUG_ON.

static u32 omap44xx_max_partitions = ARRAY_SIZE(omap44xx_prm_bases)
static u32 am33xx_max_partitions = ARRAY_SIZE(am33xx_prm_bases)
static u32 max_partitions.

At init time, assign max_partitions when you assign prm_bases, then
change the BUG_ON() to be something like:

       BUG_ON(part >= max_partitions || part == INVALID_PARTITION)

Kevin

  reply	other threads:[~2012-02-01 17:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-08 10:18 [PATCH-V2 0/3] arm:omap:omap4:Remove hardcoded reg-offs for PWRSTCTRL & PWRSTST Vaibhav Hiremath
2012-01-08 10:18 ` [PATCH-V2 1/3] arm:omap:omap4: Remove " Vaibhav Hiremath
2012-01-10 18:09   ` Kevin Hilman
2012-01-11 16:21     ` Hiremath, Vaibhav
2012-01-17  5:54     ` Hiremath, Vaibhav
2012-01-08 10:18 ` [PATCH-V2 2/3] arm:omap:omap4: Maintain virtual addr in in _prm_bases table Vaibhav Hiremath
2012-01-08 10:18 ` [PATCH-V2 3/3] arm:omap:omap4: Hook-up am33xx support to existing prm code Vaibhav Hiremath
2012-01-10 18:09   ` Kevin Hilman
2012-01-11 16:18     ` Hiremath, Vaibhav
2012-01-23  8:53     ` Hiremath, Vaibhav
2012-01-23 22:35       ` Kevin Hilman
2012-02-01  6:48         ` Hiremath, Vaibhav
2012-02-01 17:33           ` Kevin Hilman [this message]
2012-02-02  9:28             ` Hiremath, Vaibhav
2012-02-02 17:59               ` Kevin Hilman
2012-02-02 18:05             ` Hiremath, Vaibhav

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87obtifofv.fsf@ti.com \
    --to=khilman@ti.com \
    --cc=hvaibhav@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=rnayak@ti.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.