Add nas100d Ethernet MAC setup support.

svn path=/dists/trunk/linux-2.6/; revision=8003
This commit is contained in:
Martin Michlmayr 2006-12-14 18:02:06 +00:00
parent 58206f0d27
commit d93aef1ff4
4 changed files with 99 additions and 0 deletions

1
debian/changelog vendored
View File

@ -18,6 +18,7 @@ linux-2.6 (2.6.19-1~experimental.1) UNRELEASED; urgency=low
* Add IXP4xx network build fix.
* arm/ixp4xx: Enable PATA_ARTOP for the nas100d and dsmg600.
* arm/ixp4xx: Enable RTC for the nas100d
* Add nas100d Ethernet MAC setup support.
-- Bastian Blank <waldi@debian.org> Mon, 4 Dec 2006 07:16:41 +0100

View File

@ -0,0 +1,56 @@
---
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,40 @@
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
@@ -123,12 +123,35 @@ static struct platform_device nas100d_ua
.resource = nas100d_uart_resources,
};
+static struct resource res_mac0 = {
+ .start = IXP4XX_EthB_BASE_PHYS,
+ .end = IXP4XX_EthB_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+};
+
+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)

View File

@ -25,6 +25,8 @@
+ bugfix/arm/nslu2-disk-leds.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-0.2.1-driver.patch
+ features/arm/ixp4xx-net-driver-fix-qmgr.patch
+ features/arm/ixp4xx-net-driver-improve-mac-handling.patch