linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: linux-omap <linux-omap@vger.kernel.org>,
	Hiroshi Doyu <hiroshi.doyu@nokia.com>,
	Ohad Ben-Cohen <ohad@wizery.com>
Subject: Re: [RFC/PATCH 5/8] omap: mailbox: reorganize omap2 platform_device
Date: Mon, 3 May 2010 11:10:48 -0700	[thread overview]
Message-ID: <20100503181048.GW29604@atomide.com> (raw)
In-Reply-To: <1272844967-25441-1-git-send-email-felipe.contreras@gmail.com>

* Felipe Contreras <felipe.contreras@gmail.com> [100502 16:58]:
> Makes more sense to register in the mach file, plus it will allow more
> functionality later on.
> 
> Also, this probably enables multi-omap for real.
> 
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>

<snip>
 
> --- a/arch/arm/mach-omap2/mailbox.c
> +++ b/arch/arm/mach-omap2/mailbox.c

You still probably want to optimize kernel size and memory
consumption for production kernels built for one omap:

#ifdef CONFIG_ARCH_OMAP2
  
> +static struct resource omap2_mbox_resources[] = {
> +	{
> +		.start		= OMAP24XX_MAILBOX_BASE,
> +		.end		= OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
> +		.flags		= IORESOURCE_MEM,
> +	},
> +	{
> +		.start		= INT_24XX_MAIL_U0_MPU,
> +		.flags		= IORESOURCE_IRQ,
> +	},
> +	{
> +		.start		= INT_24XX_MAIL_U3_MPU,
> +		.flags		= IORESOURCE_IRQ,
> +	},
> +};

#else
#define omap2_mbox_resources	NULL
#endif

And then do the same for omap3 and omap4.

BTW, looks like this could all be also set __initdata?

> @@ -443,7 +479,46 @@ static struct platform_driver omap2_mbox_driver = {
>  
>  static int __init omap2_mbox_init(void)
>  {
> +	int err;
> +	struct platform_device *pdev;
> +	struct resource *res;
> +	unsigned num;
> +
> +	if (cpu_is_omap3430()) {
> +		res = omap3_mbox_resources;
> +		num = ARRAY_SIZE(omap3_mbox_resources);
> +	}
> +	else if (cpu_is_omap2420()) {
> +		res = omap2_mbox_resources;
> +		num = ARRAY_SIZE(omap2_mbox_resources);
> +	}
> +	else if (cpu_is_omap44xx()) {
> +		res = omap4_mbox_resources;
> +		num = ARRAY_SIZE(omap4_mbox_resources);
> +	}
> +	else {
> +		pr_err("%s: platform not supported\n", __func__);
> +		return -ENODEV;
> +	}

Note that these tests will fail when building for one omap only
unless you have the #else statement for eacch omapX_mbox_resources[].

Regards,

Tony

  reply	other threads:[~2010-05-03 18:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-02 23:59 [RFC/PATCH 0/8] omap: mailbox: split platform_driver Felipe Contreras
2010-05-02 23:59 ` [RFC/PATCH 1/8] omap: mailbox: trivial cleanups Felipe Contreras
2010-05-02 23:59 ` [RFC/PATCH 2/8] omap: mailbox: reorganize structures Felipe Contreras
2010-05-02 23:59 ` [RFC/PATCH 3/8] omap: mailbox: 2420 should be detected at run-time Felipe Contreras
2010-05-02 23:59 ` [RFC/PATCH 4/8] omap: mailbox: reorganize omap2 registering Felipe Contreras
2010-05-03  0:02 ` [RFC/PATCH 5/8] omap: mailbox: reorganize omap2 platform_device Felipe Contreras
2010-05-03 18:10   ` Tony Lindgren [this message]
2010-05-03 18:14     ` Felipe Contreras
2010-05-03  0:02 ` [RFC/PATCH 6/8] omap: mailbox: more more stuff to omap2_mbox_init Felipe Contreras
2010-05-03 13:42   ` Kanigeri, Hari
2010-05-03 15:08     ` Felipe Contreras
2010-05-03 18:50       ` Kanigeri, Hari
2010-05-03 19:22         ` Felipe Contreras
2010-05-04  6:04         ` Hiroshi DOYU
2010-05-04  8:42           ` Felipe Contreras
2010-05-03  0:02 ` [RFC/PATCH 7/8] omap: mailbox: split platform_driver Felipe Contreras
2010-05-03  0:02 ` [RFC/PATCH 8/8] omap: mailbox: always built-in omap2 platform data Felipe Contreras

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=20100503181048.GW29604@atomide.com \
    --to=tony@atomide.com \
    --cc=felipe.contreras@gmail.com \
    --cc=hiroshi.doyu@nokia.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=ohad@wizery.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).