[U-Boot] [patch] rm9200 ethernet driver: board-specific quirk (csb337)
David Brownell
david-b at pacbell.net
Sat Jun 13 00:02:46 CEST 2009
On Friday 12 June 2009, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 11:14 Tue 09 Jun , David Brownell wrote:
> I'm not really a fan of this
> but ok if I see the csn337 board patch
I meant to send that in before, thanks for the reminder.
The email I just sent has that.
If you don't like it, what would you propose instead?
Remember that *EVERY* Linux kernel (for example) is
expecting these boards to work this way. I don't
think it's realistic, or desirable, to change Linux
in this way. It's not supposed to matter what boot
loader gets used.
> > + /* The CSB337 originally used a version of the MicroMonitor bootloader
> > + * which saved Ethernet addresses in the "wrong" order. Operating
> > + * systems (like Linux) know this, and apply a workaround. Replicate
> > + * that MicroMonitor behavior so we avoid needing to make such OS code
> > + * care about which bootloader was used.
> > + */
> > + if (machine_is_csb337()) {
>
> please use ifdef to avoid other people size impact due this
The machine_is_X() macros are automatically #ifdeffed in
the header; no size impact. Read <asm/mach-types.h> ...
> > + p_mac->EMAC_SA2H = (enetaddr[0] << 8) | (enetaddr[1]);
> > + p_mac->EMAC_SA2L = (enetaddr[2] << 24) | (enetaddr[3] << 16)
> > + | (enetaddr[4] << 8) | (enetaddr[5]);
> > + } else {
> > + p_mac->EMAC_SA2L = (enetaddr[3] << 24) | (enetaddr[2] << 16)
> > + | (enetaddr[1] << 8) | (enetaddr[0]);
> > + p_mac->EMAC_SA2H = (enetaddr[5] << 8) | (enetaddr[4]);
> > + }
> >
> Best Regards,
> J.
>
>
More information about the U-Boot
mailing list