1 Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/avila-setup.c
2 ===================================================================
3 --- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/avila-setup.c
4 +++ linux-2.6.23.17/arch/arm/mach-ixp4xx/avila-setup.c
6 #include <linux/kernel.h>
7 #include <linux/init.h>
8 #include <linux/device.h>
9 +#include <linux/if_ether.h>
10 +#include <linux/socket.h>
11 +#include <linux/netdevice.h>
12 #include <linux/serial.h>
13 #include <linux/tty.h>
14 #include <linux/serial_8250.h>
15 #include <linux/slab.h>
16 +#ifdef CONFIG_SENSORS_EEPROM
17 +# include <linux/i2c.h>
18 +# include <linux/eeprom.h>
21 #include <linux/i2c-gpio.h>
23 #include <asm/types.h>
24 @@ -194,9 +202,48 @@ static void __init avila_fixup(struct ma
28 +#ifdef CONFIG_SENSORS_EEPROM
29 +static int loft_eeprom_do(struct notifier_block *self, unsigned long event, void *t)
31 + struct eeprom_data *data = t;
32 + struct sockaddr address;
33 + struct net_device * netdev ;
37 + /* The MACs are the first 12 bytes in the eeprom at address 0x51 */
38 + if (event == EEPROM_REGISTER && data->client.addr == 0x51) {
39 + data->attr->read(&data->client.dev.kobj, data->attr, macs, 0, 12);
41 + /* using dev_get_by_name here is really ugly and can cause
42 + * confusion if other ethernet devices are present. FIXME */
44 + memcpy(address.sa_data, macs, ETH_ALEN);
45 + memcpy(&avila_plat_eth[0].hwaddr, macs, ETH_ALEN);
46 + if ( (netdev = dev_get_by_name("eth0")) )
47 + netdev->set_mac_address(netdev, &address);
50 + memcpy(address.sa_data, macs + ETH_ALEN, ETH_ALEN);
51 + memcpy(&avila_plat_eth[1].hwaddr, macs + ETH_ALEN, ETH_ALEN);
52 + if ( (netdev = dev_get_by_name("eth1")) )
53 + netdev->set_mac_address(netdev, &address);
59 +static struct notifier_block loft_eeprom_notifier = {
60 + .notifier_call = loft_eeprom_do
64 static void __init avila_init(void)
67 +#ifdef CONFIG_SENSORS_EEPROM
68 + register_eeprom_notifier(&loft_eeprom_notifier);
71 avila_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
72 avila_flash_resource.end =