Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: Samsung SoCs: preparation for single kernel
Date: Wed, 23 Jun 2010 10:28:55 +0300	[thread overview]
Message-ID: <20100623072855.GZ12255@atomide.com> (raw)
In-Reply-To: <AANLkTil-AOEqhMOXydaiA1X_v0rjoNQxALrO0UY638AS@mail.gmail.com>

* Eric Miao <eric.y.miao@gmail.com> [100623 03:48]:
> On Wed, Jun 23, 2010 at 7:27 AM, Kyungmin Park <kmpark@infradead.org> wrote:
> > To Ben,
> >
> > I really need single kernel for s5pc110 (cortex A8) and s5pc210
> > (cortex A9) at least.
> > Fortunately arm move to these approaches recently. but current Samsung
> > SoCs not prepare these one.
> >
> > So I wonder do you have a plan or how to address these issues?
> > How to assign the address at resources and use it at runtime?
> >
> > Personally I want to use cpu_is_*. but you reject it to use.
> > Other way is that we can create the base address variables and assign
> > it at init time.
> >
> > Please give your opinions.
> >
> > Thank you,
> > Kyungmin Park
> >
> > e.g., cpu_is_* usage at OMAP tree
> >
> > static void omap_init_mcspi(void)
> > {
> > ? ? ? ?if (cpu_is_omap44xx())
> > ? ? ? ? ? ? ? ?omap4_mcspi_fixup();
> >
> > ? ? ? ?platform_device_register(&omap2_mcspi1);
> > ? ? ? ?platform_device_register(&omap2_mcspi2);
> >
> > ? ? ? ?if (cpu_is_omap2430() || cpu_is_omap343x() || cpu_is_omap44xx())
> > ? ? ? ? ? ? ? ?omap2_mcspi3_init();
> >
> > ? ? ? ?if (cpu_is_omap343x() || cpu_is_omap44xx())
> > ? ? ? ? ? ? ? ?omap2_mcspi4_init();
> > }
> 
> Just my two cents: cpu_is_*() can be used, but only when absolutely necessary.
> The s3c does a CPU detection at startup, so I guess the usage of cpu_is_*()
> can be even reduced.
> 
> I'm not sure if the above case is a good reference or not. The omap_init_mcspi
> is called from omap2_init_devices(), while the registration can actually be
> made into the board init code when that device is used (some of the McSPIs are
> not used, and it's not necessary to register them), and the differences be
> handled in the driver.

Few comments regarding the cpu_is_omap macros: The macros should really be
soc_is_omapxxxx() instead cpu_is_omapxxxx().

Also, sprinkling these too much makes the code messy and hard to patch for
new processors. So you should limit the use to very selected places during
init, then set some flag like OMAP_HAS_MCSPI2 | OMAP_HAS_MCSPI3 or something
similar.

Regards,

Tony

  parent reply	other threads:[~2010-06-23  7:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-22 23:27 Samsung SoCs: preparation for single kernel Kyungmin Park
2010-06-23  0:50 ` Eric Miao
2010-06-23  1:47   ` Kyungmin Park
2010-06-23  1:54     ` Eric Miao
2010-06-23  2:01       ` Kyungmin Park
2010-06-23  6:25       ` Marek Szyprowski
2010-06-23  8:01         ` Eric Miao
2010-06-23  9:20           ` Marek Szyprowski
2010-06-23 10:24             ` Eric Miao
2010-06-24  2:08             ` Kyungmin Park
2010-06-24  5:52               ` Marek Szyprowski
2010-06-23  7:28   ` Tony Lindgren [this message]
2010-06-23  7:36     ` Eric Miao

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=20100623072855.GZ12255@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox