All of lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/8] at91: introduce commom AT91_BASE_SYS
Date: Fri, 1 Jul 2011 22:38:47 +0200	[thread overview]
Message-ID: <201107012238.47355.arnd@arndb.de> (raw)
In-Reply-To: <20110701172514.GG14408@game.jcrosoft.org>

On Friday 01 July 2011 19:25:14 Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 17:46 Fri 01 Jul     , Arnd Bergmann wrote:
> > As a general comment, please start with a cover-letter (the PATCH 0/8)
> > email that describes the overall intention of the series and holds
> > the combined diffstat.
>
> this detect dynamicly the soc and factorize the init of AT91 in one place
> as all the soc have the same init
> 
> this patch series is just a first step as switch to the CLKDEV

Ok, thanks for the explanation.

> On 17:46 Fri 01 Jul     , Arnd Bergmann wrote:
> > 
> > I think it would be easier to turn this around and have a very short
> > function here:
> > 
> > void __init at91_map_io(void)
> > {
> > 	/* Map peripherals */
> > 	iotable_init(&at91_io_desc, 1);
> > }
> > 
> > and then change each of the soc specific functions into
> > 
> > 
> > -void __init at91cap9_map_io(void)
> > +static void __init at91cap9_map_io(void)
> >  {
> > -       /* Map peripherals */
> > -       iotable_init(at91cap9_io_desc, ARRAY_SIZE(at91cap9_io_desc));
> > +	at91_boot_soc = at91cap9_soc;
> > +	at91_map_io();
> > +       iotable_init(at91cap9_sram_desc, ARRAY_SIZE(at91cap9_sram_desc));
> >  }
> > 
> > This would keep the per-soc code local and still consolidate the
> > common code without introducing (IMHO ugly) cpu_is_at91...() checks.
> we detect it this is the whole idea
> 
> so not this way is the oposit of the whole idea

I wouldn't say the whole idea. An major part of your patches is to use the
fact that you know the SoC, which is definitely useful. The change I mentioned
above would only provide a simpler way to get to that information, based
on the fact that you already know the specific board.

What is the advantage that you see of using the CPU register over a pointer
from the machine_desc?

Obviously, it doesn't matter much any more once you do the conversion to
device tree an end up with a of match table like

struct of_device_id at91_match_table[] = {
	{ .compatible = "atmel,at91cap9",  .data = &at91cap9_soc, },
	{ .compatible = "atmel,at91rm9200, .data = &at91rm9200_soc, },
	...
};

	Arnd

      reply	other threads:[~2011-07-01 20:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-01  6:44 [PATCH 1/8] at91: introduce commom AT91_BASE_SYS Jean-Christophe PLAGNIOL-VILLARD
2011-07-01  6:44 ` [PATCH 2/8] at91: factorize at91 interrupts init to soc Jean-Christophe PLAGNIOL-VILLARD
2011-07-01 15:47   ` Arnd Bergmann
2011-07-01 17:26     ` Jean-Christophe PLAGNIOL-VILLARD
2011-07-04  9:19   ` Christian Glindkamp
2011-07-05  5:37     ` Jean-Christophe PLAGNIOL-VILLARD
2011-07-01  6:44 ` [PATCH 3/8] at91: remove AT91_DBGU offset from dbgu register macro Jean-Christophe PLAGNIOL-VILLARD
2011-07-01 15:49   ` Arnd Bergmann
2011-07-27 12:05   ` [PATCH 3/8 v2] " Jean-Christophe PLAGNIOL-VILLARD
2011-07-01  6:44 ` [PATCH 4/8] at91: use structure to store the current soc Jean-Christophe PLAGNIOL-VILLARD
2011-07-01  6:44 ` [PATCH 5/8] at91: move clock subsystem init to soc generic init Jean-Christophe PLAGNIOL-VILLARD
2011-07-01  6:44 ` [PATCH 6/8] at91: move register clocks " Jean-Christophe PLAGNIOL-VILLARD
2011-07-01  6:44 ` [PATCH 7/8] at91: factorize sram init Jean-Christophe PLAGNIOL-VILLARD
2011-07-01  6:44 ` [PATCH 8/8] at91: add arch specific ioremap support Jean-Christophe PLAGNIOL-VILLARD
2011-07-01 15:59   ` Arnd Bergmann
2011-07-01 17:29     ` Jean-Christophe PLAGNIOL-VILLARD
2011-07-01 15:46 ` [PATCH 1/8] at91: introduce commom AT91_BASE_SYS Arnd Bergmann
2011-07-01 17:25   ` Jean-Christophe PLAGNIOL-VILLARD
2011-07-01 20:38     ` Arnd Bergmann [this message]

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=201107012238.47355.arnd@arndb.de \
    --to=arnd@arndb.de \
    --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 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.