diff options
Diffstat (limited to 'packages/linux')
11 files changed, 565 insertions, 992 deletions
diff --git a/packages/linux/ixp4xx-kernel/2.6.15/40-rtc-class.patch b/packages/linux/ixp4xx-kernel/2.6.15/40-rtc-class.patch index e10998f8d2..3b36813564 100644 --- a/packages/linux/ixp4xx-kernel/2.6.15/40-rtc-class.patch +++ b/packages/linux/ixp4xx-kernel/2.6.15/40-rtc-class.patch @@ -1,6 +1,6 @@ ---- linux-nslu2.orig/include/linux/rtc.h 2006-01-08 18:54:58.000000000 +0100 -+++ linux-nslu2/include/linux/rtc.h 2006-01-08 18:55:19.000000000 +0100 -@@ -91,8 +91,81 @@ struct rtc_pll_info { +--- linux-nslu2.orig/include/linux/rtc.h 2006-01-20 12:04:18.000000000 +0100 ++++ linux-nslu2/include/linux/rtc.h 2006-01-20 20:23:24.000000000 +0100 +@@ -91,8 +91,91 @@ struct rtc_pll_info { #define RTC_PLL_GET _IOR('p', 0x11, struct rtc_pll_info) /* Get PLL correction */ #define RTC_PLL_SET _IOW('p', 0x12, struct rtc_pll_info) /* Set PLL correction */ @@ -64,7 +64,6 @@ +extern void rtc_device_unregister(struct rtc_device *rdev); +extern int rtc_interface_register(struct class_interface *intf); + -+ +extern int rtc_month_days(unsigned int month, unsigned int year); +extern int rtc_valid_tm(struct rtc_time *tm); +extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time); @@ -79,11 +78,22 @@ +extern void rtc_update_irq(struct class_device *class_dev, + unsigned long num, unsigned long events); + ++extern struct class_device *rtc_open(char *name); ++extern void rtc_close(struct class_device *class_dev); ++extern int rtc_irq_register(struct class_device *class_dev, ++ struct rtc_task *task); ++extern void rtc_irq_unregister(struct class_device *class_dev, ++ struct rtc_task *task); ++extern int rtc_irq_set_state(struct class_device *class_dev, ++ struct rtc_task *task, int enabled); ++extern int rtc_irq_set_freq(struct class_device *class_dev, ++ struct rtc_task *task, int freq); ++ typedef struct rtc_task { void (*func)(void *private_data); void *private_data; ---- linux-nslu2.orig/drivers/Kconfig 2006-01-08 18:54:58.000000000 +0100 -+++ linux-nslu2/drivers/Kconfig 2006-01-08 18:55:19.000000000 +0100 +--- linux-nslu2.orig/drivers/Kconfig 2006-01-20 12:04:18.000000000 +0100 ++++ linux-nslu2/drivers/Kconfig 2006-01-20 20:23:24.000000000 +0100 @@ -66,4 +66,6 @@ source "drivers/infiniband/Kconfig" source "drivers/sn/Kconfig" @@ -91,8 +101,8 @@ +source "drivers/rtc/Kconfig" + endmenu ---- linux-nslu2.orig/drivers/Makefile 2006-01-08 18:54:58.000000000 +0100 -+++ linux-nslu2/drivers/Makefile 2006-01-08 18:55:19.000000000 +0100 +--- linux-nslu2.orig/drivers/Makefile 2006-01-20 12:04:18.000000000 +0100 ++++ linux-nslu2/drivers/Makefile 2006-01-20 20:23:24.000000000 +0100 @@ -54,6 +54,7 @@ obj-$(CONFIG_USB_GADGET) += usb/gadget/ obj-$(CONFIG_GAMEPORT) += input/gameport/ obj-$(CONFIG_INPUT) += input/ @@ -102,7 +112,7 @@ obj-$(CONFIG_W1) += w1/ obj-$(CONFIG_HWMON) += hwmon/ --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/class.c 2006-01-08 18:55:19.000000000 +0100 ++++ linux-nslu2/drivers/rtc/class.c 2006-01-20 20:23:24.000000000 +0100 @@ -0,0 +1,143 @@ +/* + * RTC subsystem, base class @@ -248,8 +258,8 @@ +MODULE_DESCRIPTION("RTC class support"); +MODULE_LICENSE("GPL"); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/Kconfig 2006-01-09 04:17:02.000000000 +0100 -@@ -0,0 +1,93 @@ ++++ linux-nslu2/drivers/rtc/Kconfig 2006-01-20 21:26:12.000000000 +0100 +@@ -0,0 +1,121 @@ +# +# RTC class/drivers configuration +# @@ -268,6 +278,23 @@ + This driver can also be built as a module. If so, the module + will be called rtc-class. + ++config RTC_HCTOSYS ++ bool "Set system time from RTC on startup" ++ depends on RTC_CLASS = y ++ default y ++ help ++ If you say yes here, the system time will be set using ++ the value read from the specified RTC device. This is useful ++ in order to avoid unnecessary fschk runs. ++ ++config RTC_HCTOSYS_DEVICE ++ string "The RTC to read the time from" ++ depends on RTC_HCTOSYS = y ++ default "rtc0" ++ help ++ The RTC device that will be used as the source for ++ the system time, usually rtc0. ++ +comment "RTC interfaces" + depends on RTC_CLASS + @@ -327,6 +354,17 @@ + This driver can also be built as a module. If so, the module + will be called rtc-ds1672. + ++config RTC_DRV_PCF8563 ++ tristate "Philips PCF8563/Epson RTC8564" ++ depends on RTC_CLASS && I2C ++ help ++ If you say yes here you get support for the ++ Philips PCF8563 RTC chip. The Epson RTC8564 ++ should work as well. ++ ++ This driver can also be built as a module. If so, the module ++ will be called rtc-pcf8563. ++ +config RTC_DRV_TEST + tristate "Test driver/device" + depends on RTC_CLASS @@ -344,13 +382,14 @@ + +endmenu --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/Makefile 2006-01-09 04:17:02.000000000 +0100 -@@ -0,0 +1,15 @@ ++++ linux-nslu2/drivers/rtc/Makefile 2006-01-20 21:26:12.000000000 +0100 +@@ -0,0 +1,17 @@ +# +# Makefile for RTC class/drivers. +# + +obj-y += utils.o ++obj-$(CONFIG_RTC_HCTOSYS) += hctosys.o +obj-$(CONFIG_RTC_CLASS) += rtc-core.o +rtc-core-y := class.o interface.o +obj-$(CONFIG_RTC_INTF_SYSFS) += rtc-sysfs.o @@ -360,9 +399,10 @@ +obj-$(CONFIG_RTC_DRV_X1205) += rtc-x1205.o +obj-$(CONFIG_RTC_DRV_TEST) += rtc-test.o +obj-$(CONFIG_RTC_DRV_DS1672) += rtc-ds1672.o ++obj-$(CONFIG_RTC_DRV_PCF8563) += rtc-pcf8563.o + --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/interface.c 2006-01-09 03:39:33.000000000 +0100 ++++ linux-nslu2/drivers/rtc/interface.c 2006-01-20 21:26:14.000000000 +0100 @@ -0,0 +1,232 @@ +/* + * RTC subsystem, interface functions @@ -597,7 +637,7 @@ + +} --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/utils.c 2006-01-08 18:55:19.000000000 +0100 ++++ linux-nslu2/drivers/rtc/utils.c 2006-01-20 20:23:24.000000000 +0100 @@ -0,0 +1,97 @@ +/* + * RTC subsystem, utility functions @@ -696,8 +736,72 @@ + return 0; +} +EXPORT_SYMBOL(rtc_tm_to_time); ---- linux-nslu2.orig/arch/arm/Kconfig 2006-01-09 03:36:04.000000000 +0100 -+++ linux-nslu2/arch/arm/Kconfig 2006-01-09 03:39:50.000000000 +0100 +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-nslu2/drivers/rtc/hctosys.c 2006-01-20 20:23:24.000000000 +0100 +@@ -0,0 +1,61 @@ ++/* ++ * RTC subsystem, initialize system time on startup ++ * ++ * Copyright (C) 2005 Tower Technologies ++ * Author: Alessandro Zummo <a.zummo@towertech.it> ++ * ++ * 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; version 2 of the License. ++*/ ++ ++#include <linux/rtc.h> ++ ++/* IMPORTANT: the RTC only stores whole seconds. It is arbitrary ++ * whether it stores the most close value or the value with partial ++ * seconds truncated. However, it is important that we use it to store ++ * the truncated value. This is because otherwise it is necessary, ++ * in an rtc sync function, to read both xtime.tv_sec and ++ * xtime.tv_nsec. On some processors (i.e. ARM), an atomic read ++ * of >32bits is not possible. So storing the most close value would ++ * slow down the sync API. So here we have the truncated value and ++ * the best guess is to add 0.5s. ++ */ ++ ++static int __init rtc_hctosys(void) ++{ ++ int err; ++ struct class_device *class_dev = rtc_open(CONFIG_RTC_HCTOSYS_DEVICE); ++ ++ if (class_dev) { ++ struct rtc_time tm; ++ ++ if ((err = rtc_read_time(class_dev, &tm)) == 0) { ++ struct timespec tv; ++ ++ tv.tv_nsec = NSEC_PER_SEC >> 1; ++ ++ rtc_tm_to_time(&tm, &tv.tv_sec); ++ ++ do_settimeofday(&tv); ++ ++ dev_info(class_dev->dev, ++ "setting the system clock to " ++ "%d-%02d-%02d %02d:%02d:%02d (%d)\n", ++ tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, ++ tm.tm_hour, tm.tm_min, tm.tm_sec, tv.tv_sec); ++ } ++ else ++ dev_err(class_dev->dev, ++ "unable to set the system clock\n"); ++ ++ rtc_close(class_dev); ++ } ++ else ++ printk("%s: unable to open rtc device (%s)\n", ++ __FILE__, CONFIG_RTC_HCTOSYS_DEVICE); ++ ++ return 0; ++} ++ ++late_initcall(rtc_hctosys); +--- linux-nslu2.orig/arch/arm/Kconfig 2006-01-20 21:25:46.000000000 +0100 ++++ linux-nslu2/arch/arm/Kconfig 2006-01-20 21:26:12.000000000 +0100 @@ -748,6 +748,8 @@ source "drivers/usb/Kconfig" source "drivers/mmc/Kconfig" @@ -707,8 +811,8 @@ endmenu source "fs/Kconfig" ---- linux-nslu2.orig/arch/arm/common/rtctime.c 2006-01-09 03:36:04.000000000 +0100 -+++ linux-nslu2/arch/arm/common/rtctime.c 2006-01-09 03:39:50.000000000 +0100 +--- linux-nslu2.orig/arch/arm/common/rtctime.c 2006-01-20 21:25:46.000000000 +0100 ++++ linux-nslu2/arch/arm/common/rtctime.c 2006-01-20 21:26:12.000000000 +0100 @@ -40,89 +40,6 @@ static struct rtc_ops *rtc_ops; #define rtc_epoch 1900UL @@ -879,6 +983,24 @@ if (ret) break; ret = copy_to_user(uarg, &alrm, sizeof(alrm)); +@@ -351,7 +268,7 @@ static int rtc_ioctl(struct inode *inode + return ret; + } + +-static int rtc_open(struct inode *inode, struct file *file) ++static int rtc_arm_open(struct inode *inode, struct file *file) + { + int ret; + +@@ -406,7 +323,7 @@ static struct file_operations rtc_fops = + .read = rtc_read, + .poll = rtc_poll, + .ioctl = rtc_ioctl, +- .open = rtc_open, ++ .open = rtc_arm_open, + .release = rtc_release, + .fasync = rtc_fasync, + }; @@ -425,7 +342,7 @@ static int rtc_read_proc(char *page, cha struct rtc_time tm; char *p = page; @@ -897,8 +1019,8 @@ p += sprintf(p, "alrm_time\t: "); if ((unsigned int)alrm.time.tm_hour <= 24) p += sprintf(p, "%02d:", alrm.time.tm_hour); ---- linux-nslu2.orig/include/asm-arm/rtc.h 2006-01-09 03:36:04.000000000 +0100 -+++ linux-nslu2/include/asm-arm/rtc.h 2006-01-09 03:39:50.000000000 +0100 +--- linux-nslu2.orig/include/asm-arm/rtc.h 2006-01-20 21:25:46.000000000 +0100 ++++ linux-nslu2/include/asm-arm/rtc.h 2006-01-20 21:26:12.000000000 +0100 @@ -25,9 +25,6 @@ struct rtc_ops { int (*proc)(char *buf); }; @@ -910,7 +1032,7 @@ void rtc_update(unsigned long, unsigned long); int register_rtc(struct rtc_ops *); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/rtc-sysfs.c 2006-01-09 03:39:50.000000000 +0100 ++++ linux-nslu2/drivers/rtc/rtc-sysfs.c 2006-01-20 21:26:12.000000000 +0100 @@ -0,0 +1,128 @@ +/* + * RTC subsystem, sysfs interface @@ -1041,7 +1163,7 @@ +MODULE_DESCRIPTION("RTC class sysfs interface"); +MODULE_LICENSE("GPL"); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/rtc-proc.c 2006-01-09 03:39:50.000000000 +0100 ++++ linux-nslu2/drivers/rtc/rtc-proc.c 2006-01-20 21:26:12.000000000 +0100 @@ -0,0 +1,158 @@ +/* + * RTC subsystem, proc interface @@ -1202,7 +1324,7 @@ +MODULE_DESCRIPTION("RTC class proc interface"); +MODULE_LICENSE("GPL"); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/rtc-dev.c 2006-01-09 04:00:16.000000000 +0100 ++++ linux-nslu2/drivers/rtc/rtc-dev.c 2006-01-20 21:26:12.000000000 +0100 @@ -0,0 +1,372 @@ +/* + * RTC subsystem, dev interface @@ -1577,8 +1699,8 @@ +MODULE_DESCRIPTION("RTC class dev interface"); +MODULE_LICENSE("GPL"); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/rtc-x1205.c 2006-01-09 04:17:02.000000000 +0100 -@@ -0,0 +1,725 @@ ++++ linux-nslu2/drivers/rtc/rtc-x1205.c 2006-01-20 21:26:12.000000000 +0100 +@@ -0,0 +1,672 @@ +/* + * An i2c driver for the Xicor/Intersil X1205 RTC + * Copyright 2004 Karen Spearel @@ -1620,8 +1742,6 @@ + +/* Insmod parameters */ +I2C_CLIENT_INSMOD; -+I2C_CLIENT_MODULE_PARM(hctosys, -+ "Set the system time from the hardware clock upon initialization"); + +/* offsets into CCR area */ + @@ -1918,50 +2038,6 @@ + return 0; +} + -+static int x1205_hctosys(struct i2c_client *client) -+{ -+ int err; -+ -+ struct rtc_time tm; -+ struct timespec tv; -+ unsigned char sr; -+ -+ if ((err = x1205_get_status(client, &sr)) < 0) -+ return err; -+ -+ /* Don't set if we had a power failure */ -+ if (sr & X1205_SR_RTCF) -+ return -EINVAL; -+ -+ if ((err = x1205_get_datetime(client, &tm, X1205_CCR_BASE)) < 0) -+ return err; -+ -+ /* IMPORTANT: the RTC only stores whole seconds. It is arbitrary -+ * whether it stores the most close value or the value with partial -+ * seconds truncated. However, it is important that we use it to store -+ * the truncated value. This is because otherwise it is necessary, -+ * in an rtc sync function, to read both xtime.tv_sec and -+ * xtime.tv_nsec. On some processors (i.e. ARM), an atomic read -+ * of >32bits is not possible. So storing the most close value would -+ * slow down the sync API. So here we have the truncated value and -+ * the best guess is to add 0.5s. -+ */ -+ -+ tv.tv_nsec = NSEC_PER_SEC >> 1; -+ -+ rtc_tm_to_time(&tm, &tv.tv_sec); -+ -+ do_settimeofday(&tv); -+ -+ dev_info(&client->dev, -+ "setting the system clock to %02d-%02d-%d %02d:%02d:%02d\n", -+ tm.tm_year + 1900, tm.tm_mon + 1, -+ tm.tm_mday, tm.tm_hour, tm.tm_min, -+ tm.tm_sec); -+ -+ return 0; -+} -+ +struct x1205_limit +{ + unsigned char reg; @@ -2245,13 +2321,6 @@ + else + dev_err(&client->dev, "couldn't read status\n"); + -+ /* If requested, set the system time */ -+ if (hctosys) { -+ if ((err = x1205_hctosys(client)) < 0) -+ dev_err(&client->dev, -+ "unable to set the system clock\n"); -+ } -+ + device_create_file(&client->dev, &dev_attr_atrim); + device_create_file(&client->dev, &dev_attr_dtrim); + @@ -2305,7 +2374,7 @@ +module_init(x1205_init); +module_exit(x1205_exit); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/rtc-test.c 2006-01-09 04:17:02.000000000 +0100 ++++ linux-nslu2/drivers/rtc/rtc-test.c 2006-01-20 21:26:12.000000000 +0100 @@ -0,0 +1,206 @@ +/* + * An RTC test device/driver @@ -2514,8 +2583,8 @@ +module_init(test_init); +module_exit(test_exit); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/rtc-ds1672.c 2006-01-12 00:31:05.000000000 +0100 -@@ -0,0 +1,278 @@ ++++ linux-nslu2/drivers/rtc/rtc-ds1672.c 2006-01-20 21:26:12.000000000 +0100 +@@ -0,0 +1,234 @@ +/* + * An rtc/i2c driver for the Dallas DS1672 + * Copyright 2005 Alessandro Zummo @@ -2537,8 +2606,6 @@ + +/* Insmod parameters */ +I2C_CLIENT_INSMOD; -+I2C_CLIENT_MODULE_PARM(hctosys, -+ "Set the system time from the hardware clock upon initialization"); + +/* Registers */ + @@ -2626,41 +2693,6 @@ + return ds1672_set_mmss(client, secs); +} + -+static int ds1672_hctosys(struct i2c_client *client) -+{ -+ int err; -+ struct rtc_time tm; -+ struct timespec tv; -+ -+ if ((err = ds1672_get_datetime(client, &tm)) != 0) -+ return err; -+ -+ /* IMPORTANT: the RTC only stores whole seconds. It is arbitrary -+ * whether it stores the most close value or the value with partial -+ * seconds truncated. However, it is important that we use it to store -+ * the truncated value. This is because otherwise it is necessary, -+ * in an rtc sync function, to read both xtime.tv_sec and -+ * xtime.tv_nsec. On some processors (i.e. ARM), an atomic read -+ * of >32bits is not possible. So storing the most close value would -+ * slow down the sync API. So here we have the truncated value and -+ * the best guess is to add 0.5s. -+ */ -+ -+ tv.tv_nsec = NSEC_PER_SEC >> 1; -+ -+ rtc_tm_to_time(&tm, &tv.tv_sec); -+ -+ do_settimeofday(&tv); -+ -+ dev_info(&client->dev, -+ "setting the system clock to %d-%02d-%02d %02d:%02d:%02d\n", -+ tm.tm_year + 1900, tm.tm_mon + 1, -+ tm.tm_mday, tm.tm_hour, tm.tm_min, -+ tm.tm_sec); -+ -+ return 0; -+} -+ +static int ds1672_rtc_read_time(struct device *dev, struct rtc_time *tm) +{ + return ds1672_get_datetime(to_i2c_client(dev), tm); @@ -2758,13 +2790,6 @@ + + i2c_set_clientdata(client, rtc); + -+ /* If requested, set the system time */ -+ if (hctosys) { -+ if ((err = ds1672_hctosys(client)) < 0) -+ dev_err(&client->dev, -+ "unable to set the system clock\n"); -+ } -+ + return 0; + +exit_detach: @@ -2794,3 +2819,390 @@ + +module_init(ds1672_init); +module_exit(ds1672_exit); +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-nslu2/drivers/rtc/rtc-pcf8563.c 2006-01-20 21:27:41.000000000 +0100 +@@ -0,0 +1,384 @@ ++/* ++ * An I2C driver for the Philips PCF8563 RTC ++ * Copyright 2005-06 Tower Technologies ++ * ++ * Author: Alessandro Zummo <a.zummo@towertech.it> ++ * Maintainers: http://www.nslu2-linux.org/ ++ * ++ * based on the other drivers in this same directory. ++ * ++ * http://www.semiconductors.philips.com/acrobat/datasheets/PCF8563-04.pdf ++ * ++ * 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. ++ */ ++ ++#include <linux/module.h> ++#include <linux/i2c.h> ++#include <linux/bcd.h> ++#include <linux/rtc.h> ++ ++#define DRV_VERSION "0.4.0" ++ ++/* Addresses to scan */ ++static unsigned short normal_i2c[] = { 0x51, I2C_CLIENT_END }; ++ ++/* Module parameters */ ++I2C_CLIENT_INSMOD; ++ ++#define PCF8563_REG_ST1 0x00 /* status */ ++#define PCF8563_REG_ST2 0x01 ++ ++#define PCF8563_REG_SC 0x02 /* datetime */ ++#define PCF8563_REG_MN 0x03 ++#define PCF8563_REG_HR 0x04 ++#define PCF8563_REG_DM 0x05 ++#define PCF8563_REG_DW 0x06 ++#define PCF8563_REG_MO 0x07 ++#define PCF8563_REG_YR 0x08 ++ ++#define PCF8563_REG_AMN 0x09 /* alarm */ ++#define PCF8563_REG_AHR 0x0A ++#define PCF8563_REG_ADM 0x0B ++#define PCF8563_REG_ADW 0x0C ++ ++#define PCF8563_REG_CLKO 0x0D /* clock out */ ++#define PCF8563_REG_TMRC 0x0E /* timer control */ ++#define PCF8563_REG_TMR 0x0F /* timer */ ++ ++#define PCF8563_SC_LV 0x80 /* low voltage */ ++#define PCF8563_MO_C 0x80 /* century */ ++ ++/* Prototypes */ ++static int pcf8563_attach(struct i2c_adapter *adapter); ++static int pcf8563_detach(struct i2c_client *client); ++static int pcf8563_probe(struct i2c_adapter *adapter, int address, int kind); ++ ++static struct i2c_driver pcf8563_driver = { ++ .owner = THIS_MODULE, ++ .name = "pcf8563", ++ .flags = I2C_DF_NOTIFY, ++ .attach_adapter = &pcf8563_attach, ++ .detach_client = &pcf8563_detach, ++}; ++ ++/* ++ * In the routines that deal directly with the pcf8563 hardware, we use ++ * rtc_time -- month 0-11, hour 0-23, yr = calendar year-epoch. ++ */ ++static int pcf8563_get_datetime(struct i2c_client *client, struct rtc_time *tm) ++{ ++ unsigned char buf[13]; ++ unsigned char addr = PCF8563_REG_ST1; ++ ++ struct i2c_msg msgs[] = { ++ { client->addr, 0, 1, &addr }, /* setup read ptr */ ++ { client->addr, I2C_M_RD, 13, buf }, /* read status + date */ ++ }; ++ ++ /* read registers */ ++ if ((i2c_transfer(client->adapter, msgs, 2)) != 2) { ++ dev_err(&client->dev, "%s: read error\n", __FUNCTION__); ++ return -EIO; ++ } ++ ++ if (buf[PCF8563_REG_SC] & PCF8563_SC_LV) ++ dev_info(&client->dev, ++ "low voltage detected, date/time is not reliable.\n"); ++ ++ dev_dbg(&client->dev, ++ "%s: raw data is st1=%02x, st2=%02x, sec=%02x, min=%02x, hr=%02x, " ++ "mday=%02x, wday=%02x, mon=%02x, year=%02x\n", ++ __FUNCTION__, ++ buf[0], buf[1], buf[2], buf[3], ++ buf[4], buf[5], buf[6], buf[7], ++ buf[8]); ++ ++ ++ tm->tm_sec = BCD2BIN(buf[PCF8563_REG_SC] & 0x7F); ++ tm->tm_min = BCD2BIN(buf[PCF8563_REG_MN] & 0x7F); ++ tm->tm_hour = BCD2BIN(buf[PCF8563_REG_HR] & 0x3F); /* rtc hr 0-23 */ ++ tm->tm_mday = BCD2BIN(buf[PCF8563_REG_DM] & 0x3F); ++ tm->tm_wday = buf[PCF8563_REG_DW] & 0x07; ++ tm->tm_mon = BCD2BIN(buf[PCF8563_REG_MO] & 0x1F) - 1; /* rtc mn 1-12 */ ++ tm->tm_year = BCD2BIN(buf[PCF8563_REG_YR]) ++ + (buf[PCF8563_REG_MO] & PCF8563_MO_C ? 100 : 0); ++ ++ dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d, " ++ "mday=%d, mon=%d, year=%d, wday=%d\n", ++ __FUNCTION__, ++ tm->tm_sec, tm->tm_min, tm->tm_hour, ++ tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); ++ ++ /* the clock can give out invalid datetime, but we cannot return ++ * -EINVAL otherwise hwclock will refuse to set the time on bootup. ++ */ ++ if (rtc_valid_tm(tm) < 0) ++ dev_err(&client->dev, "retrieved date/time is not valid.\n"); ++ ++ return 0; ++} ++ ++static int pcf8563_set_datetime(struct i2c_client *client, struct rtc_time *tm) ++{ ++ int i, err; ++ unsigned char buf[9]; ++ ++ dev_dbg(&client->dev, "%s: secs=%d, mins=%d, hours=%d, " ++ "mday=%d, mon=%d, year=%d, wday=%d\n", ++ __FUNCTION__, ++ tm->tm_sec, tm->tm_min, tm->tm_hour, ++ tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); ++ ++ /* hours, minutes and seconds */ ++ buf[PCF8563_REG_SC] = BIN2BCD(tm->tm_sec); ++ buf[PCF8563_REG_MN] = BIN2BCD(tm->tm_min); ++ buf[PCF8563_REG_HR] = BIN2BCD(tm->tm_hour); ++ ++ buf[PCF8563_REG_DM] = BIN2BCD(tm->tm_mday); ++ ++ /* month, 1 - 12 */ ++ buf[PCF8563_REG_MO] = BIN2BCD(tm->tm_mon + 1); ++ ++ /* year and century */ ++ buf[PCF8563_REG_YR] = BIN2BCD(tm->tm_year % 100); ++ if (tm->tm_year / 100) ++ buf[PCF8563_REG_MO] |= PCF8563_MO_C; ++ ++ buf[PCF8563_REG_DW] = tm->tm_wday & 0x07; ++ ++ /* write register's data */ ++ for (i = 0; i < 7; i++) { ++ unsigned char data[2] = { PCF8563_REG_SC + i, ++ buf[PCF8563_REG_SC + i] }; ++ ++ err = i2c_master_send(client, data, sizeof(data)); ++ if (err != sizeof(data)) { ++ dev_err(&client->dev, ++ "%s: err=%d addr=%02x, data=%02x\n", ++ __FUNCTION__, err, data[0], data[1]); ++ return -EIO; ++ } ++ }; ++ ++ return 0; ++} ++ ++struct pcf8563_limit ++{ ++ unsigned char reg; ++ unsigned char mask; ++ unsigned char min; ++ unsigned char max; ++}; ++ ++static int pcf8563_validate_client(struct i2c_client *client) ++{ ++ int i, xfer; ++ ++ static const struct pcf8563_limit probe_limits_pattern[] = { ++ /* register, mask, min, max */ ++ { PCF8563_REG_SC, 0x7F, 0, 59 }, ++ { PCF8563_REG_MN, 0x7F, 0, 59 }, ++ { PCF8563_REG_HR, 0x3F, 0, 23 }, ++ { PCF8563_REG_DM, 0x3F, 0, 31 }, ++ { PCF8563_REG_MO, 0x1F, 0, 12 }, ++ { PCF8563_REG_YR, 0xFF, 0, 99 }, ++ }; ++ ++ /* check limits (only registers with bcd values) */ ++ for (i = 0; i < ARRAY_SIZE(probe_limits_pattern); i++) { ++ unsigned char addr, buf, value; ++ ++ addr = probe_limits_pattern[i].reg; ++ ++ struct i2c_msg msgs[2] = { ++ { client->addr, 0, 2, &addr }, ++ { client->addr, I2C_M_RD, 1, &buf }, ++ }; ++ ++ xfer = i2c_transfer(client->adapter, msgs, 2); ++ ++ if (xfer != 2) { ++ dev_err(&client->adapter->dev, ++ "%s: could not read register %x\n", ++ __FUNCTION__, probe_limits_pattern[i].reg); ++ ++ return -EIO; ++ } ++ ++ value = BCD2BIN(buf & probe_limits_pattern[i].mask); ++ ++ if (value > probe_limits_pattern[i].max || ++ value < probe_limits_pattern[i].min) { ++ dev_dbg(&client->adapter->dev, ++ "%s: register=%x, lim pattern=%d, value=%d\n", ++ __FUNCTION__, probe_limits_pattern[i].reg, i, value); ++ ++ return -ENODEV; ++ } ++ } ++ ++ return 0; ++} ++ ++static int pcf8563_rtc_read_time(struct device *dev, ++ struct rtc_time *tm) ++{ ++ return pcf8563_get_datetime(to_i2c_client(dev), tm); ++} ++ ++static int pcf8563_rtc_set_time(struct device *dev, ++ struct rtc_time *tm) ++{ ++ return pcf8563_set_datetime(to_i2c_client(dev), tm); ++} ++ ++static int pcf8563_rtc_set_mmss(struct device *dev, unsigned long secs) ++{ ++ int err; ++ ++ struct rtc_time new_tm, old_tm; ++ ++ if ((err = pcf8563_rtc_read_time(dev, &old_tm) == 0)) ++ return err; ++ ++ /* FIXME xtime.tv_nsec = old_tm.tm_sec * 10000000; */ ++ new_tm.tm_sec = secs % 60; ++ secs /= 60; ++ new_tm.tm_min = secs % 60; ++ secs /= 60; ++ new_tm.tm_hour = 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 pcf8563_rtc_set_time(dev, &new_tm); ++} ++ ++static int pcf8563_rtc_proc(struct device *dev, struct seq_file *seq) ++{ ++ seq_printf(seq, "24hr\t\t: yes\n"); ++ return 0; ++} ++ ++static struct rtc_class_ops pcf8563_rtc_ops = { ++ .proc = pcf8563_rtc_proc, ++ .read_time = pcf8563_rtc_read_time, ++ .set_time = pcf8563_rtc_set_time, ++ .set_mmss = pcf8563_rtc_set_mmss, ++}; ++ ++static int pcf8563_attach(struct i2c_adapter *adapter) ++{ ++ return i2c_probe(adapter, &addr_data, pcf8563_probe); ++} ++ ++static int pcf8563_probe(struct i2c_adapter *adapter, int address, int kind) ++{ ++ struct i2c_client *client; ++ struct rtc_device *rtc; ++ ++ int err = 0; ++ ++ dev_dbg(&adapter->dev, "%s\n", __FUNCTION__); ++ ++ if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { ++ err = -ENODEV; ++ goto exit; ++ } ++ ++ if (!(client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL))) { ++ err = -ENOMEM; ++ goto exit; ++ } ++ ++ client->addr = address; ++ client->driver = &pcf8563_driver; ++ client->adapter = adapter; ++ ++ strlcpy(client->name, pcf8563_driver.name, I2C_NAME_SIZE); ++ ++ /* Verify the chip is really an PCF8563 */ ++ if (kind < 0) { ++ if (pcf8563_validate_client(client) < 0) { ++ err = -ENODEV; ++ goto exit_kfree; ++ } ++ } ++ ++ /* Inform the i2c layer */ ++ if ((err = i2c_attach_client(client))) ++ goto exit_kfree; ++ ++ dev_info(&client->dev, "chip found, driver version " DRV_VERSION "\n"); ++ ++ rtc = rtc_device_register(pcf8563_driver.name, &client->dev, ++ &pcf8563_rtc_ops, THIS_MODULE); ++ ++ if (IS_ERR(rtc)) { ++ err = PTR_ERR(rtc); ++ dev_err(&client->dev, ++ "unable to register the class device\n"); ++ goto exit_detach; ++ } ++ ++ i2c_set_clientdata(client, rtc); ++ ++ return 0; ++ ++exit_detach: ++ i2c_detach_client(client); ++ ++exit_kfree: ++ kfree(client); ++ ++exit: ++ return err; ++} ++ ++static int pcf8563_detach(struct i2c_client *client) ++{ ++ int err; ++ struct rtc_device *rtc = i2c_get_clientdata(client); ++ ++ dev_dbg(&client->dev, "%s\n", __FUNCTION__); ++ ++ if (rtc) ++ rtc_device_unregister(rtc); ++ ++ if ((err = i2c_detach_client(client))) ++ return err; ++ ++ kfree(client); ++ ++ return 0; ++} ++ ++static int __init pcf8563_init(void) ++{ ++ return i2c_add_driver(&pcf8563_driver); ++} ++ ++static void __exit pcf8563_exit(void) ++{ ++ i2c_del_driver(&pcf8563_driver); ++} ++ ++MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>"); ++MODULE_DESCRIPTION("Philips PCF8563/Epson RTC8564 RTC driver"); ++MODULE_LICENSE("GPL"); ++MODULE_VERSION(DRV_VERSION); ++ ++module_init(pcf8563_init); ++module_exit(pcf8563_exit); ++ diff --git a/packages/linux/ixp4xx-kernel/2.6.15/45-eeprom-notifier.patch b/packages/linux/ixp4xx-kernel/2.6.15/45-eeprom-notifier.patch index a3597a9c3f..0c211f189a 100644 --- a/packages/linux/ixp4xx-kernel/2.6.15/45-eeprom-notifier.patch +++ b/packages/linux/ixp4xx-kernel/2.6.15/45-eeprom-notifier.patch @@ -129,7 +129,7 @@ Signed-off-by: John Bowler <jbowler@acm.org> +#ifndef _LINUX_EEPROM_H +#define _LINUX_EEPROM_H +/* -+ * $Id$ ++ * $Id: 45-eeprom-notifier.patch,v 1.1 2006/01/16 05:21:31 jbowler Exp $ + * + * Copyright (C) 2006 John Bowler + */ diff --git a/packages/linux/ixp4xx-kernel/2.6.15/60-nas100d-i2c.patch b/packages/linux/ixp4xx-kernel/2.6.15/60-nas100d-i2c.patch index 5dfed57c0e..7d98b75f18 100644 --- a/packages/linux/ixp4xx-kernel/2.6.15/60-nas100d-i2c.patch +++ b/packages/linux/ixp4xx-kernel/2.6.15/60-nas100d-i2c.patch @@ -5,7 +5,7 @@ 4 files changed, 503 insertions(+) --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nas100d/drivers/i2c/chips/pcf8563.c 2005-11-22 17:32:35.000000000 +0100 ++++ linux-nslu2/drivers/i2c/chips/pcf8563.c 2006-01-20 11:57:40.000000000 +0100 @@ -0,0 +1,466 @@ +/* + * pcf8563.c - An i2c driver for the Philips PCF8563 RTC @@ -474,7 +474,7 @@ +module_init(pcf8563_init); +module_exit(pcf8563_exit); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nas100d/include/linux/pcf8563.h 2005-11-22 01:36:46.000000000 +0100 ++++ linux-nslu2/include/linux/pcf8563.h 2006-01-20 11:57:40.000000000 +0100 @@ -0,0 +1,27 @@ +/* + * pcf8563.h - defines for drivers/i2c/chips/pcf8563.c @@ -503,11 +503,11 @@ +extern int pcf8563_do_command(unsigned int cmd, void *arg); + +#endif /* __LINUX_PCF8563_H__ */ ---- linux-nas100d.orig/drivers/i2c/chips/Kconfig 2005-11-21 22:01:31.000000000 +0100 -+++ linux-nas100d/drivers/i2c/chips/Kconfig 2005-11-22 01:36:46.000000000 +0100 -@@ -135,4 +135,13 @@ config RTC_X1205_I2C - This driver can also be built as a module. If so, the module - will be called x1205. +--- linux-nslu2.orig/drivers/i2c/chips/Kconfig 2006-01-20 11:55:58.000000000 +0100 ++++ linux-nslu2/drivers/i2c/chips/Kconfig 2006-01-20 11:57:40.000000000 +0100 +@@ -117,4 +117,13 @@ config SENSORS_MAX6875 + This driver can also be built as a module. If so, the module + will be called max6875. +config RTC_PCF8563_I2C + tristate "Philips PCF8563 RTC" @@ -519,12 +519,12 @@ + This driver can also be built as a module. If so, the module + will be called pcf8563. endmenu ---- linux-nas100d.orig/drivers/i2c/chips/Makefile 2005-11-21 22:01:31.000000000 +0100 -+++ linux-nas100d/drivers/i2c/chips/Makefile 2005-11-22 01:36:46.000000000 +0100 -@@ -14,6 +14,7 @@ obj-$(CONFIG_SENSORS_RTC8564) += rtc8564 +--- linux-nslu2.orig/drivers/i2c/chips/Makefile 2006-01-20 11:55:58.000000000 +0100 ++++ linux-nslu2/drivers/i2c/chips/Makefile 2006-01-20 11:58:08.000000000 +0100 +@@ -12,6 +12,7 @@ obj-$(CONFIG_SENSORS_PCF8574) += pcf8574 + obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o obj-$(CONFIG_TPS65010) += tps65010.o - obj-$(CONFIG_RTC_X1205_I2C) += x1205.o +obj-$(CONFIG_RTC_PCF8563_I2C) += pcf8563.o ifeq ($(CONFIG_I2C_DEBUG_CHIP),y) diff --git a/packages/linux/ixp4xx-kernel/2.6.15/75-nslu2-leds.patch b/packages/linux/ixp4xx-kernel/2.6.15/75-nslu2-leds.patch deleted file mode 100644 index b0dc4b8c34..0000000000 --- a/packages/linux/ixp4xx-kernel/2.6.15/75-nslu2-leds.patch +++ /dev/null @@ -1,272 +0,0 @@ - arch/arm/Kconfig | 8 - - arch/arm/mach-ixp4xx/Makefile | 4 - arch/arm/mach-ixp4xx/nslu2-leds.c | 223 ++++++++++++++++++++++++++++++++++++++ - 3 files changed, 232 insertions(+), 3 deletions(-) - ---- linux-2.6.15/arch/arm/Kconfig 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.15/arch/arm/Kconfig 1970-01-01 00:00:00.000000000 +0000 -@@ -418,7 +418,8 @@ config LEDS - ARCH_EBSA285 || ARCH_IMX || ARCH_INTEGRATOR || \ - ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_NETWINDER || \ - ARCH_OMAP || ARCH_P720T || ARCH_PXA_IDP || \ -- ARCH_SA1100 || ARCH_SHARK || ARCH_VERSATILE -+ ARCH_SA1100 || ARCH_SHARK || ARCH_VERSATILE || \ -+ MACH_NSLU2 - help - If you say Y here, the LEDs on your machine will be used - to provide useful information about your current system status. -@@ -432,7 +433,7 @@ config LEDS - - config LEDS_TIMER - bool "Timer LED" if (!ARCH_CDB89712 && !ARCH_OMAP) || \ -- MACH_OMAP_H2 || MACH_OMAP_PERSEUS2 -+ MACH_OMAP_H2 || MACH_OMAP_PERSEUS2 || MACH_NSLU2 - depends on LEDS - default y if ARCH_EBSA110 - help -@@ -448,7 +449,8 @@ config LEDS_TIMER - - config LEDS_CPU - bool "CPU usage LED" if (!ARCH_CDB89712 && !ARCH_EBSA110 && \ -- !ARCH_OMAP) || MACH_OMAP_H2 || MACH_OMAP_PERSEUS2 -+ !ARCH_OMAP) || MACH_OMAP_H2 || MACH_OMAP_PERSEUS2 \ -+ || MACH_NSLU2 - depends on LEDS - help - If you say Y here, the red LED will be used to give a good real ---- linux-2.6.15/arch/arm/mach-ixp4xx/Makefile 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.15/arch/arm/mach-ixp4xx/Makefile 1970-01-01 00:00:00.000000000 +0000 -@@ -11,3 +11,7 @@ obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote- - obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o gtwx5715-setup.o - obj-$(CONFIG_MACH_NSLU2) += nslu2-pci.o nslu2-setup.o nslu2-power.o - -+leds-$(CONFIG_MACH_NSLU2) += nslu2-leds.o -+obj-$(CONFIG_LEDS) += $(leds-y) -+ -+ ---- linux-2.6.15/arch/arm/mach-ixp4xx/nslu2-leds.c 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.15/arch/arm/mach-ixp4xx/nslu2-leds.c 1970-01-01 00:00:00.000000000 +0000 -@@ -0,0 +1,223 @@ -+/* -+ * arch/arm/mach-ixp4xx/nslu2-leds.c -+ * -+ * NSLU2 LEDs driver -+ * -+ * Copyright (C) 2005 Tower Technologies -+ * -+ * based on nslu2-io.c -+ * Copyright (C) 2004 Karen Spearel -+ * and arch/arm/mach-footbridge/netwinder-leds.c -+ * Copyright (C) 1998-1999 Russell King -+ * -+ * 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/config.h> -+#include <linux/module.h> -+#include <linux/kernel.h> -+#include <linux/init.h> -+#include <linux/spinlock.h> -+#include <linux/notifier.h> -+ -+#include <asm/hardware.h> -+#include <asm/leds.h> -+#include <asm/mach-types.h> -+#include <asm/system.h> -+ -+#define LED_STATE_ENABLED 0x01 -+#define LED_STATE_CLAIMED 0x02 -+#define LED_STATE_IDLE 0x04 -+ -+static unsigned char led_state; -+static unsigned int hw_led_state; -+ -+#ifdef CONFIG_LEDS_TIMER -+static const unsigned long idle_seq[4] = { -+ NSLU2_LED_GRN_BM, 0, -+ NSLU2_LED_GRN_BM, 0, -+}; -+ -+static const unsigned long busy_seq[4] = { -+ NSLU2_LED_GRN_BM, 0, -+ NSLU2_LED_GRN_BM | NSLU2_LED_RED_BM, 0, -+}; -+#endif -+ -+static unsigned char led_count = 0; -+ -+static DEFINE_SPINLOCK(leds_lock); -+extern spinlock_t gpio_lock; -+ -+static void nslu2_leds_event(led_event_t evt) -+{ -+ unsigned long flags; -+ -+ spin_lock_irqsave(&leds_lock, flags); -+ -+ switch (evt) { -+ case led_start: -+ /* Let's rock! Red led on, all others off. Remember -+ * that disk1/disk2 works inverted. -+ */ -+ led_state = LED_STATE_ENABLED; -+ hw_led_state = NSLU2_LED_DISK1_BM | NSLU2_LED_DISK2_BM -+ | NSLU2_LED_RED_BM; -+ break; -+ -+ case led_stop: -+ led_state &= ~LED_STATE_ENABLED; -+ break; -+ -+ case led_claim: -+ /* The user claimed the interface, red and green off */ -+ led_state |= LED_STATE_CLAIMED; -+ hw_led_state &= ~(NSLU2_LED_RED_BM | NSLU2_LED_GRN_BM); -+ break; -+ -+ case led_release: -+ /* The user released the interface, preserve the last -+ * status of the leds, except red/green. -+ */ -+ led_state &= ~LED_STATE_CLAIMED; -+ hw_led_state = *IXP4XX_GPIO_GPOUTR & 0x0000000C; -+ break; -+ -+#ifdef CONFIG_LEDS_TIMER -+ case led_timer: -+ /* Pulse green led */ -+ if (!(led_state & LED_STATE_CLAIMED)) -+ { -+ /* clear red and green bits */ -+ hw_led_state &= ~(NSLU2_LED_RED_BM | NSLU2_LED_GRN_BM); -+ -+ /* copy the right sequence in */ -+ if (led_state & LED_STATE_IDLE) -+ hw_led_state |= idle_seq[led_count % 4]; -+ else -+ hw_led_state |= busy_seq[led_count % 4]; -+ -+ led_count++; -+ } -+ break; -+#endif -+ -+#ifdef CONFIG_LEDS_CPU -+ case led_idle_start: -+ led_state |= LED_STATE_IDLE; -+#ifndef CONFIG_LEDS_TIMER -+ /* green on, red off */ -+ hw_led_state |= NSLU2_LED_GRN_BM; -+ hw_led_state &= ~NSLU2_LED_RED_BM; -+#endif -+ break; -+ -+ case led_idle_end: -+ led_state &= ~LED_STATE_IDLE; -+#ifndef CONFIG_LEDS_TIMER -+ /* green on, red on -> amber on */ -+ hw_led_state |= NSLU2_LED_GRN_BM | NSLU2_LED_RED_BM; -+#endif -+ break; -+#endif /* CONFIG_LEDS_CPU */ -+ -+ case led_halted: -+ if (!(led_state & LED_STATE_CLAIMED)) -+ hw_led_state |= NSLU2_LED_RED_BM; -+ break; -+ -+ /* leds */ -+ -+ case led_green_on: -+ if (led_state & LED_STATE_CLAIMED) -+ hw_led_state |= NSLU2_LED_GRN_BM; -+ break; -+ -+ case led_green_off: -+ if (led_state & LED_STATE_CLAIMED) -+ hw_led_state &= ~NSLU2_LED_GRN_BM; -+ break; -+ -+ case led_amber_on: -+ if (led_state & LED_STATE_CLAIMED) -+ hw_led_state |= (NSLU2_LED_RED_BM | NSLU2_LED_GRN_BM); -+ break; -+ -+ case led_amber_off: -+ if (led_state & LED_STATE_CLAIMED) -+ hw_led_state &= ~(NSLU2_LED_RED_BM | NSLU2_LED_GRN_BM); -+ break; -+ -+ case led_red_on: -+ if (led_state & LED_STATE_CLAIMED) -+ hw_led_state |= NSLU2_LED_RED_BM; -+ break; -+ -+ case led_red_off: -+ if (led_state & LED_STATE_CLAIMED) -+ hw_led_state &= ~NSLU2_LED_RED_BM; -+ break; -+ -+ default: -+ break; -+ } -+ -+ spin_unlock_irqrestore(&leds_lock, flags); -+ -+ if (led_state & LED_STATE_ENABLED) { -+ spin_lock_irqsave(&gpio_lock, flags); -+ *IXP4XX_GPIO_GPOUTR = (*IXP4XX_GPIO_GPOUTR & 0xFFFFFFF0) | hw_led_state; -+ spin_unlock_irqrestore(&gpio_lock, flags); -+ } -+} -+ -+static int nslu2_leds_panic_event(struct notifier_block *this, unsigned long event, -+ void *ptr) -+{ -+#ifdef CONFIG_LEDS_TIMER -+ leds_event(led_claim); -+#endif -+ leds_event(led_green_off); -+ leds_event(led_red_on); -+ -+ return NOTIFY_DONE; -+} -+ -+static struct notifier_block nslu2_leds_panic_block = { -+ .notifier_call = nslu2_leds_panic_event, -+}; -+ -+static int __init nslu2_leds_init(void) -+{ -+ if (!(machine_is_nslu2())) -+ return 0; -+ -+ printk(KERN_INFO "NSLU2: leds\n"); -+ -+ /* register panic notifier */ -+ notifier_chain_register(&panic_notifier_list, &nslu2_leds_panic_block); -+ -+ /* enable gpio 0-3 */ -+ gpio_line_config(NSLU2_LED_GRN, IXP4XX_GPIO_OUT); -+ gpio_line_config(NSLU2_LED_RED, IXP4XX_GPIO_OUT); -+ gpio_line_config(NSLU2_LED_DISK1, IXP4XX_GPIO_OUT); -+ gpio_line_config(NSLU2_LED_DISK2, IXP4XX_GPIO_OUT); -+ -+ leds_event = nslu2_leds_event; -+ -+ /* this will also initialize the leds to the -+ * default state. -+ */ -+ -+ leds_event(led_start); -+ -+ return 0; -+} -+ -+module_init(nslu2_leds_init); diff --git a/packages/linux/ixp4xx-kernel/2.6.15/80-nslu2-io.patch b/packages/linux/ixp4xx-kernel/2.6.15/80-nslu2-io.patch deleted file mode 100644 index a0921dffe5..0000000000 --- a/packages/linux/ixp4xx-kernel/2.6.15/80-nslu2-io.patch +++ /dev/null @@ -1,568 +0,0 @@ ---- linux-2.6.15/arch/arm/mach-ixp4xx/Makefile 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.15/arch/arm/mach-ixp4xx/Makefile 1970-01-01 00:00:00.000000000 +0000 -@@ -8,6 +8,6 @@ obj-$(CONFIG_ARCH_IXDP4XX) += ixdp425-pc - 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-power.o -+obj-$(CONFIG_MACH_NSLU2) += nslu2-pci.o nslu2-setup.o nslu2-power.o nslu2-io.o - obj-$(CONFIG_MACH_NAS100D) += nas100d-pci.o nas100d-setup.o nas100d-power.o - ---- /dev/null 2005-12-25 02:27:49.000000000 +1030 -+++ linux-2.6.15/arch/arm/mach-ixp4xx/nslu2-io.c 2006-01-15 04:11:10.000000000 +1030 -@@ -0,0 +1,555 @@ -+//============================================================================= -+// -+// n2-io.c version 0.1.7 -+// Author: Karen Spearel <kas11 at tampabay.rr.com> -+// please report problems/bugs directly to the address above -+// -+// Boilerplate to be added "real soon now"...it is and has always been GPL'ed per -+// MODULE_LICENSE but is offered without warrantee of any sort..use at your own risk -+// -+// NOTE: THIS IS INCOMPLETE. INCLUDED ONLY TO KEEP FROM BREAKING THE BUILD, -+// IT BEEPS AND SENDS A MESSAGE TO /proc/poweroff. EVENTUALLY IT -+// WILL TALK TO THE n2_pbd DAEMON. EVENTUALLY THE LED DRIVER -+// WILL TALK TO SOME USERLAND APP BUT ***NOT*** SET_LEDS. -+// -+//============================================================================= -+// GPIO Function State -+// 0 Red LED Status -+// 1 Green LED Ready = 1 -+// 2 Disk 2 LED On = 0 -+// 3 Disk 1 LED On = 0 -+// 4 Buzzer -+// 5 Power Button Pressed = 1 -+// 8 Power Down Output = 1 powers down NSLU2 -+// 12 Reset Pressed = 0 -+ -+#include <linux/config.h> -+#include <linux/version.h> -+#include <linux/module.h> -+#include <linux/kernel.h> -+#include <linux/proc_fs.h> -+#include <linux/device.h> -+#include <linux/reboot.h> -+ -+#include <asm/uaccess.h> -+#include <asm-arm/irq.h> -+#include <asm-arm/delay.h> -+ -+#include <asm/mach-types.h> -+ -+/* Set this to 1 to output lots of debug messages. */ -+#define NSLU2_IO_DEBUG 0 -+ -+#if NSLU2_IO_DEBUG -+#define nslu2_io_debug(args) printk args -+#else -+#define nslu2_io_debug(args) ((void)0) -+#endif -+ -+#define VERSION "0.1.7" -+ -+#define NSLU2BZ_MAJOR 62 //buzzer -+#define NSLU2LM_MAJOR 126 -+ -+ -+#define NSLU2_BEEP_DUR_LONG 2000 -+#define NSLU2_BEEP_DUR_MED 400 -+#define NSLU2_BEEP_DUR_SHORT 100 -+#define NSLU2_BEEP_PITCH_HIGH 250 -+#define NSLU2_BEEP_PITCH_MED 500 -+#define NSLU2_BEEP_PITCH_LOW 1000 -+#define NSLU2_LONG_DELAY 30000 -+ -+#define NSLU2_BZ_BM (1L << NSLU2_GPIO_BUZZ) -+ -+// ioctls -- 'M" is used for sound cards...we don't got one so it seems safe -+ -+#define NSLU2BZ_BEEP_STOP _IO('M',0) //stop multi-beep at end of audible -+#define NSLU2BZ_BEEP _IO('M',1) //one beep at current defaults -+#define NSLU2BZ_BEEPS _IOW('M',3,long) //param beeps at current defaults -+#define NSLU2BZ_TONESET _IOW('M',4,long) //set tone: range is high=250 to low=2000 -+#define NSLU2BZ_ONTIME _IOW('M',5,long) //ontime for multi-beeps in jiffies -+#define NSLU2BZ_SILENTTIME _IOW('M',6,long) //offtime for multi-beeps in jiffies -+#define NSLU2BZ_REPEATCNT _IOW('M',7,long) //number of repeats for multi-beeps 0 = forever -+#define NSLU2BZ_COMBINED _IOW('M',8,long) //combine all params in a long -+ -+#define NSLU2LM_OFF _IOW('M',32,long) -+#define NSLU2LM_ON _IOW('M',33,long) -+#define NSLU2LM_BLINK _IOW('M',34,long) -+#define NSLU2LM_ALT _IOW('M',35,long) -+#define NSLU2LM_ALL_ON _IO('M',36) -+#define NSLU2LM_ALL_OFF _IO('M',37) -+ -+#define PHYS_LEDS 4 -+#define BLINK_DELAY 25 -+ -+// OR Masks to turn these LEDs ON -+ -+#define RS_RED_ON 0x00000001 //0b0000 0000 0000 0010 -+#define RS_GRN_ON 0x00000002 //0b0000 0000 0000 0001 -+#define RS_YEL_ON 0x00000003 //0b0000 0000 0000 0011 -+ -+// AND Masks to turn these LEDs OFF -+ -+#define RS_RED_OFF 0xfffffffe //0b1111 1111 1111 1101 -+#define RS_GRN_OFF 0xfffffffd //0b1111 1111 1111 1110 -+#define RS_YEL_OFF 0xfffffffc //0b1111 1111 1111 1100 -+ -+// AND Masks to turn these LEDs ON -+ -+#define DISK1_ON 0xfffffff7 //0b1111 1111 1111 0111 -+#define DISK2_ON 0xfffffffb //0b1111 1111 1111 1011 -+ -+// Or Masks to turn these LEDs OFF -+ -+#define DISK1_OFF 0x00000008 //0b0000 0000 0000 1000 -+#define DISK2_OFF 0x00000004 //0b0000 0000 0000 0100 -+ -+// EOR masks for toggling LEDs on/off -+ -+#define RS_RG_ALT 0x00000003 //eor mask to toggle rs rg bits -+#define RS_GRN_TGL 0x00000002 -+#define RS_RED_TGL 0x00000001 -+#define DISK1_TGL 0x00000008 -+#define DISK2_TGL 0x00000004 -+ -+// The LED names for switches -+ -+#define LED_RS_RED 0 -+#define LED_RS_GRN 1 -+#define LED_DISK1 2 -+#define LED_DISK2 3 -+#define LED_ALL 4 -+ -+static unsigned long ontime = 50; -+static unsigned long offtime = 450; -+static unsigned long bz_repeatcnt = 10; -+static unsigned long tone = 1000; -+ -+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 n2bz_timer; //beeper -+ -+// sysfs class -+static struct class *n2lm_class; -+ -+//================================================================================================== -+// -+// Blinking is handled entirely by the 4 timer handlers. On timeout, the bit in the -+// GPIO output register is xor'd with a mask corresponding to the selected led which simply -+// flips that bit. No record of what any of the other leds is doing is needed. -+// -+//================================================================================================== -+// this blinks rs green or green/yellow if rs red is on -+#ifndef CONFIG_LEDS -+static void n2lm_rsg_handler(unsigned long data) -+{ -+ *IXP4XX_GPIO_GPOUTR ^= RS_GRN_TGL; //flip the led -+ n2lm_rsg_timer.expires = jiffies + BLINK_DELAY; //next timeout -+ add_timer(&n2lm_rsg_timer); //reinit timer -+ return; -+} -+ -+// this blinks or alternates rs red green... inited wit green on/red off -+static void n2lm_rsr_handler(unsigned long data) -+{ -+ *IXP4XX_GPIO_GPOUTR ^= n2lm_rsr_timer.data; -+ n2lm_rsr_timer.expires = jiffies + BLINK_DELAY; -+ add_timer(&n2lm_rsr_timer); -+ return; -+} -+// blinks disk 1 -+static void n2lm_d1_handler(unsigned long data) -+{ -+ *IXP4XX_GPIO_GPOUTR ^= DISK1_TGL; -+ n2lm_d1_timer.expires = jiffies + BLINK_DELAY; -+ add_timer(&n2lm_d1_timer); -+ return; -+} -+// blinks disk 2 -+static void n2lm_d2_handler(unsigned long data) -+{ -+ *IXP4XX_GPIO_GPOUTR ^= DISK2_TGL; -+ n2lm_d2_timer.expires = jiffies + BLINK_DELAY; -+ add_timer(&n2lm_d2_timer); -+ return; -+} -+ -+//================================================================================================== -+ -+static void n2lm_timer_start(unsigned long led) -+{ -+ -+ nslu2_io_debug((KERN_DEBUG "timer: %ld\n",led)); -+ -+ switch(led) { -+ case LED_RS_RED: -+ n2lm_rsr_timer.expires = jiffies + BLINK_DELAY; -+ add_timer(&n2lm_rsr_timer); -+ break; -+ -+ case LED_RS_GRN: -+ n2lm_rsg_timer.expires = jiffies + BLINK_DELAY; -+ add_timer(&n2lm_rsg_timer); -+ break; -+ -+ case LED_DISK1: -+ n2lm_d1_timer.expires = jiffies + BLINK_DELAY; -+ add_timer(&n2lm_d1_timer); -+ break; -+ -+ case LED_DISK2: -+ n2lm_d2_timer.expires = jiffies + BLINK_DELAY; -+ add_timer(&n2lm_d2_timer); -+ break; -+ -+ default: -+ break; -+ } -+ return; -+} -+ -+//================================================================================================== -+ -+static void n2lm_timer_stop(unsigned long led) -+{ -+ switch (led) { -+ case LED_RS_RED: -+ del_timer(&n2lm_rsr_timer); -+ break; -+ case LED_RS_GRN: -+ del_timer(&n2lm_rsg_timer); -+ break; -+ case LED_DISK1: -+ del_timer(&n2lm_d1_timer); -+ break; -+ case LED_DISK2: -+ del_timer(&n2lm_d2_timer); -+ break; -+ default: -+ break; -+ } -+ return; -+} -+ -+//-------------------------------------------------------------------------------------------------- -+ -+static void n2lm_timer_stop_all(void) -+{ -+ del_timer(&n2lm_rsg_timer); -+ del_timer(&n2lm_rsr_timer); -+ del_timer(&n2lm_d1_timer); -+ del_timer(&n2lm_d2_timer); -+ return; -+} -+//-------------------------------------------------------------------------------------------------- -+ -+static void n2lm_ledon(unsigned long led) -+{ -+ -+ nslu2_io_debug((KERN_DEBUG "ledon: %ld\n", led)); -+ -+ switch (led) { -+ case LED_RS_RED: -+ *IXP4XX_GPIO_GPOUTR |= RS_RED_ON; //1 -+ return; -+ case LED_RS_GRN: -+ *IXP4XX_GPIO_GPOUTR |= RS_GRN_ON; //2 -+ return; -+ case LED_DISK1: -+ *IXP4XX_GPIO_GPOUTR &= DISK1_ON; //0xfffffff7 -+ return; -+ case LED_DISK2: -+ *IXP4XX_GPIO_GPOUTR &= DISK2_ON; //0xfffffffb -+ return; -+ case LED_ALL: //all green -+ *IXP4XX_GPIO_GPOUTR |= RS_GRN_ON; -+ *IXP4XX_GPIO_GPOUTR &= (DISK1_ON & DISK2_ON); -+ return; -+ } -+} -+ -+//-------------------------------------------------------------------------------------------------- -+ -+static void n2lm_ledoff(unsigned long led) -+{ -+ -+ switch (led) { -+ case LED_RS_RED: -+ *IXP4XX_GPIO_GPOUTR &= RS_RED_OFF; //0xffffffffe -+ return; -+ case LED_RS_GRN: -+ *IXP4XX_GPIO_GPOUTR &= RS_GRN_OFF; //0xfffffffd -+ return; -+ case LED_DISK1: -+ *IXP4XX_GPIO_GPOUTR |= DISK1_OFF; //0x00000008 -+ return; -+ case LED_DISK2: -+ *IXP4XX_GPIO_GPOUTR |= DISK2_OFF; //0x00000004 -+ return; -+ case LED_ALL: -+ *IXP4XX_GPIO_GPOUTR &= (RS_GRN_OFF & RS_RED_OFF); -+ *IXP4XX_GPIO_GPOUTR |= (DISK1_OFF | DISK2_OFF); -+ } -+} -+ -+//================================================================================================== -+ -+static int n2lm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long led) -+{ -+ -+ nslu2_io_debug((KERN_DEBUG "cmd=%d, led=%ld\n", cmd, led)); -+ -+ if (led < 0 || led >= PHYS_LEDS) -+ return -EINVAL; -+ -+ switch (cmd ) { -+ case NSLU2LM_ON: -+ n2lm_timer_stop(led); -+ n2lm_ledon(led); -+ break; -+ -+ case NSLU2LM_OFF: -+ n2lm_timer_stop(led); -+ n2lm_ledoff(led); -+ break; -+ -+ case NSLU2LM_BLINK: -+ n2lm_ledon(led); -+ if (led == LED_RS_RED) -+ n2lm_rsr_timer.data = RS_RED_TGL; -+ n2lm_timer_start(led); -+ break; -+ -+ case NSLU2LM_ALT: -+ if (led == LED_RS_RED) -+ { -+ n2lm_ledon(LED_RS_GRN); -+ n2lm_ledoff(LED_RS_RED); -+ n2lm_rsr_timer.data = RS_RG_ALT; -+ n2lm_timer_start(LED_RS_RED); -+ break; -+ } else -+ return -EINVAL; -+ -+ case NSLU2LM_ALL_ON: -+ n2lm_timer_stop_all(); -+ n2lm_ledon(LED_ALL); -+ break; -+ -+ case NSLU2LM_ALL_OFF: -+ n2lm_timer_stop_all(); -+ n2lm_ledoff(LED_ALL); -+ break; -+ -+ default: -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+ -+static struct file_operations n2lm_fops = { -+ .owner = THIS_MODULE, -+ .ioctl = n2lm_ioctl, -+}; -+#endif -+//================================================================================================== -+// We can't do anything fancy here since the system tick rate is far below that required to -+// generate a desirable tone. Therefore we haven't much choice but to use a busy loop until -+// I get up to speed on the timers. The saving grace is that for the normal uses, nothing -+// important should be haprepening. -+//================================================================================================== -+ -+static void n2_buzz(int tone_delay, int duration) -+{ -+ int i; -+ -+ *IXP4XX_GPIO_GPOER &= ~NSLU2_BZ_BM; -+ -+ for (i = 1; i < duration; i++) { -+ *IXP4XX_GPIO_GPOUTR &= ~NSLU2_BZ_BM; -+ udelay(tone_delay); -+ *IXP4XX_GPIO_GPOUTR |= NSLU2_BZ_BM; -+ udelay(tone_delay); -+ } -+ *IXP4XX_GPIO_GPOER |= NSLU2_BZ_BM; -+ -+ return; -+} -+//================================================================================================= -+ -+// this handles the buzzer duty cycle -+static void n2bz_handler(unsigned long data) -+{ -+ if (--bz_repeatcnt > 0) { //if just one beep left to do -+ n2bz_timer.expires = jiffies + ontime + offtime; //next timeout -+ add_timer(&n2bz_timer); //reinit timer -+ } -+ n2_buzz(tone/2, ontime); -+ nslu2_io_debug((KERN_DEBUG "Count = %d\tOntime = %d\n", bz_repeatcnt, ontime)); -+ return; -+} -+ -+//================================================================================================== -+ -+static int n2bz_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long param) -+{ -+ switch (cmd) { -+ case NSLU2BZ_BEEP: -+ n2_buzz(tone/2, ontime); -+ break; -+ -+ case NSLU2BZ_BEEP_STOP: -+ del_timer(&n2bz_timer); -+ break; -+ -+ case NSLU2BZ_BEEPS: -+ if (param == 0) -+ bz_repeatcnt = 0xffffffff; -+ else -+ bz_repeatcnt = param; -+ n2bz_handler(0); -+ break; -+ -+ case NSLU2BZ_TONESET: -+ if (param >= 250 && param <= 2000) -+ tone = param; -+ break; -+ -+ case NSLU2BZ_ONTIME: -+ if (param > 4 && param < 201) -+ ontime = param; -+ break; -+ -+ case NSLU2BZ_SILENTTIME: -+ if (param > ontime) //enforce a reasonable duty cycle -+ offtime = param; -+ else -+ offtime = ontime; -+ break; -+ -+ case NSLU2BZ_REPEATCNT: -+ if (param == 0) -+ bz_repeatcnt = 0xffffffff; -+ else -+ bz_repeatcnt = param; -+ break; -+ -+ case NSLU2BZ_COMBINED: -+ bz_repeatcnt = (param & 0xF0000000) >> 28; //repeat 1 - 16 -+ ontime = (param & 0x0FF00000) >> 20; //ontime 1 - 256 jiffies -+ offtime = (param & 0x000FFF00) >> 8; //offtime 1 - 4095 jiffies -+ tone = (param & 0x000000FF) << 4; //tone (1 - 255) * 16 -+ break; -+ -+ default: -+ break; -+ } -+ return 0; -+} -+ -+static struct file_operations n2bz_fops = { -+ .owner = THIS_MODULE, -+ .ioctl = n2bz_ioctl, -+}; -+ -+static void n2iom_initarch(void) -+{ -+#ifndef CONFIG_LEDS -+ init_timer(&n2lm_rsg_timer); -+ init_timer(&n2lm_rsr_timer); -+ init_timer(&n2lm_d1_timer); -+ init_timer(&n2lm_d2_timer); -+ -+ n2lm_rsr_timer.function = n2lm_rsr_handler; -+ n2lm_rsg_timer.function = n2lm_rsg_handler; -+ n2lm_d2_timer.function = n2lm_d2_handler; -+ n2lm_d1_timer.function = n2lm_d1_handler; -+#endif -+ -+ init_timer(&n2bz_timer); -+ n2bz_timer.function = n2bz_handler; -+ -+ n2lm_rsr_timer.data = n2lm_rsg_timer.data = n2lm_d1_timer.data = n2lm_d2_timer.data = n2bz_timer.data = 0; -+ -+#ifndef CONFIG_LEDS -+ *IXP4XX_GPIO_GPOER &= 0xfffffff0; //enable gpio 0-3 -+ *IXP4XX_GPIO_GPOUTR |= 0x00000003; //turn off the leds -+ *IXP4XX_GPIO_GPOUTR &= 0xfffffffc; -+ n2lm_ledon(LED_ALL); -+ n2_buzz(NSLU2_BEEP_PITCH_MED, NSLU2_BEEP_DUR_SHORT); -+ n2lm_ledoff(LED_ALL); -+ -+ // Default the Ready/Status to Red during kernel boot, Turn Green at the end of sysvinit -+ n2lm_ledon(LED_RS_RED); -+#endif -+ -+ return; -+} -+ -+//================================================================================================== -+ -+static int __init n2iom_init(void) -+{ -+ if (!machine_is_nslu2()) -+ return 0; -+ -+ printk(KERN_INFO "NSLU2: i/o, %s\n", VERSION); -+ -+ n2iom_initarch(); -+ -+ n2lm_class = class_create(THIS_MODULE, "nslu2"); -+ -+#ifndef CONFIG_LEDS -+ if (register_chrdev(NSLU2LM_MAJOR, "n2_ledm", &n2lm_fops) < 0) { -+ printk(KERN_DEBUG "Led Manager Major %d not available\n", NSLU2LM_MAJOR); -+ return -EBUSY; -+ } -+ else { -+ class_device_create(n2lm_class, NULL, MKDEV(NSLU2LM_MAJOR, 0), NULL, "leds"); -+ } -+#endif -+ -+ if (register_chrdev(NSLU2BZ_MAJOR, "n2_bzm", &n2bz_fops) < 0) { -+ printk(KERN_DEBUG "Buzzer Major %d not available\n", NSLU2BZ_MAJOR); -+ return -EBUSY; -+ } -+ else { -+ class_device_create(n2lm_class, NULL, MKDEV(NSLU2BZ_MAJOR, 0), NULL, "buzzer"); -+ } -+ -+ return 0; -+} -+ -+//================================================================================================== -+ -+static void __exit n2iom_exit(void) -+{ -+ if (!machine_is_nslu2()) -+ return 0; -+ -+#ifndef CONFIG_LEDS -+ 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)); -+#endif -+ -+ unregister_chrdev(NSLU2BZ_MAJOR, "n2bz"); -+ class_device_destroy(n2lm_class, MKDEV(NSLU2BZ_MAJOR, 0)); -+ -+ class_destroy(n2lm_class); -+} -+ -+module_init(n2iom_init); -+module_exit(n2iom_exit); -+ -+MODULE_AUTHOR("Karen Spearel <kas11@tampabay.rr.com>"); -+MODULE_DESCRIPTION("NSLU2 I/O driver"); -+MODULE_LICENSE("GPL"); diff --git a/packages/linux/ixp4xx-kernel/2.6.15/81-nslu2-power.patch b/packages/linux/ixp4xx-kernel/2.6.15/81-nslu2-power.patch index ab8bdd8eae..7587058cb7 100644 --- a/packages/linux/ixp4xx-kernel/2.6.15/81-nslu2-power.patch +++ b/packages/linux/ixp4xx-kernel/2.6.15/81-nslu2-power.patch @@ -5,7 +5,7 @@ static void __exit nslu2_power_exit(void) { + if (!(machine_is_nslu2())) -+ return 0; ++ return; + free_irq(NSLU2_RB_IRQ, NULL); free_irq(NSLU2_PB_IRQ, NULL); diff --git a/packages/linux/ixp4xx-kernel/2.6.15/82-nas100d-power.patch b/packages/linux/ixp4xx-kernel/2.6.15/82-nas100d-power.patch index f02714beea..9a826efe2b 100644 --- a/packages/linux/ixp4xx-kernel/2.6.15/82-nas100d-power.patch +++ b/packages/linux/ixp4xx-kernel/2.6.15/82-nas100d-power.patch @@ -5,7 +5,7 @@ static void __exit nas100d_power_exit(void) { + if (!(machine_is_nas100d())) -+ return 0; ++ return; + free_irq(NAS100D_RB_IRQ, NULL); } diff --git a/packages/linux/ixp4xx-kernel/2.6.15/94-nslu2-setup.patch b/packages/linux/ixp4xx-kernel/2.6.15/94-nslu2-setup.patch index 55aad7c440..9f76499ef3 100644 --- a/packages/linux/ixp4xx-kernel/2.6.15/94-nslu2-setup.patch +++ b/packages/linux/ixp4xx-kernel/2.6.15/94-nslu2-setup.patch @@ -40,7 +40,7 @@ Signed-off-by: John Bowler <jbowler@acm.org> + */ +static char nslu2_command_line[] __initdata = + "root=/dev/mtdblock4 rootfstype=jffs2 init=/linuxrc " -+ "rtc-x1205.probe=0,0x6f rtc-x1205.hctosys=1 " ++ "rtc-x1205.probe=0,0x6f " + CONFIG_CMDLINE; + +static void __init nslu2_fixup(struct machine_desc *desc, diff --git a/packages/linux/ixp4xx-kernel/2.6.15/96-nas100d-leds.patch b/packages/linux/ixp4xx-kernel/2.6.15/96-nas100d-leds.patch index 7025b1ac20..d78a779127 100644 --- a/packages/linux/ixp4xx-kernel/2.6.15/96-nas100d-leds.patch +++ b/packages/linux/ixp4xx-kernel/2.6.15/96-nas100d-leds.patch @@ -49,15 +49,15 @@ Signed-off-by: John Bowler <jbowler@acm.org> static struct ixp4xx_i2c_pins nas100d_i2c_gpio_pins = { .sda_pin = NAS100D_SDA_PIN, .scl_pin = NAS100D_SCL_PIN, -@@ -106,7 +137,6 @@ static struct platform_device nas100d_rt +@@ -102,7 +133,6 @@ static struct platform_device nas100d_ua static struct platform_device *nas100d_devices[] __initdata = { &nas100d_i2c_controller, &nas100d_flash, - &nas100d_uart, - &nas100d_rtc, }; -@@ -163,7 +193,18 @@ static void __init nas100d_init(void) + static void nas100d_power_off(void) +@@ -158,7 +188,18 @@ static void __init nas100d_init(void) pm_power_off = nas100d_power_off; diff --git a/packages/linux/ixp4xx-kernel/2.6.15/defconfig b/packages/linux/ixp4xx-kernel/2.6.15/defconfig index 54fe2c613f..9f4896e659 100644 --- a/packages/linux/ixp4xx-kernel/2.6.15/defconfig +++ b/packages/linux/ixp4xx-kernel/2.6.15/defconfig @@ -940,7 +940,6 @@ CONFIG_IXP4XX_WATCHDOG=y # CONFIG_USBPCWATCHDOG is not set # CONFIG_NVRAM is not set # CONFIG_RTC is not set -CONFIG_RTC_PCF8563=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -1009,7 +1008,6 @@ CONFIG_SENSORS_EEPROM=y # CONFIG_SENSORS_RTC8564 is not set # CONFIG_SENSORS_MAX6875 is not set # CONFIG_RTC_X1205_I2C is not set -CONFIG_RTC_PCF8563_I2C=y # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set @@ -1420,6 +1418,8 @@ CONFIG_USB_EZUSB=y # Real Time Clock # CONFIG_RTC_CLASS=y +CONFIG_RTC_HCTOSYS=y +CONFIG_RTC_HCTOSYS_DEVICE="rtc0" # # RTC interfaces @@ -1433,6 +1433,7 @@ CONFIG_RTC_INTF_DEV=y # CONFIG_RTC_DRV_X1205=y CONFIG_RTC_DRV_DS1672=y +CONFIG_RTC_DRV_PCF8563=y # CONFIG_RTC_DRV_TEST is not set # @@ -1667,7 +1668,7 @@ CONFIG_CRYPTO_SERPENT=m CONFIG_CRYPTO_AES=m CONFIG_CRYPTO_CAST5=m CONFIG_CRYPTO_CAST6=m -CONFIG_CRYPTO_TEA=m +# CONFIG_CRYPTO_TEA is not set CONFIG_CRYPTO_ARC4=m CONFIG_CRYPTO_KHAZAD=m CONFIG_CRYPTO_ANUBIS=m diff --git a/packages/linux/ixp4xx-kernel_2.6.15.1.bb b/packages/linux/ixp4xx-kernel_2.6.15.1.bb index 8444052595..41d3101850 100644 --- a/packages/linux/ixp4xx-kernel_2.6.15.1.bb +++ b/packages/linux/ixp4xx-kernel_2.6.15.1.bb @@ -3,12 +3,12 @@ # Increment PR_CONFIG for changes to the ixp4xx-kernel specific # defconfig (do *NOT* increment anything in here for changes # to other kernel configs!) -PR_CONFIG = "2" +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 = "r10.${PR_CONFIG}" +PR = "r11.${PR_CONFIG}" include ixp4xx-kernel.inc @@ -33,10 +33,10 @@ IXP4XX_PATCHES += "file://40-rtc-class.patch;patch=1" IXP4XX_PATCHES += "file://45-eeprom-notifier.patch;patch=1" IXP4XX_PATCHES += "file://48-setup-byteswap-cmdline.patch;patch=1" IXP4XX_PATCHES += "file://50-nas100d-arch.patch;patch=1" -IXP4XX_PATCHES += "file://55-rtc-pcf8563.patch;patch=1" -IXP4XX_PATCHES += "file://60-nas100d-i2c.patch;patch=1" +# IXP4XX_PATCHES += "file://55-rtc-pcf8563.patch;patch=1" +# IXP4XX_PATCHES += "file://60-nas100d-i2c.patch;patch=1" # IXP4XX_PATCHES += "file://60-nas100d-ide.patch;patch=1" -IXP4XX_PATCHES += "file://60-nas100d-rtc.patch;patch=1" +# IXP4XX_PATCHES += "file://60-nas100d-rtc.patch;patch=1" IXP4XX_PATCHES += "file://60-nslu2-beeper.patch;patch=1" IXP4XX_PATCHES += "file://65-loft-config.patch;patch=1" IXP4XX_PATCHES += "file://81-nslu2-power.patch;patch=1" |