public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.aribaud@free.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] Best way of making some drivers common across kirkwood and orion5x SoCs?
Date: Mon, 02 Nov 2009 11:04:10 +0100	[thread overview]
Message-ID: <4AEEAE9A.4020304@free.fr> (raw)
In-Reply-To: <73173D32E9439E4ABB5151606C3E19E202F200EE58@SC-VEXCH1.marvell.com>

Prafulla Wadaskar a ?crit :

> Dear Albert
> 
> I propose the following strategy for this- For orion- let's follow
> the standard development strategy used for ARM architectures
> including Kirkwood. Since orion and kirkwood has lot of similarities
> but when both these will evolve for there entire supports there will
> be problems resulting code complexity.
> 
> So My suggestion is- let's develop orion as separate ARM SOC family
> as kirkwood.

This is what I intend to do, so that's fine with me.

> Some of Kirkwood drivers can be directly used with Orion, that can be
> addressed through makefiles as we used NS16550 Serial support in
> Kirkwood. SOC specific configuration in the common drivers (for ex.
> Egiga) can always be addressed through individual <asm/arch/*.h>

Agreed on reusing the drivers; again, that is what I intend to do.

Thus the only issue left is that the shared drivers (egiga, ehci, I2C,
gpio and, to a lesser extent, serial) #include the kirkwood.h file and
use kirkwood-defined symbols (e.g. KW_UART0_BASE) which ties them to the
kirkwood soc -- purely syntactically, as these symbols for the most part
are not actually kirkwood-specific.

The #include part I can handle with something like

#if defined (CONFIG_KIRKWOOD)
#include <asm/arch/kirkwood.h>
#elif defined (CONFIG_ORION5X)
#include <asm/arch/orion5x.h>
#else
#error egiga.c needs either CONFIG_KIRKWOOD or CONFIG_ORION5X.
#endif

in each driver, so yes, I can live without the 'soc.h' file renaming.

Still, the drivers would be full of 'KWxxx" and "kwxxx" symbols of which
many are not kirkwood-specific actually. In order for these drivers to
compile with an orion5x SoC, I would have to adopt kirkwood names in the
orion5x code, which I don't like as much as I would like fixing the
symbols to make them marvell-, not kirkwood-, specific.

Note that such fixing is rather trivial (tens of lines in the source
code, basically search and replace) and binary-invariant (I have patches
for these already that I can post for review upon request).

> It is always better to break down the entire work in the small
> pieces, it's easier to digest them faster :-)

Fine!

Amicalement,
-- 
Albert.

  reply	other threads:[~2009-11-02 10:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-31  9:12 [U-Boot] Best way of making some drivers common across kirkwood and orion5x SoCs? Albert ARIBAUD
2009-10-31  9:13 ` Albert ARIBAUD
2009-10-31 14:50 ` Wolfgang Denk
2009-10-31 15:12   ` Albert ARIBAUD
2009-10-31 15:23     ` Wolfgang Denk
2009-11-01  1:00       ` Albert ARIBAUD
2009-11-02  8:42         ` Prafulla Wadaskar
2009-11-02 10:04           ` Albert ARIBAUD [this message]
2009-11-02 11:29             ` Prafulla Wadaskar
2009-11-02 14:26               ` Albert ARIBAUD
2009-11-02  8:41     ` Prafulla Wadaskar
2009-11-01  6:12 ` Prafulla Wadaskar
     [not found] <4AEECD8E.1080803@free.fr>
2009-11-09 16:43 ` Prafulla Wadaskar
2009-11-09 18:57   ` Albert ARIBAUD
2009-11-10  1:54     ` Prafulla Wadaskar

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=4AEEAE9A.4020304@free.fr \
    --to=albert.aribaud@free.fr \
    --cc=u-boot@lists.denx.de \
    /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