Update the IXP4xx, NSLU2, and NAS100D patches with those from the

NSLU2-Linux repository.

svn path=/dists/trunk/linux-2.6/; revision=8925
This commit is contained in:
Gordon Farquharson 2007-06-07 04:23:44 +00:00
parent ab276ef960
commit f260cd9443
15 changed files with 2765 additions and 5117 deletions

View File

@ -109,6 +109,8 @@ CONFIG_MACH_NAS100D=y
#
CONFIG_DMABOUNCE=y
# CONFIG_IXP4XX_INDIRECT_PCI is not set
CONFIG_IXP4XX_QMGR=m
CONFIG_IXP4XX_NPE=m
#
# Processor Type
@ -787,11 +789,7 @@ CONFIG_CICADA_PHY=m
#
CONFIG_NET_ETHERNET=y
CONFIG_MII=y
CONFIG_IXP4XX_QMGR=m
CONFIG_IXP4XX_NPE=m
CONFIG_IXP4XX_FW_LOAD=y
CONFIG_IXP4XX_MAC=m
CONFIG_IXP4XX_CRYPTO=m
CONFIG_IXP4XX_ETH=m
# CONFIG_HAPPYMEAL is not set
# CONFIG_SUNGEM is not set
# CONFIG_CASSINI is not set
@ -1039,12 +1037,13 @@ CONFIG_I2C_ALGOBIT=y
# CONFIG_I2C_ALI15X3 is not set
# CONFIG_I2C_AMD756 is not set
# CONFIG_I2C_AMD8111 is not set
CONFIG_I2C_GPIO=y
# CONFIG_I2C_I801 is not set
# CONFIG_I2C_I810 is not set
# CONFIG_I2C_PIIX4 is not set
# CONFIG_I2C_IOP3XX is not set
CONFIG_I2C_ISA=m
CONFIG_I2C_IXP4XX=y
# CONFIG_I2C_IXP4XX is not set
# CONFIG_I2C_NFORCE2 is not set
# CONFIG_I2C_PARPORT_LIGHT is not set
# CONFIG_I2C_PROSAVAGE is not set

7
debian/changelog vendored
View File

