diff options
Diffstat (limited to 'packages/linux/nslu2-kernel/2.6.14/50-nslu2-general.patch')
-rw-r--r-- | packages/linux/nslu2-kernel/2.6.14/50-nslu2-general.patch | 278 |
1 files changed, 117 insertions, 161 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 b01b60e941..c5b513c5e1 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,18 +1,19 @@ --- linux-2.6.14-rc2/arch/arm/mach-ixp4xx/Makefile 2005-09-17 12:42:02.000000000 +0200 -+++ test5/arch/arm/mach-ixp4xx/Makefile 2005-09-27 19:13:04.000000000 +0200 -@@ -8,4 +8,5 @@ ++++ test6/arch/arm/mach-ixp4xx/Makefile 2005-09-28 21:58:36.000000000 +0200 +@@ -8,4 +8,6 @@ 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 ++obj-$(CONFIG_MACH_NSLU2) += nslu2-pci.o nslu2-setup.o nslu2-power.o nslu2-rtc.o nslu2-io.o ++ --- 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 ++++ test6/arch/arm/mach-ixp4xx/nslu2-rtc.c 2005-09-28 03:02:42.000000000 +0200 @@ -0,0 +1,108 @@ +/* + * arch/arm/mach-ixp4xx/nslu2-rtc.c + * -+ * NSL2 RTC driver ++ * NSLU2 RTC driver + * + * Copyright (C) 2005 Tower Technologies + * @@ -73,7 +74,7 @@ + return x1205_do_command(X1205_CMD_GETALARM, &alrm->time); +} + -+static inline int rtc_set_alarm(struct rtc_wkalrm *alrm) ++static int rtc_set_alarm(struct rtc_wkalrm *alrm) +{ + return x1205_do_command(X1205_CMD_SETALARM, &alrm->time); +} @@ -118,8 +119,8 @@ +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 -+++ test5/arch/arm/mach-ixp4xx/nslu2-io.c 2005-09-27 19:24:44.000000000 +0200 -@@ -0,0 +1,683 @@ ++++ test6/arch/arm/mach-ixp4xx/nslu2-io.c 2005-09-28 22:02:12.000000000 +0200 +@@ -0,0 +1,540 @@ +//============================================================================= +// +// n2-io.c version 0.1.7 @@ -148,28 +149,14 @@ +#include <linux/config.h> +#include <linux/version.h> +#include <linux/module.h> -+#include <linux/utsname.h> +#include <linux/kernel.h> -+#include <linux/major.h> -+#include <linux/string.h> +#include <linux/proc_fs.h> -+#include <linux/slab.h> -+#include <linux/init.h> -+#include <linux/errno.h> -+#include <linux/fs.h> -+#include <linux/miscdevice.h> +#include <linux/device.h> -+#include <linux/interrupt.h> -+#include <linux/moduleparam.h> -+#include <linux/timer.h> +#include <linux/reboot.h> + -+#include <asm/system.h> +#include <asm/uaccess.h> -+#include <asm/hardware.h> +#include <asm-arm/irq.h> +#include <asm-arm/delay.h> -+#include <asm-arm/signal.h> + +/* Set this to 1 to output lots of debug messages. */ +#define NSLU2_IO_DEBUG 0 @@ -182,8 +169,6 @@ + +#define VERSION "0.1.7" + -+#define NSLU2RB_MAJOR 60 //rbuttons -+#define NSLU2PB_MAJOR 61 //pbuttons +#define NSLU2BZ_MAJOR 62 //buzzer +#define NSLU2LM_MAJOR 126 + @@ -195,10 +180,6 @@ +#define NSLU2_BEEP_PITCH_LOW 1000 +#define NSLU2_LONG_DELAY 30000 + -+#define RB_DELAY 50 -+#define PB_DELAY 20 -+ -+#define PWR_OFF_STR "poweroff" + + +// ioctls -- 'M" is used for sound cards...we don't got one so it seems safe @@ -260,23 +241,16 @@ +#define LED_DISK2 3 +#define LED_ALL 4 + -+static int nslu2_shutdown_in_progress = 0; -+ +static unsigned long init_jiffy = 0; /* jiffies at init time */ +static unsigned long ontime = 50; +static unsigned long offtime = 450; +static unsigned long bz_repeatcnt = 10; +static unsigned long tone = 1000; + -+DECLARE_WAIT_QUEUE_HEAD(n2rb_waitq); -+DECLARE_WAIT_QUEUE_HEAD(n2pb_waitq); -+ +static struct timer_list n2lm_rsg_timer; //rs green +static struct timer_list n2lm_rsr_timer; //rs red +static struct timer_list n2lm_d1_timer; //drive 1 +static struct timer_list n2lm_d2_timer; //drive 2 -+static struct timer_list n2rb_timer; -+static struct timer_list n2pb_timer; +static struct timer_list n2bz_timer; //beeper + +// sysfs class @@ -601,95 +575,14 @@ + .ioctl = n2bz_ioctl, +}; + -+//================================================================================================== -+ -+static irqreturn_t n2pb_handler (int irq, void *dev_id, struct pt_regs *regs) -+{ -+ void *ret; -+ if (!nslu2_shutdown_in_progress++) { -+ wake_up(&n2pb_waitq); -+ remove_proc_entry(PWR_OFF_STR, NULL); //no parent -+ n2_buzz(NSLU2_BEEP_PITCH_HIGH, NSLU2_BEEP_DUR_SHORT); // Short, high-pitched "OK" -+ ret = create_proc_entry(PWR_OFF_STR, 0, NULL); -+ nslu2_io_debug((KERN_DEBUG "Powerbutton pressed. Shutting down. cpe ret = %p\n", ret)); -+ kill_proc(1,SIGINT,1); // Signal init to shut down -+ } else { -+ n2_buzz(NSLU2_BEEP_PITCH_LOW, NSLU2_BEEP_DUR_MED); // Make a scary noise! -+ nslu2_io_debug((KERN_DEBUG "Powerbutton pressed while already in shutdown")); // Whine! -+ } -+ return IRQ_HANDLED; -+} -+ -+struct testr { -+ int ctl; -+ long param; -+}; -+ -+static irqreturn_t n2rb_handler (int irq, void *dev_id, struct pt_regs *regs) -+{ -+// This doesn't reset the NSLU2. It powers it off. Close enough, since reset is unreliable -+ -+ wake_up(&n2rb_waitq); -+ machine_power_off(); -+ return IRQ_HANDLED; // So we don't get a nobody cared error :-P -+} -+ -+//================================================================================================== -+// What to do here is majorly undetermined... -+ -+static int n2rb_read (struct file *filp, char __user *buffer, size_t count, loff_t *ppos) -+{ -+ printk(KERN_DEBUG "Reset Button Wait\n"); -+ interruptible_sleep_on(&n2rb_waitq); -+ return copy_to_user(buffer, "reset", 5) ? -EFAULT : 5; -+ -+} -+ -+//================================================================================================== -+// What to do here is majorly undetermined... -+ -+static int n2pb_read (struct file *filp, char __user *buffer, size_t count, loff_t *ppos) -+{ -+ printk(KERN_DEBUG "Power Button Wait\n"); -+ interruptible_sleep_on(&n2pb_waitq); -+ return copy_to_user(buffer, "poweroff", 8) ? -EFAULT : 8; -+ -+} -+ -+//-------------------------------------------------------------------------------------------------- -+ -+static struct file_operations n2rb_fops = { -+ .owner = THIS_MODULE, -+ .read = n2rb_read, -+}; -+ -+//-------------------------------------------------------------------------------------------------- -+ -+static struct file_operations n2pb_fops = { -+ .owner = THIS_MODULE, -+ .read = n2pb_read, -+}; -+ -+//================================================================================================== -+ +static void n2iom_initarch(void) +{ + printk(KERN_DEBUG "setup_interrupts - jiffies=%ld init_jiffy=%ld\n", jiffies, init_jiffy); + -+ *IXP4XX_GPIO_GPISR = 0x20400000; // read the 2 irqs to clr -+ set_irq_type(NSLU2_RB_IRQ, IRQT_LOW); -+ set_irq_type(NSLU2_PB_IRQ, IRQT_HIGH); -+ -+ gpio_line_isr_clear(NSLU2_RB_GPIO); -+ gpio_line_isr_clear(NSLU2_PB_GPIO); -+ -+ + init_timer(&n2lm_rsg_timer); + init_timer(&n2lm_rsr_timer); + init_timer(&n2lm_d1_timer); + init_timer(&n2lm_d2_timer); -+// init_timer(&n2rb_timer); -+// init_timer(&n2pb_timer); + init_timer(&n2bz_timer); + + n2lm_rsr_timer.function = n2lm_rsr_handler; @@ -723,20 +616,6 @@ + + n2lm_class = class_create(THIS_MODULE, "nslu2"); + -+ if (register_chrdev(NSLU2RB_MAJOR, "n2_rbm", &n2pb_fops) < 0) { -+ printk(KERN_DEBUG "Reset Button Major %d not available\n", NSLU2RB_MAJOR); -+ return -EBUSY; -+ } -+ else { -+ class_device_create(n2lm_class, MKDEV(NSLU2RB_MAJOR, 0), NULL, "rbuttons"); -+ } -+ if (register_chrdev(NSLU2PB_MAJOR, "n2_pbm", &n2rb_fops) < 0) { -+ printk(KERN_DEBUG "Power Button Major %d not available\n", NSLU2PB_MAJOR); -+ return -EBUSY; -+ } -+ else { -+ class_device_create(n2lm_class, MKDEV(NSLU2PB_MAJOR, 0), NULL, "pbuttons"); -+ } + if (register_chrdev(NSLU2LM_MAJOR, "n2_ledm", &n2lm_fops) < 0) { + printk(KERN_DEBUG "Led Manager Major %d not available\n", NSLU2LM_MAJOR); + return -EBUSY; @@ -752,20 +631,6 @@ + class_device_create(n2lm_class, MKDEV(NSLU2BZ_MAJOR, 0), NULL, "buzzer"); + } + -+ if (request_irq(NSLU2_RB_IRQ, &n2rb_handler, -+ SA_INTERRUPT, "NSLU2 reset button", NULL) < 0) { -+ printk(KERN_DEBUG "Reset Button IRQ %d not available\n", NSLU2_RB_IRQ); -+ return -EIO; -+ } -+ if (request_irq(NSLU2_PB_IRQ, &n2pb_handler, -+ SA_INTERRUPT, "NSLU2 power button", NULL) < 0) { -+ printk(KERN_DEBUG "Power Button IRQ %d not available\n", NSLU2_PB_IRQ); -+ return -EIO; -+ } -+ -+ enable_irq(NSLU2_PB_IRQ); -+ enable_irq(NSLU2_RB_IRQ); -+ + return 0; +} + @@ -773,23 +638,17 @@ + +static void __exit n2iom_exit(void) +{ -+ remove_proc_entry(PWR_OFF_STR, NULL); -+ del_timer(&n2rb_timer); -+ free_irq(NSLU2_RB_IRQ,NULL); -+ unregister_chrdev(NSLU2PB_MAJOR, "n2pb"); -+ class_device_destroy(n2lm_class, MKDEV(NSLU2PB_MAJOR, 0)); -+ del_timer(&n2pb_timer); -+ free_irq(NSLU2_PB_IRQ, NULL); -+ unregister_chrdev(NSLU2RB_MAJOR, "n2rb" ); -+ class_device_destroy(n2lm_class, MKDEV(NSLU2RB_MAJOR, 0)); + del_timer(&n2lm_rsg_timer); + del_timer(&n2lm_rsr_timer); + del_timer(&n2lm_d1_timer); + del_timer(&n2lm_d2_timer); ++ + unregister_chrdev(NSLU2LM_MAJOR, "n2lm" ); + class_device_destroy(n2lm_class, MKDEV(NSLU2LM_MAJOR, 0)); ++ + unregister_chrdev(NSLU2BZ_MAJOR, "n2bz"); + class_device_destroy(n2lm_class, MKDEV(NSLU2BZ_MAJOR, 0)); ++ + class_destroy(n2lm_class); +} + @@ -802,9 +661,8 @@ +static int debug = 7; +module_param(debug, int, 0644); +MODULE_PARM_DESC(debug, "Debugging enabled = 8"); -+ --- linux-2.6.14-rc2/arch/arm/mach-ixp4xx/nslu2-setup.c 1970-01-01 01:00:00.000000000 +0100 -+++ test5/arch/arm/mach-ixp4xx/nslu2-setup.c 2005-09-27 19:37:02.000000000 +0200 ++++ test6/arch/arm/mach-ixp4xx/nslu2-setup.c 2005-09-27 20:19:14.000000000 +0200 @@ -0,0 +1,131 @@ +/* + * arch/arm/mach-ixp4xx/nslu2-setup.c @@ -938,7 +796,7 @@ + .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 ++++ test6/arch/arm/mach-ixp4xx/nslu2-pci.c 2005-09-27 20:19:14.000000000 +0200 @@ -0,0 +1,78 @@ +/* + * arch/arm/mach-ixp4xx/nslu2-pci.c @@ -1018,9 +876,110 @@ +} + +subsys_initcall(nslu2_pci_init); +--- linux-2.6.14-rc2/arch/arm/mach-ixp4xx/nslu2-power.c 1970-01-01 01:00:00.000000000 +0100 ++++ test6/arch/arm/mach-ixp4xx/nslu2-power.c 2005-09-28 03:03:11.000000000 +0200 +@@ -0,0 +1,98 @@ ++/* ++ * arch/arm/mach-ixp4xx/nslu2-power.c ++ * ++ * NSLU2 Power/Reset driver ++ * ++ * Copyright (C) 2005 Tower Technologies ++ * ++ * based on nslu2-io.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/reboot.h> ++#include <linux/interrupt.h> ++ ++static int nslu2_shutdown_in_progress = 0; ++ ++static irqreturn_t nslu2_power_handler(int irq, void *dev_id, struct pt_regs *regs) ++{ ++ /* FIXME init will start a shutdown but the machine ++ * will actually reboot at the end ++ */ ++ ++ if (!nslu2_shutdown_in_progress++) { ++ kill_proc(1, SIGINT, 1); /* Signal init to shut down */ ++ } ++ ++ return IRQ_HANDLED; ++} ++ ++static irqreturn_t nslu2_reset_handler(int irq, void *dev_id, struct pt_regs *regs) ++{ ++ /* FIXME This doesn't reset the NSLU2. It powers it off. ++ * Close enough, since reset is unreliable ++ */ ++ ++ machine_power_off(); ++ ++ return IRQ_HANDLED; ++} ++ ++static int __init nslu2_power_init(void) ++{ ++ printk(KERN_INFO "NSLU2 Power/Reset\n"); ++ ++ *IXP4XX_GPIO_GPISR = 0x20400000; /* read the 2 irqs to clr */ ++ ++ set_irq_type(NSLU2_RB_IRQ, IRQT_LOW); ++ set_irq_type(NSLU2_PB_IRQ, IRQT_HIGH); ++ ++ gpio_line_isr_clear(NSLU2_RB_GPIO); ++ gpio_line_isr_clear(NSLU2_PB_GPIO); ++ ++ ++ if (request_irq(NSLU2_RB_IRQ, &nslu2_reset_handler, ++ SA_INTERRUPT, "NSLU2 reset button", NULL) < 0) { ++ ++ printk(KERN_DEBUG "Reset Button IRQ %d not available\n", ++ NSLU2_RB_IRQ); ++ ++ return -EIO; ++ } ++ ++ if (request_irq(NSLU2_PB_IRQ, &nslu2_power_handler, ++ SA_INTERRUPT, "NSLU2 power button", NULL) < 0) { ++ ++ printk(KERN_DEBUG "Power Button IRQ %d not available\n", ++ NSLU2_PB_IRQ); ++ ++ return -EIO; ++ } ++ ++ enable_irq(NSLU2_PB_IRQ); ++ enable_irq(NSLU2_RB_IRQ); ++ ++ return 0; ++} ++ ++static void __exit nslu2_power_exit(void) ++{ ++ free_irq(NSLU2_RB_IRQ, NULL); ++ free_irq(NSLU2_PB_IRQ, NULL); ++} ++ ++module_init (nslu2_power_init); ++module_exit (nslu2_power_exit); ++ ++MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>"); ++MODULE_DESCRIPTION("NSLU2 Power/Reset driver"); ++MODULE_LICENSE("GPL"); --- 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 @@ ++++ test6/include/asm-arm/arch-ixp4xx/nslu2.h 2005-09-27 20:39:35.000000000 +0200 +@@ -0,0 +1,59 @@ +/* + * include/asm-arm/arch-ixp4xx/nslu2.h + * @@ -1037,9 +996,6 @@ + * 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 |