Best way of making some drivers common across kirkwood and orion5x SoCs?
A message that is not in the archive (sent off-list or not yet received): [email protected]
Dear Albert
Quoted 49 lines
-----Original Message-----
From: Albert ARIBAUD [mailto:albert.aribaud at free.fr]
Sent: Monday, November 02, 2009 5:46 PM
To: Prafulla Wadaskar
Subject: Re: [U-Boot] Best way of making some drivers common across kirkwood and orion5x SoCs?Prafulla Wadaskar a ?crit :
Quoted 4 lines
Quoted 3 lines
Still, the drivers would be full of 'KWxxx" and "kwxxx" symbols of which many are not kirkwood-specific actually.
Quoted 8 lines
Any way, those are not even orion specific nor Marvell specific. Those are related to the functionality supported by SOCs that may be customized by each SOC
Quoted 2 lines
In order for these drivers to compile with an orion5x SoC, I would have to adopt kirkwood names in the
What harm in this?
I would say it harms maintenability and reuseability of the code. If those drivers are neither kirkwood- nor even marvell-specific, then they
should not lead readers to believe they are, otherwise people might not
realize they can ruse these drivers in their own SoCs.Quoted 8 lines
Quoted 2 lines
orion5x code, which I don't like as much as I would like fixing the
If you see kernel code even there you can see kirkwood call from Orion drivers and vice versa.
Quoted 1 line
symbols to make them marvell-, not kirkwood-, specific.
This will not solve the root problem, what about some non
marvell SoC
Quoted 3 lines
have same h/w and want to reuse the code? Do we again change the suffixes? (kirkwood re-used external serial driver adopting external definitions).
Point valid and taken--see my suggestion below.
Quoted 1 line
I suggest here to adopt kw symbols in Orion. This would
make it clear
Quoted 1 line
for anybody that kirkwood code is reused by orion. With
this kirkwood
Quoted 1 line
drives will be untouched.
Quoted 9 lines
This does not solve the root problem any better than switching to Marvell prefixes, as you rightly point out. I thus suggest removing any
Marvell, Kirkwood or Orion prefixes from symbols in these drivers altogether. For instance, egiga symbols would takeEGIGA_as a prefix.
Then each SoC (kirkwood, orion5x, any other) header file would provide
adequate definitions (#defineEGIGA_xxxxyyyy).
I understands your concerns-
1. For SOC support Orion should be implemented similar to Kirkwood (you agreed on this)
2. For common drivers for (ex: kirkwood_egiga.c) the common code must be abstracted to egiga_core.c and architecture specific code must be supported through kirkwood_egiga.c/h and orion_egiga.c/h, this way it would make it more clean and structured.
Quoted 7 lines
Quoted 4 lines
While doing this reuse activity, if we find something blocking, certainly we should address that, but let's avoid changing identity of drivers.
I personally believe that having the Orion5x SoC dependent of the kirkwood one is blocking enough from a design standpoint.
What is your opinion with #2 suggestion?
Regards..
Prafulla . .
Quoted 7 lines
Quoted 2 lines
Regards.. Prafulla . .
Amicalement,
Signature · 1 line
Albert.
Hi PRafulla,
Prafulla Wadaskar a ?crit :
Quoted 2 lines
1. For SOC support Orion should be implemented similar to Kirkwood (you agreed on this)
I still do. :)
Quoted 4 lines
2. For common drivers for (ex:
kirkwood_egiga.c) the common code must be abstracted toegiga_core.cand architecture specific code must be supported through kirkwood_egiga.c/h and orion_egiga.c/h, this way it would make it more clean and structured.
Agreed.
Quoted 1 line
What is your opinion with #2 suggestion?
Sounds fine! I'll start submitting patches for both common drivers and orion support based on this proposal.
Regarding the arch-specific parts of current driver code, should they end up in cpu/arm926ejs/{kirkwood,orion5x} or stay in drivers/*? I tend like cpu/arm926ejs/* better as it puts everything arch-specific in a single place.
Amicalement,
Signature · 1 line
Albert.
Quoted 35 lines
-----Original Message-----
From: Albert ARIBAUD [mailto:albert.aribaud at free.fr]
Sent: Tuesday, November 10, 2009 12:27 AM
To: Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Ashish Karkare; Prabhanjan Sarnaik
Subject: Re: [U-Boot] Best way of making some drivers common across kirkwood and orion5x SoCs?Hi PRafulla,
Prafulla Wadaskar a ?crit :
Quoted 2 lines
1. For SOC support Orion should be implemented similar to Kirkwood (you agreed on this)
I still do. :)
Quoted 1 line
2. For common drivers for (ex:
kirkwood_egiga.c) thecommon code must
Quoted 1 line
be abstracted to
egiga_core.cand architecture specificcode must be
Quoted 1 line
supported through kirkwood_egiga.c/h and orion_egiga.c/h,
this way it
Quoted 1 line
would make it more clean and structured.
Agreed.
Quoted 1 line
What is your opinion with #2 suggestion?
Sounds fine! I'll start submitting patches for both common drivers and
orion support based on this proposal.
Quoted 5 lines
Regarding the arch-specific parts of current driver code, should they end up in cpu/arm926ejs/{kirkwood,orion5x} or stay in
drivers/*? I tend
like cpu/arm926ejs/* better as it puts everything arch-specific in a single place.
I agree for this. Good luck :-)
Regards...
Prafulla . . .
Quoted 5 lines
Amicalement,
Signature · 1 line
Albert.