From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from jdub.homelinux.org (unknown [209.180.55.243]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id 97C12DDE3B for ; Wed, 22 Aug 2007 11:13:32 +1000 (EST) Date: Tue, 21 Aug 2007 20:13:27 -0500 From: Josh Boyer To: wolfgang.reissnegger@xilinx.com Subject: Re: [PATCH 3/3] Add support for xupv2p and ml410 boards. Message-ID: <20070821201327.046a95fd@vader.jdub.homelinux.org> In-Reply-To: <20070822005048.CF66B31005A@mail77-blu.bigfish.com> References: <1187743993171-git-send-email-wolfgang.reissnegger@xilinx.com> <1187743993360-git-send-email-wolfgang.reissnegger@xilinx.com> <20070822005048.CF66B31005A@mail77-blu.bigfish.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Cc: Stephen Neuendorffer , linuxppc-embedded@ozlabs.org List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, 21 Aug 2007 17:53:13 -0700 wolfgang.reissnegger@xilinx.com wrote: > From: Stephen Neuendorffer > > xupv2p support generates MAC addresses based on a silicon serial ID. General reminder, no new code will be accepted in arch/ppc. It's in bugfix state only. I of course have no problems with people sending patches for new stuff, but I don't want people to get the idea that it will wind up in tree. > +#include > +#include > + > +int virtex_device_fixup(struct platform_device *dev) Could this be a static function? > +{ > +#ifdef XPAR_ONEWIRE_0_BASEADDR > + int i; > + // Use the Silicon Serial ID attached on the onewire bus to > + // generate sensible MAC addresses. No C++ style comments please. > + unsigned char *p_onewire = ioremap(XPAR_ONEWIRE_0_BASEADDR, 6); What happens if ioremap fails? > + struct xemac_platform_data *pdata = dev->dev.platform_data; > + if (strcmp(dev->name, "xilinx_emac") == 0) { > + printk(KERN_INFO "Fixup MAC address for %s:%d\n", > + dev->name, dev->id); > + // FIXME.. this doesn't seem to return data that is consistent > + // with the self test... why not? > + pdata->mac_addr[0] = 0x00; > + pdata->mac_addr[1] = 0x0A; > + pdata->mac_addr[2] = 0x35; > + pdata->mac_addr[3] = dev->id; > + pdata->mac_addr[4] = p_onewire[4]; > + pdata->mac_addr[5] = p_onewire[5]; > + pr_debug(KERN_INFO > + "MAC address is now %2x:%2x:%2x:%2x:%2x:%2x\n", > + pdata->mac_addr[0], pdata->mac_addr[1], > + pdata->mac_addr[2], pdata->mac_addr[3], > + pdata->mac_addr[4], pdata->mac_addr[5]); > + } > + iounmap(p_onewire); > +#endif > + return 0; > +} > --- /dev/null > +++ b/arch/ppc/platforms/4xx/xparameters/xparameters_ml41x.h > @@ -0,0 +1,277 @@ > + > +/******************************************************************* > +* > +* CAUTION: This file is automatically generated by libgen. > +* Version: Xilinx EDK 8.2.02 EDK_Im_Sp2.4 > +* DO NOT EDIT. > +* > +* Copyright (c) 2005 Xilinx, Inc. All rights reserved. All rights reserved is not compatible with the GPL I don't think... josh