@ -40,11 +40,14 @@ linux-2.6 (2.6.22~rc4-1~experimental.1) UNRELEASED; urgency=low
* Add Xen licensing info to the copyright file. (closes: #368912)
[ Gordon Farquharson ]
* arm/ixp4xx: Update NPE driver for 2.6.22.
* arm: Mark CHELSIO_T3, NETXEN_NIC, BCM43XX, VIDEO_BT848,
DVB_B2C2_FLEXCOP, and DVB_BUDGET as broken on ARM.
* arm/ixp4xx: Replace IXP4xx network drivers (Qmgr, NPE, Ethernet,
HSS) with the ones written by Krzysztof Halasa.
* arm/ixp4xx: Add support for the new generic I2C GPIO driver on the
NSLU2 and the NAS100D. Thanks to Michael-Luke Jones and Rod Whitby.
-- maximilian attems <maks@debian.org> Wed, 06 Jun 2007 19:37:50 +0200
-- Gordon Farquharson <gordonfarquharson@gmail.com> Wed, 6 Jun 2007 22:04:46 -0600
linux-2.6 (2.6.21-3) UNRELEASED; urgency=low

View File

@ -1,46 +0,0 @@
---
drivers/net/ixp4xx/mac_driver.c | 24 ++++++++++--------------
1 file changed, 10 insertions(+), 14 deletions(-)
Index: linux-2.6.20-rc3/drivers/net/ixp4xx/mac_driver.c
===================================================================
--- linux-2.6.20-rc3.orig/drivers/net/ixp4xx/mac_driver.c
+++ linux-2.6.20-rc3/drivers/net/ixp4xx/mac_driver.c
@@ -350,6 +350,16 @@
mac->npe_stat_num = i<NPE_STAT_NUM ? NPE_STAT_NUM_BASE : NPE_STAT_NUM;
mac->npe_stat_num += NPE_Q_STAT_NUM;
+ /* Only use platform or random if there's currently no device hw addr */
+ if (is_zero_ether_addr(dev->dev_addr)) {
+ if (is_zero_ether_addr(mac->plat->hwaddr)) {
+ random_ether_addr(dev->dev_addr);
+ dev->dev_addr[5] = mac->plat->phy_id;
+ }
+ else
+ memcpy(dev->dev_addr, mac->plat->hwaddr, 6);
+ }
+
mac_set_uniaddr(dev);
media_check(dev, 1);
ixmac_set_rx_mode(dev);
@@ -692,20 +702,6 @@
INIT_DELAYED_WORK(&mac->mdio_thread, mac_mdio_thread);
- /* The place of the MAC address is very system dependent.
- * Here we use a random one to be replaced by one of the
- * following commands:
- * "ip link set address 02:03:04:04:04:01 dev eth0"
- * "ifconfig eth0 hw ether 02:03:04:04:04:07"
- */
-
- if (is_zero_ether_addr(plat->hwaddr)) {
- random_ether_addr(dev->dev_addr);
- dev->dev_addr[5] = plat->phy_id;
- }
- else
- memcpy(dev->dev_addr, plat->hwaddr, 6);
-
printk(KERN_INFO IXMAC_NAME " driver " IXMAC_VERSION
": %s on %s with PHY[%d] initialized\n",
dev->name, npe->plat->name, plat->phy_id);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,87 @@
Index: linux-2.6.22-rc3-armeb/arch/arm/mach-ixp4xx/common.c
===================================================================
--- linux-2.6.22-rc3-armeb.orig/arch/arm/mach-ixp4xx/common.c 2007-05-27 07:07:26.000000000 -0700
+++ linux-2.6.22-rc3-armeb/arch/arm/mach-ixp4xx/common.c 2007-05-27 07:08:24.000000000 -0700
@@ -486,3 +486,17 @@
clockevents_register_device(&clockevent_ixp4xx);
return 0;
}
+
+/* fuses */
+
+u32 ixp4xx_read_fuses(void)
+{
+ unsigned int fuses = ~*IXP4XX_EXP_CFG2;
+ fuses &= ~IXP4XX_FUSE_RESERVED;
+ if (!cpu_is_ixp46x())
+ fuses &= ~IXP4XX_FUSE_IXP46X_ONLY;
+
+ return fuses;
+}
+
+EXPORT_SYMBOL(ixp4xx_read_fuses);
Index: linux-2.6.22-rc3-armeb/include/asm-arm/arch-ixp4xx/platform.h
===================================================================
--- linux-2.6.22-rc3-armeb.orig/include/asm-arm/arch-ixp4xx/platform.h 2007-05-27 07:07:26.000000000 -0700
+++ linux-2.6.22-rc3-armeb/include/asm-arm/arch-ixp4xx/platform.h 2007-05-27 10:18:14.000000000 -0700
@@ -120,6 +120,47 @@
extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
+/* Fuse definitions and functions */
+
+/* Fuse Bits of IXP_EXP_CFG2 */
+#define IXP4XX_FUSE_RCOMP (1 << 0)
+#define IXP4XX_FUSE_USB_DEVICE (1 << 1)
+#define IXP4XX_FUSE_HASH (1 << 2)
+#define IXP4XX_FUSE_AES (1 << 3)
+#define IXP4XX_FUSE_DES (1 << 4)
+#define IXP4XX_FUSE_HDLC (1 << 5)
+#define IXP4XX_FUSE_AAL (1 << 6)
+#define IXP4XX_FUSE_HSS (1 << 7)
+#define IXP4XX_FUSE_UTOPIA (1 << 8)
+#define IXP4XX_FUSE_NPEB_ETH0 (1 << 9)
+#define IXP4XX_FUSE_NPEC_ETH (1 << 10)
+#define IXP4XX_FUSE_RESET_NPEA (1 << 11)
+#define IXP4XX_FUSE_RESET_NPEB (1 << 12)
+#define IXP4XX_FUSE_RESET_NPEC (1 << 13)
+#define IXP4XX_FUSE_PCI (1 << 14)
+#define IXP4XX_FUSE_ECC_TIMESYNC (1 << 15)
+#define IXP4XX_FUSE_UTOPIA_PHY_LIMIT (3 << 16)
+#define IXP4XX_FUSE_USB_HOST (1 << 18)
+#define IXP4XX_FUSE_NPEA_ETH (1 << 19)
+#define IXP4XX_FUSE_NPEB_ETH_1_TO_3 (1 << 20)
+#define IXP4XX_FUSE_RSA (1 << 21)
+#define IXP4XX_FUSE_XSCALE_MAX_FREQ (3 << 22)
+#define IXP4XX_FUSE_RESERVED (0xFF << 24)
+
+#define IXP4XX_FUSE_IXP46X_ONLY (IXP4XX_FUSE_ECC_TIMESYNC | \
+ IXP4XX_FUSE_USB_HOST | \
+ IXP4XX_FUSE_NPEA_ETH | \
+ IXP4XX_FUSE_NPEB_ETH_1_TO_3 | \
+ IXP4XX_FUSE_RSA | \
+ IXP4XX_FUSE_XSCALE_MAX_FREQ)
+
+extern u32 ixp4xx_read_fuses(void);
+
+static inline void ixp4xx_write_fuses(u32 value)
+{
+ *IXP4XX_EXP_CFG2 = ~value;
+}
+
/*
* GPIO-functions
*/
Index: linux-2.6.22-rc3-armeb/arch/arm/kernel/setup.c
===================================================================
--- linux-2.6.22-rc3-armeb.orig/arch/arm/kernel/setup.c 2007-05-27 07:07:26.000000000 -0700
+++ linux-2.6.22-rc3-armeb/arch/arm/kernel/setup.c 2007-05-27 07:08:24.000000000 -0700
@@ -60,6 +60,8 @@
extern void _stext, _text, _etext, __data_start, _edata, _end;
unsigned int processor_id;
+EXPORT_SYMBOL(processor_id);
+
unsigned int __machine_arch_type;
EXPORT_SYMBOL(__machine_arch_type);

