From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Brownell Date: Fri, 12 Jun 2009 15:02:46 -0700 Subject: [U-Boot] [patch] rm9200 ethernet driver: board-specific quirk (csb337) In-Reply-To: <20090612213055.GB1802@game.jcrosoft.org> References: <200906091114.24166.david-b@pacbell.net> <20090612213055.GB1802@game.jcrosoft.org> Message-ID: <200906121502.46867.david-b@pacbell.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 ... > > + 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. > >