[PATCH 3/3] Add support for xupv2p and ml410 boards.
Josh Boyer
jwboyer at jdub.homelinux.org
Wed Aug 22 11:13:27 EST 2007
On Tue, 21 Aug 2007 17:53:13 -0700
wolfgang.reissnegger at xilinx.com wrote:
> From: Stephen Neuendorffer <stephen.neuendorffer at xilinx.com>
>
> 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 <linux/xilinx_devices.h>
> +#include <platforms/4xx/xparameters/xparameters.h>
> +
> +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
More information about the Linuxppc-embedded
mailing list