1 diff -r -u linux-2.6.23.12/arch/arm/mach-ixp4xx/avila-setup.c ../../../../trunk/build_dir/linux-ixp4xx_generic/linux-2.6.23.12/arch/arm/mach-ixp4xx/avila-setup.c
2 --- linux-2.6.23.12/arch/arm/mach-ixp4xx/avila-setup.c 2008-01-04 01:28:24.134925761 +0100
3 +++ ../../../../trunk/build_dir/linux-ixp4xx_generic/linux-2.6.23.12/arch/arm/mach-ixp4xx/avila-setup.c 2008-01-04 01:23:27.874042817 +0100
5 #include <linux/kernel.h>
6 #include <linux/init.h>
7 #include <linux/device.h>
8 +#include <linux/if_ether.h>
9 +#include <linux/socket.h>
10 +#include <linux/netdevice.h>
11 #include <linux/serial.h>
12 #include <linux/tty.h>
13 #include <linux/serial_8250.h>
14 #include <linux/slab.h>
15 +#ifdef CONFIG_SENSORS_EEPROM
16 +# include <linux/i2c.h>
17 +# include <linux/eeprom.h>
20 #include <linux/i2c-gpio.h>
22 #include <asm/types.h>
27 +#ifdef CONFIG_SENSORS_EEPROM
28 +static int loft_eeprom_do(struct notifier_block *self, unsigned long event, void *t)
30 + struct eeprom_data *data = t;
31 + struct sockaddr address;
32 + struct net_device * netdev ;
36 + /* The MACs are the first 12 bytes in the eeprom at address 0x51 */
37 + if (event == EEPROM_REGISTER && data->client.addr == 0x51) {
38 + data->attr->read(&data->client.dev.kobj, data->attr, macs, 0, 12);
40 + /* using dev_get_by_name here is really ugly and can cause
41 + * confusion if other ethernet devices are present. FIXME */
43 + memcpy(address.sa_data, macs, ETH_ALEN);
44 + memcpy(&avila_plat_eth[0].hwaddr, macs, ETH_ALEN);
45 + if ( (netdev = dev_get_by_name("eth0")) )
46 + netdev->set_mac_address(netdev, &address);
49 + memcpy(address.sa_data, macs + ETH_ALEN, ETH_ALEN);
50 + memcpy(&avila_plat_eth[1].hwaddr, macs + ETH_ALEN, ETH_ALEN);
51 + if ( (netdev = dev_get_by_name("eth1")) )
52 + netdev->set_mac_address(netdev, &address);
58 +static struct notifier_block loft_eeprom_notifier = {
59 + .notifier_call = loft_eeprom_do
63 static void __init avila_init(void)
66 +#ifdef CONFIG_SENSORS_EEPROM
67 + register_eeprom_notifier(&loft_eeprom_notifier);
70 avila_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
71 avila_flash_resource.end =