mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-08-25 15:04:15 +03:00
prepare 2.6.24 on ixp4xx
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10438 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
7679574444
commit
85b39abe7d
@ -353,6 +353,7 @@ CONFIG_PPP_MPPE=m
|
||||
CONFIG_RTC_CLASS=y
|
||||
# CONFIG_RTC_DEBUG is not set
|
||||
# CONFIG_RTC_DRV_DS1307 is not set
|
||||
# CONFIG_RTC_DRV_DS1374 is not set
|
||||
# CONFIG_RTC_DRV_DS1553 is not set
|
||||
CONFIG_RTC_DRV_DS1672=y
|
||||
# CONFIG_RTC_DRV_DS1742 is not set
|
||||
@ -397,6 +398,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
|
||||
# CONFIG_SENSORS_ADM1029 is not set
|
||||
# CONFIG_SENSORS_ADM1031 is not set
|
||||
# CONFIG_SENSORS_ADM9240 is not set
|
||||
# CONFIG_SENSORS_ADT7470 is not set
|
||||
# CONFIG_SENSORS_ASB100 is not set
|
||||
# CONFIG_SENSORS_ATXP1 is not set
|
||||
# CONFIG_SENSORS_DS1337 is not set
|
||||
@ -404,10 +406,13 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
|
||||
# CONFIG_SENSORS_DS1621 is not set
|
||||
CONFIG_SENSORS_EEPROM=y
|
||||
# CONFIG_SENSORS_F71805F is not set
|
||||
# CONFIG_SENSORS_F71882FG is not set
|
||||
# CONFIG_SENSORS_F75375S is not set
|
||||
# CONFIG_SENSORS_FSCHER is not set
|
||||
# CONFIG_SENSORS_FSCPOS is not set
|
||||
# CONFIG_SENSORS_GL518SM is not set
|
||||
# CONFIG_SENSORS_GL520SM is not set
|
||||
# CONFIG_SENSORS_I5K_AMB is not set
|
||||
# CONFIG_SENSORS_IT87 is not set
|
||||
# CONFIG_SENSORS_LM63 is not set
|
||||
# CONFIG_SENSORS_LM75 is not set
|
||||
|
@ -0,0 +1,111 @@
|
||||
Upgrade the power and reset button handling for the DSMG600:
|
||||
* Remove the superfluous declaration of ctrl_alt_del().
|
||||
* Convert GPIO and IRQ handling to use the <asm/gpio.h> api.
|
||||
* Perform the reset on the release of the power button, so that
|
||||
NAS devices which have been set to auto-power-on (by bridging
|
||||
the power button) do not continuously power cycle.
|
||||
* Remove all superflous constants from dsmg600.h
|
||||
|
||||
Signed-off-by: Rod Whitby <rod@whitby.id.au>
|
||||
|
||||
---
|
||||
arch/arm/mach-ixp4xx/dsmg600-power.c | 24 ++++++++++++++----------
|
||||
include/asm-arm/arch-ixp4xx/dsmg600.h | 7 +------
|
||||
2 files changed, 15 insertions(+), 16 deletions(-)
|
||||
|
||||
Index: linux-2.6.23.12-armeb/arch/arm/mach-ixp4xx/dsmg600-power.c
|
||||
===================================================================
|
||||
--- linux-2.6.23.12-armeb.orig/arch/arm/mach-ixp4xx/dsmg600-power.c 2008-01-11 16:20:26.000000000 +1030
|
||||
+++ linux-2.6.23.12-armeb/arch/arm/mach-ixp4xx/dsmg600-power.c 2008-01-11 16:20:30.000000000 +1030
|
||||
@@ -26,10 +26,9 @@
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/timer.h>
|
||||
|
||||
+#include <asm/gpio.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
-extern void ctrl_alt_del(void);
|
||||
-
|
||||
/* This is used to make sure the power-button pusher is serious. The button
|
||||
* must be held until the value of this counter reaches zero.
|
||||
*/
|
||||
@@ -47,9 +46,16 @@
|
||||
* state of the power button.
|
||||
*/
|
||||
|
||||
- if (*IXP4XX_GPIO_GPINR & DSMG600_PB_BM) {
|
||||
+ if (gpio_get_value(DSMG600_PB_GPIO)) {
|
||||
|
||||
/* IO Pin is 1 (button pushed) */
|
||||
+ if (power_button_countdown > 0) {
|
||||
+ power_button_countdown--;
|
||||
+ }
|
||||
+
|
||||
+ } else {
|
||||
+
|
||||
+ /* Done on button release, to allow for auto-power-on mods. */
|
||||
if (power_button_countdown == 0) {
|
||||
/* Signal init to do the ctrlaltdel action, this will bypass
|
||||
* init if it hasn't started and do a kernel_restart.
|
||||
@@ -58,11 +64,9 @@
|
||||
|
||||
/* Change the state of the power LED to "blink" */
|
||||
gpio_line_set(DSMG600_LED_PWR_GPIO, IXP4XX_GPIO_LOW);
|
||||
+ } else {
|
||||
+ power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
|
||||
}
|
||||
- power_button_countdown--;
|
||||
-
|
||||
- } else {
|
||||
- power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
|
||||
}
|
||||
|
||||
mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500));
|
||||
@@ -81,12 +85,12 @@
|
||||
if (!(machine_is_dsmg600()))
|
||||
return 0;
|
||||
|
||||
- if (request_irq(DSMG600_RB_IRQ, &dsmg600_reset_handler,
|
||||
+ if (request_irq(gpio_to_irq(DSMG600_RB_GPIO), &dsmg600_reset_handler,
|
||||
IRQF_DISABLED | IRQF_TRIGGER_LOW, "DSM-G600 reset button",
|
||||
NULL) < 0) {
|
||||
|
||||
printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
|
||||
- DSMG600_RB_IRQ);
|
||||
+ gpio_to_irq(DSMG600_RB_GPIO));
|
||||
|
||||
return -EIO;
|
||||
}
|
||||
@@ -114,7 +118,7 @@
|
||||
|
||||
del_timer_sync(&dsmg600_power_timer);
|
||||
|
||||
- free_irq(DSMG600_RB_IRQ, NULL);
|
||||
+ free_irq(gpio_to_irq(DSMG600_RB_GPIO), NULL);
|
||||
}
|
||||
|
||||
module_init(dsmg600_power_init);
|
||||
Index: linux-2.6.23.12-armeb/include/asm-arm/arch-ixp4xx/dsmg600.h
|
||||
===================================================================
|
||||
--- linux-2.6.23.12-armeb.orig/include/asm-arm/arch-ixp4xx/dsmg600.h 2008-01-11 16:20:26.000000000 +1030
|
||||
+++ linux-2.6.23.12-armeb/include/asm-arm/arch-ixp4xx/dsmg600.h 2008-01-11 16:20:30.000000000 +1030
|
||||
@@ -40,18 +40,13 @@
|
||||
/* Buttons */
|
||||
|
||||
#define DSMG600_PB_GPIO 15 /* power button */
|
||||
-#define DSMG600_PB_BM (1L << DSMG600_PB_GPIO)
|
||||
-
|
||||
#define DSMG600_RB_GPIO 3 /* reset button */
|
||||
|
||||
-#define DSMG600_RB_IRQ IRQ_IXP4XX_GPIO3
|
||||
+/* Power control */
|
||||
|
||||
#define DSMG600_PO_GPIO 2 /* power off */
|
||||
|
||||
/* LEDs */
|
||||
|
||||
#define DSMG600_LED_PWR_GPIO 0
|
||||
-#define DSMG600_LED_PWR_BM (1L << DSMG600_LED_PWR_GPIO)
|
||||
-
|
||||
#define DSMG600_LED_WLAN_GPIO 14
|
||||
-#define DSMG600_LED_WLAN_BM (1L << DSMG600_LED_WLAN_GPIO)
|
@ -0,0 +1,188 @@
|
||||
Upgrade the power and reset button handling for the NAS100D:
|
||||
* Convert GPIO and IRQ handling to use the <asm/gpio.h> api.
|
||||
* Perform the reset only after the power button has been held down
|
||||
for at least two seconds. Do the reset on the release of the power
|
||||
button, so that NAS devices which have been set to auto-power-on (by
|
||||
bridging the power button) do not continuously power cycle.
|
||||
* Remove all superflous constants from nas100d.h
|
||||
* Add LED constants to nas100d.h while we're there.
|
||||
Also, update the board LED setup code to use constants.
|
||||
|
||||
Signed-off-by: Rod Whitby <rod@whitby.id.au>
|
||||
|
||||
Index: linux-2.6.23.12-armeb/arch/arm/mach-ixp4xx/nas100d-power.c
|
||||
===================================================================
|
||||
--- linux-2.6.23.12-armeb.orig/arch/arm/mach-ixp4xx/nas100d-power.c 2008-01-11 16:59:20.000000000 +1030
|
||||
+++ linux-2.6.23.12-armeb/arch/arm/mach-ixp4xx/nas100d-power.c 2008-01-11 17:03:23.000000000 +1030
|
||||
@@ -21,15 +21,61 @@
|
||||
#include <linux/irq.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/reboot.h>
|
||||
+#include <linux/jiffies.h>
|
||||
+#include <linux/timer.h>
|
||||
|
||||
+#include <asm/gpio.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
-static irqreturn_t nas100d_reset_handler(int irq, void *dev_id)
|
||||
+extern void ctrl_alt_del(void);
|
||||
+
|
||||
+/* This is used to make sure the power-button pusher is serious. The button
|
||||
+ * must be held until the value of this counter reaches zero.
|
||||
+ */
|
||||
+static volatile int power_button_countdown;
|
||||
+
|
||||
+/* Must hold the button down for at least this many counts to be processed */
|
||||
+#define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
|
||||
+
|
||||
+static void nas100d_power_handler(unsigned long data);
|
||||
+static DEFINE_TIMER(nas100d_power_timer, nas100d_power_handler, 0, 0);
|
||||
+
|
||||
+static void nas100d_power_handler(unsigned long data)
|
||||
{
|
||||
- /* Signal init to do the ctrlaltdel action, this will bypass init if
|
||||
- * it hasn't started and do a kernel_restart.
|
||||
+ /* This routine is called twice per second to check the
|
||||
+ * state of the power button.
|
||||
*/
|
||||
- ctrl_alt_del();
|
||||
+
|
||||
+ if (gpio_get_value(NAS100D_PB_GPIO)) {
|
||||
+
|
||||
+ /* IO Pin is 1 (button pushed) */
|
||||
+ if (power_button_countdown > 0) {
|
||||
+ power_button_countdown--;
|
||||
+ }
|
||||
+
|
||||
+ } else {
|
||||
+
|
||||
+ /* Done on button release, to allow for auto-power-on mods. */
|
||||
+ if (power_button_countdown == 0) {
|
||||
+ /* Signal init to do the ctrlaltdel action, this will bypass
|
||||
+ * init if it hasn't started and do a kernel_restart.
|
||||
+ */
|
||||
+ ctrl_alt_del();
|
||||
+
|
||||
+ /* Change the state of the power LED to "blink" */
|
||||
+ gpio_line_set(NAS100D_LED_PWR_GPIO, IXP4XX_GPIO_LOW);
|
||||
+ } else {
|
||||
+ power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ mod_timer(&nas100d_power_timer, jiffies + msecs_to_jiffies(500));
|
||||
+}
|
||||
+
|
||||
+static irqreturn_t nas100d_reset_handler(int irq, void *dev_id)
|
||||
+{
|
||||
+ /* This is the paper-clip reset, it shuts the machine down directly. */
|
||||
+ machine_power_off();
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
@@ -39,17 +85,30 @@
|
||||
if (!(machine_is_nas100d()))
|
||||
return 0;
|
||||
|
||||
- set_irq_type(NAS100D_RB_IRQ, IRQT_LOW);
|
||||
+ set_irq_type(gpio_to_irq(NAS100D_RB_GPIO), IRQT_LOW);
|
||||
|
||||
- if (request_irq(NAS100D_RB_IRQ, &nas100d_reset_handler,
|
||||
+ if (request_irq(gpio_to_irq(NAS100D_RB_GPIO), &nas100d_reset_handler,
|
||||
IRQF_DISABLED, "NAS100D reset button", NULL) < 0) {
|
||||
|
||||
printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
|
||||
- NAS100D_RB_IRQ);
|
||||
+ gpio_to_irq(NAS100D_RB_GPIO));
|
||||
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
+ /* The power button on the Iomega NAS100d is on GPIO 14, but
|
||||
+ * it cannot handle interrupts on that GPIO line. So we'll
|
||||
+ * have to poll it with a kernel timer.
|
||||
+ */
|
||||
+
|
||||
+ /* Make sure that the power button GPIO is set up as an input */
|
||||
+ gpio_line_config(NAS100D_PB_GPIO, IXP4XX_GPIO_IN);
|
||||
+
|
||||
+ /* Set the initial value for the power button IRQ handler */
|
||||
+ power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
|
||||
+
|
||||
+ mod_timer(&nas100d_power_timer, jiffies + msecs_to_jiffies(500));
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -58,7 +117,9 @@
|
||||
if (!(machine_is_nas100d()))
|
||||
return;
|
||||
|
||||
- free_irq(NAS100D_RB_IRQ, NULL);
|
||||
+ del_timer_sync(&nas100d_power_timer);
|
||||
+
|
||||
+ free_irq(gpio_to_irq(NAS100D_RB_GPIO), NULL);
|
||||
}
|
||||
|
||||
module_init(nas100d_power_init);
|
||||
Index: linux-2.6.23.12-armeb/include/asm-arm/arch-ixp4xx/nas100d.h
|
||||
===================================================================
|
||||
--- linux-2.6.23.12-armeb.orig/include/asm-arm/arch-ixp4xx/nas100d.h 2008-01-11 16:59:20.000000000 +1030
|
||||
+++ linux-2.6.23.12-armeb/include/asm-arm/arch-ixp4xx/nas100d.h 2008-01-11 17:03:23.000000000 +1030
|
||||
@@ -38,15 +38,15 @@
|
||||
|
||||
/* Buttons */
|
||||
|
||||
-#define NAS100D_PB_GPIO 14
|
||||
-#define NAS100D_RB_GPIO 4
|
||||
+#define NAS100D_PB_GPIO 14 /* power button */
|
||||
+#define NAS100D_RB_GPIO 4 /* reset button */
|
||||
+
|
||||
+/* Power control */
|
||||
+
|
||||
#define NAS100D_PO_GPIO 12 /* power off */
|
||||
|
||||
-#define NAS100D_PB_IRQ IRQ_IXP4XX_GPIO14
|
||||
-#define NAS100D_RB_IRQ IRQ_IXP4XX_GPIO4
|
||||
+/* LEDs */
|
||||
|
||||
-/*
|
||||
-#define NAS100D_PB_BM (1L << NAS100D_PB_GPIO)
|
||||
-#define NAS100D_PO_BM (1L << NAS100D_PO_GPIO)
|
||||
-#define NAS100D_RB_BM (1L << NAS100D_RB_GPIO)
|
||||
-*/
|
||||
+#define NAS100D_LED_WLAN_GPIO 0
|
||||
+#define NAS100D_LED_DISK_GPIO 3
|
||||
+#define NAS100D_LED_PWR_GPIO 15
|
||||
Index: linux-2.6.23.12-armeb/arch/arm/mach-ixp4xx/nas100d-setup.c
|
||||
===================================================================
|
||||
--- linux-2.6.23.12-armeb.orig/arch/arm/mach-ixp4xx/nas100d-setup.c 2008-01-11 17:03:23.000000000 +1030
|
||||
+++ linux-2.6.23.12-armeb/arch/arm/mach-ixp4xx/nas100d-setup.c 2008-01-11 17:06:15.000000000 +1030
|
||||
@@ -44,20 +44,20 @@
|
||||
static struct resource nas100d_led_resources[] = {
|
||||
{
|
||||
.name = "wlan", /* green led */
|
||||
- .start = 0,
|
||||
- .end = 0,
|
||||
+ .start = NAS100D_LED_WLAN_GPIO,
|
||||
+ .end = NAS100D_LED_WLAN_GPIO,
|
||||
.flags = IXP4XX_GPIO_LOW,
|
||||
},
|
||||
{
|
||||
- .name = "ready", /* blue power led (off is flashing!) */
|
||||
- .start = 15,
|
||||
- .end = 15,
|
||||
+ .name = "power", /* blue power led (off is flashing!) */
|
||||
+ .start = NAS100D_LED_PWR_GPIO,
|
||||
+ .end = NAS100D_LED_PWR_GPIO,
|
||||
.flags = IXP4XX_GPIO_LOW,
|
||||
},
|
||||
{
|
||||
.name = "disk", /* yellow led */
|
||||
- .start = 3,
|
||||
- .end = 3,
|
||||
+ .start = NAS100D_LED_DISK_GPIO,
|
||||
+ .end = NAS100D_LED_DISK_GPIO,
|
||||
.flags = IXP4XX_GPIO_LOW,
|
||||
},
|
||||
};
|
232
target/linux/ixp4xx/patches-2.6.24/020-ixp4xx_i2c_gpio.patch
Normal file
232
target/linux/ixp4xx/patches-2.6.24/020-ixp4xx_i2c_gpio.patch
Normal file
@ -0,0 +1,232 @@
|
||||
Migrate all ixp4xx devices to the bitbanging I2C bus driver utilizing
|
||||
the arch-neutral GPIO API (linux/i2c-gpio.h).
|
||||
|
||||
Tested by the nslu2-linux and openwrt projects in public firmware releases.
|
||||
|
||||
Acked-by: Rod Whitby <rod@whitby.id.au>
|
||||
Signed-off-by: Michael-Luke Jones <mlj28@cam.ac.uk>
|
||||
|
||||
Index: linux-2.6.24-rc6-armeb/arch/arm/mach-ixp4xx/nslu2-setup.c
|
||||
===================================================================
|
||||
--- linux-2.6.24-rc6-armeb.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2008-01-05 18:10:05.000000000 +1030
|
||||
+++ linux-2.6.24-rc6-armeb/arch/arm/mach-ixp4xx/nslu2-setup.c 2008-01-05 18:10:10.000000000 +1030
|
||||
@@ -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
|
||||
Index: linux-2.6.24-rc6-armeb/arch/arm/mach-ixp4xx/nas100d-setup.c
|
||||
===================================================================
|
||||
--- linux-2.6.24-rc6-armeb.orig/arch/arm/mach-ixp4xx/nas100d-setup.c 2008-01-05 18:10:05.000000000 +1030
|
||||
+++ linux-2.6.24-rc6-armeb/arch/arm/mach-ixp4xx/nas100d-setup.c 2008-01-05 18:10:10.000000000 +1030
|
||||
@@ -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,
|
||||
Index: linux-2.6.24-rc6-armeb/arch/arm/mach-ixp4xx/avila-setup.c
|
||||
===================================================================
|
||||
--- linux-2.6.24-rc6-armeb.orig/arch/arm/mach-ixp4xx/avila-setup.c 2008-01-05 18:10:05.000000000 +1030
|
||||
+++ linux-2.6.24-rc6-armeb/arch/arm/mach-ixp4xx/avila-setup.c 2008-01-05 18:10:10.000000000 +1030
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <linux/tty.h>
|
||||
#include <linux/serial_8250.h>
|
||||
#include <linux/slab.h>
|
||||
+#include <linux/i2c-gpio.h>
|
||||
|
||||
#include <asm/types.h>
|
||||
#include <asm/setup.h>
|
||||
@@ -47,18 +48,17 @@
|
||||
.resource = &avila_flash_resource,
|
||||
};
|
||||
|
||||
-static struct ixp4xx_i2c_pins avila_i2c_gpio_pins = {
|
||||
+static struct i2c_gpio_platform_data avila_i2c_gpio_data = {
|
||||
.sda_pin = AVILA_SDA_PIN,
|
||||
.scl_pin = AVILA_SCL_PIN,
|
||||
};
|
||||
|
||||
-static struct platform_device avila_i2c_controller = {
|
||||
- .name = "IXP4XX-I2C",
|
||||
+static struct platform_device avila_i2c_gpio = {
|
||||
+ .name = "i2c-gpio",
|
||||
.id = 0,
|
||||
- .dev = {
|
||||
- .platform_data = &avila_i2c_gpio_pins,
|
||||
+ .dev = {
|
||||
+ .platform_data = &avila_i2c_gpio_data,
|
||||
},
|
||||
- .num_resources = 0
|
||||
};
|
||||
|
||||
static struct resource avila_uart_resources[] = {
|
||||
@@ -133,7 +133,7 @@
|
||||
};
|
||||
|
||||
static struct platform_device *avila_devices[] __initdata = {
|
||||
- &avila_i2c_controller,
|
||||
+ &avila_i2c_gpio,
|
||||
&avila_flash,
|
||||
&avila_uart
|
||||
};
|
||||
Index: linux-2.6.24-rc6-armeb/arch/arm/mach-ixp4xx/dsmg600-setup.c
|
||||
===================================================================
|
||||
--- linux-2.6.24-rc6-armeb.orig/arch/arm/mach-ixp4xx/dsmg600-setup.c 2008-01-05 18:10:05.000000000 +1030
|
||||
+++ linux-2.6.24-rc6-armeb/arch/arm/mach-ixp4xx/dsmg600-setup.c 2008-01-05 18:10:10.000000000 +1030
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/serial.h>
|
||||
#include <linux/serial_8250.h>
|
||||
+#include <linux/i2c-gpio.h>
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
@@ -37,15 +38,17 @@
|
||||
.resource = &dsmg600_flash_resource,
|
||||
};
|
||||
|
||||
-static struct ixp4xx_i2c_pins dsmg600_i2c_gpio_pins = {
|
||||
+static struct i2c_gpio_platform_data dsmg600_i2c_gpio_data = {
|
||||
.sda_pin = DSMG600_SDA_PIN,
|
||||
.scl_pin = DSMG600_SCL_PIN,
|
||||
};
|
||||
|
||||
-static struct platform_device dsmg600_i2c_controller = {
|
||||
- .name = "IXP4XX-I2C",
|
||||
+static struct platform_device dsmg600_i2c_gpio = {
|
||||
+ .name = "i2c-gpio",
|
||||
.id = 0,
|
||||
- .dev.platform_data = &dsmg600_i2c_gpio_pins,
|
||||
+ .dev = {
|
||||
+ .platform_data = &dsmg600_i2c_gpio_data,
|
||||
+ },
|
||||
};
|
||||
|
||||
#ifdef CONFIG_LEDS_CLASS
|
||||
@@ -116,7 +119,7 @@
|
||||
};
|
||||
|
||||
static struct platform_device *dsmg600_devices[] __initdata = {
|
||||
- &dsmg600_i2c_controller,
|
||||
+ &dsmg600_i2c_gpio,
|
||||
&dsmg600_flash,
|
||||
};
|
||||
|
||||
Index: linux-2.6.24-rc6-armeb/arch/arm/mach-ixp4xx/ixdp425-setup.c
|
||||
===================================================================
|
||||
--- linux-2.6.24-rc6-armeb.orig/arch/arm/mach-ixp4xx/ixdp425-setup.c 2008-01-05 18:10:05.000000000 +1030
|
||||
+++ linux-2.6.24-rc6-armeb/arch/arm/mach-ixp4xx/ixdp425-setup.c 2008-01-05 18:10:10.000000000 +1030
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <linux/tty.h>
|
||||
#include <linux/serial_8250.h>
|
||||
#include <linux/slab.h>
|
||||
+#include <linux/i2c-gpio.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/nand.h>
|
||||
@@ -120,18 +121,17 @@
|
||||
};
|
||||
#endif /* CONFIG_MTD_NAND_PLATFORM */
|
||||
|
||||
-static struct ixp4xx_i2c_pins ixdp425_i2c_gpio_pins = {
|
||||
+static struct i2c_gpio_platform_data ixdp425_i2c_gpio_data = {
|
||||
.sda_pin = IXDP425_SDA_PIN,
|
||||
.scl_pin = IXDP425_SCL_PIN,
|
||||
};
|
||||
|
||||
-static struct platform_device ixdp425_i2c_controller = {
|
||||
- .name = "IXP4XX-I2C",
|
||||
+static struct platform_device ixdp425_i2c_gpio = {
|
||||
+ .name = "i2c-gpio",
|
||||
.id = 0,
|
||||
- .dev = {
|
||||
- .platform_data = &ixdp425_i2c_gpio_pins,
|
||||
+ .dev = {
|
||||
+ .platform_data = &ixdp425_i2c_gpio_data,
|
||||
},
|
||||
- .num_resources = 0
|
||||
};
|
||||
|
||||
static struct resource ixdp425_uart_resources[] = {
|
||||
@@ -178,7 +178,7 @@
|
||||
};
|
||||
|
||||
static struct platform_device *ixdp425_devices[] __initdata = {
|
||||
- &ixdp425_i2c_controller,
|
||||
+ &ixdp425_i2c_gpio,
|
||||
&ixdp425_flash,
|
||||
#if defined(CONFIG_MTD_NAND_PLATFORM) || \
|
||||
defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
|
@ -0,0 +1,794 @@
|
||||
Index: linux-2.6.23.12-armeb/arch/arm/mach-ixp4xx/fsg-pci.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ linux-2.6.23.12-armeb/arch/arm/mach-ixp4xx/fsg-pci.c 2008-01-11 17:06:33.000000000 +1030
|
||||
@@ -0,0 +1,71 @@
|
||||
+/*
|
||||
+ * arch/arch/mach-ixp4xx/fsg-pci.c
|
||||
+ *
|
||||
+ * FSG board-level PCI initialization
|
||||
+ *
|
||||
+ * Author: Rod Whitby <rod@whitby.id.au>
|
||||
+ * Maintainer: http://www.nslu2-linux.org/
|
||||
+ *
|
||||
+ * based on ixdp425-pci.c:
|
||||
+ * Copyright (C) 2002 Intel Corporation.
|
||||
+ * Copyright (C) 2003-2004 MontaVista Software, Inc.
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License version 2 as
|
||||
+ * published by the Free Software Foundation.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/pci.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/irq.h>
|
||||
+
|
||||
+#include <asm/mach/pci.h>
|
||||
+#include <asm/mach-types.h>
|
||||
+
|
||||
+void __init fsg_pci_preinit(void)
|
||||
+{
|
||||
+ set_irq_type(IRQ_FSG_PCI_INTA, IRQT_LOW);
|
||||
+ set_irq_type(IRQ_FSG_PCI_INTB, IRQT_LOW);
|
||||
+ set_irq_type(IRQ_FSG_PCI_INTC, IRQT_LOW);
|
||||
+
|
||||
+ ixp4xx_pci_preinit();
|
||||
+}
|
||||
+
|
||||
+static int __init fsg_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
|
||||
+{
|
||||
+ static int pci_irq_table[FSG_PCI_IRQ_LINES] = {
|
||||
+ IRQ_FSG_PCI_INTC,
|
||||
+ IRQ_FSG_PCI_INTB,
|
||||
+ IRQ_FSG_PCI_INTA,
|
||||
+ };
|
||||
+
|
||||
+ int irq = -1;
|
||||
+ slot = slot - 11;
|
||||
+
|
||||
+ if (slot >= 1 && slot <= FSG_PCI_MAX_DEV &&
|
||||
+ pin >= 1 && pin <= FSG_PCI_IRQ_LINES) {
|
||||
+ irq = pci_irq_table[(slot - 1)];
|
||||
+ }
|
||||
+ printk("%s: Mapped slot %d pin %d to IRQ %d\n", __FUNCTION__,slot, pin, irq);
|
||||
+
|
||||
+ return irq;
|
||||
+}
|
||||
+
|
||||
+struct hw_pci fsg_pci __initdata = {
|
||||
+ .nr_controllers = 1,
|
||||
+ .preinit = fsg_pci_preinit,
|
||||
+ .swizzle = pci_std_swizzle,
|
||||
+ .setup = ixp4xx_setup,
|
||||
+ .scan = ixp4xx_scan_bus,
|
||||
+ .map_irq = fsg_map_irq,
|
||||
+};
|
||||
+
|
||||
+int __init fsg_pci_init(void)
|
||||
+{
|
||||
+ if (machine_is_fsg())
|
||||
+ pci_common_init(&fsg_pci);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+subsys_initcall(fsg_pci_init);
|
||||
Index: linux-2.6.23.12-armeb/arch/arm/mach-ixp4xx/fsg-setup.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ linux-2.6.23.12-armeb/arch/arm/mach-ixp4xx/fsg-setup.c 2008-01-11 17:06:33.000000000 +1030
|
||||
@@ -0,0 +1,220 @@
|
||||
+/*
|
||||
+ * arch/arm/mach-ixp4xx/fsg-setup.c
|
||||
+ *
|
||||
+ * FSG board-setup
|
||||
+ *
|
||||
+ * based ixdp425-setup.c:
|
||||
+ * Copyright (C) 2003-2004 MontaVista Software, Inc.
|
||||
+ *
|
||||
+ * Author: Rod Whitby <rod@whitby.id.au>
|
||||
+ * Maintainers: http://www.nslu2-linux.org/
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/serial.h>
|
||||
+#include <linux/serial_8250.h>
|
||||
+#include <linux/leds.h>
|
||||
+#include <linux/reboot.h>
|
||||
+#include <linux/i2c-gpio.h>
|
||||
+
|
||||
+#include <asm/mach-types.h>
|
||||
+#include <asm/mach/arch.h>
|
||||
+#include <asm/mach/flash.h>
|
||||
+#include <asm/io.h>
|
||||
+
|
||||
+static struct flash_platform_data fsg_flash_data = {
|
||||
+ .map_name = "cfi_probe",
|
||||
+ .width = 2,
|
||||
+};
|
||||
+
|
||||
+static struct resource fsg_flash_resource = {
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+};
|
||||
+
|
||||
+static struct platform_device fsg_flash = {
|
||||
+ .name = "IXP4XX-Flash",
|
||||
+ .id = 0,
|
||||
+ .dev.platform_data = &fsg_flash_data,
|
||||
+ .num_resources = 1,
|
||||
+ .resource = &fsg_flash_resource,
|
||||
+};
|
||||
+
|
||||
+static struct i2c_gpio_platform_data fsg_i2c_gpio_data = {
|
||||
+ .sda_pin = FSG_SDA_PIN,
|
||||
+ .scl_pin = FSG_SCL_PIN,
|
||||
+};
|
||||
+
|
||||
+static struct platform_device fsg_i2c_gpio = {
|
||||
+ .name = "i2c-gpio",
|
||||
+ .id = 0,
|
||||
+ .dev = {
|
||||
+ .platform_data = &fsg_i2c_gpio_data,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static struct resource fsg_uart_resources[] = {
|
||||
+ {
|
||||
+ .start = IXP4XX_UART1_BASE_PHYS,
|
||||
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+ },
|
||||
+ {
|
||||
+ .start = IXP4XX_UART2_BASE_PHYS,
|
||||
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static struct plat_serial8250_port fsg_uart_data[] = {
|
||||
+ {
|
||||
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
|
||||
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
|
||||
+ .irq = IRQ_IXP4XX_UART1,
|
||||
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
|
||||
+ .iotype = UPIO_MEM,
|
||||
+ .regshift = 2,
|
||||
+ .uartclk = IXP4XX_UART_XTAL,
|
||||
+ },
|
||||
+ {
|
||||
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
|
||||
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
|
||||
+ .irq = IRQ_IXP4XX_UART2,
|
||||
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
|
||||
+ .iotype = UPIO_MEM,
|
||||
+ .regshift = 2,
|
||||
+ .uartclk = IXP4XX_UART_XTAL,
|
||||
+ },
|
||||
+ { }
|
||||
+};
|
||||
+
|
||||
+static struct platform_device fsg_uart = {
|
||||
+ .name = "serial8250",
|
||||
+ .id = PLAT8250_DEV_PLATFORM,
|
||||
+ .dev.platform_data = fsg_uart_data,
|
||||
+ .num_resources = ARRAY_SIZE(fsg_uart_resources),
|
||||
+ .resource = fsg_uart_resources,
|
||||
+};
|
||||
+
|
||||
+static struct platform_device fsg_leds = {
|
||||
+ .name = "fsg-led",
|
||||
+ .id = -1,
|
||||
+};
|
||||
+
|
||||
+/* Built-in 10/100 Ethernet MAC interfaces */
|
||||
+static struct eth_plat_info fsg_plat_eth[] = {
|
||||
+ {
|
||||
+ .phy = 5,
|
||||
+ .rxq = 3,
|
||||
+ .txreadyq = 20,
|
||||
+ }, {
|
||||
+ .phy = 4,
|
||||
+ .rxq = 4,
|
||||
+ .txreadyq = 21,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static struct platform_device fsg_eth[] = {
|
||||
+ {
|
||||
+ .name = "ixp4xx_eth",
|
||||
+ .id = IXP4XX_ETH_NPEB,
|
||||
+ .dev.platform_data = fsg_plat_eth,
|
||||
+ }, {
|
||||
+ .name = "ixp4xx_eth",
|
||||
+ .id = IXP4XX_ETH_NPEC,
|
||||
+ .dev.platform_data = fsg_plat_eth + 1,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static struct platform_device *fsg_devices[] __initdata = {
|
||||
+ &fsg_i2c_gpio,
|
||||
+ &fsg_flash,
|
||||
+ &fsg_leds,
|
||||
+ &fsg_eth[0],
|
||||
+ &fsg_eth[1],
|
||||
+};
|
||||
+
|
||||
+static void fsg_power_off(void)
|
||||
+{
|
||||
+ printk("Restarting system.\n");
|
||||
+ machine_restart(NULL);
|
||||
+}
|
||||
+
|
||||
+static void __init fsg_init(void)
|
||||
+{
|
||||
+ uint8_t __iomem *f;
|
||||
+ int i;
|
||||
+
|
||||
+ ixp4xx_sys_init();
|
||||
+
|
||||
+ pm_power_off = fsg_power_off;
|
||||
+
|
||||
+ fsg_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
|
||||
+ fsg_flash_resource.end =
|
||||
+ IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
|
||||
+
|
||||
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
|
||||
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
|
||||
+
|
||||
+ /* Configure CS2 for operation, 8bit and writable */
|
||||
+ *IXP4XX_EXP_CS2 = 0xbfff0002;
|
||||
+
|
||||
+ /* This is only useful on a modified machine, but it is valuable
|
||||
+ * to have it first in order to see debug messages, and so that
|
||||
+ * it does *not* get removed if platform_add_devices fails!
|
||||
+ */
|
||||
+ (void)platform_device_register(&fsg_uart);
|
||||
+
|
||||
+ platform_add_devices(fsg_devices, ARRAY_SIZE(fsg_devices));
|
||||
+
|
||||
+
|
||||
+ /*
|
||||
+ * Map in a portion of the flash and read the MAC addresses.
|
||||
+ * Since it is stored in BE in the flash itself, we need to
|
||||
+ * byteswap it if we're in LE mode.
|
||||
+ */
|
||||
+ if ((f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x400000))) {
|
||||
+#ifdef __ARMEB__
|
||||
+ for (i = 0; i < 6; i++) {
|
||||
+ fsg_plat_eth[0].hwaddr[i] = readb(f + 0x3C0422 + i);
|
||||
+ fsg_plat_eth[1].hwaddr[i] = readb(f + 0x3C043B + i);
|
||||
+ }
|
||||
+#else
|
||||
+ fsg_plat_eth[0].hwaddr[0] = readb(f + 0x3C0422 + 3);
|
||||
+ fsg_plat_eth[0].hwaddr[1] = readb(f + 0x3C0422 + 2);
|
||||
+ fsg_plat_eth[0].hwaddr[2] = readb(f + 0x3C0422 + 1);
|
||||
+ fsg_plat_eth[0].hwaddr[3] = readb(f + 0x3C0422 + 0);
|
||||
+ fsg_plat_eth[0].hwaddr[4] = readb(f + 0x3C0422 + 7);
|
||||
+ fsg_plat_eth[0].hwaddr[5] = readb(f + 0x3C0422 + 6);
|
||||
+
|
||||
+ fsg_plat_eth[1].hwaddr[0] = readb(f + 0x3C0422 + 3);
|
||||
+ fsg_plat_eth[1].hwaddr[1] = readb(f + 0x3C0422 + 2);
|
||||
+ fsg_plat_eth[1].hwaddr[2] = readb(f + 0x3C0422 + 1);
|
||||
+ fsg_plat_eth[1].hwaddr[3] = readb(f + 0x3C0422 + 0);
|
||||
+ fsg_plat_eth[1].hwaddr[4] = readb(f + 0x3C0422 + 7);
|
||||
+ fsg_plat_eth[1].hwaddr[5] = readb(f + 0x3C0422 + 6);
|
||||
+#endif
|
||||
+ iounmap(f);
|
||||
+ }
|
||||
+ printk(KERN_INFO "FSG: Using MAC address %.2x:%.2x:%.2x:%.2x:%.2x:%.2x for port 0\n",
|
||||
+ fsg_plat_eth[0].hwaddr[0], fsg_plat_eth[0].hwaddr[1],
|
||||
+ fsg_plat_eth[0].hwaddr[2], fsg_plat_eth[0].hwaddr[3],
|
||||
+ fsg_plat_eth[0].hwaddr[4], fsg_plat_eth[0].hwaddr[5]);
|
||||
+ printk(KERN_INFO "FSG: Using MAC address %.2x:%.2x:%.2x:%.2x:%.2x:%.2x for port 1\n",
|
||||
+ fsg_plat_eth[1].hwaddr[0], fsg_plat_eth[1].hwaddr[1],
|
||||
+ fsg_plat_eth[1].hwaddr[2], fsg_plat_eth[1].hwaddr[3],
|
||||
+ fsg_plat_eth[1].hwaddr[4], fsg_plat_eth[1].hwaddr[5]);
|
||||
+
|
||||
+}
|
||||
+
|
||||
+MACHINE_START(FSG, "Freecom FSG-3")
|
||||
+ /* Maintainer: www.nslu2-linux.org */
|
||||
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
|
||||
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
|
||||
+ .map_io = ixp4xx_map_io,
|
||||
+ .init_irq = ixp4xx_init_irq,
|
||||
+ .timer = &ixp4xx_timer,
|
||||
+ .boot_params = 0x0100,
|
||||
+ .init_machine = fsg_init,
|
||||
+MACHINE_END
|
||||
+
|
||||
Index: linux-2.6.23.12-armeb/arch/arm/mach-ixp4xx/Kconfig
|
||||
===================================================================
|
||||
--- linux-2.6.23.12-armeb.orig/arch/arm/mach-ixp4xx/Kconfig 2008-01-11 17:05:08.000000000 +1030
|
||||
+++ linux-2.6.23.12-armeb/arch/arm/mach-ixp4xx/Kconfig 2008-01-11 17:06:33.000000000 +1030
|
||||
@@ -125,6 +125,15 @@
|
||||
depends on ARCH_IXDP425 || MACH_IXDP465 || MACH_KIXRP435
|
||||
default y
|
||||
|
||||
+config MACH_FSG
|
||||
+ bool
|
||||
+ prompt "Freecom FSG-3"
|
||||
+ select PCI
|
||||
+ help
|
||||
+ Say 'Y' here if you want your kernel to support Freecom's
|
||||
+ FSG-3 device. For more information on this platform,
|
||||
+ see http://www.nslu2-linux.org/wiki/FSG3/HomePage
|
||||
+
|
||||
#
|
||||
# Certain registers and IRQs are only enabled if supporting IXP465 CPUs
|
||||
#
|
||||
Index: linux-2.6.23.12-armeb/arch/arm/mach-ixp4xx/Makefile
|
||||
===================================================================
|
||||
--- linux-2.6.23.12-armeb.orig/arch/arm/mach-ixp4xx/Makefile 2008-01-11 17:05:08.000000000 +1030
|
||||
+++ linux-2.6.23.12-armeb/arch/arm/mach-ixp4xx/Makefile 2008-01-11 17:06:33.000000000 +1030
|
||||
@@ -15,6 +15,7 @@
|
||||
obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o
|
||||
obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o
|
||||
obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
|
||||
+obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
|
||||
|
||||
obj-y += common.o
|
||||
|
||||
@@ -28,6 +29,7 @@
|
||||
obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o dsmg600-power.o
|
||||
obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
|
||||
obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
|
||||
+obj-$(CONFIG_MACH_FSG) += fsg-setup.o fsg-power.o
|
||||
|
||||
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
|
||||
obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
|
||||
Index: linux-2.6.23.12-armeb/include/asm-arm/arch-ixp4xx/fsg.h
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ linux-2.6.23.12-armeb/include/asm-arm/arch-ixp4xx/fsg.h 2008-01-11 17:06:33.000000000 +1030
|
||||
@@ -0,0 +1,50 @@
|
||||
+/*
|
||||
+ * include/asm-arm/arch-ixp4xx/fsg.h
|
||||
+ *
|
||||
+ * Freecom FSG-3 platform specific definitions
|
||||
+ *
|
||||
+ * Author: Rod Whitby <rod@whitby.id.au>
|
||||
+ * Author: Tomasz Chmielewski <mangoo@wpkg.org>
|
||||
+ * Maintainers: http://www.nslu2-linux.org
|
||||
+ *
|
||||
+ * Based on coyote.h by
|
||||
+ * Copyright 2004 (c) MontaVista, Software, Inc.
|
||||
+ *
|
||||
+ * This file is licensed under the terms of the GNU General Public
|
||||
+ * License version 2. This program is licensed "as is" without any
|
||||
+ * warranty of any kind, whether express or implied.
|
||||
+ */
|
||||
+
|
||||
+#ifndef __ASM_ARCH_HARDWARE_H__
|
||||
+#error "Do not include this directly, instead #include <asm/hardware.h>"
|
||||
+#endif
|
||||
+
|
||||
+#define FSG_SDA_PIN 12
|
||||
+#define FSG_SCL_PIN 13
|
||||
+
|
||||
+/*
|
||||
+ * FSG PCI IRQs
|
||||
+ */
|
||||
+#define FSG_PCI_MAX_DEV 3
|
||||
+#define FSG_PCI_IRQ_LINES 3
|
||||
+
|
||||
+
|
||||
+/* PCI controller GPIO to IRQ pin mappings */
|
||||
+#define FSG_PCI_INTA_PIN 6
|
||||
+#define FSG_PCI_INTB_PIN 7
|
||||
+#define FSG_PCI_INTC_PIN 5
|
||||
+
|
||||
+/* Buttons */
|
||||
+
|
||||
+#define FSG_SB_GPIO 4 /* sync button */
|
||||
+#define FSG_RB_GPIO 9 /* reset button */
|
||||
+#define FSG_UB_GPIO 10 /* usb button */
|
||||
+
|
||||
+/* LEDs */
|
||||
+
|
||||
+#define FSG_LED_WLAN_BIT 0
|
||||
+#define FSG_LED_WAN_BIT 1
|
||||
+#define FSG_LED_SATA_BIT 2
|
||||
+#define FSG_LED_USB_BIT 4
|
||||
+#define FSG_LED_RING_BIT 5
|
||||
+#define FSG_LED_SYNC_BIT 7
|
||||
Index: linux-2.6.23.12-armeb/include/asm-arm/arch-ixp4xx/hardware.h
|
||||
===================================================================
|
||||
--- linux-2.6.23.12-armeb.orig/include/asm-arm/arch-ixp4xx/hardware.h 2008-01-11 17:05:08.000000000 +1030
|
||||
+++ linux-2.6.23.12-armeb/include/asm-arm/arch-ixp4xx/hardware.h 2008-01-11 17:06:33.000000000 +1030
|
||||
@@ -45,5 +45,6 @@
|
||||
#include "nslu2.h"
|
||||
#include "nas100d.h"
|
||||
#include "dsmg600.h"
|
||||
+#include "fsg.h"
|
||||
|
||||
#endif /* _ASM_ARCH_HARDWARE_H */
|
||||
Index: linux-2.6.23.12-armeb/include/asm-arm/arch-ixp4xx/irqs.h
|
||||
===================================================================
|
||||
--- linux-2.6.23.12-armeb.orig/include/asm-arm/arch-ixp4xx/irqs.h 2008-01-11 17:05:08.000000000 +1030
|
||||
+++ linux-2.6.23.12-armeb/include/asm-arm/arch-ixp4xx/irqs.h 2008-01-11 17:06:33.000000000 +1030
|
||||
@@ -128,4 +128,11 @@
|
||||
#define IRQ_DSMG600_PCI_INTE IRQ_IXP4XX_GPIO7
|
||||
#define IRQ_DSMG600_PCI_INTF IRQ_IXP4XX_GPIO6
|
||||
|
||||
+/*
|
||||
+ * Freecom FSG-3 Board IRQs
|
||||
+ */
|
||||
+#define IRQ_FSG_PCI_INTA IRQ_IXP4XX_GPIO6
|
||||
+#define IRQ_FSG_PCI_INTB IRQ_IXP4XX_GPIO7
|
||||
+#define IRQ_FSG_PCI_INTC IRQ_IXP4XX_GPIO5
|
||||
+
|
||||
#endif
|
||||
Index: linux-2.6.23.12-armeb/arch/arm/mach-ixp4xx/fsg-power.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ linux-2.6.23.12-armeb/arch/arm/mach-ixp4xx/fsg-power.c 2008-01-11 17:06:33.000000000 +1030
|
||||
@@ -0,0 +1,89 @@
|
||||
+/*
|
||||
+ * arch/arm/mach-ixp4xx/fsg-power.c
|
||||
+ *
|
||||
+ * FSG Power/Reset driver
|
||||
+ *
|
||||
+ * Copyright (C) 2008 Rod Whitby <rod@whitby.id.au>
|
||||
+ *
|
||||
+ * based on nslu2-power.c
|
||||
+ * Copyright (C) 2005 Tower Technologies
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License version 2 as
|
||||
+ * published by the Free Software Foundation.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/reboot.h>
|
||||
+#include <linux/interrupt.h>
|
||||
+#include <linux/irq.h>
|
||||
+#include <linux/jiffies.h>
|
||||
+#include <linux/timer.h>
|
||||
+
|
||||
+#include <asm/gpio.h>
|
||||
+#include <asm/mach-types.h>
|
||||
+
|
||||
+static irqreturn_t fsg_power_handler(int irq, void *dev_id)
|
||||
+{
|
||||
+ /* Signal init to do the ctrlaltdel action, this will bypass init if
|
||||
+ * it hasn't started and do a kernel_restart.
|
||||
+ */
|
||||
+ ctrl_alt_del();
|
||||
+
|
||||
+ return IRQ_HANDLED;
|
||||
+}
|
||||
+
|
||||
+static irqreturn_t fsg_reset_handler(int irq, void *dev_id)
|
||||
+{
|
||||
+ /* This is the paper-clip reset, it shuts the machine down directly.
|
||||
+ */
|
||||
+ machine_power_off();
|
||||
+
|
||||
+ return IRQ_HANDLED;
|
||||
+}
|
||||
+
|
||||
+static int __init fsg_power_init(void)
|
||||
+{
|
||||
+ if (!(machine_is_fsg()))
|
||||
+ return 0;
|
||||
+
|
||||
+ set_irq_type(gpio_to_irq(FSG_RB_GPIO), IRQT_LOW);
|
||||
+ set_irq_type(gpio_to_irq(FSG_SB_GPIO), IRQT_LOW);
|
||||
+
|
||||
+ if (request_irq(gpio_to_irq(FSG_RB_GPIO), &fsg_reset_handler,
|
||||
+ IRQF_DISABLED, "FSG reset button", NULL) < 0) {
|
||||
+
|
||||
+ printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
|
||||
+ gpio_to_irq(FSG_RB_GPIO));
|
||||
+
|
||||
+ return -EIO;
|
||||
+ }
|
||||
+
|
||||
+ if (request_irq(gpio_to_irq(FSG_SB_GPIO), &fsg_power_handler,
|
||||
+ IRQF_DISABLED, "FSG power button", NULL) < 0) {
|
||||
+
|
||||
+ printk(KERN_DEBUG "Power Button IRQ %d not available\n",
|
||||
+ gpio_to_irq(FSG_SB_GPIO));
|
||||
+
|
||||
+ return -EIO;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void __exit fsg_power_exit(void)
|
||||
+{
|
||||
+ if (!(machine_is_fsg()))
|
||||
+ return;
|
||||
+
|
||||
+ free_irq(gpio_to_irq(FSG_SB_GPIO), NULL);
|
||||
+ free_irq(gpio_to_irq(FSG_RB_GPIO), NULL);
|
||||
+}
|
||||
+
|
||||
+module_init(fsg_power_init);
|
||||
+module_exit(fsg_power_exit);
|
||||
+
|
||||
+MODULE_AUTHOR("Rod Whitby <rod@whitby.id.au>");
|
||||
+MODULE_DESCRIPTION("FSG Power/Reset driver");
|
||||
+MODULE_LICENSE("GPL");
|
||||
Index: linux-2.6.23.12-armeb/drivers/leds/Kconfig
|
||||
===================================================================
|
||||
--- linux-2.6.23.12-armeb.orig/drivers/leds/Kconfig 2008-01-11 17:05:08.000000000 +1030
|
||||
+++ linux-2.6.23.12-armeb/drivers/leds/Kconfig 2008-01-11 17:06:33.000000000 +1030
|
||||
@@ -48,6 +48,12 @@
|
||||
particular board must have LEDs and they must be connected
|
||||
to the GPIO lines. If unsure, say Y.
|
||||
|
||||
+config LEDS_FSG
|
||||
+ tristate "LED Support for the Freecom FSG-3"
|
||||
+ depends on LEDS_CLASS && MACH_FSG
|
||||
+ help
|
||||
+ This option enables support for the LEDs on the Freecom FSG-3.
|
||||
+
|
||||
config LEDS_TOSA
|
||||
tristate "LED Support for the Sharp SL-6000 series"
|
||||
depends on LEDS_CLASS && PXA_SHARPSL
|
||||
Index: linux-2.6.23.12-armeb/drivers/leds/Makefile
|
||||
===================================================================
|
||||
--- linux-2.6.23.12-armeb.orig/drivers/leds/Makefile 2008-01-11 17:05:08.000000000 +1030
|
||||
+++ linux-2.6.23.12-armeb/drivers/leds/Makefile 2008-01-11 17:06:33.000000000 +1030
|
||||
@@ -9,6 +9,7 @@
|
||||
obj-$(CONFIG_LEDS_LOCOMO) += leds-locomo.o
|
||||
obj-$(CONFIG_LEDS_SPITZ) += leds-spitz.o
|
||||
obj-$(CONFIG_LEDS_IXP4XX) += leds-ixp4xx-gpio.o
|
||||
+obj-$(CONFIG_LEDS_FSG) += leds-fsg.o
|
||||
obj-$(CONFIG_LEDS_TOSA) += leds-tosa.o
|
||||
obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o
|
||||
obj-$(CONFIG_LEDS_AMS_DELTA) += leds-ams-delta.o
|
||||
Index: linux-2.6.23.12-armeb/drivers/leds/leds-fsg.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ linux-2.6.23.12-armeb/drivers/leds/leds-fsg.c 2008-01-11 17:06:33.000000000 +1030
|
||||
@@ -0,0 +1,243 @@
|
||||
+/*
|
||||
+ * LED Driver for the Freecom FSG-3
|
||||
+ *
|
||||
+ * Copyright (c) 2008 Rod Whitby <rod@whitby.id.au>
|
||||
+ *
|
||||
+ * Author: Rod Whitby <rod@whitby.id.au>
|
||||
+ *
|
||||
+ * Based on leds-spitz.c
|
||||
+ * Copyright 2005-2006 Openedhand Ltd.
|
||||
+ * Author: Richard Purdie <rpurdie@openedhand.com>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License version 2 as
|
||||
+ * published by the Free Software Foundation.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/leds.h>
|
||||
+#include <asm/arch/hardware.h>
|
||||
+#include <asm/io.h>
|
||||
+
|
||||
+static short __iomem *latch_address;
|
||||
+static unsigned short latch_value;
|
||||
+
|
||||
+
|
||||
+static void fsg_led_wlan_set(struct led_classdev *led_cdev, enum led_brightness value)
|
||||
+{
|
||||
+ if (value) {
|
||||
+ latch_value &= ~(1 << FSG_LED_WLAN_BIT);
|
||||
+ *latch_address = latch_value;
|
||||
+ }
|
||||
+ else {
|
||||
+ latch_value |= (1 << FSG_LED_WLAN_BIT);
|
||||
+ *latch_address = latch_value;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void fsg_led_wan_set(struct led_classdev *led_cdev, enum led_brightness value)
|
||||
+{
|
||||
+ if (value) {
|
||||
+ latch_value &= ~(1 << FSG_LED_WAN_BIT);
|
||||
+ *latch_address = latch_value;
|
||||
+ }
|
||||
+ else {
|
||||
+ latch_value |= (1 << FSG_LED_WAN_BIT);
|
||||
+ *latch_address = latch_value;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void fsg_led_sata_set(struct led_classdev *led_cdev, enum led_brightness value)
|
||||
+{
|
||||
+ if (value) {
|
||||
+ latch_value &= ~(1 << FSG_LED_SATA_BIT);
|
||||
+ *latch_address = latch_value;
|
||||
+ }
|
||||
+ else {
|
||||
+ latch_value |= (1 << FSG_LED_SATA_BIT);
|
||||
+ *latch_address = latch_value;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void fsg_led_usb_set(struct led_classdev *led_cdev, enum led_brightness value)
|
||||
+{
|
||||
+ if (value) {
|
||||
+ latch_value &= ~(1 << FSG_LED_USB_BIT);
|
||||
+ *latch_address = latch_value;
|
||||
+ }
|
||||
+ else {
|
||||
+ latch_value |= (1 << FSG_LED_USB_BIT);
|
||||
+ *latch_address = latch_value;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void fsg_led_sync_set(struct led_classdev *led_cdev, enum led_brightness value)
|
||||
+{
|
||||
+ if (value) {
|
||||
+ latch_value &= ~(1 << FSG_LED_SYNC_BIT);
|
||||
+ *latch_address = latch_value;
|
||||
+ }
|
||||
+ else {
|
||||
+ latch_value |= (1 << FSG_LED_SYNC_BIT);
|
||||
+ *latch_address = latch_value;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void fsg_led_ring_set(struct led_classdev *led_cdev, enum led_brightness value)
|
||||
+{
|
||||
+ if (value) {
|
||||
+ latch_value &= ~(1 << FSG_LED_RING_BIT);
|
||||
+ *latch_address = latch_value;
|
||||
+ }
|
||||
+ else {
|
||||
+ latch_value |= (1 << FSG_LED_RING_BIT);
|
||||
+ *latch_address = latch_value;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
+static struct led_classdev fsg_wlan_led = {
|
||||
+ .name = "fsg:wlan",
|
||||
+ .brightness_set = fsg_led_wlan_set,
|
||||
+};
|
||||
+
|
||||
+static struct led_classdev fsg_wan_led = {
|
||||
+ .name = "fsg:wan",
|
||||
+ .brightness_set = fsg_led_wan_set,
|
||||
+};
|
||||
+
|
||||
+static struct led_classdev fsg_sata_led = {
|
||||
+ .name = "fsg:sata",
|
||||
+ .brightness_set = fsg_led_sata_set,
|
||||
+};
|
||||
+
|
||||
+static struct led_classdev fsg_usb_led = {
|
||||
+ .name = "fsg:usb",
|
||||
+ .brightness_set = fsg_led_usb_set,
|
||||
+};
|
||||
+
|
||||
+static struct led_classdev fsg_sync_led = {
|
||||
+ .name = "fsg:sync",
|
||||
+ .brightness_set = fsg_led_sync_set,
|
||||
+};
|
||||
+
|
||||
+static struct led_classdev fsg_ring_led = {
|
||||
+ .name = "fsg:ring",
|
||||
+ .brightness_set = fsg_led_ring_set,
|
||||
+};
|
||||
+
|
||||
+
|
||||
+
|
||||
+#ifdef CONFIG_PM
|
||||
+static int fsg_led_suspend(struct platform_device *dev, pm_message_t state)
|
||||
+{
|
||||
+ led_classdev_suspend(&fsg_wlan_led);
|
||||
+ led_classdev_suspend(&fsg_wan_led);
|
||||
+ led_classdev_suspend(&fsg_sata_led);
|
||||
+ led_classdev_suspend(&fsg_usb_led);
|
||||
+ led_classdev_suspend(&fsg_sync_led);
|
||||
+ led_classdev_suspend(&fsg_ring_led);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int fsg_led_resume(struct platform_device *dev)
|
||||
+{
|
||||
+ led_classdev_resume(&fsg_wlan_led);
|
||||
+ led_classdev_resume(&fsg_wan_led);
|
||||
+ led_classdev_resume(&fsg_sata_led);
|
||||
+ led_classdev_resume(&fsg_usb_led);
|
||||
+ led_classdev_resume(&fsg_sync_led);
|
||||
+ led_classdev_resume(&fsg_ring_led);
|
||||
+ return 0;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
+static int fsg_led_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ /* FIXME: Need to work out how to handle failure below */
|
||||
+
|
||||
+ ret = led_classdev_register(&pdev->dev, &fsg_wlan_led);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ ret = led_classdev_register(&pdev->dev, &fsg_wan_led);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ ret = led_classdev_register(&pdev->dev, &fsg_sata_led);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ ret = led_classdev_register(&pdev->dev, &fsg_usb_led);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ ret = led_classdev_register(&pdev->dev, &fsg_sync_led);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ ret = led_classdev_register(&pdev->dev, &fsg_ring_led);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int fsg_led_remove(struct platform_device *pdev)
|
||||
+{
|
||||
+ led_classdev_unregister(&fsg_wlan_led);
|
||||
+ led_classdev_unregister(&fsg_wan_led);
|
||||
+ led_classdev_unregister(&fsg_sata_led);
|
||||
+ led_classdev_unregister(&fsg_usb_led);
|
||||
+ led_classdev_unregister(&fsg_sync_led);
|
||||
+ led_classdev_unregister(&fsg_ring_led);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static struct platform_driver fsg_led_driver = {
|
||||
+ .probe = fsg_led_probe,
|
||||
+ .remove = fsg_led_remove,
|
||||
+#ifdef CONFIG_PM
|
||||
+ .suspend = fsg_led_suspend,
|
||||
+ .resume = fsg_led_resume,
|
||||
+#endif
|
||||
+ .driver = {
|
||||
+ .name = "fsg-led",
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+
|
||||
+static int __init fsg_led_init(void)
|
||||
+{
|
||||
+ /* Map the LED chip select address space */
|
||||
+ latch_address = (unsigned short *) ioremap(IXP4XX_EXP_BUS_BASE(2), 512);
|
||||
+ if (!latch_address)
|
||||
+ return -ENOMEM;
|
||||
+ latch_value = 0xffff;
|
||||
+ *latch_address = latch_value;
|
||||
+ /* FIXME: We leak memory if the next line fails */
|
||||
+ return platform_driver_register(&fsg_led_driver);
|
||||
+}
|
||||
+
|
||||
+static void __exit fsg_led_exit(void)
|
||||
+{
|
||||
+ platform_driver_unregister(&fsg_led_driver);
|
||||
+ iounmap(latch_address);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+module_init(fsg_led_init);
|
||||
+module_exit(fsg_led_exit);
|
||||
+
|
||||
+MODULE_AUTHOR("Rod Whitby <rod@whitby.id.au>");
|
||||
+MODULE_DESCRIPTION("Freecom FSG-3 LED driver");
|
||||
+MODULE_LICENSE("GPL");
|
@ -0,0 +1,88 @@
|
||||
Index: linux-2.6.23.12-armeb/arch/arm/mach-ixp4xx/nslu2-setup.c
|
||||
===================================================================
|
||||
--- linux-2.6.23.12-armeb.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2008-01-08 15:28:13.000000000 +1030
|
||||
+++ linux-2.6.23.12-armeb/arch/arm/mach-ixp4xx/nslu2-setup.c 2008-01-08 15:28:32.000000000 +1030
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/flash.h>
|
||||
#include <asm/mach/time.h>
|
||||
+#include <asm/io.h>
|
||||
|
||||
static struct flash_platform_data nslu2_flash_data = {
|
||||
.map_name = "cfi_probe",
|
||||
@@ -140,6 +141,23 @@
|
||||
.resource = nslu2_uart_resources,
|
||||
};
|
||||
|
||||
+/* Built-in 10/100 Ethernet MAC interfaces */
|
||||
+static struct eth_plat_info nslu2_plat_eth[] = {
|
||||
+ {
|
||||
+ .phy = 1,
|
||||
+ .rxq = 3,
|
||||
+ .txreadyq = 20,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static struct platform_device nslu2_eth[] = {
|
||||
+ {
|
||||
+ .name = "ixp4xx_eth",
|
||||
+ .id = IXP4XX_ETH_NPEB,
|
||||
+ .dev.platform_data = nslu2_plat_eth,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
static struct platform_device *nslu2_devices[] __initdata = {
|
||||
&nslu2_i2c_gpio,
|
||||
&nslu2_flash,
|
||||
@@ -147,6 +165,7 @@
|
||||
#ifdef CONFIG_LEDS_IXP4XX
|
||||
&nslu2_leds,
|
||||
#endif
|
||||
+ &nslu2_eth[0],
|
||||
};
|
||||
|
||||
static void nslu2_power_off(void)
|
||||
@@ -175,6 +194,9 @@
|
||||
|
||||
static void __init nslu2_init(void)
|
||||
{
|
||||
+ uint8_t __iomem *f;
|
||||
+ int i;
|
||||
+
|
||||
ixp4xx_sys_init();
|
||||
|
||||
nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
|
||||
@@ -191,6 +213,33 @@
|
||||
(void)platform_device_register(&nslu2_uart);
|
||||
|
||||
platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices));
|
||||
+
|
||||
+
|
||||
+ /*
|
||||
+ * Map in a portion of the flash and read the MAC address.
|
||||
+ * Since it is stored in BE in the flash itself, we need to
|
||||
+ * byteswap it if we're in LE mode.
|
||||
+ */
|
||||
+ if ((f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x40000))) {
|
||||
+#ifdef __ARMEB__
|
||||
+ for (i = 0; i < 6; i++) {
|
||||
+ nslu2_plat_eth[0].hwaddr[i] = readb(f + 0x3FFB0 + i);
|
||||
+ }
|
||||
+#else
|
||||
+ nslu2_plat_eth[0].hwaddr[0] = readb(f + 0x3FFB0 + 3);
|
||||
+ nslu2_plat_eth[0].hwaddr[1] = readb(f + 0x3FFB0 + 2);
|
||||
+ nslu2_plat_eth[0].hwaddr[2] = readb(f + 0x3FFB0 + 1);
|
||||
+ nslu2_plat_eth[0].hwaddr[3] = readb(f + 0x3FFB0 + 0);
|
||||
+ nslu2_plat_eth[0].hwaddr[4] = readb(f + 0x3FFB0 + 7);
|
||||
+ nslu2_plat_eth[0].hwaddr[5] = readb(f + 0x3FFB0 + 6);
|
||||
+#endif
|
||||
+ iounmap(f);
|
||||
+ }
|
||||
+ printk(KERN_INFO "NSLU2: Using MAC address %.2x:%.2x:%.2x:%.2x:%.2x:%.2x for port 0\n",
|
||||
+ nslu2_plat_eth[0].hwaddr[0], nslu2_plat_eth[0].hwaddr[1],
|
||||
+ nslu2_plat_eth[0].hwaddr[2], nslu2_plat_eth[0].hwaddr[3],
|
||||
+ nslu2_plat_eth[0].hwaddr[4], nslu2_plat_eth[0].hwaddr[5]);
|
||||
+
|
||||
}
|
||||
|
||||
MACHINE_START(NSLU2, "Linksys NSLU2")
|
@ -0,0 +1,87 @@
|
||||
Index: linux-2.6.23.12-armeb/arch/arm/mach-ixp4xx/nas100d-setup.c
|
||||
===================================================================
|
||||
--- linux-2.6.23.12-armeb.orig/arch/arm/mach-ixp4xx/nas100d-setup.c 2008-01-08 15:22:07.000000000 +1030
|
||||
+++ linux-2.6.23.12-armeb/arch/arm/mach-ixp4xx/nas100d-setup.c 2008-01-08 15:32:32.000000000 +1030
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/flash.h>
|
||||
+#include <asm/io.h>
|
||||
|
||||
static struct flash_platform_data nas100d_flash_data = {
|
||||
.map_name = "cfi_probe",
|
||||
@@ -125,12 +126,30 @@
|
||||
.resource = nas100d_uart_resources,
|
||||
};
|
||||
|
||||
+/* Built-in 10/100 Ethernet MAC interfaces */
|
||||
+static struct eth_plat_info nas100d_plat_eth[] = {
|
||||
+ {
|
||||
+ .phy = 0,
|
||||
+ .rxq = 3,
|
||||
+ .txreadyq = 20,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static struct platform_device nas100d_eth[] = {
|
||||
+ {
|
||||
+ .name = "ixp4xx_eth",
|
||||
+ .id = IXP4XX_ETH_NPEB,
|
||||
+ .dev.platform_data = nas100d_plat_eth,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
static struct platform_device *nas100d_devices[] __initdata = {
|
||||
&nas100d_i2c_gpio,
|
||||
&nas100d_flash,
|
||||
#ifdef CONFIG_LEDS_IXP4XX
|
||||
&nas100d_leds,
|
||||
#endif
|
||||
+ &nas100d_eth[0],
|
||||
};
|
||||
|
||||
static void nas100d_power_off(void)
|
||||
@@ -146,6 +165,9 @@
|
||||
|
||||
static void __init nas100d_init(void)
|
||||
{
|
||||
+ uint8_t __iomem *f;
|
||||
+ int i;
|
||||
+
|
||||
ixp4xx_sys_init();
|
||||
|
||||
/* gpio 14 and 15 are _not_ clocks */
|
||||
@@ -165,6 +187,33 @@
|
||||
(void)platform_device_register(&nas100d_uart);
|
||||
|
||||
platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices));
|
||||
+
|
||||
+
|
||||
+ /*
|
||||
+ * Map in a portion of the flash and read the MAC address.
|
||||
+ * Since it is stored in BE in the flash itself, we need to
|
||||
+ * byteswap it if we're in LE mode.
|
||||
+ */
|
||||
+ if ((f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x1000000))) {
|
||||
+#ifdef __ARMEB__
|
||||
+ for (i = 0; i < 6; i++) {
|
||||
+ nas100d_plat_eth[0].hwaddr[i] = readb(f + 0xFC0FD8 + i);
|
||||
+ }
|
||||
+#else
|
||||
+ nas100d_plat_eth[0].hwaddr[0] = readb(f + 0xFC0FD8 + 3);
|
||||
+ nas100d_plat_eth[0].hwaddr[1] = readb(f + 0xFC0FD8 + 2);
|
||||
+ nas100d_plat_eth[0].hwaddr[2] = readb(f + 0xFC0FD8 + 1);
|
||||
+ nas100d_plat_eth[0].hwaddr[3] = readb(f + 0xFC0FD8 + 0);
|
||||
+ nas100d_plat_eth[0].hwaddr[4] = readb(f + 0xFC0FD8 + 7);
|
||||
+ nas100d_plat_eth[0].hwaddr[5] = readb(f + 0xFC0FD8 + 6);
|
||||
+#endif
|
||||
+ iounmap(f);
|
||||
+ }
|
||||
+ printk(KERN_INFO "NAS100D: Using MAC address %.2x:%.2x:%.2x:%.2x:%.2x:%.2x for port 0\n",
|
||||
+ nas100d_plat_eth[0].hwaddr[0], nas100d_plat_eth[0].hwaddr[1],
|
||||
+ nas100d_plat_eth[0].hwaddr[2], nas100d_plat_eth[0].hwaddr[3],
|
||||
+ nas100d_plat_eth[0].hwaddr[4], nas100d_plat_eth[0].hwaddr[5]);
|
||||
+
|
||||
}
|
||||
|
||||
MACHINE_START(NAS100D, "Iomega NAS 100d")
|
@ -0,0 +1,17 @@
|
||||
Index: linux-2.6.19/drivers/char/random.c
|
||||
===================================================================
|
||||
--- linux-2.6.19.orig/drivers/char/random.c
|
||||
+++ linux-2.6.19/drivers/char/random.c
|
||||
@@ -248,9 +248,9 @@
|
||||
/*
|
||||
* Configuration information
|
||||
*/
|
||||
-#define INPUT_POOL_WORDS 128
|
||||
-#define OUTPUT_POOL_WORDS 32
|
||||
-#define SEC_XFER_SIZE 512
|
||||
+#define INPUT_POOL_WORDS 256
|
||||
+#define OUTPUT_POOL_WORDS 64
|
||||
+#define SEC_XFER_SIZE 1024
|
||||
|
||||
/*
|
||||
* The minimum number of bits of entropy before we wake up a read on
|
55
target/linux/ixp4xx/patches-2.6.24/091-nslu2_rtc_fixup.patch
Normal file
55
target/linux/ixp4xx/patches-2.6.24/091-nslu2_rtc_fixup.patch
Normal file
@ -0,0 +1,55 @@
|
||||
diff -uprN linux-2.6.23.orig/arch/arm/mach-ixp4xx/nslu2-setup.c linux-2.6.23/arch/arm/mach-ixp4xx/nslu2-setup.c
|
||||
--- linux-2.6.23.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2007-10-09 15:31:38.000000000 -0500
|
||||
+++ linux-2.6.23/arch/arm/mach-ixp4xx/nslu2-setup.c 2007-10-11 01:04:46.000000000 -0500
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <linux/serial_8250.h>
|
||||
#include <linux/leds.h>
|
||||
|
||||
+#include <asm/setup.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/flash.h>
|
||||
@@ -171,6 +172,35 @@ static struct sys_timer nslu2_timer = {
|
||||
.init = nslu2_timer_init,
|
||||
};
|
||||
|
||||
+static char nslu2_rtc_probe[] __initdata = "rtc-isl1208.ignore=0,0x6f rtc-x1205.probe=0,0x6f ";
|
||||
+
|
||||
+static void __init nslu2_fixup(struct machine_desc *desc,
|
||||
+ struct tag *tags, char **cmdline, struct meminfo *mi)
|
||||
+{
|
||||
+ struct tag *t = tags;
|
||||
+ char *p = *cmdline;
|
||||
+
|
||||
+ /* Find the end of the tags table, taking note of any cmdline tag. */
|
||||
+ for (; t->hdr.size; t = tag_next(t)) {
|
||||
+ if (t->hdr.tag == ATAG_CMDLINE) {
|
||||
+ p = t->u.cmdline.cmdline;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* Overwrite the end of the table with a new cmdline tag. */
|
||||
+ t->hdr.tag = ATAG_CMDLINE;
|
||||
+ t->hdr.size = (sizeof (struct tag_header) +
|
||||
+ strlen(nslu2_rtc_probe) + strlen(p) + 1 + 4) >> 2;
|
||||
+ strlcpy(t->u.cmdline.cmdline, nslu2_rtc_probe, COMMAND_LINE_SIZE);
|
||||
+ strlcpy(t->u.cmdline.cmdline + strlen(nslu2_rtc_probe), p,
|
||||
+ COMMAND_LINE_SIZE - strlen(nslu2_rtc_probe));
|
||||
+
|
||||
+ /* Terminate the table. */
|
||||
+ t = tag_next(t);
|
||||
+ t->hdr.tag = ATAG_NONE;
|
||||
+ t->hdr.size = 0;
|
||||
+}
|
||||
+
|
||||
static void __init nslu2_init(void)
|
||||
{
|
||||
ixp4xx_sys_init();
|
||||
@@ -196,6 +226,7 @@ MACHINE_START(NSLU2, "Linksys NSLU2")
|
||||
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
|
||||
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
|
||||
.boot_params = 0x00000100,
|
||||
+ .fixup = nslu2_fixup,
|
||||
.map_io = ixp4xx_map_io,
|
||||
.init_irq = ixp4xx_init_irq,
|
||||
.timer = &nslu2_timer,
|
@ -0,0 +1,55 @@
|
||||
diff -uprN linux-2.6.23.orig/arch/arm/mach-ixp4xx/nas100d-setup.c linux-2.6.23/arch/arm/mach-ixp4xx/nas100d-setup.c
|
||||
--- linux-2.6.23.orig/arch/arm/mach-ixp4xx/nas100d-setup.c 2007-10-09 15:31:38.000000000 -0500
|
||||
+++ linux-2.6.23/arch/arm/mach-ixp4xx/nas100d-setup.c 2007-10-11 01:06:33.000000000 -0500
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <linux/serial_8250.h>
|
||||
#include <linux/leds.h>
|
||||
|
||||
+#include <asm/setup.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/flash.h>
|
||||
@@ -142,6 +143,35 @@ static void nas100d_power_off(void)
|
||||
gpio_line_set(NAS100D_PO_GPIO, IXP4XX_GPIO_HIGH);
|
||||
}
|
||||
|
||||
+static char nas100d_rtc_probe[] __initdata = "rtc-pcf8563.probe=0,0x51 ";
|
||||
+
|
||||
+static void __init nas100d_fixup(struct machine_desc *desc,
|
||||
+ struct tag *tags, char **cmdline, struct meminfo *mi)
|
||||
+{
|
||||
+ struct tag *t = tags;
|
||||
+ char *p = *cmdline;
|
||||
+
|
||||
+ /* Find the end of the tags table, taking note of any cmdline tag. */
|
||||
+ for (; t->hdr.size; t = tag_next(t)) {
|
||||
+ if (t->hdr.tag == ATAG_CMDLINE) {
|
||||
+ p = t->u.cmdline.cmdline;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* Overwrite the end of the table with a new cmdline tag. */
|
||||
+ t->hdr.tag = ATAG_CMDLINE;
|
||||
+ t->hdr.size = (sizeof (struct tag_header) +
|
||||
+ strlen(nas100d_rtc_probe) + strlen(p) + 1 + 4) >> 2;
|
||||
+ strlcpy(t->u.cmdline.cmdline, nas100d_rtc_probe, COMMAND_LINE_SIZE);
|
||||
+ strlcpy(t->u.cmdline.cmdline + strlen(nas100d_rtc_probe), p,
|
||||
+ COMMAND_LINE_SIZE - strlen(nas100d_rtc_probe));
|
||||
+
|
||||
+ /* Terminate the table. */
|
||||
+ t = tag_next(t);
|
||||
+ t->hdr.tag = ATAG_NONE;
|
||||
+ t->hdr.size = 0;
|
||||
+}
|
||||
+
|
||||
static void __init nas100d_init(void)
|
||||
{
|
||||
ixp4xx_sys_init();
|
||||
@@ -170,6 +200,7 @@ MACHINE_START(NAS100D, "Iomega NAS 100d"
|
||||
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
|
||||
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
|
||||
.boot_params = 0x00000100,
|
||||
+ .fixup = nas100d_fixup,
|
||||
.map_io = ixp4xx_map_io,
|
||||
.init_irq = ixp4xx_init_irq,
|
||||
.timer = &ixp4xx_timer,
|
@ -0,0 +1,56 @@
|
||||
Index: linux-2.6.22-rc4-armeb/arch/arm/mach-ixp4xx/dsmg600-setup.c
|
||||
===================================================================
|
||||
--- linux-2.6.22-rc4-armeb.orig/arch/arm/mach-ixp4xx/dsmg600-setup.c
|
||||
+++ linux-2.6.22-rc4-armeb/arch/arm/mach-ixp4xx/dsmg600-setup.c
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <linux/serial_8250.h>
|
||||
#include <linux/i2c-gpio.h>
|
||||
|
||||
+#include <asm/setup.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/flash.h>
|
||||
@@ -145,6 +146,35 @@ static struct sys_timer dsmg600_timer =
|
||||
.init = dsmg600_timer_init,
|
||||
};
|
||||
|
||||
+static char dsmg600_rtc_probe[] __initdata = "rtc-pcf8563.probe=0,0x51 ";
|
||||
+
|
||||
+static void __init dsmg600_fixup(struct machine_desc *desc,
|
||||
+ struct tag *tags, char **cmdline, struct meminfo *mi)
|
||||
+{
|
||||
+ struct tag *t = tags;
|
||||
+ char *p = *cmdline;
|
||||
+
|
||||
+ /* Find the end of the tags table, taking note of any cmdline tag. */
|
||||
+ for (; t->hdr.size; t = tag_next(t)) {
|
||||
+ if (t->hdr.tag == ATAG_CMDLINE) {
|
||||
+ p = t->u.cmdline.cmdline;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* Overwrite the end of the table with a new cmdline tag. */
|
||||
+ t->hdr.tag = ATAG_CMDLINE;
|
||||
+ t->hdr.size = (sizeof (struct tag_header) +
|
||||
+ strlen(dsmg600_rtc_probe) + strlen(p) + 1 + 4) >> 2;
|
||||
+ strlcpy(t->u.cmdline.cmdline, dsmg600_rtc_probe, COMMAND_LINE_SIZE);
|
||||
+ strlcpy(t->u.cmdline.cmdline + strlen(dsmg600_rtc_probe), p,
|
||||
+ COMMAND_LINE_SIZE - strlen(dsmg600_rtc_probe));
|
||||
+
|
||||
+ /* Terminate the table. */
|
||||
+ t = tag_next(t);
|
||||
+ t->hdr.tag = ATAG_NONE;
|
||||
+ t->hdr.size = 0;
|
||||
+}
|
||||
+
|
||||
static void __init dsmg600_init(void)
|
||||
{
|
||||
ixp4xx_sys_init();
|
||||
@@ -177,6 +207,7 @@ MACHINE_START(DSMG600, "D-Link DSM-G600
|
||||
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
|
||||
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
|
||||
.boot_params = 0x00000100,
|
||||
+ .fixup = dsmg600_fixup,
|
||||
.map_io = ixp4xx_map_io,
|
||||
.init_irq = ixp4xx_init_irq,
|
||||
.timer = &dsmg600_timer,
|
@ -0,0 +1,41 @@
|
||||
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/gateway7001-setup.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/gateway7001-setup.c
|
||||
--- linux-2.6.23/arch/arm/mach-ixp4xx/gateway7001-setup.c 2007-10-09 22:31:38.000000000 +0200
|
||||
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/gateway7001-setup.c 2007-10-22 15:09:33.000000000 +0200
|
||||
@@ -76,9 +76,36 @@
|
||||
.resource = &gateway7001_uart_resource,
|
||||
};
|
||||
|
||||
+/* Built-in 10/100 Ethernet MAC interfaces */
|
||||
+static struct eth_plat_info gateway7001_plat_eth[] = {
|
||||
+ {
|
||||
+ .phy = 1,
|
||||
+ .rxq = 3,
|
||||
+ .txreadyq = 20,
|
||||
+ }, {
|
||||
+ .phy = 2,
|
||||
+ .rxq = 4,
|
||||
+ .txreadyq = 21,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static struct platform_device gateway7001_eth[] = {
|
||||
+ {
|
||||
+ .name = "ixp4xx_eth",
|
||||
+ .id = IXP4XX_ETH_NPEB,
|
||||
+ .dev.platform_data = gateway7001_plat_eth,
|
||||
+ }, {
|
||||
+ .name = "ixp4xx_eth",
|
||||
+ .id = IXP4XX_ETH_NPEC,
|
||||
+ .dev.platform_data = gateway7001_plat_eth + 1,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
static struct platform_device *gateway7001_devices[] __initdata = {
|
||||
&gateway7001_flash,
|
||||
- &gateway7001_uart
|
||||
+ &gateway7001_uart,
|
||||
+ &gateway7001_eth[0],
|
||||
+ &gateway7001_eth[1],
|
||||
};
|
||||
|
||||
static void __init gateway7001_init(void)
|
@ -0,0 +1,31 @@
|
||||
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/wg302v2-setup.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/wg302v2-setup.c
|
||||
--- linux-2.6.23/arch/arm/mach-ixp4xx/wg302v2-setup.c 2007-10-09 22:31:38.000000000 +0200
|
||||
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/wg302v2-setup.c 2007-10-22 15:02:20.000000000 +0200
|
||||
@@ -77,9 +77,27 @@
|
||||
.resource = &wg302v2_uart_resource,
|
||||
};
|
||||
|
||||
+/* Built-in 10/100 Ethernet MAC interfaces */
|
||||
+static struct eth_plat_info wg302_plat_eth[] = {
|
||||
+ {
|
||||
+ .phy = 8,
|
||||
+ .rxq = 3,
|
||||
+ .txreadyq = 20,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static struct platform_device wg302_eth[] = {
|
||||
+ {
|
||||
+ .name = "ixp4xx_eth",
|
||||
+ .id = IXP4XX_ETH_NPEB,
|
||||
+ .dev.platform_data = wg302_plat_eth,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
static struct platform_device *wg302v2_devices[] __initdata = {
|
||||
&wg302v2_flash,
|
||||
&wg302v2_uart,
|
||||
+ &wg302_eth[0],
|
||||
};
|
||||
|
||||
static void __init wg302v2_init(void)
|
@ -0,0 +1,297 @@
|
||||
Index: linux-2.6.23.12/arch/arm/mach-ixp4xx/Kconfig
|
||||
===================================================================
|
||||
--- linux-2.6.23.12.orig/arch/arm/mach-ixp4xx/Kconfig 2008-01-05 13:30:14.000000000 +1030
|
||||
+++ linux-2.6.23.12/arch/arm/mach-ixp4xx/Kconfig 2008-01-05 13:37:05.000000000 +1030
|
||||
@@ -57,6 +57,14 @@
|
||||
WG302 v2 or WAG302 v2 Access Points. For more information
|
||||
on this platform, see http://openwrt.org
|
||||
|
||||
+config MACH_PRONGHORNMETRO
|
||||
+ bool "Pronghorn Metro"
|
||||
+ select PCI
|
||||
+ help
|
||||
+ Say 'Y' here if you want your kernel to support the ADI
|
||||
+ Engineering Pronghorn Metro Platform. For more
|
||||
+ information on this platform, see <file:Documentation/arm/IXP4xx>.
|
||||
+
|
||||
config ARCH_IXDP425
|
||||
bool "IXDP425"
|
||||
help
|
||||
Index: linux-2.6.23.12/arch/arm/mach-ixp4xx/Makefile
|
||||
===================================================================
|
||||
--- linux-2.6.23.12.orig/arch/arm/mach-ixp4xx/Makefile 2008-01-05 13:32:45.000000000 +1030
|
||||
+++ linux-2.6.23.12/arch/arm/mach-ixp4xx/Makefile 2008-01-05 13:37:37.000000000 +1030
|
||||
@@ -16,6 +16,7 @@
|
||||
obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o
|
||||
obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
|
||||
obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
|
||||
+obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
|
||||
|
||||
obj-y += common.o
|
||||
|
||||
@@ -30,5 +31,6 @@
|
||||
obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
|
||||
obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
|
||||
obj-$(CONFIG_MACH_FSG) += fsg-setup.o fsg-power.o
|
||||
+obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
|
||||
|
||||
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
|
||||
Index: linux-2.6.23.12/arch/arm/mach-ixp4xx/pronghornmetro-pci.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ linux-2.6.23.12/arch/arm/mach-ixp4xx/pronghornmetro-pci.c 2008-01-05 13:37:05.000000000 +1030
|
||||
@@ -0,0 +1,74 @@
|
||||
+/*
|
||||
+ * arch/arch/mach-ixp4xx/pronghornmetro-pci.c
|
||||
+ *
|
||||
+ * PCI setup routines for ADI Engineering Pronghorn Metro
|
||||
+ *
|
||||
+ * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
|
||||
+ *
|
||||
+ * based on coyote-pci.c:
|
||||
+ * Copyright (C) 2002 Jungo Software Technologies.
|
||||
+ * Copyright (C) 2003 MontaVista Softwrae, Inc.
|
||||
+ *
|
||||
+ * Maintainer: Imre Kaloz <kaloz@openwrt.org>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License version 2 as
|
||||
+ * published by the Free Software Foundation.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/pci.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/irq.h>
|
||||
+
|
||||
+#include <asm/mach-types.h>
|
||||
+#include <asm/hardware.h>
|
||||
+#include <asm/irq.h>
|
||||
+
|
||||
+#include <asm/mach/pci.h>
|
||||
+
|
||||
+extern void ixp4xx_pci_preinit(void);
|
||||
+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);
|
||||
+
|
||||
+void __init pronghornmetro_pci_preinit(void)
|
||||
+{
|
||||
+ set_irq_type(IRQ_IXP4XX_GPIO4, IRQT_LOW);
|
||||
+ set_irq_type(IRQ_IXP4XX_GPIO6, IRQT_LOW);
|
||||
+ set_irq_type(IRQ_IXP4XX_GPIO11, IRQT_LOW);
|
||||
+ set_irq_type(IRQ_IXP4XX_GPIO1, IRQT_LOW);
|
||||
+
|
||||
+ ixp4xx_pci_preinit();
|
||||
+}
|
||||
+
|
||||
+static int __init pronghornmetro_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
|
||||
+{
|
||||
+ if (slot == 13)
|
||||
+ return IRQ_IXP4XX_GPIO4;
|
||||
+ else if (slot == 14)
|
||||
+ return IRQ_IXP4XX_GPIO6;
|
||||
+ else if (slot == 15)
|
||||
+ return IRQ_IXP4XX_GPIO11;
|
||||
+ else if (slot == 16)
|
||||
+ return IRQ_IXP4XX_GPIO1;
|
||||
+ else return -1;
|
||||
+}
|
||||
+
|
||||
+struct hw_pci pronghornmetro_pci __initdata = {
|
||||
+ .nr_controllers = 1,
|
||||
+ .preinit = pronghornmetro_pci_preinit,
|
||||
+ .swizzle = pci_std_swizzle,
|
||||
+ .setup = ixp4xx_setup,
|
||||
+ .scan = ixp4xx_scan_bus,
|
||||
+ .map_irq = pronghornmetro_map_irq,
|
||||
+};
|
||||
+
|
||||
+int __init pronghornmetro_pci_init(void)
|
||||
+{
|
||||
+ if (machine_is_pronghorn_metro())
|
||||
+ pci_common_init(&pronghornmetro_pci);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+subsys_initcall(pronghornmetro_pci_init);
|
||||
Index: linux-2.6.23.12/arch/arm/mach-ixp4xx/pronghornmetro-setup.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ linux-2.6.23.12/arch/arm/mach-ixp4xx/pronghornmetro-setup.c 2008-01-05 13:37:05.000000000 +1030
|
||||
@@ -0,0 +1,147 @@
|
||||
+/*
|
||||
+ * arch/arm/mach-ixp4xx/pronghornmetro-setup.c
|
||||
+ *
|
||||
+ * Board setup for the ADI Engineering Pronghorn Metro
|
||||
+ *
|
||||
+ * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
|
||||
+ *
|
||||
+ * based on coyote-setup.c:
|
||||
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
|
||||
+ *
|
||||
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
|
||||
+ */
|
||||
+
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/device.h>
|
||||
+#include <linux/serial.h>
|
||||
+#include <linux/tty.h>
|
||||
+#include <linux/serial_8250.h>
|
||||
+#include <linux/slab.h>
|
||||
+
|
||||
+#include <asm/types.h>
|
||||
+#include <asm/setup.h>
|
||||
+#include <asm/memory.h>
|
||||
+#include <asm/hardware.h>
|
||||
+#include <asm/irq.h>
|
||||
+#include <asm/mach-types.h>
|
||||
+#include <asm/mach/arch.h>
|
||||
+#include <asm/mach/flash.h>
|
||||
+
|
||||
+static struct flash_platform_data pronghornmetro_flash_data = {
|
||||
+ .map_name = "cfi_probe",
|
||||
+ .width = 2,
|
||||
+};
|
||||
+
|
||||
+static struct resource pronghornmetro_flash_resource = {
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+};
|
||||
+
|
||||
+static struct platform_device pronghornmetro_flash = {
|
||||
+ .name = "IXP4XX-Flash",
|
||||
+ .id = 0,
|
||||
+ .dev = {
|
||||
+ .platform_data = &pronghornmetro_flash_data,
|
||||
+ },
|
||||
+ .num_resources = 1,
|
||||
+ .resource = &pronghornmetro_flash_resource,
|
||||
+};
|
||||
+
|
||||
+static struct resource pronghornmetro_uart_resource = {
|
||||
+ .start = IXP4XX_UART2_BASE_PHYS,
|
||||
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+};
|
||||
+
|
||||
+static struct plat_serial8250_port pronghornmetro_uart_data[] = {
|
||||
+ {
|
||||
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
|
||||
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
|
||||
+ .irq = IRQ_IXP4XX_UART2,
|
||||
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
|
||||
+ .iotype = UPIO_MEM,
|
||||
+ .regshift = 2,
|
||||
+ .uartclk = IXP4XX_UART_XTAL,
|
||||
+ },
|
||||
+ { },
|
||||
+};
|
||||
+
|
||||
+static struct platform_device pronghornmetro_uart = {
|
||||
+ .name = "serial8250",
|
||||
+ .id = PLAT8250_DEV_PLATFORM,
|
||||
+ .dev = {
|
||||
+ .platform_data = pronghornmetro_uart_data,
|
||||
+ },
|
||||
+ .num_resources = 1,
|
||||
+ .resource = &pronghornmetro_uart_resource,
|
||||
+};
|
||||
+
|
||||
+static struct resource pronghornmetro_pata_resources[] = {
|
||||
+ {
|
||||
+ .flags = IORESOURCE_MEM
|
||||
+ },
|
||||
+ {
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+ },
|
||||
+ {
|
||||
+ .name = "intrq",
|
||||
+ .start = IRQ_IXP4XX_GPIO0,
|
||||
+ .end = IRQ_IXP4XX_GPIO0,
|
||||
+ .flags = IORESOURCE_IRQ,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static struct ixp4xx_pata_data pronghornmetro_pata_data = {
|
||||
+ .cs0_bits = 0xbfff0043,
|
||||
+ .cs1_bits = 0xbfff0043,
|
||||
+};
|
||||
+
|
||||
+static struct platform_device pronghornmetro_pata = {
|
||||
+ .name = "pata_ixp4xx_cf",
|
||||
+ .id = 0,
|
||||
+ .dev.platform_data = &pronghornmetro_pata_data,
|
||||
+ .num_resources = ARRAY_SIZE(pronghornmetro_pata_resources),
|
||||
+ .resource = pronghornmetro_pata_resources,
|
||||
+};
|
||||
+
|
||||
+static struct platform_device *pronghornmetro_devices[] __initdata = {
|
||||
+ &pronghornmetro_flash,
|
||||
+ &pronghornmetro_uart,
|
||||
+};
|
||||
+
|
||||
+static void __init pronghornmetro_init(void)
|
||||
+{
|
||||
+ ixp4xx_sys_init();
|
||||
+
|
||||
+ pronghornmetro_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
|
||||
+ pronghornmetro_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_16M - 1;
|
||||
+
|
||||
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
|
||||
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
|
||||
+
|
||||
+ platform_add_devices(pronghornmetro_devices, ARRAY_SIZE(pronghornmetro_devices));
|
||||
+
|
||||
+ pronghornmetro_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(1);
|
||||
+ pronghornmetro_pata_resources[0].end = IXP4XX_EXP_BUS_END(1);
|
||||
+
|
||||
+ pronghornmetro_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(2);
|
||||
+ pronghornmetro_pata_resources[1].end = IXP4XX_EXP_BUS_END(2);
|
||||
+
|
||||
+ pronghornmetro_pata_data.cs0_cfg = IXP4XX_EXP_CS1;
|
||||
+ pronghornmetro_pata_data.cs1_cfg = IXP4XX_EXP_CS2;
|
||||
+
|
||||
+ platform_device_register(&pronghornmetro_pata);
|
||||
+}
|
||||
+
|
||||
+#ifdef CONFIG_MACH_PRONGHORNMETRO
|
||||
+MACHINE_START(PRONGHORNMETRO, "ADI Engineering Pronghorn Metro")
|
||||
+ /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
|
||||
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
|
||||
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
|
||||
+ .map_io = ixp4xx_map_io,
|
||||
+ .init_irq = ixp4xx_init_irq,
|
||||
+ .timer = &ixp4xx_timer,
|
||||
+ .boot_params = 0x0100,
|
||||
+ .init_machine = pronghornmetro_init,
|
||||
+MACHINE_END
|
||||
+#endif
|
||||
Index: linux-2.6.23.12/Documentation/arm/IXP4xx
|
||||
===================================================================
|
||||
--- linux-2.6.23.12.orig/Documentation/arm/IXP4xx 2008-01-05 13:30:14.000000000 +1030
|
||||
+++ linux-2.6.23.12/Documentation/arm/IXP4xx 2008-01-05 13:37:05.000000000 +1030
|
||||
@@ -111,6 +111,9 @@
|
||||
the platform has two mini-PCI slots used for 802.11[bga] cards.
|
||||
Finally, there is an IDE port hanging off the expansion bus.
|
||||
|
||||
+ADI Engineering Pronghorn Metro Platform
|
||||
+http://www.adiengineering.com/php-bin/ecomm4/productDisplay.php?category_id=30&product_id=85
|
||||
+
|
||||
Gateworks Avila Network Platform
|
||||
http://www.gateworks.com/avila_sbc.htm
|
||||
|
||||
Index: linux-2.6.23.12/include/asm-arm/arch-ixp4xx/uncompress.h
|
||||
===================================================================
|
||||
--- linux-2.6.23.12.orig/include/asm-arm/arch-ixp4xx/uncompress.h 2008-01-05 13:30:14.000000000 +1030
|
||||
+++ linux-2.6.23.12/include/asm-arm/arch-ixp4xx/uncompress.h 2008-01-05 13:37:05.000000000 +1030
|
||||
@@ -41,7 +41,8 @@
|
||||
* Some boards are using UART2 as console
|
||||
*/
|
||||
if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
|
||||
- machine_is_gateway7001() || machine_is_wg302v2())
|
||||
+ machine_is_gateway7001() || machine_is_wg302v2() ||
|
||||
+ machine_is_pronghorn_metro())
|
||||
uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
|
||||
else
|
||||
uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;
|
@ -0,0 +1,40 @@
|
||||
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/pronghornmetro-setup.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/pronghornmetro-setup.c
|
||||
--- linux-2.6.23/arch/arm/mach-ixp4xx/pronghornmetro-setup.c 2007-10-22 15:41:27.000000000 +0200
|
||||
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/pronghornmetro-setup.c 2007-10-22 15:43:30.000000000 +0200
|
||||
@@ -104,9 +104,36 @@
|
||||
.resource = pronghornmetro_pata_resources,
|
||||
};
|
||||
|
||||
+/* Built-in 10/100 Ethernet MAC interfaces */
|
||||
+static struct eth_plat_info pronghornmetro_plat_eth[] = {
|
||||
+ {
|
||||
+ .phy = 0,
|
||||
+ .rxq = 3,
|
||||
+ .txreadyq = 20,
|
||||
+ }, {
|
||||
+ .phy = 1,
|
||||
+ .rxq = 4,
|
||||
+ .txreadyq = 21,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static struct platform_device pronghornmetro_eth[] = {
|
||||
+ {
|
||||
+ .name = "ixp4xx_eth",
|
||||
+ .id = IXP4XX_ETH_NPEB,
|
||||
+ .dev.platform_data = pronghornmetro_plat_eth,
|
||||
+ }, {
|
||||
+ .name = "ixp4xx_eth",
|
||||
+ .id = IXP4XX_ETH_NPEC,
|
||||
+ .dev.platform_data = pronghornmetro_plat_eth + 1,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
static struct platform_device *pronghornmetro_devices[] __initdata = {
|
||||
&pronghornmetro_flash,
|
||||
&pronghornmetro_uart,
|
||||
+ &pronghornmetro_eth[0],
|
||||
+ &pronghornmetro_eth[1],
|
||||
};
|
||||
|
||||
static void __init pronghornmetro_init(void)
|
185
target/linux/ixp4xx/patches-2.6.24/120-compex_support.patch
Normal file
185
target/linux/ixp4xx/patches-2.6.24/120-compex_support.patch
Normal file
@ -0,0 +1,185 @@
|
||||
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/Kconfig linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Kconfig
|
||||
--- linux-2.6.23/arch/arm/mach-ixp4xx/Kconfig 2007-10-23 18:03:34.000000000 +0200
|
||||
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Kconfig 2007-10-23 18:22:41.000000000 +0200
|
||||
@@ -65,6 +65,14 @@
|
||||
Engineering Pronghorn Metro Platform. For more
|
||||
information on this platform, see <file:Documentation/arm/IXP4xx>.
|
||||
|
||||
+config MACH_COMPEX
|
||||
+ bool "Compex WP18 / NP18A"
|
||||
+ select PCI
|
||||
+ help
|
||||
+ Say 'Y' here if you want your kernel to support Compex'
|
||||
+ WP18 or NP18A boards. For more information on this
|
||||
+ platform, see http://openwrt.org
|
||||
+
|
||||
config ARCH_IXDP425
|
||||
bool "IXDP425"
|
||||
help
|
||||
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/Makefile linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Makefile
|
||||
--- linux-2.6.23/arch/arm/mach-ixp4xx/Makefile 2007-10-23 18:03:34.000000000 +0200
|
||||
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Makefile 2007-10-23 18:22:41.000000000 +0200
|
||||
@@ -17,6 +17,7 @@
|
||||
obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
|
||||
obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
|
||||
obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
|
||||
+obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
|
||||
|
||||
obj-y += common.o
|
||||
|
||||
@@ -32,6 +33,7 @@
|
||||
obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
|
||||
obj-$(CONFIG_MACH_FSG) += fsg-setup.o
|
||||
obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
|
||||
+obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
|
||||
|
||||
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
|
||||
obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
|
||||
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/compex-setup.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/compex-setup.c
|
||||
--- linux-2.6.23/arch/arm/mach-ixp4xx/compex-setup.c 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/compex-setup.c 2007-10-23 18:22:41.000000000 +0200
|
||||
@@ -0,0 +1,120 @@
|
||||
+/*
|
||||
+ * arch/arm/mach-ixp4xx/compex-setup.c
|
||||
+ *
|
||||
+ * Ccompex WP18 / NP18A board-setup
|
||||
+ *
|
||||
+ * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
|
||||
+ *
|
||||
+ * based on ixdp425-setup.c:
|
||||
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
|
||||
+ *
|
||||
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
|
||||
+ */
|
||||
+
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/device.h>
|
||||
+#include <linux/serial.h>
|
||||
+#include <linux/tty.h>
|
||||
+#include <linux/serial_8250.h>
|
||||
+#include <linux/slab.h>
|
||||
+
|
||||
+#include <asm/types.h>
|
||||
+#include <asm/setup.h>
|
||||
+#include <asm/memory.h>
|
||||
+#include <asm/hardware.h>
|
||||
+#include <asm/mach-types.h>
|
||||
+#include <asm/irq.h>
|
||||
+#include <asm/mach/arch.h>
|
||||
+#include <asm/mach/flash.h>
|
||||
+
|
||||
+static struct flash_platform_data compex_flash_data = {
|
||||
+ .map_name = "cfi_probe",
|
||||
+ .width = 2,
|
||||
+};
|
||||
+
|
||||
+static struct resource compex_flash_resource = {
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+};
|
||||
+
|
||||
+static struct platform_device compex_flash = {
|
||||
+ .name = "IXP4XX-Flash",
|
||||
+ .id = 0,
|
||||
+ .dev = {
|
||||
+ .platform_data = &compex_flash_data,
|
||||
+ },
|
||||
+ .num_resources = 1,
|
||||
+ .resource = &compex_flash_resource,
|
||||
+};
|
||||
+
|
||||
+static struct resource compex_uart_resources[] = {
|
||||
+ {
|
||||
+ .start = IXP4XX_UART1_BASE_PHYS,
|
||||
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
|
||||
+ .flags = IORESOURCE_MEM
|
||||
+ },
|
||||
+ {
|
||||
+ .start = IXP4XX_UART2_BASE_PHYS,
|
||||
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
|
||||
+ .flags = IORESOURCE_MEM
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static struct plat_serial8250_port compex_uart_data[] = {
|
||||
+ {
|
||||
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
|
||||
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
|
||||
+ .irq = IRQ_IXP4XX_UART1,
|
||||
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
|
||||
+ .iotype = UPIO_MEM,
|
||||
+ .regshift = 2,
|
||||
+ .uartclk = IXP4XX_UART_XTAL,
|
||||
+ },
|
||||
+ {
|
||||
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
|
||||
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
|
||||
+ .irq = IRQ_IXP4XX_UART2,
|
||||
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
|
||||
+ .iotype = UPIO_MEM,
|
||||
+ .regshift = 2,
|
||||
+ .uartclk = IXP4XX_UART_XTAL,
|
||||
+ },
|
||||
+ { },
|
||||
+};
|
||||
+
|
||||
+static struct platform_device compex_uart = {
|
||||
+ .name = "serial8250",
|
||||
+ .id = PLAT8250_DEV_PLATFORM,
|
||||
+ .dev.platform_data = compex_uart_data,
|
||||
+ .num_resources = 2,
|
||||
+ .resource = compex_uart_resources,
|
||||
+};
|
||||
+
|
||||
+static struct platform_device *compex_devices[] __initdata = {
|
||||
+ &compex_flash,
|
||||
+ &compex_uart
|
||||
+};
|
||||
+
|
||||
+static void __init compex_init(void)
|
||||
+{
|
||||
+ ixp4xx_sys_init();
|
||||
+
|
||||
+ compex_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
|
||||
+ compex_flash_resource.end =
|
||||
+ IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
|
||||
+
|
||||
+ platform_add_devices(compex_devices, ARRAY_SIZE(compex_devices));
|
||||
+}
|
||||
+
|
||||
+#ifdef CONFIG_MACH_COMPEX
|
||||
+MACHINE_START(COMPEX, "Compex WP18 / NP18A")
|
||||
+ /* Maintainer: Imre Kaloz <Kaloz@openwrt.org> */
|
||||
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
|
||||
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
|
||||
+ .map_io = ixp4xx_map_io,
|
||||
+ .init_irq = ixp4xx_init_irq,
|
||||
+ .timer = &ixp4xx_timer,
|
||||
+ .boot_params = 0x0100,
|
||||
+ .init_machine = compex_init,
|
||||
+MACHINE_END
|
||||
+#endif
|
||||
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/ixdp425-pci.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/ixdp425-pci.c
|
||||
--- linux-2.6.23/arch/arm/mach-ixp4xx/ixdp425-pci.c 2007-10-09 22:31:38.000000000 +0200
|
||||
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/ixdp425-pci.c 2007-10-23 18:22:41.000000000 +0200
|
||||
@@ -66,7 +66,7 @@
|
||||
int __init ixdp425_pci_init(void)
|
||||
{
|
||||
if (machine_is_ixdp425() || machine_is_ixcdp1100() ||
|
||||
- machine_is_ixdp465() || machine_is_kixrp435())
|
||||
+ machine_is_ixdp465() || machine_is_kixrp435() || machine_is_compex())
|
||||
pci_common_init(&ixdp425_pci);
|
||||
return 0;
|
||||
}
|
||||
diff -Nur linux-2.6.23/arch/arm/tools/mach-types linux-2.6.23-owrt/arch/arm/tools/mach-types
|
||||
--- linux-2.6.23/arch/arm/tools/mach-types 2007-10-09 22:31:38.000000000 +0200
|
||||
+++ linux-2.6.23-owrt/arch/arm/tools/mach-types 2007-10-23 18:22:41.000000000 +0200
|
||||
@@ -1278,7 +1278,7 @@
|
||||
smdk6400 MACH_SMDK6400 SMDK6400 1270
|
||||
nokia_n800 MACH_NOKIA_N800 NOKIA_N800 1271
|
||||
greenphone MACH_GREENPHONE GREENPHONE 1272
|
||||
-compex42x MACH_COMPEXWP18 COMPEXWP18 1273
|
||||
+compex MACH_COMPEX COMPEX 1273
|
||||
xmate MACH_XMATE XMATE 1274
|
||||
energizer MACH_ENERGIZER ENERGIZER 1275
|
||||
ime1 MACH_IME1 IME1 1276
|
@ -0,0 +1,41 @@
|
||||
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/compex-setup.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/compex-setup.c
|
||||
--- linux-2.6.23/arch/arm/mach-ixp4xx/compex-setup.c 2007-10-23 18:39:29.000000000 +0200
|
||||
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/compex-setup.c 2007-10-23 18:45:34.000000000 +0200
|
||||
@@ -90,9 +90,36 @@
|
||||
.resource = compex_uart_resources,
|
||||
};
|
||||
|
||||
+/* Built-in 10/100 Ethernet MAC interfaces */
|
||||
+static struct eth_plat_info compex_plat_eth[] = {
|
||||
+ {
|
||||
+ .phy = -1,
|
||||
+ .rxq = 3,
|
||||
+ .txreadyq = 20,
|
||||
+ }, {
|
||||
+ .phy = 3,
|
||||
+ .rxq = 4,
|
||||
+ .txreadyq = 21,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static struct platform_device compex_eth[] = {
|
||||
+ {
|
||||
+ .name = "ixp4xx_eth",
|
||||
+ .id = IXP4XX_ETH_NPEB,
|
||||
+ .dev.platform_data = compex_plat_eth,
|
||||
+ }, {
|
||||
+ .name = "ixp4xx_eth",
|
||||
+ .id = IXP4XX_ETH_NPEC,
|
||||
+ .dev.platform_data = compex_plat_eth + 1,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
static struct platform_device *compex_devices[] __initdata = {
|
||||
&compex_flash,
|
||||
- &compex_uart
|
||||
+ &compex_uart,
|
||||
+ &compex_eth[0],
|
||||
+ &compex_eth[1],
|
||||
};
|
||||
|
||||
static void __init compex_init(void)
|
230
target/linux/ixp4xx/patches-2.6.24/130-wrt300nv2_support.patch
Normal file
230
target/linux/ixp4xx/patches-2.6.24/130-wrt300nv2_support.patch
Normal file
@ -0,0 +1,230 @@
|
||||
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/Kconfig linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Kconfig
|
||||
--- linux-2.6.23/arch/arm/mach-ixp4xx/Kconfig 2007-10-23 18:39:29.000000000 +0200
|
||||
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Kconfig 2007-10-23 19:11:31.000000000 +0200
|
||||
@@ -73,6 +73,14 @@
|
||||
WP18 or NP18A boards. For more information on this
|
||||
platform, see http://openwrt.org
|
||||
|
||||
+config MACH_WRT300NV2
|
||||
+ bool "Linksys WRT300N v2"
|
||||
+ select PCI
|
||||
+ help
|
||||
+ Say 'Y' here if you want your kernel to support Linksys'
|
||||
+ WRT300N v2 router. For more information on this
|
||||
+ platform, see http://openwrt.org
|
||||
+
|
||||
config ARCH_IXDP425
|
||||
bool "IXDP425"
|
||||
help
|
||||
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/Makefile linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Makefile
|
||||
--- linux-2.6.23/arch/arm/mach-ixp4xx/Makefile 2007-10-23 18:39:29.000000000 +0200
|
||||
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Makefile 2007-10-23 19:11:31.000000000 +0200
|
||||
@@ -18,6 +18,7 @@
|
||||
obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
|
||||
obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
|
||||
obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
|
||||
+obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
|
||||
|
||||
obj-y += common.o
|
||||
|
||||
@@ -34,6 +35,7 @@
|
||||
obj-$(CONFIG_MACH_FSG) += fsg-setup.o
|
||||
obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
|
||||
obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
|
||||
+obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
|
||||
|
||||
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
|
||||
obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
|
||||
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/wrt300nv2-pci.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/wrt300nv2-pci.c
|
||||
--- linux-2.6.23/arch/arm/mach-ixp4xx/wrt300nv2-pci.c 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/wrt300nv2-pci.c 2007-10-23 19:11:31.000000000 +0200
|
||||
@@ -0,0 +1,65 @@
|
||||
+/*
|
||||
+ * arch/arch/mach-ixp4xx/wrt300nv2-pci.c
|
||||
+ *
|
||||
+ * PCI setup routines for Linksys WRT300N v2
|
||||
+ *
|
||||
+ * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
|
||||
+ *
|
||||
+ * based on coyote-pci.c:
|
||||
+ * Copyright (C) 2002 Jungo Software Technologies.
|
||||
+ * Copyright (C) 2003 MontaVista Softwrae, Inc.
|
||||
+ *
|
||||
+ * Maintainer: Imre Kaloz <kaloz@openwrt.org>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License version 2 as
|
||||
+ * published by the Free Software Foundation.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/pci.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/irq.h>
|
||||
+
|
||||
+#include <asm/mach-types.h>
|
||||
+#include <asm/hardware.h>
|
||||
+#include <asm/irq.h>
|
||||
+
|
||||
+#include <asm/mach/pci.h>
|
||||
+
|
||||
+extern void ixp4xx_pci_preinit(void);
|
||||
+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);
|
||||
+
|
||||
+void __init wrt300nv2_pci_preinit(void)
|
||||
+{
|
||||
+ set_irq_type(IRQ_IXP4XX_GPIO8, IRQT_LOW);
|
||||
+
|
||||
+ ixp4xx_pci_preinit();
|
||||
+}
|
||||
+
|
||||
+static int __init wrt300nv2_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
|
||||
+{
|
||||
+ if (slot == 1)
|
||||
+ return IRQ_IXP4XX_GPIO8;
|
||||
+ else return -1;
|
||||
+}
|
||||
+
|
||||
+struct hw_pci wrt300nv2_pci __initdata = {
|
||||
+ .nr_controllers = 1,
|
||||
+ .preinit = wrt300nv2_pci_preinit,
|
||||
+ .swizzle = pci_std_swizzle,
|
||||
+ .setup = ixp4xx_setup,
|
||||
+ .scan = ixp4xx_scan_bus,
|
||||
+ .map_irq = wrt300nv2_map_irq,
|
||||
+};
|
||||
+
|
||||
+int __init wrt300nv2_pci_init(void)
|
||||
+{
|
||||
+ if (machine_is_wrt300nv2())
|
||||
+ pci_common_init(&wrt300nv2_pci);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+subsys_initcall(wrt300nv2_pci_init);
|
||||
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/wrt300nv2-setup.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
|
||||
--- linux-2.6.23/arch/arm/mach-ixp4xx/wrt300nv2-setup.c 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/wrt300nv2-setup.c 2007-10-23 19:11:31.000000000 +0200
|
||||
@@ -0,0 +1,108 @@
|
||||
+/*
|
||||
+ * arch/arm/mach-ixp4xx/wrt300nv2-setup.c
|
||||
+ *
|
||||
+ * Board setup for the Linksys WRT300N v2
|
||||
+ *
|
||||
+ * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
|
||||
+ *
|
||||
+ * based on coyote-setup.c:
|
||||
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
|
||||
+ *
|
||||
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
|
||||
+ */
|
||||
+
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/device.h>
|
||||
+#include <linux/serial.h>
|
||||
+#include <linux/tty.h>
|
||||
+#include <linux/serial_8250.h>
|
||||
+#include <linux/slab.h>
|
||||
+
|
||||
+#include <asm/types.h>
|
||||
+#include <asm/setup.h>
|
||||
+#include <asm/memory.h>
|
||||
+#include <asm/hardware.h>
|
||||
+#include <asm/irq.h>
|
||||
+#include <asm/mach-types.h>
|
||||
+#include <asm/mach/arch.h>
|
||||
+#include <asm/mach/flash.h>
|
||||
+
|
||||
+static struct flash_platform_data wrt300nv2_flash_data = {
|
||||
+ .map_name = "cfi_probe",
|
||||
+ .width = 2,
|
||||
+};
|
||||
+
|
||||
+static struct resource wrt300nv2_flash_resource = {
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+};
|
||||
+
|
||||
+static struct platform_device wrt300nv2_flash = {
|
||||
+ .name = "IXP4XX-Flash",
|
||||
+ .id = 0,
|
||||
+ .dev = {
|
||||
+ .platform_data = &wrt300nv2_flash_data,
|
||||
+ },
|
||||
+ .num_resources = 1,
|
||||
+ .resource = &wrt300nv2_flash_resource,
|
||||
+};
|
||||
+
|
||||
+static struct resource wrt300nv2_uart_resource = {
|
||||
+ .start = IXP4XX_UART2_BASE_PHYS,
|
||||
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+};
|
||||
+
|
||||
+static struct plat_serial8250_port wrt300nv2_uart_data[] = {
|
||||
+ {
|
||||
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
|
||||
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
|
||||
+ .irq = IRQ_IXP4XX_UART2,
|
||||
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
|
||||
+ .iotype = UPIO_MEM,
|
||||
+ .regshift = 2,
|
||||
+ .uartclk = IXP4XX_UART_XTAL,
|
||||
+ },
|
||||
+ { },
|
||||
+};
|
||||
+
|
||||
+static struct platform_device wrt300nv2_uart = {
|
||||
+ .name = "serial8250",
|
||||
+ .id = PLAT8250_DEV_PLATFORM,
|
||||
+ .dev = {
|
||||
+ .platform_data = wrt300nv2_uart_data,
|
||||
+ },
|
||||
+ .num_resources = 1,
|
||||
+ .resource = &wrt300nv2_uart_resource,
|
||||
+};
|
||||
+
|
||||
+static struct platform_device *wrt300nv2_devices[] __initdata = {
|
||||
+ &wrt300nv2_flash,
|
||||
+ &wrt300nv2_uart
|
||||
+};
|
||||
+
|
||||
+static void __init wrt300nv2_init(void)
|
||||
+{
|
||||
+ ixp4xx_sys_init();
|
||||
+
|
||||
+ wrt300nv2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
|
||||
+ wrt300nv2_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
|
||||
+
|
||||
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
|
||||
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
|
||||
+
|
||||
+ platform_add_devices(wrt300nv2_devices, ARRAY_SIZE(wrt300nv2_devices));
|
||||
+}
|
||||
+
|
||||
+#ifdef CONFIG_MACH_WRT300NV2
|
||||
+MACHINE_START(WRT300NV2, "Linksys WRT300N v2")
|
||||
+ /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
|
||||
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
|
||||
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
|
||||
+ .map_io = ixp4xx_map_io,
|
||||
+ .init_irq = ixp4xx_init_irq,
|
||||
+ .timer = &ixp4xx_timer,
|
||||
+ .boot_params = 0x0100,
|
||||
+ .init_machine = wrt300nv2_init,
|
||||
+MACHINE_END
|
||||
+#endif
|
||||
diff -Nur linux-2.6.23/include/asm-arm/arch-ixp4xx/uncompress.h linux-2.6.23-owrt/include/asm-arm/arch-ixp4xx/uncompress.h
|
||||
--- linux-2.6.23/include/asm-arm/arch-ixp4xx/uncompress.h 2007-10-23 18:03:35.000000000 +0200
|
||||
+++ linux-2.6.23-owrt/include/asm-arm/arch-ixp4xx/uncompress.h 2007-10-23 19:12:30.000000000 +0200
|
||||
@@ -42,7 +42,7 @@
|
||||
*/
|
||||
if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
|
||||
machine_is_gateway7001() || machine_is_wg302v2() ||
|
||||
- machine_is_pronghorn_metro())
|
||||
+ machine_is_pronghorn_metro() || machine_is_wrt300nv2())
|
||||
uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
|
||||
else
|
||||
uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;
|
@ -0,0 +1,41 @@
|
||||
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/wrt300nv2-setup.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
|
||||
--- linux-2.6.23/arch/arm/mach-ixp4xx/wrt300nv2-setup.c 2007-10-23 19:20:08.000000000 +0200
|
||||
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/wrt300nv2-setup.c 2007-10-23 19:22:19.000000000 +0200
|
||||
@@ -76,9 +76,36 @@
|
||||
.resource = &wrt300nv2_uart_resource,
|
||||
};
|
||||
|
||||
+/* Built-in 10/100 Ethernet MAC interfaces */
|
||||
+static struct eth_plat_info wrt300nv2_plat_eth[] = {
|
||||
+ {
|
||||
+ .phy = -1,
|
||||
+ .rxq = 3,
|
||||
+ .txreadyq = 20,
|
||||
+ }, {
|
||||
+ .phy = 1,
|
||||
+ .rxq = 4,
|
||||
+ .txreadyq = 21,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static struct platform_device wrt300nv2_eth[] = {
|
||||
+ {
|
||||
+ .name = "ixp4xx_eth",
|
||||
+ .id = IXP4XX_ETH_NPEB,
|
||||
+ .dev.platform_data = wrt300nv2_plat_eth,
|
||||
+ }, {
|
||||
+ .name = "ixp4xx_eth",
|
||||
+ .id = IXP4XX_ETH_NPEC,
|
||||
+ .dev.platform_data = wrt300nv2_plat_eth + 1,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
static struct platform_device *wrt300nv2_devices[] __initdata = {
|
||||
&wrt300nv2_flash,
|
||||
- &wrt300nv2_uart
|
||||
+ &wrt300nv2_uart,
|
||||
+ &wrt300nv2_eth[0],
|
||||
+ &wrt300nv2_eth[1],
|
||||
};
|
||||
|
||||
static void __init wrt300nv2_init(void)
|
240
target/linux/ixp4xx/patches-2.6.24/140-sidewinder_support.patch
Normal file
240
target/linux/ixp4xx/patches-2.6.24/140-sidewinder_support.patch
Normal file
@ -0,0 +1,240 @@
|
||||
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/Kconfig linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Kconfig
|
||||
--- linux-2.6.23/arch/arm/mach-ixp4xx/Kconfig 2007-10-23 19:20:08.000000000 +0200
|
||||
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Kconfig 2007-10-23 19:26:46.000000000 +0200
|
||||
@@ -65,6 +65,14 @@
|
||||
Engineering Pronghorn Metro Platform. For more
|
||||
information on this platform, see <file:Documentation/arm/IXP4xx>.
|
||||
|
||||
+config MACH_SIDEWINDER
|
||||
+ bool "Sidewinder"
|
||||
+ select PCI
|
||||
+ help
|
||||
+ Say 'Y' here if you want your kernel to support the ADI
|
||||
+ Engineering Sidewinder Platform. For more
|
||||
+ information on this platform, see <file:Documentation/arm/IXP4xx>.
|
||||
+
|
||||
config MACH_COMPEX
|
||||
bool "Compex WP18 / NP18A"
|
||||
select PCI
|
||||
@@ -163,7 +171,7 @@
|
||||
#
|
||||
config CPU_IXP46X
|
||||
bool
|
||||
- depends on MACH_IXDP465
|
||||
+ depends on MACH_IXDP465 || MACH_SIDEWINDER
|
||||
default y
|
||||
|
||||
config CPU_IXP43X
|
||||
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/Makefile linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Makefile
|
||||
--- linux-2.6.23/arch/arm/mach-ixp4xx/Makefile 2007-10-23 19:20:08.000000000 +0200
|
||||
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Makefile 2007-10-23 19:23:52.000000000 +0200
|
||||
@@ -19,6 +19,7 @@
|
||||
obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
|
||||
obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
|
||||
obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
|
||||
+obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o
|
||||
|
||||
obj-y += common.o
|
||||
|
||||
@@ -36,6 +37,7 @@
|
||||
obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
|
||||
obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
|
||||
obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
|
||||
+obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o
|
||||
|
||||
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
|
||||
obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
|
||||
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/sidewinder-pci.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/sidewinder-pci.c
|
||||
--- linux-2.6.23/arch/arm/mach-ixp4xx/sidewinder-pci.c 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/sidewinder-pci.c 2007-10-23 19:23:52.000000000 +0200
|
||||
@@ -0,0 +1,71 @@
|
||||
+/*
|
||||
+ * arch/arch/mach-ixp4xx/pronghornmetro-pci.c
|
||||
+ *
|
||||
+ * PCI setup routines for ADI Engineering Sidewinder
|
||||
+ *
|
||||
+ * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
|
||||
+ *
|
||||
+ * based on coyote-pci.c:
|
||||
+ * Copyright (C) 2002 Jungo Software Technologies.
|
||||
+ * Copyright (C) 2003 MontaVista Softwrae, Inc.
|
||||
+ *
|
||||
+ * Maintainer: Imre Kaloz <kaloz@openwrt.org>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License version 2 as
|
||||
+ * published by the Free Software Foundation.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/pci.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/irq.h>
|
||||
+
|
||||
+#include <asm/mach-types.h>
|
||||
+#include <asm/hardware.h>
|
||||
+#include <asm/irq.h>
|
||||
+
|
||||
+#include <asm/mach/pci.h>
|
||||
+
|
||||
+extern void ixp4xx_pci_preinit(void);
|
||||
+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);
|
||||
+
|
||||
+void __init sidewinder_pci_preinit(void)
|
||||
+{
|
||||
+ set_irq_type(IRQ_IXP4XX_GPIO11, IRQT_LOW);
|
||||
+ set_irq_type(IRQ_IXP4XX_GPIO10, IRQT_LOW);
|
||||
+ set_irq_type(IRQ_IXP4XX_GPIO9, IRQT_LOW);
|
||||
+
|
||||
+ ixp4xx_pci_preinit();
|
||||
+}
|
||||
+
|
||||
+static int __init sidewinder_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
|
||||
+{
|
||||
+ if (slot == 1)
|
||||
+ return IRQ_IXP4XX_GPIO11;
|
||||
+ else if (slot == 2)
|
||||
+ return IRQ_IXP4XX_GPIO10;
|
||||
+ else if (slot == 3)
|
||||
+ return IRQ_IXP4XX_GPIO9;
|
||||
+ else return -1;
|
||||
+}
|
||||
+
|
||||
+struct hw_pci sidewinder_pci __initdata = {
|
||||
+ .nr_controllers = 1,
|
||||
+ .preinit = sidewinder_pci_preinit,
|
||||
+ .swizzle = pci_std_swizzle,
|
||||
+ .setup = ixp4xx_setup,
|
||||
+ .scan = ixp4xx_scan_bus,
|
||||
+ .map_irq = sidewinder_map_irq,
|
||||
+};
|
||||
+
|
||||
+int __init sidewinder_pci_init(void)
|
||||
+{
|
||||
+ if (machine_is_sidewinder())
|
||||
+ pci_common_init(&sidewinder_pci);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+subsys_initcall(sidewinder_pci_init);
|
||||
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/sidewinder-setup.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/sidewinder-setup.c
|
||||
--- linux-2.6.23/arch/arm/mach-ixp4xx/sidewinder-setup.c 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/sidewinder-setup.c 2007-10-23 19:23:52.000000000 +0200
|
||||
@@ -0,0 +1,115 @@
|
||||
+/*
|
||||
+ * arch/arm/mach-ixp4xx/sidewinder-setup.c
|
||||
+ *
|
||||
+ * Board setup for the ADI Engineering Sidewinder
|
||||
+ *
|
||||
+ * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
|
||||
+ *
|
||||
+ * based on coyote-setup.c:
|
||||
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
|
||||
+ *
|
||||
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
|
||||
+ */
|
||||
+
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/serial.h>
|
||||
+#include <linux/serial_8250.h>
|
||||
+
|
||||
+#include <asm/mach-types.h>
|
||||
+#include <asm/mach/arch.h>
|
||||
+#include <asm/mach/flash.h>
|
||||
+
|
||||
+static struct flash_platform_data sidewinder_flash_data = {
|
||||
+ .map_name = "cfi_probe",
|
||||
+ .width = 2,
|
||||
+};
|
||||
+
|
||||
+static struct resource sidewinder_flash_resource = {
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+};
|
||||
+
|
||||
+static struct platform_device sidewinder_flash = {
|
||||
+ .name = "IXP4XX-Flash",
|
||||
+ .id = 0,
|
||||
+ .dev = {
|
||||
+ .platform_data = &sidewinder_flash_data,
|
||||
+ },
|
||||
+ .num_resources = 1,
|
||||
+ .resource = &sidewinder_flash_resource,
|
||||
+};
|
||||
+
|
||||
+static struct resource sidewinder_uart_resources[] = {
|
||||
+ {
|
||||
+ .start = IXP4XX_UART1_BASE_PHYS,
|
||||
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+ },
|
||||
+ {
|
||||
+ .start = IXP4XX_UART2_BASE_PHYS,
|
||||
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static struct plat_serial8250_port sidewinder_uart_data[] = {
|
||||
+ {
|
||||
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
|
||||
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
|
||||
+ .irq = IRQ_IXP4XX_UART1,
|
||||
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
|
||||
+ .iotype = UPIO_MEM,
|
||||
+ .regshift = 2,
|
||||
+ .uartclk = IXP4XX_UART_XTAL,
|
||||
+ },
|
||||
+ {
|
||||
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
|
||||
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
|
||||
+ .irq = IRQ_IXP4XX_UART2,
|
||||
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
|
||||
+ .iotype = UPIO_MEM,
|
||||
+ .regshift = 2,
|
||||
+ .uartclk = IXP4XX_UART_XTAL,
|
||||
+ },
|
||||
+ { },
|
||||
+};
|
||||
+
|
||||
+static struct platform_device sidewinder_uart = {
|
||||
+ .name = "serial8250",
|
||||
+ .id = PLAT8250_DEV_PLATFORM,
|
||||
+ .dev = {
|
||||
+ .platform_data = sidewinder_uart_data,
|
||||
+ },
|
||||
+ .num_resources = 2,
|
||||
+ .resource = &sidewinder_uart_resources,
|
||||
+};
|
||||
+
|
||||
+static struct platform_device *sidewinder_devices[] __initdata = {
|
||||
+ &sidewinder_flash,
|
||||
+ &sidewinder_uart,
|
||||
+};
|
||||
+
|
||||
+static void __init sidewinder_init(void)
|
||||
+{
|
||||
+ ixp4xx_sys_init();
|
||||
+
|
||||
+ sidewinder_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
|
||||
+ sidewinder_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_64M - 1;
|
||||
+
|
||||
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
|
||||
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
|
||||
+
|
||||
+ platform_add_devices(sidewinder_devices, ARRAY_SIZE(sidewinder_devices));
|
||||
+}
|
||||
+
|
||||
+#ifdef CONFIG_MACH_SIDEWINDER
|
||||
+MACHINE_START(SIDEWINDER, "ADI Engineering Sidewinder")
|
||||
+ /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
|
||||
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
|
||||
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
|
||||
+ .map_io = ixp4xx_map_io,
|
||||
+ .init_irq = ixp4xx_init_irq,
|
||||
+ .timer = &ixp4xx_timer,
|
||||
+ .boot_params = 0x0100,
|
||||
+ .init_machine = sidewinder_init,
|
||||
+MACHINE_END
|
||||
+#endif
|
@ -0,0 +1,212 @@
|
||||
diff -Nur linux-2.6.23.1/arch/arm/mach-ixp4xx/ap1000-setup.c linux-2.6.23.1-owrt/arch/arm/mach-ixp4xx/ap1000-setup.c
|
||||
--- linux-2.6.23.1/arch/arm/mach-ixp4xx/ap1000-setup.c 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ linux-2.6.23.1-owrt/arch/arm/mach-ixp4xx/ap1000-setup.c 2007-11-14 13:58:58.000000000 +0100
|
||||
@@ -0,0 +1,151 @@
|
||||
+/*
|
||||
+ * arch/arm/mach-ixp4xx/ap1000-setup.c
|
||||
+ *
|
||||
+ * Lanready AP-1000
|
||||
+ *
|
||||
+ * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
|
||||
+ *
|
||||
+ * based on ixdp425-setup.c:
|
||||
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
|
||||
+ *
|
||||
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
|
||||
+ */
|
||||
+
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/device.h>
|
||||
+#include <linux/serial.h>
|
||||
+#include <linux/tty.h>
|
||||
+#include <linux/serial_8250.h>
|
||||
+#include <linux/slab.h>
|
||||
+
|
||||
+#include <asm/types.h>
|
||||
+#include <asm/setup.h>
|
||||
+#include <asm/memory.h>
|
||||
+#include <asm/hardware.h>
|
||||
+#include <asm/mach-types.h>
|
||||
+#include <asm/irq.h>
|
||||
+#include <asm/mach/arch.h>
|
||||
+#include <asm/mach/flash.h>
|
||||
+
|
||||
+static struct flash_platform_data ap1000_flash_data = {
|
||||
+ .map_name = "cfi_probe",
|
||||
+ .width = 2,
|
||||
+};
|
||||
+
|
||||
+static struct resource ap1000_flash_resource = {
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+};
|
||||
+
|
||||
+static struct platform_device ap1000_flash = {
|
||||
+ .name = "IXP4XX-Flash",
|
||||
+ .id = 0,
|
||||
+ .dev = {
|
||||
+ .platform_data = &ap1000_flash_data,
|
||||
+ },
|
||||
+ .num_resources = 1,
|
||||
+ .resource = &ap1000_flash_resource,
|
||||
+};
|
||||
+
|
||||
+static struct resource ap1000_uart_resources[] = {
|
||||
+ {
|
||||
+ .start = IXP4XX_UART1_BASE_PHYS,
|
||||
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
|
||||
+ .flags = IORESOURCE_MEM
|
||||
+ },
|
||||
+ {
|
||||
+ .start = IXP4XX_UART2_BASE_PHYS,
|
||||
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
|
||||
+ .flags = IORESOURCE_MEM
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static struct plat_serial8250_port ap1000_uart_data[] = {
|
||||
+ {
|
||||
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
|
||||
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
|
||||
+ .irq = IRQ_IXP4XX_UART1,
|
||||
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
|
||||
+ .iotype = UPIO_MEM,
|
||||
+ .regshift = 2,
|
||||
+ .uartclk = IXP4XX_UART_XTAL,
|
||||
+ },
|
||||
+ {
|
||||
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
|
||||
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
|
||||
+ .irq = IRQ_IXP4XX_UART2,
|
||||
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
|
||||
+ .iotype = UPIO_MEM,
|
||||
+ .regshift = 2,
|
||||
+ .uartclk = IXP4XX_UART_XTAL,
|
||||
+ },
|
||||
+ { },
|
||||
+};
|
||||
+
|
||||
+static struct platform_device ap1000_uart = {
|
||||
+ .name = "serial8250",
|
||||
+ .id = PLAT8250_DEV_PLATFORM,
|
||||
+ .dev.platform_data = ap1000_uart_data,
|
||||
+ .num_resources = 2,
|
||||
+ .resource = ap1000_uart_resources
|
||||
+};
|
||||
+
|
||||
+static struct platform_device *ap1000_devices[] __initdata = {
|
||||
+ &ap1000_flash,
|
||||
+ &ap1000_uart
|
||||
+};
|
||||
+
|
||||
+static char ap1000_mem_fixup[] __initdata = "mem=64M ";
|
||||
+
|
||||
+static void __init ap1000_fixup(struct machine_desc *desc,
|
||||
+ struct tag *tags, char **cmdline, struct meminfo *mi)
|
||||
+
|
||||
+{
|
||||
+ struct tag *t = tags;
|
||||
+ char *p = *cmdline;
|
||||
+
|
||||
+ /* Find the end of the tags table, taking note of any cmdline tag. */
|
||||
+ for (; t->hdr.size; t = tag_next(t)) {
|
||||
+ if (t->hdr.tag == ATAG_CMDLINE) {
|
||||
+ p = t->u.cmdline.cmdline;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* Overwrite the end of the table with a new cmdline tag. */
|
||||
+ t->hdr.tag = ATAG_CMDLINE;
|
||||
+ t->hdr.size = (sizeof (struct tag_header) +
|
||||
+ strlen(ap1000_mem_fixup) + strlen(p) + 1 + 4) >> 2;
|
||||
+ strlcpy(t->u.cmdline.cmdline, ap1000_mem_fixup, COMMAND_LINE_SIZE);
|
||||
+ strlcpy(t->u.cmdline.cmdline + strlen(ap1000_mem_fixup), p,
|
||||
+ COMMAND_LINE_SIZE - strlen(ap1000_mem_fixup));
|
||||
+
|
||||
+ /* Terminate the table. */
|
||||
+ t = tag_next(t);
|
||||
+ t->hdr.tag = ATAG_NONE;
|
||||
+ t->hdr.size = 0;
|
||||
+}
|
||||
+
|
||||
+static void __init ap1000_init(void)
|
||||
+{
|
||||
+ ixp4xx_sys_init();
|
||||
+
|
||||
+ ap1000_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
|
||||
+ ap1000_flash_resource.end =
|
||||
+ IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
|
||||
+
|
||||
+ platform_add_devices(ap1000_devices, ARRAY_SIZE(ap1000_devices));
|
||||
+}
|
||||
+
|
||||
+#ifdef CONFIG_MACH_AP1000
|
||||
+MACHINE_START(AP1000, "Lanready AP-1000")
|
||||
+ /* Maintainer: Imre Kaloz <Kaloz@openwrt.org> */
|
||||
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
|
||||
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
|
||||
+ .fixup = ap1000_fixup,
|
||||
+ .map_io = ixp4xx_map_io,
|
||||
+ .init_irq = ixp4xx_init_irq,
|
||||
+ .timer = &ixp4xx_timer,
|
||||
+ .boot_params = 0x0100,
|
||||
+ .init_machine = ap1000_init,
|
||||
+MACHINE_END
|
||||
+#endif
|
||||
diff -Nur linux-2.6.23.1/arch/arm/mach-ixp4xx/ixdp425-pci.c linux-2.6.23.1-owrt/arch/arm/mach-ixp4xx/ixdp425-pci.c
|
||||
--- linux-2.6.23.1/arch/arm/mach-ixp4xx/ixdp425-pci.c 2007-11-14 13:15:50.000000000 +0100
|
||||
+++ linux-2.6.23.1-owrt/arch/arm/mach-ixp4xx/ixdp425-pci.c 2007-11-14 13:27:16.000000000 +0100
|
||||
@@ -66,7 +66,8 @@
|
||||
int __init ixdp425_pci_init(void)
|
||||
{
|
||||
if (machine_is_ixdp425() || machine_is_ixcdp1100() ||
|
||||
- machine_is_ixdp465() || machine_is_kixrp435() || machine_is_compex())
|
||||
+ machine_is_ixdp465() || machine_is_kixrp435() ||
|
||||
+ machine_is_compex() || machine_is_ap1000())
|
||||
pci_common_init(&ixdp425_pci);
|
||||
return 0;
|
||||
}
|
||||
diff -Nur linux-2.6.23.1/arch/arm/mach-ixp4xx/Kconfig linux-2.6.23.1-owrt/arch/arm/mach-ixp4xx/Kconfig
|
||||
--- linux-2.6.23.1/arch/arm/mach-ixp4xx/Kconfig 2007-11-14 13:15:50.000000000 +0100
|
||||
+++ linux-2.6.23.1-owrt/arch/arm/mach-ixp4xx/Kconfig 2007-11-14 13:25:07.000000000 +0100
|
||||
@@ -89,6 +89,14 @@
|
||||
WRT300N v2 router. For more information on this
|
||||
platform, see http://openwrt.org
|
||||
|
||||
+config MACH_AP1000
|
||||
+ bool "Lanready AP-1000"
|
||||
+ select PCI
|
||||
+ help
|
||||
+ Say 'Y' here if you want your kernel to support Lanready's
|
||||
+ AP1000 board. For more information on this
|
||||
+ platform, see http://openwrt.org
|
||||
+
|
||||
config ARCH_IXDP425
|
||||
bool "IXDP425"
|
||||
help
|
||||
diff -Nur linux-2.6.23.1/arch/arm/mach-ixp4xx/Makefile linux-2.6.23.1-owrt/arch/arm/mach-ixp4xx/Makefile
|
||||
--- linux-2.6.23.1/arch/arm/mach-ixp4xx/Makefile 2007-11-14 13:15:50.000000000 +0100
|
||||
+++ linux-2.6.23.1-owrt/arch/arm/mach-ixp4xx/Makefile 2007-11-14 13:31:29.000000000 +0100
|
||||
@@ -20,6 +20,7 @@
|
||||
obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
|
||||
obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
|
||||
obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o
|
||||
+obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o
|
||||
|
||||
obj-y += common.o
|
||||
|
||||
@@ -38,5 +39,6 @@
|
||||
obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
|
||||
obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
|
||||
obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o
|
||||
+obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o
|
||||
|
||||
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
|
||||
diff -Nur linux-2.6.23.1/arch/arm/tools/mach-types linux-2.6.23.1-owrt/arch/arm/tools/mach-types
|
||||
--- linux-2.6.23.1/arch/arm/tools/mach-types 2007-11-14 13:15:50.000000000 +0100
|
||||
+++ linux-2.6.23.1-owrt/arch/arm/tools/mach-types 2007-11-14 13:26:06.000000000 +0100
|
||||
@@ -1367,3 +1367,4 @@
|
||||
csb726 MACH_CSB726 CSB726 1359
|
||||
tik27 MACH_TIK27 TIK27 1360
|
||||
mx_uc7420 MACH_MX_UC7420 MX_UC7420 1361
|
||||
+ap1000 MACH_AP1000 AP1000 1543
|
@ -0,0 +1,41 @@
|
||||
diff -Nur linux-2.6.23.1/arch/arm/mach-ixp4xx/ap1000-setup.c linux-2.6.23.1-owrt/arch/arm/mach-ixp4xx/ap1000-setup.c
|
||||
--- linux-2.6.23.1/arch/arm/mach-ixp4xx/ap1000-setup.c 2007-11-14 14:11:10.000000000 +0100
|
||||
+++ linux-2.6.23.1-owrt/arch/arm/mach-ixp4xx/ap1000-setup.c 2007-11-14 14:09:30.000000000 +0100
|
||||
@@ -90,9 +90,36 @@
|
||||
.resource = ap1000_uart_resources
|
||||
};
|
||||
|
||||
+/* Built-in 10/100 Ethernet MAC interfaces */
|
||||
+static struct eth_plat_info ap1000_plat_eth[] = {
|
||||
+ {
|
||||
+ .phy = 4,
|
||||
+ .rxq = 3,
|
||||
+ .txreadyq = 20,
|
||||
+ }, {
|
||||
+ .phy = 5,
|
||||
+ .rxq = 4,
|
||||
+ .txreadyq = 21,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static struct platform_device ap1000_eth[] = {
|
||||
+ {
|
||||
+ .name = "ixp4xx_eth",
|
||||
+ .id = IXP4XX_ETH_NPEB,
|
||||
+ .dev.platform_data = ap1000_plat_eth,
|
||||
+ }, {
|
||||
+ .name = "ixp4xx_eth",
|
||||
+ .id = IXP4XX_ETH_NPEC,
|
||||
+ .dev.platform_data = ap1000_plat_eth + 1,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
static struct platform_device *ap1000_devices[] __initdata = {
|
||||
&ap1000_flash,
|
||||
- &ap1000_uart
|
||||
+ &ap1000_uart,
|
||||
+ &ap1000_eth[0],
|
||||
+ &ap1000_eth[1],
|
||||
};
|
||||
|
||||
static char ap1000_mem_fixup[] __initdata = "mem=64M ";
|
217
target/linux/ixp4xx/patches-2.6.24/160-wg302v1_support.patch
Normal file
217
target/linux/ixp4xx/patches-2.6.24/160-wg302v1_support.patch
Normal file
@ -0,0 +1,217 @@
|
||||
diff -Nur linux-2.6.23.12/arch/arm/mach-ixp4xx/Kconfig linux-2.6.23.12-owrt/arch/arm/mach-ixp4xx/Kconfig
|
||||
--- linux-2.6.23.12/arch/arm/mach-ixp4xx/Kconfig 2008-01-14 22:08:42.000000000 +0100
|
||||
+++ linux-2.6.23.12-owrt/arch/arm/mach-ixp4xx/Kconfig 2008-01-14 22:12:21.000000000 +0100
|
||||
@@ -49,6 +49,14 @@
|
||||
7001 Access Point. For more information on this platform,
|
||||
see http://openwrt.org
|
||||
|
||||
+config MACH_WG302V1
|
||||
+ bool "Netgear WG302 v1 / WAG302 v1"
|
||||
+ select PCI
|
||||
+ help
|
||||
+ Say 'Y' here if you want your kernel to support Netgear's
|
||||
+ WG302 v1 or WAG302 v1 Access Points. For more information
|
||||
+ on this platform, see http://openwrt.org
|
||||
+
|
||||
config MACH_WG302V2
|
||||
bool "Netgear WG302 v2 / WAG302 v2"
|
||||
select PCI
|
||||
diff -Nur linux-2.6.23.12/arch/arm/mach-ixp4xx/Makefile linux-2.6.23.12-owrt/arch/arm/mach-ixp4xx/Makefile
|
||||
--- linux-2.6.23.12/arch/arm/mach-ixp4xx/Makefile 2008-01-14 22:08:42.000000000 +0100
|
||||
+++ linux-2.6.23.12-owrt/arch/arm/mach-ixp4xx/Makefile 2008-01-14 22:11:47.000000000 +0100
|
||||
@@ -14,6 +14,7 @@
|
||||
obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o
|
||||
obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o
|
||||
obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o
|
||||
+obj-pci-$(CONFIG_MACH_WG302V1) += wg302v1-pci.o
|
||||
obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
|
||||
obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
|
||||
obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
|
||||
@@ -33,6 +34,7 @@
|
||||
obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o nas100d-power.o
|
||||
obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o dsmg600-power.o
|
||||
obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
|
||||
+obj-$(CONFIG_MACH_WG302V1) += wg302v1-setup.o
|
||||
obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
|
||||
obj-$(CONFIG_MACH_FSG) += fsg-setup.o fsg-power.o
|
||||
obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
|
||||
diff -Nur linux-2.6.23.12/arch/arm/mach-ixp4xx/wg302v1-pci.c linux-2.6.23.12-owrt/arch/arm/mach-ixp4xx/wg302v1-pci.c
|
||||
--- linux-2.6.23.12/arch/arm/mach-ixp4xx/wg302v1-pci.c 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ linux-2.6.23.12-owrt/arch/arm/mach-ixp4xx/wg302v1-pci.c 2008-01-14 22:33:52.000000000 +0100
|
||||
@@ -0,0 +1,63 @@
|
||||
+/*
|
||||
+ * arch/arch/mach-ixp4xx/wg302v1-pci.c
|
||||
+ *
|
||||
+ * PCI setup routines for the Netgear WG302 v1 and WAG302 v1
|
||||
+ *
|
||||
+ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
|
||||
+ *
|
||||
+ * based on coyote-pci.c:
|
||||
+ * Copyright (C) 2002 Jungo Software Technologies.
|
||||
+ * Copyright (C) 2003 MontaVista Software, Inc.
|
||||
+ *
|
||||
+ * Maintainer: Imre Kaloz <kaloz@openwrt.org>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License version 2 as
|
||||
+ * published by the Free Software Foundation.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/pci.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/irq.h>
|
||||
+
|
||||
+#include <asm/mach-types.h>
|
||||
+#include <asm/hardware.h>
|
||||
+
|
||||
+#include <asm/mach/pci.h>
|
||||
+
|
||||
+void __init wg302v1_pci_preinit(void)
|
||||
+{
|
||||
+ set_irq_type(IRQ_IXP4XX_GPIO8, IRQT_LOW);
|
||||
+ set_irq_type(IRQ_IXP4XX_GPIO10, IRQT_LOW);
|
||||
+
|
||||
+ ixp4xx_pci_preinit();
|
||||
+}
|
||||
+
|
||||
+static int __init wg302v1_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
|
||||
+{
|
||||
+ if (slot == 1)
|
||||
+ return IRQ_IXP4XX_GPIO8;
|
||||
+ else if (slot == 2)
|
||||
+ return IRQ_IXP4XX_GPIO10;
|
||||
+ else return -1;
|
||||
+}
|
||||
+
|
||||
+struct hw_pci wg302v1_pci __initdata = {
|
||||
+ .nr_controllers = 1,
|
||||
+ .preinit = wg302v1_pci_preinit,
|
||||
+ .swizzle = pci_std_swizzle,
|
||||
+ .setup = ixp4xx_setup,
|
||||
+ .scan = ixp4xx_scan_bus,
|
||||
+ .map_irq = wg302v1_map_irq,
|
||||
+};
|
||||
+
|
||||
+int __init wg302v1_pci_init(void)
|
||||
+{
|
||||
+ if (machine_is_wg302v1())
|
||||
+ pci_common_init(&wg302v1_pci);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+subsys_initcall(wg302v1_pci_init);
|
||||
diff -Nur linux-2.6.23.12/arch/arm/mach-ixp4xx/wg302v1-setup.c linux-2.6.23.12-owrt/arch/arm/mach-ixp4xx/wg302v1-setup.c
|
||||
--- linux-2.6.23.12/arch/arm/mach-ixp4xx/wg302v1-setup.c 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ linux-2.6.23.12-owrt/arch/arm/mach-ixp4xx/wg302v1-setup.c 2008-01-14 23:04:01.000000000 +0100
|
||||
@@ -0,0 +1,109 @@
|
||||
+/*
|
||||
+ * arch/arm/mach-ixp4xx/wg302v1-setup.c
|
||||
+ *
|
||||
+ * Board setup for the Netgear WG302 v1 and WAG302 v1
|
||||
+ *
|
||||
+ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
|
||||
+ *
|
||||
+ * based on coyote-setup.c:
|
||||
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
|
||||
+ *
|
||||
+ * Author: Imre Kaloz <kaloz@openwrt.org>
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/device.h>
|
||||
+#include <linux/serial.h>
|
||||
+#include <linux/tty.h>
|
||||
+#include <linux/serial_8250.h>
|
||||
+#include <linux/slab.h>
|
||||
+
|
||||
+#include <asm/types.h>
|
||||
+#include <asm/setup.h>
|
||||
+#include <asm/memory.h>
|
||||
+#include <asm/hardware.h>
|
||||
+#include <asm/irq.h>
|
||||
+#include <asm/mach-types.h>
|
||||
+#include <asm/mach/arch.h>
|
||||
+#include <asm/mach/flash.h>
|
||||
+
|
||||
+static struct flash_platform_data wg302v1_flash_data = {
|
||||
+ .map_name = "cfi_probe",
|
||||
+ .width = 2,
|
||||
+};
|
||||
+
|
||||
+static struct resource wg302v1_flash_resource = {
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+};
|
||||
+
|
||||
+static struct platform_device wg302v1_flash = {
|
||||
+ .name = "IXP4XX-Flash",
|
||||
+ .id = 0,
|
||||
+ .dev = {
|
||||
+ .platform_data = &wg302v1_flash_data,
|
||||
+ },
|
||||
+ .num_resources = 1,
|
||||
+ .resource = &wg302v1_flash_resource,
|
||||
+};
|
||||
+
|
||||
+static struct resource wg302v1_uart_resource = {
|
||||
+ .start = IXP4XX_UART1_BASE_PHYS,
|
||||
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+};
|
||||
+
|
||||
+static struct plat_serial8250_port wg302v1_uart_data[] = {
|
||||
+ {
|
||||
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
|
||||
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
|
||||
+ .irq = IRQ_IXP4XX_UART1,
|
||||
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
|
||||
+ .iotype = UPIO_MEM,
|
||||
+ .regshift = 2,
|
||||
+ .uartclk = IXP4XX_UART_XTAL,
|
||||
+ },
|
||||
+ { },
|
||||
+};
|
||||
+
|
||||
+static struct platform_device wg302v1_uart = {
|
||||
+ .name = "serial8250",
|
||||
+ .id = PLAT8250_DEV_PLATFORM,
|
||||
+ .dev = {
|
||||
+ .platform_data = wg302v1_uart_data,
|
||||
+ },
|
||||
+ .num_resources = 1,
|
||||
+ .resource = &wg302v1_uart_resource,
|
||||
+};
|
||||
+
|
||||
+static struct platform_device *wg302v1_devices[] __initdata = {
|
||||
+ &wg302v1_flash,
|
||||
+ &wg302v1_uart,
|
||||
+};
|
||||
+
|
||||
+static void __init wg302v1_init(void)
|
||||
+{
|
||||
+ ixp4xx_sys_init();
|
||||
+
|
||||
+ wg302v1_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
|
||||
+ wg302v1_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
|
||||
+
|
||||
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
|
||||
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
|
||||
+
|
||||
+ platform_add_devices(wg302v1_devices, ARRAY_SIZE(wg302v1_devices));
|
||||
+}
|
||||
+
|
||||
+#ifdef CONFIG_MACH_WG302V1
|
||||
+MACHINE_START(WG302V1, "Netgear WG302 v1 / WAG302 v1")
|
||||
+ /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
|
||||
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
|
||||
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
|
||||
+ .map_io = ixp4xx_map_io,
|
||||
+ .init_irq = ixp4xx_init_irq,
|
||||
+ .timer = &ixp4xx_timer,
|
||||
+ .boot_params = 0x0100,
|
||||
+ .init_machine = wg302v1_init,
|
||||
+MACHINE_END
|
||||
+#endif
|
@ -0,0 +1,31 @@
|
||||
diff -Nur linux-2.6.23.12/arch/arm/mach-ixp4xx/wg302v1-setup.c linux-2.6.23.12-owrt/arch/arm/mach-ixp4xx/wg302v1-setup.c
|
||||
--- linux-2.6.23.12/arch/arm/mach-ixp4xx/wg302v1-setup.c 2008-01-14 23:06:42.000000000 +0100
|
||||
+++ linux-2.6.23.12-owrt/arch/arm/mach-ixp4xx/wg302v1-setup.c 2008-01-14 23:03:16.000000000 +0100
|
||||
@@ -77,9 +77,27 @@
|
||||
.resource = &wg302v1_uart_resource,
|
||||
};
|
||||
|
||||
+/* Built-in 10/100 Ethernet MAC interfaces */
|
||||
+static struct eth_plat_info wg302_plat_eth[] = {
|
||||
+ {
|
||||
+ .phy = 30,
|
||||
+ .rxq = 3,
|
||||
+ .txreadyq = 20,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static struct platform_device wg302_eth[] = {
|
||||
+ {
|
||||
+ .name = "ixp4xx_eth",
|
||||
+ .id = IXP4XX_ETH_NPEB,
|
||||
+ .dev.platform_data = wg302_plat_eth,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
static struct platform_device *wg302v1_devices[] __initdata = {
|
||||
&wg302v1_flash,
|
||||
&wg302v1_uart,
|
||||
+ &wg302_eth[0],
|
||||
};
|
||||
|
||||
static void __init wg302v1_init(void)
|
@ -0,0 +1,48 @@
|
||||
diff -Nur linux-2.6.23.12/arch/arm/mach-ixp4xx/wg302v1-setup.c linux-2.6.23.12-owrt/arch/arm/mach-ixp4xx/wg302v1-setup.c
|
||||
--- linux-2.6.23.12/arch/arm/mach-ixp4xx/wg302v1-setup.c 2008-01-14 23:12:03.000000000 +0100
|
||||
+++ linux-2.6.23.12-owrt/arch/arm/mach-ixp4xx/wg302v1-setup.c 2008-01-14 23:11:34.000000000 +0100
|
||||
@@ -100,6 +100,36 @@
|
||||
&wg302_eth[0],
|
||||
};
|
||||
|
||||
+static char wg302v1_mem_fixup[] __initdata = "mem=32M ";
|
||||
+
|
||||
+static void __init wg302v1_fixup(struct machine_desc *desc,
|
||||
+ struct tag *tags, char **cmdline, struct meminfo *mi)
|
||||
+
|
||||
+{
|
||||
+ struct tag *t = tags;
|
||||
+ char *p = *cmdline;
|
||||
+
|
||||
+ /* Find the end of the tags table, taking note of any cmdline tag. */
|
||||
+ for (; t->hdr.size; t = tag_next(t)) {
|
||||
+ if (t->hdr.tag == ATAG_CMDLINE) {
|
||||
+ p = t->u.cmdline.cmdline;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* Overwrite the end of the table with a new cmdline tag. */
|
||||
+ t->hdr.tag = ATAG_CMDLINE;
|
||||
+ t->hdr.size = (sizeof (struct tag_header) +
|
||||
+ strlen(wg302v1_mem_fixup) + strlen(p) + 1 + 4) >> 2;
|
||||
+ strlcpy(t->u.cmdline.cmdline, wg302v1_mem_fixup, COMMAND_LINE_SIZE);
|
||||
+ strlcpy(t->u.cmdline.cmdline + strlen(wg302v1_mem_fixup), p,
|
||||
+ COMMAND_LINE_SIZE - strlen(wg302v1_mem_fixup));
|
||||
+
|
||||
+ /* Terminate the table. */
|
||||
+ t = tag_next(t);
|
||||
+ t->hdr.tag = ATAG_NONE;
|
||||
+ t->hdr.size = 0;
|
||||
+}
|
||||
+
|
||||
static void __init wg302v1_init(void)
|
||||
{
|
||||
ixp4xx_sys_init();
|
||||
@@ -118,6 +148,7 @@
|
||||
/* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
|
||||
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
|
||||
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
|
||||
+ .fixup = wg302v1_fixup,
|
||||
.map_io = ixp4xx_map_io,
|
||||
.init_irq = ixp4xx_init_irq,
|
||||
.timer = &ixp4xx_timer,
|
4050
target/linux/ixp4xx/patches-2.6.24/200-npe_driver.patch
Normal file
4050
target/linux/ixp4xx/patches-2.6.24/200-npe_driver.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,12 @@
|
||||
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/ixp4xx_npe.c linux-2.6.23-openwrt/arch/arm/mach-ixp4xx/ixp4xx_npe.c
|
||||
--- linux-2.6.23/arch/arm/mach-ixp4xx/ixp4xx_npe.c 2007-10-22 22:18:15.000000000 +0200
|
||||
+++ linux-2.6.23-openwrt/arch/arm/mach-ixp4xx/ixp4xx_npe.c 2007-10-22 22:32:48.000000000 +0200
|
||||
@@ -585,6 +585,8 @@
|
||||
npe_reset(npe);
|
||||
#endif
|
||||
|
||||
+ print_npe(KERN_INFO, npe, "firmware's license can be found in /usr/share/doc/LICENSE.IPL\n");
|
||||
+
|
||||
print_npe(KERN_INFO, npe, "firmware functionality 0x%X, "
|
||||
"revision 0x%X:%X\n", (image->id >> 16) & 0xFF,
|
||||
(image->id >> 8) & 0xFF, image->id & 0xFF);
|
187
target/linux/ixp4xx/patches-2.6.24/294-eeprom_new_notifier.patch
Normal file
187
target/linux/ixp4xx/patches-2.6.24/294-eeprom_new_notifier.patch
Normal file
@ -0,0 +1,187 @@
|
||||
diff -uprN linux-2.6.23.orig/drivers/i2c/chips/eeprom.c linux-2.6.23/drivers/i2c/chips/eeprom.c
|
||||
--- linux-2.6.23.orig/drivers/i2c/chips/eeprom.c 2007-10-09 15:31:38.000000000 -0500
|
||||
+++ linux-2.6.23/drivers/i2c/chips/eeprom.c 2007-10-11 00:57:25.000000000 -0500
|
||||
@@ -33,6 +33,8 @@
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/mutex.h>
|
||||
+#include <linux/notifier.h>
|
||||
+#include <linux/eeprom.h>
|
||||
|
||||
/* Addresses to scan */
|
||||
static unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54,
|
||||
@@ -41,26 +43,7 @@ static unsigned short normal_i2c[] = { 0
|
||||
/* Insmod parameters */
|
||||
I2C_CLIENT_INSMOD_1(eeprom);
|
||||
|
||||
-
|
||||
-/* Size of EEPROM in bytes */
|
||||
-#define EEPROM_SIZE 256
|
||||
-
|
||||
-/* possible types of eeprom devices */
|
||||
-enum eeprom_nature {
|
||||
- UNKNOWN,
|
||||
- VAIO,
|
||||
-};
|
||||
-
|
||||
-/* Each client has this additional data */
|
||||
-struct eeprom_data {
|
||||
- struct i2c_client client;
|
||||
- struct mutex update_lock;
|
||||
- u8 valid; /* bitfield, bit!=0 if slice is valid */
|
||||
- unsigned long last_updated[8]; /* In jiffies, 8 slices */
|
||||
- u8 data[EEPROM_SIZE]; /* Register values */
|
||||
- enum eeprom_nature nature;
|
||||
-};
|
||||
-
|
||||
+ATOMIC_NOTIFIER_HEAD(eeprom_chain);
|
||||
|
||||
static int eeprom_attach_adapter(struct i2c_adapter *adapter);
|
||||
static int eeprom_detect(struct i2c_adapter *adapter, int address, int kind);
|
||||
@@ -191,6 +174,7 @@ static int eeprom_detect(struct i2c_adap
|
||||
data->valid = 0;
|
||||
mutex_init(&data->update_lock);
|
||||
data->nature = UNKNOWN;
|
||||
+ data->attr = &eeprom_attr;
|
||||
|
||||
/* Tell the I2C layer a new client has arrived */
|
||||
if ((err = i2c_attach_client(new_client)))
|
||||
@@ -214,6 +198,9 @@ static int eeprom_detect(struct i2c_adap
|
||||
if (err)
|
||||
goto exit_detach;
|
||||
|
||||
+ /* call the notifier chain */
|
||||
+ atomic_notifier_call_chain(&eeprom_chain, EEPROM_REGISTER, data);
|
||||
+
|
||||
return 0;
|
||||
|
||||
exit_detach:
|
||||
@@ -239,6 +226,41 @@ static int eeprom_detach_client(struct i
|
||||
return 0;
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * register_eeprom_notifier - register a 'user' of EEPROM devices.
|
||||
+ * @nb: pointer to notifier info structure
|
||||
+ *
|
||||
+ * Registers a callback function to be called upon detection
|
||||
+ * of an EEPROM device. Detection invokes the 'add' callback
|
||||
+ * with the kobj of the mutex and a bin_attribute which allows
|
||||
+ * read from the EEPROM. The intention is that the notifier
|
||||
+ * will be able to read system configuration from the notifier.
|
||||
+ *
|
||||
+ * Only EEPROMs detected *after* the addition of the notifier
|
||||
+ * are notified. I.e. EEPROMs already known to the system
|
||||
+ * will not be notified - add the notifier from board level
|
||||
+ * code!
|
||||
+ */
|
||||
+int register_eeprom_notifier(struct notifier_block *nb)
|
||||
+{
|
||||
+ return atomic_notifier_chain_register(&eeprom_chain, nb);
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * unregister_eeprom_notifier - unregister a 'user' of EEPROM devices.
|
||||
+ * @old: pointer to notifier info structure
|
||||
+ *
|
||||
+ * Removes a callback function from the list of 'users' to be
|
||||
+ * notified upon detection of EEPROM devices.
|
||||
+ */
|
||||
+int unregister_eeprom_notifier(struct notifier_block *nb)
|
||||
+{
|
||||
+ return atomic_notifier_chain_unregister(&eeprom_chain, nb);
|
||||
+}
|
||||
+
|
||||
+EXPORT_SYMBOL_GPL(register_eeprom_notifier);
|
||||
+EXPORT_SYMBOL_GPL(unregister_eeprom_notifier);
|
||||
+
|
||||
static int __init eeprom_init(void)
|
||||
{
|
||||
return i2c_add_driver(&eeprom_driver);
|
||||
diff -uprN linux-2.6.23.orig/include/linux/eeprom.h linux-2.6.23/include/linux/eeprom.h
|
||||
--- linux-2.6.23.orig/include/linux/eeprom.h 1969-12-31 18:00:00.000000000 -0600
|
||||
+++ linux-2.6.23/include/linux/eeprom.h 2007-10-11 00:57:25.000000000 -0500
|
||||
@@ -0,0 +1,71 @@
|
||||
+#ifndef _LINUX_EEPROM_H
|
||||
+#define _LINUX_EEPROM_H
|
||||
+/*
|
||||
+ * EEPROM notifier header
|
||||
+ *
|
||||
+ * Copyright (C) 2006 John Bowler
|
||||
+ */
|
||||
+
|
||||
+/*
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
+ */
|
||||
+
|
||||
+#ifndef __KERNEL__
|
||||
+#error This is a kernel header
|
||||
+#endif
|
||||
+
|
||||
+#include <linux/list.h>
|
||||
+#include <linux/kobject.h>
|
||||
+#include <linux/sysfs.h>
|
||||
+
|
||||
+/* Size of EEPROM in bytes */
|
||||
+#define EEPROM_SIZE 256
|
||||
+
|
||||
+/* possible types of eeprom devices */
|
||||
+enum eeprom_nature {
|
||||
+ UNKNOWN,
|
||||
+ VAIO,
|
||||
+};
|
||||
+
|
||||
+/* Each client has this additional data */
|
||||
+struct eeprom_data {
|
||||
+ struct i2c_client client;
|
||||
+ struct mutex update_lock;
|
||||
+ u8 valid; /* bitfield, bit!=0 if slice is valid */
|
||||
+ unsigned long last_updated[8]; /* In jiffies, 8 slices */
|
||||
+ u8 data[EEPROM_SIZE]; /* Register values */
|
||||
+ enum eeprom_nature nature;
|
||||
+ struct bin_attribute *attr;
|
||||
+};
|
||||
+
|
||||
+/*
|
||||
+ * This is very basic.
|
||||
+ *
|
||||
+ * If an EEPROM is detected on the I2C bus (this only works for
|
||||
+ * I2C EEPROMs) the notifier chain is called with
|
||||
+ * both the I2C information and the kobject for the sysfs
|
||||
+ * device which has been registers. It is then possible to
|
||||
+ * read from the device via the bin_attribute::read method
|
||||
+ * to extract configuration information.
|
||||
+ *
|
||||
+ * Register the notifier in the board level code, there is no
|
||||
+ * need to unregister it but you can if you want (it will save
|
||||
+ * a little bit or kernel memory to do so).
|
||||
+ */
|
||||
+
|
||||
+extern int register_eeprom_notifier(struct notifier_block *nb);
|
||||
+extern int unregister_eeprom_notifier(struct notifier_block *nb);
|
||||
+
|
||||
+#endif /* _LINUX_EEPROM_H */
|
||||
diff -uprN linux-2.6.23.orig/include/linux/notifier.h linux-2.6.23/include/linux/notifier.h
|
||||
--- linux-2.6.23.orig/include/linux/notifier.h 2007-10-09 15:31:38.000000000 -0500
|
||||
+++ linux-2.6.23/include/linux/notifier.h 2007-10-11 00:57:25.000000000 -0500
|
||||
@@ -231,5 +231,8 @@ static inline int notifier_to_errno(int
|
||||
#define PM_SUSPEND_PREPARE 0x0003 /* Going to suspend the system */
|
||||
#define PM_POST_SUSPEND 0x0004 /* Suspend finished */
|
||||
|
||||
+/* eeprom notifier chain */
|
||||
+#define EEPROM_REGISTER 0x0001
|
||||
+
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _LINUX_NOTIFIER_H */
|
@ -0,0 +1,43 @@
|
||||
diff --git a/arch/arm/mach-ixp4xx/avila-setup.c b/arch/arm/mach-ixp4xx/avila-setup.c
|
||||
index e38f45f..10ed5d6 100644
|
||||
--- a/arch/arm/mach-ixp4xx/avila-setup.c
|
||||
+++ b/arch/arm/mach-ixp4xx/avila-setup.c
|
||||
@@ -132,10 +132,37 @@ static struct platform_device avila_pata = {
|
||||
.resource = avila_pata_resources,
|
||||
};
|
||||
|
||||
+/* Built-in 10/100 Ethernet MAC interfaces */
|
||||
+static struct eth_plat_info avila_plat_eth[] = {
|
||||
+ {
|
||||
+ .phy = 0,
|
||||
+ .rxq = 3,
|
||||
+ .txreadyq = 20,
|
||||
+ }, {
|
||||
+ .phy = 1,
|
||||
+ .rxq = 4,
|
||||
+ .txreadyq = 21,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static struct platform_device avila_eth[] = {
|
||||
+ {
|
||||
+ .name = "ixp4xx_eth",
|
||||
+ .id = IXP4XX_ETH_NPEB,
|
||||
+ .dev.platform_data = avila_plat_eth,
|
||||
+ }, {
|
||||
+ .name = "ixp4xx_eth",
|
||||
+ .id = IXP4XX_ETH_NPEC,
|
||||
+ .dev.platform_data = avila_plat_eth + 1,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
static struct platform_device *avila_devices[] __initdata = {
|
||||
&avila_i2c_gpio,
|
||||
&avila_flash,
|
||||
- &avila_uart
|
||||
+ &avila_uart,
|
||||
+ &avila_eth[0],
|
||||
+ &avila_eth[1],
|
||||
};
|
||||
|
||||
static void __init avila_init(void)
|
55
target/linux/ixp4xx/patches-2.6.24/298-avila_rtc_fixup.patch
Normal file
55
target/linux/ixp4xx/patches-2.6.24/298-avila_rtc_fixup.patch
Normal file
@ -0,0 +1,55 @@
|
||||
diff -uprN linux-2.6.23.orig/arch/arm/mach-ixp4xx/avila-setup.c linux-2.6.23/arch/arm/mach-ixp4xx/avila-setup.c
|
||||
--- linux-2.6.23.orig/arch/arm/mach-ixp4xx/avila-setup.c 2007-10-09 15:31:38.000000000 -0500
|
||||
+++ linux-2.6.23/arch/arm/mach-ixp4xx/avila-setup.c 2007-10-11 01:08:21.000000000 -0500
|
||||
@@ -138,6 +138,35 @@ static struct platform_device *avila_dev
|
||||
&avila_uart
|
||||
};
|
||||
|
||||
+static char avila_rtc_probe[] __initdata = "rtc-ds1672.probe=0,0x68 ";
|
||||
+
|
||||
+static void __init avila_fixup(struct machine_desc *desc,
|
||||
+ struct tag *tags, char **cmdline, struct meminfo *mi)
|
||||
+{
|
||||
+ struct tag *t = tags;
|
||||
+ char *p = *cmdline;
|
||||
+
|
||||
+ /* Find the end of the tags table, taking note of any cmdline tag. */
|
||||
+ for (; t->hdr.size; t = tag_next(t)) {
|
||||
+ if (t->hdr.tag == ATAG_CMDLINE) {
|
||||
+ p = t->u.cmdline.cmdline;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* Overwrite the end of the table with a new cmdline tag. */
|
||||
+ t->hdr.tag = ATAG_CMDLINE;
|
||||
+ t->hdr.size = (sizeof (struct tag_header) +
|
||||
+ strlen(avila_rtc_probe) + strlen(p) + 1 + 4) >> 2;
|
||||
+ strlcpy(t->u.cmdline.cmdline, avila_rtc_probe, COMMAND_LINE_SIZE);
|
||||
+ strlcpy(t->u.cmdline.cmdline + strlen(avila_rtc_probe), p,
|
||||
+ COMMAND_LINE_SIZE - strlen(avila_rtc_probe));
|
||||
+
|
||||
+ /* Terminate the table. */
|
||||
+ t = tag_next(t);
|
||||
+ t->hdr.tag = ATAG_NONE;
|
||||
+ t->hdr.size = 0;
|
||||
+}
|
||||
+
|
||||
static void __init avila_init(void)
|
||||
{
|
||||
ixp4xx_sys_init();
|
||||
@@ -165,6 +194,7 @@ MACHINE_START(AVILA, "Gateworks Avila Ne
|
||||
/* Maintainer: Deepak Saxena <dsaxena@plexity.net> */
|
||||
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
|
||||
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
|
||||
+ .fixup = avila_fixup,
|
||||
.map_io = ixp4xx_map_io,
|
||||
.init_irq = ixp4xx_init_irq,
|
||||
.timer = &ixp4xx_timer,
|
||||
@@ -182,6 +212,7 @@ MACHINE_START(LOFT, "Giant Shoulder Inc
|
||||
/* Maintainer: Tom Billman <kernel@giantshoulderinc.com> */
|
||||
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
|
||||
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
|
||||
+ .fixup = avila_fixup,
|
||||
.map_io = ixp4xx_map_io,
|
||||
.init_irq = ixp4xx_init_irq,
|
||||
.timer = &ixp4xx_timer,
|
72
target/linux/ixp4xx/patches-2.6.24/300-avila_fetch_mac.patch
Normal file
72
target/linux/ixp4xx/patches-2.6.24/300-avila_fetch_mac.patch
Normal file
@ -0,0 +1,72 @@
|
||||
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
|
||||
--- linux-2.6.23.12/arch/arm/mach-ixp4xx/avila-setup.c 2008-01-04 01:28:24.134925761 +0100
|
||||
+++ ../../../../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
|
||||
@@ -14,10 +14,18 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/device.h>
|
||||
+#include <linux/if_ether.h>
|
||||
+#include <linux/socket.h>
|
||||
+#include <linux/netdevice.h>
|
||||
#include <linux/serial.h>
|
||||
#include <linux/tty.h>
|
||||
#include <linux/serial_8250.h>
|
||||
#include <linux/slab.h>
|
||||
+#ifdef CONFIG_SENSORS_EEPROM
|
||||
+# include <linux/i2c.h>
|
||||
+# include <linux/eeprom.h>
|
||||
+#endif
|
||||
+
|
||||
#include <linux/i2c-gpio.h>
|
||||
|
||||
#include <asm/types.h>
|
||||
@@ -194,9 +202,48 @@
|
||||
t->hdr.size = 0;
|
||||
}
|
||||
|
||||
+#ifdef CONFIG_SENSORS_EEPROM
|
||||
+static int loft_eeprom_do(struct notifier_block *self, unsigned long event, void *t)
|
||||
+{
|
||||
+ struct eeprom_data *data = t;
|
||||
+ struct sockaddr address;
|
||||
+ struct net_device * netdev ;
|
||||
+
|
||||
+ char macs[12];
|
||||
+
|
||||
+ /* The MACs are the first 12 bytes in the eeprom at address 0x51 */
|
||||
+ if (event == EEPROM_REGISTER && data->client.addr == 0x51) {
|
||||
+ data->attr->read(&data->client.dev.kobj, data->attr, macs, 0, 12);
|
||||
+ /*eth0*/
|
||||
+ /* using dev_get_by_name here is really ugly and can cause
|
||||
+ * confusion if other ethernet devices are present. FIXME */
|
||||
+
|
||||
+ memcpy(address.sa_data, macs, ETH_ALEN);
|
||||
+ memcpy(&avila_plat_eth[0].hwaddr, macs, ETH_ALEN);
|
||||
+ if ( (netdev = dev_get_by_name(&init_net, "eth0")) )
|
||||
+ netdev->set_mac_address(netdev, &address);
|
||||
+
|
||||
+ /*same for eth1*/
|
||||
+ memcpy(address.sa_data, macs + ETH_ALEN, ETH_ALEN);
|
||||
+ memcpy(&avila_plat_eth[1].hwaddr, macs + ETH_ALEN, ETH_ALEN);
|
||||
+ if ( (netdev = dev_get_by_name(&init_net, "eth1")) )
|
||||
+ netdev->set_mac_address(netdev, &address);
|
||||
+ }
|
||||
+
|
||||
+ return NOTIFY_DONE;
|
||||
+}
|
||||
+
|
||||
+static struct notifier_block loft_eeprom_notifier = {
|
||||
+ .notifier_call = loft_eeprom_do
|
||||
+};
|
||||
+#endif
|
||||
+
|
||||
static void __init avila_init(void)
|
||||
{
|
||||
ixp4xx_sys_init();
|
||||
+#ifdef CONFIG_SENSORS_EEPROM
|
||||
+ register_eeprom_notifier(&loft_eeprom_notifier);
|
||||
+#endif
|
||||
|
||||
avila_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
|
||||
avila_flash_resource.end =
|
||||
|
50
target/linux/ixp4xx/patches-2.6.24/301-avila_led.patch
Normal file
50
target/linux/ixp4xx/patches-2.6.24/301-avila_led.patch
Normal file
@ -0,0 +1,50 @@
|
||||
Index: linux-2.6.23.14/arch/arm/mach-ixp4xx/avila-setup.c
|
||||
===================================================================
|
||||
--- linux-2.6.23.14.orig/arch/arm/mach-ixp4xx/avila-setup.c 2008-01-25 18:26:06.000000000 +0100
|
||||
+++ linux-2.6.23.14/arch/arm/mach-ixp4xx/avila-setup.c 2008-01-25 18:44:02.000000000 +0100
|
||||
@@ -165,12 +165,34 @@
|
||||
}
|
||||
};
|
||||
|
||||
+#ifdef CONFIG_LEDS_IXP4XX
|
||||
+static struct resource avila_led_resources[] = {
|
||||
+ {
|
||||
+ .name = "user",
|
||||
+ .start = AVILA_LED_USER_GPIO,
|
||||
+ .end = AVILA_LED_USER_GPIO,
|
||||
+ .flags = IXP4XX_GPIO_LOW,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static struct platform_device avila_leds = {
|
||||
+ .name = "IXP4XX-GPIO-LED",
|
||||
+ .id = -1,
|
||||
+ .num_resources = ARRAY_SIZE(avila_led_resources),
|
||||
+ .resource = avila_led_resources,
|
||||
+};
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
static struct platform_device *avila_devices[] __initdata = {
|
||||
&avila_i2c_gpio,
|
||||
&avila_flash,
|
||||
&avila_uart,
|
||||
&avila_eth[0],
|
||||
&avila_eth[1],
|
||||
+#ifdef CONFIG_LEDS_IXP4XX
|
||||
+ &avila_leds,
|
||||
+#endif
|
||||
};
|
||||
|
||||
static char avila_rtc_probe[] __initdata = "rtc-ds1672.probe=0,0x68 ";
|
||||
Index: linux-2.6.23.14/include/asm-arm/arch-ixp4xx/avila.h
|
||||
===================================================================
|
||||
--- linux-2.6.23.14.orig/include/asm-arm/arch-ixp4xx/avila.h 2008-01-25 18:26:02.000000000 +0100
|
||||
+++ linux-2.6.23.14/include/asm-arm/arch-ixp4xx/avila.h 2008-01-25 18:26:06.000000000 +0100
|
||||
@@ -36,4 +36,5 @@
|
||||
#define AVILA_PCI_INTC_PIN 9
|
||||
#define AVILA_PCI_INTD_PIN 8
|
||||
|
||||
-
|
||||
+/* User LED */
|
||||
+#define AVILA_LED_USER_GPIO 3
|
49
target/linux/ixp4xx/patches-2.6.24/302-gpio_device.patch
Normal file
49
target/linux/ixp4xx/patches-2.6.24/302-gpio_device.patch
Normal file
@ -0,0 +1,49 @@
|
||||
Index: linux-2.6.23.14/arch/arm/mach-ixp4xx/avila-setup.c
|
||||
===================================================================
|
||||
--- linux-2.6.23.14.orig/arch/arm/mach-ixp4xx/avila-setup.c 2008-01-26 02:59:30.000000000 +0100
|
||||
+++ linux-2.6.23.14/arch/arm/mach-ixp4xx/avila-setup.c 2008-01-26 03:03:07.000000000 +0100
|
||||
@@ -183,6 +183,23 @@
|
||||
};
|
||||
#endif
|
||||
|
||||
+#ifdef CONFIG_GPIO_DEVICE
|
||||
+static struct resource avila_gpio_resources[] = {
|
||||
+ {
|
||||
+ .name = "gpio",
|
||||
+ .start = AVILA_GPIO_MASK,
|
||||
+ .end = AVILA_GPIO_MASK,
|
||||
+ .flags = 0,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static struct platform_device avila_gpio = {
|
||||
+ .name = "GPIODEV",
|
||||
+ .id = -1,
|
||||
+ .num_resources = ARRAY_SIZE(avila_gpio_resources),
|
||||
+ .resource = avila_gpio_resources,
|
||||
+};
|
||||
+#endif
|
||||
|
||||
static struct platform_device *avila_devices[] __initdata = {
|
||||
&avila_i2c_gpio,
|
||||
@@ -193,6 +210,9 @@
|
||||
#ifdef CONFIG_LEDS_IXP4XX
|
||||
&avila_leds,
|
||||
#endif
|
||||
+#ifdef CONFIG_GPIO_DEVICE
|
||||
+ &avila_gpio,
|
||||
+#endif
|
||||
};
|
||||
|
||||
static char avila_rtc_probe[] __initdata = "rtc-ds1672.probe=0,0x68 ";
|
||||
Index: linux-2.6.23.14/include/asm-arm/arch-ixp4xx/avila.h
|
||||
===================================================================
|
||||
--- linux-2.6.23.14.orig/include/asm-arm/arch-ixp4xx/avila.h 2008-01-26 03:03:27.000000000 +0100
|
||||
+++ linux-2.6.23.14/include/asm-arm/arch-ixp4xx/avila.h 2008-01-26 03:07:02.000000000 +0100
|
||||
@@ -38,3 +38,6 @@
|
||||
|
||||
/* User LED */
|
||||
#define AVILA_LED_USER_GPIO 3
|
||||
+
|
||||
+/* gpio mask used by platform device */
|
||||
+#define AVILA_GPIO_MASK (1 << 1) | (1 << 3) | (1 << 5) | (1 << 7) | (1 << 9)
|
31
target/linux/ixp4xx/patches-2.6.24/400-dmabounce.patch
Normal file
31
target/linux/ixp4xx/patches-2.6.24/400-dmabounce.patch
Normal file
@ -0,0 +1,31 @@
|
||||
Index: linux-2.6.23.14/arch/arm/common/dmabounce.c
|
||||
===================================================================
|
||||
--- linux-2.6.23.14.orig/arch/arm/common/dmabounce.c 2008-01-24 22:03:28.475500801 +0100
|
||||
+++ linux-2.6.23.14/arch/arm/common/dmabounce.c 2008-01-24 22:17:36.415822168 +0100
|
||||
@@ -116,6 +116,10 @@
|
||||
} else if (size <= device_info->large.size) {
|
||||
pool = &device_info->large;
|
||||
} else {
|
||||
+#ifdef CONFIG_DMABOUNCE_DEBUG
|
||||
+ printk(KERN_INFO "A dma bounce buffer outside the pool size was requested. Requested size was 0x%08X\nThe calling code was :\n", size);
|
||||
+ dump_stack();
|
||||
+#endif
|
||||
pool = NULL;
|
||||
}
|
||||
|
||||
Index: linux-2.6.23.14/arch/arm/mach-ixp4xx/Kconfig
|
||||
===================================================================
|
||||
--- linux-2.6.23.14.orig/arch/arm/mach-ixp4xx/Kconfig 2008-01-24 22:10:29.331484012 +0100
|
||||
+++ linux-2.6.23.14/arch/arm/mach-ixp4xx/Kconfig 2008-01-24 22:11:42.891675973 +0100
|
||||
@@ -220,6 +220,11 @@
|
||||
default y
|
||||
depends on PCI
|
||||
|
||||
+config DMABOUNCE_DEBUG
|
||||
+ bool "Enable DMABounce debuging"
|
||||
+ default n
|
||||
+ depends on DMABOUNCE
|
||||
+
|
||||
config IXP4XX_INDIRECT_PCI
|
||||
bool "Use indirect PCI memory access"
|
||||
depends on PCI
|
13
target/linux/ixp4xx/patches-2.6.24/401-avila_pci_dev.patch
Normal file
13
target/linux/ixp4xx/patches-2.6.24/401-avila_pci_dev.patch
Normal file
@ -0,0 +1,13 @@
|
||||
Index: linux-2.6.23.14/include/asm-arm/arch-ixp4xx/avila.h
|
||||
===================================================================
|
||||
--- linux-2.6.23.14.orig/include/asm-arm/arch-ixp4xx/avila.h 2008-01-31 17:40:36.000000000 +0100
|
||||
+++ linux-2.6.23.14/include/asm-arm/arch-ixp4xx/avila.h 2008-01-31 17:40:42.000000000 +0100
|
||||
@@ -25,7 +25,7 @@
|
||||
/*
|
||||
* AVILA PCI IRQs
|
||||
*/
|
||||
-#define AVILA_PCI_MAX_DEV 4
|
||||
+#define AVILA_PCI_MAX_DEV 6
|
||||
#define LOFT_PCI_MAX_DEV 6
|
||||
#define AVILA_PCI_IRQ_LINES 4
|
||||
|
Loading…
Reference in New Issue
Block a user