From 566c8bb147d8ba79662edcd755883793e0c945f5 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Wed, 31 Oct 2007 10:44:22 +0000 Subject: linux-rp: cleaned Tosa patches (my fault) --- .../linux/linux-rp-2.6.22/wm97xx-lcdnoise-r0.patch | 208 -- .../linux-rp-2.6.23/sharpsl-pm-postresume-r1.patch | 30 - .../linux/linux-rp-2.6.23/tmio-fb-r6-fix-r0.patch | 45 - packages/linux/linux-rp-2.6.23/tmio-nand-r8.patch | 594 ---- .../linux/linux-rp-2.6.23/tmio-tc6393-r8.patch | 800 ------ .../linux/linux-rp-2.6.23/tosa-bluetooth-r8.patch | 194 -- .../linux/linux-rp-2.6.23/tosa-keyboard-r19.patch | 514 ---- .../linux-rp-2.6.23/tosa-lcdnoise-r1-fix-r0.patch | 135 - .../linux/linux-rp-2.6.23/tosa-lcdnoise-r1.patch | 158 -- .../linux-rp-2.6.23/tosa-power-r18-fix-r0.patch | 59 - .../linux/linux-rp-2.6.23/tosa-power-r18.patch | 691 ----- .../linux-rp-2.6.23/tosa-pxaac97-r6-fix-r0.patch | 29 - .../linux-rp-2.6.23/tosa-tmio-lcd-r10-fix-r0.patch | 35 - .../linux/linux-rp-2.6.23/tosa-tmio-lcd-r10.patch | 464 ---- .../linux-rp-2.6.23/wm9712-reset-loop-r2.patch | 44 - .../wm9712-suspend-cold-res-r2.patch | 16 - .../linux/linux-rp-2.6.23/wm97xx-lcdnoise-r0.patch | 208 -- .../linux-rp-2.6.23/wm97xx-lg13-r0-fix-r0.patch | 128 - .../linux/linux-rp-2.6.23/wm97xx-lg13-r0.patch | 2899 -------------------- 19 files changed, 7251 deletions(-) delete mode 100644 packages/linux/linux-rp-2.6.22/wm97xx-lcdnoise-r0.patch delete mode 100644 packages/linux/linux-rp-2.6.23/wm97xx-lcdnoise-r0.patch diff --git a/packages/linux/linux-rp-2.6.22/wm97xx-lcdnoise-r0.patch b/packages/linux/linux-rp-2.6.22/wm97xx-lcdnoise-r0.patch deleted file mode 100644 index 191de3af22..0000000000 --- a/packages/linux/linux-rp-2.6.22/wm97xx-lcdnoise-r0.patch +++ /dev/null @@ -1,208 +0,0 @@ -Index: linux-tosa/drivers/input/touchscreen/wm9712.c -=================================================================== ---- linux-tosa.orig/drivers/input/touchscreen/wm9712.c 2006-08-29 16:52:36.008543280 +0100 -+++ linux-tosa/drivers/input/touchscreen/wm9712.c 2006-08-29 16:52:50.923275896 +0100 -@@ -1,7 +1,7 @@ - /* - * wm9712.c -- Codec driver for Wolfson WM9712 AC97 Codecs. - * -- * Copyright 2003, 2004, 2005 Wolfson Microelectronics PLC. -+ * Copyright 2003, 2004, 2005, 2006 Wolfson Microelectronics PLC. - * Author: Liam Girdwood - * liam.girdwood@wolfsonmicro.com or linux@wolfsonmicro.com - * Parts Copyright : Ian Molton -@@ -13,6 +13,12 @@ - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * -+ * Revision history -+ * 4th Jul 2005 Initial version. -+ * 29th Aug 2006 Mike Arthur -+ * Added fixes for Sharp SL-6000 (Tosa) LCD noise causing -+ * touchscreen interference. -+ * - */ - - #include -@@ -28,6 +34,10 @@ - #define WM9705_VERSION "0.60" - #define DEFAULT_PRESSURE 0xb0c0 - -+#define CCNT(a) asm volatile ("mrc p14, 0, %0, C1, C1, 0" : "=r"(a)) -+#define CCNT_ON() asm("mcr p14, 0, %0, C0, C0, 0" : : "r"(1)) -+#define CCNT_OFF() asm("mcr p14, 0, %0, C0, C0, 0" : : "r"(1)) -+ - /* - * Debug - */ -@@ -243,6 +253,36 @@ - return wm->dig[2] & WM9712_PDEN; - } - -+ -+#ifdef CONFIG_MACH_TOSA -+/* On the Sharp SL-6000 (Tosa), due to a noisy LCD, we need to perform a wait -+ * before sampling the Y axis of the touchscreen */ -+static inline void wm9712_lcd_sync_on(struct wm97xx* wm, int adcsel) { -+ unsigned long timer1 = 0, timer2 = 0, wait_time = 0; -+ if (adcsel == WM97XX_ADCSEL_Y) { -+ wait_time = wm97xx_calc_lcd_waittime(wm); -+ -+ CCNT_ON(); -+ -+ if (wait_time) { -+ /* wait for LCD rising edge */ -+ wm_machinfo->wait_hsync(); -+ /* get clock */ -+ CCNT(timer1); -+ CCNT(timer2); -+ -+ while ((timer2 - timer1) < wait_time) { -+ CCNT(timer2); -+ } -+ } -+ } -+} -+ -+static inline void wm9712_lcd_sync_off(void) { -+ CCNT_OFF(); -+} -+#endif -+ - /* - * Read a sample from the WM9712 adc in polling mode. - */ -@@ -260,6 +300,9 @@ - /* set up digitiser */ - if (adcsel & 0x8000) - adcsel = ((adcsel & 0x7fff) + 3) << 12; -+ #ifdef CONFIG_MACH_TOSA -+ wm9712_lcd_sync_on(wm, adcsel); -+ #endif - wm97xx_reg_write(wm, AC97_WM97XX_DIGITISER1, adcsel | WM97XX_POLL | WM97XX_DELAY(delay)); - - /* wait 3 AC97 time slots + delay for conversion */ -@@ -282,6 +325,10 @@ - - *sample = wm97xx_reg_read(wm, AC97_WM97XX_DIGITISER_RD); - -+ #ifdef CONFIG_MACH_TOSA -+ wm9712_lcd_sync_off(); -+ #endif -+ - /* check we have correct sample */ - if ((*sample & WM97XX_ADCSEL_MASK) != adcsel) { - dbg ("adc wrong sample, read %x got %x", adcsel, -@@ -303,11 +350,12 @@ - static int wm9712_poll_touch(struct wm97xx* wm, struct wm97xx_data *data) - { - int rc; -- - if ((rc = wm9712_poll_sample(wm, WM97XX_ADCSEL_X, &data->x)) != RC_VALID) - return rc; -+ - if ((rc = wm9712_poll_sample(wm, WM97XX_ADCSEL_Y, &data->y)) != RC_VALID) - return rc; -+ - if (pil && !five_wire) { - if ((rc = wm9712_poll_sample(wm, WM97XX_ADCSEL_PRES, &data->p)) != RC_VALID) - return rc; -Index: linux-tosa/drivers/input/touchscreen/wm97xx-core.c -=================================================================== ---- linux-tosa.orig/drivers/input/touchscreen/wm97xx-core.c 2006-08-29 16:52:36.008543280 +0100 -+++ linux-tosa/drivers/input/touchscreen/wm97xx-core.c 2006-08-29 16:52:50.924275744 +0100 -@@ -2,7 +2,7 @@ - * wm97xx-core.c -- Touch screen driver core for Wolfson WM9705, WM9712 - * and WM9713 AC97 Codecs. - * -- * Copyright 2003, 2004, 2005 Wolfson Microelectronics PLC. -+ * Copyright 2003, 2004, 2005, 2006 Wolfson Microelectronics PLC. - * Author: Liam Girdwood - * liam.girdwood@wolfsonmicro.com or linux@wolfsonmicro.com - * Parts Copyright : Ian Molton -@@ -67,6 +67,9 @@ - * GPIOs) and 2.6 power management. - * 29th Nov 2004 Added WM9713 support. - * 4th Jul 2005 Moved codec specific code out to seperate files. -+ * 29th Aug 2006 Mike Arthur -+ * Added fixes for Sharp SL-6000 (Tosa) LCD noise causing -+ * touchscreen interference. - */ - - #include -@@ -94,6 +97,7 @@ - static DECLARE_MUTEX(gpio_sem); - static LIST_HEAD(wm97xx_misc_list); - static struct wm97xx* wm_codec = NULL; -+struct wm97xx_machinfo *wm_machinfo; - - /* - * WM97xx - enable/disable AUX ADC sysfs -@@ -832,6 +836,23 @@ - mdev->remove(wm_codec); - } - -+#ifdef CONFIG_MACH_TOSA -+/* On the Sharp SL-6000 (Tosa), due to a noisy LCD, we need to perform a wait -+ * before sampling the Y axis of the touchscreen */ -+unsigned long wm97xx_calc_lcd_waittime(struct wm97xx *wm) { -+ unsigned long hsync_time = wm_machinfo->get_hsync_time(); -+ return hsync_time; -+} -+ -+void wm97xx_set_machinfo(struct wm97xx_machinfo *machinfo) { -+ wm_machinfo = machinfo; -+} -+ -+void wm97xx_unset_machinfo() { -+ wm_machinfo = NULL; -+} -+#endif -+ - static struct device_driver wm97xx_driver = { - .name = "ac97", - .bus = &ac97_bus_type, -@@ -861,6 +882,9 @@ - EXPORT_SYMBOL_GPL(wm97xx_reg_write); - EXPORT_SYMBOL_GPL(wm97xx_register_misc_dev); - EXPORT_SYMBOL_GPL(wm97xx_unregister_misc_dev); -+EXPORT_SYMBOL_GPL(wm97xx_calc_lcd_waittime); -+EXPORT_SYMBOL_GPL(wm97xx_set_machinfo); -+EXPORT_SYMBOL_GPL(wm97xx_unset_machinfo); - - module_init(wm97xx_init); - module_exit(wm97xx_exit); -Index: linux-tosa/include/linux/wm97xx.h -=================================================================== ---- linux-tosa.orig/include/linux/wm97xx.h 2006-08-29 16:52:36.008543280 +0100 -+++ linux-tosa/include/linux/wm97xx.h 2006-08-29 16:52:50.924275744 +0100 -@@ -207,6 +207,7 @@ - - struct wm97xx; - extern struct wm97xx_codec_drv wm97xx_codec; -+extern struct wm97xx_machinfo *wm_machinfo; - - /* - * Codec driver interface - allows mapping to WM9705/12/13 and newer codecs -@@ -253,6 +254,11 @@ - struct list_head list; - }; - -+struct wm97xx_machinfo { -+ unsigned long (*get_hsync_time)(void); -+ void (*wait_hsync)(void); -+}; -+ - int wm97xx_register_misc_dev(struct wm97xx_misc_dev* mdev); - void wm97xx_unregister_misc_dev(struct wm97xx_misc_dev* mdev); - -@@ -281,4 +287,9 @@ - int wm97xx_acc_startup(struct wm97xx* wm); - void wm97xx_acc_shutdown(struct wm97xx* wm); - -+ -+unsigned long wm97xx_calc_lcd_waittime(struct wm97xx *wm); -+void wm97xx_set_machinfo(struct wm97xx_machinfo *machinfo); -+void wm97xx_unset_machinfo(void); -+ - #endif diff --git a/packages/linux/linux-rp-2.6.23/sharpsl-pm-postresume-r1.patch b/packages/linux/linux-rp-2.6.23/sharpsl-pm-postresume-r1.patch index e1491d6d49..409daf03e6 100644 --- a/packages/linux/linux-rp-2.6.23/sharpsl-pm-postresume-r1.patch +++ b/packages/linux/linux-rp-2.6.23/sharpsl-pm-postresume-r1.patch @@ -22,36 +22,6 @@ Index: git/arch/arm/common/sharpsl_pm.c if (sharpsl_pm.machinfo->earlyresume) sharpsl_pm.machinfo->earlyresume(); -+ if (sharpsl_pm.machinfo->postresume) -+ sharpsl_pm.machinfo->postresume(); -+ - dev_dbg(sharpsl_pm.dev, "SharpSL resuming...\n"); - - return 0; - arch/arm/common/sharpsl_pm.c | 3 +++ - include/asm-arm/hardware/sharpsl_pm.h | 1 + - 2 files changed, 4 insertions(+) - -Index: git/include/asm-arm/hardware/sharpsl_pm.h -=================================================================== ---- git.orig/include/asm-arm/hardware/sharpsl_pm.h 2006-10-31 16:09:33.000000000 +0000 -+++ git/include/asm-arm/hardware/sharpsl_pm.h 2006-11-07 22:08:41.000000000 +0000 -@@ -26,6 +26,7 @@ struct sharpsl_charger_machinfo { - void (*presuspend)(void); - void (*postsuspend)(void); - void (*earlyresume)(void); -+ void (*postresume)(void); - unsigned long (*read_devdata)(int); - #define SHARPSL_BATT_VOLT 1 - #define SHARPSL_BATT_TEMP 2 -Index: git/arch/arm/common/sharpsl_pm.c -=================================================================== ---- git.orig/arch/arm/common/sharpsl_pm.c 2006-11-07 22:03:48.000000000 +0000 -+++ git/arch/arm/common/sharpsl_pm.c 2006-11-07 22:04:20.000000000 +0000 -@@ -584,6 +584,9 @@ static int corgi_pxa_pm_enter(suspend_st - if (sharpsl_pm.machinfo->earlyresume) - sharpsl_pm.machinfo->earlyresume(); - + if (sharpsl_pm.machinfo->postresume) + sharpsl_pm.machinfo->postresume(); + diff --git a/packages/linux/linux-rp-2.6.23/tmio-fb-r6-fix-r0.patch b/packages/linux/linux-rp-2.6.23/tmio-fb-r6-fix-r0.patch index 523edec381..eab57c50e8 100644 --- a/packages/linux/linux-rp-2.6.23/tmio-fb-r6-fix-r0.patch +++ b/packages/linux/linux-rp-2.6.23/tmio-fb-r6-fix-r0.patch @@ -43,48 +43,3 @@ index 10b0105..72eb76c 100644 -- 1.4.4.4 -From 302745ce6f3bab7b1a97de32339405ae3fd8eacb Mon Sep 17 00:00:00 2001 -From: Dmitry Baryshkov -Date: Fri, 19 Oct 2007 00:05:54 +0400 -Subject: [PATCH] tmio-fb-r6.patch fixes - ---- - drivers/video/tmiofb.c | 8 ++++---- - 1 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/drivers/video/tmiofb.c b/drivers/video/tmiofb.c -index 10b0105..72eb76c 100644 ---- a/drivers/video/tmiofb.c -+++ b/drivers/video/tmiofb.c -@@ -463,8 +463,8 @@ static int tmiofb_vblank (struct fb_info *fbi, struct fb_vblank *vblank) - #define FBIO_TMIO_ACC_WRITE 0x7C639300 - #define FBIO_TMIO_ACC_SYNC 0x7C639301 - --static int tmiofb_ioctl (struct inode *inode, struct file *file, -- unsigned int cmd, unsigned long arg, struct fb_info *fbi) -+static int tmiofb_ioctl (struct fb_info *fbi, -+ unsigned int cmd, unsigned long arg) - { - switch (cmd) { - case FBIOGET_VBLANK: { -@@ -677,7 +677,7 @@ static struct fb_ops tmiofb_ops_acc = { - * 2000 0002 display start - * 2000 0004 line number match (0x1ff mask???) - */ --static irqreturn_t tmiofb_irq (int irq, void *__fbi, struct pt_regs *r) -+static irqreturn_t tmiofb_irq (int irq, void *__fbi) - { - struct fb_info* fbi = __fbi; - struct tmiofb_par* par = fbi->par; -@@ -762,7 +762,7 @@ static int __init tmiofb_probe (struct device *dev) - } - fbi->screen_base = par->sram; - -- retval = request_irq (irq->start, &tmiofb_irq, SA_INTERRUPT, -+ retval = request_irq (irq->start, &tmiofb_irq, IRQF_DISABLED, - TMIO_NAME_LCD, fbi); - if (retval) - goto err_request_irq; --- -1.4.4.4 - diff --git a/packages/linux/linux-rp-2.6.23/tmio-nand-r8.patch b/packages/linux/linux-rp-2.6.23/tmio-nand-r8.patch index 3a30c2f34c..a71fd114a8 100644 --- a/packages/linux/linux-rp-2.6.23/tmio-nand-r8.patch +++ b/packages/linux/linux-rp-2.6.23/tmio-nand-r8.patch @@ -592,597 +592,3 @@ index 0000000..d196553 +MODULE_LICENSE ("GPL"); +MODULE_AUTHOR ("Dirk Opfer, Chris Humbert"); +MODULE_DESCRIPTION ("NAND flash driver on Toshiba Mobile IO controller"); - drivers/mtd/nand/Kconfig | 7 + - drivers/mtd/nand/Makefile | 1 + - drivers/mtd/nand/tmio.c | 554 +++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 562 insertions(+), 0 deletions(-) - -diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig -index f1d60b6..b9c8796 100644 ---- a/drivers/mtd/nand/Kconfig -+++ b/drivers/mtd/nand/Kconfig -@@ -69,6 +69,13 @@ config MTD_NAND_AMS_DELTA - help - Support for NAND flash on Amstrad E3 (Delta). - -+config MTD_NAND_TMIO -+ tristate "NAND Flash device on Toshiba Mobile IO Controller" -+ depends on MTD_NAND && TOSHIBA_TC6393XB -+ help -+ Support for NAND flash connected to a Toshiba Mobile IO -+ Controller in some PDAs, including the Sharp SL6000x. -+ - config MTD_NAND_TOTO - tristate "NAND Flash device on TOTO board" - depends on ARCH_OMAP && BROKEN -diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile -index edba1db..64f24e1 100644 ---- a/drivers/mtd/nand/Makefile -+++ b/drivers/mtd/nand/Makefile -@@ -27,5 +27,6 @@ obj-$(CONFIG_MTD_NAND_AT91) += at91_nand.o - obj-$(CONFIG_MTD_NAND_CM_X270) += cmx270_nand.o - obj-$(CONFIG_MTD_NAND_BASLER_EXCITE) += excite_nandflash.o - obj-$(CONFIG_MTD_NAND_PLATFORM) += plat_nand.o -+obj-$(CONFIG_MTD_NAND_TMIO) += tmio.o - - nand-objs := nand_base.o nand_bbt.o -diff --git a/drivers/mtd/nand/tmio.c b/drivers/mtd/nand/tmio.c -new file mode 100644 -index 0000000..d196553 ---- /dev/null -+++ b/drivers/mtd/nand/tmio.c -@@ -0,0 +1,554 @@ -+/* -+ * A device driver for NAND flash connected to a Toshiba Mobile IO -+ * controller. This is known to work with the following variants: -+ * TC6393XB revision 3 -+ * -+ * Maintainer: Chris Humbert -+ * -+ * Copyright (C) 2005 Chris Humbert -+ * Copyright (C) 2005 Dirk Opfer -+ * Copyright (C) 2004 SHARP -+ * Copyright (C) 2002 Lineo Japan, Inc. -+ * Copyright (C) Ian Molton and Sebastian Carlier -+ * -+ * Based on Sharp's NAND driver, sharp_sl_tc6393.c -+ * -+ * 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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#define mtd_printk(level, mtd, format, arg...) \ -+ printk (level "%s: " format, mtd->name, ## arg) -+#define mtd_warn(mtd, format, arg...) \ -+ mtd_printk (KERN_WARNING, mtd, format, ## arg) -+ -+/*--------------------------------------------------------------------------*/ -+ -+/* tmio_nfcr.mode Register Command List */ -+#define FCR_MODE_DATA 0x94 // Data Data_Mode -+#define FCR_MODE_COMMAND 0x95 // Data Command_Mode -+#define FCR_MODE_ADDRESS 0x96 // Data Address_Mode -+ -+#define FCR_MODE_HWECC_CALC 0xB4 // HW-ECC Data -+#define FCR_MODE_HWECC_RESULT 0xD4 // HW-ECC Calculation Result Read_Mode -+#define FCR_MODE_HWECC_RESET 0xF4 // HW-ECC Reset -+ -+#define FCR_MODE_POWER_ON 0x0C // Power Supply ON to SSFDC card -+#define FCR_MODE_POWER_OFF 0x08 // Power Supply OFF to SSFDC card -+ -+#define FCR_MODE_LED_OFF 0x00 // LED OFF -+#define FCR_MODE_LED_ON 0x04 // LED ON -+ -+#define FCR_MODE_EJECT_ON 0x68 // Ejection Demand from Penguin is Advanced -+#define FCR_MODE_EJECT_OFF 0x08 // Ejection Demand from Penguin is Not Advanced -+ -+#define FCR_MODE_LOCK 0x6C // Operates By Lock_Mode. Ejection Switch is Invalid -+#define FCR_MODE_UNLOCK 0x0C // Operates By UnLock_Mode.Ejection Switch is Effective -+ -+#define FCR_MODE_CONTROLLER_ID 0x40 // Controller ID Read -+#define FCR_MODE_STANDBY 0x00 // SSFDC card Changes Standby State -+ -+#define FCR_MODE_WE 0x80 -+#define FCR_MODE_ECC1 0x40 -+#define FCR_MODE_ECC0 0x20 -+#define FCR_MODE_CE 0x10 -+#define FCR_MODE_PCNT1 0x08 -+#define FCR_MODE_PCNT0 0x04 -+#define FCR_MODE_ALE 0x02 -+#define FCR_MODE_CLE 0x01 -+ -+#define FCR_STATUS_BUSY 0x80 -+ -+/* -+ * NAND Flash Host Controller Configuration Register -+ */ -+struct tmio_nfhccr { -+ u8 x00[4]; -+ u16 command; /* 0x04 Command */ -+ u8 x01[0x0a]; -+ u16 base[2]; /* 0x10 NAND Flash Control Reg Base Addr*/ -+ u8 x02[0x29]; -+ u8 intp; /* 0x3d Interrupt Pin */ -+ u8 x03[0x0a]; -+ u8 inte; /* 0x48 Interrupt Enable */ -+ u8 x04; -+ u8 ec; /* 0x4a Event Control */ -+ u8 x05; -+ u8 icc; /* 0x4c Internal Clock Control */ -+ u8 x06[0x0e]; -+ u8 eccc; /* 0x5b ECC Control */ -+ u8 x07[4]; -+ u8 nftc; /* 0x60 NAND Flash Transaction Control */ -+ u8 nfm; /* 0x61 NAND Flash Monitor */ -+ u8 nfpsc; /* 0x62 NAND Flash Power Supply Control */ -+ u8 nfdc; /* 0x63 NAND Flash Detect Control */ -+ u8 x08[0x9c]; -+} __attribute__ ((packed)); -+ -+/* -+ * NAND Flash Control Register -+ */ -+struct tmio_nfcr { -+union { -+ u8 u8; /* 0x00 Data Register */ -+ u16 u16; -+ u32 u32; -+} __attribute__ ((packed)); -+ u8 mode; /* 0x04 Mode Register */ -+ u8 status; /* 0x05 Status Register */ -+ u8 isr; /* 0x06 Interrupt Status Register */ -+ u8 imr; /* 0x07 Interrupt Mask Register */ -+} __attribute__ ((packed)); -+ -+struct tmio_nand { -+ struct mtd_info mtd; -+ struct nand_chip chip; -+ -+ struct tmio_nfhccr __iomem * ccr; -+ struct tmio_nfcr __iomem * fcr; -+ -+ unsigned int irq; -+ -+ /* for tmio_nand_read_byte */ -+ u8 read; -+ unsigned read_good:1; -+}; -+ -+#define mtd_to_tmio(m) container_of(m, struct tmio_nand, mtd) -+ -+/*--------------------------------------------------------------------------*/ -+ -+static void tmio_nand_hwcontrol(struct mtd_info *mtd, int cmd, -+ unsigned int ctrl) -+{ -+ struct tmio_nand *tmio = mtd_to_tmio (mtd); -+ struct tmio_nfcr __iomem *fcr = tmio->fcr; -+ struct nand_chip *chip = mtd->priv; -+ -+ if (ctrl & NAND_CTRL_CHANGE) { -+ u8 mode; -+ -+ if (ctrl & NAND_NCE) { -+ mode = FCR_MODE_DATA; -+ -+ if (ctrl & NAND_CLE) -+ mode |= FCR_MODE_CLE; -+ else -+ mode &= ~FCR_MODE_CLE; -+ -+ if (ctrl & NAND_ALE) -+ mode |= FCR_MODE_ALE; -+ else -+ mode &= ~FCR_MODE_ALE; -+ } else { -+ mode = FCR_MODE_STANDBY; -+ } -+ -+ iowrite8 (mode, &fcr->mode); -+ tmio->read_good = 0; -+ } -+ -+ if (cmd != NAND_CMD_NONE) -+ writeb(cmd, chip->IO_ADDR_W); -+} -+ -+static int tmio_nand_dev_ready (struct mtd_info* mtd) -+{ -+ struct tmio_nand* tmio = mtd_to_tmio (mtd); -+ struct tmio_nfcr __iomem * fcr = tmio->fcr; -+ -+ return !(ioread8 (&fcr->status) & FCR_STATUS_BUSY); -+} -+ -+static irqreturn_t tmio_irq (int irq, void *__tmio) -+{ -+ struct tmio_nand* tmio = __tmio; -+ struct nand_chip* this = &tmio->chip; -+ struct tmio_nfcr __iomem * fcr = tmio->fcr; -+ -+ /* disable RDYREQ interrupt */ -+ iowrite8 (0x00, &fcr->imr); -+ -+ if (unlikely (!waitqueue_active (&this->controller->wq))) -+ printk (KERN_WARNING TMIO_NAME_NAND ": spurious interrupt\n"); -+ -+ wake_up (&this->controller->wq); -+ return IRQ_HANDLED; -+} -+ -+/* -+ * The TMIO core has a RDYREQ interrupt on the posedge of #SMRB. -+ * This interrupt is normally disabled, but for long operations like -+ * erase and write, we enable it to wake us up. The irq handler -+ * disables the interrupt. -+ */ -+static int -+tmio_nand_wait (struct mtd_info *mtd, struct nand_chip *this) -+{ -+ struct tmio_nand* tmio = mtd_to_tmio (mtd); -+ struct tmio_nfcr __iomem * fcr = tmio->fcr; -+ long timeout; -+ -+ /* enable RDYREQ interrupt */ -+ iowrite8 (0x0f, &fcr->isr); -+ iowrite8 (0x81, &fcr->imr); -+ -+ timeout = wait_event_timeout (this->controller->wq, tmio_nand_dev_ready (mtd), -+ msecs_to_jiffies (this->state == FL_ERASING ? 400 : 20)); -+ -+ if (unlikely (!tmio_nand_dev_ready (mtd))) { -+ iowrite8 (0x00, &fcr->imr); -+ mtd_warn (mtd, "still busy with %s after %d ms\n", -+ this->state == FL_ERASING ? "erase" : "program", -+ this->state == FL_ERASING ? 400 : 20); -+ -+ } else if (unlikely (!timeout)) { -+ iowrite8 (0x00, &fcr->imr); -+ mtd_warn (mtd, "timeout waiting for interrupt\n"); -+ } -+ -+ this->cmdfunc (mtd, NAND_CMD_STATUS, -1, -1); -+ return this->read_byte (mtd); -+} -+ -+/* -+ * The TMIO controller combines two 8-bit data bytes into one 16-bit -+ * word. This function separates them so nand_base.c works as expected, -+ * especially its NAND_CMD_READID routines. -+ * -+ * To prevent stale data from being read, tmio_nand_hwcontrol() clears -+ * tmio->read_good. -+ */ -+static u_char tmio_nand_read_byte (struct mtd_info *mtd) -+{ -+ struct tmio_nand* tmio = mtd_to_tmio (mtd); -+ struct tmio_nfcr __iomem * fcr = tmio->fcr; -+ unsigned int data; -+ -+ if (tmio->read_good--) -+ return tmio->read; -+ -+ data = ioread16 (&fcr->u16); -+ tmio->read = data >> 8; -+ return data; -+} -+ -+/* -+ * The TMIO controller converts an 8-bit NAND interface to a 16-bit -+ * bus interface, so all data reads and writes must be 16-bit wide. -+ * Thus, we implement 16-bit versions of the read, write, and verify -+ * buffer functions. -+ */ -+static void -+tmio_nand_write_buf (struct mtd_info *mtd, const u_char *buf, int len) -+{ -+ struct tmio_nand* tmio = mtd_to_tmio (mtd); -+ struct tmio_nfcr __iomem * fcr = tmio->fcr; -+ -+ iowrite16_rep (&fcr->u16, buf, len >> 1); -+} -+ -+static void tmio_nand_read_buf (struct mtd_info *mtd, u_char *buf, int len) -+{ -+ struct tmio_nand* tmio = mtd_to_tmio (mtd); -+ struct tmio_nfcr __iomem * fcr = tmio->fcr; -+ -+ ioread16_rep (&fcr->u16, buf, len >> 1); -+} -+ -+static int -+tmio_nand_verify_buf (struct mtd_info *mtd, const u_char *buf, int len) -+{ -+ struct tmio_nand* tmio = mtd_to_tmio (mtd); -+ struct tmio_nfcr __iomem * fcr = tmio->fcr; -+ u16* p = (u16*) buf; -+ -+ for (len >>= 1; len; len--) -+ if (*(p++) != ioread16 (&fcr->u16)) -+ return -EFAULT; -+ return 0; -+} -+ -+static void tmio_nand_enable_hwecc (struct mtd_info* mtd, int mode) -+{ -+ struct tmio_nand* tmio = mtd_to_tmio (mtd); -+ struct tmio_nfcr __iomem * fcr = tmio->fcr; -+ -+ iowrite8 (FCR_MODE_HWECC_RESET, &fcr->mode); -+ ioread8 (&fcr->u8); /* dummy read */ -+ iowrite8 (FCR_MODE_HWECC_CALC, &fcr->mode); -+} -+ -+static int tmio_nand_calculate_ecc (struct mtd_info* mtd, const u_char* dat, -+ u_char* ecc_code) -+{ -+ struct tmio_nand* tmio = mtd_to_tmio (mtd); -+ struct tmio_nfcr __iomem * fcr = tmio->fcr; -+ unsigned int ecc; -+ -+ iowrite8 (FCR_MODE_HWECC_RESULT, &fcr->mode); -+ -+ ecc = ioread16 (&fcr->u16); -+ ecc_code[1] = ecc; // 000-255 LP7-0 -+ ecc_code[0] = ecc >> 8; // 000-255 LP15-8 -+ ecc = ioread16 (&fcr->u16); -+ ecc_code[2] = ecc; // 000-255 CP5-0,11b -+ ecc_code[4] = ecc >> 8; // 256-511 LP7-0 -+ ecc = ioread16 (&fcr->u16); -+ ecc_code[3] = ecc; // 256-511 LP15-8 -+ ecc_code[5] = ecc >> 8; // 256-511 CP5-0,11b -+ -+ iowrite8 (FCR_MODE_DATA, &fcr->mode); -+ return 0; -+} -+ -+static void tmio_hw_init (struct device *dev, struct tmio_nand *tmio) -+{ -+ struct resource* nfcr = tmio_resource_control (dev); -+ struct tmio_device* tdev = dev_to_tdev (dev); -+ struct tmio_nfhccr __iomem * ccr = tmio->ccr; -+ struct tmio_nfcr __iomem * fcr = tmio->fcr; -+ unsigned long base; -+ -+ /* (89h) SMD Buffer ON By TC6393XB SystemConfig gpibfc1 */ -+ tdev->ops->clock (dev, 1); -+ tdev->ops->function (dev, 1); -+ -+ /* (4Ch) CLKRUN Enable 1st spcrunc */ -+ iowrite8 (0x81, &ccr->icc); -+ -+ /* (10h)BaseAddress 0x1000 spba.spba2 */ -+ base = nfcr->start - tdev->iomem->start; -+ iowrite16 (base, ccr->base + 0); -+ iowrite16 (base >> 16, ccr->base + 1); -+ -+ /* (04h)Command Register I/O spcmd */ -+ iowrite8 (0x02, &ccr->command); -+ -+ /* (62h) Power Supply Control ssmpwc */ -+ /* HardPowerOFF - SuspendOFF - PowerSupplyWait_4MS */ -+ iowrite8 (0x02, &ccr->nfpsc); -+ -+ /* (63h) Detect Control ssmdtc */ -+ iowrite8 (0x02, &ccr->nfdc); -+ -+ /* Interrupt status register clear sintst */ -+ iowrite8 (0x0f, &fcr->isr); -+ -+ /* After power supply, Media are reset smode */ -+ iowrite8 (FCR_MODE_POWER_ON, &fcr->mode); -+ iowrite8 (FCR_MODE_COMMAND, &fcr->mode); -+ iowrite8 (NAND_CMD_RESET, &fcr->u8); -+ -+ /* Standby Mode smode */ -+ iowrite8 (FCR_MODE_STANDBY, &fcr->mode); -+ -+ mdelay (5); -+} -+ -+static void tmio_hw_stop (struct device *dev, struct tmio_nand *tmio) -+{ -+ struct tmio_device* tdev = dev_to_tdev (dev); -+ struct tmio_nfcr __iomem * fcr = tmio->fcr; -+ -+ iowrite8 (FCR_MODE_POWER_OFF, &fcr->mode); -+ tdev->ops->function (dev, 0); -+ tdev->ops->clock (dev, 0); -+} -+ -+/*--------------------------------------------------------------------------*/ -+ -+#ifdef CONFIG_MTD_PARTITIONS -+static const char *part_probes[] = { "cmdlinepart", NULL }; -+#endif -+ -+static int tmio_probe (struct device *dev) -+{ -+ struct tmio_device* tdev = dev_to_tdev (dev); -+ struct tmio_nand_platform_data* tnpd = dev->platform_data; -+ struct resource* ccr = tmio_resource_config (dev); -+ struct resource* fcr = tmio_resource_control (dev); -+ struct resource* irq = tmio_resource_irq (dev); -+ struct tmio_nand* tmio; -+ struct mtd_info* mtd; -+ struct nand_chip* this; -+ struct mtd_partition* parts; -+ int nbparts = 0; -+ int retval; -+ -+ if (!tnpd) -+ return -EINVAL; -+ -+ retval = request_resource (tdev->iomem, ccr); -+ if (retval) -+ goto err_request_ccr; -+ -+ retval = request_resource (tdev->iomem, fcr); -+ if (retval) -+ goto err_request_fcr; -+ -+ tmio = kzalloc (sizeof *tmio, GFP_KERNEL); -+ if (!tmio) { -+ retval = -ENOMEM; -+ goto err_kzalloc; -+ } -+ -+ dev_set_drvdata (dev, tmio); -+ mtd = &tmio->mtd; -+ this = &tmio->chip; -+ mtd->priv = this; -+ mtd->name = TMIO_NAME_NAND; -+ -+ tmio->ccr = ioremap (ccr->start, ccr->end - ccr->start + 1); -+ if (!tmio->ccr) { -+ retval = -EIO; -+ goto err_iomap_ccr; -+ } -+ -+ tmio->fcr = ioremap (fcr->start, fcr->end - fcr->start + 1); -+ if (!tmio->fcr) { -+ retval = -EIO; -+ goto err_iomap_fcr; -+ } -+ -+ tmio_hw_init (dev, tmio); -+ -+ /* Set address of NAND IO lines */ -+ this->IO_ADDR_R = tmio->fcr; -+ this->IO_ADDR_W = tmio->fcr; -+ -+ /* Set address of hardware control function */ -+ this->cmd_ctrl = tmio_nand_hwcontrol; -+ this->dev_ready = tmio_nand_dev_ready; -+ this->read_byte = tmio_nand_read_byte; -+ this->write_buf = tmio_nand_write_buf; -+ this->read_buf = tmio_nand_read_buf; -+ this->verify_buf = tmio_nand_verify_buf; -+ -+ /* set eccmode using hardware ECC */ -+ this->ecc.mode = NAND_ECC_HW; -+ this->ecc.size = 512; -+ this->ecc.bytes = 6; -+ this->ecc.hwctl = tmio_nand_enable_hwecc; -+ this->ecc.calculate = tmio_nand_calculate_ecc; -+ this->ecc.correct = nand_correct_data; -+ this->badblock_pattern = tnpd->badblock_pattern; -+ -+ /* 15 us command delay time */ -+ this->chip_delay = 15; -+ -+ if (irq->start) { -+ retval = request_irq (irq->start, &tmio_irq, -+ IRQF_DISABLED, irq->name, tmio); -+ if (!retval) { -+ tmio->irq = irq->start; -+ this->waitfunc = tmio_nand_wait; -+ } else -+ mtd_warn (mtd, "request_irq error %d\n", retval); -+ } -+ -+ /* Scan to find existence of the device */ -+ if (nand_scan (mtd, 1)) { -+ retval = -ENODEV; -+ goto err_scan; -+ } -+ -+ /* Register the partitions */ -+#ifdef CONFIG_MTD_PARTITIONS -+ nbparts = parse_mtd_partitions (mtd, part_probes, &parts, 0); -+#endif -+ if (nbparts <= 0) { -+ parts = tnpd->partition; -+ nbparts = tnpd->num_partitions; -+ } -+ -+ add_mtd_partitions (mtd, parts, nbparts); -+ return 0; -+ -+err_scan: -+ if (tmio->irq) -+ free_irq (tmio->irq, tmio); -+ tmio_hw_stop (dev, tmio); -+ iounmap (tmio->fcr); -+err_iomap_fcr: -+ iounmap (tmio->ccr); -+err_iomap_ccr: -+ kfree (tmio); -+err_kzalloc: -+ release_resource (fcr); -+err_request_fcr: -+ release_resource (ccr); -+err_request_ccr: -+ return retval; -+} -+ -+static int tmio_remove (struct device *dev) -+{ -+ struct tmio_nand* tmio = dev_get_drvdata (dev); -+ -+ nand_release (&tmio->mtd); -+ if (tmio->irq) -+ free_irq (tmio->irq, tmio); -+ tmio_hw_stop (dev, tmio); -+ iounmap (tmio->fcr); -+ iounmap (tmio->ccr); -+ kfree (tmio); -+ release_resource (tmio_resource_control (dev)); -+ release_resource (tmio_resource_config (dev)); -+ return 0; -+} -+ -+#ifdef CONFIG_PM -+static int tmio_suspend (struct device *dev, pm_message_t state) -+{ -+ tmio_hw_stop (dev, dev_get_drvdata (dev)); -+ return 0; -+} -+ -+static int tmio_resume (struct device *dev) -+{ -+ tmio_hw_init (dev, dev_get_drvdata (dev)); -+ return 0; -+} -+#endif -+ -+static struct device_driver tmio_driver = { -+ .name = TMIO_NAME_NAND, -+ .bus = &tmio_bus_type, -+ .probe = tmio_probe, -+ .remove = tmio_remove, -+#ifdef CONFIG_PM -+ .suspend = tmio_suspend, -+ .resume = tmio_resume, -+#endif -+}; -+ -+static int __init tmio_init (void) { -+ return driver_register (&tmio_driver); -+} -+ -+static void __exit tmio_exit (void) { -+ driver_unregister (&tmio_driver); -+} -+ -+module_init (tmio_init); -+module_exit (tmio_exit); -+ -+MODULE_LICENSE ("GPL"); -+MODULE_AUTHOR ("Dirk Opfer, Chris Humbert"); -+MODULE_DESCRIPTION ("NAND flash driver on Toshiba Mobile IO controller"); diff --git a/packages/linux/linux-rp-2.6.23/tmio-tc6393-r8.patch b/packages/linux/linux-rp-2.6.23/tmio-tc6393-r8.patch index 500fa837ec..1bfdc23630 100644 --- a/packages/linux/linux-rp-2.6.23/tmio-tc6393-r8.patch +++ b/packages/linux/linux-rp-2.6.23/tmio-tc6393-r8.patch @@ -774,806 +774,6 @@ Index: git/include/asm-arm/arch-pxa/irqs.h #define IRQ_LOCOMO_SPI_OVRN (IRQ_BOARD_END + 20) #define IRQ_LOCOMO_SPI_TEND (IRQ_BOARD_END + 21) -+#define IRQ_TC6393_START (IRQ_BOARD_END) -+#define IRQ_TC6393_NAND (IRQ_BOARD_END + 0) -+#define IRQ_TC6393_SD (IRQ_BOARD_END + 1) -+#define IRQ_TC6393_OHCI (IRQ_BOARD_END + 2) -+#define IRQ_TC6393_SERIAL (IRQ_BOARD_END + 3) -+#define IRQ_TC6393_LCD (IRQ_BOARD_END + 4) -+ - /* - * Figure out the MAX IRQ number. - * - * If we have an SA1111, the max IRQ is S1_BVD1_STSCHG+1. - * If we have an LoCoMo, the max IRQ is IRQ_LOCOMO_SPI_TEND+1 -+ * If we have an TC6393XB, the max IRQ is IRQ_TC6393_LCD+1 - * Otherwise, we have the standard IRQs only. - */ - #ifdef CONFIG_SA1111 - #define NR_IRQS (IRQ_S1_BVD1_STSCHG + 1) - #elif defined(CONFIG_SHARP_LOCOMO) - #define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1) -+#elif defined(CONFIG_TOSHIBA_TC6393XB) -+#define NR_IRQS (IRQ_TC6393_LCD + 1) - #elif defined(CONFIG_ARCH_LUBBOCK) || \ - defined(CONFIG_MACH_LOGICPD_PXA270) || \ - defined(CONFIG_MACH_MAINSTONE) - arch/arm/common/Kconfig | 3 - arch/arm/common/Makefile | 1 - arch/arm/common/tc6393xb.c | 668 ++++++++++++++++++++++++++++++++++++++++ - arch/arm/mach-pxa/Kconfig | 1 - include/asm-arm/arch-pxa/irqs.h | 10 - include/asm-arm/hardware/tmio.h | 44 ++ - 6 files changed, 727 insertions(+) - -Index: git/arch/arm/common/tc6393xb.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ git/arch/arm/common/tc6393xb.c 2006-11-07 22:14:49.000000000 +0000 -@@ -0,0 +1,668 @@ -+/* -+ * Toshiba TC6393XB SoC support -+ * -+ * Maintainer: Chris Humbert -+ * -+ * Copyright (c) 2005-2006 Chris Humbert -+ * Copyright (c) 2005 Dirk Opfer -+ * -+ * Based on code written by Sharp/Lineo for 2.4 kernels -+ * Based on locomo.c -+ * -+ * 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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#ifndef TMIO_SOC_TC6393XB -+#error "TC6393XB SoC not configured" -+#endif -+ -+/*--------------------------------------------------------------------------*/ -+ -+/* cell ids must be 0-based because they are used as array indexes. */ -+#define TC6393_CELL_NAND 0 -+#define TC6393_CELL_SD 1 -+#define TC6393_CELL_OHCI 2 -+#define TC6393_CELL_SERIAL 3 -+#define TC6393_CELL_LCD 4 -+#define TC6393_NUM_CELLS 5 -+ -+#define TC6393_RESOURCE(_name, _start, _end, _flags) \ -+ { \ -+ .name = _name, \ -+ .start = _start, \ -+ .end = _end, \ -+ .flags = _flags, \ -+ } -+ -+#define TC6393_MEM(name, start, size) \ -+ TC6393_RESOURCE(name, start, (start) + (size) - 1, IORESOURCE_MEM) -+ -+#define TC6393_IRQ(name, irq) \ -+ TC6393_RESOURCE(name, irq, irq, IORESOURCE_IRQ) -+ -+const static struct resource tc6393_NAND_resource[] = { -+ TC6393_MEM (TMIO_NAME_NAND, 0x000100, 0x100), -+ TC6393_MEM (TMIO_NAME_NAND, 0x001000, 0x008), -+ TC6393_MEM (TMIO_NAME_NAND, 0, 0), -+ TC6393_IRQ (TMIO_NAME_NAND, IRQ_TC6393_NAND), -+}; -+ -+const static struct resource tc6393_SD_resource[] = { -+ TC6393_MEM (TMIO_NAME_SD, 0x000200, 0x100), -+ TC6393_MEM (TMIO_NAME_SD, 0x002000, 0x200), -+ TC6393_MEM (TMIO_NAME_SD, 0, 0), -+ TC6393_IRQ (TMIO_NAME_SD, IRQ_TC6393_SD), -+}; -+ -+const static struct resource tc6393_OHCI_resource[] = { -+ TC6393_MEM (TMIO_NAME_OHCI, 0x000300, 0x100), -+ TC6393_MEM (TMIO_NAME_OHCI, 0x003000, 0x100), -+ TC6393_MEM (TMIO_NAME_OHCI, 0x010000, 32 * 1024), -+ TC6393_IRQ (TMIO_NAME_OHCI, IRQ_TC6393_OHCI), -+}; -+ -+const static struct resource tc6393_SERIAL_resource[] = { -+ TC6393_MEM (TMIO_NAME_SERIAL, 0x000400, 0x100), -+ TC6393_MEM (TMIO_NAME_SERIAL, 0x004000, 0x100), -+ TC6393_MEM (TMIO_NAME_SERIAL, 0, 0), -+ TC6393_IRQ (TMIO_NAME_SERIAL, IRQ_TC6393_SERIAL), -+}; -+ -+const static struct resource tc6393_LCD_resource[] = { -+ TC6393_MEM (TMIO_NAME_LCD, 0x000500, 0x100), -+ TC6393_MEM (TMIO_NAME_LCD, 0x005000, 0x200), -+ TC6393_MEM (TMIO_NAME_LCD, 0x100000, 1024 * 1024), -+ TC6393_IRQ (TMIO_NAME_LCD, IRQ_TC6393_LCD), -+}; -+ -+#define TC6393_CELL(_NAME) \ -+ [TC6393_CELL_##_NAME] = { \ -+ .name = TMIO_NAME_##_NAME, \ -+ .id = TC6393_CELL_##_NAME, \ -+ .resource = tc6393_##_NAME##_resource, \ -+ .num_resources = ARRAY_SIZE (tc6393_##_NAME##_resource), \ -+ } -+ -+struct tc6393_cell { -+ const char* name; -+ unsigned int id; -+ const struct resource* resource; -+ unsigned int num_resources; -+}; -+ -+const static struct tc6393_cell tc6393_cell [TC6393_NUM_CELLS] = { -+ TC6393_CELL (NAND ), -+ TC6393_CELL (SD ), -+ TC6393_CELL (OHCI ), -+ TC6393_CELL (SERIAL ), -+ TC6393_CELL (LCD ), -+}; -+ -+/*--------------------------------------------------------------------------*/ -+ -+/* -+ * TC6393 System Configuration Register -+ */ -+struct tc6393_scr { -+ u8 x00[8]; -+ u8 revid; /* 0x08 Revision ID */ -+ u8 x01[0x47]; -+ u8 isr; /* 0x50 Interrupt Status */ -+ u8 x02; -+ u8 imr; /* 0x52 Interrupt Mask */ -+ u8 x03; -+ u8 irr; /* 0x54 Interrupt Routing */ -+ u8 x04[0x0b]; -+ u16 gper; /* 0x60 GP Enable */ -+ u8 x05[2]; -+ u16 gpi_sr[2]; /* 0x64 GPI Status */ -+ u16 gpi_imr[2]; /* 0x68 GPI INT Mask */ -+ u16 gpi_eder[2]; /* 0x6c GPI Edge Detect Enable */ -+ u16 gpi_lir[4]; /* 0x70 GPI Level Invert */ -+ u16 gpo_dsr[2]; /* 0x78 GPO Data Set */ -+ u16 gpo_doecr[2]; /* 0x7c GPO Data OE Control */ -+ u16 gp_iarcr[2]; /* 0x80 GP Internal Active Reg Control */ -+ u16 gp_iarlcr[2]; /* 0x84 GP Internal Active Reg Level Con*/ -+ u8 gpi_bcr[4]; /* 0x88 GPI Buffer Control */ -+ u16 gpa_iarcr; /* 0x8c GPa Internal Active Reg Control */ -+ u8 x06[2]; -+ u16 gpa_iarlcr; /* 0x90 GPa Internal Active Reg Level Co*/ -+ u8 x07[2]; -+ u16 gpa_bcr; /* 0x94 GPa Buffer Control */ -+ u8 x08[2]; -+ u16 ccr; /* 0x98 Clock Control */ -+ u16 pll2cr; /* 0x9a PLL2 Control */ -+ u16 pll1cr[2]; /* 0x9c PLL1 Control */ -+ u8 diarcr; /* 0xa0 Device Internal Active Reg Contr*/ -+ u8 dbocr; /* 0xa1 Device Buffer Off Control */ -+ u8 x09[0x3e]; -+ u8 fer; /* 0xe0 Function Enable */ -+ u8 x10[3]; -+ u16 mcr; /* 0xe4 Mode Control */ -+ u8 x11[0x14]; -+ u8 config; /* 0xfc Configuration Control */ -+ u8 x12[2]; -+ u8 debug; /* 0xff Debug */ -+} __attribute__ ((packed)); -+ -+union tc6393_scr_fer { -+ u8 raw; -+struct { -+ unsigned usben:1; /* D0 USB enable */ -+ unsigned lcdcven:1; /* D1 polysylicon TFT enable */ -+ unsigned slcden:1; /* D2 SLCD enable */ -+} __attribute__ ((packed)); -+} __attribute__ ((packed)); -+ -+union tc6393_scr_ccr { -+ u16 raw; -+struct { -+ unsigned ck32ken:1; /* D0 SD host clock enable */ -+ unsigned usbcken:1; /* D1 USB host clock enable */ -+ unsigned x00:2; -+ unsigned sharp:1; /* D4 ??? set in Sharp's code */ -+ unsigned x01:3; -+ enum { disable = 0, -+ m12MHz = 1, -+ m24MHz = 2, -+ m48MHz = 3, -+ } mclksel:3; /* D10-D8 LCD controller clock */ -+ unsigned x02:1; -+ enum { h24MHz = 0, -+ h48MHz = 1, -+ } hclksel:2; /* D13-D12 host bus clock */ -+ unsigned x03:2; -+} __attribute__ ((packed)); -+} __attribute__ ((packed)); -+ -+/*--------------------------------------------------------------------------*/ -+ -+struct tc6393 { -+ spinlock_t lock; /* read-modify-write lock */ -+ struct device* dev; /* TC6393 device */ -+ struct tc6393_scr __iomem *scr; /* system configuration reg */ -+ -+ struct resource rscr; /* system config reg resource */ -+ struct resource* iomem; /* entire TC6393 iomem resource */ -+ unsigned int irq; /* hardware cascade irq */ -+ -+ struct tmio_device tdev [TC6393_NUM_CELLS]; -+}; -+ -+/*--------------------------------------------------------------------------*/ -+ -+static u32 tc6393_ioread32 (const void __iomem *addr) -+{ -+ return ((u32) ioread16 (addr)) | (((u32) ioread16 (addr + 2)) << 16); -+} -+ -+static u32 tc6393_iowrite32 (u32 val, const void __iomem *addr) -+{ -+ iowrite16 (val, addr); -+ iowrite16 (val >> 16, addr + 2); -+ return val; -+} -+ -+u32 get_tc6393_gpio (struct device *dev) -+{ -+ struct tc6393* tc6393 = dev_get_drvdata (dev); -+ struct tc6393_scr __iomem * scr = tc6393->scr; -+ -+ return tc6393_ioread32 (scr->gpo_dsr); -+} -+EXPORT_SYMBOL (get_tc6393_gpio); -+ -+u32 set_tc6393_gpio (struct device *dev, u32 bits) -+{ -+ struct tc6393* tc6393 = dev_get_drvdata (dev); -+ struct tc6393_scr __iomem * scr = tc6393->scr; -+ unsigned long flags; -+ u32 dsr; -+ -+ spin_lock_irqsave (&tc6393->lock, flags); -+ dsr = tc6393_ioread32 (scr->gpo_dsr) | bits; -+ tc6393_iowrite32 (dsr, scr->gpo_dsr); -+ spin_unlock_irqrestore (&tc6393->lock, flags); -+ -+ return dsr; -+} -+EXPORT_SYMBOL (set_tc6393_gpio); -+ -+u32 reset_tc6393_gpio (struct device *dev, u32 bits) -+{ -+ struct tc6393* tc6393 = dev_get_drvdata (dev); -+ struct tc6393_scr __iomem * scr = tc6393->scr; -+ unsigned long flags; -+ u32 dsr; -+ -+ spin_lock_irqsave (&tc6393->lock, flags); -+ dsr = tc6393_ioread32 (scr->gpo_dsr) & ~bits; -+ tc6393_iowrite32 (dsr, scr->gpo_dsr); -+ spin_unlock_irqrestore (&tc6393->lock, flags); -+ -+ return dsr; -+} -+EXPORT_SYMBOL (reset_tc6393_gpio); -+ -+/*--------------------------------------------------------------------------*/ -+ -+static void -+tc6393_irq (unsigned int irq, struct irq_desc *desc) -+{ -+ struct tc6393* tc6393 = get_irq_chip_data (irq); -+ struct tc6393_scr __iomem * scr = tc6393->scr; -+ unsigned int isr; -+ unsigned int bit; -+ unsigned int i; -+ -+ desc->chip->ack (irq); -+ -+ while ((isr = ioread8(&scr->isr) & ~ioread8(&scr->imr))) -+ for (bit = 1, i = IRQ_TC6393_START; i <= IRQ_TC6393_LCD; -+ bit <<= 1, i++) -+ if (isr & bit) -+ desc_handle_irq (i, irq_desc + i); -+} -+ -+static void tc6393_irq_ack (unsigned int irq) -+{ -+} -+ -+static void tc6393_irq_mask (unsigned int irq) -+{ -+ struct tc6393* tc6393 = get_irq_chip_data (irq); -+ struct tc6393_scr __iomem * scr = tc6393->scr; -+ unsigned long flags; -+ -+ spin_lock_irqsave (&tc6393->lock, flags); -+ iowrite8 (ioread8 (&scr->imr) | (1 << (irq - IRQ_TC6393_START)), -+ &scr->imr); -+ spin_unlock_irqrestore (&tc6393->lock, flags); -+} -+ -+static void tc6393_irq_unmask (unsigned int irq) -+{ -+ struct tc6393* tc6393 = get_irq_chip_data (irq); -+ struct tc6393_scr __iomem * scr = tc6393->scr; -+ unsigned long flags; -+ -+ spin_lock_irqsave (&tc6393->lock, flags); -+ iowrite8 (ioread8 (&scr->imr) & ~(1 << (irq - IRQ_TC6393_START)), -+ &scr->imr); -+ spin_unlock_irqrestore (&tc6393->lock, flags); -+} -+ -+static struct irq_chip tc6393_chip = { -+ .ack = tc6393_irq_ack, -+ .mask = tc6393_irq_mask, -+ .unmask = tc6393_irq_unmask, -+}; -+ -+static void tc6393_attach_irq (struct tc6393 *tc6393) -+{ -+ unsigned int irq; -+ -+ for (irq = IRQ_TC6393_START; irq <= IRQ_TC6393_LCD; irq++) { -+ set_irq_chip (irq, &tc6393_chip); -+ set_irq_chip_data(irq, tc6393); -+ set_irq_handler (irq, handle_edge_irq); -+ set_irq_flags (irq, IRQF_VALID | IRQF_PROBE); -+ } -+ -+ set_irq_type (tc6393->irq, IRQT_FALLING); -+ set_irq_chip_data (tc6393->irq, tc6393); -+ set_irq_chained_handler (tc6393->irq, tc6393_irq); -+} -+ -+static void tc6393_detach_irq (struct tc6393 *tc6393) -+{ -+ unsigned int irq; -+ -+ set_irq_chained_handler (tc6393->irq, NULL); -+ set_irq_chip_data (tc6393->irq, NULL); -+ -+ for (irq = IRQ_TC6393_START; irq <= IRQ_TC6393_LCD; irq++) { -+ set_irq_flags (irq, 0); -+ set_irq_chip (irq, NULL); -+ set_irq_chip_data(irq, NULL); -+ } -+} -+ -+/*--------------------------------------------------------------------------*/ -+ -+static int tc6393_bus_match (struct device *dev, struct device_driver *drv) -+{ -+ struct tmio_device* tdev = dev_to_tdev (dev); -+ const struct tc6393_cell* cell = tdev->soc_data; -+ -+ return !strcmp (cell->name, drv->name); -+} -+ -+static int tc6393_bus_suspend (struct device *dev, pm_message_t state) -+{ -+ struct device_driver* drv = dev->driver; -+ return drv && drv->suspend ? drv->suspend (dev, state) : 0; -+} -+ -+static int tc6393_bus_resume (struct device *dev) -+{ -+ struct device_driver* drv = dev->driver; -+ return drv && drv->resume ? drv->resume (dev) : 0; -+} -+ -+struct bus_type tc6393_bus_type = { -+ .name = TMIO_NAME_BUS, -+ .match = tc6393_bus_match, -+ .suspend = tc6393_bus_suspend, -+ .resume = tc6393_bus_resume, -+}; -+EXPORT_SYMBOL (tc6393_bus_type); -+ -+/*--------------------------------------------------------------------------*/ -+ -+static void tc6393_cell_clock (struct device *dev, int enable) -+{ -+ struct tmio_device* tdev = dev_to_tdev (dev); -+ const struct tc6393_cell* cell = tdev->soc_data; -+ struct tc6393* tc6393 = dev_get_drvdata (dev->parent); -+ struct tc6393_scr __iomem * scr = tc6393->scr; -+ union tc6393_scr_ccr ccr; -+ unsigned long flags; -+ -+ spin_lock_irqsave (&tc6393->lock, flags); -+ ccr.raw = ioread16 (&scr->ccr); -+ -+ switch (cell->id) { -+ case TC6393_CELL_SD: ccr.ck32ken = enable; break; -+ case TC6393_CELL_OHCI: ccr.usbcken = enable; break; -+ case TC6393_CELL_LCD: -+ ccr.mclksel = enable ? m48MHz : disable; -+ break; -+ } -+ -+ printk (KERN_DEBUG TMIO_NAME_CORE ": scr->ccr = %04x\n", ccr.raw); -+ -+ iowrite16(ccr.raw, &scr->ccr); -+ spin_unlock_irqrestore (&tc6393->lock, flags); -+} -+ -+static void tc6393_cell_function (struct device *dev, int enable) -+{ -+ struct tmio_device* tdev = dev_to_tdev (dev); -+ const struct tc6393_cell* cell = tdev->soc_data; -+ struct tc6393* tc6393 = dev_get_drvdata (dev->parent); -+ struct tc6393_scr __iomem * scr = tc6393->scr; -+ union tc6393_scr_fer fer; -+ unsigned long flags; -+ -+ if (cell->id == TC6393_CELL_NAND) { -+ if (enable) { -+ /* SMD buffer on */ -+ printk (KERN_DEBUG TMIO_NAME_CORE ": SMD buffer on\n"); -+ iowrite8 (0xff, scr->gpi_bcr + 1); -+ } -+ return; -+ } -+ -+ spin_lock_irqsave (&tc6393->lock, flags); -+ fer.raw = ioread16 (&scr->fer); -+ -+ switch (cell->id) { -+ case TC6393_CELL_OHCI: fer.usben = enable; break; -+ case TC6393_CELL_LCD: fer.slcden = enable; break; -+ } -+ -+ printk (KERN_DEBUG TMIO_NAME_CORE ": scr->fer = %02x\n", fer.raw); -+ -+ iowrite8 (fer.raw, &scr->fer); -+ spin_unlock_irqrestore (&tc6393->lock, flags); -+} -+ -+static void -+tc6393_lcd_mode (struct device *dev, const struct fb_videomode *mode) -+{ -+ struct tc6393* tc6393 = dev_get_drvdata (dev->parent); -+ struct tc6393_scr __iomem * scr = tc6393->scr; -+ -+ iowrite16 (mode->pixclock, scr->pll1cr + 0); -+ iowrite16 (mode->pixclock >> 16, scr->pll1cr + 1); -+} -+ -+static struct tmio_cell_ops tc6393_cell_ops = { -+ .clock = tc6393_cell_clock, -+ .function = tc6393_cell_function, -+ .lcd_mode = tc6393_lcd_mode, -+}; -+ -+static void tc6393_device_release (struct device *dev) -+{ -+} -+ -+static int -+tc6393_device_register (struct tc6393 *tc6393, struct tmio_cell *tcell) -+{ -+ const struct tc6393_cell* cell; -+ struct tmio_device* tdev; -+ struct device* dev; -+ int i; -+ -+ for (i = 0; strcmp (tcell->name, tc6393_cell [i].name); ) -+ if (++i >= ARRAY_SIZE(tc6393_cell)) -+ return -EINVAL; -+ -+ cell = tc6393_cell + i; -+ tdev = tc6393->tdev + i; -+ dev = &tdev->dev; -+ -+ tdev->ops = &tc6393_cell_ops; -+ tdev->iomem = tc6393->iomem; -+ tdev->soc_data = (void*) cell; -+ -+ dev->parent = tc6393->dev; -+ strncpy (dev->bus_id, cell->name, sizeof dev->bus_id); -+ dev->bus = &tc6393_bus_type; -+ dev->dma_mask = tc6393->dev->dma_mask; -+ dev->coherent_dma_mask = tc6393->dev->coherent_dma_mask; -+ dev->release = tc6393_device_release; -+ dev->platform_data = tcell->platform_data; -+ -+ for (i=0; i < cell->num_resources; i++) { -+ const struct resource* cr = cell->resource + i; -+ struct resource* dr = tdev->resource + i; -+ -+ dr->name = cr->name; -+ dr->start = cr->start; -+ dr->end = cr->end; -+ dr->flags = cr->flags; -+ -+ /* convert memory offsets to absolutes */ -+ if (cr->flags & IORESOURCE_MEM) { -+ dr->start += tc6393->iomem->start; -+ dr->end += tc6393->iomem->start; -+ } -+ } -+ -+ return device_register (dev); -+} -+ -+/*--------------------------------------------------------------------------*/ -+ -+static void tc6393_hw_init (struct tc6393 *tc6393) -+{ -+ struct tc6393_scr __iomem * scr = tc6393->scr; -+ struct tc6393_platform_data* tcpd = tc6393->dev->platform_data; -+ -+ tcpd->enable (tc6393->dev); -+ -+ iowrite8 (0, &scr->fer); -+ iowrite16(tcpd->scr_pll2cr, &scr->pll2cr); -+ iowrite16(tcpd->scr_ccr, &scr->ccr); -+ iowrite16(tcpd->scr_mcr, &scr->mcr); -+ iowrite16(tcpd->scr_gper, &scr->gper); -+ iowrite8 (0, &scr->irr); -+ iowrite8 (0xbf, &scr->imr); -+ iowrite16(tcpd->scr_gpo_dsr, scr->gpo_dsr + 0); -+ iowrite16(tcpd->scr_gpo_dsr >> 16, scr->gpo_dsr + 1); -+ iowrite16(tcpd->scr_gpo_doecr, scr->gpo_doecr + 0); -+ iowrite16(tcpd->scr_gpo_doecr >> 16, scr->gpo_doecr + 1); -+} -+ -+static int tc6393_probe (struct device *dev) -+{ -+ struct platform_device* pdev = to_platform_device (dev); -+ struct tc6393_platform_data* tcpd = dev->platform_data; -+ struct tc6393* tc6393; -+ struct resource* iomem; -+ struct resource* rscr; -+ int retval; -+ int i; -+ -+ iomem = platform_get_resource (pdev, IORESOURCE_MEM, 0); -+ if (!iomem) -+ return -EINVAL; -+ -+ tc6393 = kzalloc (sizeof *tc6393, GFP_KERNEL); -+ if (!tc6393) { -+ retval = -ENOMEM; -+ goto err_kzalloc; -+ } -+ -+ dev_set_drvdata (dev, tc6393); -+ spin_lock_init (&tc6393->lock); -+ tc6393->dev = dev; -+ tc6393->iomem = iomem; -+ tc6393->irq = platform_get_irq (pdev, 0); -+ -+ rscr = &tc6393->rscr; -+ rscr->name = TMIO_NAME_CORE; -+ rscr->start = iomem->start; -+ rscr->end = iomem->start + 0xff; -+ rscr->flags = IORESOURCE_MEM; -+ -+ retval = request_resource (iomem, rscr); -+ if (retval) -+ goto err_request_scr; -+ -+ tc6393->scr = ioremap (rscr->start, rscr->end - rscr->start + 1); -+ if (!tc6393->scr) { -+ retval = -ENOMEM; -+ goto err_ioremap; -+ } -+ -+ tc6393_hw_init (tc6393); -+ -+ printk (KERN_INFO "Toshiba %s revision %d at 0x%08lx, irq %d\n", -+ TMIO_SOC_NAME, ioread8 (&tc6393->scr->revid), -+ iomem->start, tc6393->irq); -+ -+ if (tc6393->irq) -+ tc6393_attach_irq (tc6393); -+ -+ for (i = 0; i < tcpd->num_cells; i++) -+ tc6393_device_register (tc6393, tcpd->cell + i); -+ -+ return 0; -+ -+err_ioremap: -+ release_resource (rscr); -+err_request_scr: -+ kfree(tc6393); -+err_kzalloc: -+ release_resource (iomem); -+ return retval; -+} -+ -+static int tc6393_dev_remove (struct device *dev, void *data) -+{ -+ device_unregister (dev); -+ return 0; -+} -+ -+static int tc6393_remove (struct device *dev) -+{ -+ struct tc6393* tc6393 = dev_get_drvdata (dev); -+ -+ device_for_each_child (dev, tc6393, tc6393_dev_remove); -+ -+ if (tc6393->irq) -+ tc6393_detach_irq (tc6393); -+ -+ iounmap (tc6393->scr); -+ release_resource (&tc6393->rscr); -+ release_resource (tc6393->iomem); -+ kfree (tc6393); -+ return 0; -+} -+ -+#ifdef CONFIG_PM -+static int tc6393_suspend (struct device *dev, pm_message_t state) -+{ -+ struct tc6393_platform_data* tcpd = dev->platform_data; -+ tcpd->disable (dev); -+ return 0; -+} -+ -+static int tc6393_resume (struct device *dev) -+{ -+ struct tc6393* tc6393 = dev_get_drvdata (dev); -+ tc6393_hw_init (tc6393); -+ return 0; -+} -+#endif -+ -+static struct device_driver tc6393_device_driver = { -+ .name = TMIO_SOC_NAME, -+ .bus = &platform_bus_type, -+ .probe = tc6393_probe, -+ .remove = tc6393_remove, -+#ifdef CONFIG_PM -+ .suspend = tc6393_suspend, -+ .resume = tc6393_resume, -+#endif -+}; -+ -+/*--------------------------------------------------------------------------*/ -+ -+static int __init tc6393_init (void) -+{ -+ int retval = bus_register (&tc6393_bus_type); -+ if (retval) -+ return retval; -+ -+ return driver_register (&tc6393_device_driver); -+} -+ -+static void __exit tc6393_exit (void) -+{ -+ driver_unregister (&tc6393_device_driver); -+ bus_unregister (&tc6393_bus_type); -+} -+ -+module_init (tc6393_init); -+module_exit (tc6393_exit); -+ -+MODULE_DESCRIPTION ("TC6393 SoC bus driver"); -+MODULE_AUTHOR ("Chris Humbert, Dirk Opfer"); -+MODULE_LICENSE ("GPL"); -Index: git/arch/arm/common/Kconfig -=================================================================== ---- git.orig/arch/arm/common/Kconfig 2006-10-31 16:08:28.000000000 +0000 -+++ git/arch/arm/common/Kconfig 2006-11-07 22:13:09.000000000 +0000 -@@ -31,3 +31,6 @@ config SHARPSL_PM - - config SHARP_SCOOP - bool -+ -+config TOSHIBA_TC6393XB -+ bool -Index: git/arch/arm/mach-pxa/Kconfig -=================================================================== ---- git.orig/arch/arm/mach-pxa/Kconfig 2006-11-07 22:13:06.000000000 +0000 -+++ git/arch/arm/mach-pxa/ 2006-11-07 23:30:34.000000000 +0000 -@@ -128,6 +128,7 @@ config MACH_BORZOI - config MACH_TOSA - bool "Enable Sharp SL-6000x (Tosa) Support" - depends on PXA_SHARPSL_25x -+ select TOSHIBA_TC6393XB - - config PXA25x - bool -Index: git/arch/arm/common/Makefile -=================================================================== ---- git.orig/arch/arm/common/Makefile 2006-10-31 16:08:28.000000000 +0000 -+++ git/arch/arm/common/Makefile 2006-11-07 22:13:09.000000000 +0000 -@@ -17,3 +17,4 @@ obj-$(CONFIG_SHARPSL_PM) += sharpsl_pm.o - obj-$(CONFIG_SHARP_SCOOP) += scoop.o - obj-$(CONFIG_ARCH_IXP2000) += uengine.o - obj-$(CONFIG_ARCH_IXP23XX) += uengine.o -+obj-$(CONFIG_TOSHIBA_TC6393XB) += tc6393xb.o -Index: git/include/asm-arm/hardware/tmio.h -=================================================================== ---- git.orig/include/asm-arm/hardware/tmio.h 2006-11-07 22:13:09.000000000 +0000 -+++ git/include/asm-arm/hardware/tmio.h 2006-11-07 22:13:09.000000000 +0000 -@@ -91,6 +91,50 @@ struct tmio_device { - - /*--------------------------------------------------------------------------*/ - -+/* -+ * TC6393XB SoC -+ */ -+#ifdef CONFIG_TOSHIBA_TC6393XB -+#define TMIO_SOC_TC6393XB -+#define TMIO_SOC_NAME "TC6393XB" -+#define TMIO_NAME_BUS "tc6393-bus" -+#define TMIO_NAME_CORE "tc6393-core" -+#define TMIO_NAME_NAND "tc6393-nand" -+#define TMIO_NAME_SD "tc6393-sd" -+#define TMIO_NAME_OHCI "tc6393-ohci" -+#define TMIO_NAME_SERIAL "tc6393-serial" -+#define TMIO_NAME_LCD "tc6393-lcd" -+#define tmio_bus_type tc6393_bus_type -+ -+#define TC6393_GPIO(x) (1 << (x)) -+ -+extern struct bus_type tc6393_bus_type; -+ -+struct tc6393_platform_data { -+ u16 scr_pll2cr; /* PLL2 Control */ -+ u16 scr_ccr; /* Clock Control */ -+ u16 scr_mcr; /* Mode Control */ -+ u16 scr_gper; /* GP Enable */ -+ u32 scr_gpo_doecr; /* GPO Data OE Control */ -+ u32 scr_gpo_dsr; /* GPO Data Set */ -+ -+ /* cells to register as devices */ -+ struct tmio_cell* cell; -+ unsigned int num_cells; -+ -+ /* callbacks to enable and disable the TC6393XB's power and clock */ -+ void (*enable) (struct device *dev); -+ void (*disable) (struct device *dev); -+}; -+ -+u32 get_tc6393_gpio (struct device *dev); -+u32 set_tc6393_gpio (struct device *dev, u32 bits); -+u32 reset_tc6393_gpio (struct device *dev, u32 bits); -+ -+/*--------------------------------------------------------------------------*/ -+ -+#else - #error "no TMIO SoC configured" -+#endif - - #endif -Index: git/include/asm-arm/arch-pxa/irqs.h -=================================================================== ---- git.orig/include/asm-arm/arch-pxa/irqs.h 2006-10-31 16:09:33.000000000 +0000 -+++ git/include/asm-arm/arch-pxa/irqs.h 2006-11-07 22:13:09.000000000 +0000 -@@ -163,17 +163,27 @@ - #define IRQ_LOCOMO_SPI_OVRN (IRQ_BOARD_END + 20) - #define IRQ_LOCOMO_SPI_TEND (IRQ_BOARD_END + 21) - +#define IRQ_TC6393_START (IRQ_BOARD_END) +#define IRQ_TC6393_NAND (IRQ_BOARD_END + 0) +#define IRQ_TC6393_SD (IRQ_BOARD_END + 1) diff --git a/packages/linux/linux-rp-2.6.23/tosa-bluetooth-r8.patch b/packages/linux/linux-rp-2.6.23/tosa-bluetooth-r8.patch index 9976549956..7873cffef5 100644 --- a/packages/linux/linux-rp-2.6.23/tosa-bluetooth-r8.patch +++ b/packages/linux/linux-rp-2.6.23/tosa-bluetooth-r8.patch @@ -192,197 +192,3 @@ Index: linux-2.6.17/arch/arm/mach-pxa/tosa.c }; static void tosa_poweroff(void) -Index: linux-2.6.17/arch/arm/mach-pxa/Makefile -=================================================================== ---- linux-2.6.17.orig/arch/arm/mach-pxa/Makefile 2006-06-20 11:45:51.252467944 +0200 -+++ linux-2.6.17/arch/arm/mach-pxa/Makefile 2006-06-20 11:46:33.619027248 +0200 -@@ -16,7 +16,7 @@ - obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o spitz_pm.o - obj-$(CONFIG_MACH_AKITA) += akita-ioexp.o - obj-$(CONFIG_MACH_POODLE) += poodle.o corgi_ssp.o sharpsl_pm.o poodle_pm.o --obj-$(CONFIG_MACH_TOSA) += tosa.o sharpsl_pm.o tosa_pm.o tosa_lcd.o -+obj-$(CONFIG_MACH_TOSA) += tosa.o sharpsl_pm.o tosa_pm.o tosa_lcd.o tosa_bt.o - obj-$(CONFIG_MACH_EM_X270) += em-x270.o - obj-$(CONFIG_MACH_HX2750) += hx2750.o hx2750_test.o - -Index: linux-2.6.17/arch/arm/mach-pxa/tosa_bt.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.17/arch/arm/mach-pxa/tosa_bt.c 2006-06-20 11:46:08.107905528 +0200 -@@ -0,0 +1,128 @@ -+/* -+ * Bluetooth control code for Sharp SL-6000x (tosa) -+ * -+ * Copyright (c) 2005 Dirk Opfer -+ * -+ * 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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+ -+static int tosa_bluetooth_power(int on) -+{ -+ -+ if (!on) { //off -+ -+ set_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_BT_RESET); -+ pxa_gpio_mode(GPIO42_BTRXD|GPIO_IN); -+ pxa_gpio_mode(GPIO43_BTTXD|GPIO_IN); -+ pxa_gpio_mode(GPIO44_BTCTS|GPIO_IN); -+ pxa_gpio_mode(GPIO45_BTRTS|GPIO_IN); -+ mdelay(10); // wait 10ms -+ reset_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_BT_RESET); -+ reset_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_BT_PWR_EN); -+ reset_scoop_gpio(&tosascoop_jc_device.dev,TOSA_SCOOP_JC_BT_LED); // turn off BT LED -+ -+ } else { // on -+ -+ reset_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_BT_RESET); -+ set_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_BT_PWR_EN); -+ pxa_gpio_mode(GPIO42_HWRXD_MD); -+ pxa_gpio_mode(GPIO43_HWTXD_MD); -+ pxa_gpio_mode(GPIO44_HWCTS_MD); -+ pxa_gpio_mode(GPIO45_HWRTS_MD); -+ -+ set_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_BT_RESET); -+ mdelay(20); // wait 20ms -+ reset_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_BT_RESET); -+ set_scoop_gpio(&tosascoop_jc_device.dev,TOSA_SCOOP_JC_BT_LED); // turn BT LED on -+ } -+ return 0; -+} -+ -+/* -+ * Support Routines -+ */ -+int __init tosa_bluetooth_probe(struct platform_device *dev) -+{ -+ int ret = 0; -+ pxa_gpio_mode(GPIO42_BTRXD|GPIO_IN); -+ pxa_gpio_mode(GPIO43_BTTXD|GPIO_IN); -+ pxa_gpio_mode(GPIO44_BTCTS|GPIO_IN); -+ pxa_gpio_mode(GPIO45_BTRTS|GPIO_IN); -+ set_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_BT_PWR_EN); -+ mdelay(5); -+ -+ if ( (GPLR(GPIO42_BTRXD) & GPIO_bit(GPIO42_BTRXD))==0 && -+ (GPLR(GPIO44_BTCTS) & GPIO_bit(GPIO44_BTCTS))==0) { -+ printk(KERN_INFO "No Bluetooth Device found!\n"); -+ ret = ENODEV; // no bluetooth -+ } else { -+ printk(KERN_INFO "Tosa Bluetooth Device found on ttyS3!\n"); -+ } -+ reset_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_BT_PWR_EN); -+ -+ tosa_bluetooth_power(1); // Power on -+ return ret; -+} -+ -+static int tosa_bluetooth_remove(struct platform_device *dev) -+{ -+ tosa_bluetooth_power(0); // Power off -+ return 0; -+} -+ -+#ifdef CONFIG_PM -+static int tosa_bluetooth_suspend(struct platform_device *dev, pm_message_t state) -+{ -+ tosa_bluetooth_power(0); // Power off -+ return 0; -+} -+ -+static int tosa_bluetooth_resume(struct platform_device *dev) -+{ -+ tosa_bluetooth_power(1); // Power on -+ return 0; -+} -+#else -+#define tosa_bluetooth_suspend NULL -+#define tosa_bluetooth_resume NULL -+#endif -+ -+static struct platform_driver tosa_bluetooth_driver = { -+ .probe = tosa_bluetooth_probe, -+ .remove = tosa_bluetooth_remove, -+ .suspend = tosa_bluetooth_suspend, -+ .resume = tosa_bluetooth_resume, -+ .driver = { -+ .name = "tosa-bluetooth", -+ }, -+}; -+ -+int __init tosa_bluetooth_init(void) -+{ -+ return platform_driver_register(&tosa_bluetooth_driver); -+} -+ -+void __exit tosa_bluetooth_cleanup(void) -+{ -+ platform_driver_unregister(&tosa_bluetooth_driver); -+} -+ -+module_init(tosa_bluetooth_init); -+module_exit(tosa_bluetooth_cleanup); -Index: linux-2.6.17/arch/arm/mach-pxa/tosa.c -=================================================================== ---- linux-2.6.17.orig/arch/arm/mach-pxa/tosa.c 2006-06-20 11:45:51.254467640 +0200 -+++ linux-2.6.17/arch/arm/mach-pxa/tosa.c 2006-06-20 11:46:08.112904768 +0200 -@@ -288,7 +288,7 @@ - - static void tosa_tc6393_enable(struct device *dev) - { -- -+ printk("!!tosa_tc6393_enable!!\n"); - reset_scoop_gpio(&tosascoop_jc_device.dev,TOSA_SCOOP_JC_TC3693_L3V_ON); - reset_scoop_gpio(&tosascoop_jc_device.dev,TOSA_SCOOP_JC_TC6393_SUSPEND); - reset_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_TC6393_REST_IN); //#PCLR -@@ -303,7 +303,7 @@ - - static void tosa_tc6393_disable(struct device *dev) - { -- -+ printk("!!tosa_tc6393_disable!!\n"); - reset_scoop_gpio(&tosascoop_jc_device.dev,TOSA_SCOOP_JC_TC3693_L3V_ON); - reset_scoop_gpio(&tosascoop_jc_device.dev,TOSA_SCOOP_JC_TC6393_SUSPEND); - reset_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_TC6393_REST_IN); //#PCLR -@@ -428,6 +428,17 @@ - }, - }; - -+/* -+ * Tosa Blueooth -+ */ -+static struct platform_device tosa_bluetooth_device = { -+ .name = "tosa-bluetooth", -+ .id = -1, -+ .dev = { -+ .parent = &tosascoop_jc_device.dev, -+ }, -+}; -+ - static struct platform_device *devices[] __initdata = { - &tosascoop_device, - &tosascoop_jc_device, -@@ -435,6 +446,7 @@ - &tosaled_device, - &tc6393_device, - &tosalcd_device, -+ &tosa_bluetooth_device, - }; - - static void tosa_poweroff(void) diff --git a/packages/linux/linux-rp-2.6.23/tosa-keyboard-r19.patch b/packages/linux/linux-rp-2.6.23/tosa-keyboard-r19.patch index 5d94f25527..948c27fdce 100644 --- a/packages/linux/linux-rp-2.6.23/tosa-keyboard-r19.patch +++ b/packages/linux/linux-rp-2.6.23/tosa-keyboard-r19.patch @@ -512,517 +512,3 @@ Index: git/drivers/input/keyboard/tosakbd.c +MODULE_AUTHOR("Dirk Opfer "); +MODULE_DESCRIPTION("Tosa Keyboard Driver"); +MODULE_LICENSE("GPLv2"); - drivers/input/keyboard/Kconfig | 12 - - drivers/input/keyboard/Makefile | 1 - drivers/input/keyboard/tosakbd.c | 467 +++++++++++++++++++++++++++++++++++++++ - 3 files changed, 479 insertions(+), 1 deletion(-) - -Index: git/drivers/input/keyboard/Kconfig -=================================================================== ---- git.orig/drivers/input/keyboard/Kconfig 2006-10-31 16:08:57.000000000 +0000 -+++ git/drivers/input/keyboard/Kconfig 2006-11-07 22:13:10.000000000 +0000 -@@ -148,12 +148,22 @@ config KEYBOARD_SPITZ - depends on PXA_SHARPSL - default y - help -- Say Y here to enable the keyboard on the Sharp Zaurus SL-C1000, -+ Say Y here to enable the keyboard on the Sharp Zaurus SL-C1000, - SL-C3000 and Sl-C3100 series of PDAs. - - To compile this driver as a module, choose M here: the - module will be called spitzkbd. - -+config KEYBOARD_TOSA -+ tristate "Tosa keyboard" -+ depends on PXA_SHARPSL -+ default y -+ help -+ Say Y here to enable the keyboard on the Sharp Zaurus SL-6000x (Tosa) -+ -+ To compile this driver as a module, choose M here: the -+ module will be called tosakbd. -+ - config KEYBOARD_AMIGA - tristate "Amiga keyboard" - depends on AMIGA -Index: git/drivers/input/keyboard/Makefile -=================================================================== ---- git.orig/drivers/input/keyboard/Makefile 2006-10-31 16:08:57.000000000 +0000 -+++ git/drivers/input/keyboard/Makefile 2006-11-07 22:13:10.000000000 +0000 -@@ -17,3 +17,4 @@ obj-$(CONFIG_KEYBOARD_SPITZ) += spitzkb - obj-$(CONFIG_KEYBOARD_AAED2000) += aaed2000_kbd.o - obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o - obj-$(CONFIG_KEYBOARD_ASIC3) += asic3_keys.o -+obj-$(CONFIG_KEYBOARD_TOSA) += tosakbd.o -Index: git/drivers/input/keyboard/tosakbd.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ git/drivers/input/keyboard/tosakbd.c 2006-11-07 23:27:19.000000000 +0000 -@@ -0,0 +1,467 @@ -+/* -+ * Keyboard driver for Sharp Tosa models (SL-6000x) -+ * -+ * Copyright (c) 2005 Dirk Opfer -+ * -+ * Based on xtkbd.c/locomkbd.c/corgikbd.c -+ * -+ * 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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+ -+#define TOSA_KEY_STROBE_NUM (11) -+#define TOSA_KEY_SENSE_NUM (7) -+ -+#define KEYMASK_ON (0x1<<0) -+#define KEYMASK_REC (0x1<<1) -+#define KEYMASK_SYNC (0x1<<2) -+ -+#define KB_ROWS 7 -+#define KB_COLS 11 -+#define KB_ROWMASK(r) (1 << (r)) -+#define SCANCODE(r,c) ( ((r)<<4) + (c) + 1 ) -+#define NR_SCANCODES (SCANCODE(KB_ROWS-1,KB_COLS)+1+1) -+ -+#define SCAN_INTERVAL (HZ/10) -+#define HP_SCAN_INTERVAL (150) /* ms */ -+#define HP_STABLE_COUNT 2 -+ -+#define TOSA_KEY_CALENDER KEY_F1 -+#define TOSA_KEY_ADDRESS KEY_F2 -+#define TOSA_KEY_FN KEY_F3 -+#define TOSA_KEY_CANCEL KEY_F4 -+#define TOSA_KEY_OFF KEY_SUSPEND -+#define TOSA