File diff suppressed because it is too large Load Diff

View File

@ -1,56 +0,0 @@
---
arch/arm/mach-ixp4xx/nas100d-setup.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
Index: linux-2.6.19/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.19.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.19/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -16,6 +16,7 @@
#include <linux/serial.h>
#include <linux/serial_8250.h>
#include <linux/leds.h>
+#include <linux/mtd/mtd.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -165,6 +166,30 @@ static struct platform_device *nas100d_d
&nas100d_npe_ucode,
};
+static void nas100d_flash_add(struct mtd_info *mtd)
+{
+ if (strcmp(mtd->name, "RedBoot config") == 0) {
+ size_t retlen;
+ u_char mac[6];
+
+ if (mtd->read(mtd, 0x0FD8, 6, &retlen, mac) == 0 && retlen == 6) {
+ printk(KERN_INFO "nas100d mac: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+ memcpy(plat_mac0.hwaddr, mac, 6);
+ } else {
+ printk(KERN_ERR "nas100d mac: read failed\n");
+ }
+ }
+}
+
+static void nas100d_flash_remove(struct mtd_info *mtd) {
+}
+
+static struct mtd_notifier nas100d_flash_notifier = {
+ .add = nas100d_flash_add,
+ .remove = nas100d_flash_remove,
+};
+
static void nas100d_power_off(void)
{
/* This causes the box to drop the power and go dead. */
@@ -196,6 +221,8 @@ static void __init nas100d_init(void)
(void)platform_device_register(&nas100d_uart);
platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices));
+
+ register_mtd_user(&nas100d_flash_notifier);
}
MACHINE_START(NAS100D, "Iomega NAS 100d")

View File

