diff options
author | John Bowler <jbowler@nslu2-linux.org> | 2005-09-28 00:55:32 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2005-09-28 00:55:32 +0000 |
commit | 9aee9f0e7ff475cbad9d1c35f48fdb0a3e9b7f30 (patch) | |
tree | 52c2171cc5b6d3da4ee44dc7289c460fcfa1959f | |
parent | b5067af0bfa30f894bc4fed805aaee5f5c529b2b (diff) |
nslu2-kernel 2.6.14: latest patch set, includes LE patches
6 files changed, 409 insertions, 313 deletions
diff --git a/packages/linux/nslu2-kernel/2.6.14/50-nslu2-general.patch b/packages/linux/nslu2-kernel/2.6.14/50-nslu2-general.patch index a4923de72d..b01b60e941 100644 --- a/packages/linux/nslu2-kernel/2.6.14/50-nslu2-general.patch +++ b/packages/linux/nslu2-kernel/2.6.14/50-nslu2-general.patch @@ -1,16 +1,125 @@ -diff -urN linux-2.6.14-rc2/arch/arm/mach-ixp4xx/Makefile test3/arch/arm/mach-ixp4xx/Makefile --- linux-2.6.14-rc2/arch/arm/mach-ixp4xx/Makefile 2005-09-17 12:42:02.000000000 +0200 -+++ test3/arch/arm/mach-ixp4xx/Makefile 2005-09-24 13:21:35.000000000 +0200 ++++ test5/arch/arm/mach-ixp4xx/Makefile 2005-09-27 19:13:04.000000000 +0200 @@ -8,4 +8,5 @@ obj-$(CONFIG_MACH_IXDPG425) += ixdpg425-pci.o coyote-setup.o obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote-pci.o coyote-setup.o obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o gtwx5715-setup.o +obj-$(CONFIG_MACH_NSLU2) += nslu2-pci.o nslu2-setup.o nslu2-io.o nslu2-rtc.o -diff -urN linux-2.6.14-rc2/arch/arm/mach-ixp4xx/nslu2-io.c test3/arch/arm/mach-ixp4xx/nslu2-io.c +--- linux-2.6.14-rc2/arch/arm/mach-ixp4xx/nslu2-rtc.c 1970-01-01 01:00:00.000000000 +0100 ++++ test5/arch/arm/mach-ixp4xx/nslu2-rtc.c 2005-09-24 19:07:37.000000000 +0200 +@@ -0,0 +1,108 @@ ++/* ++ * arch/arm/mach-ixp4xx/nslu2-rtc.c ++ * ++ * NSL2 RTC driver ++ * ++ * Copyright (C) 2005 Tower Technologies ++ * ++ * based on x1205-rtc.c ++ * Copyright (C) 2004 Karen Spearel ++ * ++ * Author: Alessandro Zummo <a.zummo@towertech.it> ++ * Maintainers: http://www.nslu2-linux.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/module.h> ++#include <linux/time.h> ++#include <linux/rtc.h> ++#include <linux/init.h> ++ ++#include <linux/x1205.h> ++ ++#include <asm/rtc.h> ++ ++ ++extern int (*set_rtc)(void); ++ ++static int nslu2_set_rtc(void) ++{ ++ struct rtc_time new_tm, old_tm; ++ unsigned long cur_secs = xtime.tv_sec; ++ ++ if (x1205_do_command(X1205_CMD_GETDATETIME, &old_tm)) ++ return 0; ++ ++ /* FIXME xtime.tv_nsec = old_tm.tm_sec * 10000000; */ ++ new_tm.tm_sec = cur_secs % 60; ++ cur_secs /= 60; ++ new_tm.tm_min = cur_secs % 60; ++ cur_secs /= 60; ++ new_tm.tm_hour = cur_secs % 24; ++ ++ /* ++ * avoid writing when we're going to change the day ++ * of the month. We will retry in the next minute. ++ * This basically means that if the RTC must not drift ++ * by more than 1 minute in 11 minutes. ++ */ ++ if ((old_tm.tm_hour == 23 && old_tm.tm_min == 59) || ++ (new_tm.tm_hour == 23 && new_tm.tm_min == 59)) ++ return 1; ++ ++ return x1205_do_command(X1205_CMD_SETTIME, &new_tm); ++} ++ ++static int rtc_read_alarm(struct rtc_wkalrm *alrm) ++{ ++ return x1205_do_command(X1205_CMD_GETALARM, &alrm->time); ++} ++ ++static inline int rtc_set_alarm(struct rtc_wkalrm *alrm) ++{ ++ return x1205_do_command(X1205_CMD_SETALARM, &alrm->time); ++} ++ ++static int rtc_read_time(struct rtc_time *tm) ++{ ++ return x1205_do_command(X1205_CMD_GETDATETIME, tm); ++} ++ ++static int rtc_set_time(struct rtc_time *tm) ++{ ++ return x1205_do_command(X1205_CMD_SETDATETIME, tm); ++} ++ ++static struct rtc_ops rtc_ops = { ++ .owner = THIS_MODULE, ++ .read_time = rtc_read_time, ++ .set_time = rtc_set_time, ++ .read_alarm = rtc_read_alarm, ++ .set_alarm = rtc_set_alarm, ++}; ++ ++static int __init nslu2_rtc_init(void) ++{ ++ int ret = register_rtc(&rtc_ops); ++ ++ if (ret) ++ return ret; ++ ++ set_rtc = nslu2_set_rtc; ++ ++ return 0; ++} ++ ++static void __exit nslu2_rtc_exit(void) ++{ ++ set_rtc = NULL; ++ ++ unregister_rtc(&rtc_ops); ++} ++ ++module_init(nslu2_rtc_init); ++module_exit(nslu2_rtc_exit); --- linux-2.6.14-rc2/arch/arm/mach-ixp4xx/nslu2-io.c 1970-01-01 01:00:00.000000000 +0100 -+++ test3/arch/arm/mach-ixp4xx/nslu2-io.c 2005-09-24 15:44:08.000000000 +0200 -@@ -0,0 +1,696 @@ ++++ test5/arch/arm/mach-ixp4xx/nslu2-io.c 2005-09-27 19:24:44.000000000 +0200 +@@ -0,0 +1,683 @@ +//============================================================================= +// +// n2-io.c version 0.1.7 @@ -86,19 +195,6 @@ diff -urN linux-2.6.14-rc2/arch/arm/mach-ixp4xx/nslu2-io.c test3/arch/arm/mach-i +#define NSLU2_BEEP_PITCH_LOW 1000 +#define NSLU2_LONG_DELAY 30000 + -+#define NSLU2_BZ_GPIO 4 -+#define NSLU2_PB_GPIO 5 -+#define NSLU2_PO_GPIO 8 //power off -+#define NSLU2_RB_GPIO 12 -+ -+#define NSLU2_PB_IRQ 22 //gpio5 -+#define NSLU2_RB_IRQ 29 //gpio12 -+ -+#define GPIO_BZ_BM 0x0010 //b0000 0000 0001 0000 -+#define GPIO_PB_BM 0x0020 //b0000 0000 0010 0000 -+#define GPIO_PO_BM 0x0100 //b0000 0001 0000 0000 -+#define GPIO_RB_BM 0x1000 //b0001 0000 0000 0000 -+ +#define RB_DELAY 50 +#define PB_DELAY 20 + @@ -416,15 +512,15 @@ diff -urN linux-2.6.14-rc2/arch/arm/mach-ixp4xx/nslu2-io.c test3/arch/arm/mach-i +{ + int i; + -+ *IXP4XX_GPIO_GPOER &= ~GPIO_BZ_BM; ++ *IXP4XX_GPIO_GPOER &= ~NSLU2_BZ_BM; + + for (i = 1; i < duration; i++) { -+ *IXP4XX_GPIO_GPOUTR &= ~GPIO_BZ_BM; ++ *IXP4XX_GPIO_GPOUTR &= ~NSLU2_BZ_BM; + udelay(tone_delay); -+ *IXP4XX_GPIO_GPOUTR |= GPIO_BZ_BM; ++ *IXP4XX_GPIO_GPOUTR |= NSLU2_BZ_BM; + udelay(tone_delay); + } -+ *IXP4XX_GPIO_GPOER |= GPIO_BZ_BM; ++ *IXP4XX_GPIO_GPOER |= NSLU2_BZ_BM; + + return; +} @@ -707,209 +803,9 @@ diff -urN linux-2.6.14-rc2/arch/arm/mach-ixp4xx/nslu2-io.c test3/arch/arm/mach-i +module_param(debug, int, 0644); +MODULE_PARM_DESC(debug, "Debugging enabled = 8"); + -diff -urN linux-2.6.14-rc2/arch/arm/mach-ixp4xx/nslu2-pci.c test3/arch/arm/mach-ixp4xx/nslu2-pci.c ---- linux-2.6.14-rc2/arch/arm/mach-ixp4xx/nslu2-pci.c 1970-01-01 01:00:00.000000000 +0100 -+++ test3/arch/arm/mach-ixp4xx/nslu2-pci.c 2005-09-24 15:19:54.000000000 +0200 -@@ -0,0 +1,83 @@ -+/* -+ * arch/arm/mach-ixp4xx/nslu2-pci.c -+ * -+ * NSLU2 board-level PCI initialization -+ * -+ * based on ixdp425-pci.c: -+ * Copyright (C) 2002 Intel Corporation. -+ * Copyright (C) 2003-2004 MontaVista Software, Inc. -+ * -+ * Maintainer: http://www.nslu2-linux.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. -+ * -+ */ -+// GPIO 8 is used as the power input so is not free for use as a PCI IRQ -+// However, all the common PCI setup code presumes the standard 4 PCI -+// interrupts are available. So we compromise...we don't enable the -+// IRQ on Pin 8 but we let -+ -+#include <linux/config.h> -+#include <linux/pci.h> -+#include <linux/init.h> -+#include <linux/delay.h> -+ -+#include <asm/mach/pci.h> -+#include <asm/irq.h> -+#include <asm/hardware.h> -+#include <asm/mach-types.h> -+ -+void __init nslu2_pci_preinit(void) -+{ -+ set_irq_type(IRQ_NSLU2_PCI_INTA, IRQT_LOW); -+ set_irq_type(IRQ_NSLU2_PCI_INTB, IRQT_LOW); -+ set_irq_type(IRQ_NSLU2_PCI_INTC, IRQT_LOW); -+ -+ gpio_line_isr_clear(NSLU2_PCI_INTA_PIN); -+ gpio_line_isr_clear(NSLU2_PCI_INTB_PIN); -+ gpio_line_isr_clear(NSLU2_PCI_INTC_PIN); -+ -+ /* INTD is not configured. Unused? */ -+ -+ ixp4xx_pci_preinit(); -+} -+ -+static int __init nslu2_map_irq(struct pci_dev *dev, u8 slot, u8 pin) -+{ -+ static int pci_irq_table[NSLU2_PCI_IRQ_LINES] = { -+ IRQ_NSLU2_PCI_INTA, -+ IRQ_NSLU2_PCI_INTB, -+ IRQ_NSLU2_PCI_INTC, -+ }; -+ -+ int irq = -1; -+ -+ if (slot >= 1 && slot <= NSLU2_PCI_MAX_DEV && -+ pin >= 1 && pin <= NSLU2_PCI_IRQ_LINES) { -+ irq = pci_irq_table[ -+ (slot + pin - 2) % 3]; -+ } -+ -+ return irq; -+} -+ -+struct hw_pci __initdata nslu2_pci = { -+ .nr_controllers = 1, -+ .preinit = nslu2_pci_preinit, -+ .swizzle = pci_std_swizzle, -+ .setup = ixp4xx_setup, -+ .scan = ixp4xx_scan_bus, -+ .map_irq = nslu2_map_irq, -+}; -+ -+int __init nslu2_pci_init(void) /* monkey see, monkey do */ -+{ -+ if (machine_is_nslu2()) -+ pci_common_init(&nslu2_pci); -+ -+ return 0; -+} -+ -+subsys_initcall(nslu2_pci_init); -diff -urN linux-2.6.14-rc2/arch/arm/mach-ixp4xx/nslu2-rtc.c test3/arch/arm/mach-ixp4xx/nslu2-rtc.c ---- linux-2.6.14-rc2/arch/arm/mach-ixp4xx/nslu2-rtc.c 1970-01-01 01:00:00.000000000 +0100 -+++ test3/arch/arm/mach-ixp4xx/nslu2-rtc.c 2005-09-24 17:35:55.000000000 +0200 -@@ -0,0 +1,108 @@ -+/* -+ * arch/arm/mach-ixp4xx/nslu2-rtc.c -+ * -+ * NSL2 RTC driver -+ * -+ * Copyright (C) 2005 Tower Technologies -+ * -+ * based on x1205-rtc.c -+ * Copyright (C) 2004 Karen Spearel -+ * -+ * Author: Alessandro Zummo <a.zummo@towertech.it> -+ * Maintainers: http://www.nslu2-linux.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/module.h> -+#include <linux/time.h> -+#include <linux/rtc.h> -+#include <linux/init.h> -+ -+#include <linux/x1205.h> -+ -+#include <asm/rtc.h> -+ -+ -+extern int (*set_rtc)(void); -+ -+static int nslu2_set_rtc(void) -+{ -+ struct rtc_time new_tm, old_tm; -+ unsigned long cur_secs = xtime.tv_sec; -+ -+ if (x1205_do_command(X1205_CMD_GETDATETIME, &old_tm)) -+ return 0; -+ -+ /* FIXME xtime.tv_nsec = old_tm.tm_sec * 10000000; */ -+ new_tm.tm_sec = cur_secs % 60; -+ cur_secs /= 60; -+ new_tm.tm_min = cur_secs % 60; -+ cur_secs /= 60; -+ new_tm.tm_hour = cur_secs % 24; -+ -+ /* -+ * avoid writing when we're going to change the day -+ * of the month. We will retry in the next minute. -+ * This basically means that if the RTC must not drift -+ * by more than 1 minute in 11 minutes. -+ */ -+ if ((old_tm.tm_hour == 23 && old_tm.tm_min == 59) || -+ (new_tm.tm_hour == 23 && new_tm.tm_min == 59)) -+ return 1; -+ -+ return x1205_do_command(X1205_CMD_SETTIME, &new_tm); -+} -+ -+static int rtc_read_alarm(struct rtc_wkalrm *alrm) -+{ -+ return x1205_do_command(X1205_CMD_GETALARM, &alrm->time); -+} -+ -+static inline int rtc_set_alarm(struct rtc_wkalrm *alrm) -+{ -+ return x1205_do_command(X1205_CMD_SETALARM, &alrm->time); -+} -+ -+static int rtc_read_time(struct rtc_time *tm) -+{ -+ return x1205_do_command(X1205_CMD_GETDATETIME, tm); -+} -+ -+static int rtc_set_time(struct rtc_time *tm) -+{ -+ return x1205_do_command(X1205_CMD_SETDATETIME, tm); -+} -+ -+static struct rtc_ops rtc_ops = { -+ .owner = THIS_MODULE, -+ .read_time = rtc_read_time, -+ .set_time = rtc_set_time, -+ .read_alarm = rtc_read_alarm, -+ .set_alarm = rtc_set_alarm, -+}; -+ -+static int __init nslu2_rtc_init(void) -+{ -+ int ret = register_rtc(&rtc_ops); -+ -+ if (ret) -+ return ret; -+ -+ set_rtc = nslu2_set_rtc; -+ -+ return 0; -+} -+ -+static void __exit nslu2_rtc_exit(void) -+{ -+ set_rtc = NULL; -+ -+ unregister_rtc(&rtc_ops); -+} -+ -+module_init(nslu2_rtc_init); -+module_exit(nslu2_rtc_exit); -diff -urN linux-2.6.14-rc2/arch/arm/mach-ixp4xx/nslu2-setup.c test3/arch/arm/mach-ixp4xx/nslu2-setup.c --- linux-2.6.14-rc2/arch/arm/mach-ixp4xx/nslu2-setup.c 1970-01-01 01:00:00.000000000 +0100 -+++ test3/arch/arm/mach-ixp4xx/nslu2-setup.c 2005-09-24 17:27:31.000000000 +0200 -@@ -0,0 +1,145 @@ ++++ test5/arch/arm/mach-ixp4xx/nslu2-setup.c 2005-09-27 19:37:02.000000000 +0200 +@@ -0,0 +1,131 @@ +/* + * arch/arm/mach-ixp4xx/nslu2-setup.c + * @@ -926,54 +822,42 @@ diff -urN linux-2.6.14-rc2/arch/arm/mach-ixp4xx/nslu2-setup.c test3/arch/arm/mac + */ + +#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 <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 nslu2_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, ++ .map_name = "cfi_probe", ++ .width = 2, +}; + +static struct resource nslu2_flash_resource = { -+ .start = NSLU2_FLASH_BASE, -+ .end = NSLU2_FLASH_BASE + NSLU2_FLASH_SIZE, -+ .flags = IORESOURCE_MEM, ++ .start = NSLU2_FLASH_BASE, ++ .end = NSLU2_FLASH_BASE + NSLU2_FLASH_SIZE, ++ .flags = IORESOURCE_MEM, +}; + +static struct platform_device nslu2_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev = { -+ .platform_data = &nslu2_flash_data, -+ }, -+ .num_resources = 1, -+ .resource = &nslu2_flash_resource, ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev.platform_data = &nslu2_flash_data, ++ .num_resources = 1, ++ .resource = &nslu2_flash_resource, +}; + +static struct ixp4xx_i2c_pins nslu2_i2c_gpio_pins = { -+ .sda_pin = NSLU2_SDA_PIN, -+ .scl_pin = NSLU2_SCL_PIN, ++ .sda_pin = NSLU2_SDA_PIN, ++ .scl_pin = NSLU2_SCL_PIN, +}; + +static struct platform_device nslu2_i2c_controller = { -+ .name = "IXP4XX-I2C", -+ .id = 0, -+ .dev = { -+ .platform_data = &nslu2_i2c_gpio_pins, -+ }, -+ .num_resources = 0 ++ .name = "IXP4XX-I2C", ++ .id = 0, ++ .dev.platform_data = &nslu2_i2c_gpio_pins, ++ .num_resources = 0 +}; + +static struct resource nslu2_uart_resources[] = { @@ -1025,22 +909,20 @@ diff -urN linux-2.6.14-rc2/arch/arm/mach-ixp4xx/nslu2-setup.c test3/arch/arm/mac + &nslu2_uart +}; + -+static void n2_power_off(void) ++static void nslu2_power_off(void) +{ + /* This causes the box to drop the power and go dead. */ -+#define GPIO_PO_BM 0x0100 //b0000 0001 0000 0000 -+ *IXP4XX_GPIO_GPOER &= ~GPIO_PO_BM; /* enable the pwr cntl gpio */ -+ *IXP4XX_GPIO_GPOUTR |= GPIO_PO_BM; /* do the deed */ ++ ++ *IXP4XX_GPIO_GPOER &= ~NSLU2_PO_BM; /* enable the pwr cntl gpio */ ++ *IXP4XX_GPIO_GPOUTR |= NSLU2_PO_BM; /* do the deed */ +} + +static void __init nslu2_init(void) +{ -+ /* NSLU2 has a 33.00 MHZ crystal, we need to cope with that */ -+/* ixp4xx_ticks_per_usec = NSLU2_CLOCK_TICKS_PER_USEC;*/ -+ + ixp4xx_sys_init(); + -+ pm_power_off = n2_power_off; ++ pm_power_off = nslu2_power_off; ++ + platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices)); +} + @@ -1055,3 +937,149 @@ diff -urN linux-2.6.14-rc2/arch/arm/mach-ixp4xx/nslu2-setup.c test3/arch/arm/mac + .timer = &ixp4xx_timer, + .init_machine = nslu2_init, +MACHINE_END +--- linux-2.6.14-rc2/arch/arm/mach-ixp4xx/nslu2-pci.c 1970-01-01 01:00:00.000000000 +0100 ++++ test5/arch/arm/mach-ixp4xx/nslu2-pci.c 2005-09-27 19:57:17.000000000 +0200 +@@ -0,0 +1,78 @@ ++/* ++ * arch/arm/mach-ixp4xx/nslu2-pci.c ++ * ++ * NSLU2 board-level PCI initialization ++ * ++ * based on ixdp425-pci.c: ++ * Copyright (C) 2002 Intel Corporation. ++ * Copyright (C) 2003-2004 MontaVista Software, Inc. ++ * ++ * Maintainer: http://www.nslu2-linux.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/config.h> ++#include <linux/pci.h> ++#include <linux/init.h> ++ ++#include <asm/mach/pci.h> ++#include <asm/mach-types.h> ++ ++void __init nslu2_pci_preinit(void) ++{ ++ set_irq_type(IRQ_NSLU2_PCI_INTA, IRQT_LOW); ++ set_irq_type(IRQ_NSLU2_PCI_INTB, IRQT_LOW); ++ set_irq_type(IRQ_NSLU2_PCI_INTC, IRQT_LOW); ++ ++ gpio_line_isr_clear(NSLU2_PCI_INTA_PIN); ++ gpio_line_isr_clear(NSLU2_PCI_INTB_PIN); ++ gpio_line_isr_clear(NSLU2_PCI_INTC_PIN); ++ ++ /* INTD is not configured as GPIO is used ++ * for the power input button. ++ */ ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init nslu2_map_irq(struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ static int pci_irq_table[NSLU2_PCI_IRQ_LINES] = { ++ IRQ_NSLU2_PCI_INTA, ++ IRQ_NSLU2_PCI_INTB, ++ IRQ_NSLU2_PCI_INTC, ++ }; ++ ++ int irq = -1; ++ ++ if (slot >= 1 && slot <= NSLU2_PCI_MAX_DEV && ++ pin >= 1 && pin <= NSLU2_PCI_IRQ_LINES) { ++ irq = pci_irq_table[ ++ (slot + pin - 2) % NSLU2_PCI_IRQ_LINES]; ++ } ++ ++ return irq; ++} ++ ++struct hw_pci __initdata nslu2_pci = { ++ .nr_controllers = 1, ++ .preinit = nslu2_pci_preinit, ++ .swizzle = pci_std_swizzle, ++ .setup = ixp4xx_setup, ++ .scan = ixp4xx_scan_bus, ++ .map_irq = nslu2_map_irq, ++}; ++ ++int __init nslu2_pci_init(void) /* monkey see, monkey do */ ++{ ++ if (machine_is_nslu2()) ++ pci_common_init(&nslu2_pci); ++ ++ return 0; ++} ++ ++subsys_initcall(nslu2_pci_init); +--- linux-2.6.14-rc2/include/asm-arm/arch-ixp4xx/nslu2.h 1970-01-01 01:00:00.000000000 +0100 ++++ test5/include/asm-arm/arch-ixp4xx/nslu2.h 2005-09-27 20:01:59.000000000 +0200 +@@ -0,0 +1,62 @@ ++/* ++ * include/asm-arm/arch-ixp4xx/nslu2.h ++ * ++ * NSLU2 platform specific definitions ++ * ++ * Author: Mark Rakes <mrakes AT mac.com> ++ * Maintainers: http://www.nslu2-linux.org ++ * ++ * based on ixdp425.h: ++ * 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. ++ */ ++ ++// GPIO 8 is used as the power input so is not free for use as a PCI IRQ ++// kas11 11-2-04 ++ ++#ifndef __ASM_ARCH_HARDWARE_H__ ++#error "Do not include this directly, instead #include <asm/hardware.h>" ++#endif ++ ++#define NSLU2_FLASH_BASE IXP4XX_EXP_BUS_CS0_BASE_PHYS ++#define NSLU2_FLASH_SIZE IXP4XX_EXP_BUS_CSX_REGION_SIZE ++ ++#define NSLU2_SDA_PIN 7 ++#define NSLU2_SCL_PIN 6 ++ ++/* ++ * NSLU2 PCI IRQs ++ */ ++#define NSLU2_PCI_MAX_DEV 3 ++#define NSLU2_PCI_IRQ_LINES 3 ++ ++ ++/* PCI controller GPIO to IRQ pin mappings */ ++#define NSLU2_PCI_INTA_PIN 11 ++#define NSLU2_PCI_INTB_PIN 10 ++#define NSLU2_PCI_INTC_PIN 9 ++#define NSLU2_PCI_INTD_PIN 8 ++ ++ ++/* NSLU2 Timer */ ++#define NSLU2_FREQ 66000000 ++#define NSLU2_CLOCK_TICK_RATE (((NSLU2_FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ) ++#define NSLU2_CLOCK_TICKS_PER_USEC ((NSLU2_CLOCK_TICK_RATE + USEC_PER_SEC/2) / USEC_PER_SEC) ++ ++/* GPIO */ ++ ++#define NSLU2_BZ_GPIO 4 ++#define NSLU2_PB_GPIO 5 ++#define NSLU2_PO_GPIO 8 /* power off */ ++#define NSLU2_RB_GPIO 12 ++ ++#define NSLU2_PB_IRQ 22 /* gpio5 */ ++#define NSLU2_RB_IRQ 29 /* gpio12 */ ++ ++#define NSLU2_BZ_BM 0x0010 /* b0000 0000 0001 0000 */ ++#define NSLU2_PB_BM 0x0020 /* b0000 0000 0010 0000 */ ++#define NSLU2_PO_BM 0x0100 /* b0000 0001 0000 0000 */ ++#define NSLU2_RB_BM 0x1000 /* b0001 0000 0000 0000 */ diff --git a/packages/linux/nslu2-kernel/2.6.14/50-nslu2-include.patch b/packages/linux/nslu2-kernel/2.6.14/50-nslu2-include.patch deleted file mode 100644 index afd395b190..0000000000 --- a/packages/linux/nslu2-kernel/2.6.14/50-nslu2-include.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- linux-2.6.14-rc2/include/asm-arm/arch-ixp4xx/nslu2.h 1970-01-01 01:00:00.000000000 +0100 -+++ test3/include/asm-arm/arch-ixp4xx/nslu2.h 2005-09-24 17:46:04.000000000 +0200 -@@ -0,0 +1,48 @@ -+/* -+ * include/asm-arm/arch-ixp4xx/nslu2.h -+ * -+ * NSLU2 platform specific definitions -+ * -+ * Author: Mark Rakes <mrakes AT mac.com> -+ * Maintainers: http://www.nslu2-linux.org -+ * -+ * based on ixdp425.h: -+ * 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. -+ */ -+ -+// GPIO 8 is used as the power input so is not free for use as a PCI IRQ -+// kas11 11-2-04 -+ -+#ifndef __ASM_ARCH_HARDWARE_H__ -+#error "Do not include this directly, instead #include <asm/hardware.h>" -+#endif -+ -+#define NSLU2_FLASH_BASE IXP4XX_EXP_BUS_CS0_BASE_PHYS -+#define NSLU2_FLASH_SIZE IXP4XX_EXP_BUS_CSX_REGION_SIZE -+ -+#define NSLU2_SDA_PIN 7 -+#define NSLU2_SCL_PIN 6 -+ -+/* -+ * NSLU2 PCI IRQs -+ */ -+#define NSLU2_PCI_MAX_DEV 3 -+#define NSLU2_PCI_IRQ_LINES 3 -+ -+ -+/* PCI controller GPIO to IRQ pin mappings */ -+#define NSLU2_PCI_INTA_PIN 11 -+#define NSLU2_PCI_INTB_PIN 10 -+#define NSLU2_PCI_INTC_PIN 9 -+//#define NSLU2_PCI_INTD_PIN 8 -+ -+ -+/* NSLU2 Timer */ -+//#define NSLU2_FREQ 66000000 -+//#define NSLU2_CLOCK_TICK_RATE (((NSLU2_FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ) -+//#define NSLU2_CLOCK_TICKS_PER_USEC ((NSLU2_CLOCK_TICK_RATE + USEC_PER_SEC/2) / USEC_PER_SEC) -+ diff --git a/packages/linux/nslu2-kernel/2.6.14/90-arm-le.patch b/packages/linux/nslu2-kernel/2.6.14/90-arm-le.patch new file mode 100644 index 0000000000..7af75c736b --- /dev/null +++ b/packages/linux/nslu2-kernel/2.6.14/90-arm-le.patch @@ -0,0 +1,29 @@ +diff -urpN linux-2.6.11.12/arch/arm/boot/compressed/little-endian.S linux-2.6.11.12-le2/arch/arm/boot/compressed/little-endian.S +--- linux-2.6.11.12/arch/arm/boot/compressed/little-endian.S 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.11.12-le2/arch/arm/boot/compressed/little-endian.S 2005-07-17 12:13:55.000000000 +0200 +@@ -0,0 +1,13 @@ ++/* ++ * linux/arch/arm/boot/compressed/little-endian.S ++ * ++ * Switch CPU into little endian mode. ++ * Author: Nicolas Pitre ++ */ ++ ++ .section ".start", #alloc, #execinstr ++ ++ mrc p15, 0, r0, c1, c0, 0 @ read control reg ++ bic r0, r0, #(1 << 7) @ enable little endian mode ++ mcr p15, 0, r0, c1, c0, 0 @ write control reg ++ +diff -urpN linux-2.6.11.12/arch/arm/boot/compressed/Makefile linux-2.6.11.12-le2/arch/arm/boot/compressed/Makefile +--- linux-2.6.11.12/arch/arm/boot/compressed/Makefile 2005-06-12 04:45:37.000000000 +0200 ++++ linux-2.6.11.12-le2/arch/arm/boot/compressed/Makefile 2005-07-17 12:13:55.000000000 +0200 +@@ -56,6 +56,8 @@ endif + + ifeq ($(CONFIG_CPU_BIG_ENDIAN),y) + OBJS += big-endian.o ++else ++OBJS += little-endian.o + endif + + # diff --git a/packages/linux/nslu2-kernel/2.6.14/90-ixp4xx-pci-le.patch b/packages/linux/nslu2-kernel/2.6.14/90-ixp4xx-pci-le.patch new file mode 100644 index 0000000000..a536325067 --- /dev/null +++ b/packages/linux/nslu2-kernel/2.6.14/90-ixp4xx-pci-le.patch @@ -0,0 +1,13 @@ +diff -urpN linux-2.6.11.12/arch/arm/mach-ixp4xx/common-pci.c linux-2.6.11.12-le2/arch/arm/mach-ixp4xx/common-pci.c +--- linux-2.6.11.12/arch/arm/mach-ixp4xx/common-pci.c 2005-06-12 04:45:37.000000000 +0200 ++++ linux-2.6.11.12-le2/arch/arm/mach-ixp4xx/common-pci.c 2005-07-17 12:13:55.000000000 +0200 +@@ -427,7 +427,7 @@ void __init ixp4xx_pci_preinit(void) + #ifdef __ARMEB__ + *PCI_CSR = PCI_CSR_IC | PCI_CSR_ABE | PCI_CSR_PDS | PCI_CSR_ADS; + #else +- *PCI_CSR = PCI_CSR_IC; ++ *PCI_CSR = PCI_CSR_IC | PCI_CSR_ABE; + #endif + + pr_debug("DONE\n"); + diff --git a/packages/linux/nslu2-kernel/2.6.14/90-mtd-ixp4xx.patch b/packages/linux/nslu2-kernel/2.6.14/90-mtd-ixp4xx.patch new file mode 100644 index 0000000000..6d93a09a9f --- /dev/null +++ b/packages/linux/nslu2-kernel/2.6.14/90-mtd-ixp4xx.patch @@ -0,0 +1,75 @@ +--- /tmp/ixp4xx.c 2005-09-24 18:12:25.000000000 +0200 ++++ test4/drivers/mtd/maps/ixp4xx.c 2005-09-24 19:02:24.000000000 +0200 +@@ -42,6 +42,10 @@ + static map_word ixp4xx_read16(struct map_info *map, unsigned long ofs) + { + map_word val; ++ ++#ifndef __ARMEB__ ++ ofs ^= 2; ++#endif + val.x[0] = *(__u16 *) (map->map_priv_1 + ofs); + return val; + } +@@ -51,6 +55,21 @@ + * when attached to a 16-bit wide device (such as the 28F128J3A), + * so we can't just memcpy_fromio(). + */ ++ ++#if !defined(__ARMEB__) && defined(CONFIG_MTD_REDBOOT_PARTS) ++struct fis_image_desc { ++ unsigned char name[16]; // Null terminated name ++ unsigned long flash_base; // Address within FLASH of image ++ unsigned long mem_base; // Address in memory where it executes ++ unsigned long size; // Length of image ++ unsigned long entry_point; // Execution entry point ++ unsigned long data_length; // Length of actual data ++ unsigned char _pad[256-(16+7*sizeof(unsigned long))]; ++ unsigned long desc_cksum; // Checksum over image descriptor ++ unsigned long file_cksum; // Checksum over image data ++}; ++#endif ++ + static void ixp4xx_copy_from(struct map_info *map, void *to, + unsigned long from, ssize_t len) + { +@@ -71,6 +90,19 @@ + + if (len > 0) + *dest++ = BYTE0(*(u16 *)src); ++ ++#if !defined(__ARMEB__) && defined(CONFIG_MTD_REDBOOT_PARTS) ++ if (from == 0x7e0000) { ++ int i; ++ struct fis_image_desc *desc = (struct fis_image_desc *)to; ++ ++ for (i=0; i < (len/sizeof(struct fis_image_desc)); i++) { ++ desc[i].flash_base = be32_to_cpu(desc[i].flash_base); ++ desc[i].mem_base = be32_to_cpu(desc[i].mem_base); ++ desc[i].size = be32_to_cpu(desc[i].size); ++ } ++ } ++#endif + } + + /* +@@ -79,6 +111,9 @@ + */ + static void ixp4xx_probe_write16(struct map_info *map, map_word d, unsigned long adr) + { ++#ifndef __ARMEB__ ++ adr ^= 2; ++#endif + if (!(adr & 1)) + *(__u16 *) (map->map_priv_1 + adr) = d.x[0]; + } +@@ -88,6 +123,9 @@ + */ + static void ixp4xx_write16(struct map_info *map, map_word d, unsigned long adr) + { ++#ifndef __ARMEB__ ++ adr ^= 2; ++#endif + *(__u16 *) (map->map_priv_1 + adr) = d.x[0]; + } + diff --git a/packages/linux/nslu2-kernel_2.6.14-rc2.bb b/packages/linux/nslu2-kernel_2.6.14-rc2.bb index 200d7ef3a5..5a78fe032d 100644 --- a/packages/linux/nslu2-kernel_2.6.14-rc2.bb +++ b/packages/linux/nslu2-kernel_2.6.14-rc2.bb @@ -8,7 +8,7 @@ PR_CONFIG = "0" # Increment the number below (i.e. the digits after PR) when # making changes within this file or for changes to the patches # applied to the kernel. -PR = "r3.${PR_CONFIG}" +PR = "r4.${PR_CONFIG}" include nslu2-kernel.inc @@ -33,7 +33,9 @@ N2K_PATCHES = "\ file://30-i2c-x1205.patch;patch=1 \ file://50-nslu2-arch.patch;patch=1 \ file://50-nslu2-general.patch;patch=1 \ - file://50-nslu2-include.patch;patch=1 \ + file://90-arm-le.patch;patch=1 \ + file://90-ixp4xx-pci-le.patch;patch=1 \ + file://90-mtd-ixp4xx.patch;patch=1 \ file://anonymiser.patch;patch=1 \ " |