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] [PATCH V7 0/4] Add disk support to orion5x and edminiv2
Date: Thu, 05 Aug 2010 16:11:43 +0200	[thread overview]
Message-ID: <4C5AC69F.3040304@free.fr> (raw)
In-Reply-To: <20100805130230.2C20C1524E3@gemini.denx.de>

Le 05/08/2010 15:02, Wolfgang Denk a ?crit :
> Dear Rogan Dawes,
>
> In message<4C5AB1A4.3000409@dawes.za.net>  you wrote:
>> This may be a stupid comment, but from my perspective implementing
>> Albert's orion5x changes for my DNS323, all I am doing is copying a lot
>> of what Albert is doing for the edminiv2 verbatim.
>>
>> Would it not make sense perhaps to define defaults in a SoC config file,
>> and then allow them to be overridden as required for each specific board?
>
> That would make sense, but quite often you don't know what will be
> common code and what not when writing the first version of such code.
>
> I recommend that you discuss with Albert (as part of the review
> process here) what should be handled as common driver code that you
> can easily reuse.
>
> It is pretty likely that your copied code would not be accepted for
> mainline, and you will be requested to factor out common parts when
> you submit it (that's quite often the fate for the second or third in
> such a row).
>
> Best regards,
>
> Wolfgang Denk

Rogan,

As Wolfgang points out, we need to know which code can be common and 
which cannot. IIRC, you are creating a new board for dns323, so you most 
probably copied the edminiv2 board code (board/LaCie/edminiv2/) and the 
edminiv2 config (include/configs/edminiv2).

As for configurations, I think they should be kept separate -- unless 
Wolfgang wants to do something similar to what is happening at the 
moment with ARM defconfigs in the Linux kernel, but he showed no sign of 
it. :)

As for the edminiv2 board code, it only provides three functions, 
board_flash_get_legacy(), board_init() and reset_phy().

We know that flash_get_legacy() cannot be shared (we both have non-CFI 
compliant flash chips, but they're different). Granted, we could rewrite 
it as a common/ function and keep the board-specifics in 
CONFIG_FLASH_LEGACY_xxxx defines (or a struct), but I don't see a 
benefit in code size, simplicity or clarity in this.

We could try to commonalize board_init(), which should only differ in 
machine type, but it is very small, so I don't see a great benefit in 
factorizing, and if any initialization is to be added later on to one 
board, we'd have to revert somehow.

What we could share is reset_phy() if your board has an MV88E1116 
Ethernet phy; then you could move reset_phy() to a driver in net/ that 
would be built conditionally to e.g. CONFIG_PHY_MV88E1116, and then you 
would add the corresponding #define to the edminiv2 and dns323 config files.

The rest of my devs (gbe, ide) is only a matter of setting the right 
configuration. Granted, that makes our config files more similar, but as 
I said, just because they are similar is not enough of a reason to 
factorize these IMO.

Rogan, what other code do you think you'd be duplicating?

Amicalement,
-- 
Albert.

  reply	other threads:[~2010-08-05 14:11 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-05 12:35 [U-Boot] [PATCH V7 0/4] Add disk support to orion5x and edminiv2 Albert Aribaud
2010-08-05 12:35 ` [U-Boot] [PATCH V7 1/4] ide: add configuration CONFIG_IDE_SWAP_IO Albert Aribaud
2010-08-05 12:35   ` [U-Boot] [PATCH V7 2/4] ide: add mvsata_ide driver Albert Aribaud
2010-08-05 12:35     ` [U-Boot] [PATCH V7 3/4] cmd_ide: add support for orion5x Albert Aribaud
2010-08-05 12:35       ` [U-Boot] [PATCH V7 4/4] edminiv2: add mvsata_ide and cmd_ide support Albert Aribaud
2010-08-05 18:48         ` Prafulla Wadaskar
2010-08-05 18:43       ` [U-Boot] [PATCH V7 3/4] cmd_ide: add support for orion5x Prafulla Wadaskar
2010-08-05 21:28         ` Albert ARIBAUD
2010-08-05 19:09     ` [U-Boot] [PATCH V7 2/4] ide: add mvsata_ide driver Prafulla Wadaskar
2010-08-05 21:29       ` Albert ARIBAUD
2010-08-06  9:38         ` Albert ARIBAUD
2010-08-07  6:39     ` Prafulla Wadaskar
2010-08-07  8:31       ` Albert ARIBAUD
2010-08-05 18:58   ` [U-Boot] [PATCH V7 1/4] ide: add configuration CONFIG_IDE_SWAP_IO Prafulla Wadaskar
2010-08-05 12:42 ` [U-Boot] [PATCH V7 0/4] Add disk support to orion5x and edminiv2 Rogan Dawes
2010-08-05 13:02   ` Wolfgang Denk
2010-08-05 14:11     ` Albert ARIBAUD [this message]
2010-08-05 14:28       ` Rogan Dawes
2010-08-05 15:12         ` Albert ARIBAUD
2010-08-05 15:35           ` Rogan Dawes
2010-08-05 18:25           ` Wolfgang Denk
2010-08-05 18:37             ` Prafulla Wadaskar
2010-08-06  7:08               ` Albert ARIBAUD
2010-08-06  8:18                 ` Prafulla Wadaskar
2010-08-06  9:09                   ` Albert ARIBAUD

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=4C5AC69F.3040304@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