@ -0,0 +1,44 @@
Index: linux-2.6.22-rc1-armeb/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.22-rc1-armeb.orig/arch/arm/mach-ixp4xx/nas100d-setup.c 2007-05-13 04:54:45.000000000 -0700
+++ linux-2.6.22-rc1-armeb/arch/arm/mach-ixp4xx/nas100d-setup.c 2007-05-13 05:05:44.000000000 -0700
@@ -16,6 +16,7 @@
#include <linux/serial.h>
#include <linux/serial_8250.h>
#include <linux/leds.h>
+#include <linux/i2c-gpio.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -68,16 +69,17 @@
};
#endif
-static struct ixp4xx_i2c_pins nas100d_i2c_gpio_pins = {
+static struct i2c_gpio_platform_data nas100d_i2c_gpio_data = {
.sda_pin = NAS100D_SDA_PIN,
.scl_pin = NAS100D_SCL_PIN,
};
-static struct platform_device nas100d_i2c_controller = {
- .name = "IXP4XX-I2C",
+static struct platform_device nas100d_i2c_gpio = {
+ .name = "i2c-gpio",
.id = 0,
- .dev.platform_data = &nas100d_i2c_gpio_pins,
- .num_resources = 0,
+ .dev = {
+ .platform_data = &nas100d_i2c_gpio_data,
+ },
};
static struct resource nas100d_uart_resources[] = {
@@ -124,7 +126,7 @@
};
static struct platform_device *nas100d_devices[] __initdata = {
- &nas100d_i2c_controller,
+ &nas100d_i2c_gpio,
&nas100d_flash,
#ifdef CONFIG_LEDS_IXP4XX
&nas100d_leds,

View File

@ -0,0 +1,34 @@
Index: linux-2.6.22-rc3-armeb/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.22-rc3-armeb.orig/arch/arm/mach-ixp4xx/nas100d-setup.c 2007-05-27 05:03:46.000000000 -0700
+++ linux-2.6.22-rc3-armeb/arch/arm/mach-ixp4xx/nas100d-setup.c 2007-05-27 12:52:12.000000000 -0700
@@ -125,12 +125,29 @@
.resource = nas100d_uart_resources,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct mac_plat_info nas100d_plat_mac[] = {
+ {
+ .phy = 0,
+ .rxq = 3,
+ }
+};
+
+static struct platform_device nas100d_mac[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = nas100d_plat_mac,
+ }
+};
+
static struct platform_device *nas100d_devices[] __initdata = {
&nas100d_i2c_gpio,
&nas100d_flash,
#ifdef CONFIG_LEDS_IXP4XX
&nas100d_leds,
#endif
+ &nas100d_mac[0],
};
static void nas100d_power_off(void)

View File

@ -1,40 +1,52 @@
Index: linux-2.6.19/arch/arm/mach-ixp4xx/nas100d-setup.c
Index: linux-2.6.22-rc4-armeb/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.19.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.19/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -123,12 +123,35 @@ static struct platform_device nas100d_ua
.resource = nas100d_uart_resources,
--- linux-2.6.22-rc4-armeb.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.22-rc4-armeb/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -17,6 +17,7 @@
#include <linux/serial_8250.h>
#include <linux/leds.h>
#include <linux/i2c-gpio.h>
+#include <linux/mtd/mtd.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -150,6 +151,30 @@ static struct platform_device *nas100d_d
&nas100d_mac[0],
};
+static struct resource res_mac0 = {
+ .start = IXP4XX_EthB_BASE_PHYS,
+ .end = IXP4XX_EthB_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+static void nas100d_flash_add(struct mtd_info *mtd)
+{
+ if (strcmp(mtd->name, "RedBoot config") == 0) {
+ size_t retlen;
+ u_char mac[6];
+
+ if (mtd->read(mtd, 0x0FD8, 6, &retlen, mac) == 0 && retlen == 6) {
+ printk(KERN_INFO "nas100d mac: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+ memcpy(nas100d_plat_mac[0].hwaddr, mac, 6);
+ } else {
+ printk(KERN_ERR "nas100d mac: read failed\n");
+ }
+ }
+}
+
+static void nas100d_flash_remove(struct mtd_info *mtd) {
+}
+
+static struct mtd_notifier nas100d_flash_notifier = {
+ .add = nas100d_flash_add,
+ .remove = nas100d_flash_remove,
+};
+
+static struct mac_plat_info plat_mac0 = {
+ .npe_id = 1,
+ .phy_id = 0,
+ .eth_id = 0,
+ .rxq_id = 27,
+ .txq_id = 24,
+};
+
+static struct platform_device mac0 = {
+ .name = "ixp4xx_mac",
+ .id = 0,
+ .dev.platform_data = &plat_mac0,
+ .num_resources = 1,
+ .resource = &res_mac0,
+};
+
static struct platform_device *nas100d_devices[] __initdata = {
&nas100d_i2c_controller,
&nas100d_flash,
#ifdef CONFIG_LEDS_IXP4XX
&nas100d_leds,
#endif
+ &mac0
};
static void nas100d_power_off(void)
{
/* This causes the box to drop the power and go dead. */
@@ -182,6 +207,8 @@ static void __init nas100d_init(void)
(void)platform_device_register(&nas100d_uart);
platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices));
+
+ register_mtd_user(&nas100d_flash_notifier);
}
MACHINE_START(NAS100D, "Iomega NAS 100d")

View File

@ -1,56 +0,0 @@
diff -Naurp linux-2.6.22-rc4.orig/arch/arm/mach-ixp4xx/nslu2-setup.c linux-2.6.22-rc4/arch/arm/mach-ixp4xx/nslu2-setup.c
--- linux-2.6.22-rc4.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2007-06-05 20:37:07.000000000 -0600
+++ linux-2.6.22-rc4/arch/arm/mach-ixp4xx/nslu2-setup.c 2007-06-05 21:12:36.000000000 -0600
@@ -17,6 +17,7 @@
#include <linux/kernel.h>
#include <linux/serial.h>
#include <linux/serial_8250.h>
+#include <linux/mtd/mtd.h>
#include <linux/leds.h>
#include <asm/mach-types.h>
@@ -171,8 +172,44 @@ static struct sys_timer nslu2_timer = {
.init = nslu2_timer_init,
};
+/*
+ * When the RedBoot partition is added the MAC address is read from
+ * it.
+ */
+static void nslu2_flash_add(struct mtd_info *mtd) {
+ if (strcmp(mtd->name, "RedBoot") == 0) {
+ size_t retlen;
+ u_char mac[6];
+
+ /* The MAC is at a known offset... */
+ if (mtd->read(mtd, 0x3FFB0, 6, &retlen, mac) == 0 && retlen == 6) {
+ printk(KERN_INFO "NSLU2 MAC: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+ memcpy(&plat_mac0.hwaddr, mac, 6);
+ } else {
+ printk(KERN_ERR "NSLU2 MAC: read failed\n");
+ }
+ }
+}
+
+/*
+ * Nothing to do on remove at present.
+ */
+static void nslu2_flash_remove(struct mtd_info *mtd) {
+}
+
+static struct mtd_notifier nslu2_flash_notifier = {
+ .add = nslu2_flash_add,
+ .remove = nslu2_flash_remove,
+};
+
static void __init nslu2_init(void)
{
+ /* The flash has an ethernet MAC embedded in it which we need,
+ * that is all this notifier does.
+ */
+ register_mtd_user(&nslu2_flash_notifier);
+
ixp4xx_sys_init();
nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);

View File

@ -0,0 +1,47 @@
Index: linux-2.6.22-rc1-armeb/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.22-rc1-armeb.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2007-05-13 04:54:45.000000000 -0700
+++ linux-2.6.22-rc1-armeb/arch/arm/mach-ixp4xx/nslu2-setup.c 2007-05-13 05:01:20.000000000 -0700
@@ -18,6 +18,7 @@
#include <linux/serial.h>
#include <linux/serial_8250.h>
#include <linux/leds.h>
+#include <linux/i2c-gpio.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -41,7 +42,7 @@
.resource = &nslu2_flash_resource,
};
-static struct ixp4xx_i2c_pins nslu2_i2c_gpio_pins = {
+static struct i2c_gpio_platform_data nslu2_i2c_gpio_data = {
.sda_pin = NSLU2_SDA_PIN,
.scl_pin = NSLU2_SCL_PIN,
};
@@ -82,11 +83,12 @@
};
#endif
-static struct platform_device nslu2_i2c_controller = {
- .name = "IXP4XX-I2C",
+static struct platform_device nslu2_i2c_gpio = {
+ .name = "i2c-gpio",
.id = 0,
- .dev.platform_data = &nslu2_i2c_gpio_pins,
- .num_resources = 0,
+ .dev = {
+ .platform_data = &nslu2_i2c_gpio_data,
+ },
};
static struct platform_device nslu2_beeper = {
@@ -139,7 +141,7 @@
};
static struct platform_device *nslu2_devices[] __initdata = {
- &nslu2_i2c_controller,
+ &nslu2_i2c_gpio,
&nslu2_flash,
&nslu2_beeper,
#ifdef CONFIG_LEDS_IXP4XX

View File

@ -0,0 +1,35 @@
Index: linux-2.6.22-rc1-armeb/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.22-rc1-armeb.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2007-05-16 08:10:47.000000000 -0700
+++ linux-2.6.22-rc1-armeb/arch/arm/mach-ixp4xx/nslu2-setup.c 2007-05-16 08:15:14.000000000 -0700
@@ -140,6 +140,22 @@
.resource = nslu2_uart_resources,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct mac_plat_info nslu2_plat_mac[] = {
+ {
+ .phy = 1,
+ .rxq = 3,
+ }
+};
+
+static struct platform_device nslu2_mac[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = nslu2_plat_mac,
+ }
+};
+
static struct platform_device *nslu2_devices[] __initdata = {
&nslu2_i2c_gpio,
&nslu2_flash,
@@ -147,6 +163,7 @@
#ifdef CONFIG_LEDS_IXP4XX
&nslu2_leds,
#endif
+ &nslu2_mac[0],
};
static void nslu2_power_off(void)

View File

@ -1,41 +1,52 @@
Index: linux-2.6.18/arch/arm/mach-ixp4xx/nslu2-setup.c
Index: linux-2.6.22-rc4-armeb/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.18.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-10-01 23:12:35.000000000 +0200
+++ linux-2.6.18/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-10-01 23:12:40.000000000 +0200
@@ -139,6 +139,28 @@
.resource = nslu2_uart_resources,
--- linux-2.6.22-rc4-armeb.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ linux-2.6.22-rc4-armeb/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -19,6 +19,7 @@
#include <linux/serial_8250.h>
#include <linux/leds.h>
#include <linux/i2c-gpio.h>
+#include <linux/mtd/mtd.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -166,6 +167,30 @@ static struct platform_device *nslu2_dev
&nslu2_mac[0],
};
+static struct resource res_mac0 = {
+ .start = IXP4XX_EthB_BASE_PHYS,
+ .end = IXP4XX_EthB_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+static void nslu2_flash_add(struct mtd_info *mtd)
+{
+ if (strcmp(mtd->name, "RedBoot") == 0) {
+ size_t retlen;
+ u_char mac[6];
+
+ if (mtd->read(mtd, 0x3FFB0, 6, &retlen, mac) == 0 && retlen == 6) {
+ printk(KERN_INFO "nslu2 mac: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+ memcpy(nslu2_plat_mac[0].hwaddr, mac, 6);
+ } else {
+ printk(KERN_ERR "nslu2 mac: read failed\n");
+ }
+ }
+}
+
+static void nslu2_flash_remove(struct mtd_info *mtd) {
+}
+
+static struct mtd_notifier nslu2_flash_notifier = {
+ .add = nslu2_flash_add,
+ .remove = nslu2_flash_remove,
+};
+
+static struct mac_plat_info plat_mac0 = {
+ .npe_id = 1,
+ .phy_id = 1,
+ .eth_id = 0,
+ .rxq_id = 27,
+ .txq_id = 24,
+};
+
+static struct platform_device mac0 = {
+ .name = "ixp4xx_mac",
+ .id = 0,
+ .dev.platform_data = &plat_mac0,
+ .num_resources = 1,
+ .resource = &res_mac0,
+};
+
static struct platform_device *nslu2_devices[] __initdata = {
&nslu2_i2c_controller,
&nslu2_flash,
@@ -146,6 +168,7 @@
#ifdef CONFIG_LEDS_IXP4XX
&nslu2_leds,
#endif
+ &mac0
};
static void nslu2_power_off(void)
{
/* This causes the box to drop the power and go dead. */
@@ -208,6 +233,8 @@ static void __init nslu2_init(void)
(void)platform_device_register(&nslu2_uart);
platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices));
+
+ register_mtd_user(&nslu2_flash_notifier);
}
MACHINE_START(NSLU2, "Linksys NSLU2")

View File

@ -19,12 +19,14 @@
+ bugfix/mips/tulip_dc21143.patch
+ features/mips/qemu-vga.patch
+ features/mips/sb1-duart.patch
+ features/arm/ixp4xx-net-fuses.patch
+ features/arm/ixp4xx-net-drivers.patch
+ features/arm/nslu2-i2c-gpio-driver-support.patch
+ features/arm/nas100d-i2c-gpio-driver-support.patch
+ features/arm/nslu2-mac_plat_info.patch
+ features/arm/nas100d-mac_plat_info.patch
+ features/arm/nslu2-setup-mac.patch
+ features/arm/nslu2-eth-mac.patch
+ features/arm/nas100d-setup-mac.patch
+ features/arm/nas100d-eth-mac.patch
+ features/arm/ixp4xx-npe-driver-0.3.1.patch
+ features/arm/ixp4xx-net-driver-improve-mac-handling.patch
+ bugfix/drivers-bus_to_virt.patch
+ bugfix/sparc/drivers_net-broken.patch
+ bugfix/arm/rtc-rs5c372-n2100.patch