From b3608c889a261aa4a7b4adf53964f516d1763777 Mon Sep 17 00:00:00 2001 From: jacob Date: Wed, 2 Feb 2005 04:17:16 +0000 Subject: [PATCH] update to SP1 kernel: 2.6.5-7.141 --- .../kernel-2.6.5-2.6-suse-i686-bigsmp.config | 6 +- .../kernel-2.6.5-2.6-suse-i686.config | 6 +- .../kernel_patches/patches/mtd-2.6-suse-lnxi.patch | 6097 +++++--------------- lustre/kernel_patches/targets/2.6-suse.target.in | 4 +- 4 files changed, 1322 insertions(+), 4791 deletions(-) diff --git a/lustre/kernel_patches/kernel_configs/kernel-2.6.5-2.6-suse-i686-bigsmp.config b/lustre/kernel_patches/kernel_configs/kernel-2.6.5-2.6-suse-i686-bigsmp.config index 5068127..e90083d 100644 --- a/lustre/kernel_patches/kernel_configs/kernel-2.6.5-2.6-suse-i686-bigsmp.config +++ b/lustre/kernel_patches/kernel_configs/kernel-2.6.5-2.6-suse-i686-bigsmp.config @@ -36,6 +36,8 @@ CONFIG_CKRM=y CONFIG_RCFS_FS=m CONFIG_CKRM_TYPE_TASKCLASS=y CONFIG_CKRM_RES_NUMTASKS=m +CONFIG_CKRM_CPU_SCHEDULE=y +# CONFIG_CKRM_CPU_SCHEDULE_AT_BOOT is not set CONFIG_CKRM_TYPE_SOCKETCLASS=y CONFIG_CKRM_RBCE=m CONFIG_CKRM_CRBCE=m @@ -275,6 +277,7 @@ CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM=y CONFIG_HOTPLUG_PCI_IBM=m CONFIG_HOTPLUG_PCI_AMD=m CONFIG_HOTPLUG_PCI_ACPI=m +CONFIG_HOTPLUG_PCI_ACPI_IBM=m CONFIG_HOTPLUG_PCI_CPCI=y CONFIG_HOTPLUG_PCI_CPCI_ZT5550=m CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m @@ -1713,6 +1716,7 @@ CONFIG_KEYBOARD_SUNKBD=m # CONFIG_KEYBOARD_LKKBD is not set CONFIG_KEYBOARD_XTKBD=m CONFIG_KEYBOARD_NEWTON=m +# CONFIG_KEYBOARD_POSFILTER is not set CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=y CONFIG_MOUSE_SERIAL=m @@ -2867,7 +2871,7 @@ CONFIG_ZLIB_DEFLATE=m # CONFIG_SUSE_KERNEL=y CONFIG_CFGNAME="bigsmp" -CONFIG_RELEASE="SLES9_SP1_BRANCH_2004110217390391" +CONFIG_RELEASE="7.141" CONFIG_X86_SMP=y CONFIG_X86_HT=y CONFIG_X86_BIOS_REBOOT=y diff --git a/lustre/kernel_patches/kernel_configs/kernel-2.6.5-2.6-suse-i686.config b/lustre/kernel_patches/kernel_configs/kernel-2.6.5-2.6-suse-i686.config index 5068127..e90083d 100644 --- a/lustre/kernel_patches/kernel_configs/kernel-2.6.5-2.6-suse-i686.config +++ b/lustre/kernel_patches/kernel_configs/kernel-2.6.5-2.6-suse-i686.config @@ -36,6 +36,8 @@ CONFIG_CKRM=y CONFIG_RCFS_FS=m CONFIG_CKRM_TYPE_TASKCLASS=y CONFIG_CKRM_RES_NUMTASKS=m +CONFIG_CKRM_CPU_SCHEDULE=y +# CONFIG_CKRM_CPU_SCHEDULE_AT_BOOT is not set CONFIG_CKRM_TYPE_SOCKETCLASS=y CONFIG_CKRM_RBCE=m CONFIG_CKRM_CRBCE=m @@ -275,6 +277,7 @@ CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM=y CONFIG_HOTPLUG_PCI_IBM=m CONFIG_HOTPLUG_PCI_AMD=m CONFIG_HOTPLUG_PCI_ACPI=m +CONFIG_HOTPLUG_PCI_ACPI_IBM=m CONFIG_HOTPLUG_PCI_CPCI=y CONFIG_HOTPLUG_PCI_CPCI_ZT5550=m CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m @@ -1713,6 +1716,7 @@ CONFIG_KEYBOARD_SUNKBD=m # CONFIG_KEYBOARD_LKKBD is not set CONFIG_KEYBOARD_XTKBD=m CONFIG_KEYBOARD_NEWTON=m +# CONFIG_KEYBOARD_POSFILTER is not set CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=y CONFIG_MOUSE_SERIAL=m @@ -2867,7 +2871,7 @@ CONFIG_ZLIB_DEFLATE=m # CONFIG_SUSE_KERNEL=y CONFIG_CFGNAME="bigsmp" -CONFIG_RELEASE="SLES9_SP1_BRANCH_2004110217390391" +CONFIG_RELEASE="7.141" CONFIG_X86_SMP=y CONFIG_X86_HT=y CONFIG_X86_BIOS_REBOOT=y diff --git a/lustre/kernel_patches/patches/mtd-2.6-suse-lnxi.patch b/lustre/kernel_patches/patches/mtd-2.6-suse-lnxi.patch index 18dd9b8..85b2ca2 100644 --- a/lustre/kernel_patches/patches/mtd-2.6-suse-lnxi.patch +++ b/lustre/kernel_patches/patches/mtd-2.6-suse-lnxi.patch @@ -1,7 +1,7 @@ -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/Kconfig +Index: linux-2.6.5/drivers/mtd/Kconfig =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/Kconfig 2004-04-03 22:36:26.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/Kconfig 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/Kconfig 2004-04-03 22:36:26.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/Kconfig 2005-02-01 17:11:17.000000000 -0500 @@ -1,4 +1,4 @@ -# $Id: Kconfig,v 1.3 2003/05/28 11:02:23 dwmw2 Exp $ +# $Id: Kconfig,v 1.6 2004/08/09 13:19:42 dwmw2 Exp $ @@ -43,10 +43,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/Kconfig ---help--- Allow generic configuration of the MTD paritition tables via the kernel command line. Multiple flash resources are supported for hardware where -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/Makefile +Index: linux-2.6.5/drivers/mtd/Makefile =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/Makefile 2004-04-03 22:36:57.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/Makefile 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/Makefile 2004-04-03 22:36:57.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/Makefile 2005-02-01 17:11:17.000000000 -0500 @@ -1,28 +1,14 @@ # # Makefile for the memory technology device drivers. @@ -81,10 +81,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/Makefile obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o obj-$(CONFIG_MTD_AFS_PARTS) += afs.o -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/afs.c +Index: linux-2.6.5/drivers/mtd/afs.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/afs.c 2004-04-03 22:38:15.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/afs.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/afs.c 2004-04-03 22:38:15.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/afs.c 2005-02-01 17:11:17.000000000 -0500 @@ -21,7 +21,7 @@ This is access code for flashes using ARM's flash partitioning standards. @@ -94,10 +94,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/afs.c ======================================================================*/ -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/Kconfig +Index: linux-2.6.5/drivers/mtd/chips/Kconfig =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/chips/Kconfig 2004-04-03 22:36:54.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/Kconfig 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/chips/Kconfig 2004-04-03 22:36:54.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/chips/Kconfig 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ # drivers/mtd/chips/Kconfig -# $Id: Kconfig,v 1.3 2003/05/28 15:13:24 dwmw2 Exp $ @@ -247,10 +247,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/Kconfig bool "Older (theoretically obsoleted now) drivers for non-CFI chips" help This option does not enable any code directly, but will allow you to -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/Makefile +Index: linux-2.6.5/drivers/mtd/chips/Makefile =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/chips/Makefile 2004-04-03 22:36:53.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/Makefile 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/chips/Makefile 2004-04-03 22:36:53.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/chips/Makefile 2005-02-01 17:11:17.000000000 -0500 @@ -1,18 +1,19 @@ # # linux/drivers/chips/Makefile @@ -273,10 +273,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/Makefile obj-$(CONFIG_MTD_CFI_STAA) += cfi_cmdset_0020.o obj-$(CONFIG_MTD_CFI_AMDSTD) += cfi_cmdset_0002.o obj-$(CONFIG_MTD_CFI_INTELEXT) += cfi_cmdset_0001.o -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/amd_flash.c +Index: linux-2.6.5/drivers/mtd/chips/amd_flash.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/chips/amd_flash.c 2004-04-03 22:36:53.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/amd_flash.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/chips/amd_flash.c 2004-04-03 22:36:53.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/chips/amd_flash.c 2005-02-01 17:11:17.000000000 -0500 @@ -3,7 +3,7 @@ * * Author: Jonas Holmberg @@ -316,10 +316,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/amd_flash return 0; } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/cfi_cmdset_0001.c +Index: linux-2.6.5/drivers/mtd/chips/cfi_cmdset_0001.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/chips/cfi_cmdset_0001.c 2004-04-03 22:36:54.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/cfi_cmdset_0001.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/chips/cfi_cmdset_0001.c 2004-04-03 22:36:54.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/chips/cfi_cmdset_0001.c 2005-02-01 17:11:17.000000000 -0500 @@ -4,7 +4,7 @@ * * (C) 2000 Red Hat. GPL'd @@ -1819,10 +1819,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/cfi_cmdse kfree(cfi); kfree(mtd->eraseregions); } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/cfi_cmdset_0002.c +Index: linux-2.6.5/drivers/mtd/chips/cfi_cmdset_0002.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/chips/cfi_cmdset_0002.c 2004-04-03 22:36:57.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/cfi_cmdset_0002.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/chips/cfi_cmdset_0002.c 2004-04-03 22:36:57.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/chips/cfi_cmdset_0002.c 2005-02-01 17:11:17.000000000 -0500 @@ -3,15 +3,21 @@ * AMD & Fujitsu Standard Vendor Command Set (ID 0x0002) * @@ -4002,10 +4002,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/cfi_cmdse MODULE_AUTHOR("Crossnet Co. et al."); MODULE_DESCRIPTION("MTD chip driver for AMD/Fujitsu flash chips"); - -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/cfi_cmdset_0020.c +Index: linux-2.6.5/drivers/mtd/chips/cfi_cmdset_0020.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/chips/cfi_cmdset_0020.c 2004-04-03 22:36:55.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/cfi_cmdset_0020.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/chips/cfi_cmdset_0020.c 2004-04-03 22:36:55.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/chips/cfi_cmdset_0020.c 2005-02-01 17:11:17.000000000 -0500 @@ -4,6 +4,7 @@ * * (C) 2000 Red Hat. GPL'd @@ -4645,10 +4645,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/cfi_cmdse static char im_name[]="cfi_cmdset_0020"; int __init cfi_staa_init(void) -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/cfi_probe.c +Index: linux-2.6.5/drivers/mtd/chips/cfi_probe.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/chips/cfi_probe.c 2004-04-03 22:37:40.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/cfi_probe.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/chips/cfi_probe.c 2004-04-03 22:37:40.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/chips/cfi_probe.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,7 +1,7 @@ /* Common Flash Interface probe code. @@ -4843,10 +4843,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/cfi_probe } else printk("No Vpp line\n"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/cfi_util.c +Index: linux-2.6.5/drivers/mtd/chips/cfi_util.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/chips/cfi_util.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/cfi_util.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/chips/cfi_util.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/chips/cfi_util.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,188 @@ +/* + * Common Flash Interface support: @@ -5036,10 +5036,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/cfi_util. +EXPORT_SYMBOL(cfi_varsize_frob); + +MODULE_LICENSE("GPL"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/chipreg.c +Index: linux-2.6.5/drivers/mtd/chips/chipreg.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/chips/chipreg.c 2004-04-03 22:36:56.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/chipreg.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/chips/chipreg.c 2004-04-03 22:36:56.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/chips/chipreg.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: chipreg.c,v 1.15 2003/05/21 15:15:05 dwmw2 Exp $ @@ -5047,10 +5047,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/chipreg.c * * Registration for chip drivers * -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/fwh_lock.h +Index: linux-2.6.5/drivers/mtd/chips/fwh_lock.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/chips/fwh_lock.h 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/fwh_lock.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/chips/fwh_lock.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/chips/fwh_lock.h 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,107 @@ +#ifndef FWH_LOCK_H +#define FWH_LOCK_H @@ -5159,10 +5159,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/fwh_lock. + mtd->unlock = fwh_unlock_varsize; +} +#endif /* FWH_LOCK_H */ -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/gen_probe.c +Index: linux-2.6.5/drivers/mtd/chips/gen_probe.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/chips/gen_probe.c 2004-11-11 10:28:18.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/gen_probe.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/chips/gen_probe.c 2005-02-01 16:55:45.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/chips/gen_probe.c 2005-02-01 17:11:17.000000000 -0500 @@ -2,7 +2,7 @@ * Routines common to all CFI-type probes. * (C) 2001-2003 Red Hat, Inc. @@ -5463,10 +5463,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/gen_probe typedef struct mtd_info *cfi_cmdset_fn_t(struct map_info *, int); extern cfi_cmdset_fn_t cfi_cmdset_0001; -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/jedec.c +Index: linux-2.6.5/drivers/mtd/chips/jedec.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/chips/jedec.c 2004-04-03 22:37:23.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/jedec.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/chips/jedec.c 2004-04-03 22:37:23.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/chips/jedec.c 2005-02-01 17:11:17.000000000 -0500 @@ -11,7 +11,7 @@ * not going to guess how to send commands to them, plus I expect they will * all speak CFI.. @@ -5549,10 +5549,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/jedec.c return 0; #undef flread -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/jedec_probe.c +Index: linux-2.6.5/drivers/mtd/chips/jedec_probe.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/chips/jedec_probe.c 2004-11-11 10:28:19.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/jedec_probe.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/chips/jedec_probe.c 2005-02-01 16:55:45.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/chips/jedec_probe.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,9 +1,11 @@ /* Common Flash Interface probe code. @@ -6435,10 +6435,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/jedec_pro return 1; } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/map_ram.c +Index: linux-2.6.5/drivers/mtd/chips/map_ram.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/chips/map_ram.c 2004-04-03 22:36:55.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/map_ram.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/chips/map_ram.c 2004-04-03 22:36:55.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/chips/map_ram.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,7 +1,7 @@ /* * Common code to handle map devices which are simple RAM @@ -6470,10 +6470,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/map_ram.c return 0; } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/map_rom.c +Index: linux-2.6.5/drivers/mtd/chips/map_rom.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/chips/map_rom.c 2004-04-03 22:37:25.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/map_rom.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/chips/map_rom.c 2004-04-03 22:37:25.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/chips/map_rom.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,7 +1,7 @@ /* * Common code to handle map devices which are simple ROM @@ -6483,10 +6483,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/map_rom.c */ #include -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/sharp.c +Index: linux-2.6.5/drivers/mtd/chips/sharp.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/chips/sharp.c 2004-04-03 22:37:23.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/sharp.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/chips/sharp.c 2004-04-03 22:37:23.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/chips/sharp.c 2005-02-01 17:11:17.000000000 -0500 @@ -4,7 +4,7 @@ * Copyright 2000,2001 David A. Schleef * 2000,2001 Lineo, Inc. @@ -6523,10 +6523,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/chips/sharp.c return 0; } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/cmdlinepart.c +Index: linux-2.6.5/drivers/mtd/cmdlinepart.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/cmdlinepart.c 2004-04-03 22:37:37.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/cmdlinepart.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/cmdlinepart.c 2004-04-03 22:37:37.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/cmdlinepart.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: cmdlinepart.c,v 1.9 2003/05/16 17:08:24 dwmw2 Exp $ @@ -6600,10 +6600,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/cmdlinepart.c MODULE_LICENSE("GPL"); MODULE_AUTHOR("Marius Groeger "); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/Kconfig +Index: linux-2.6.5/drivers/mtd/devices/Kconfig =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/devices/Kconfig 2004-04-03 22:38:28.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/Kconfig 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/devices/Kconfig 2004-04-03 22:38:28.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/devices/Kconfig 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ # drivers/mtd/maps/Kconfig -# $Id: Kconfig,v 1.4 2003/05/28 15:18:54 dwmw2 Exp $ @@ -6703,10 +6703,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/Kconfig config MTD_DOCPROBE_ADVANCED bool "Advanced detection options for DiskOnChip" -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/Makefile +Index: linux-2.6.5/drivers/mtd/devices/Makefile =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/devices/Makefile 2004-04-03 22:36:13.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/Makefile 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/devices/Makefile 2004-04-03 22:36:13.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/devices/Makefile 2005-02-01 17:11:17.000000000 -0500 @@ -1,7 +1,7 @@ # # linux/drivers/devices/Makefile @@ -6728,10 +6728,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/Makefil obj-$(CONFIG_MTD_PMC551) += pmc551.o obj-$(CONFIG_MTD_MS02NV) += ms02-nv.o obj-$(CONFIG_MTD_MTDRAM) += mtdram.o -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/blkmtd-24.c +Index: linux-2.6.5/drivers/mtd/devices/blkmtd-24.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/devices/blkmtd-24.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/blkmtd-24.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/devices/blkmtd-24.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/devices/blkmtd-24.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,1056 @@ +/* + * $Id: blkmtd-24.c,v 1.23 2004/08/09 18:49:42 dmarlin Exp $ @@ -7789,10 +7789,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/blkmtd- + +module_init(init_blkmtd); +module_exit(cleanup_blkmtd); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/blkmtd.c +Index: linux-2.6.5/drivers/mtd/devices/blkmtd.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/devices/blkmtd.c 2004-11-11 10:27:58.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/blkmtd.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/devices/blkmtd.c 2005-02-01 16:55:31.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/devices/blkmtd.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: blkmtd-25.c,v 1.5 2003/07/16 06:48:27 spse Exp $ @@ -7962,10 +7962,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/blkmtd. erase_size, total_size, *regions); return info; } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/doc2000.c +Index: linux-2.6.5/drivers/mtd/devices/doc2000.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/devices/doc2000.c 2004-04-03 22:36:12.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/doc2000.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/devices/doc2000.c 2004-04-03 22:36:12.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/devices/doc2000.c 2005-02-01 17:11:17.000000000 -0500 @@ -4,7 +4,7 @@ * (c) 1999 Machine Vision Holdings, Inc. * (c) 1999, 2000 David Woodhouse @@ -8985,10 +8985,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/doc2000 up(&this->lock); return 0; -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/doc2001.c +Index: linux-2.6.5/drivers/mtd/devices/doc2001.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/devices/doc2001.c 2004-04-03 22:36:54.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/doc2001.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/devices/doc2001.c 2004-04-03 22:36:54.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/devices/doc2001.c 2005-02-01 17:11:17.000000000 -0500 @@ -4,7 +4,7 @@ * (c) 1999 Machine Vision Holdings, Inc. * (c) 1999, 2000 David Woodhouse @@ -9172,10 +9172,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/doc2001 return 0; } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/doc2001plus.c +Index: linux-2.6.5/drivers/mtd/devices/doc2001plus.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/devices/doc2001plus.c 2004-04-03 22:36:12.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/doc2001plus.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/devices/doc2001plus.c 2004-04-03 22:36:12.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/devices/doc2001plus.c 2005-02-01 17:11:17.000000000 -0500 @@ -6,7 +6,9 @@ * (c) 1999 Machine Vision Holdings, Inc. * (c) 1999, 2000 David Woodhouse @@ -9488,10 +9488,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/doc2001 return 0; } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/docprobe.c +Index: linux-2.6.5/drivers/mtd/devices/docprobe.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/devices/docprobe.c 2004-04-03 22:37:37.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/docprobe.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/devices/docprobe.c 2004-04-03 22:37:37.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/devices/docprobe.c 2005-02-01 17:11:17.000000000 -0500 @@ -4,7 +4,7 @@ /* (C) 1999 Machine Vision Holdings, Inc. */ /* (C) 1999-2003 David Woodhouse */ @@ -9576,10 +9576,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/docprob case DOC_ChipID_Doc2k: name="2000"; im_funcname = "DoC2k_init"; -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/lart.c +Index: linux-2.6.5/drivers/mtd/devices/lart.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/devices/lart.c 2004-04-03 22:36:57.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/lart.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/devices/lart.c 2004-04-03 22:36:57.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/devices/lart.c 2005-02-01 17:11:17.000000000 -0500 @@ -2,7 +2,7 @@ /* * MTD driver for the 28F160F3 Flash Memory (non-CFI) on LART. @@ -9598,10 +9598,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/lart.c return (0); } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/ms02-nv.c +Index: linux-2.6.5/drivers/mtd/devices/ms02-nv.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/devices/ms02-nv.c 2004-04-03 22:36:15.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/ms02-nv.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/devices/ms02-nv.c 2004-04-03 22:36:15.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/devices/ms02-nv.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,12 +1,12 @@ /* - * Copyright (c) 2001 Maciej W. Rozycki @@ -9678,10 +9678,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/ms02-nv csr = (volatile u32 *)KN03_MCR_BASE; if (*csr & KN03_MCR_BNK32M) stride = 2; -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/ms02-nv.h +Index: linux-2.6.5/drivers/mtd/devices/ms02-nv.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/devices/ms02-nv.h 2004-04-03 22:37:07.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/ms02-nv.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/devices/ms02-nv.h 2004-04-03 22:37:07.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/devices/ms02-nv.h 2005-02-01 17:11:17.000000000 -0500 @@ -1,34 +1,96 @@ /* - * Copyright (c) 2001 Maciej W. Rozycki @@ -9789,10 +9789,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/ms02-nv typedef volatile u32 ms02nv_uint; struct ms02nv_private { -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/mtdram.c +Index: linux-2.6.5/drivers/mtd/devices/mtdram.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/devices/mtdram.c 2004-04-03 22:36:15.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/mtdram.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/devices/mtdram.c 2004-04-03 22:36:15.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/devices/mtdram.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,6 +1,6 @@ /* * mtdram - a test mtd device @@ -9812,10 +9812,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/mtdram. return 0; } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/phram.c +Index: linux-2.6.5/drivers/mtd/devices/phram.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/devices/phram.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/phram.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/devices/phram.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/devices/phram.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,359 @@ +/** + * @@ -10176,10 +10176,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/phram.c +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Jörn Engel "); +MODULE_DESCRIPTION("MTD driver for physical RAM"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/pmc551.c +Index: linux-2.6.5/drivers/mtd/devices/pmc551.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/devices/pmc551.c 2004-04-03 22:37:41.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/pmc551.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/devices/pmc551.c 2004-04-03 22:37:41.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/devices/pmc551.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: pmc551.c,v 1.24 2003/05/20 21:03:08 dwmw2 Exp $ @@ -10238,10 +10238,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/pmc551. & PCI_BASE_ADDRESS_MEM_MASK), priv->asize); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/slram.c +Index: linux-2.6.5/drivers/mtd/devices/slram.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/devices/slram.c 2004-04-03 22:36:12.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/slram.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/devices/slram.c 2004-04-03 22:36:12.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/devices/slram.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,6 +1,6 @@ /*====================================================================== @@ -10264,2169 +10264,373 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/devices/slram.c return(0); } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/ftl.c +Index: linux-2.6.5/drivers/mtd/ftl.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/ftl.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/ftl.c 2004-11-18 18:39:09.000000000 -0500 -@@ -0,0 +1,1113 @@ -+/* This version ported to the Linux-MTD system by dwmw2@infradead.org +--- linux-2.6.5.orig/drivers/mtd/ftl.c 2004-04-03 22:37:45.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/ftl.c 2005-02-01 17:11:29.000000000 -0500 +@@ -1,5 +1,5 @@ + /* This version ported to the Linux-MTD system by dwmw2@infradead.org +- * $Id: ftl.c,v 1.51 2003/06/23 12:00:08 dwmw2 Exp $ + * $Id: ftl.c,v 1.53 2004/08/09 13:55:43 dwmw2 Exp $ -+ * -+ * Fixes: Arnaldo Carvalho de Melo -+ * - fixes some leaks on failure in build_maps and ftl_notify_add, cleanups -+ * -+ * Based on: -+ */ -+/*====================================================================== -+ -+ A Flash Translation Layer memory card driver -+ -+ This driver implements a disk-like block device driver with an -+ apparent block size of 512 bytes for flash memory cards. -+ -+ ftl_cs.c 1.62 2000/02/01 00:59:04 -+ -+ The contents of this file are subject to the Mozilla Public -+ License Version 1.1 (the "License"); you may not use this file -+ except in compliance with the License. You may obtain a copy of -+ the License at http://www.mozilla.org/MPL/ -+ -+ Software distributed under the License is distributed on an "AS -+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -+ implied. See the License for the specific language governing -+ rights and limitations under the License. -+ -+ The initial developer of the original code is David A. Hinds -+ . Portions created by David A. Hinds -+ are Copyright (C) 1999 David A. Hinds. All Rights Reserved. -+ -+ Alternatively, the contents of this file may be used under the -+ terms of the GNU General Public License version 2 (the "GPL"), in -+ which case the provisions of the GPL are applicable instead of the -+ above. If you wish to allow the use of your version of this file -+ only under the terms of the GPL and not to allow others to use -+ your version of this file under the MPL, indicate your decision -+ by deleting the provisions above and replace them with the notice -+ and other provisions required by the GPL. If you do not delete -+ the provisions above, a recipient may use your version of this -+ file under either the MPL or the GPL. -+ -+ LEGAL NOTE: The FTL format is patented by M-Systems. They have -+ granted a license for its use with PCMCIA devices: -+ -+ "M-Systems grants a royalty-free, non-exclusive license under -+ any presently existing M-Systems intellectual property rights -+ necessary for the design and development of FTL-compatible -+ drivers, file systems and utilities using the data formats with -+ PCMCIA PC Cards as described in the PCMCIA Flash Translation -+ Layer (FTL) Specification." -+ -+ Use of the FTL format for non-PCMCIA applications may be an -+ infringement of these patents. For additional information, -+ contact M-Systems (http://www.m-sys.com) directly. -+ -+======================================================================*/ -+#include -+#include -+#include -+/*#define PSYCHO_DEBUG */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+/*====================================================================*/ -+ -+/* Parameters that can be set with 'insmod' */ -+static int shuffle_freq = 50; -+MODULE_PARM(shuffle_freq, "i"); -+ -+/*====================================================================*/ -+ -+/* Major device # for FTL device */ -+#ifndef FTL_MAJOR -+#define FTL_MAJOR 44 -+#endif -+ -+ -+/*====================================================================*/ -+ -+/* Maximum number of separate memory devices we'll allow */ -+#define MAX_DEV 4 -+ -+/* Maximum number of regions per device */ -+#define MAX_REGION 4 -+ -+/* Maximum number of partitions in an FTL region */ -+#define PART_BITS 4 -+ -+/* Maximum number of outstanding erase requests per socket */ -+#define MAX_ERASE 8 -+ -+/* Sector size -- shouldn't need to change */ -+#define SECTOR_SIZE 512 -+ -+ -+/* Each memory region corresponds to a minor device */ -+typedef struct partition_t { -+ struct mtd_blktrans_dev mbd; -+ u_int32_t state; -+ u_int32_t *VirtualBlockMap; -+ u_int32_t *VirtualPageMap; -+ u_int32_t FreeTotal; -+ struct eun_info_t { -+ u_int32_t Offset; -+ u_int32_t EraseCount; -+ u_int32_t Free; -+ u_int32_t Deleted; -+ } *EUNInfo; -+ struct xfer_info_t { -+ u_int32_t Offset; -+ u_int32_t EraseCount; -+ u_int16_t state; -+ } *XferInfo; -+ u_int16_t bam_index; -+ u_int32_t *bam_cache; -+ u_int16_t DataUnits; -+ u_int32_t BlocksPerUnit; -+ erase_unit_header_t header; -+#if 0 -+ region_info_t region; -+ memory_handle_t handle; -+#endif -+} partition_t; -+ -+void ftl_freepart(partition_t *part); -+ -+/* Partition state flags */ -+#define FTL_FORMATTED 0x01 -+ -+/* Transfer unit states */ -+#define XFER_UNKNOWN 0x00 -+#define XFER_ERASING 0x01 -+#define XFER_ERASED 0x02 -+#define XFER_PREPARED 0x03 -+#define XFER_FAILED 0x04 -+ -+/*====================================================================*/ -+ -+ -+static void ftl_erase_callback(struct erase_info *done); -+ -+ -+/*====================================================================== -+ -+ Scan_header() checks to see if a memory region contains an FTL -+ partition. build_maps() reads all the erase unit headers, builds -+ the erase unit map, and then builds the virtual page map. -+ -+======================================================================*/ -+ -+static int scan_header(partition_t *part) -+{ -+ erase_unit_header_t header; -+ loff_t offset, max_offset; + * + * Fixes: Arnaldo Carvalho de Melo + * - fixes some leaks on failure in build_maps and ftl_notify_add, cleanups +@@ -167,7 +167,8 @@ + { + erase_unit_header_t header; + loff_t offset, max_offset; +- int ret; + size_t ret; -+ int err; -+ part->header.FormattedSize = 0; -+ max_offset = (0x100000mbd.mtd->size)?0x100000:part->mbd.mtd->size; -+ /* Search first megabyte for a valid FTL header */ -+ for (offset = 0; -+ (offset + sizeof(header)) < max_offset; -+ offset += part->mbd.mtd->erasesize ? : 0x2000) { -+ -+ err = part->mbd.mtd->read(part->mbd.mtd, offset, sizeof(header), &ret, -+ (unsigned char *)&header); -+ -+ if (err) -+ return err; -+ -+ if (strcmp(header.DataOrgTuple+3, "FTL100") == 0) break; -+ } -+ -+ if (offset == max_offset) { -+ printk(KERN_NOTICE "ftl_cs: FTL header not found.\n"); -+ return -ENOENT; -+ } -+ if (header.BlockSize != 9 || -+ (header.EraseUnitSize < 10) || (header.EraseUnitSize > 31) || -+ (header.NumTransferUnits >= le16_to_cpu(header.NumEraseUnits))) { -+ printk(KERN_NOTICE "ftl_cs: FTL header corrupt!\n"); -+ return -1; -+ } -+ if ((1 << header.EraseUnitSize) != part->mbd.mtd->erasesize) { -+ printk(KERN_NOTICE "ftl: FTL EraseUnitSize %x != MTD erasesize %x\n", -+ 1 << header.EraseUnitSize,part->mbd.mtd->erasesize); -+ return -1; -+ } -+ part->header = header; -+ return 0; -+} -+ -+static int build_maps(partition_t *part) -+{ -+ erase_unit_header_t header; -+ u_int16_t xvalid, xtrans, i; -+ u_int blocks, j; -+ int hdr_ok, ret = -1; -+ ssize_t retval; -+ loff_t offset; -+ -+ /* Set up erase unit maps */ -+ part->DataUnits = le16_to_cpu(part->header.NumEraseUnits) - -+ part->header.NumTransferUnits; -+ part->EUNInfo = kmalloc(part->DataUnits * sizeof(struct eun_info_t), -+ GFP_KERNEL); -+ if (!part->EUNInfo) -+ goto out; -+ for (i = 0; i < part->DataUnits; i++) -+ part->EUNInfo[i].Offset = 0xffffffff; -+ part->XferInfo = -+ kmalloc(part->header.NumTransferUnits * sizeof(struct xfer_info_t), -+ GFP_KERNEL); -+ if (!part->XferInfo) -+ goto out_EUNInfo; -+ -+ xvalid = xtrans = 0; -+ for (i = 0; i < le16_to_cpu(part->header.NumEraseUnits); i++) { -+ offset = ((i + le16_to_cpu(part->header.FirstPhysicalEUN)) -+ << part->header.EraseUnitSize); -+ ret = part->mbd.mtd->read(part->mbd.mtd, offset, sizeof(header), &retval, -+ (unsigned char *)&header); -+ -+ if (ret) -+ goto out_XferInfo; -+ -+ ret = -1; -+ /* Is this a transfer partition? */ -+ hdr_ok = (strcmp(header.DataOrgTuple+3, "FTL100") == 0); -+ if (hdr_ok && (le16_to_cpu(header.LogicalEUN) < part->DataUnits) && -+ (part->EUNInfo[le16_to_cpu(header.LogicalEUN)].Offset == 0xffffffff)) { -+ part->EUNInfo[le16_to_cpu(header.LogicalEUN)].Offset = offset; -+ part->EUNInfo[le16_to_cpu(header.LogicalEUN)].EraseCount = -+ le32_to_cpu(header.EraseCount); -+ xvalid++; -+ } else { -+ if (xtrans == part->header.NumTransferUnits) { -+ printk(KERN_NOTICE "ftl_cs: format error: too many " -+ "transfer units!\n"); -+ goto out_XferInfo; -+ } -+ if (hdr_ok && (le16_to_cpu(header.LogicalEUN) == 0xffff)) { -+ part->XferInfo[xtrans].state = XFER_PREPARED; -+ part->XferInfo[xtrans].EraseCount = le32_to_cpu(header.EraseCount); -+ } else { -+ part->XferInfo[xtrans].state = XFER_UNKNOWN; -+ /* Pick anything reasonable for the erase count */ -+ part->XferInfo[xtrans].EraseCount = -+ le32_to_cpu(part->header.EraseCount); -+ } -+ part->XferInfo[xtrans].Offset = offset; -+ xtrans++; -+ } -+ } -+ /* Check for format trouble */ -+ header = part->header; -+ if ((xtrans != header.NumTransferUnits) || -+ (xvalid+xtrans != le16_to_cpu(header.NumEraseUnits))) { -+ printk(KERN_NOTICE "ftl_cs: format error: erase units " -+ "don't add up!\n"); -+ goto out_XferInfo; -+ } -+ -+ /* Set up virtual page map */ -+ blocks = le32_to_cpu(header.FormattedSize) >> header.BlockSize; -+ part->VirtualBlockMap = vmalloc(blocks * sizeof(u_int32_t)); -+ if (!part->VirtualBlockMap) -+ goto out_XferInfo; -+ -+ memset(part->VirtualBlockMap, 0xff, blocks * sizeof(u_int32_t)); -+ part->BlocksPerUnit = (1 << header.EraseUnitSize) >> header.BlockSize; -+ -+ part->bam_cache = kmalloc(part->BlocksPerUnit * sizeof(u_int32_t), -+ GFP_KERNEL); -+ if (!part->bam_cache) -+ goto out_VirtualBlockMap; -+ -+ part->bam_index = 0xffff; -+ part->FreeTotal = 0; -+ -+ for (i = 0; i < part->DataUnits; i++) { -+ part->EUNInfo[i].Free = 0; -+ part->EUNInfo[i].Deleted = 0; -+ offset = part->EUNInfo[i].Offset + le32_to_cpu(header.BAMOffset); -+ -+ ret = part->mbd.mtd->read(part->mbd.mtd, offset, -+ part->BlocksPerUnit * sizeof(u_int32_t), &retval, -+ (unsigned char *)part->bam_cache); -+ -+ if (ret) -+ goto out_bam_cache; -+ -+ for (j = 0; j < part->BlocksPerUnit; j++) { -+ if (BLOCK_FREE(le32_to_cpu(part->bam_cache[j]))) { -+ part->EUNInfo[i].Free++; -+ part->FreeTotal++; -+ } else if ((BLOCK_TYPE(le32_to_cpu(part->bam_cache[j])) == BLOCK_DATA) && -+ (BLOCK_NUMBER(le32_to_cpu(part->bam_cache[j])) < blocks)) -+ part->VirtualBlockMap[BLOCK_NUMBER(le32_to_cpu(part->bam_cache[j]))] = -+ (i << header.EraseUnitSize) + (j << header.BlockSize); -+ else if (BLOCK_DELETED(le32_to_cpu(part->bam_cache[j]))) -+ part->EUNInfo[i].Deleted++; -+ } -+ } -+ -+ ret = 0; -+ goto out; -+ -+out_bam_cache: -+ kfree(part->bam_cache); -+out_VirtualBlockMap: -+ vfree(part->VirtualBlockMap); -+out_XferInfo: -+ kfree(part->XferInfo); -+out_EUNInfo: -+ kfree(part->EUNInfo); -+out: -+ return ret; -+} /* build_maps */ -+ -+/*====================================================================== -+ -+ Erase_xfer() schedules an asynchronous erase operation for a -+ transfer unit. -+ -+======================================================================*/ -+ -+static int erase_xfer(partition_t *part, -+ u_int16_t xfernum) -+{ -+ int ret; -+ struct xfer_info_t *xfer; -+ struct erase_info *erase; -+ -+ xfer = &part->XferInfo[xfernum]; -+ DEBUG(1, "ftl_cs: erasing xfer unit at 0x%x\n", xfer->Offset); -+ xfer->state = XFER_ERASING; -+ -+ /* Is there a free erase slot? Always in MTD. */ -+ -+ -+ erase=kmalloc(sizeof(struct erase_info), GFP_KERNEL); -+ if (!erase) -+ return -ENOMEM; -+ -+ erase->callback = ftl_erase_callback; -+ erase->addr = xfer->Offset; -+ erase->len = 1 << part->header.EraseUnitSize; -+ erase->priv = (u_long)part; -+ -+ ret = part->mbd.mtd->erase(part->mbd.mtd, erase); -+ -+ if (!ret) -+ xfer->EraseCount++; -+ else -+ kfree(erase); -+ -+ return ret; -+} /* erase_xfer */ -+ -+/*====================================================================== -+ -+ Prepare_xfer() takes a freshly erased transfer unit and gives -+ it an appropriate header. -+ -+======================================================================*/ -+ -+static void ftl_erase_callback(struct erase_info *erase) -+{ -+ partition_t *part; -+ struct xfer_info_t *xfer; -+ int i; -+ -+ /* Look up the transfer unit */ -+ part = (partition_t *)(erase->priv); -+ -+ for (i = 0; i < part->header.NumTransferUnits; i++) -+ if (part->XferInfo[i].Offset == erase->addr) break; -+ -+ if (i == part->header.NumTransferUnits) { -+ printk(KERN_NOTICE "ftl_cs: internal error: " -+ "erase lookup failed!\n"); -+ return; -+ } -+ -+ xfer = &part->XferInfo[i]; -+ if (erase->state == MTD_ERASE_DONE) -+ xfer->state = XFER_ERASED; -+ else { -+ xfer->state = XFER_FAILED; -+ printk(KERN_NOTICE "ftl_cs: erase failed: state = %d\n", -+ erase->state); -+ } -+ -+ kfree(erase); -+ -+} /* ftl_erase_callback */ -+ -+static int prepare_xfer(partition_t *part, int i) -+{ -+ erase_unit_header_t header; -+ struct xfer_info_t *xfer; -+ int nbam, ret; -+ u_int32_t ctl; -+ ssize_t retlen; -+ loff_t offset; -+ -+ xfer = &part->XferInfo[i]; -+ xfer->state = XFER_FAILED; -+ -+ DEBUG(1, "ftl_cs: preparing xfer unit at 0x%x\n", xfer->Offset); -+ -+ /* Write the transfer unit header */ -+ header = part->header; -+ header.LogicalEUN = cpu_to_le16(0xffff); -+ header.EraseCount = cpu_to_le32(xfer->EraseCount); -+ -+ ret = part->mbd.mtd->write(part->mbd.mtd, xfer->Offset, sizeof(header), -+ &retlen, (u_char *)&header); -+ -+ if (ret) { -+ return ret; -+ } -+ -+ /* Write the BAM stub */ -+ nbam = (part->BlocksPerUnit * sizeof(u_int32_t) + -+ le32_to_cpu(part->header.BAMOffset) + SECTOR_SIZE - 1) / SECTOR_SIZE; -+ -+ offset = xfer->Offset + le32_to_cpu(part->header.BAMOffset); -+ ctl = cpu_to_le32(BLOCK_CONTROL); -+ -+ for (i = 0; i < nbam; i++, offset += sizeof(u_int32_t)) { -+ -+ ret = part->mbd.mtd->write(part->mbd.mtd, offset, sizeof(u_int32_t), -+ &retlen, (u_char *)&ctl); -+ -+ if (ret) -+ return ret; -+ } -+ xfer->state = XFER_PREPARED; -+ return 0; -+ -+} /* prepare_xfer */ -+ -+/*====================================================================== -+ -+ Copy_erase_unit() takes a full erase block and a transfer unit, -+ copies everything to the transfer unit, then swaps the block -+ pointers. -+ -+ All data blocks are copied to the corresponding blocks in the -+ target unit, so the virtual block map does not need to be -+ updated. -+ -+======================================================================*/ -+ -+static int copy_erase_unit(partition_t *part, u_int16_t srcunit, -+ u_int16_t xferunit) -+{ -+ u_char buf[SECTOR_SIZE]; -+ struct eun_info_t *eun; -+ struct xfer_info_t *xfer; -+ u_int32_t src, dest, free, i; -+ u_int16_t unit; -+ int ret; -+ ssize_t retlen; -+ loff_t offset; -+ u_int16_t srcunitswap = cpu_to_le16(srcunit); -+ -+ eun = &part->EUNInfo[srcunit]; -+ xfer = &part->XferInfo[xferunit]; -+ DEBUG(2, "ftl_cs: copying block 0x%x to 0x%x\n", -+ eun->Offset, xfer->Offset); -+ -+ -+ /* Read current BAM */ -+ if (part->bam_index != srcunit) { -+ -+ offset = eun->Offset + le32_to_cpu(part->header.BAMOffset); -+ -+ ret = part->mbd.mtd->read(part->mbd.mtd, offset, -+ part->BlocksPerUnit * sizeof(u_int32_t), -+ &retlen, (u_char *) (part->bam_cache)); -+ -+ /* mark the cache bad, in case we get an error later */ -+ part->bam_index = 0xffff; -+ -+ if (ret) { -+ printk( KERN_WARNING "ftl: Failed to read BAM cache in copy_erase_unit()!\n"); -+ return ret; -+ } -+ } -+ -+ /* Write the LogicalEUN for the transfer unit */ -+ xfer->state = XFER_UNKNOWN; -+ offset = xfer->Offset + 20; /* Bad! */ -+ unit = cpu_to_le16(0x7fff); -+ -+ ret = part->mbd.mtd->write(part->mbd.mtd, offset, sizeof(u_int16_t), -+ &retlen, (u_char *) &unit); -+ -+ if (ret) { -+ printk( KERN_WARNING "ftl: Failed to write back to BAM cache in copy_erase_unit()!\n"); -+ return ret; -+ } -+ -+ /* Copy all data blocks from source unit to transfer unit */ -+ src = eun->Offset; dest = xfer->Offset; -+ -+ free = 0; -+ ret = 0; -+ for (i = 0; i < part->BlocksPerUnit; i++) { -+ switch (BLOCK_TYPE(le32_to_cpu(part->bam_cache[i]))) { -+ case BLOCK_CONTROL: -+ /* This gets updated later */ -+ break; -+ case BLOCK_DATA: -+ case BLOCK_REPLACEMENT: -+ ret = part->mbd.mtd->read(part->mbd.mtd, src, SECTOR_SIZE, -+ &retlen, (u_char *) buf); -+ if (ret) { -+ printk(KERN_WARNING "ftl: Error reading old xfer unit in copy_erase_unit\n"); -+ return ret; -+ } -+ -+ -+ ret = part->mbd.mtd->write(part->mbd.mtd, dest, SECTOR_SIZE, -+ &retlen, (u_char *) buf); -+ if (ret) { -+ printk(KERN_WARNING "ftl: Error writing new xfer unit in copy_erase_unit\n"); -+ return ret; -+ } -+ -+ break; -+ default: -+ /* All other blocks must be free */ -+ part->bam_cache[i] = cpu_to_le32(0xffffffff); -+ free++; -+ break; -+ } -+ src += SECTOR_SIZE; -+ dest += SECTOR_SIZE; -+ } -+ -+ /* Write the BAM to the transfer unit */ -+ ret = part->mbd.mtd->write(part->mbd.mtd, xfer->Offset + le32_to_cpu(part->header.BAMOffset), -+ part->BlocksPerUnit * sizeof(int32_t), &retlen, -+ (u_char *)part->bam_cache); -+ if (ret) { -+ printk( KERN_WARNING "ftl: Error writing BAM in copy_erase_unit\n"); -+ return ret; -+ } -+ -+ -+ /* All clear? Then update the LogicalEUN again */ -+ ret = part->mbd.mtd->write(part->mbd.mtd, xfer->Offset + 20, sizeof(u_int16_t), -+ &retlen, (u_char *)&srcunitswap); -+ -+ if (ret) { -+ printk(KERN_WARNING "ftl: Error writing new LogicalEUN in copy_erase_unit\n"); -+ return ret; -+ } -+ -+ -+ /* Update the maps and usage stats*/ -+ i = xfer->EraseCount; -+ xfer->EraseCount = eun->EraseCount; -+ eun->EraseCount = i; -+ i = xfer->Offset; -+ xfer->Offset = eun->Offset; -+ eun->Offset = i; -+ part->FreeTotal -= eun->Free; -+ part->FreeTotal += free; -+ eun->Free = free; -+ eun->Deleted = 0; -+ -+ /* Now, the cache should be valid for the new block */ -+ part->bam_index = srcunit; -+ -+ return 0; -+} /* copy_erase_unit */ -+ -+/*====================================================================== -+ -+ reclaim_block() picks a full erase unit and a transfer unit and -+ then calls copy_erase_unit() to copy one to the other. Then, it -+ schedules an erase on the expired block. -+ -+ What's a good way to decide which transfer unit and which erase -+ unit to use? Beats me. My way is to always pick the transfer -+ unit with the fewest erases, and usually pick the data unit with -+ the most deleted blocks. But with a small probability, pick the -+ oldest data unit instead. This means that we generally postpone -+ the next reclaimation as long as possible, but shuffle static -+ stuff around a bit for wear leveling. -+ -+======================================================================*/ -+ -+static int reclaim_block(partition_t *part) -+{ -+ u_int16_t i, eun, xfer; -+ u_int32_t best; -+ int queued, ret; -+ -+ DEBUG(0, "ftl_cs: reclaiming space...\n"); -+ DEBUG(3, "NumTransferUnits == %x\n", part->header.NumTransferUnits); -+ /* Pick the least erased transfer unit */ -+ best = 0xffffffff; xfer = 0xffff; -+ do { -+ queued = 0; -+ for (i = 0; i < part->header.NumTransferUnits; i++) { -+ int n=0; -+ if (part->XferInfo[i].state == XFER_UNKNOWN) { -+ DEBUG(3,"XferInfo[%d].state == XFER_UNKNOWN\n",i); -+ n=1; -+ erase_xfer(part, i); -+ } -+ if (part->XferInfo[i].state == XFER_ERASING) { -+ DEBUG(3,"XferInfo[%d].state == XFER_ERASING\n",i); -+ n=1; -+ queued = 1; -+ } -+ else if (part->XferInfo[i].state == XFER_ERASED) { -+ DEBUG(3,"XferInfo[%d].state == XFER_ERASED\n",i); -+ n=1; -+ prepare_xfer(part, i); -+ } -+ if (part->XferInfo[i].state == XFER_PREPARED) { -+ DEBUG(3,"XferInfo[%d].state == XFER_PREPARED\n",i); -+ n=1; -+ if (part->XferInfo[i].EraseCount <= best) { -+ best = part->XferInfo[i].EraseCount; -+ xfer = i; -+ } -+ } -+ if (!n) -+ DEBUG(3,"XferInfo[%d].state == %x\n",i, part->XferInfo[i].state); -+ -+ } -+ if (xfer == 0xffff) { -+ if (queued) { -+ DEBUG(1, "ftl_cs: waiting for transfer " -+ "unit to be prepared...\n"); -+ if (part->mbd.mtd->sync) -+ part->mbd.mtd->sync(part->mbd.mtd); -+ } else { -+ static int ne = 0; -+ if (++ne < 5) -+ printk(KERN_NOTICE "ftl_cs: reclaim failed: no " -+ "suitable transfer units!\n"); -+ else -+ DEBUG(1, "ftl_cs: reclaim failed: no " -+ "suitable transfer units!\n"); -+ -+ return -EIO; -+ } -+ } -+ } while (xfer == 0xffff); -+ -+ eun = 0; -+ if ((jiffies % shuffle_freq) == 0) { -+ DEBUG(1, "ftl_cs: recycling freshest block...\n"); -+ best = 0xffffffff; -+ for (i = 0; i < part->DataUnits; i++) -+ if (part->EUNInfo[i].EraseCount <= best) { -+ best = part->EUNInfo[i].EraseCount; -+ eun = i; -+ } -+ } else { -+ best = 0; -+ for (i = 0; i < part->DataUnits; i++) -+ if (part->EUNInfo[i].Deleted >= best) { -+ best = part->EUNInfo[i].Deleted; -+ eun = i; -+ } -+ if (best == 0) { -+ static int ne = 0; -+ if (++ne < 5) -+ printk(KERN_NOTICE "ftl_cs: reclaim failed: " -+ "no free blocks!\n"); -+ else -+ DEBUG(1,"ftl_cs: reclaim failed: " -+ "no free blocks!\n"); -+ -+ return -EIO; -+ } -+ } -+ ret = copy_erase_unit(part, eun, xfer); -+ if (!ret) -+ erase_xfer(part, xfer); -+ else -+ printk(KERN_NOTICE "ftl_cs: copy_erase_unit failed!\n"); -+ return ret; -+} /* reclaim_block */ -+ -+/*====================================================================== -+ -+ Find_free() searches for a free block. If necessary, it updates -+ the BAM cache for the erase unit containing the free block. It -+ returns the block index -- the erase unit is just the currently -+ cached unit. If there are no free blocks, it returns 0 -- this -+ is never a valid data block because it contains the header. -+ -+======================================================================*/ -+ -+#ifdef PSYCHO_DEBUG -+static void dump_lists(partition_t *part) -+{ -+ int i; -+ printk(KERN_DEBUG "ftl_cs: Free total = %d\n", part->FreeTotal); -+ for (i = 0; i < part->DataUnits; i++) -+ printk(KERN_DEBUG "ftl_cs: unit %d: %d phys, %d free, " -+ "%d deleted\n", i, -+ part->EUNInfo[i].Offset >> part->header.EraseUnitSize, -+ part->EUNInfo[i].Free, part->EUNInfo[i].Deleted); -+} -+#endif -+ -+static u_int32_t find_free(partition_t *part) -+{ -+ u_int16_t stop, eun; -+ u_int32_t blk; -+ size_t retlen; -+ int ret; -+ -+ /* Find an erase unit with some free space */ -+ stop = (part->bam_index == 0xffff) ? 0 : part->bam_index; -+ eun = stop; -+ do { -+ if (part->EUNInfo[eun].Free != 0) break; -+ /* Wrap around at end of table */ -+ if (++eun == part->DataUnits) eun = 0; -+ } while (eun != stop); -+ -+ if (part->EUNInfo[eun].Free == 0) -+ return 0; -+ -+ /* Is this unit's BAM cached? */ -+ if (eun != part->bam_index) { -+ /* Invalidate cache */ -+ part->bam_index = 0xffff; -+ -+ ret = part->mbd.mtd->read(part->mbd.mtd, -+ part->EUNInfo[eun].Offset + le32_to_cpu(part->header.BAMOffset), -+ part->BlocksPerUnit * sizeof(u_int32_t), -+ &retlen, (u_char *) (part->bam_cache)); -+ -+ if (ret) { -+ printk(KERN_WARNING"ftl: Error reading BAM in find_free\n"); -+ return 0; -+ } -+ part->bam_index = eun; -+ } -+ -+ /* Find a free block */ -+ for (blk = 0; blk < part->BlocksPerUnit; blk++) -+ if (BLOCK_FREE(le32_to_cpu(part->bam_cache[blk]))) break; -+ if (blk == part->BlocksPerUnit) { -+#ifdef PSYCHO_DEBUG -+ static int ne = 0; -+ if (++ne == 1) -+ dump_lists(part); -+#endif -+ printk(KERN_NOTICE "ftl_cs: bad free list!\n"); -+ return 0; -+ } -+ DEBUG(2, "ftl_cs: found free block at %d in %d\n", blk, eun); -+ return blk; -+ -+} /* find_free */ -+ -+ -+/*====================================================================== -+ -+ Read a series of sectors from an FTL partition. -+ -+======================================================================*/ -+ -+static int ftl_read(partition_t *part, caddr_t buffer, -+ u_long sector, u_long nblocks) -+{ -+ u_int32_t log_addr, bsize; -+ u_long i; -+ int ret; -+ size_t offset, retlen; -+ -+ DEBUG(2, "ftl_cs: ftl_read(0x%p, 0x%lx, %ld)\n", -+ part, sector, nblocks); -+ if (!(part->state & FTL_FORMATTED)) { -+ printk(KERN_NOTICE "ftl_cs: bad partition\n"); -+ return -EIO; -+ } -+ bsize = 1 << part->header.EraseUnitSize; -+ -+ for (i = 0; i < nblocks; i++) { -+ if (((sector+i) * SECTOR_SIZE) >= le32_to_cpu(part->header.FormattedSize)) { -+ printk(KERN_NOTICE "ftl_cs: bad read offset\n"); -+ return -EIO; -+ } -+ log_addr = part->VirtualBlockMap[sector+i]; -+ if (log_addr == 0xffffffff) -+ memset(buffer, 0, SECTOR_SIZE); -+ else { -+ offset = (part->EUNInfo[log_addr / bsize].Offset -+ + (log_addr % bsize)); -+ ret = part->mbd.mtd->read(part->mbd.mtd, offset, SECTOR_SIZE, -+ &retlen, (u_char *) buffer); -+ -+ if (ret) { -+ printk(KERN_WARNING "Error reading MTD device in ftl_read()\n"); -+ return ret; -+ } -+ } -+ buffer += SECTOR_SIZE; -+ } -+ return 0; -+} /* ftl_read */ -+ -+/*====================================================================== -+ -+ Write a series of sectors to an FTL partition -+ -+======================================================================*/ -+ -+static int set_bam_entry(partition_t *part, u_int32_t log_addr, -+ u_int32_t virt_addr) -+{ -+ u_int32_t bsize, blk, le_virt_addr; -+#ifdef PSYCHO_DEBUG -+ u_int32_t old_addr; -+#endif -+ u_int16_t eun; -+ int ret; -+ size_t retlen, offset; -+ -+ DEBUG(2, "ftl_cs: set_bam_entry(0x%p, 0x%x, 0x%x)\n", -+ part, log_addr, virt_addr); -+ bsize = 1 << part->header.EraseUnitSize; -+ eun = log_addr / bsize; -+ blk = (log_addr % bsize) / SECTOR_SIZE; -+ offset = (part->EUNInfo[eun].Offset + blk * sizeof(u_int32_t) + -+ le32_to_cpu(part->header.BAMOffset)); -+ -+#ifdef PSYCHO_DEBUG -+ ret = part->mbd.mtd->read(part->mbd.mtd, offset, sizeof(u_int32_t), -+ &retlen, (u_char *)&old_addr); -+ if (ret) { -+ printk(KERN_WARNING"ftl: Error reading old_addr in set_bam_entry: %d\n",ret); -+ return ret; -+ } -+ old_addr = le32_to_cpu(old_addr); -+ -+ if (((virt_addr == 0xfffffffe) && !BLOCK_FREE(old_addr)) || -+ ((virt_addr == 0) && (BLOCK_TYPE(old_addr) != BLOCK_DATA)) || -+ (!BLOCK_DELETED(virt_addr) && (old_addr != 0xfffffffe))) { -+ static int ne = 0; -+ if (++ne < 5) { -+ printk(KERN_NOTICE "ftl_cs: set_bam_entry() inconsistency!\n"); -+ printk(KERN_NOTICE "ftl_cs: log_addr = 0x%x, old = 0x%x" -+ ", new = 0x%x\n", log_addr, old_addr, virt_addr); -+ } -+ return -EIO; -+ } -+#endif -+ le_virt_addr = cpu_to_le32(virt_addr); -+ if (part->bam_index == eun) { -+#ifdef PSYCHO_DEBUG -+ if (le32_to_cpu(part->bam_cache[blk]) != old_addr) { -+ static int ne = 0; -+ if (++ne < 5) { -+ printk(KERN_NOTICE "ftl_cs: set_bam_entry() " -+ "inconsistency!\n"); -+ printk(KERN_NOTICE "ftl_cs: log_addr = 0x%x, cache" -+ " = 0x%x\n", -+ le32_to_cpu(part->bam_cache[blk]), old_addr); -+ } -+ return -EIO; -+ } -+#endif -+ part->bam_cache[blk] = le_virt_addr; -+ } -+ ret = part->mbd.mtd->write(part->mbd.mtd, offset, sizeof(u_int32_t), -+ &retlen, (u_char *)&le_virt_addr); -+ -+ if (ret) { -+ printk(KERN_NOTICE "ftl_cs: set_bam_entry() failed!\n"); -+ printk(KERN_NOTICE "ftl_cs: log_addr = 0x%x, new = 0x%x\n", -+ log_addr, virt_addr); -+ } -+ return ret; -+} /* set_bam_entry */ -+ -+static int ftl_write(partition_t *part, caddr_t buffer, -+ u_long sector, u_long nblocks) -+{ -+ u_int32_t bsize, log_addr, virt_addr, old_addr, blk; -+ u_long i; -+ int ret; -+ size_t retlen, offset; -+ -+ DEBUG(2, "ftl_cs: ftl_write(0x%p, %ld, %ld)\n", -+ part, sector, nblocks); -+ if (!(part->state & FTL_FORMATTED)) { -+ printk(KERN_NOTICE "ftl_cs: bad partition\n"); -+ return -EIO; -+ } -+ /* See if we need to reclaim space, before we start */ -+ while (part->FreeTotal < nblocks) { -+ ret = reclaim_block(part); -+ if (ret) -+ return ret; -+ } -+ -+ bsize = 1 << part->header.EraseUnitSize; -+ -+ virt_addr = sector * SECTOR_SIZE | BLOCK_DATA; -+ for (i = 0; i < nblocks; i++) { -+ if (virt_addr >= le32_to_cpu(part->header.FormattedSize)) { -+ printk(KERN_NOTICE "ftl_cs: bad write offset\n"); -+ return -EIO; -+ } -+ -+ /* Grab a free block */ -+ blk = find_free(part); -+ if (blk == 0) { -+ static int ne = 0; -+ if (++ne < 5) -+ printk(KERN_NOTICE "ftl_cs: internal error: " -+ "no free blocks!\n"); -+ return -ENOSPC; -+ } -+ -+ /* Tag the BAM entry, and write the new block */ -+ log_addr = part->bam_index * bsize + blk * SECTOR_SIZE; -+ part->EUNInfo[part->bam_index].Free--; -+ part->FreeTotal--; -+ if (set_bam_entry(part, log_addr, 0xfffffffe)) -+ return -EIO; -+ part->EUNInfo[part->bam_index].Deleted++; -+ offset = (part->EUNInfo[part->bam_index].Offset + -+ blk * SECTOR_SIZE); -+ ret = part->mbd.mtd->write(part->mbd.mtd, offset, SECTOR_SIZE, &retlen, -+ buffer); -+ -+ if (ret) { -+ printk(KERN_NOTICE "ftl_cs: block write failed!\n"); -+ printk(KERN_NOTICE "ftl_cs: log_addr = 0x%x, virt_addr" -+ " = 0x%x, Offset = 0x%zx\n", log_addr, virt_addr, -+ offset); -+ return -EIO; -+ } -+ -+ /* Only delete the old entry when the new entry is ready */ -+ old_addr = part->VirtualBlockMap[sector+i]; -+ if (old_addr != 0xffffffff) { -+ part->VirtualBlockMap[sector+i] = 0xffffffff; -+ part->EUNInfo[old_addr/bsize].Deleted++; -+ if (set_bam_entry(part, old_addr, 0)) -+ return -EIO; -+ } -+ -+ /* Finally, set up the new pointers */ -+ if (set_bam_entry(part, log_addr, virt_addr)) -+ return -EIO; -+ part->VirtualBlockMap[sector+i] = log_addr; -+ part->EUNInfo[part->bam_index].Deleted--; -+ -+ buffer += SECTOR_SIZE; -+ virt_addr += SECTOR_SIZE; -+ } -+ return 0; -+} /* ftl_write */ -+ -+static int ftl_getgeo(struct mtd_blktrans_dev *dev, struct hd_geometry *geo) -+{ -+ partition_t *part = (void *)dev; -+ u_long sect; -+ -+ /* Sort of arbitrary: round size down to 4KiB boundary */ -+ sect = le32_to_cpu(part->header.FormattedSize)/SECTOR_SIZE; -+ -+ geo->heads = 1; -+ geo->sectors = 8; -+ geo->cylinders = sect >> 3; -+ -+ return 0; -+} -+ -+static int ftl_readsect(struct mtd_blktrans_dev *dev, -+ unsigned long block, char *buf) -+{ -+ return ftl_read((void *)dev, buf, block, 1); -+} -+ -+static int ftl_writesect(struct mtd_blktrans_dev *dev, -+ unsigned long block, char *buf) -+{ -+ return ftl_write((void *)dev, buf, block, 1); -+} -+ -+/*====================================================================*/ -+ -+void ftl_freepart(partition_t *part) -+{ -+ if (part->VirtualBlockMap) { -+ vfree(part->VirtualBlockMap); -+ part->VirtualBlockMap = NULL; -+ } -+ if (part->VirtualPageMap) { -+ kfree(part->VirtualPageMap); -+ part->VirtualPageMap = NULL; -+ } -+ if (part->EUNInfo) { -+ kfree(part->EUNInfo); -+ part->EUNInfo = NULL; -+ } -+ if (part->XferInfo) { -+ kfree(part->XferInfo); -+ part->XferInfo = NULL; -+ } -+ if (part->bam_cache) { -+ kfree(part->bam_cache); -+ part->bam_cache = NULL; -+ } -+ -+} /* ftl_freepart */ -+ -+static void ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) -+{ -+ partition_t *partition; -+ -+ partition = kmalloc(sizeof(partition_t), GFP_KERNEL); -+ -+ if (!partition) { -+ printk(KERN_WARNING "No memory to scan for FTL on %s\n", -+ mtd->name); -+ return; -+ } -+ -+ memset(partition, 0, sizeof(partition_t)); -+ -+ partition->mbd.mtd = mtd; -+ -+ if ((scan_header(partition) == 0) && -+ (build_maps(partition) == 0)) { -+ -+ partition->state = FTL_FORMATTED; -+#ifdef PCMCIA_DEBUG -+ printk(KERN_INFO "ftl_cs: opening %d KiB FTL partition\n", -+ le32_to_cpu(partition->header.FormattedSize) >> 10); -+#endif -+ partition->mbd.size = le32_to_cpu(partition->header.FormattedSize) >> 9; -+ partition->mbd.blksize = SECTOR_SIZE; -+ partition->mbd.tr = tr; -+ partition->mbd.devnum = -1; -+ if (add_mtd_blktrans_dev((void *)partition)) -+ kfree(partition); -+ -+ } else -+ kfree(partition); -+} -+ -+static void ftl_remove_dev(struct mtd_blktrans_dev *dev) -+{ -+ del_mtd_blktrans_dev(dev); -+ kfree(dev); -+} -+ -+struct mtd_blktrans_ops ftl_tr = { -+ .name = "ftl", -+ .major = FTL_MAJOR, -+ .part_bits = PART_BITS, -+ .readsect = ftl_readsect, -+ .writesect = ftl_writesect, -+ .getgeo = ftl_getgeo, -+ .add_mtd = ftl_add_mtd, -+ .remove_dev = ftl_remove_dev, -+ .owner = THIS_MODULE, -+}; -+ -+int init_ftl(void) -+{ -+ DEBUG(0, "$Id: ftl.c,v 1.53 2004/08/09 13:55:43 dwmw2 Exp $\n"); -+ -+ return register_mtd_blktrans(&ftl_tr); -+} -+ -+static void __exit cleanup_ftl(void) -+{ -+ deregister_mtd_blktrans(&ftl_tr); -+} -+ -+module_init(init_ftl); -+module_exit(cleanup_ftl); -+ -+ -+MODULE_LICENSE("Dual MPL/GPL"); -+MODULE_AUTHOR("David Hinds "); -+MODULE_DESCRIPTION("Support code for Flash Translation Layer, used on PCMCIA devices"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/inftlcore.c -=================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/inftlcore.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/inftlcore.c 2004-11-18 18:39:09.000000000 -0500 -@@ -0,0 +1,912 @@ -+/* -+ * inftlcore.c -- Linux driver for Inverse Flash Translation Layer (INFTL) -+ * -+ * (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com) -+ * -+ * Based heavily on the nftlcore.c code which is: -+ * (c) 1999 Machine Vision Holdings, Inc. -+ * Author: David Woodhouse -+ * -+ * $Id: inftlcore.c,v 1.17 2004/08/09 13:56:48 dwmw2 Exp $ -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* -+ * Maximum number of loops while examining next block, to have a -+ * chance to detect consistency problems (they should never happen -+ * because of the checks done in the mounting. -+ */ -+#define MAX_LOOPS 10000 -+ -+extern void INFTL_dumptables(struct INFTLrecord *inftl); -+extern void INFTL_dumpVUchains(struct INFTLrecord *inftl); -+ -+static void inftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) -+{ -+ struct INFTLrecord *inftl; -+ unsigned long temp; -+ -+ if (mtd->type != MTD_NANDFLASH) -+ return; -+ /* OK, this is moderately ugly. But probably safe. Alternatives? */ -+ if (memcmp(mtd->name, "DiskOnChip", 10)) -+ return; -+ -+ if (!mtd->block_isbad) { -+ printk(KERN_ERR -+"INFTL no longer supports the old DiskOnChip drivers loaded via docprobe.\n" -+"Please use the new diskonchip driver under the NAND subsystem.\n"); -+ return; -+ } -+ -+ DEBUG(MTD_DEBUG_LEVEL3, "INFTL: add_mtd for %s\n", mtd->name); -+ -+ inftl = kmalloc(sizeof(*inftl), GFP_KERNEL); -+ -+ if (!inftl) { -+ printk(KERN_WARNING "INFTL: Out of memory for data structures\n"); -+ return; -+ } -+ memset(inftl, 0, sizeof(*inftl)); -+ -+ inftl->mbd.mtd = mtd; -+ inftl->mbd.devnum = -1; -+ inftl->mbd.blksize = 512; -+ inftl->mbd.tr = tr; -+ memcpy(&inftl->oobinfo, &mtd->oobinfo, sizeof(struct nand_oobinfo)); -+ inftl->oobinfo.useecc = MTD_NANDECC_PLACEONLY; -+ -+ if (INFTL_mount(inftl) < 0) { -+ printk(KERN_WARNING "INFTL: could not mount device\n"); -+ kfree(inftl); -+ return; -+ } -+ -+ /* OK, it's a new one. Set up all the data structures. */ -+ -+ /* Calculate geometry */ -+ inftl->cylinders = 1024; -+ inftl->heads = 16; -+ -+ temp = inftl->cylinders * inftl->heads; -+ inftl->sectors = inftl->mbd.size / temp; -+ if (inftl->mbd.size % temp) { -+ inftl->sectors++; -+ temp = inftl->cylinders * inftl->sectors; -+ inftl->heads = inftl->mbd.size / temp; -+ -+ if (inftl->mbd.size % temp) { -+ inftl->heads++; -+ temp = inftl->heads * inftl->sectors; -+ inftl->cylinders = inftl->mbd.size / temp; -+ } -+ } -+ -+ if (inftl->mbd.size != inftl->heads * inftl->cylinders * inftl->sectors) { -+ /* -+ Oh no we don't have -+ mbd.size == heads * cylinders * sectors -+ */ -+ printk(KERN_WARNING "INFTL: cannot calculate a geometry to " -+ "match size of 0x%lx.\n", inftl->mbd.size); -+ printk(KERN_WARNING "INFTL: using C:%d H:%d S:%d " -+ "(== 0x%lx sects)\n", -+ inftl->cylinders, inftl->heads , inftl->sectors, -+ (long)inftl->cylinders * (long)inftl->heads * -+ (long)inftl->sectors ); -+ } -+ -+ if (add_mtd_blktrans_dev(&inftl->mbd)) { -+ if (inftl->PUtable) -+ kfree(inftl->PUtable); -+ if (inftl->VUtable) -+ kfree(inftl->VUtable); -+ kfree(inftl); -+ return; -+ } -+#ifdef PSYCHO_DEBUG -+ printk(KERN_INFO "INFTL: Found new nftl%c\n", nftl->mbd.devnum + 'a'); -+#endif -+ return; -+} -+ -+static void inftl_remove_dev(struct mtd_blktrans_dev *dev) -+{ -+ struct INFTLrecord *inftl = (void *)dev; -+ -+ DEBUG(MTD_DEBUG_LEVEL3, "INFTL: remove_dev (i=%d)\n", dev->devnum); -+ -+ del_mtd_blktrans_dev(dev); -+ -+ if (inftl->PUtable) -+ kfree(inftl->PUtable); -+ if (inftl->VUtable) -+ kfree(inftl->VUtable); -+ kfree(inftl); -+} -+ -+/* -+ * Actual INFTL access routines. -+ */ -+ -+/* -+ * INFTL_findfreeblock: Find a free Erase Unit on the INFTL partition. -+ * This function is used when the give Virtual Unit Chain. -+ */ -+static u16 INFTL_findfreeblock(struct INFTLrecord *inftl, int desperate) -+{ -+ u16 pot = inftl->LastFreeEUN; -+ int silly = inftl->nb_blocks; -+ -+ DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_findfreeblock(inftl=%p," -+ "desperate=%d)\n", inftl, desperate); -+ -+ /* -+ * Normally, we force a fold to happen before we run out of free -+ * blocks completely. -+ */ -+ if (!desperate && inftl->numfreeEUNs < 2) { -+ DEBUG(MTD_DEBUG_LEVEL1, "INFTL: there are too few free " -+ "EUNs (%d)\n", inftl->numfreeEUNs); -+ return 0xffff; -+ } -+ -+ /* Scan for a free block */ -+ do { -+ if (inftl->PUtable[pot] == BLOCK_FREE) { -+ inftl->LastFreeEUN = pot; -+ return pot; -+ } -+ -+ if (++pot > inftl->lastEUN) -+ pot = 0; -+ -+ if (!silly--) { -+ printk(KERN_WARNING "INFTL: no free blocks found! " -+ "EUN range = %d - %d\n", 0, inftl->LastFreeEUN); -+ return BLOCK_NIL; -+ } -+ } while (pot != inftl->LastFreeEUN); -+ -+ return BLOCK_NIL; -+} -+ -+static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned pendingblock) -+{ -+ u16 BlockMap[MAX_SECTORS_PER_UNIT]; -+ unsigned char BlockDeleted[MAX_SECTORS_PER_UNIT]; -+ unsigned int thisEUN, prevEUN, status; -+ int block, silly; -+ unsigned int targetEUN; -+ struct inftl_oob oob; -+ size_t retlen; -+ -+ DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_foldchain(inftl=%p,thisVUC=%d," -+ "pending=%d)\n", inftl, thisVUC, pendingblock); -+ -+ memset(BlockMap, 0xff, sizeof(BlockMap)); -+ memset(BlockDeleted, 0, sizeof(BlockDeleted)); -+ -+ thisEUN = targetEUN = inftl->VUtable[thisVUC]; -+ -+ if (thisEUN == BLOCK_NIL) { -+ printk(KERN_WARNING "INFTL: trying to fold non-existent " -+ "Virtual Unit Chain %d!\n", thisVUC); -+ return BLOCK_NIL; -+ } -+ -+ /* -+ * Scan to find the Erase Unit which holds the actual data for each -+ * 512-byte block within the Chain. -+ */ -+ silly = MAX_LOOPS; -+ while (thisEUN < inftl->nb_blocks) { -+ for (block = 0; block < inftl->EraseSize/SECTORSIZE; block ++) { -+ if ((BlockMap[block] != 0xffff) || BlockDeleted[block]) -+ continue; -+ -+ if (MTD_READOOB(inftl->mbd.mtd, (thisEUN * inftl->EraseSize) -+ + (block * SECTORSIZE), 16 , &retlen, -+ (char *)&oob) < 0) -+ status = SECTOR_IGNORE; -+ else -+ status = oob.b.Status | oob.b.Status1; -+ -+ switch(status) { -+ case SECTOR_FREE: -+ case SECTOR_IGNORE: -+ break; -+ case SECTOR_USED: -+ BlockMap[block] = thisEUN; -+ continue; -+ case SECTOR_DELETED: -+ BlockDeleted[block] = 1; -+ continue; -+ default: -+ printk(KERN_WARNING "INFTL: unknown status " -+ "for block %d in EUN %d: %x\n", -+ block, thisEUN, status); -+ break; -+ } -+ } -+ -+ if (!silly--) { -+ printk(KERN_WARNING "INFTL: infinite loop in Virtual " -+ "Unit Chain 0x%x\n", thisVUC); -+ return BLOCK_NIL; -+ } -+ -+ thisEUN = inftl->PUtable[thisEUN]; -+ } -+ -+ /* -+ * OK. We now know the location of every block in the Virtual Unit -+ * Chain, and the Erase Unit into which we are supposed to be copying. -+ * Go for it. -+ */ -+ DEBUG(MTD_DEBUG_LEVEL1, "INFTL: folding chain %d into unit %d\n", -+ thisVUC, targetEUN); -+ -+ for (block = 0; block < inftl->EraseSize/SECTORSIZE ; block++) { -+ unsigned char movebuf[SECTORSIZE]; -+ int ret; -+ -+ /* -+ * If it's in the target EUN already, or if it's pending write, -+ * do nothing. -+ */ -+ if (BlockMap[block] == targetEUN || (pendingblock == -+ (thisVUC * (inftl->EraseSize / SECTORSIZE) + block))) { -+ continue; -+ } -+ -+ /* -+ * Copy only in non free block (free blocks can only -+ * happen in case of media errors or deleted blocks). -+ */ -+ if (BlockMap[block] == BLOCK_NIL) -+ continue; -+ -+ ret = MTD_READ(inftl->mbd.mtd, (inftl->EraseSize * -+ BlockMap[block]) + (block * SECTORSIZE), SECTORSIZE, -+ &retlen, movebuf); -+ if (ret < 0) { -+ ret = MTD_READ(inftl->mbd.mtd, (inftl->EraseSize * -+ BlockMap[block]) + (block * SECTORSIZE), -+ SECTORSIZE, &retlen, movebuf); -+ if (ret != -EIO) -+ DEBUG(MTD_DEBUG_LEVEL1, "INFTL: error went " -+ "away on retry?\n"); -+ } -+ memset(&oob, 0xff, sizeof(struct inftl_oob)); -+ oob.b.Status = oob.b.Status1 = SECTOR_USED; -+ MTD_WRITEECC(inftl->mbd.mtd, (inftl->EraseSize * targetEUN) + -+ (block * SECTORSIZE), SECTORSIZE, &retlen, -+ movebuf, (char *)&oob, &inftl->oobinfo); -+ } -+ -+ /* -+ * Newest unit in chain now contains data from _all_ older units. -+ * So go through and erase each unit in chain, oldest first. (This -+ * is important, by doing oldest first if we crash/reboot then it -+ * it is relatively simple to clean up the mess). -+ */ -+ DEBUG(MTD_DEBUG_LEVEL1, "INFTL: want to erase virtual chain %d\n", -+ thisVUC); -+ -+ for (;;) { -+ /* Find oldest unit in chain. */ -+ thisEUN = inftl->VUtable[thisVUC]; -+ prevEUN = BLOCK_NIL; -+ while (inftl->PUtable[thisEUN] != BLOCK_NIL) { -+ prevEUN = thisEUN; -+ thisEUN = inftl->PUtable[thisEUN]; -+ } -+ -+ /* Check if we are all done */ -+ if (thisEUN == targetEUN) -+ break; -+ -+ if (INFTL_formatblock(inftl, thisEUN) < 0) { -+ /* -+ * Could not erase : mark block as reserved. -+ */ -+ inftl->PUtable[thisEUN] = BLOCK_RESERVED; -+ } else { -+ /* Correctly erased : mark it as free */ -+ inftl->PUtable[thisEUN] = BLOCK_FREE; -+ inftl->PUtable[prevEUN] = BLOCK_NIL; -+ inftl->numfreeEUNs++; -+ } -+ } -+ -+ return targetEUN; -+} -+ -+u16 INFTL_makefreeblock(struct INFTLrecord *inftl, unsigned pendingblock) -+{ -+ /* -+ * This is the part that needs some cleverness applied. -+ * For now, I'm doing the minimum applicable to actually -+ * get the thing to work. -+ * Wear-levelling and other clever stuff needs to be implemented -+ * and we also need to do some assessment of the results when -+ * the system loses power half-way through the routine. -+ */ -+ u16 LongestChain = 0; -+ u16 ChainLength = 0, thislen; -+ u16 chain, EUN; -+ -+ DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_makefreeblock(inftl=%p," -+ "pending=%d)\n", inftl, pendingblock); -+ -+ for (chain = 0; chain < inftl->nb_blocks; chain++) { -+ EUN = inftl->VUtable[chain]; -+ thislen = 0; -+ -+ while (EUN <= inftl->lastEUN) { -+ thislen++; -+ EUN = inftl->PUtable[EUN]; -+ if (thislen > 0xff00) { -+ printk(KERN_WARNING "INFTL: endless loop in " -+ "Virtual Chain %d: Unit %x\n", -+ chain, EUN); -+ /* -+ * Actually, don't return failure. -+ * Just ignore this chain and get on with it. -+ */ -+ thislen = 0; -+ break; -+ } -+ } -+ -+ if (thislen > ChainLength) { -+ ChainLength = thislen; -+ LongestChain = chain; -+ } -+ } -+ -+ if (ChainLength < 2) { -+ printk(KERN_WARNING "INFTL: no Virtual Unit Chains available " -+ "for folding. Failing request\n"); -+ return BLOCK_NIL; -+ } -+ -+ return INFTL_foldchain(inftl, LongestChain, pendingblock); -+} -+ -+static int nrbits(unsigned int val, int bitcount) -+{ -+ int i, total = 0; -+ -+ for (i = 0; (i < bitcount); i++) -+ total += (((0x1 << i) & val) ? 1 : 0); -+ return total; -+} -+ -+/* -+ * INFTL_findwriteunit: Return the unit number into which we can write -+ * for this block. Make it available if it isn't already. -+ */ -+static inline u16 INFTL_findwriteunit(struct INFTLrecord *inftl, unsigned block) -+{ -+ unsigned int thisVUC = block / (inftl->EraseSize / SECTORSIZE); -+ unsigned int thisEUN, writeEUN, prev_block, status; -+ unsigned long blockofs = (block * SECTORSIZE) & (inftl->EraseSize -1); -+ struct inftl_oob oob; -+ struct inftl_bci bci; -+ unsigned char anac, nacs, parity; -+ size_t retlen; -+ int silly, silly2 = 3; -+ -+ DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_findwriteunit(inftl=%p," -+ "block=%d)\n", inftl, block); -+ -+ do { -+ /* -+ * Scan the media to find a unit in the VUC which has -+ * a free space for the block in question. -+ */ -+ writeEUN = BLOCK_NIL; -+ thisEUN = inftl->VUtable[thisVUC]; -+ silly = MAX_LOOPS; -+ -+ while (thisEUN <= inftl->lastEUN) { -+ MTD_READOOB(inftl->mbd.mtd, (thisEUN * inftl->EraseSize) + -+ blockofs, 8, &retlen, (char *)&bci); -+ -+ status = bci.Status | bci.Status1; -+ DEBUG(MTD_DEBUG_LEVEL3, "INFTL: status of block %d in " -+ "EUN %d is %x\n", block , writeEUN, status); -+ -+ switch(status) { -+ case SECTOR_FREE: -+ writeEUN = thisEUN; -+ break; -+ case SECTOR_DELETED: -+ case SECTOR_USED: -+ /* Can't go any further */ -+ goto hitused; -+ case SECTOR_IGNORE: -+ break; -+ default: -+ /* -+ * Invalid block. Don't use it any more. -+ * Must implement. -+ */ -+ break; -+ } -+ -+ if (!silly--) { -+ printk(KERN_WARNING "INFTL: infinite loop in " -+ "Virtual Unit Chain 0x%x\n", thisVUC); -+ return 0xffff; -+ } -+ -+ /* Skip to next block in chain */ -+ thisEUN = inftl->PUtable[thisEUN]; -+ } -+ -+hitused: -+ if (writeEUN != BLOCK_NIL) -+ return writeEUN; -+ -+ -+ /* -+ * OK. We didn't find one in the existing chain, or there -+ * is no existing chain. Allocate a new one. -+ */ -+ writeEUN = INFTL_findfreeblock(inftl, 0); -+ -+ if (writeEUN == BLOCK_NIL) { -+ /* -+ * That didn't work - there were no free blocks just -+ * waiting to be picked up. We're going to have to fold -+ * a chain to make room. -+ */ -+ thisEUN = INFTL_makefreeblock(inftl, 0xffff); -+ -+ /* -+ * Hopefully we free something, lets try again. -+ * This time we are desperate... -+ */ -+ DEBUG(MTD_DEBUG_LEVEL1, "INFTL: using desperate==1 " -+ "to find free EUN to accommodate write to " -+ "VUC %d\n", thisVUC); -+ writeEUN = INFTL_findfreeblock(inftl, 1); -+ if (writeEUN == BLOCK_NIL) { -+ /* -+ * Ouch. This should never happen - we should -+ * always be able to make some room somehow. -+ * If we get here, we've allocated more storage -+ * space than actual media, or our makefreeblock -+ * routine is missing something. -+ */ -+ printk(KERN_WARNING "INFTL: cannot make free " -+ "space.\n"); -+#ifdef DEBUG -+ INFTL_dumptables(inftl); -+ INFTL_dumpVUchains(inftl); -+#endif -+ return BLOCK_NIL; -+ } -+ } -+ -+ /* -+ * Insert new block into virtual chain. Firstly update the -+ * block headers in flash... -+ */ -+ anac = 0; -+ nacs = 0; -+ thisEUN = inftl->VUtable[thisVUC]; -+ if (thisEUN != BLOCK_NIL) { -+ MTD_READOOB(inftl->mbd.mtd, thisEUN * inftl->EraseSize -+ + 8, 8, &retlen, (char *)&oob.u); -+ anac = oob.u.a.ANAC + 1; -+ nacs = oob.u.a.NACs + 1; -+ } -+ -+ prev_block = inftl->VUtable[thisVUC]; -+ if (prev_block < inftl->nb_blocks) -+ prev_block -= inftl->firstEUN; -+ -+ parity = (nrbits(thisVUC, 16) & 0x1) ? 0x1 : 0; -+ parity |= (nrbits(prev_block, 16) & 0x1) ? 0x2 : 0; -+ parity |= (nrbits(anac, 8) & 0x1) ? 0x4 : 0; -+ parity |= (nrbits(nacs, 8) & 0x1) ? 0x8 : 0; -+ -+ oob.u.a.virtualUnitNo = cpu_to_le16(thisVUC); -+ oob.u.a.prevUnitNo = cpu_to_le16(prev_block); -+ oob.u.a.ANAC = anac; -+ oob.u.a.NACs = nacs; -+ oob.u.a.parityPerField = parity; -+ oob.u.a.discarded = 0xaa; -+ -+ MTD_WRITEOOB(inftl->mbd.mtd, writeEUN * inftl->EraseSize + 8, 8, -+ &retlen, (char *)&oob.u); -+ -+ /* Also back up header... */ -+ oob.u.b.virtualUnitNo = cpu_to_le16(thisVUC); -+ oob.u.b.prevUnitNo = cpu_to_le16(prev_block); -+ oob.u.b.ANAC = anac; -+ oob.u.b.NACs = nacs; -+ oob.u.b.parityPerField = parity; -+ oob.u.b.discarded = 0xaa; -+ -+ MTD_WRITEOOB(inftl->mbd.mtd, writeEUN * inftl->EraseSize + -+ SECTORSIZE * 4 + 8, 8, &retlen, (char *)&oob.u); -+ -+ inftl->PUtable[writeEUN] = inftl->VUtable[thisVUC]; -+ inftl->VUtable[thisVUC] = writeEUN; -+ -+ inftl->numfreeEUNs--; -+ return writeEUN; -+ -+ } while (silly2--); -+ -+ printk(KERN_WARNING "INFTL: error folding to make room for Virtual " -+ "Unit Chain 0x%x\n", thisVUC); -+ return 0xffff; -+} -+ -+/* -+ * Given a Virtual Unit Chain, see if it can be deleted, and if so do it. -+ */ -+static void INFTL_trydeletechain(struct INFTLrecord *inftl, unsigned thisVUC) -+{ -+ unsigned char BlockUsed[MAX_SECTORS_PER_UNIT]; -+ unsigned char BlockDeleted[MAX_SECTORS_PER_UNIT]; -+ unsigned int thisEUN, status; -+ int block, silly; -+ struct inftl_bci bci; -+ size_t retlen; -+ -+ DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_trydeletechain(inftl=%p," -+ "thisVUC=%d)\n", inftl, thisVUC); -+ -+ memset(BlockUsed, 0, sizeof(BlockUsed)); -+ memset(BlockDeleted, 0, sizeof(BlockDeleted)); -+ -+ thisEUN = inftl->VUtable[thisVUC]; -+ if (thisEUN == BLOCK_NIL) { -+ printk(KERN_WARNING "INFTL: trying to delete non-existent " -+ "Virtual Unit Chain %d!\n", thisVUC); -+ return; -+ } -+ -+ /* -+ * Scan through the Erase Units to determine whether any data is in -+ * each of the 512-byte blocks within the Chain. -+ */ -+ silly = MAX_LOOPS; -+ while (thisEUN < inftl->nb_blocks) { -+ for (block = 0; block < inftl->EraseSize/SECTORSIZE; block++) { -+ if (BlockUsed[block] || BlockDeleted[block]) -+ continue; -+ -+ if (MTD_READOOB(inftl->mbd.mtd, (thisEUN * inftl->EraseSize) -+ + (block * SECTORSIZE), 8 , &retlen, -+ (char *)&bci) < 0) -+ status = SECTOR_IGNORE; -+ else -+ status = bci.Status | bci.Status1; -+ -+ switch(status) { -+ case SECTOR_FREE: -+ case SECTOR_IGNORE: -+ break; -+ case SECTOR_USED: -+ BlockUsed[block] = 1; -+ continue; -+ case SECTOR_DELETED: -+ BlockDeleted[block] = 1; -+ continue; -+ default: -+ printk(KERN_WARNING "INFTL: unknown status " -+ "for block %d in EUN %d: 0x%x\n", -+ block, thisEUN, status); -+ } -+ } -+ -+ if (!silly--) { -+ printk(KERN_WARNING "INFTL: infinite loop in Virtual " -+ "Unit Chain 0x%x\n", thisVUC); -+ return; -+ } -+ -+ thisEUN = inftl->PUtable[thisEUN]; -+ } -+ -+ for (block = 0; block < inftl->EraseSize/SECTORSIZE; block++) -+ if (BlockUsed[block]) -+ return; -+ -+ /* -+ * For each block in the chain free it and make it available -+ * for future use. Erase from the oldest unit first. -+ */ -+ DEBUG(MTD_DEBUG_LEVEL1, "INFTL: deleting empty VUC %d\n", thisVUC); -+ -+ for (;;) { -+ u16 *prevEUN = &inftl->VUtable[thisVUC]; -+ thisEUN = *prevEUN; -+ -+ /* If the chain is all gone already, we're done */ -+ if (thisEUN == BLOCK_NIL) { -+ DEBUG(MTD_DEBUG_LEVEL2, "INFTL: Empty VUC %d for deletion was already absent\n", thisEUN); -+ return; -+ } -+ -+ /* Find oldest unit in chain. */ -+ while (inftl->PUtable[thisEUN] != BLOCK_NIL) { -+ BUG_ON(thisEUN >= inftl->nb_blocks); -+ -+ prevEUN = &inftl->PUtable[thisEUN]; -+ thisEUN = *prevEUN; -+ } -+ -+ DEBUG(MTD_DEBUG_LEVEL3, "Deleting EUN %d from VUC %d\n", -+ thisEUN, thisVUC); -+ -+ if (INFTL_formatblock(inftl, thisEUN) < 0) { -+ /* -+ * Could not erase : mark block as reserved. -+ */ -+ inftl->PUtable[thisEUN] = BLOCK_RESERVED; -+ } else { -+ /* Correctly erased : mark it as free */ -+ inftl->PUtable[thisEUN] = BLOCK_FREE; -+ inftl->numfreeEUNs++; -+ } -+ -+ /* Now sort out whatever was pointing to it... */ -+ *prevEUN = BLOCK_NIL; -+ -+ /* Ideally we'd actually be responsive to new -+ requests while we're doing this -- if there's -+ free space why should others be made to wait? */ -+ cond_resched(); ++ int err; + part->header.FormattedSize = 0; + max_offset = (0x100000mbd.mtd->size)?0x100000:part->mbd.mtd->size; + /* Search first megabyte for a valid FTL header */ +@@ -175,11 +176,11 @@ + (offset + sizeof(header)) < max_offset; + offset += part->mbd.mtd->erasesize ? : 0x2000) { + +- ret = part->mbd.mtd->read(part->mbd.mtd, offset, sizeof(header), &ret, ++ err = part->mbd.mtd->read(part->mbd.mtd, offset, sizeof(header), &ret, + (unsigned char *)&header); + +- if (ret) +- return ret; ++ if (err) ++ return err; + + if (strcmp(header.DataOrgTuple+3, "FTL100") == 0) break; + } +@@ -958,7 +959,7 @@ + if (ret) { + printk(KERN_NOTICE "ftl_cs: block write failed!\n"); + printk(KERN_NOTICE "ftl_cs: log_addr = 0x%x, virt_addr" +- " = 0x%x, Offset = 0x%x\n", log_addr, virt_addr, ++ " = 0x%x, Offset = 0x%zx\n", log_addr, virt_addr, + offset); + return -EIO; + } +@@ -1093,7 +1094,7 @@ + + int init_ftl(void) + { +- DEBUG(0, "$Id: ftl.c,v 1.51 2003/06/23 12:00:08 dwmw2 Exp $\n"); ++ DEBUG(0, "$Id: ftl.c,v 1.53 2004/08/09 13:55:43 dwmw2 Exp $\n"); + + return register_mtd_blktrans(&ftl_tr); + } +Index: linux-2.6.5/drivers/mtd/inftlcore.c +=================================================================== +--- linux-2.6.5.orig/drivers/mtd/inftlcore.c 2004-04-03 22:36:18.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/inftlcore.c 2005-02-01 17:11:29.000000000 -0500 +@@ -7,7 +7,7 @@ + * (c) 1999 Machine Vision Holdings, Inc. + * Author: David Woodhouse + * +- * $Id: inftlcore.c,v 1.14 2003/06/26 08:28:26 dwmw2 Exp $ ++ * $Id: inftlcore.c,v 1.17 2004/08/09 13:56:48 dwmw2 Exp $ + * + * 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 +@@ -55,9 +55,19 @@ + struct INFTLrecord *inftl; + unsigned long temp; + +- if (mtd->ecctype != MTD_ECC_RS_DiskOnChip) ++ if (mtd->type != MTD_NANDFLASH) ++ return; ++ /* OK, this is moderately ugly. But probably safe. Alternatives? */ ++ if (memcmp(mtd->name, "DiskOnChip", 10)) + return; + ++ if (!mtd->block_isbad) { ++ printk(KERN_ERR ++"INFTL no longer supports the old DiskOnChip drivers loaded via docprobe.\n" ++"Please use the new diskonchip driver under the NAND subsystem.\n"); ++ return; + } + -+ inftl->VUtable[thisVUC] = BLOCK_NIL; -+} -+ -+static int INFTL_deleteblock(struct INFTLrecord *inftl, unsigned block) -+{ -+ unsigned int thisEUN = inftl->VUtable[block / (inftl->EraseSize / SECTORSIZE)]; -+ unsigned long blockofs = (block * SECTORSIZE) & (inftl->EraseSize - 1); -+ unsigned int status; -+ int silly = MAX_LOOPS; -+ size_t retlen; -+ struct inftl_bci bci; -+ + DEBUG(MTD_DEBUG_LEVEL3, "INFTL: add_mtd for %s\n", mtd->name); + + inftl = kmalloc(sizeof(*inftl), GFP_KERNEL); +@@ -72,6 +82,8 @@ + inftl->mbd.devnum = -1; + inftl->mbd.blksize = 512; + inftl->mbd.tr = tr; ++ memcpy(&inftl->oobinfo, &mtd->oobinfo, sizeof(struct nand_oobinfo)); ++ inftl->oobinfo.useecc = MTD_NANDECC_PLACEONLY; + + if (INFTL_mount(inftl) < 0) { + printk(KERN_WARNING "INFTL: could not mount device\n"); +@@ -155,8 +167,8 @@ + u16 pot = inftl->LastFreeEUN; + int silly = inftl->nb_blocks; + +- DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_findfreeblock(inftl=0x%x," +- "desperate=%d)\n", (int)inftl, desperate); ++ DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_findfreeblock(inftl=%p," ++ "desperate=%d)\n", inftl, desperate); + + /* + * Normally, we force a fold to happen before we run out of free +@@ -198,8 +210,8 @@ + struct inftl_oob oob; + size_t retlen; + +- DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_foldchain(inftl=0x%x,thisVUC=%d," +- "pending=%d)\n", (int)inftl, thisVUC, pendingblock); ++ DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_foldchain(inftl=%p,thisVUC=%d," ++ "pending=%d)\n", inftl, thisVUC, pendingblock); + + memset(BlockMap, 0xff, sizeof(BlockMap)); + memset(BlockDeleted, 0, sizeof(BlockDeleted)); +@@ -284,21 +296,22 @@ + if (BlockMap[block] == BLOCK_NIL) + continue; + +- ret = MTD_READECC(inftl->mbd.mtd, (inftl->EraseSize * ++ ret = MTD_READ(inftl->mbd.mtd, (inftl->EraseSize * + BlockMap[block]) + (block * SECTORSIZE), SECTORSIZE, +- &retlen, movebuf, (char *)&oob, NULL); ++ &retlen, movebuf); + if (ret < 0) { +- ret = MTD_READECC(inftl->mbd.mtd, (inftl->EraseSize * ++ ret = MTD_READ(inftl->mbd.mtd, (inftl->EraseSize * + BlockMap[block]) + (block * SECTORSIZE), +- SECTORSIZE, &retlen, movebuf, (char *)&oob, +- NULL); ++ SECTORSIZE, &retlen, movebuf); + if (ret != -EIO) + DEBUG(MTD_DEBUG_LEVEL1, "INFTL: error went " + "away on retry?\n"); + } ++ memset(&oob, 0xff, sizeof(struct inftl_oob)); ++ oob.b.Status = oob.b.Status1 = SECTOR_USED; + MTD_WRITEECC(inftl->mbd.mtd, (inftl->EraseSize * targetEUN) + + (block * SECTORSIZE), SECTORSIZE, &retlen, +- movebuf, (char *)&oob, NULL); ++ movebuf, (char *)&oob, &inftl->oobinfo); + } + + /* +@@ -326,7 +339,6 @@ + if (INFTL_formatblock(inftl, thisEUN) < 0) { + /* + * Could not erase : mark block as reserved. +- * FixMe: Update Bad Unit Table on disk. + */ + inftl->PUtable[thisEUN] = BLOCK_RESERVED; + } else { +@@ -354,8 +366,8 @@ + u16 ChainLength = 0, thislen; + u16 chain, EUN; + +- DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_makefreeblock(inftl=0x%x," +- "pending=%d)\n", (int)inftl, pendingblock); ++ DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_makefreeblock(inftl=%p," ++ "pending=%d)\n", inftl, pendingblock); + + for (chain = 0; chain < inftl->nb_blocks; chain++) { + EUN = inftl->VUtable[chain]; +@@ -416,8 +428,8 @@ + size_t retlen; + int silly, silly2 = 3; + +- DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_findwriteunit(inftl=0x%x," +- "block=%d)\n", (int)inftl, block); ++ DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_findwriteunit(inftl=%p," ++ "block=%d)\n", inftl, block); + + do { + /* +@@ -578,8 +590,8 @@ + struct inftl_bci bci; + size_t retlen; + +- DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_trydeletechain(inftl=0x%x," +- "thisVUC=%d)\n", (int)inftl, thisVUC); ++ DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_trydeletechain(inftl=%p," ++ "thisVUC=%d)\n", inftl, thisVUC); + + memset(BlockUsed, 0, sizeof(BlockUsed)); + memset(BlockDeleted, 0, sizeof(BlockDeleted)); +@@ -668,7 +680,6 @@ + if (INFTL_formatblock(inftl, thisEUN) < 0) { + /* + * Could not erase : mark block as reserved. +- * FixMe: Update Bad Unit Table on medium. + */ + inftl->PUtable[thisEUN] = BLOCK_RESERVED; + } else { +@@ -698,8 +709,8 @@ + size_t retlen; + struct inftl_bci bci; + +- DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_deleteblock(inftl=0x%x," +- "block=%d)\n", (int)inftl, block); + DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_deleteblock(inftl=%p," + "block=%d)\n", inftl, block); -+ -+ while (thisEUN < inftl->nb_blocks) { -+ if (MTD_READOOB(inftl->mbd.mtd, (thisEUN * inftl->EraseSize) + -+ blockofs, 8, &retlen, (char *)&bci) < 0) -+ status = SECTOR_IGNORE; -+ else -+ status = bci.Status | bci.Status1; -+ -+ switch (status) { -+ case SECTOR_FREE: -+ case SECTOR_IGNORE: -+ break; -+ case SECTOR_DELETED: -+ thisEUN = BLOCK_NIL; -+ goto foundit; -+ case SECTOR_USED: -+ goto foundit; -+ default: -+ printk(KERN_WARNING "INFTL: unknown status for " -+ "block %d in EUN %d: 0x%x\n", -+ block, thisEUN, status); -+ break; -+ } -+ -+ if (!silly--) { -+ printk(KERN_WARNING "INFTL: infinite loop in Virtual " -+ "Unit Chain 0x%x\n", -+ block / (inftl->EraseSize / SECTORSIZE)); -+ return 1; -+ } -+ thisEUN = inftl->PUtable[thisEUN]; -+ } -+ -+foundit: -+ if (thisEUN != BLOCK_NIL) { -+ loff_t ptr = (thisEUN * inftl->EraseSize) + blockofs; -+ -+ if (MTD_READOOB(inftl->mbd.mtd, ptr, 8, &retlen, (char *)&bci) < 0) -+ return -EIO; -+ bci.Status = bci.Status1 = SECTOR_DELETED; -+ if (MTD_WRITEOOB(inftl->mbd.mtd, ptr, 8, &retlen, (char *)&bci) < 0) -+ return -EIO; -+ INFTL_trydeletechain(inftl, block / (inftl->EraseSize / SECTORSIZE)); -+ } -+ return 0; -+} -+ -+static int inftl_writeblock(struct mtd_blktrans_dev *mbd, unsigned long block, -+ char *buffer) -+{ -+ struct INFTLrecord *inftl = (void *)mbd; -+ unsigned int writeEUN; -+ unsigned long blockofs = (block * SECTORSIZE) & (inftl->EraseSize - 1); -+ size_t retlen; + + while (thisEUN < inftl->nb_blocks) { + if (MTD_READOOB(inftl->mbd.mtd, (thisEUN * inftl->EraseSize) + +@@ -754,11 +765,11 @@ + unsigned int writeEUN; + unsigned long blockofs = (block * SECTORSIZE) & (inftl->EraseSize - 1); + size_t retlen; +- u8 eccbuf[6]; + struct inftl_oob oob; -+ char *p, *pend; -+ + char *p, *pend; + +- DEBUG(MTD_DEBUG_LEVEL3, "INFTL: inftl_writeblock(inftl=0x%x,block=%ld," +- "buffer=0x%x)\n", (int)inftl, block, (int)buffer); + DEBUG(MTD_DEBUG_LEVEL3, "INFTL: inftl_writeblock(inftl=%p,block=%ld," + "buffer=%p)\n", inftl, block, buffer); -+ -+ /* Is block all zero? */ -+ pend = buffer + SECTORSIZE; -+ for (p = buffer; p < pend && !*p; p++) -+ ; -+ -+ if (p < pend) { -+ writeEUN = INFTL_findwriteunit(inftl, block); -+ -+ if (writeEUN == BLOCK_NIL) { -+ printk(KERN_WARNING "inftl_writeblock(): cannot find " -+ "block to write to\n"); -+ /* -+ * If we _still_ haven't got a block to use, -+ * we're screwed. -+ */ -+ return 1; -+ } -+ + + /* Is block all zero? */ + pend = buffer + SECTORSIZE; +@@ -778,11 +789,13 @@ + return 1; + } + + memset(&oob, 0xff, sizeof(struct inftl_oob)); + oob.b.Status = oob.b.Status1 = SECTOR_USED; -+ MTD_WRITEECC(inftl->mbd.mtd, (writeEUN * inftl->EraseSize) + -+ blockofs, SECTORSIZE, &retlen, (char *)buffer, + MTD_WRITEECC(inftl->mbd.mtd, (writeEUN * inftl->EraseSize) + + blockofs, SECTORSIZE, &retlen, (char *)buffer, +- (char *)eccbuf, NULL); + (char *)&oob, &inftl->oobinfo); -+ /* + /* +- * No need to write SECTOR_USED flags since they are written + * need to write SECTOR_USED flags since they are not written -+ * in mtd_writeecc -+ */ -+ } else { -+ INFTL_deleteblock(inftl, block); -+ } -+ -+ return 0; -+} -+ -+static int inftl_readblock(struct mtd_blktrans_dev *mbd, unsigned long block, -+ char *buffer) -+{ -+ struct INFTLrecord *inftl = (void *)mbd; -+ unsigned int thisEUN = inftl->VUtable[block / (inftl->EraseSize / SECTORSIZE)]; -+ unsigned long blockofs = (block * SECTORSIZE) & (inftl->EraseSize - 1); -+ unsigned int status; -+ int silly = MAX_LOOPS; -+ struct inftl_bci bci; -+ size_t retlen; -+ + * in mtd_writeecc + */ + } else { +@@ -803,8 +816,8 @@ + struct inftl_bci bci; + size_t retlen; + +- DEBUG(MTD_DEBUG_LEVEL3, "INFTL: inftl_readblock(inftl=0x%x,block=%ld," +- "buffer=0x%x)\n", (int)inftl, block, (int)buffer); + DEBUG(MTD_DEBUG_LEVEL3, "INFTL: inftl_readblock(inftl=%p,block=%ld," + "buffer=%p)\n", inftl, block, buffer); -+ -+ while (thisEUN < inftl->nb_blocks) { -+ if (MTD_READOOB(inftl->mbd.mtd, (thisEUN * inftl->EraseSize) + -+ blockofs, 8, &retlen, (char *)&bci) < 0) -+ status = SECTOR_IGNORE; -+ else -+ status = bci.Status | bci.Status1; -+ -+ switch (status) { -+ case SECTOR_DELETED: -+ thisEUN = BLOCK_NIL; -+ goto foundit; -+ case SECTOR_USED: -+ goto foundit; -+ case SECTOR_FREE: -+ case SECTOR_IGNORE: -+ break; -+ default: -+ printk(KERN_WARNING "INFTL: unknown status for " -+ "block %ld in EUN %d: 0x%04x\n", -+ block, thisEUN, status); -+ break; -+ } -+ -+ if (!silly--) { -+ printk(KERN_WARNING "INFTL: infinite loop in " -+ "Virtual Unit Chain 0x%lx\n", -+ block / (inftl->EraseSize / SECTORSIZE)); -+ return 1; -+ } -+ -+ thisEUN = inftl->PUtable[thisEUN]; -+ } -+ -+foundit: -+ if (thisEUN == BLOCK_NIL) { -+ /* The requested block is not on the media, return all 0x00 */ -+ memset(buffer, 0, SECTORSIZE); -+ } else { -+ size_t retlen; -+ loff_t ptr = (thisEUN * inftl->EraseSize) + blockofs; + + while (thisEUN < inftl->nb_blocks) { + if (MTD_READOOB(inftl->mbd.mtd, (thisEUN * inftl->EraseSize) + +@@ -846,9 +859,8 @@ + } else { + size_t retlen; + loff_t ptr = (thisEUN * inftl->EraseSize) + blockofs; +- u_char eccbuf[6]; +- if (MTD_READECC(inftl->mbd.mtd, ptr, SECTORSIZE, &retlen, +- buffer, eccbuf, NULL)) + if (MTD_READ(inftl->mbd.mtd, ptr, SECTORSIZE, &retlen, + buffer)) -+ return -EIO; -+ } -+ return 0; -+} -+ -+static int inftl_getgeo(struct mtd_blktrans_dev *dev, struct hd_geometry *geo) -+{ -+ struct INFTLrecord *inftl = (void *)dev; -+ -+ geo->heads = inftl->heads; -+ geo->sectors = inftl->sectors; -+ geo->cylinders = inftl->cylinders; -+ -+ return 0; -+} -+ -+struct mtd_blktrans_ops inftl_tr = { -+ .name = "inftl", -+ .major = INFTL_MAJOR, -+ .part_bits = INFTL_PARTN_BITS, -+ .getgeo = inftl_getgeo, -+ .readsect = inftl_readblock, -+ .writesect = inftl_writeblock, -+ .add_mtd = inftl_add_mtd, -+ .remove_dev = inftl_remove_dev, -+ .owner = THIS_MODULE, -+}; -+ -+extern char inftlmountrev[]; -+ -+int __init init_inftl(void) -+{ + return -EIO; + } + return 0; +@@ -881,7 +893,7 @@ + + int __init init_inftl(void) + { +- printk(KERN_INFO "INFTL: inftlcore.c $Revision: 1.14 $, " + printk(KERN_INFO "INFTL: inftlcore.c $Revision: 1.17 $, " -+ "inftlmount.c %s\n", inftlmountrev); -+ -+ return register_mtd_blktrans(&inftl_tr); -+} -+ -+static void __exit cleanup_inftl(void) -+{ -+ deregister_mtd_blktrans(&inftl_tr); -+} -+ -+module_init(init_inftl); -+module_exit(cleanup_inftl); -+ -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("Greg Ungerer , David Woodhouse , Fabrice Bellard et al."); -+MODULE_DESCRIPTION("Support code for Inverse Flash Translation Layer, used on M-Systems DiskOnChip 2000, Millennium and Millennium Plus"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/inftlmount.c + "inftlmount.c %s\n", inftlmountrev); + + return register_mtd_blktrans(&inftl_tr); +Index: linux-2.6.5/drivers/mtd/inftlmount.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/inftlmount.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/inftlmount.c 2004-11-18 18:39:09.000000000 -0500 -@@ -0,0 +1,801 @@ -+/* -+ * inftlmount.c -- INFTL mount code with extensive checks. -+ * -+ * Author: Greg Ungerer (gerg@snapgear.com) -+ * (C) Copyright 2002-2003, Greg Ungerer (gerg@snapgear.com) -+ * -+ * Based heavily on the nftlmount.c code which is: -+ * Author: Fabrice Bellard (fabrice.bellard@netgem.com) -+ * Copyright (C) 2000 Netgem S.A. -+ * +--- linux-2.6.5.orig/drivers/mtd/inftlmount.c 2004-04-03 22:36:16.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/inftlmount.c 2005-02-01 17:11:29.000000000 -0500 +@@ -8,7 +8,7 @@ + * Author: Fabrice Bellard (fabrice.bellard@netgem.com) + * Copyright (C) 2000 Netgem S.A. + * +- * $Id: inftlmount.c,v 1.11 2003/06/23 07:39:21 dwmw2 Exp $ + * $Id: inftlmount.c,v 1.14 2004/08/09 13:57:42 dwmw2 Exp $ -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ + * + * 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 +@@ -41,7 +41,7 @@ + #include + #include + +-char inftlmountrev[]="$Revision: 1.11 $"; +char inftlmountrev[]="$Revision: 1.14 $"; -+ -+/* -+ * find_boot_record: Find the INFTL Media Header and its Spare copy which -+ * contains the various device information of the INFTL partition and -+ * Bad Unit Table. Update the PUtable[] table according to the Bad -+ * Unit Table. PUtable[] is used for management of Erase Unit in -+ * other routines in inftlcore.c and inftlmount.c. -+ */ -+static int find_boot_record(struct INFTLrecord *inftl) -+{ -+ struct inftl_unittail h1; -+ //struct inftl_oob oob; + + /* + * find_boot_record: Find the INFTL Media Header and its Spare copy which +@@ -54,14 +54,13 @@ + { + struct inftl_unittail h1; + //struct inftl_oob oob; +- unsigned int i, block, boot_record_count = 0; + unsigned int i, block; -+ u8 buf[SECTORSIZE]; -+ struct INFTLMediaHeader *mh = &inftl->MediaHdr; -+ struct INFTLPartition *ip; + u8 buf[SECTORSIZE]; + struct INFTLMediaHeader *mh = &inftl->MediaHdr; + struct INFTLPartition *ip; +- int retlen; + size_t retlen; -+ + +- DEBUG(MTD_DEBUG_LEVEL3, "INFTL: find_boot_record(inftl=0x%x)\n", +- (int)inftl); + DEBUG(MTD_DEBUG_LEVEL3, "INFTL: find_boot_record(inftl=%p)\n", inftl); -+ -+ /* -+ * Assume logical EraseSize == physical erasesize for starting the -+ * scan. We'll sort it out later if we find a MediaHeader which says -+ * otherwise. -+ */ -+ inftl->EraseSize = inftl->mbd.mtd->erasesize; -+ inftl->nb_blocks = inftl->mbd.mtd->size / inftl->EraseSize; -+ -+ inftl->MediaUnit = BLOCK_NIL; -+ -+ /* Search for a valid boot record */ -+ for (block = 0; block < inftl->nb_blocks; block++) { -+ int ret; -+ -+ /* -+ * Check for BNAND header first. Then whinge if it's found -+ * but later checks fail. -+ */ + + /* + * Assume logical EraseSize == physical erasesize for starting the +@@ -72,7 +71,6 @@ + inftl->nb_blocks = inftl->mbd.mtd->size / inftl->EraseSize; + + inftl->MediaUnit = BLOCK_NIL; +- inftl->SpareMediaUnit = BLOCK_NIL; + + /* Search for a valid boot record */ + for (block = 0; block < inftl->nb_blocks; block++) { +@@ -82,8 +80,11 @@ + * Check for BNAND header first. Then whinge if it's found + * but later checks fail. + */ +- if ((ret = MTD_READ(inftl->mbd.mtd, block * inftl->EraseSize, +- SECTORSIZE, &retlen, buf))) { + ret = MTD_READ(inftl->mbd.mtd, block * inftl->EraseSize, + SECTORSIZE, &retlen, buf); + /* We ignore ret in case the ECC of the MediaHeader is invalid + (which is apparently acceptable) */ + if (retlen != SECTORSIZE) { -+ static int warncount = 5; -+ -+ if (warncount) { -+ printk(KERN_WARNING "INFTL: block read at 0x%x " -+ "of mtd%d failed: %d\n", -+ block * inftl->EraseSize, -+ inftl->mbd.mtd->index, ret); -+ if (!--warncount) -+ printk(KERN_WARNING "INFTL: further " -+ "failures for this block will " -+ "not be printed\n"); -+ } -+ continue; -+ } -+ -+ if (retlen < 6 || memcmp(buf, "BNAND", 6)) { -+ /* BNAND\0 not found. Continue */ -+ continue; -+ } -+ -+ /* To be safer with BIOS, also use erase mark as discriminant */ -+ if ((ret = MTD_READOOB(inftl->mbd.mtd, block * inftl->EraseSize + -+ SECTORSIZE + 8, 8, &retlen, (char *)&h1) < 0)) { -+ printk(KERN_WARNING "INFTL: ANAND header found at " -+ "0x%x in mtd%d, but OOB data read failed " -+ "(err %d)\n", block * inftl->EraseSize, -+ inftl->mbd.mtd->index, ret); -+ continue; -+ } -+ -+ -+ /* -+ * This is the first we've seen. -+ * Copy the media header structure into place. -+ */ -+ memcpy(mh, buf, sizeof(struct INFTLMediaHeader)); + static int warncount = 5; + + if (warncount) { +@@ -114,36 +115,28 @@ + continue; + } + +- if (boot_record_count) { +- /* +- * We've already processed one. So we just check if +- * this one is the same as the first one we found. +- */ +- if (memcmp(mh, buf, sizeof(struct INFTLMediaHeader))) { +- printk(KERN_WARNING "INFTL: Media Headers at " +- "0x%x and 0x%x disagree.\n", +- inftl->MediaUnit * inftl->EraseSize, +- block * inftl->EraseSize); +- return -1; +- } +- if (boot_record_count == 1) +- inftl->SpareMediaUnit = block; +- +- /* +- * Mark this boot record (INFTL MediaHeader) block as +- * reserved. +- */ +- inftl->PUtable[block] = BLOCK_RESERVED; +- +- boot_record_count++; +- continue; +- } + + /* + * This is the first we've seen. + * Copy the media header structure into place. + */ + memcpy(mh, buf, sizeof(struct INFTLMediaHeader)); + + /* Read the spare media header at offset 4096 */ + MTD_READ(inftl->mbd.mtd, block * inftl->EraseSize + 4096, @@ -12443,266 +10647,147 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/inftlmount.c + return -1; + } + -+ mh->NoOfBootImageBlocks = le32_to_cpu(mh->NoOfBootImageBlocks); -+ mh->NoOfBinaryPartitions = le32_to_cpu(mh->NoOfBinaryPartitions); -+ mh->NoOfBDTLPartitions = le32_to_cpu(mh->NoOfBDTLPartitions); -+ mh->BlockMultiplierBits = le32_to_cpu(mh->BlockMultiplierBits); -+ mh->FormatFlags = le32_to_cpu(mh->FormatFlags); -+ mh->PercentUsed = le32_to_cpu(mh->PercentUsed); -+ -+#ifdef CONFIG_MTD_DEBUG_VERBOSE -+ if (CONFIG_MTD_DEBUG_VERBOSE >= 2) { -+ printk("INFTL: Media Header ->\n" -+ " bootRecordID = %s\n" -+ " NoOfBootImageBlocks = %d\n" -+ " NoOfBinaryPartitions = %d\n" -+ " NoOfBDTLPartitions = %d\n" -+ " BlockMultiplerBits = %d\n" -+ " FormatFlgs = %d\n" -+ " OsakVersion = 0x%x\n" -+ " PercentUsed = %d\n", -+ mh->bootRecordID, mh->NoOfBootImageBlocks, -+ mh->NoOfBinaryPartitions, -+ mh->NoOfBDTLPartitions, -+ mh->BlockMultiplierBits, mh->FormatFlags, -+ mh->OsakVersion, mh->PercentUsed); -+ } -+#endif -+ -+ if (mh->NoOfBDTLPartitions == 0) { -+ printk(KERN_WARNING "INFTL: Media Header sanity check " -+ "failed: NoOfBDTLPartitions (%d) == 0, " -+ "must be at least 1\n", mh->NoOfBDTLPartitions); -+ return -1; -+ } -+ -+ if ((mh->NoOfBDTLPartitions + mh->NoOfBinaryPartitions) > 4) { -+ printk(KERN_WARNING "INFTL: Media Header sanity check " -+ "failed: Total Partitions (%d) > 4, " -+ "BDTL=%d Binary=%d\n", mh->NoOfBDTLPartitions + -+ mh->NoOfBinaryPartitions, -+ mh->NoOfBDTLPartitions, -+ mh->NoOfBinaryPartitions); -+ return -1; -+ } -+ -+ if (mh->BlockMultiplierBits > 1) { -+ printk(KERN_WARNING "INFTL: sorry, we don't support " -+ "UnitSizeFactor 0x%02x\n", -+ mh->BlockMultiplierBits); -+ return -1; -+ } else if (mh->BlockMultiplierBits == 1) { -+ printk(KERN_WARNING "INFTL: support for INFTL with " -+ "UnitSizeFactor 0x%02x is experimental\n", -+ mh->BlockMultiplierBits); -+ inftl->EraseSize = inftl->mbd.mtd->erasesize << + mh->NoOfBootImageBlocks = le32_to_cpu(mh->NoOfBootImageBlocks); + mh->NoOfBinaryPartitions = le32_to_cpu(mh->NoOfBinaryPartitions); + mh->NoOfBDTLPartitions = le32_to_cpu(mh->NoOfBDTLPartitions); +@@ -197,8 +190,9 @@ + "UnitSizeFactor 0x%02x is experimental\n", + mh->BlockMultiplierBits); + inftl->EraseSize = inftl->mbd.mtd->erasesize << +- (0xff - mh->BlockMultiplierBits); + mh->BlockMultiplierBits; -+ inftl->nb_blocks = inftl->mbd.mtd->size / inftl->EraseSize; + inftl->nb_blocks = inftl->mbd.mtd->size / inftl->EraseSize; + block >>= mh->BlockMultiplierBits; -+ } -+ -+ /* Scan the partitions */ -+ for (i = 0; (i < 4); i++) { -+ ip = &mh->Partitions[i]; -+ ip->virtualUnits = le32_to_cpu(ip->virtualUnits); -+ ip->firstUnit = le32_to_cpu(ip->firstUnit); -+ ip->lastUnit = le32_to_cpu(ip->lastUnit); -+ ip->flags = le32_to_cpu(ip->flags); -+ ip->spareUnits = le32_to_cpu(ip->spareUnits); -+ ip->Reserved0 = le32_to_cpu(ip->Reserved0); -+ -+#ifdef CONFIG_MTD_DEBUG_VERBOSE -+ if (CONFIG_MTD_DEBUG_VERBOSE >= 2) { -+ printk(" PARTITION[%d] ->\n" -+ " virtualUnits = %d\n" -+ " firstUnit = %d\n" -+ " lastUnit = %d\n" -+ " flags = 0x%x\n" -+ " spareUnits = %d\n", -+ i, ip->virtualUnits, ip->firstUnit, -+ ip->lastUnit, ip->flags, -+ ip->spareUnits); -+ } -+#endif -+ -+ if (ip->Reserved0 != ip->firstUnit) { -+ struct erase_info *instr = &inftl->instr; -+ -+ /* -+ * Most likely this is using the -+ * undocumented qiuck mount feature. -+ * We don't support that, we will need -+ * to erase the hidden block for full -+ * compatibility. -+ */ -+ instr->addr = ip->Reserved0 * inftl->EraseSize; -+ instr->len = inftl->EraseSize; -+ MTD_ERASE(inftl->mbd.mtd, instr); -+ } -+ if ((ip->lastUnit - ip->firstUnit + 1) < ip->virtualUnits) { -+ printk(KERN_WARNING "INFTL: Media Header " -+ "Partition %d sanity check failed\n" -+ " firstUnit %d : lastUnit %d > " -+ "virtualUnits %d\n", i, ip->lastUnit, -+ ip->firstUnit, ip->Reserved0); -+ return -1; -+ } -+ if (ip->Reserved1 != 0) { -+ printk(KERN_WARNING "INFTL: Media Header " -+ "Partition %d sanity check failed: " -+ "Reserved1 %d != 0\n", -+ i, ip->Reserved1); -+ return -1; -+ } -+ -+ if (ip->flags & INFTL_BDTL) -+ break; -+ } -+ -+ if (i >= 4) { -+ printk(KERN_WARNING "INFTL: Media Header Partition " -+ "sanity check failed:\n No partition " -+ "marked as Disk Partition\n"); -+ return -1; -+ } -+ -+ inftl->nb_boot_blocks = ip->firstUnit; -+ inftl->numvunits = ip->virtualUnits; -+ if (inftl->numvunits > (inftl->nb_blocks - -+ inftl->nb_boot_blocks - 2)) { -+ printk(KERN_WARNING "INFTL: Media Header sanity check " -+ "failed:\n numvunits (%d) > nb_blocks " -+ "(%d) - nb_boot_blocks(%d) - 2\n", -+ inftl->numvunits, inftl->nb_blocks, -+ inftl->nb_boot_blocks); -+ return -1; -+ } -+ -+ inftl->mbd.size = inftl->numvunits * -+ (inftl->EraseSize / SECTORSIZE); -+ -+ /* -+ * Block count is set to last used EUN (we won't need to keep -+ * any meta-data past that point). -+ */ -+ inftl->firstEUN = ip->firstUnit; -+ inftl->lastEUN = ip->lastUnit; -+ inftl->nb_blocks = ip->lastUnit + 1; -+ -+ /* Memory alloc */ -+ inftl->PUtable = kmalloc(inftl->nb_blocks * sizeof(u16), GFP_KERNEL); -+ if (!inftl->PUtable) { -+ printk(KERN_WARNING "INFTL: allocation of PUtable " + } + + /* Scan the partitions */ +@@ -293,7 +287,7 @@ + inftl->PUtable = kmalloc(inftl->nb_blocks * sizeof(u16), GFP_KERNEL); + if (!inftl->PUtable) { + printk(KERN_WARNING "INFTL: allocation of PUtable " +- "failed (%d bytes)\n", + "failed (%zd bytes)\n", -+ inftl->nb_blocks * sizeof(u16)); -+ return -ENOMEM; -+ } -+ -+ inftl->VUtable = kmalloc(inftl->nb_blocks * sizeof(u16), GFP_KERNEL); -+ if (!inftl->VUtable) { -+ kfree(inftl->PUtable); -+ printk(KERN_WARNING "INFTL: allocation of VUtable " + inftl->nb_blocks * sizeof(u16)); + return -ENOMEM; + } +@@ -302,7 +296,7 @@ + if (!inftl->VUtable) { + kfree(inftl->PUtable); + printk(KERN_WARNING "INFTL: allocation of VUtable " +- "failed (%d bytes)\n", + "failed (%zd bytes)\n", -+ inftl->nb_blocks * sizeof(u16)); -+ return -ENOMEM; -+ } -+ -+ /* Mark the blocks before INFTL MediaHeader as reserved */ -+ for (i = 0; i < inftl->nb_boot_blocks; i++) -+ inftl->PUtable[i] = BLOCK_RESERVED; -+ /* Mark all remaining blocks as potentially containing data */ -+ for (; i < inftl->nb_blocks; i++) -+ inftl->PUtable[i] = BLOCK_NOTEXPLORED; -+ -+ /* Mark this boot record (NFTL MediaHeader) block as reserved */ -+ inftl->PUtable[block] = BLOCK_RESERVED; -+ -+ /* Read Bad Erase Unit Table and modify PUtable[] accordingly */ -+ for (i = 0; i < inftl->nb_blocks; i++) { + inftl->nb_blocks * sizeof(u16)); + return -ENOMEM; + } +@@ -317,34 +311,23 @@ + /* Mark this boot record (NFTL MediaHeader) block as reserved */ + inftl->PUtable[block] = BLOCK_RESERVED; + +-#if 0 + /* Read Bad Erase Unit Table and modify PUtable[] accordingly */ + for (i = 0; i < inftl->nb_blocks; i++) { +- if ((i & (SECTORSIZE - 1)) == 0) { +- /* read one sector for every SECTORSIZE of blocks */ +- if ((ret = MTD_READECC(inftl->mbd.mtd, +- block * inftl->EraseSize + i + SECTORSIZE, +- SECTORSIZE, &retlen, buf, +- (char *)&oob, NULL)) < 0) { +- printk(KERN_WARNING "INFTL: read of " +- "bad sector table failed " +- "(err %d)\n", ret); +- kfree(inftl->VUtable); +- kfree(inftl->PUtable); +- return -1; +- } + int physblock; + /* If any of the physical eraseblocks are bad, don't + use the unit. */ + for (physblock = 0; physblock < inftl->EraseSize; physblock += inftl->mbd.mtd->erasesize) { + if (inftl->mbd.mtd->block_isbad(inftl->mbd.mtd, i * inftl->EraseSize + physblock)) + inftl->PUtable[i] = BLOCK_RESERVED; -+ } -+ } -+ -+ inftl->MediaUnit = block; + } +- /* Mark the Bad Erase Unit as RESERVED in PUtable */ +- if (buf[i & (SECTORSIZE - 1)] != 0xff) +- inftl->PUtable[i] = BLOCK_RESERVED; + } +-#endif + + inftl->MediaUnit = block; +- boot_record_count++; + return 0; -+ } + } +- +- return boot_record_count ? 0 : -1; + + /* Not found. */ + return -1; -+} -+ -+static int memcmpb(void *a, int c, int n) -+{ -+ int i; -+ for (i = 0; i < n; i++) { -+ if (c != ((unsigned char *)a)[i]) -+ return 1; -+ } -+ return 0; -+} -+ -+/* -+ * check_free_sector: check if a free sector is actually FREE, -+ * i.e. All 0xff in data and oob area. -+ */ -+static int check_free_sectors(struct INFTLrecord *inftl, unsigned int address, -+ int len, int check_oob) -+{ + } + + static int memcmpb(void *a, int c, int n) +@@ -364,28 +347,22 @@ + static int check_free_sectors(struct INFTLrecord *inftl, unsigned int address, + int len, int check_oob) + { +- int i, retlen; +- u8 buf[SECTORSIZE]; + u8 buf[SECTORSIZE + inftl->mbd.mtd->oobsize]; + size_t retlen; + int i; -+ + +- DEBUG(MTD_DEBUG_LEVEL3, "INFTL: check_free_sectors(inftl=0x%x," +- "address=0x%x,len=%d,check_oob=%d)\n", (int)inftl, + DEBUG(MTD_DEBUG_LEVEL3, "INFTL: check_free_sectors(inftl=%p," + "address=0x%x,len=%d,check_oob=%d)\n", inftl, -+ address, len, check_oob); -+ -+ for (i = 0; i < len; i += SECTORSIZE) { + address, len, check_oob); + + for (i = 0; i < len; i += SECTORSIZE) { +- /* +- * We want to read the sector without ECC check here since a +- * free sector does not have ECC syndrome on it yet. +- */ +- if (MTD_READ(inftl->mbd.mtd, address, SECTORSIZE, &retlen, buf) < 0) + if (MTD_READECC(inftl->mbd.mtd, address, SECTORSIZE, &retlen, buf, &buf[SECTORSIZE], &inftl->oobinfo) < 0) -+ return -1; -+ if (memcmpb(buf, 0xff, SECTORSIZE) != 0) -+ return -1; -+ -+ if (check_oob) { + return -1; + if (memcmpb(buf, 0xff, SECTORSIZE) != 0) + return -1; + + if (check_oob) { +- if (MTD_READOOB(inftl->mbd.mtd, address, +- inftl->mbd.mtd->oobsize, &retlen, buf) < 0) +- return -1; +- if (memcmpb(buf, 0xff, inftl->mbd.mtd->oobsize) != 0) + if (memcmpb(buf + SECTORSIZE, 0xff, inftl->mbd.mtd->oobsize) != 0) -+ return -1; -+ } -+ address += SECTORSIZE; -+ } -+ -+ return 0; -+} -+ -+/* -+ * INFTL_format: format a Erase Unit by erasing ALL Erase Zones in the Erase -+ * Unit and Update INFTL metadata. Each erase operation is -+ * checked with check_free_sectors. -+ * -+ * Return: 0 when succeed, -1 on error. -+ * -+ * ToDo: 1. Is it neceressary to check_free_sector after erasing ?? -+ */ -+int INFTL_formatblock(struct INFTLrecord *inftl, int block) -+{ + return -1; + } + address += SECTORSIZE; +@@ -402,52 +379,62 @@ + * Return: 0 when succeed, -1 on error. + * + * ToDo: 1. Is it neceressary to check_free_sector after erasing ?? +- * 2. UnitSizeFactor != 0xFF + */ + int INFTL_formatblock(struct INFTLrecord *inftl, int block) + { +- int retlen; + size_t retlen; -+ struct inftl_unittail uci; -+ struct erase_info *instr = &inftl->instr; + struct inftl_unittail uci; + struct erase_info *instr = &inftl->instr; + int physblock; -+ + +- DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_formatblock(inftl=0x%x," +- "block=%d)\n", (int)inftl, block); + DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_formatblock(inftl=%p," + "block=%d)\n", inftl, block); -+ -+ memset(instr, 0, sizeof(struct erase_info)); -+ + + memset(instr, 0, sizeof(struct erase_info)); + + /* FIXME: Shouldn't we be setting the 'discarded' flag to zero + _first_? */ + -+ /* Use async erase interface, test return code */ -+ instr->addr = block * inftl->EraseSize; + /* Use async erase interface, test return code */ + instr->addr = block * inftl->EraseSize; +- instr->len = inftl->EraseSize; +- MTD_ERASE(inftl->mbd.mtd, instr); + instr->len = inftl->mbd.mtd->erasesize; + /* Erase one physical eraseblock at a time, even though the NAND api + allows us to group them. This way we if we have a failure, we can @@ -12715,400 +10800,78 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/inftlmount.c + block); + goto fail; + } -+ -+ /* + +- if (instr->state == MTD_ERASE_FAILED) { + /* +- * Could not format, FixMe: We should update the BadUnitTable +- * both in memory and on disk. +- */ +- printk(KERN_WARNING "INFTL: error while formatting block %d\n", +- block); +- return -1; + * Check the "freeness" of Erase Unit before updating metadata. + * FixMe: is this check really necessary? Since we have check the + * return code after the erase operation. + */ + if (check_free_sectors(inftl, instr->addr, instr->len, 1) != 0) + goto fail; -+ } -+ -+ uci.EraseMark = cpu_to_le16(ERASE_MARK); -+ uci.EraseMark1 = cpu_to_le16(ERASE_MARK); -+ uci.Reserved[0] = 0; -+ uci.Reserved[1] = 0; -+ uci.Reserved[2] = 0; -+ uci.Reserved[3] = 0; + } + +- /* +- * Check the "freeness" of Erase Unit before updating metadata. +- * FixMe: is this check really necessary? Since we have check the +- * return code after the erase operation. +- */ +- if (check_free_sectors(inftl, instr->addr, inftl->EraseSize, 1) != 0) +- return -1; +- + uci.EraseMark = cpu_to_le16(ERASE_MARK); + uci.EraseMark1 = cpu_to_le16(ERASE_MARK); + uci.Reserved[0] = 0; + uci.Reserved[1] = 0; + uci.Reserved[2] = 0; + uci.Reserved[3] = 0; +- if (MTD_WRITEOOB(inftl->mbd.mtd, block * inftl->EraseSize + SECTORSIZE * 2 + + instr->addr = block * inftl->EraseSize + SECTORSIZE * 2; + if (MTD_WRITEOOB(inftl->mbd.mtd, instr->addr + -+ 8, 8, &retlen, (char *)&uci) < 0) + 8, 8, &retlen, (char *)&uci) < 0) +- return -1; + goto fail; -+ return 0; + return 0; +fail: + /* could not format, update the bad block table (caller is responsible + for setting the PUtable to BLOCK_RESERVED on failure) */ + inftl->mbd.mtd->block_markbad(inftl->mbd.mtd, instr->addr); + return -1; -+} -+ -+/* -+ * format_chain: Format an invalid Virtual Unit chain. It frees all the Erase -+ * Units in a Virtual Unit Chain, i.e. all the units are disconnected. -+ * -+ * Since the chain is invalid then we will have to erase it from its -+ * head (normally for INFTL we go from the oldest). But if it has a -+ * loop then there is no oldest... -+ */ -+static void format_chain(struct INFTLrecord *inftl, unsigned int first_block) -+{ -+ unsigned int block = first_block, block1; -+ -+ printk(KERN_WARNING "INFTL: formatting chain at block %d\n", -+ first_block); -+ -+ for (;;) { -+ block1 = inftl->PUtable[block]; -+ -+ printk(KERN_WARNING "INFTL: formatting block %d\n", block); -+ if (INFTL_formatblock(inftl, block) < 0) { -+ /* -+ * Cannot format !!!! Mark it as Bad Unit, -+ */ -+ inftl->PUtable[block] = BLOCK_RESERVED; -+ } else { -+ inftl->PUtable[block] = BLOCK_FREE; -+ } -+ -+ /* Goto next block on the chain */ -+ block = block1; -+ -+ if (block == BLOCK_NIL || block >= inftl->lastEUN) -+ break; -+ } -+} -+ -+void INFTL_dumptables(struct INFTLrecord *s) -+{ -+ int i; -+ -+ printk("-------------------------------------------" -+ "----------------------------------\n"); -+ -+ printk("VUtable[%d] ->", s->nb_blocks); -+ for (i = 0; i < s->nb_blocks; i++) { -+ if ((i % 8) == 0) -+ printk("\n%04x: ", i); -+ printk("%04x ", s->VUtable[i]); -+ } -+ -+ printk("\n-------------------------------------------" -+ "----------------------------------\n"); -+ -+ printk("PUtable[%d-%d=%d] ->", s->firstEUN, s->lastEUN, s->nb_blocks); -+ for (i = 0; i <= s->lastEUN; i++) { -+ if ((i % 8) == 0) -+ printk("\n%04x: ", i); -+ printk("%04x ", s->PUtable[i]); -+ } -+ -+ printk("\n-------------------------------------------" -+ "----------------------------------\n"); -+ -+ printk("INFTL ->\n" -+ " EraseSize = %d\n" -+ " h/s/c = %d/%d/%d\n" -+ " numvunits = %d\n" -+ " firstEUN = %d\n" -+ " lastEUN = %d\n" -+ " numfreeEUNs = %d\n" -+ " LastFreeEUN = %d\n" -+ " nb_blocks = %d\n" -+ " nb_boot_blocks = %d", -+ s->EraseSize, s->heads, s->sectors, s->cylinders, -+ s->numvunits, s->firstEUN, s->lastEUN, s->numfreeEUNs, -+ s->LastFreeEUN, s->nb_blocks, s->nb_boot_blocks); -+ -+ printk("\n-------------------------------------------" -+ "----------------------------------\n"); -+} -+ -+void INFTL_dumpVUchains(struct INFTLrecord *s) -+{ -+ int logical, block, i; -+ -+ printk("-------------------------------------------" -+ "----------------------------------\n"); -+ -+ printk("INFTL Virtual Unit Chains:\n"); -+ for (logical = 0; logical < s->nb_blocks; logical++) { -+ block = s->VUtable[logical]; -+ if (block > s->nb_blocks) -+ continue; -+ printk(" LOGICAL %d --> %d ", logical, block); -+ for (i = 0; i < s->nb_blocks; i++) { -+ if (s->PUtable[block] == BLOCK_NIL) -+ break; -+ block = s->PUtable[block]; -+ printk("%d ", block); -+ } -+ printk("\n"); -+ } -+ -+ printk("-------------------------------------------" -+ "----------------------------------\n"); -+} -+ -+int INFTL_mount(struct INFTLrecord *s) -+{ -+ unsigned int block, first_block, prev_block, last_block; -+ unsigned int first_logical_block, logical_block, erase_mark; -+ int chain_length, do_format_chain; -+ struct inftl_unithead1 h0; -+ struct inftl_unittail h1; + } + + /* +@@ -472,7 +459,6 @@ + if (INFTL_formatblock(inftl, block) < 0) { + /* + * Cannot format !!!! Mark it as Bad Unit, +- * FixMe: update the BadUnitTable on disk. + */ + inftl->PUtable[block] = BLOCK_RESERVED; + } else { +@@ -565,10 +551,11 @@ + int chain_length, do_format_chain; + struct inftl_unithead1 h0; + struct inftl_unittail h1; +- int i, retlen; + size_t retlen; + int i; -+ u8 *ANACtable, ANAC; -+ + u8 *ANACtable, ANAC; + +- DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_mount(inftl=0x%x)\n", (int)s); + DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_mount(inftl=%p)\n", s); -+ -+ /* Search for INFTL MediaHeader and Spare INFTL Media Header */ -+ if (find_boot_record(s) < 0) { -+ printk(KERN_WARNING "INFTL: could not find valid boot record?\n"); -+ return -1; -+ } -+ -+ /* Init the logical to physical table */ -+ for (i = 0; i < s->nb_blocks; i++) -+ s->VUtable[i] = BLOCK_NIL; -+ -+ logical_block = block = BLOCK_NIL; -+ -+ /* Temporary buffer to store ANAC numbers. */ -+ ANACtable = kmalloc(s->nb_blocks * sizeof(u8), GFP_KERNEL); -+ memset(ANACtable, 0, s->nb_blocks); -+ -+ /* -+ * First pass is to explore each physical unit, and construct the -+ * virtual chains that exist (newest physical unit goes into VUtable). -+ * Any block that is in any way invalid will be left in the -+ * NOTEXPLORED state. Then at the end we will try to format it and -+ * mark it as free. -+ */ -+ DEBUG(MTD_DEBUG_LEVEL3, "INFTL: pass 1, explore each unit\n"); -+ for (first_block = s->firstEUN; first_block <= s->lastEUN; first_block++) { -+ if (s->PUtable[first_block] != BLOCK_NOTEXPLORED) -+ continue; -+ -+ do_format_chain = 0; -+ first_logical_block = BLOCK_NIL; -+ last_block = BLOCK_NIL; -+ block = first_block; -+ -+ for (chain_length = 0; ; chain_length++) { -+ -+ if ((chain_length == 0) && -+ (s->PUtable[block] != BLOCK_NOTEXPLORED)) { -+ /* Nothing to do here, onto next block */ -+ break; -+ } -+ -+ if (MTD_READOOB(s->mbd.mtd, block * s->EraseSize + 8, -+ 8, &retlen, (char *)&h0) < 0 || -+ MTD_READOOB(s->mbd.mtd, block * s->EraseSize + -+ 2 * SECTORSIZE + 8, 8, &retlen, (char *)&h1) < 0) { -+ /* Should never happen? */ -+ do_format_chain++; -+ break; -+ } -+ -+ logical_block = le16_to_cpu(h0.virtualUnitNo); -+ prev_block = le16_to_cpu(h0.prevUnitNo); -+ erase_mark = le16_to_cpu((h1.EraseMark | h1.EraseMark1)); -+ ANACtable[block] = h0.ANAC; -+ -+ /* Previous block is relative to start of Partition */ -+ if (prev_block < s->nb_blocks) -+ prev_block += s->firstEUN; -+ -+ /* Already explored partial chain? */ -+ if (s->PUtable[block] != BLOCK_NOTEXPLORED) { -+ /* Check if chain for this logical */ -+ if (logical_block == first_logical_block) { -+ if (last_block != BLOCK_NIL) -+ s->PUtable[last_block] = block; -+ } -+ break; -+ } -+ -+ /* Check for invalid block */ -+ if (erase_mark != ERASE_MARK) { -+ printk(KERN_WARNING "INFTL: corrupt block %d " -+ "in chain %d, chain length %d, erase " -+ "mark 0x%x?\n", block, first_block, -+ chain_length, erase_mark); -+ /* -+ * Assume end of chain, probably incomplete -+ * fold/erase... -+ */ -+ if (chain_length == 0) -+ do_format_chain++; -+ break; -+ } -+ -+ /* Check for it being free already then... */ -+ if ((logical_block == BLOCK_FREE) || -+ (logical_block == BLOCK_NIL)) { -+ s->PUtable[block] = BLOCK_FREE; -+ break; -+ } -+ -+ /* Sanity checks on block numbers */ -+ if ((logical_block >= s->nb_blocks) || -+ ((prev_block >= s->nb_blocks) && -+ (prev_block != BLOCK_NIL))) { -+ if (chain_length > 0) { -+ printk(KERN_WARNING "INFTL: corrupt " -+ "block %d in chain %d?\n", -+ block, first_block); -+ do_format_chain++; -+ } -+ break; -+ } -+ -+ if (first_logical_block == BLOCK_NIL) { -+ first_logical_block = logical_block; -+ } else { -+ if (first_logical_block != logical_block) { -+ /* Normal for folded chain... */ -+ break; -+ } -+ } -+ -+ /* -+ * Current block is valid, so if we followed a virtual -+ * chain to get here then we can set the previous -+ * block pointer in our PUtable now. Then move onto -+ * the previous block in the chain. -+ */ -+ s->PUtable[block] = BLOCK_NIL; -+ if (last_block != BLOCK_NIL) -+ s->PUtable[last_block] = block; -+ last_block = block; -+ block = prev_block; -+ -+ /* Check for end of chain */ -+ if (block == BLOCK_NIL) -+ break; -+ -+ /* Validate next block before following it... */ -+ if (block > s->lastEUN) { -+ printk(KERN_WARNING "INFTL: invalid previous " -+ "block %d in chain %d?\n", block, -+ first_block); -+ do_format_chain++; -+ break; -+ } -+ } -+ -+ if (do_format_chain) { -+ format_chain(s, first_block); -+ continue; -+ } -+ -+ /* -+ * Looks like a valid chain then. It may not really be the -+ * newest block in the chain, but it is the newest we have -+ * found so far. We might update it in later iterations of -+ * this loop if we find something newer. -+ */ -+ s->VUtable[first_logical_block] = first_block; -+ logical_block = BLOCK_NIL; -+ } -+ -+#ifdef CONFIG_MTD_DEBUG_VERBOSE -+ if (CONFIG_MTD_DEBUG_VERBOSE >= 2) -+ INFTL_dumptables(s); -+#endif -+ -+ /* -+ * Second pass, check for infinite loops in chains. These are -+ * possible because we don't update the previous pointers when -+ * we fold chains. No big deal, just fix them up in PUtable. -+ */ -+ DEBUG(MTD_DEBUG_LEVEL3, "INFTL: pass 2, validate virtual chains\n"); -+ for (logical_block = 0; logical_block < s->numvunits; logical_block++) { -+ block = s->VUtable[logical_block]; -+ last_block = BLOCK_NIL; -+ -+ /* Check for free/reserved/nil */ -+ if (block >= BLOCK_RESERVED) -+ continue; -+ -+ ANAC = ANACtable[block]; -+ for (i = 0; i < s->numvunits; i++) { -+ if (s->PUtable[block] == BLOCK_NIL) -+ break; -+ if (s->PUtable[block] > s->lastEUN) { -+ printk(KERN_WARNING "INFTL: invalid prev %d, " -+ "in virtual chain %d\n", -+ s->PUtable[block], logical_block); -+ s->PUtable[block] = BLOCK_NIL; -+ -+ } -+ if (ANACtable[block] != ANAC) { -+ /* -+ * Chain must point back to itself. This is ok, -+ * but we will need adjust the tables with this -+ * newest block and oldest block. -+ */ -+ s->VUtable[logical_block] = block; -+ s->PUtable[last_block] = BLOCK_NIL; -+ break; -+ } -+ -+ ANAC--; -+ last_block = block; -+ block = s->PUtable[block]; -+ } -+ -+ if (i >= s->nb_blocks) { -+ /* -+ * Uhoo, infinite chain with valid ANACS! -+ * Format whole chain... -+ */ -+ format_chain(s, first_block); -+ } -+ } -+ -+#ifdef CONFIG_MTD_DEBUG_VERBOSE -+ if (CONFIG_MTD_DEBUG_VERBOSE >= 2) -+ INFTL_dumptables(s); -+ if (CONFIG_MTD_DEBUG_VERBOSE >= 2) -+ INFTL_dumpVUchains(s); -+#endif -+ -+ /* -+ * Third pass, format unreferenced blocks and init free block count. -+ */ -+ s->numfreeEUNs = 0; -+ s->LastFreeEUN = BLOCK_NIL; -+ -+ DEBUG(MTD_DEBUG_LEVEL3, "INFTL: pass 3, format unused blocks\n"); -+ for (block = s->firstEUN; block <= s->lastEUN; block++) { -+ if (s->PUtable[block] == BLOCK_NOTEXPLORED) { -+ printk("INFTL: unreferenced block %d, formatting it\n", -+ block); -+ if (INFTL_formatblock(s, block) < 0) -+ s->PUtable[block] = BLOCK_RESERVED; -+ else -+ s->PUtable[block] = BLOCK_FREE; -+ } -+ if (s->PUtable[block] == BLOCK_FREE) { -+ s->numfreeEUNs++; -+ if (s->LastFreeEUN == BLOCK_NIL) -+ s->LastFreeEUN = block; -+ } -+ } -+ -+ kfree(ANACtable); -+ return 0; -+} -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/Kconfig + + /* Search for INFTL MediaHeader and Spare INFTL Media Header */ + if (find_boot_record(s) < 0) { +Index: linux-2.6.5/drivers/mtd/maps/Kconfig =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/Kconfig 2004-04-03 22:38:21.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/Kconfig 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/Kconfig 2004-04-03 22:38:21.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/Kconfig 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ # drivers/mtd/maps/Kconfig -# $Id: Kconfig,v 1.12 2003/06/23 07:38:11 dwmw2 Exp $ @@ -13440,10 +11203,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/Kconfig + endmenu -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/Makefile +Index: linux-2.6.5/drivers/mtd/maps/Makefile =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/Makefile 2004-04-03 22:36:12.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/Makefile 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/Makefile 2004-04-03 22:36:12.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/Makefile 2005-02-01 17:11:17.000000000 -0500 @@ -1,7 +1,7 @@ # # linux/drivers/maps/Makefile @@ -13495,10 +11258,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/Makefile +obj-$(CONFIG_MTD_IXP2000) += ixp2000.o +obj-$(CONFIG_MTD_WRSBC8260) += wr_sbc82xx_flash.o +obj-$(CONFIG_MTD_DMV182) += dmv182.o -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/amd76xrom.c +Index: linux-2.6.5/drivers/mtd/maps/amd76xrom.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/amd76xrom.c 2004-04-03 22:36:52.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/amd76xrom.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/amd76xrom.c 2004-04-03 22:36:52.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/amd76xrom.c 2005-02-01 17:11:17.000000000 -0500 @@ -2,7 +2,7 @@ * amd76xrom.c * @@ -13916,10 +11679,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/amd76xrom. } module_init(init_amd76xrom); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/arctic-mtd.c +Index: linux-2.6.5/drivers/mtd/maps/arctic-mtd.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/arctic-mtd.c 2004-04-03 22:36:55.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/arctic-mtd.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/arctic-mtd.c 2004-04-03 22:36:55.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/arctic-mtd.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: arctic-mtd.c,v 1.10 2003/06/02 16:37:59 trini Exp $ @@ -13945,10 +11708,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/arctic-mtd if (!arctic_mtd_map.virt) { printk("%s: failed to ioremap 0x%x\n", NAME, PADDR); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/autcpu12-nvram.c +Index: linux-2.6.5/drivers/mtd/maps/autcpu12-nvram.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/autcpu12-nvram.c 2004-04-03 22:38:17.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/autcpu12-nvram.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/autcpu12-nvram.c 2004-04-03 22:38:17.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/autcpu12-nvram.c 2005-02-01 17:11:17.000000000 -0500 @@ -2,7 +2,7 @@ * NV-RAM memory access on autcpu12 * (C) 2002 Thomas Gleixner (gleixner@autronix.de) @@ -13985,10 +11748,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/autcpu12-n autcpu12_sram_map.size = SZ_128K; map: -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/beech-mtd.c +Index: linux-2.6.5/drivers/mtd/maps/beech-mtd.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/beech-mtd.c 2004-04-03 22:37:36.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/beech-mtd.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/beech-mtd.c 2004-04-03 22:37:36.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/beech-mtd.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: beech-mtd.c,v 1.7 2003/05/21 12:45:18 dwmw2 Exp $ @@ -14014,10 +11777,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/beech-mtd. if (!beech_mtd_map.virt) { printk("%s: failed to ioremap 0x%x\n", NAME, PADDR); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/cdb89712.c +Index: linux-2.6.5/drivers/mtd/maps/cdb89712.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/cdb89712.c 2004-04-03 22:38:26.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/cdb89712.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/cdb89712.c 2004-04-03 22:38:26.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/cdb89712.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,7 +1,7 @@ /* * Flash on Cirrus CDB89712 @@ -14081,10 +11844,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/cdb89712.c if (!cdb89712_bootrom_map.virt) { printk(KERN_NOTICE "Failed to ioremap Cdb89712 BootROM space\n"); err = -EIO; -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ceiva.c +Index: linux-2.6.5/drivers/mtd/maps/ceiva.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/ceiva.c 2004-04-03 22:36:55.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ceiva.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/ceiva.c 2004-04-03 22:36:55.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/ceiva.c 2005-02-01 17:11:17.000000000 -0500 @@ -11,7 +11,7 @@ * * (C) 2000 Nicolas Pitre @@ -14105,10 +11868,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ceiva.c clps[i].map->size = clps[i].size; simple_map_init(&clps[i].map); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/cfi_flagadm.c +Index: linux-2.6.5/drivers/mtd/maps/cfi_flagadm.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/cfi_flagadm.c 2004-04-03 22:36:13.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/cfi_flagadm.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/cfi_flagadm.c 2004-04-03 22:36:13.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/cfi_flagadm.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,7 +1,7 @@ /* * Copyright © 2001 Flaga hf. Medical Devices, Kári Davíðsson @@ -14136,10 +11899,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/cfi_flagad FLASH_SIZE); if (!flagadm_map.virt) { -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/cstm_mips_ixx.c +Index: linux-2.6.5/drivers/mtd/maps/cstm_mips_ixx.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/cstm_mips_ixx.c 2004-04-03 22:36:25.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/cstm_mips_ixx.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/cstm_mips_ixx.c 2004-04-03 22:36:25.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/cstm_mips_ixx.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: cstm_mips_ixx.c,v 1.9 2003/05/21 12:45:18 dwmw2 Exp $ @@ -14191,10 +11954,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/cstm_mips_ #if defined(CONFIG_MIPS_ITE8172) || defined(CONFIG_MIPS_IVR) cstm_mips_ixx_map[i].set_vpp = cstm_mips_ixx_set_vpp; #endif -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/db1550-flash.c +Index: linux-2.6.5/drivers/mtd/maps/db1550-flash.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/db1550-flash.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/db1550-flash.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/db1550-flash.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/db1550-flash.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,188 @@ +/* + * Flash memory access on Alchemy Db1550 board @@ -14384,10 +12147,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/db1550-fla +MODULE_AUTHOR("Embedded Edge, LLC"); +MODULE_DESCRIPTION("Db1550 mtd map driver"); +MODULE_LICENSE("GPL"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/db1x00-flash.c +Index: linux-2.6.5/drivers/mtd/maps/db1x00-flash.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/db1x00-flash.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/db1x00-flash.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/db1x00-flash.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/db1x00-flash.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,219 @@ +/* + * Flash memory access on Alchemy Db1xxx boards @@ -14608,10 +12371,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/db1x00-fla +MODULE_AUTHOR("Pete Popov"); +MODULE_DESCRIPTION("Db1x00 mtd map driver"); +MODULE_LICENSE("GPL"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/dbox2-flash.c +Index: linux-2.6.5/drivers/mtd/maps/dbox2-flash.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/dbox2-flash.c 2004-04-03 22:38:21.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/dbox2-flash.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/dbox2-flash.c 2004-04-03 22:38:21.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/dbox2-flash.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: dbox2-flash.c,v 1.9 2003/05/21 12:45:18 dwmw2 Exp $ @@ -14690,10 +12453,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/dbox2-flas mymtd = do_map_probe("cfi_probe", &dbox2_flash_map); } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/dc21285.c +Index: linux-2.6.5/drivers/mtd/maps/dc21285.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/dc21285.c 2004-04-03 22:36:57.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/dc21285.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/dc21285.c 2004-04-03 22:36:57.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/dc21285.c 2005-02-01 17:11:17.000000000 -0500 @@ -5,13 +5,14 @@ * * This code is GPL @@ -15015,10 +12778,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/dc21285.c iounmap((void *)dc21285_map.map_priv_1); } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/dilnetpc.c +Index: linux-2.6.5/drivers/mtd/maps/dilnetpc.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/dilnetpc.c 2004-04-03 22:36:26.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/dilnetpc.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/dilnetpc.c 2004-04-03 22:36:26.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/dilnetpc.c 2005-02-01 17:11:17.000000000 -0500 @@ -14,7 +14,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA @@ -15046,10 +12809,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/dilnetpc.c dnpc_map_flash(dnpc_map.phys, dnpc_map.size); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/dmv182.c +Index: linux-2.6.5/drivers/mtd/maps/dmv182.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/dmv182.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/dmv182.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/dmv182.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/dmv182.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,150 @@ + +/* @@ -15201,10 +12964,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/dmv182.c + +module_init(init_svme182); +module_exit(cleanup_svme182); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ebony.c +Index: linux-2.6.5/drivers/mtd/maps/ebony.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/ebony.c 2004-04-03 22:37:59.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ebony.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/ebony.c 2004-04-03 22:37:59.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/ebony.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,11 +1,11 @@ /* - * $Id: ebony.c,v 1.8 2003/06/23 11:48:18 dwmw2 Exp $ @@ -15282,10 +13045,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ebony.c -MODULE_AUTHOR("Matt Porter "); +MODULE_AUTHOR("Matt Porter "); MODULE_DESCRIPTION("MTD map and partitions for IBM 440GP Ebony boards"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/edb7312.c +Index: linux-2.6.5/drivers/mtd/maps/edb7312.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/edb7312.c 2004-04-03 22:38:27.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/edb7312.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/edb7312.c 2004-04-03 22:38:27.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/edb7312.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: edb7312.c,v 1.9 2003/06/23 11:48:18 dwmw2 Exp $ @@ -15324,10 +13087,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/edb7312.c if (!edb7312nor_map.virt) { printk(MSG_PREFIX "failed to ioremap\n"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/elan-104nc.c +Index: linux-2.6.5/drivers/mtd/maps/elan-104nc.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/elan-104nc.c 2004-04-03 22:37:06.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/elan-104nc.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/elan-104nc.c 2004-04-03 22:37:06.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/elan-104nc.c 2005-02-01 17:11:17.000000000 -0500 @@ -16,7 +16,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA @@ -15447,10 +13210,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/elan-104nc if (!iomapadr) { printk( KERN_ERR"%s: failed to ioremap memory region\n", elan_104nc_map.name ); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/epxa10db-flash.c +Index: linux-2.6.5/drivers/mtd/maps/epxa10db-flash.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/epxa10db-flash.c 2004-04-03 22:37:39.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/epxa10db-flash.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/epxa10db-flash.c 2004-04-03 22:37:39.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/epxa10db-flash.c 2005-02-01 17:11:17.000000000 -0500 @@ -5,7 +5,7 @@ * Copyright (C) 2001 Altera Corporation * Copyright (C) 2001 Red Hat, Inc. @@ -15478,10 +13241,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/epxa10db-f if (!epxa_map.virt) { printk("Failed to ioremap %s flash\n",BOARD_NAME); return -EIO; -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/fortunet.c +Index: linux-2.6.5/drivers/mtd/maps/fortunet.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/fortunet.c 2004-04-03 22:36:27.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/fortunet.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/fortunet.c 2004-04-03 22:36:27.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/fortunet.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,6 +1,6 @@ /* fortunet.c memory map * @@ -15576,10 +13339,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/fortunet.c map_regions[ix].mymtd = do_map_probe("cfi_probe", &map_regions[ix].map_info); } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/h720x-flash.c +Index: linux-2.6.5/drivers/mtd/maps/h720x-flash.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/h720x-flash.c 2004-04-03 22:36:26.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/h720x-flash.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/h720x-flash.c 2004-04-03 22:36:26.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/h720x-flash.c 2005-02-01 17:11:17.000000000 -0500 @@ -2,9 +2,11 @@ * Flash memory access on Hynix GMS30C7201/HMS30C7202 based * evaluation boards @@ -15628,10 +13391,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/h720x-flas mymtd = do_map_probe("cfi_probe", &h720x_map); } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ichxrom.c +Index: linux-2.6.5/drivers/mtd/maps/ichxrom.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/ichxrom.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ichxrom.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/ichxrom.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/ichxrom.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,380 @@ +/* + * ichxrom.c @@ -16013,10 +13776,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ichxrom.c +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Eric Biederman "); +MODULE_DESCRIPTION("MTD map driver for BIOS chips on the ICHX southbridge"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/impa7.c +Index: linux-2.6.5/drivers/mtd/maps/impa7.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/impa7.c 2004-04-03 22:36:26.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/impa7.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/impa7.c 2004-04-03 22:36:26.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/impa7.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: impa7.c,v 1.9 2003/06/23 11:47:43 dwmw2 Exp $ @@ -16064,10 +13827,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/impa7.c ioremap(pt[i].addr, pt[i].size); if (!impa7_map[i].virt) { printk(MSG_PREFIX "failed to ioremap\n"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/integrator-flash-v24.c +Index: linux-2.6.5/drivers/mtd/maps/integrator-flash-v24.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/integrator-flash-v24.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/integrator-flash-v24.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/integrator-flash-v24.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/integrator-flash-v24.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,258 @@ +/*====================================================================== + @@ -16327,10 +14090,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/integrator +MODULE_AUTHOR("ARM Ltd"); +MODULE_DESCRIPTION("ARM Integrator CFI map driver"); +MODULE_LICENSE("GPL"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/integrator-flash.c +Index: linux-2.6.5/drivers/mtd/maps/integrator-flash.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/integrator-flash.c 2004-04-03 22:37:41.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/integrator-flash.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/integrator-flash.c 2004-04-03 22:37:41.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/integrator-flash.c 2005-02-01 17:11:17.000000000 -0500 @@ -22,7 +22,7 @@ This is access code for flashes using ARM's flash partitioning standards. @@ -16352,10 +14115,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/integrator info->map.name = dev->dev.bus_id; info->map.set_vpp = armflash_set_vpp; -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ipaq-flash.c +Index: linux-2.6.5/drivers/mtd/maps/ipaq-flash.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/ipaq-flash.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ipaq-flash.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/ipaq-flash.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/ipaq-flash.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,464 @@ +/* + * Flash memory access on iPAQ Handhelds (either SA1100 or PXA250 based) @@ -16821,10 +14584,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ipaq-flash +MODULE_AUTHOR("Jamey Hicks"); +MODULE_DESCRIPTION("IPAQ CFI map driver"); +MODULE_LICENSE("MIT"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/iq80310.c +Index: linux-2.6.5/drivers/mtd/maps/iq80310.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/iq80310.c 2004-04-03 22:38:15.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/iq80310.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/iq80310.c 2004-04-03 22:38:15.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/iq80310.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: iq80310.c,v 1.17 2003/06/23 11:48:18 dwmw2 Exp $ @@ -16850,10 +14613,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/iq80310.c if (!iq80310_map.virt) { printk("Failed to ioremap\n"); return -EIO; -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ixp2000.c +Index: linux-2.6.5/drivers/mtd/maps/ixp2000.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/ixp2000.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ixp2000.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/ixp2000.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/ixp2000.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,281 @@ +/* + * $Id: ixp2000.c,v 1.3 2004/09/16 23:27:13 gleixner Exp $ @@ -17136,10 +14899,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ixp2000.c +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Deepak Saxena "); + -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ixp4xx.c +Index: linux-2.6.5/drivers/mtd/maps/ixp4xx.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/ixp4xx.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ixp4xx.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/ixp4xx.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/ixp4xx.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,260 @@ +/* + * $Id: ixp4xx.c,v 1.6 2004/09/17 00:25:06 gleixner Exp $ @@ -17401,10 +15164,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ixp4xx.c +MODULE_DESCRIPTION("MTD map driver for Intel IXP4xx systems") +MODULE_AUTHOR("Deepak Saxena"); + -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/l440gx.c +Index: linux-2.6.5/drivers/mtd/maps/l440gx.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/l440gx.c 2004-04-03 22:37:59.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/l440gx.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/l440gx.c 2004-04-03 22:37:59.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/l440gx.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: l440gx.c,v 1.12 2003/05/21 12:45:19 dwmw2 Exp $ @@ -17430,10 +15193,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/l440gx.c if (!l440gx_map.virt) { printk(KERN_WARNING "Failed to ioremap L440GX flash region\n"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/lasat.c +Index: linux-2.6.5/drivers/mtd/maps/lasat.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/lasat.c 2004-04-03 22:36:25.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/lasat.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/lasat.c 2004-04-03 22:36:25.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/lasat.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,14 +1,13 @@ /* - * Flash device on lasat 100 and 200 boards @@ -17566,10 +15329,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/lasat.c MODULE_LICENSE("GPL"); MODULE_AUTHOR("Brian Murphy "); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/lubbock-flash.c +Index: linux-2.6.5/drivers/mtd/maps/lubbock-flash.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/lubbock-flash.c 2004-04-03 22:37:37.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/lubbock-flash.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/lubbock-flash.c 2004-04-03 22:37:37.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/lubbock-flash.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: lubbock-flash.c,v 1.9 2003/06/23 11:48:18 dwmw2 Exp $ @@ -17665,10 +15428,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/lubbock-fl if (parsed_parts[i]) kfree(parsed_parts[i]); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/map_funcs.c +Index: linux-2.6.5/drivers/mtd/maps/map_funcs.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/map_funcs.c 2004-11-11 10:28:07.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/map_funcs.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/map_funcs.c 2005-02-01 16:55:39.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/map_funcs.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: map_funcs.c,v 1.2 2003/05/21 15:15:07 dwmw2 Exp $ @@ -17774,10 +15537,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/map_funcs. map->copy_from = simple_map_copy_from; map->copy_to = simple_map_copy_to; } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/mbx860.c +Index: linux-2.6.5/drivers/mtd/maps/mbx860.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/mbx860.c 2004-04-03 22:36:54.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/mbx860.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/mbx860.c 2004-04-03 22:36:54.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/mbx860.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: mbx860.c,v 1.5 2003/05/21 12:45:19 dwmw2 Exp $ @@ -17801,10 +15564,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/mbx860.c if (!mbx_map.virt) { printk("Failed to ioremap\n"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/mpc1211.c +Index: linux-2.6.5/drivers/mtd/maps/mpc1211.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/mpc1211.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/mpc1211.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/mpc1211.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/mpc1211.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,81 @@ +/* + * Flash on MPC-1211 @@ -17887,10 +15650,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/mpc1211.c +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Saito.K & Jeanne "); +MODULE_DESCRIPTION("MTD map driver for MPC-1211 boards. Interface"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/netsc520.c +Index: linux-2.6.5/drivers/mtd/maps/netsc520.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/netsc520.c 2004-04-03 22:37:41.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/netsc520.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/netsc520.c 2004-04-03 22:37:41.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/netsc520.c 2005-02-01 17:11:17.000000000 -0500 @@ -3,7 +3,7 @@ * Copyright (C) 2001 Mark Langsdorf (mark.langsdorf@amd.com) * based on sc520cdp.c by Sysgo Real-Time Solutions GmbH @@ -17918,10 +15681,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/netsc520.c if (!netsc520_map.virt) { printk("Failed to ioremap_nocache\n"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/nettel.c +Index: linux-2.6.5/drivers/mtd/maps/nettel.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/nettel.c 2004-04-03 22:36:52.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/nettel.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/nettel.c 2004-04-03 22:36:52.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/nettel.c 2005-02-01 17:11:17.000000000 -0500 @@ -6,7 +6,7 @@ * (C) Copyright 2000-2001, Greg Ungerer (gerg@snapgear.com) * (C) Copyright 2001-2002, SnapGear (www.snapgear.com) @@ -17959,10 +15722,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/nettel.c if (!nettel_amd_map.virt) { printk("SNAPGEAR: failed to ioremap() BOOTCS\n"); return(-EIO); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ocelot.c +Index: linux-2.6.5/drivers/mtd/maps/ocelot.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/ocelot.c 2004-04-03 22:38:22.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ocelot.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/ocelot.c 2004-04-03 22:38:22.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/ocelot.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: ocelot.c,v 1.12 2003/05/21 12:45:19 dwmw2 Exp $ @@ -18005,10 +15768,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ocelot.c if (!ocelot_flash_map.virt) { printk(KERN_NOTICE "Failed to ioremap Ocelot flash space\n"); goto fail_2; -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ocotea.c +Index: linux-2.6.5/drivers/mtd/maps/ocotea.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/ocotea.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ocotea.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/ocotea.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/ocotea.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,156 @@ +/* + * Mapping for Ocotea user flash @@ -18166,10 +15929,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/ocotea.c +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Matt Porter "); +MODULE_DESCRIPTION("MTD map and partitions for IBM 440GX Ocotea boards"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/octagon-5066.c +Index: linux-2.6.5/drivers/mtd/maps/octagon-5066.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/octagon-5066.c 2004-04-03 22:36:25.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/octagon-5066.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/octagon-5066.c 2004-04-03 22:36:25.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/octagon-5066.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,4 +1,4 @@ -// $Id: octagon-5066.c,v 1.24 2003/05/21 15:15:07 dwmw2 Exp $ +// $Id: octagon-5066.c,v 1.26 2004/07/12 22:38:29 dwmw2 Exp $ @@ -18278,10 +16041,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/octagon-50 .copy_to = oct5066_copy_to, .map_priv_1 = 2<<6 } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/omap-toto-flash.c +Index: linux-2.6.5/drivers/mtd/maps/omap-toto-flash.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/omap-toto-flash.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/omap-toto-flash.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/omap-toto-flash.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/omap-toto-flash.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,137 @@ +/* + * NOR Flash memory access on TI Toto board @@ -18420,10 +16183,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/omap-toto- +MODULE_AUTHOR("Jian Zhang"); +MODULE_DESCRIPTION("OMAP Toto board map driver"); +MODULE_LICENSE("GPL"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/pb1550-flash.c +Index: linux-2.6.5/drivers/mtd/maps/pb1550-flash.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/pb1550-flash.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/pb1550-flash.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/pb1550-flash.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/pb1550-flash.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,204 @@ +/* + * Flash memory access on Alchemy Pb1550 board @@ -18629,10 +16392,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/pb1550-fla +MODULE_AUTHOR("Embedded Edge, LLC"); +MODULE_DESCRIPTION("Pb1550 mtd map driver"); +MODULE_LICENSE("GPL"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/pb1xxx-flash.c +Index: linux-2.6.5/drivers/mtd/maps/pb1xxx-flash.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/pb1xxx-flash.c 2004-04-03 22:38:24.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/pb1xxx-flash.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/pb1xxx-flash.c 2004-04-03 22:38:24.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/pb1xxx-flash.c 2005-02-01 17:11:17.000000000 -0500 @@ -3,14 +3,14 @@ * * (C) 2001 Pete Popov @@ -18890,10 +16653,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/pb1xxx-fla } module_init(pb1xxx_mtd_init); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/pci.c +Index: linux-2.6.5/drivers/mtd/maps/pci.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/pci.c 2004-04-03 22:36:56.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/pci.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/pci.c 2004-04-03 22:36:56.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/pci.c 2005-02-01 17:11:17.000000000 -0500 @@ -7,7 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. @@ -19077,10 +16840,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/pci.c static int __devinit mtd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) { -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/pcmciamtd.c +Index: linux-2.6.5/drivers/mtd/maps/pcmciamtd.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/pcmciamtd.c 2004-04-03 22:36:19.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/pcmciamtd.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/pcmciamtd.c 2004-04-03 22:36:19.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/pcmciamtd.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: pcmciamtd.c,v 1.48 2003/06/24 07:14:38 spse Exp $ @@ -19339,10 +17102,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/pcmciamtd. } if(force_size && (force_size < 1 || force_size > 64)) { info("bad force_size (%d), using default", force_size); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/physmap.c +Index: linux-2.6.5/drivers/mtd/maps/physmap.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/physmap.c 2004-04-03 22:37:25.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/physmap.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/physmap.c 2004-04-03 22:37:25.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/physmap.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,7 +1,12 @@ /* - * $Id: physmap.c,v 1.29 2003/05/29 09:24:10 dwmw2 Exp $ @@ -19468,10 +17231,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/physmap.c del_mtd_partitions(mymtd); } else { del_mtd_device(mymtd); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/pnc2000.c +Index: linux-2.6.5/drivers/mtd/maps/pnc2000.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/pnc2000.c 2004-04-03 22:37:06.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/pnc2000.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/pnc2000.c 2004-04-03 22:37:06.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/pnc2000.c 2005-02-01 17:11:17.000000000 -0500 @@ -5,7 +5,7 @@ * * This code is GPL @@ -19493,10 +17256,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/pnc2000.c }; -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/redwood.c +Index: linux-2.6.5/drivers/mtd/maps/redwood.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/redwood.c 2004-04-03 22:37:37.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/redwood.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/redwood.c 2004-04-03 22:37:37.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/redwood.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,14 +1,13 @@ /* - * $Id: redwood.c,v 1.6 2003/05/21 12:45:19 dwmw2 Exp $ @@ -19558,10 +17321,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/redwood.c -MODULE_AUTHOR("Armin Kuster "); +MODULE_AUTHOR("MontaVista Software "); MODULE_DESCRIPTION("MTD map driver for the IBM Redwood reference boards"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/rpxlite.c +Index: linux-2.6.5/drivers/mtd/maps/rpxlite.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/rpxlite.c 2004-04-03 22:38:23.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/rpxlite.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/rpxlite.c 2004-04-03 22:38:23.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/rpxlite.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: rpxlite.c,v 1.19 2003/05/21 12:45:19 dwmw2 Exp $ @@ -19586,10 +17349,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/rpxlite.c if (!rpxlite_map.virt) { printk("Failed to ioremap\n"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/sa1100-flash.c +Index: linux-2.6.5/drivers/mtd/maps/sa1100-flash.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/sa1100-flash.c 2004-04-03 22:36:51.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/sa1100-flash.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/sa1100-flash.c 2004-04-03 22:36:51.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/sa1100-flash.c 2005-02-01 17:11:17.000000000 -0500 @@ -3,7 +3,7 @@ * * (C) 2000 Nicolas Pitre @@ -19702,10 +17465,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/sa1100-fla * We currently only implement CS0 and CS1 here. */ for (i = 0; i < nr; i++) { -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/sbc8240.c +Index: linux-2.6.5/drivers/mtd/maps/sbc8240.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/sbc8240.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/sbc8240.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/sbc8240.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/sbc8240.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,247 @@ +/* + * Handle mapping of the flash memory access routines on the SBC8240 board. @@ -19954,10 +17717,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/sbc8240.c +MODULE_AUTHOR ("Carolyn Smith "); +MODULE_DESCRIPTION ("MTD map driver for SBC8240 boards"); + -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/sbc_gxx.c +Index: linux-2.6.5/drivers/mtd/maps/sbc_gxx.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/sbc_gxx.c 2004-04-03 22:37:23.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/sbc_gxx.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/sbc_gxx.c 2004-04-03 22:37:23.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/sbc_gxx.c 2005-02-01 17:11:17.000000000 -0500 @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA @@ -20069,10 +17832,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/sbc_gxx.c if (!iomapadr) { printk( KERN_ERR"%s: failed to ioremap memory region\n", sbc_gxx_map.name ); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/sc520cdp.c +Index: linux-2.6.5/drivers/mtd/maps/sc520cdp.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/sc520cdp.c 2004-04-03 22:38:17.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/sc520cdp.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/sc520cdp.c 2004-04-03 22:38:17.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/sc520cdp.c 2005-02-01 17:11:17.000000000 -0500 @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA @@ -20114,10 +17877,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/sc520cdp.c if (!sc520cdp_map[i].virt) { printk("Failed to ioremap_nocache\n"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/scb2_flash.c +Index: linux-2.6.5/drivers/mtd/maps/scb2_flash.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/scb2_flash.c 2004-04-03 22:37:23.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/scb2_flash.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/scb2_flash.c 2004-04-03 22:37:23.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/scb2_flash.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,6 +1,6 @@ /* * MTD map driver for BIOS Flash on Intel SCB2 boards @@ -20144,10 +17907,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/scb2_flash scb2_map.size = SCB2_WINDOW; simple_map_init(&scb2_map); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/scx200_docflash.c +Index: linux-2.6.5/drivers/mtd/maps/scx200_docflash.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/scx200_docflash.c 2004-04-03 22:37:37.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/scx200_docflash.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/scx200_docflash.c 2004-04-03 22:37:37.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/scx200_docflash.c 2005-02-01 17:11:17.000000000 -0500 @@ -2,7 +2,7 @@ Copyright (c) 2001,2002 Christer Weinigel @@ -20175,10 +17938,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/scx200_doc if (!scx200_docflash_map.virt) { printk(KERN_ERR NAME ": failed to ioremap the flash\n"); release_resource(&docmem); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/solutionengine.c +Index: linux-2.6.5/drivers/mtd/maps/solutionengine.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/solutionengine.c 2004-04-03 22:38:18.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/solutionengine.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/solutionengine.c 2004-04-03 22:38:18.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/solutionengine.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: solutionengine.c,v 1.10 2003/05/21 12:45:20 dwmw2 Exp $ @@ -20223,10 +17986,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/solutionen simple_map_init(&soleng_eprom_map); simple_map_init(&soleng_flash_map); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/sun_uflash.c +Index: linux-2.6.5/drivers/mtd/maps/sun_uflash.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/sun_uflash.c 2004-04-03 22:37:36.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/sun_uflash.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/sun_uflash.c 2004-04-03 22:37:36.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/sun_uflash.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,4 +1,4 @@ -/* $Id: sun_uflash.c,v 1.7 2003/05/20 20:59:32 dwmw2 Exp $ +/* $Id: sun_uflash.c,v 1.10 2004/09/16 23:27:14 gleixner Exp $ @@ -20251,10 +18014,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/sun_uflash if(0 == pdev->map.virt) { printk("%s: failed to map device\n", __FUNCTION__); kfree(pdev->name); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/tqm8xxl.c +Index: linux-2.6.5/drivers/mtd/maps/tqm8xxl.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/tqm8xxl.c 2004-04-03 22:36:26.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/tqm8xxl.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/tqm8xxl.c 2004-04-03 22:36:26.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/tqm8xxl.c 2005-02-01 17:11:17.000000000 -0500 @@ -2,7 +2,7 @@ * Handle mapping of the flash memory access routines * on TQM8xxL based devices. @@ -20287,10 +18050,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/tqm8xxl.c map_banks[idx]->phys = flash_addr; /* FIXME: This looks utterly bogus, but I'm trying to preserve the behaviour of the original (shown here)... -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/tsunami_flash.c +Index: linux-2.6.5/drivers/mtd/maps/tsunami_flash.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/tsunami_flash.c 2004-04-03 22:38:16.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/tsunami_flash.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/tsunami_flash.c 2004-04-03 22:38:16.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/tsunami_flash.c 2005-02-01 17:11:17.000000000 -0500 @@ -2,7 +2,7 @@ * tsunami_flash.c * @@ -20344,10 +18107,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/tsunami_fl char **type; tsunami_tig_writeb(FLASH_ENABLE_BYTE, FLASH_ENABLE_PORT); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/uclinux.c +Index: linux-2.6.5/drivers/mtd/maps/uclinux.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/uclinux.c 2004-04-03 22:38:16.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/uclinux.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/uclinux.c 2004-04-03 22:38:16.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/uclinux.c 2005-02-01 17:11:17.000000000 -0500 @@ -5,7 +5,7 @@ * * (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com) @@ -20380,10 +18143,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/uclinux.c ioremap_nocache(mapp->phys, mapp->size); if (mapp->virt == 0) { -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/vmax301.c +Index: linux-2.6.5/drivers/mtd/maps/vmax301.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/vmax301.c 2004-04-03 22:36:54.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/vmax301.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/vmax301.c 2004-04-03 22:36:54.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/vmax301.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,4 +1,4 @@ -// $Id: vmax301.c,v 1.28 2003/05/21 15:15:08 dwmw2 Exp $ +// $Id: vmax301.c,v 1.30 2004/07/12 22:38:29 dwmw2 Exp $ @@ -20492,10 +18255,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/vmax301.c .copy_to = vmax301_copy_to, .map_priv_1 = WINDOW_START + (3*WINDOW_LENGTH), .map_priv_2 = 0xFFFFFFFF -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/wr_sbc82xx_flash.c +Index: linux-2.6.5/drivers/mtd/maps/wr_sbc82xx_flash.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/maps/wr_sbc82xx_flash.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/wr_sbc82xx_flash.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/maps/wr_sbc82xx_flash.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/maps/wr_sbc82xx_flash.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,181 @@ +/* + * $Id: wr_sbc82xx_flash.c,v 1.6 2004/09/16 23:27:14 gleixner Exp $ @@ -20678,10 +18441,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/maps/wr_sbc82xx +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("David Woodhouse "); +MODULE_DESCRIPTION("Flash map driver for WindRiver PowerQUICC II"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtd_blkdevs-24.c +Index: linux-2.6.5/drivers/mtd/mtd_blkdevs-24.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/mtd_blkdevs-24.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtd_blkdevs-24.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/mtd_blkdevs-24.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/mtd_blkdevs-24.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,692 @@ +/* + * $Id: mtd_blkdevs-24.c,v 1.16 2004/08/11 15:29:24 dmarlin Exp $ @@ -21375,10 +19138,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtd_blkdevs-24. +MODULE_AUTHOR("David Woodhouse "); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Common interface to block layer for MTD 'translation layers'"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtd_blkdevs.c +Index: linux-2.6.5/drivers/mtd/mtd_blkdevs.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/mtd_blkdevs.c 2004-04-03 22:36:14.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtd_blkdevs.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/mtd_blkdevs.c 2004-04-03 22:36:14.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/mtd_blkdevs.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: mtd_blkdevs.c,v 1.16 2003/06/23 13:34:43 dwmw2 Exp $ @@ -21407,10 +19170,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtd_blkdevs.c gd->private_data = new; new->blkcore_priv = gd; gd->queue = tr->blkcore_priv->rq; -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtdblock.c +Index: linux-2.6.5/drivers/mtd/mtdblock.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/mtdblock.c 2004-04-03 22:36:56.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtdblock.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/mtdblock.c 2004-04-03 22:36:56.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/mtdblock.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,7 +1,7 @@ /* * Direct MTD block device access @@ -21429,10 +19192,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtdblock.c return -ENOMEM; memset(mtdblk, 0, sizeof(*mtdblk)); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtdchar.c +Index: linux-2.6.5/drivers/mtd/mtdchar.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/mtdchar.c 2004-11-11 10:28:27.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtdchar.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/mtdchar.c 2005-02-01 16:55:50.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/mtdchar.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: mtdchar.c,v 1.54 2003/05/21 10:50:43 dwmw2 Exp $ @@ -21922,10 +19685,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtdchar.c unregister_chrdev(MTD_CHAR_MAJOR, "mtd"); } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtdconcat.c +Index: linux-2.6.5/drivers/mtd/mtdconcat.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/mtdconcat.c 2004-04-03 22:37:37.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtdconcat.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/mtdconcat.c 2004-04-03 22:37:37.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/mtdconcat.c 2005-02-01 17:11:17.000000000 -0500 @@ -7,7 +7,7 @@ * * This code is GPL @@ -23155,10 +20918,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtdconcat.c MODULE_LICENSE("GPL"); MODULE_AUTHOR("Robert Kaiser "); MODULE_DESCRIPTION("Generic support for concatenating of MTD devices"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtdcore.c +Index: linux-2.6.5/drivers/mtd/mtdcore.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/mtdcore.c 2004-11-11 10:28:27.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtdcore.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/mtdcore.c 2005-02-01 16:55:50.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/mtdcore.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,12 +1,11 @@ /* - * $Id: mtdcore.c,v 1.39 2003/05/21 15:15:03 dwmw2 Exp $ @@ -23288,10 +21051,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtdcore.c #endif } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtdpart.c +Index: linux-2.6.5/drivers/mtd/mtdpart.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/mtdpart.c 2004-04-03 22:37:38.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtdpart.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/mtdpart.c 2004-04-03 22:37:38.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/mtdpart.c 2005-02-01 17:11:17.000000000 -0500 @@ -5,7 +5,7 @@ * * This code is GPL @@ -23425,10 +21188,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/mtdpart.c if(parts[i].mtdp) { /* store the object pointer (caller may or may not register it */ *parts[i].mtdp = &slave->mtd; -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/Kconfig +Index: linux-2.6.5/drivers/mtd/nand/Kconfig =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/nand/Kconfig 2004-04-03 22:37:41.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/Kconfig 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/nand/Kconfig 2004-04-03 22:37:41.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/nand/Kconfig 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ # drivers/mtd/nand/Kconfig -# $Id: Kconfig,v 1.4 2003/05/28 10:04:23 dwmw2 Exp $ @@ -23579,10 +21342,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/Kconfig + load time (assuming you build diskonchip as a module) with the module + parameter "inftl_bbt_write=1". +endmenu -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/Makefile +Index: linux-2.6.5/drivers/mtd/nand/Makefile =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/nand/Makefile 2004-04-03 22:36:14.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/Makefile 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/nand/Makefile 2004-04-03 22:36:14.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/nand/Makefile 2005-02-01 17:11:17.000000000 -0500 @@ -1,10 +1,21 @@ # # linux/drivers/nand/Makefile @@ -23611,10 +21374,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/Makefile +obj-$(CONFIG_MTD_NAND_FROM4) += rtc_from4.o + +nand-objs = nand_base.o nand_bbt.o -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/au1550nd.c +Index: linux-2.6.5/drivers/mtd/nand/au1550nd.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/nand/au1550nd.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/au1550nd.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/nand/au1550nd.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/nand/au1550nd.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,481 @@ +/* + * drivers/mtd/nand/au1550nd.c @@ -24097,10 +21860,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/au1550nd.c +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Embedded Edge, LLC"); +MODULE_DESCRIPTION("Board-specific glue layer for NAND flash on Pb1550 board"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/autcpu12.c +Index: linux-2.6.5/drivers/mtd/nand/autcpu12.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/nand/autcpu12.c 2004-04-03 22:36:25.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/autcpu12.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/nand/autcpu12.c 2004-04-03 22:36:25.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/nand/autcpu12.c 2005-02-01 17:11:17.000000000 -0500 @@ -6,7 +6,7 @@ * Derived from drivers/mtd/spia.c * Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com) @@ -24308,10 +22071,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/autcpu12.c /* Free the MTD device structure */ kfree (autcpu12_mtd); } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/diskonchip.c +Index: linux-2.6.5/drivers/mtd/nand/diskonchip.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/nand/diskonchip.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/diskonchip.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/nand/diskonchip.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/nand/diskonchip.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,1637 @@ +/* + * drivers/mtd/nand/diskonchip.c @@ -25950,10 +23713,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/diskonchip +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("David Woodhouse "); +MODULE_DESCRIPTION("M-Systems DiskOnChip 2000, Millennium and Millennium Plus device driver\n"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/edb7312.c +Index: linux-2.6.5/drivers/mtd/nand/edb7312.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/nand/edb7312.c 2004-04-03 22:38:22.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/edb7312.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/nand/edb7312.c 2004-04-03 22:38:22.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/nand/edb7312.c 2005-02-01 17:11:17.000000000 -0500 @@ -6,7 +6,7 @@ * Derived from drivers/mtd/nand/autcpu12.c * Copyright (c) 2001 Thomas Gleixner (gleixner@autronix.de) @@ -26081,10 +23844,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/edb7312.c /* Free internal data buffer */ kfree (this->data_buf); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/h1910.c +Index: linux-2.6.5/drivers/mtd/nand/h1910.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/nand/h1910.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/h1910.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/nand/h1910.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/nand/h1910.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,208 @@ +/* + * drivers/mtd/nand/h1910.c @@ -26294,10 +24057,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/h1910.c +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Joshua Wise "); +MODULE_DESCRIPTION("NAND flash driver for iPAQ h1910"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/nand_base.c +Index: linux-2.6.5/drivers/mtd/nand/nand_base.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/nand/nand_base.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/nand_base.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/nand/nand_base.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/nand/nand_base.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,2581 @@ +/* + * drivers/mtd/nand.c @@ -28880,10 +26643,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/nand_base. +MODULE_LICENSE ("GPL"); +MODULE_AUTHOR ("Steven J. Hill , Thomas Gleixner "); +MODULE_DESCRIPTION ("Generic NAND flash driver code"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/nand_bbt.c +Index: linux-2.6.5/drivers/mtd/nand/nand_bbt.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/nand/nand_bbt.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/nand_bbt.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/nand/nand_bbt.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/nand/nand_bbt.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,1053 @@ +/* + * drivers/mtd/nand_bbt.c @@ -29938,10 +27701,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/nand_bbt.c + +EXPORT_SYMBOL (nand_scan_bbt); +EXPORT_SYMBOL (nand_default_bbt); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/nand_ecc.c +Index: linux-2.6.5/drivers/mtd/nand/nand_ecc.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/nand/nand_ecc.c 2004-04-03 22:36:54.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/nand_ecc.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/nand/nand_ecc.c 2004-04-03 22:36:54.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/nand/nand_ecc.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,22 +1,44 @@ /* - * drivers/mtd/nand_ecc.c @@ -30049,10 +27812,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/nand_ecc.c { u_char a, b, c, d1, d2, d3, add, bit, i; -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/nand_ids.c +Index: linux-2.6.5/drivers/mtd/nand/nand_ids.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/nand/nand_ids.c 2004-04-03 22:36:56.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/nand_ids.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/nand/nand_ids.c 2004-04-03 22:36:56.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/nand/nand_ids.c 2005-02-01 17:11:17.000000000 -0500 @@ -2,9 +2,8 @@ * drivers/mtd/nandids.c * @@ -30194,10 +27957,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/nand_ids.c EXPORT_SYMBOL (nand_manuf_ids); EXPORT_SYMBOL (nand_flash_ids); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/ppchameleonevb.c +Index: linux-2.6.5/drivers/mtd/nand/ppchameleonevb.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/nand/ppchameleonevb.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/ppchameleonevb.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/nand/ppchameleonevb.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/nand/ppchameleonevb.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,419 @@ +/* + * drivers/mtd/nand/ppchameleonevb.c @@ -30618,10 +28381,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/ppchameleo +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("DAVE Srl "); +MODULE_DESCRIPTION("MTD map driver for DAVE Srl PPChameleonEVB board"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/rtc_from4.c +Index: linux-2.6.5/drivers/mtd/nand/rtc_from4.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/nand/rtc_from4.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/rtc_from4.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/nand/rtc_from4.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/nand/rtc_from4.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,500 @@ +/* + * drivers/mtd/nand/rtc_from4.c @@ -31123,10 +28886,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/rtc_from4. +MODULE_AUTHOR("d.marlin "); +MODULE_DESCRIPTION("Glue layer for NAND flash on toto board"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/tx4925ndfmc.c +Index: linux-2.6.5/drivers/mtd/nand/tx4925ndfmc.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/nand/tx4925ndfmc.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/tx4925ndfmc.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/nand/tx4925ndfmc.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/nand/tx4925ndfmc.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,416 @@ +/* + * drivers/mtd/tx4925ndfmc.c @@ -31872,10 +29635,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/tx4925ndfm +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Alice Hennessy "); +MODULE_DESCRIPTION("Glue layer for SmartMediaCard on Toshiba RBTX4925"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/tx4938ndfmc.c +Index: linux-2.6.5/drivers/mtd/nand/tx4938ndfmc.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/nand/tx4938ndfmc.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/tx4938ndfmc.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/nand/tx4938ndfmc.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/nand/tx4938ndfmc.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,406 @@ +/* + * drivers/mtd/nand/tx4938ndfmc.c @@ -32164,1673 +29927,433 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nand/tx4938ndfm + } + } + -+ /* wait until command is processed */ -+ while (!this->dev_ready(mtd)); -+} -+ -+#ifdef CONFIG_MTD_CMDLINE_PARTS -+extern int parse_cmdline_partitions(struct mtd_info *master, struct mtd_partition **pparts, char *); -+#endif -+/* -+ * Main initialization routine -+ */ -+int __init tx4938ndfmc_init (void) -+{ -+ struct nand_chip *this; -+ int bsprt = 0, hold = 0xf, spw = 0xf; -+ int protected = 0; -+ -+ if ((*rbtx4938_piosel_ptr & 0x0c) != 0x08) { -+ printk("TX4938 NDFMC: disabled by IOC PIOSEL\n"); -+ return -ENODEV; -+ } -+ bsprt = 1; -+ hold = 2; -+ spw = 9 - 1; /* 8 GBUSCLK = 80ns (@ GBUSCLK 100MHz) */ -+ -+ if ((tx4938_ccfgptr->pcfg & -+ (TX4938_PCFG_ATA_SEL|TX4938_PCFG_ISA_SEL|TX4938_PCFG_NDF_SEL)) -+ != TX4938_PCFG_NDF_SEL) { -+ printk("TX4938 NDFMC: disabled by PCFG.\n"); -+ return -ENODEV; -+ } -+ -+ /* reset NDFMC */ -+ tx4938_ndfmcptr->rstr |= TX4938_NDFRSTR_RST; -+ while (tx4938_ndfmcptr->rstr & TX4938_NDFRSTR_RST) -+ ; -+ /* setup BusSeparete, Hold Time, Strobe Pulse Width */ -+ tx4938_ndfmcptr->mcr = bsprt ? TX4938_NDFMCR_BSPRT : 0; -+ tx4938_ndfmcptr->spr = hold << 4 | spw; -+ -+ /* Allocate memory for MTD device structure and private data */ -+ tx4938ndfmc_mtd = (struct mtd_info *) kmalloc (sizeof(struct mtd_info) + sizeof (struct nand_chip), -+ GFP_KERNEL); -+ if (!tx4938ndfmc_mtd) { -+ printk ("Unable to allocate TX4938 NDFMC MTD device structure.\n"); -+ return -ENOMEM; -+ } -+ -+ /* Get pointer to private data */ -+ this = (struct nand_chip *) (&tx4938ndfmc_mtd[1]); -+ -+ /* Initialize structures */ -+ memset((char *) tx4938ndfmc_mtd, 0, sizeof(struct mtd_info)); -+ memset((char *) this, 0, sizeof(struct nand_chip)); -+ -+ /* Link the private data with the MTD structure */ -+ tx4938ndfmc_mtd->priv = this; -+ -+ /* Set address of NAND IO lines */ -+ this->IO_ADDR_R = (unsigned long)&tx4938_ndfmcptr->dtr; -+ this->IO_ADDR_W = (unsigned long)&tx4938_ndfmcptr->dtr; -+ this->hwcontrol = tx4938ndfmc_hwcontrol; -+ this->dev_ready = tx4938ndfmc_dev_ready; -+ this->calculate_ecc = tx4938ndfmc_calculate_ecc; -+ this->correct_data = nand_correct_data; -+ this->enable_hwecc = tx4938ndfmc_enable_hwecc; -+ this->eccmode = NAND_ECC_HW3_256; -+ this->chip_delay = 100; -+ this->read_byte = tx4938ndfmc_nand_read_byte; -+ this->write_byte = tx4938ndfmc_nand_write_byte; -+ this->cmdfunc = tx4938ndfmc_nand_command; -+ this->write_buf = tx4938ndfmc_nand_write_buf; -+ this->read_buf = tx4938ndfmc_nand_read_buf; -+ this->verify_buf = tx4938ndfmc_nand_verify_buf; -+ -+ /* Scan to find existance of the device */ -+ if (nand_scan (tx4938ndfmc_mtd, 1)) { -+ kfree (tx4938ndfmc_mtd); -+ return -ENXIO; -+ } -+ -+ if (protected) { -+ printk(KERN_INFO "TX4938 NDFMC: write protected.\n"); -+ tx4938ndfmc_mtd->flags &= ~(MTD_WRITEABLE | MTD_ERASEABLE); -+ } -+ -+#ifdef CONFIG_MTD_CMDLINE_PARTS -+ { -+ int mtd_parts_nb = 0; -+ struct mtd_partition *mtd_parts = 0; -+ mtd_parts_nb = parse_cmdline_partitions(tx4938ndfmc_mtd, &mtd_parts, "tx4938ndfmc"); -+ if (mtd_parts_nb > 0) -+ add_mtd_partitions(tx4938ndfmc_mtd, mtd_parts, mtd_parts_nb); -+ else -+ add_mtd_device(tx4938ndfmc_mtd); -+ } -+#else -+ add_mtd_partitions(tx4938ndfmc_mtd, partition_info, NUM_PARTITIONS ); -+#endif -+ -+ return 0; -+} -+module_init(tx4938ndfmc_init); -+ -+/* -+ * Clean up routine -+ */ -+static void __exit tx4938ndfmc_cleanup (void) -+{ -+ /* Release resources, unregister device */ -+ nand_release (tx4938ndfmc_mtd); -+ -+ /* Free the MTD device structure */ -+ kfree (tx4938ndfmc_mtd); -+} -+module_exit(tx4938ndfmc_cleanup); -+ -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("Alice Hennessy "); -+MODULE_DESCRIPTION("Board-specific glue layer for NAND flash on TX4938 NDFMC"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nftlcore.c -=================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/nftlcore.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nftlcore.c 2004-11-18 18:39:09.000000000 -0500 -@@ -0,0 +1,767 @@ -+/* Linux driver for NAND Flash Translation Layer */ -+/* (c) 1999 Machine Vision Holdings, Inc. */ -+/* Author: David Woodhouse */ -+/* $Id: nftlcore.c,v 1.96 2004/06/28 13:52:55 dbrown Exp $ */ -+ -+/* -+ The contents of this file are distributed under the GNU General -+ Public License version 2. The author places no additional -+ restrictions of any kind on it. -+ */ -+ -+#define PRERELEASE -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+ -+/* maximum number of loops while examining next block, to have a -+ chance to detect consistency problems (they should never happen -+ because of the checks done in the mounting */ -+ -+#define MAX_LOOPS 10000 -+ -+ -+static void nftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) -+{ -+ struct NFTLrecord *nftl; -+ unsigned long temp; -+ -+ if (mtd->type != MTD_NANDFLASH) -+ return; -+ /* OK, this is moderately ugly. But probably safe. Alternatives? */ -+ if (memcmp(mtd->name, "DiskOnChip", 10)) -+ return; -+ -+ if (!mtd->block_isbad) { -+ printk(KERN_ERR -+"NFTL no longer supports the old DiskOnChip drivers loaded via docprobe.\n" -+"Please use the new diskonchip driver under the NAND subsystem.\n"); -+ return; -+ } -+ -+ DEBUG(MTD_DEBUG_LEVEL1, "NFTL: add_mtd for %s\n", mtd->name); -+ -+ nftl = kmalloc(sizeof(struct NFTLrecord), GFP_KERNEL); -+ -+ if (!nftl) { -+ printk(KERN_WARNING "NFTL: out of memory for data structures\n"); -+ return; -+ } -+ memset(nftl, 0, sizeof(*nftl)); -+ -+ nftl->mbd.mtd = mtd; -+ nftl->mbd.devnum = -1; -+ nftl->mbd.blksize = 512; -+ nftl->mbd.tr = tr; -+ memcpy(&nftl->oobinfo, &mtd->oobinfo, sizeof(struct nand_oobinfo)); -+ nftl->oobinfo.useecc = MTD_NANDECC_PLACEONLY; -+ -+ if (NFTL_mount(nftl) < 0) { -+ printk(KERN_WARNING "NFTL: could not mount device\n"); -+ kfree(nftl); -+ return; -+ } -+ -+ /* OK, it's a new one. Set up all the data structures. */ -+ -+ /* Calculate geometry */ -+ nftl->cylinders = 1024; -+ nftl->heads = 16; -+ -+ temp = nftl->cylinders * nftl->heads; -+ nftl->sectors = nftl->mbd.size / temp; -+ if (nftl->mbd.size % temp) { -+ nftl->sectors++; -+ temp = nftl->cylinders * nftl->sectors; -+ nftl->heads = nftl->mbd.size / temp; -+ -+ if (nftl->mbd.size % temp) { -+ nftl->heads++; -+ temp = nftl->heads * nftl->sectors; -+ nftl->cylinders = nftl->mbd.size / temp; -+ } -+ } -+ -+ if (nftl->mbd.size != nftl->heads * nftl->cylinders * nftl->sectors) { -+ /* -+ Oh no we don't have -+ mbd.size == heads * cylinders * sectors -+ */ -+ printk(KERN_WARNING "NFTL: cannot calculate a geometry to " -+ "match size of 0x%lx.\n", nftl->mbd.size); -+ printk(KERN_WARNING "NFTL: using C:%d H:%d S:%d " -+ "(== 0x%lx sects)\n", -+ nftl->cylinders, nftl->heads , nftl->sectors, -+ (long)nftl->cylinders * (long)nftl->heads * -+ (long)nftl->sectors ); -+ } -+ -+ if (add_mtd_blktrans_dev(&nftl->mbd)) { -+ if (nftl->ReplUnitTable) -+ kfree(nftl->ReplUnitTable); -+ if (nftl->EUNtable) -+ kfree(nftl->EUNtable); -+ kfree(nftl); -+ return; -+ } -+#ifdef PSYCHO_DEBUG -+ printk(KERN_INFO "NFTL: Found new nftl%c\n", nftl->mbd.devnum + 'a'); -+#endif -+} -+ -+static void nftl_remove_dev(struct mtd_blktrans_dev *dev) -+{ -+ struct NFTLrecord *nftl = (void *)dev; -+ -+ DEBUG(MTD_DEBUG_LEVEL1, "NFTL: remove_dev (i=%d)\n", dev->devnum); -+ -+ del_mtd_blktrans_dev(dev); -+ if (nftl->ReplUnitTable) -+ kfree(nftl->ReplUnitTable); -+ if (nftl->EUNtable) -+ kfree(nftl->EUNtable); -+ kfree(nftl); -+} -+ -+#ifdef CONFIG_NFTL_RW -+ -+/* Actual NFTL access routines */ -+/* NFTL_findfreeblock: Find a free Erase Unit on the NFTL partition. This function is used -+ * when the give Virtual Unit Chain -+ */ -+static u16 NFTL_findfreeblock(struct NFTLrecord *nftl, int desperate ) -+{ -+ /* For a given Virtual Unit Chain: find or create a free block and -+ add it to the chain */ -+ /* We're passed the number of the last EUN in the chain, to save us from -+ having to look it up again */ -+ u16 pot = nftl->LastFreeEUN; -+ int silly = nftl->nb_blocks; -+ -+ /* Normally, we force a fold to happen before we run out of free blocks completely */ -+ if (!desperate && nftl->numfreeEUNs < 2) { -+ DEBUG(MTD_DEBUG_LEVEL1, "NFTL_findfreeblock: there are too few free EUNs\n"); -+ return 0xffff; -+ } -+ -+ /* Scan for a free block */ -+ do { -+ if (nftl->ReplUnitTable[pot] == BLOCK_FREE) { -+ nftl->LastFreeEUN = pot; -+ nftl->numfreeEUNs--; -+ return pot; -+ } -+ -+ /* This will probably point to the MediaHdr unit itself, -+ right at the beginning of the partition. But that unit -+ (and the backup unit too) should have the UCI set -+ up so that it's not selected for overwriting */ -+ if (++pot > nftl->lastEUN) -+ pot = le16_to_cpu(nftl->MediaHdr.FirstPhysicalEUN); -+ -+ if (!silly--) { -+ printk("Argh! No free blocks found! LastFreeEUN = %d, " -+ "FirstEUN = %d\n", nftl->LastFreeEUN, -+ le16_to_cpu(nftl->MediaHdr.FirstPhysicalEUN)); -+ return 0xffff; -+ } -+ } while (pot != nftl->LastFreeEUN); -+ -+ return 0xffff; -+} -+ -+static u16 NFTL_foldchain (struct NFTLrecord *nftl, unsigned thisVUC, unsigned pendingblock ) -+{ -+ u16 BlockMap[MAX_SECTORS_PER_UNIT]; -+ unsigned char BlockLastState[MAX_SECTORS_PER_UNIT]; -+ unsigned char BlockFreeFound[MAX_SECTORS_PER_UNIT]; -+ unsigned int thisEUN; -+ int block; -+ int silly; -+ unsigned int targetEUN; -+ struct nftl_oob oob; -+ int inplace = 1; -+ size_t retlen; -+ -+ memset(BlockMap, 0xff, sizeof(BlockMap)); -+ memset(BlockFreeFound, 0, sizeof(BlockFreeFound)); -+ -+ thisEUN = nftl->EUNtable[thisVUC]; -+ -+ if (thisEUN == BLOCK_NIL) { -+ printk(KERN_WARNING "Trying to fold non-existent " -+ "Virtual Unit Chain %d!\n", thisVUC); -+ return BLOCK_NIL; -+ } -+ -+ /* Scan to find the Erase Unit which holds the actual data for each -+ 512-byte block within the Chain. -+ */ -+ silly = MAX_LOOPS; -+ targetEUN = BLOCK_NIL; -+ while (thisEUN <= nftl->lastEUN ) { -+ unsigned int status, foldmark; -+ -+ targetEUN = thisEUN; -+ for (block = 0; block < nftl->EraseSize / 512; block ++) { -+ MTD_READOOB(nftl->mbd.mtd, -+ (thisEUN * nftl->EraseSize) + (block * 512), -+ 16 , &retlen, (char *)&oob); -+ if (block == 2) { -+ foldmark = oob.u.c.FoldMark | oob.u.c.FoldMark1; -+ if (foldmark == FOLD_MARK_IN_PROGRESS) { -+ DEBUG(MTD_DEBUG_LEVEL1, -+ "Write Inhibited on EUN %d\n", thisEUN); -+ inplace = 0; -+ } else { -+ /* There's no other reason not to do inplace, -+ except ones that come later. So we don't need -+ to preserve inplace */ -+ inplace = 1; -+ } -+ } -+ status = oob.b.Status | oob.b.Status1; -+ BlockLastState[block] = status; -+ -+ switch(status) { -+ case SECTOR_FREE: -+ BlockFreeFound[block] = 1; -+ break; -+ -+ case SECTOR_USED: -+ if (!BlockFreeFound[block]) -+ BlockMap[block] = thisEUN; -+ else -+ printk(KERN_WARNING -+ "SECTOR_USED found after SECTOR_FREE " -+ "in Virtual Unit Chain %d for block %d\n", -+ thisVUC, block); -+ break; -+ case SECTOR_DELETED: -+ if (!BlockFreeFound[block]) -+ BlockMap[block] = BLOCK_NIL; -+ else -+ printk(KERN_WARNING -+ "SECTOR_DELETED found after SECTOR_FREE " -+ "in Virtual Unit Chain %d for block %d\n", -+ thisVUC, block); -+ break; -+ -+ case SECTOR_IGNORE: -+ break; -+ default: -+ printk("Unknown status for block %d in EUN %d: %x\n", -+ block, thisEUN, status); -+ } -+ } -+ -+ if (!silly--) { -+ printk(KERN_WARNING "Infinite loop in Virtual Unit Chain 0x%x\n", -+ thisVUC); -+ return BLOCK_NIL; -+ } -+ -+ thisEUN = nftl->ReplUnitTable[thisEUN]; -+ } -+ -+ if (inplace) { -+ /* We're being asked to be a fold-in-place. Check -+ that all blocks which actually have data associated -+ with them (i.e. BlockMap[block] != BLOCK_NIL) are -+ either already present or SECTOR_FREE in the target -+ block. If not, we're going to have to fold out-of-place -+ anyway. -+ */ -+ for (block = 0; block < nftl->EraseSize / 512 ; block++) { -+ if (BlockLastState[block] != SECTOR_FREE && -+ BlockMap[block] != BLOCK_NIL && -+ BlockMap[block] != targetEUN) { -+ DEBUG(MTD_DEBUG_LEVEL1, "Setting inplace to 0. VUC %d, " -+ "block %d was %x lastEUN, " -+ "and is in EUN %d (%s) %d\n", -+ thisVUC, block, BlockLastState[block], -+ BlockMap[block], -+ BlockMap[block]== targetEUN ? "==" : "!=", -+ targetEUN); -+ inplace = 0; -+ break; -+ } -+ } -+ -+ if (pendingblock >= (thisVUC * (nftl->EraseSize / 512)) && -+ pendingblock < ((thisVUC + 1)* (nftl->EraseSize / 512)) && -+ BlockLastState[pendingblock - (thisVUC * (nftl->EraseSize / 512))] != -+ SECTOR_FREE) { -+ DEBUG(MTD_DEBUG_LEVEL1, "Pending write not free in EUN %d. " -+ "Folding out of place.\n", targetEUN); -+ inplace = 0; -+ } -+ } -+ -+ if (!inplace) { -+ DEBUG(MTD_DEBUG_LEVEL1, "Cannot fold Virtual Unit Chain %d in place. " -+ "Trying out-of-place\n", thisVUC); -+ /* We need to find a targetEUN to fold into. */ -+ targetEUN = NFTL_findfreeblock(nftl, 1); -+ if (targetEUN == BLOCK_NIL) { -+ /* Ouch. Now we're screwed. We need to do a -+ fold-in-place of another chain to make room -+ for this one. We need a better way of selecting -+ which chain to fold, because makefreeblock will -+ only ask us to fold the same one again. -+ */ -+ printk(KERN_WARNING -+ "NFTL_findfreeblock(desperate) returns 0xffff.\n"); -+ return BLOCK_NIL; -+ } -+ } else { -+ /* We put a fold mark in the chain we are folding only if -+ we fold in place to help the mount check code. If we do -+ not fold in place, it is possible to find the valid -+ chain by selecting the longer one */ -+ oob.u.c.FoldMark = oob.u.c.FoldMark1 = cpu_to_le16(FOLD_MARK_IN_PROGRESS); -+ oob.u.c.unused = 0xffffffff; -+ MTD_WRITEOOB(nftl->mbd.mtd, (nftl->EraseSize * targetEUN) + 2 * 512 + 8, -+ 8, &retlen, (char *)&oob.u); -+ } -+ -+ /* OK. We now know the location of every block in the Virtual Unit Chain, -+ and the Erase Unit into which we are supposed to be copying. -+ Go for it. -+ */ -+ DEBUG(MTD_DEBUG_LEVEL1,"Folding chain %d into unit %d\n", thisVUC, targetEUN); -+ for (block = 0; block < nftl->EraseSize / 512 ; block++) { -+ unsigned char movebuf[512]; -+ int ret; -+ -+ /* If it's in the target EUN already, or if it's pending write, do nothing */ -+ if (BlockMap[block] == targetEUN || -+ (pendingblock == (thisVUC * (nftl->EraseSize / 512) + block))) { -+ continue; -+ } -+ -+ /* copy only in non free block (free blocks can only -+ happen in case of media errors or deleted blocks) */ -+ if (BlockMap[block] == BLOCK_NIL) -+ continue; -+ -+ ret = MTD_READ(nftl->mbd.mtd, (nftl->EraseSize * BlockMap[block]) + (block * 512), -+ 512, &retlen, movebuf); -+ if (ret < 0) { -+ ret = MTD_READ(nftl->mbd.mtd, (nftl->EraseSize * BlockMap[block]) -+ + (block * 512), 512, &retlen, -+ movebuf); -+ if (ret != -EIO) -+ printk("Error went away on retry.\n"); -+ } -+ memset(&oob, 0xff, sizeof(struct nftl_oob)); -+ oob.b.Status = oob.b.Status1 = SECTOR_USED; -+ MTD_WRITEECC(nftl->mbd.mtd, (nftl->EraseSize * targetEUN) + (block * 512), -+ 512, &retlen, movebuf, (char *)&oob, &nftl->oobinfo); -+ } -+ -+ /* add the header so that it is now a valid chain */ -+ oob.u.a.VirtUnitNum = oob.u.a.SpareVirtUnitNum -+ = cpu_to_le16(thisVUC); -+ oob.u.a.ReplUnitNum = oob.u.a.SpareReplUnitNum = 0xffff; -+ -+ MTD_WRITEOOB(nftl->mbd.mtd, (nftl->EraseSize * targetEUN) + 8, -+ 8, &retlen, (char *)&oob.u); -+ -+ /* OK. We've moved the whole lot into the new block. Now we have to free the original blocks. */ -+ -+ /* At this point, we have two different chains for this Virtual Unit, and no way to tell -+ them apart. If we crash now, we get confused. However, both contain the same data, so we -+ shouldn't actually lose data in this case. It's just that when we load up on a medium which -+ has duplicate chains, we need to free one of the chains because it's not necessary any more. -+ */ -+ thisEUN = nftl->EUNtable[thisVUC]; -+ DEBUG(MTD_DEBUG_LEVEL1,"Want to erase\n"); -+ -+ /* For each block in the old chain (except the targetEUN of course), -+ free it and make it available for future use */ -+ while (thisEUN <= nftl->lastEUN && thisEUN != targetEUN) { -+ unsigned int EUNtmp; -+ -+ EUNtmp = nftl->ReplUnitTable[thisEUN]; -+ -+ if (NFTL_formatblock(nftl, thisEUN) < 0) { -+ /* could not erase : mark block as reserved -+ */ -+ nftl->ReplUnitTable[thisEUN] = BLOCK_RESERVED; -+ } else { -+ /* correctly erased : mark it as free */ -+ nftl->ReplUnitTable[thisEUN] = BLOCK_FREE; -+ nftl->numfreeEUNs++; -+ } -+ thisEUN = EUNtmp; -+ } -+ -+ /* Make this the new start of chain for thisVUC */ -+ nftl->ReplUnitTable[targetEUN] = BLOCK_NIL; -+ nftl->EUNtable[thisVUC] = targetEUN; -+ -+ return targetEUN; ++ /* wait until command is processed */ ++ while (!this->dev_ready(mtd)); +} + -+u16 NFTL_makefreeblock( struct NFTLrecord *nftl , unsigned pendingblock) ++#ifdef CONFIG_MTD_CMDLINE_PARTS ++extern int parse_cmdline_partitions(struct mtd_info *master, struct mtd_partition **pparts, char *); ++#endif ++/* ++ * Main initialization routine ++ */ ++int __init tx4938ndfmc_init (void) +{ -+ /* This is the part that needs some cleverness applied. -+ For now, I'm doing the minimum applicable to actually -+ get the thing to work. -+ Wear-levelling and other clever stuff needs to be implemented -+ and we also need to do some assessment of the results when -+ the system loses power half-way through the routine. -+ */ -+ u16 LongestChain = 0; -+ u16 ChainLength = 0, thislen; -+ u16 chain, EUN; -+ -+ for (chain = 0; chain < le32_to_cpu(nftl->MediaHdr.FormattedSize) / nftl->EraseSize; chain++) { -+ EUN = nftl->EUNtable[chain]; -+ thislen = 0; -+ -+ while (EUN <= nftl->lastEUN) { -+ thislen++; -+ //printk("VUC %d reaches len %d with EUN %d\n", chain, thislen, EUN); -+ EUN = nftl->ReplUnitTable[EUN] & 0x7fff; -+ if (thislen > 0xff00) { -+ printk("Endless loop in Virtual Chain %d: Unit %x\n", -+ chain, EUN); -+ } -+ if (thislen > 0xff10) { -+ /* Actually, don't return failure. Just ignore this chain and -+ get on with it. */ -+ thislen = 0; -+ break; -+ } -+ } ++ struct nand_chip *this; ++ int bsprt = 0, hold = 0xf, spw = 0xf; ++ int protected = 0; + -+ if (thislen > ChainLength) { -+ //printk("New longest chain is %d with length %d\n", chain, thislen); -+ ChainLength = thislen; -+ LongestChain = chain; -+ } ++ if ((*rbtx4938_piosel_ptr & 0x0c) != 0x08) { ++ printk("TX4938 NDFMC: disabled by IOC PIOSEL\n"); ++ return -ENODEV; + } ++ bsprt = 1; ++ hold = 2; ++ spw = 9 - 1; /* 8 GBUSCLK = 80ns (@ GBUSCLK 100MHz) */ + -+ if (ChainLength < 2) { -+ printk(KERN_WARNING "No Virtual Unit Chains available for folding. " -+ "Failing request\n"); -+ return 0xffff; ++ if ((tx4938_ccfgptr->pcfg & ++ (TX4938_PCFG_ATA_SEL|TX4938_PCFG_ISA_SEL|TX4938_PCFG_NDF_SEL)) ++ != TX4938_PCFG_NDF_SEL) { ++ printk("TX4938 NDFMC: disabled by PCFG.\n"); ++ return -ENODEV; + } + -+ return NFTL_foldchain (nftl, LongestChain, pendingblock); -+} -+ -+/* NFTL_findwriteunit: Return the unit number into which we can write -+ for this block. Make it available if it isn't already -+*/ -+static inline u16 NFTL_findwriteunit(struct NFTLrecord *nftl, unsigned block) -+{ -+ u16 lastEUN; -+ u16 thisVUC = block / (nftl->EraseSize / 512); -+ unsigned int writeEUN; -+ unsigned long blockofs = (block * 512) & (nftl->EraseSize -1); -+ size_t retlen; -+ int silly, silly2 = 3; -+ struct nftl_oob oob; -+ -+ do { -+ /* Scan the media to find a unit in the VUC which has -+ a free space for the block in question. -+ */ -+ -+ /* This condition catches the 0x[7f]fff cases, as well as -+ being a sanity check for past-end-of-media access -+ */ -+ lastEUN = BLOCK_NIL; -+ writeEUN = nftl->EUNtable[thisVUC]; -+ silly = MAX_LOOPS; -+ while (writeEUN <= nftl->lastEUN) { -+ struct nftl_bci bci; -+ size_t retlen; -+ unsigned int status; -+ -+ lastEUN = writeEUN; -+ -+ MTD_READOOB(nftl->mbd.mtd, (writeEUN * nftl->EraseSize) + blockofs, -+ 8, &retlen, (char *)&bci); -+ -+ DEBUG(MTD_DEBUG_LEVEL2, "Status of block %d in EUN %d is %x\n", -+ block , writeEUN, le16_to_cpu(bci.Status)); -+ -+ status = bci.Status | bci.Status1; -+ switch(status) { -+ case SECTOR_FREE: -+ return writeEUN; -+ -+ case SECTOR_DELETED: -+ case SECTOR_USED: -+ case SECTOR_IGNORE: -+ break; -+ default: -+ // Invalid block. Don't use it any more. Must implement. -+ break; -+ } -+ -+ if (!silly--) { -+ printk(KERN_WARNING -+ "Infinite loop in Virtual Unit Chain 0x%x\n", -+ thisVUC); -+ return 0xffff; -+ } -+ -+ /* Skip to next block in chain */ -+ writeEUN = nftl->ReplUnitTable[writeEUN]; -+ } -+ -+ /* OK. We didn't find one in the existing chain, or there -+ is no existing chain. */ -+ -+ /* Try to find an already-free block */ -+ writeEUN = NFTL_findfreeblock(nftl, 0); -+ -+ if (writeEUN == BLOCK_NIL) { -+ /* That didn't work - there were no free blocks just -+ waiting to be picked up. We're going to have to fold -+ a chain to make room. -+ */ -+ -+ /* First remember the start of this chain */ -+ //u16 startEUN = nftl->EUNtable[thisVUC]; -+ -+ //printk("Write to VirtualUnitChain %d, calling makefreeblock()\n", thisVUC); -+ writeEUN = NFTL_makefreeblock(nftl, 0xffff); -+ -+ if (writeEUN == BLOCK_NIL) { -+ /* OK, we accept that the above comment is -+ lying - there may have been free blocks -+ last time we called NFTL_findfreeblock(), -+ but they are reserved for when we're -+ desperate. Well, now we're desperate. -+ */ -+ DEBUG(MTD_DEBUG_LEVEL1, "Using desperate==1 to find free EUN to accommodate write to VUC %d\n", thisVUC); -+ writeEUN = NFTL_findfreeblock(nftl, 1); -+ } -+ if (writeEUN == BLOCK_NIL) { -+ /* Ouch. This should never happen - we should -+ always be able to make some room somehow. -+ If we get here, we've allocated more storage -+ space than actual media, or our makefreeblock -+ routine is missing something. -+ */ -+ printk(KERN_WARNING "Cannot make free space.\n"); -+ return BLOCK_NIL; -+ } -+ //printk("Restarting scan\n"); -+ lastEUN = BLOCK_NIL; -+ continue; -+ } -+ -+ /* We've found a free block. Insert it into the chain. */ -+ -+ if (lastEUN != BLOCK_NIL) { -+ thisVUC |= 0x8000; /* It's a replacement block */ -+ } else { -+ /* The first block in a new chain */ -+ nftl->EUNtable[thisVUC] = writeEUN; -+ } -+ -+ /* set up the actual EUN we're writing into */ -+ /* Both in our cache... */ -+ nftl->ReplUnitTable[writeEUN] = BLOCK_NIL; ++ /* reset NDFMC */ ++ tx4938_ndfmcptr->rstr |= TX4938_NDFRSTR_RST; ++ while (tx4938_ndfmcptr->rstr & TX4938_NDFRSTR_RST) ++ ; ++ /* setup BusSeparete, Hold Time, Strobe Pulse Width */ ++ tx4938_ndfmcptr->mcr = bsprt ? TX4938_NDFMCR_BSPRT : 0; ++ tx4938_ndfmcptr->spr = hold << 4 | spw; + -+ /* ... and on the flash itself */ -+ MTD_READOOB(nftl->mbd.mtd, writeEUN * nftl->EraseSize + 8, 8, -+ &retlen, (char *)&oob.u); ++ /* Allocate memory for MTD device structure and private data */ ++ tx4938ndfmc_mtd = (struct mtd_info *) kmalloc (sizeof(struct mtd_info) + sizeof (struct nand_chip), ++ GFP_KERNEL); ++ if (!tx4938ndfmc_mtd) { ++ printk ("Unable to allocate TX4938 NDFMC MTD device structure.\n"); ++ return -ENOMEM; ++ } + -+ oob.u.a.VirtUnitNum = oob.u.a.SpareVirtUnitNum = cpu_to_le16(thisVUC); ++ /* Get pointer to private data */ ++ this = (struct nand_chip *) (&tx4938ndfmc_mtd[1]); + -+ MTD_WRITEOOB(nftl->mbd.mtd, writeEUN * nftl->EraseSize + 8, 8, -+ &retlen, (char *)&oob.u); ++ /* Initialize structures */ ++ memset((char *) tx4938ndfmc_mtd, 0, sizeof(struct mtd_info)); ++ memset((char *) this, 0, sizeof(struct nand_chip)); + -+ /* we link the new block to the chain only after the -+ block is ready. It avoids the case where the chain -+ could point to a free block */ -+ if (lastEUN != BLOCK_NIL) { -+ /* Both in our cache... */ -+ nftl->ReplUnitTable[lastEUN] = writeEUN; -+ /* ... and on the flash itself */ -+ MTD_READOOB(nftl->mbd.mtd, (lastEUN * nftl->EraseSize) + 8, -+ 8, &retlen, (char *)&oob.u); ++ /* Link the private data with the MTD structure */ ++ tx4938ndfmc_mtd->priv = this; + -+ oob.u.a.ReplUnitNum = oob.u.a.SpareReplUnitNum -+ = cpu_to_le16(writeEUN); ++ /* Set address of NAND IO lines */ ++ this->IO_ADDR_R = (unsigned long)&tx4938_ndfmcptr->dtr; ++ this->IO_ADDR_W = (unsigned long)&tx4938_ndfmcptr->dtr; ++ this->hwcontrol = tx4938ndfmc_hwcontrol; ++ this->dev_ready = tx4938ndfmc_dev_ready; ++ this->calculate_ecc = tx4938ndfmc_calculate_ecc; ++ this->correct_data = nand_correct_data; ++ this->enable_hwecc = tx4938ndfmc_enable_hwecc; ++ this->eccmode = NAND_ECC_HW3_256; ++ this->chip_delay = 100; ++ this->read_byte = tx4938ndfmc_nand_read_byte; ++ this->write_byte = tx4938ndfmc_nand_write_byte; ++ this->cmdfunc = tx4938ndfmc_nand_command; ++ this->write_buf = tx4938ndfmc_nand_write_buf; ++ this->read_buf = tx4938ndfmc_nand_read_buf; ++ this->verify_buf = tx4938ndfmc_nand_verify_buf; + -+ MTD_WRITEOOB(nftl->mbd.mtd, (lastEUN * nftl->EraseSize) + 8, -+ 8, &retlen, (char *)&oob.u); -+ } ++ /* Scan to find existance of the device */ ++ if (nand_scan (tx4938ndfmc_mtd, 1)) { ++ kfree (tx4938ndfmc_mtd); ++ return -ENXIO; ++ } + -+ return writeEUN; ++ if (protected) { ++ printk(KERN_INFO "TX4938 NDFMC: write protected.\n"); ++ tx4938ndfmc_mtd->flags &= ~(MTD_WRITEABLE | MTD_ERASEABLE); ++ } + -+ } while (silly2--); ++#ifdef CONFIG_MTD_CMDLINE_PARTS ++ { ++ int mtd_parts_nb = 0; ++ struct mtd_partition *mtd_parts = 0; ++ mtd_parts_nb = parse_cmdline_partitions(tx4938ndfmc_mtd, &mtd_parts, "tx4938ndfmc"); ++ if (mtd_parts_nb > 0) ++ add_mtd_partitions(tx4938ndfmc_mtd, mtd_parts, mtd_parts_nb); ++ else ++ add_mtd_device(tx4938ndfmc_mtd); ++ } ++#else ++ add_mtd_partitions(tx4938ndfmc_mtd, partition_info, NUM_PARTITIONS ); ++#endif + -+ printk(KERN_WARNING "Error folding to make room for Virtual Unit Chain 0x%x\n", -+ thisVUC); -+ return 0xffff; ++ return 0; +} ++module_init(tx4938ndfmc_init); + -+static int nftl_writeblock(struct mtd_blktrans_dev *mbd, unsigned long block, -+ char *buffer) ++/* ++ * Clean up routine ++ */ ++static void __exit tx4938ndfmc_cleanup (void) +{ -+ struct NFTLrecord *nftl = (void *)mbd; -+ u16 writeEUN; -+ unsigned long blockofs = (block * 512) & (nftl->EraseSize - 1); -+ size_t retlen; -+ struct nftl_oob oob; ++ /* Release resources, unregister device */ ++ nand_release (tx4938ndfmc_mtd); + -+ writeEUN = NFTL_findwriteunit(nftl, block); ++ /* Free the MTD device structure */ ++ kfree (tx4938ndfmc_mtd); ++} ++module_exit(tx4938ndfmc_cleanup); + -+ if (writeEUN == BLOCK_NIL) { -+ printk(KERN_WARNING -+ "NFTL_writeblock(): Cannot find block to write to\n"); -+ /* If we _still_ haven't got a block to use, we're screwed */ -+ return 1; ++MODULE_LICENSE("GPL"); ++MODULE_AUTHOR("Alice Hennessy "); ++MODULE_DESCRIPTION("Board-specific glue layer for NAND flash on TX4938 NDFMC"); +Index: linux-2.6.5/drivers/mtd/nftlcore.c +=================================================================== +--- linux-2.6.5.orig/drivers/mtd/nftlcore.c 2004-04-03 22:36:15.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/nftlcore.c 2005-02-01 17:11:29.000000000 -0500 +@@ -1,7 +1,7 @@ + /* Linux driver for NAND Flash Translation Layer */ + /* (c) 1999 Machine Vision Holdings, Inc. */ + /* Author: David Woodhouse */ +-/* $Id: nftlcore.c,v 1.94 2003/06/23 12:00:08 dwmw2 Exp $ */ ++/* $Id: nftlcore.c,v 1.96 2004/06/28 13:52:55 dbrown Exp $ */ + + /* + The contents of this file are distributed under the GNU General +@@ -43,9 +43,19 @@ + struct NFTLrecord *nftl; + unsigned long temp; + +- if (mtd->ecctype != MTD_ECC_RS_DiskOnChip) ++ if (mtd->type != MTD_NANDFLASH) ++ return; ++ /* OK, this is moderately ugly. But probably safe. Alternatives? */ ++ if (memcmp(mtd->name, "DiskOnChip", 10)) + return; + ++ if (!mtd->block_isbad) { ++ printk(KERN_ERR ++"NFTL no longer supports the old DiskOnChip drivers loaded via docprobe.\n" ++"Please use the new diskonchip driver under the NAND subsystem.\n"); ++ return; + } + + DEBUG(MTD_DEBUG_LEVEL1, "NFTL: add_mtd for %s\n", mtd->name); + + nftl = kmalloc(sizeof(struct NFTLrecord), GFP_KERNEL); +@@ -60,6 +70,8 @@ + nftl->mbd.devnum = -1; + nftl->mbd.blksize = 512; + nftl->mbd.tr = tr; ++ memcpy(&nftl->oobinfo, &mtd->oobinfo, sizeof(struct nand_oobinfo)); ++ nftl->oobinfo.useecc = MTD_NANDECC_PLACEONLY; + + if (NFTL_mount(nftl) < 0) { + printk(KERN_WARNING "NFTL: could not mount device\n"); +@@ -350,17 +362,19 @@ + if (BlockMap[block] == BLOCK_NIL) + continue; + +- ret = MTD_READECC(nftl->mbd.mtd, (nftl->EraseSize * BlockMap[block]) + (block * 512), +- 512, &retlen, movebuf, (char *)&oob, NAND_ECC_DISKONCHIP); ++ ret = MTD_READ(nftl->mbd.mtd, (nftl->EraseSize * BlockMap[block]) + (block * 512), ++ 512, &retlen, movebuf); + if (ret < 0) { +- ret = MTD_READECC(nftl->mbd.mtd, (nftl->EraseSize * BlockMap[block]) ++ ret = MTD_READ(nftl->mbd.mtd, (nftl->EraseSize * BlockMap[block]) + + (block * 512), 512, &retlen, +- movebuf, (char *)&oob, NAND_ECC_DISKONCHIP); ++ movebuf); + if (ret != -EIO) + printk("Error went away on retry.\n"); + } ++ memset(&oob, 0xff, sizeof(struct nftl_oob)); ++ oob.b.Status = oob.b.Status1 = SECTOR_USED; + MTD_WRITEECC(nftl->mbd.mtd, (nftl->EraseSize * targetEUN) + (block * 512), +- 512, &retlen, movebuf, (char *)&oob, NAND_ECC_DISKONCHIP); ++ 512, &retlen, movebuf, (char *)&oob, &nftl->oobinfo); + } + + /* add the header so that it is now a valid chain */ +@@ -390,7 +404,6 @@ + + if (NFTL_formatblock(nftl, thisEUN) < 0) { + /* could not erase : mark block as reserved +- * FixMe: Update Bad Unit Table on disk + */ + nftl->ReplUnitTable[thisEUN] = BLOCK_RESERVED; + } else { +@@ -617,7 +630,7 @@ + u16 writeEUN; + unsigned long blockofs = (block * 512) & (nftl->EraseSize - 1); + size_t retlen; +- u8 eccbuf[6]; ++ struct nftl_oob oob; + + writeEUN = NFTL_findwriteunit(nftl, block); + +@@ -628,9 +641,11 @@ + return 1; + } + + memset(&oob, 0xff, sizeof(struct nftl_oob)); + oob.b.Status = oob.b.Status1 = SECTOR_USED; -+ MTD_WRITEECC(nftl->mbd.mtd, (writeEUN * nftl->EraseSize) + blockofs, + MTD_WRITEECC(nftl->mbd.mtd, (writeEUN * nftl->EraseSize) + blockofs, +- 512, &retlen, (char *)buffer, (char *)eccbuf, NAND_ECC_DISKONCHIP); +- /* no need to write SECTOR_USED flags since they are written in mtd_writeecc */ + 512, &retlen, (char *)buffer, (char *)&oob, &nftl->oobinfo); + /* need to write SECTOR_USED flags since they are not written in mtd_writeecc */ -+ -+ return 0; -+} -+#endif /* CONFIG_NFTL_RW */ -+ -+static int nftl_readblock(struct mtd_blktrans_dev *mbd, unsigned long block, -+ char *buffer) -+{ -+ struct NFTLrecord *nftl = (void *)mbd; -+ u16 lastgoodEUN; -+ u16 thisEUN = nftl->EUNtable[block / (nftl->EraseSize / 512)]; -+ unsigned long blockofs = (block * 512) & (nftl->EraseSize - 1); -+ unsigned int status; -+ int silly = MAX_LOOPS; -+ size_t retlen; -+ struct nftl_bci bci; -+ -+ lastgoodEUN = BLOCK_NIL; -+ -+ if (thisEUN != BLOCK_NIL) { -+ while (thisEUN < nftl->nb_blocks) { -+ if (MTD_READOOB(nftl->mbd.mtd, (thisEUN * nftl->EraseSize) + blockofs, -+ 8, &retlen, (char *)&bci) < 0) -+ status = SECTOR_IGNORE; -+ else -+ status = bci.Status | bci.Status1; -+ -+ switch (status) { -+ case SECTOR_FREE: -+ /* no modification of a sector should follow a free sector */ -+ goto the_end; -+ case SECTOR_DELETED: -+ lastgoodEUN = BLOCK_NIL; -+ break; -+ case SECTOR_USED: -+ lastgoodEUN = thisEUN; -+ break; -+ case SECTOR_IGNORE: -+ break; -+ default: -+ printk("Unknown status for block %ld in EUN %d: %x\n", -+ block, thisEUN, status); -+ break; -+ } -+ -+ if (!silly--) { -+ printk(KERN_WARNING "Infinite loop in Virtual Unit Chain 0x%lx\n", -+ block / (nftl->EraseSize / 512)); -+ return 1; -+ } -+ thisEUN = nftl->ReplUnitTable[thisEUN]; -+ } -+ } -+ -+ the_end: -+ if (lastgoodEUN == BLOCK_NIL) { -+ /* the requested block is not on the media, return all 0x00 */ -+ memset(buffer, 0, 512); -+ } else { -+ loff_t ptr = (lastgoodEUN * nftl->EraseSize) + blockofs; -+ size_t retlen; + + return 0; + } +@@ -692,8 +707,7 @@ + } else { + loff_t ptr = (lastgoodEUN * nftl->EraseSize) + blockofs; + size_t retlen; +- u_char eccbuf[6]; +- if (MTD_READECC(nftl->mbd.mtd, ptr, 512, &retlen, buffer, eccbuf, NAND_ECC_DISKONCHIP)) + if (MTD_READ(nftl->mbd.mtd, ptr, 512, &retlen, buffer)) -+ return -EIO; -+ } -+ return 0; -+} -+ -+static int nftl_getgeo(struct mtd_blktrans_dev *dev, struct hd_geometry *geo) -+{ -+ struct NFTLrecord *nftl = (void *)dev; -+ -+ geo->heads = nftl->heads; -+ geo->sectors = nftl->sectors; -+ geo->cylinders = nftl->cylinders; -+ -+ return 0; -+} -+ -+/**************************************************************************** -+ * -+ * Module stuff -+ * -+ ****************************************************************************/ -+ -+ -+struct mtd_blktrans_ops nftl_tr = { -+ .name = "nftl", -+ .major = NFTL_MAJOR, -+ .part_bits = NFTL_PARTN_BITS, -+ .getgeo = nftl_getgeo, -+ .readsect = nftl_readblock, -+#ifdef CONFIG_NFTL_RW -+ .writesect = nftl_writeblock, -+#endif -+ .add_mtd = nftl_add_mtd, -+ .remove_dev = nftl_remove_dev, -+ .owner = THIS_MODULE, -+}; -+ -+extern char nftlmountrev[]; -+ -+int __init init_nftl(void) -+{ + return -EIO; + } + return 0; +@@ -735,7 +749,7 @@ + + int __init init_nftl(void) + { +- printk(KERN_INFO "NFTL driver: nftlcore.c $Revision: 1.94 $, nftlmount.c %s\n", nftlmountrev); + printk(KERN_INFO "NFTL driver: nftlcore.c $Revision: 1.96 $, nftlmount.c %s\n", nftlmountrev); -+ -+ return register_mtd_blktrans(&nftl_tr); -+} -+ -+static void __exit cleanup_nftl(void) -+{ -+ deregister_mtd_blktrans(&nftl_tr); -+} -+ -+module_init(init_nftl); -+module_exit(cleanup_nftl); -+ -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("David Woodhouse , Fabrice Bellard et al."); -+MODULE_DESCRIPTION("Support code for NAND Flash Translation Layer, used on M-Systems DiskOnChip 2000 and Millennium"); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nftlmount.c + + return register_mtd_blktrans(&nftl_tr); + } +Index: linux-2.6.5/drivers/mtd/nftlmount.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/nftlmount.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/nftlmount.c 2004-11-18 18:39:09.000000000 -0500 -@@ -0,0 +1,767 @@ -+/* -+ * NFTL mount code with extensive checks -+ * -+ * Author: Fabrice Bellard (fabrice.bellard@netgem.com) -+ * Copyright (C) 2000 Netgem S.A. -+ * +--- linux-2.6.5.orig/drivers/mtd/nftlmount.c 2004-04-03 22:37:36.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/nftlmount.c 2005-02-01 17:11:29.000000000 -0500 +@@ -4,7 +4,7 @@ + * Author: Fabrice Bellard (fabrice.bellard@netgem.com) + * Copyright (C) 2000 Netgem S.A. + * +- * $Id: nftlmount.c,v 1.34 2003/05/21 10:54:10 dwmw2 Exp $ + * $Id: nftlmount.c,v 1.37 2004/09/16 23:32:37 gleixner Exp $ -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define SECTORSIZE 512 -+ + * + * 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 +@@ -31,7 +31,7 @@ + + #define SECTORSIZE 512 + +-char nftlmountrev[]="$Revision: 1.34 $"; +char nftlmountrev[]="$Revision: 1.37 $"; -+ -+/* find_boot_record: Find the NFTL Media Header and its Spare copy which contains the -+ * various device information of the NFTL partition and Bad Unit Table. Update -+ * the ReplUnitTable[] table accroding to the Bad Unit Table. ReplUnitTable[] -+ * is used for management of Erase Unit in other routines in nftl.c and nftlmount.c -+ */ -+static int find_boot_record(struct NFTLrecord *nftl) -+{ -+ struct nftl_uci1 h1; -+ unsigned int block, boot_record_count = 0; -+ size_t retlen; -+ u8 buf[SECTORSIZE]; -+ struct NFTLMediaHeader *mh = &nftl->MediaHdr; -+ unsigned int i; -+ -+ /* Assume logical EraseSize == physical erasesize for starting the scan. -+ We'll sort it out later if we find a MediaHeader which says otherwise */ + + /* find_boot_record: Find the NFTL Media Header and its Spare copy which contains the + * various device information of the NFTL partition and Bad Unit Table. Update +@@ -41,7 +41,6 @@ + static int find_boot_record(struct NFTLrecord *nftl) + { + struct nftl_uci1 h1; +- struct nftl_oob oob; + unsigned int block, boot_record_count = 0; + size_t retlen; + u8 buf[SECTORSIZE]; +@@ -50,6 +49,10 @@ + + /* Assume logical EraseSize == physical erasesize for starting the scan. + We'll sort it out later if we find a MediaHeader which says otherwise */ + /* Actually, we won't. The new DiskOnChip driver has already scanned + the MediaHeader and adjusted the virtual erasesize it presents in + the mtd device accordingly. We could even get rid of + nftl->EraseSize if there were any point in doing so. */ -+ nftl->EraseSize = nftl->mbd.mtd->erasesize; -+ nftl->nb_blocks = nftl->mbd.mtd->size / nftl->EraseSize; -+ -+ nftl->MediaUnit = BLOCK_NIL; -+ nftl->SpareMediaUnit = BLOCK_NIL; -+ -+ /* search for a valid boot record */ -+ for (block = 0; block < nftl->nb_blocks; block++) { -+ int ret; -+ -+ /* Check for ANAND header first. Then can whinge if it's found but later -+ checks fail */ + nftl->EraseSize = nftl->mbd.mtd->erasesize; + nftl->nb_blocks = nftl->mbd.mtd->size / nftl->EraseSize; + +@@ -62,7 +65,10 @@ + + /* Check for ANAND header first. Then can whinge if it's found but later + checks fail */ +- if ((ret = MTD_READ(nftl->mbd.mtd, block * nftl->EraseSize, SECTORSIZE, &retlen, buf))) { + ret = MTD_READ(nftl->mbd.mtd, block * nftl->EraseSize, SECTORSIZE, &retlen, buf); + /* We ignore ret in case the ECC of the MediaHeader is invalid + (which is apparently acceptable) */ + if (retlen != SECTORSIZE) { -+ static int warncount = 5; -+ -+ if (warncount) { -+ printk(KERN_WARNING "Block read at 0x%x of mtd%d failed: %d\n", -+ block * nftl->EraseSize, nftl->mbd.mtd->index, ret); -+ if (!--warncount) -+ printk(KERN_WARNING "Further failures for this block will not be printed\n"); -+ } -+ continue; -+ } -+ -+ if (retlen < 6 || memcmp(buf, "ANAND", 6)) { -+ /* ANAND\0 not found. Continue */ -+#if 0 -+ printk(KERN_DEBUG "ANAND header not found at 0x%x in mtd%d\n", -+ block * nftl->EraseSize, nftl->mbd.mtd->index); -+#endif -+ continue; -+ } -+ -+ /* To be safer with BIOS, also use erase mark as discriminant */ -+ if ((ret = MTD_READOOB(nftl->mbd.mtd, block * nftl->EraseSize + SECTORSIZE + 8, -+ 8, &retlen, (char *)&h1) < 0)) { -+ printk(KERN_WARNING "ANAND header found at 0x%x in mtd%d, but OOB data read failed (err %d)\n", -+ block * nftl->EraseSize, nftl->mbd.mtd->index, ret); -+ continue; -+ } -+ -+#if 0 /* Some people seem to have devices without ECC or erase marks -+ on the Media Header blocks. There are enough other sanity -+ checks in here that we can probably do without it. -+ */ -+ if (le16_to_cpu(h1.EraseMark | h1.EraseMark1) != ERASE_MARK) { -+ printk(KERN_NOTICE "ANAND header found at 0x%x in mtd%d, but erase mark not present (0x%04x,0x%04x instead)\n", -+ block * nftl->EraseSize, nftl->mbd.mtd->index, -+ le16_to_cpu(h1.EraseMark), le16_to_cpu(h1.EraseMark1)); -+ continue; -+ } -+ -+ /* Finally reread to check ECC */ -+ if ((ret = MTD_READECC(nftl->mbd.mtd, block * nftl->EraseSize, SECTORSIZE, + static int warncount = 5; + + if (warncount) { +@@ -104,7 +110,7 @@ + + /* Finally reread to check ECC */ + if ((ret = MTD_READECC(nftl->mbd.mtd, block * nftl->EraseSize, SECTORSIZE, +- &retlen, buf, (char *)&oob, NAND_ECC_DISKONCHIP) < 0)) { + &retlen, buf, (char *)&oob, NULL) < 0)) { -+ printk(KERN_NOTICE "ANAND header found at 0x%x in mtd%d, but ECC read failed (err %d)\n", -+ block * nftl->EraseSize, nftl->mbd.mtd->index, ret); -+ continue; -+ } -+ -+ /* Paranoia. Check the ANAND header is still there after the ECC read */ -+ if (memcmp(buf, "ANAND", 6)) { -+ printk(KERN_NOTICE "ANAND header found at 0x%x in mtd%d, but went away on reread!\n", -+ block * nftl->EraseSize, nftl->mbd.mtd->index); -+ printk(KERN_NOTICE "New data are: %02x %02x %02x %02x %02x %02x\n", -+ buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]); -+ continue; -+ } -+#endif -+ /* OK, we like it. */ -+ -+ if (boot_record_count) { -+ /* We've already processed one. So we just check if -+ this one is the same as the first one we found */ -+ if (memcmp(mh, buf, sizeof(struct NFTLMediaHeader))) { -+ printk(KERN_NOTICE "NFTL Media Headers at 0x%x and 0x%x disagree.\n", -+ nftl->MediaUnit * nftl->EraseSize, block * nftl->EraseSize); -+ /* if (debug) Print both side by side */ -+ if (boot_record_count < 2) { -+ /* We haven't yet seen two real ones */ -+ return -1; -+ } -+ continue; -+ } -+ if (boot_record_count == 1) -+ nftl->SpareMediaUnit = block; -+ -+ /* Mark this boot record (NFTL MediaHeader) block as reserved */ -+ nftl->ReplUnitTable[block] = BLOCK_RESERVED; -+ -+ -+ boot_record_count++; -+ continue; -+ } -+ -+ /* This is the first we've seen. Copy the media header structure into place */ -+ memcpy(mh, buf, sizeof(struct NFTLMediaHeader)); -+ -+ /* Do some sanity checks on it */ + printk(KERN_NOTICE "ANAND header found at 0x%x in mtd%d, but ECC read failed (err %d)\n", + block * nftl->EraseSize, nftl->mbd.mtd->index, ret); + continue; +@@ -149,6 +155,10 @@ + memcpy(mh, buf, sizeof(struct NFTLMediaHeader)); + + /* Do some sanity checks on it */ +#if 0 +The new DiskOnChip driver scans the MediaHeader itself, and presents a virtual +erasesize based on UnitSizeFactor. So the erasesize we read from the mtd +device is already correct. -+ if (mh->UnitSizeFactor == 0) { -+ printk(KERN_NOTICE "NFTL: UnitSizeFactor 0x00 detected. This violates the spec but we think we know what it means...\n"); -+ } else if (mh->UnitSizeFactor < 0xfc) { -+ printk(KERN_NOTICE "Sorry, we don't support UnitSizeFactor 0x%02x\n", -+ mh->UnitSizeFactor); -+ return -1; -+ } else if (mh->UnitSizeFactor != 0xff) { -+ printk(KERN_NOTICE "WARNING: Support for NFTL with UnitSizeFactor 0x%02x is experimental\n", -+ mh->UnitSizeFactor); -+ nftl->EraseSize = nftl->mbd.mtd->erasesize << (0xff - mh->UnitSizeFactor); -+ nftl->nb_blocks = nftl->mbd.mtd->size / nftl->EraseSize; -+ } + if (mh->UnitSizeFactor == 0) { + printk(KERN_NOTICE "NFTL: UnitSizeFactor 0x00 detected. This violates the spec but we think we know what it means...\n"); + } else if (mh->UnitSizeFactor < 0xfc) { +@@ -161,6 +171,7 @@ + nftl->EraseSize = nftl->mbd.mtd->erasesize << (0xff - mh->UnitSizeFactor); + nftl->nb_blocks = nftl->mbd.mtd->size / nftl->EraseSize; + } +#endif -+ nftl->nb_boot_blocks = le16_to_cpu(mh->FirstPhysicalEUN); -+ if ((nftl->nb_boot_blocks + 2) >= nftl->nb_blocks) { -+ printk(KERN_NOTICE "NFTL Media Header sanity check failed:\n"); -+ printk(KERN_NOTICE "nb_boot_blocks (%d) + 2 > nb_blocks (%d)\n", -+ nftl->nb_boot_blocks, nftl->nb_blocks); -+ return -1; -+ } -+ -+ nftl->numvunits = le32_to_cpu(mh->FormattedSize) / nftl->EraseSize; -+ if (nftl->numvunits > (nftl->nb_blocks - nftl->nb_boot_blocks - 2)) { -+ printk(KERN_NOTICE "NFTL Media Header sanity check failed:\n"); -+ printk(KERN_NOTICE "numvunits (%d) > nb_blocks (%d) - nb_boot_blocks(%d) - 2\n", -+ nftl->numvunits, nftl->nb_blocks, nftl->nb_boot_blocks); -+ return -1; -+ } -+ -+ nftl->mbd.size = nftl->numvunits * (nftl->EraseSize / SECTORSIZE); -+ -+ /* If we're not using the last sectors in the device for some reason, -+ reduce nb_blocks accordingly so we forget they're there */ -+ nftl->nb_blocks = le16_to_cpu(mh->NumEraseUnits) + le16_to_cpu(mh->FirstPhysicalEUN); -+ -+ /* XXX: will be suppressed */ -+ nftl->lastEUN = nftl->nb_blocks - 1; -+ -+ /* memory alloc */ -+ nftl->EUNtable = kmalloc(nftl->nb_blocks * sizeof(u16), GFP_KERNEL); -+ if (!nftl->EUNtable) { -+ printk(KERN_NOTICE "NFTL: allocation of EUNtable failed\n"); -+ return -ENOMEM; -+ } -+ -+ nftl->ReplUnitTable = kmalloc(nftl->nb_blocks * sizeof(u16), GFP_KERNEL); -+ if (!nftl->ReplUnitTable) { -+ kfree(nftl->EUNtable); -+ printk(KERN_NOTICE "NFTL: allocation of ReplUnitTable failed\n"); -+ return -ENOMEM; -+ } -+ -+ /* mark the bios blocks (blocks before NFTL MediaHeader) as reserved */ -+ for (i = 0; i < nftl->nb_boot_blocks; i++) -+ nftl->ReplUnitTable[i] = BLOCK_RESERVED; -+ /* mark all remaining blocks as potentially containing data */ -+ for (; i < nftl->nb_blocks; i++) { -+ nftl->ReplUnitTable[i] = BLOCK_NOTEXPLORED; -+ } -+ -+ /* Mark this boot record (NFTL MediaHeader) block as reserved */ -+ nftl->ReplUnitTable[block] = BLOCK_RESERVED; -+ -+ /* read the Bad Erase Unit Table and modify ReplUnitTable[] accordingly */ -+ for (i = 0; i < nftl->nb_blocks; i++) { + nftl->nb_boot_blocks = le16_to_cpu(mh->FirstPhysicalEUN); + if ((nftl->nb_boot_blocks + 2) >= nftl->nb_blocks) { + printk(KERN_NOTICE "NFTL Media Header sanity check failed:\n"); +@@ -213,11 +224,13 @@ + + /* read the Bad Erase Unit Table and modify ReplUnitTable[] accordingly */ + for (i = 0; i < nftl->nb_blocks; i++) { +#if 0 +The new DiskOnChip driver already scanned the bad block table. Just query it. -+ if ((i & (SECTORSIZE - 1)) == 0) { -+ /* read one sector for every SECTORSIZE of blocks */ -+ if ((ret = MTD_READECC(nftl->mbd.mtd, block * nftl->EraseSize + -+ i + SECTORSIZE, SECTORSIZE, &retlen, buf, + if ((i & (SECTORSIZE - 1)) == 0) { + /* read one sector for every SECTORSIZE of blocks */ + if ((ret = MTD_READECC(nftl->mbd.mtd, block * nftl->EraseSize + + i + SECTORSIZE, SECTORSIZE, &retlen, buf, +- (char *)&oob, NAND_ECC_DISKONCHIP)) < 0) { + (char *)&oob, NULL)) < 0) { -+ printk(KERN_NOTICE "Read of bad sector table failed (err %d)\n", -+ ret); -+ kfree(nftl->ReplUnitTable); -+ kfree(nftl->EUNtable); -+ return -1; -+ } -+ } -+ /* mark the Bad Erase Unit as RESERVED in ReplUnitTable */ -+ if (buf[i & (SECTORSIZE - 1)] != 0xff) -+ nftl->ReplUnitTable[i] = BLOCK_RESERVED; + printk(KERN_NOTICE "Read of bad sector table failed (err %d)\n", + ret); + kfree(nftl->ReplUnitTable); +@@ -228,6 +241,9 @@ + /* mark the Bad Erase Unit as RESERVED in ReplUnitTable */ + if (buf[i & (SECTORSIZE - 1)] != 0xff) + nftl->ReplUnitTable[i] = BLOCK_RESERVED; +#endif + if (nftl->mbd.mtd->block_isbad(nftl->mbd.mtd, i * nftl->EraseSize)) + nftl->ReplUnitTable[i] = BLOCK_RESERVED; -+ } -+ -+ nftl->MediaUnit = block; -+ boot_record_count++; -+ -+ } /* foreach (block) */ -+ -+ return boot_record_count?0:-1; -+} -+ -+static int memcmpb(void *a, int c, int n) -+{ -+ int i; -+ for (i = 0; i < n; i++) { -+ if (c != ((unsigned char *)a)[i]) -+ return 1; -+ } -+ return 0; -+} -+ -+/* check_free_sector: check if a free sector is actually FREE, i.e. All 0xff in data and oob area */ -+static int check_free_sectors(struct NFTLrecord *nftl, unsigned int address, int len, -+ int check_oob) -+{ -+ int i, retlen; + } + + nftl->MediaUnit = block; +@@ -253,21 +269,16 @@ + int check_oob) + { + int i, retlen; +- u8 buf[SECTORSIZE]; + u8 buf[SECTORSIZE + nftl->mbd.mtd->oobsize]; -+ -+ for (i = 0; i < len; i += SECTORSIZE) { + + for (i = 0; i < len; i += SECTORSIZE) { +- /* we want to read the sector without ECC check here since a free +- sector does not have ECC syndrome on it yet */ +- if (MTD_READ(nftl->mbd.mtd, address, SECTORSIZE, &retlen, buf) < 0) + if (MTD_READECC(nftl->mbd.mtd, address, SECTORSIZE, &retlen, buf, &buf[SECTORSIZE], &nftl->oobinfo) < 0) -+ return -1; -+ if (memcmpb(buf, 0xff, SECTORSIZE) != 0) -+ return -1; -+ -+ if (check_oob) { + return -1; + if (memcmpb(buf, 0xff, SECTORSIZE) != 0) + return -1; + + if (check_oob) { +- if (MTD_READOOB(nftl->mbd.mtd, address, nftl->mbd.mtd->oobsize, +- &retlen, buf) < 0) +- return -1; +- if (memcmpb(buf, 0xff, nftl->mbd.mtd->oobsize) != 0) + if (memcmpb(buf + SECTORSIZE, 0xff, nftl->mbd.mtd->oobsize) != 0) -+ return -1; -+ } -+ address += SECTORSIZE; -+ } -+ -+ return 0; -+} -+ -+/* NFTL_format: format a Erase Unit by erasing ALL Erase Zones in the Erase Unit and -+ * Update NFTL metadata. Each erase operation is checked with check_free_sectors -+ * -+ * Return: 0 when succeed, -1 on error. -+ * -+ * ToDo: 1. Is it neceressary to check_free_sector after erasing ?? -+ */ -+int NFTL_formatblock(struct NFTLrecord *nftl, int block) -+{ -+ size_t retlen; -+ unsigned int nb_erases, erase_mark; -+ struct nftl_uci1 uci; -+ struct erase_info *instr = &nftl->instr; -+ -+ /* Read the Unit Control Information #1 for Wear-Leveling */ -+ if (MTD_READOOB(nftl->mbd.mtd, block * nftl->EraseSize + SECTORSIZE + 8, -+ 8, &retlen, (char *)&uci) < 0) -+ goto default_uci1; -+ -+ erase_mark = le16_to_cpu ((uci.EraseMark | uci.EraseMark1)); -+ if (erase_mark != ERASE_MARK) { -+ default_uci1: -+ uci.EraseMark = cpu_to_le16(ERASE_MARK); -+ uci.EraseMark1 = cpu_to_le16(ERASE_MARK); -+ uci.WearInfo = cpu_to_le32(0); -+ } -+ -+ memset(instr, 0, sizeof(struct erase_info)); -+ -+ /* XXX: use async erase interface, XXX: test return code */ -+ instr->addr = block * nftl->EraseSize; -+ instr->len = nftl->EraseSize; -+ MTD_ERASE(nftl->mbd.mtd, instr); -+ -+ if (instr->state == MTD_ERASE_FAILED) { -+ printk("Error while formatting block %d\n", block); + return -1; + } + address += SECTORSIZE; +@@ -282,7 +293,6 @@ + * Return: 0 when succeed, -1 on error. + * + * ToDo: 1. Is it neceressary to check_free_sector after erasing ?? +- * 2. UnitSizeFactor != 0xFF + */ + int NFTL_formatblock(struct NFTLrecord *nftl, int block) + { +@@ -312,11 +322,10 @@ + MTD_ERASE(nftl->mbd.mtd, instr); + + if (instr->state == MTD_ERASE_FAILED) { +- /* could not format, FixMe: We should update the BadUnitTable +- both in memory and on disk */ + printk("Error while formatting block %d\n", block); +- return -1; +- } else { + goto fail; + } + -+ /* increase and write Wear-Leveling info */ -+ nb_erases = le32_to_cpu(uci.WearInfo); -+ nb_erases++; -+ -+ /* wrap (almost impossible with current flashs) or free block */ -+ if (nb_erases == 0) -+ nb_erases = 1; -+ -+ /* check the "freeness" of Erase Unit before updating metadata -+ * FixMe: is this check really necessary ? since we have check the -+ * return code after the erase operation. */ -+ if (check_free_sectors(nftl, instr->addr, nftl->EraseSize, 1) != 0) + /* increase and write Wear-Leveling info */ + nb_erases = le32_to_cpu(uci.WearInfo); + nb_erases++; +@@ -329,14 +338,18 @@ + * FixMe: is this check really necessary ? since we have check the + * return code after the erase operation. */ + if (check_free_sectors(nftl, instr->addr, nftl->EraseSize, 1) != 0) +- return -1; + goto fail; -+ -+ uci.WearInfo = le32_to_cpu(nb_erases); -+ if (MTD_WRITEOOB(nftl->mbd.mtd, block * nftl->EraseSize + SECTORSIZE + 8, 8, -+ &retlen, (char *)&uci) < 0) + + uci.WearInfo = le32_to_cpu(nb_erases); + if (MTD_WRITEOOB(nftl->mbd.mtd, block * nftl->EraseSize + SECTORSIZE + 8, 8, + &retlen, (char *)&uci) < 0) +- return -1; + goto fail; -+ return 0; + return 0; +- } +fail: + /* could not format, update the bad block table (caller is responsible + for setting the ReplUnitTable to BLOCK_RESERVED on failure) */ + nftl->mbd.mtd->block_markbad(nftl->mbd.mtd, instr->addr); + return -1; -+} -+ -+/* check_sectors_in_chain: Check that each sector of a Virtual Unit Chain is correct. -+ * Mark as 'IGNORE' each incorrect sector. This check is only done if the chain -+ * was being folded when NFTL was interrupted. -+ * -+ * The check_free_sectors in this function is neceressary. There is a possible -+ * situation that after writing the Data area, the Block Control Information is -+ * not updated according (due to power failure or something) which leaves the block -+ * in an umconsistent state. So we have to check if a block is really FREE in this -+ * case. */ -+static void check_sectors_in_chain(struct NFTLrecord *nftl, unsigned int first_block) -+{ -+ unsigned int block, i, status; -+ struct nftl_bci bci; -+ int sectors_per_block, retlen; -+ -+ sectors_per_block = nftl->EraseSize / SECTORSIZE; -+ block = first_block; -+ for (;;) { -+ for (i = 0; i < sectors_per_block; i++) { -+ if (MTD_READOOB(nftl->mbd.mtd, block * nftl->EraseSize + i * SECTORSIZE, -+ 8, &retlen, (char *)&bci) < 0) -+ status = SECTOR_IGNORE; -+ else -+ status = bci.Status | bci.Status1; -+ -+ switch(status) { -+ case SECTOR_FREE: -+ /* verify that the sector is really free. If not, mark -+ as ignore */ -+ if (memcmpb(&bci, 0xff, 8) != 0 || -+ check_free_sectors(nftl, block * nftl->EraseSize + i * SECTORSIZE, -+ SECTORSIZE, 0) != 0) { -+ printk("Incorrect free sector %d in block %d: " -+ "marking it as ignored\n", -+ i, block); -+ -+ /* sector not free actually : mark it as SECTOR_IGNORE */ -+ bci.Status = SECTOR_IGNORE; -+ bci.Status1 = SECTOR_IGNORE; -+ MTD_WRITEOOB(nftl->mbd.mtd, -+ block * nftl->EraseSize + i * SECTORSIZE, -+ 8, &retlen, (char *)&bci); -+ } -+ break; -+ default: -+ break; -+ } -+ } -+ -+ /* proceed to next Erase Unit on the chain */ -+ block = nftl->ReplUnitTable[block]; -+ if (!(block == BLOCK_NIL || block < nftl->nb_blocks)) -+ printk("incorrect ReplUnitTable[] : %d\n", block); -+ if (block == BLOCK_NIL || block >= nftl->nb_blocks) -+ break; -+ } -+} -+ -+/* calc_chain_lenght: Walk through a Virtual Unit Chain and estimate chain length */ -+static int calc_chain_length(struct NFTLrecord *nftl, unsigned int first_block) -+{ -+ unsigned int length = 0, block = first_block; -+ -+ for (;;) { -+ length++; -+ /* avoid infinite loops, although this is guaranted not to -+ happen because of the previous checks */ -+ if (length >= nftl->nb_blocks) { -+ printk("nftl: length too long %d !\n", length); -+ break; -+ } -+ -+ block = nftl->ReplUnitTable[block]; -+ if (!(block == BLOCK_NIL || block < nftl->nb_blocks)) -+ printk("incorrect ReplUnitTable[] : %d\n", block); -+ if (block == BLOCK_NIL || block >= nftl->nb_blocks) -+ break; -+ } -+ return length; -+} -+ -+/* format_chain: Format an invalid Virtual Unit chain. It frees all the Erase Units in a -+ * Virtual Unit Chain, i.e. all the units are disconnected. -+ * -+ * It is not stricly correct to begin from the first block of the chain because -+ * if we stop the code, we may see again a valid chain if there was a first_block -+ * flag in a block inside it. But is it really a problem ? -+ * -+ * FixMe: Figure out what the last statesment means. What if power failure when we are -+ * in the for (;;) loop formatting blocks ?? -+ */ -+static void format_chain(struct NFTLrecord *nftl, unsigned int first_block) -+{ -+ unsigned int block = first_block, block1; -+ -+ printk("Formatting chain at block %d\n", first_block); -+ -+ for (;;) { -+ block1 = nftl->ReplUnitTable[block]; -+ -+ printk("Formatting block %d\n", block); -+ if (NFTL_formatblock(nftl, block) < 0) { + } + + /* check_sectors_in_chain: Check that each sector of a Virtual Unit Chain is correct. +@@ -441,8 +454,7 @@ + + printk("Formatting block %d\n", block); + if (NFTL_formatblock(nftl, block) < 0) { +- /* cannot format !!!! Mark it as Bad Unit, +- FixMe: update the BadUnitTable on disk */ + /* cannot format !!!! Mark it as Bad Unit */ -+ nftl->ReplUnitTable[block] = BLOCK_RESERVED; -+ } else { -+ nftl->ReplUnitTable[block] = BLOCK_FREE; -+ } -+ -+ /* goto next block on the chain */ -+ block = block1; -+ -+ if (!(block == BLOCK_NIL || block < nftl->nb_blocks)) -+ printk("incorrect ReplUnitTable[] : %d\n", block); -+ if (block == BLOCK_NIL || block >= nftl->nb_blocks) -+ break; -+ } -+} -+ -+/* check_and_mark_free_block: Verify that a block is free in the NFTL sense (valid erase mark) or -+ * totally free (only 0xff). -+ * -+ * Definition: Free Erase Unit -- A properly erased/formatted Free Erase Unit should have meet the -+ * following critia: -+ * 1. */ -+static int check_and_mark_free_block(struct NFTLrecord *nftl, int block) -+{ -+ struct nftl_uci1 h1; -+ unsigned int erase_mark; -+ size_t retlen; -+ -+ /* check erase mark. */ -+ if (MTD_READOOB(nftl->mbd.mtd, block * nftl->EraseSize + SECTORSIZE + 8, 8, -+ &retlen, (char *)&h1) < 0) -+ return -1; -+ -+ erase_mark = le16_to_cpu ((h1.EraseMark | h1.EraseMark1)); -+ if (erase_mark != ERASE_MARK) { -+ /* if no erase mark, the block must be totally free. This is -+ possible in two cases : empty filsystem or interrupted erase (very unlikely) */ -+ if (check_free_sectors (nftl, block * nftl->EraseSize, nftl->EraseSize, 1) != 0) -+ return -1; -+ -+ /* free block : write erase mark */ -+ h1.EraseMark = cpu_to_le16(ERASE_MARK); -+ h1.EraseMark1 = cpu_to_le16(ERASE_MARK); -+ h1.WearInfo = cpu_to_le32(0); -+ if (MTD_WRITEOOB(nftl->mbd.mtd, block * nftl->EraseSize + SECTORSIZE + 8, 8, -+ &retlen, (char *)&h1) < 0) -+ return -1; -+ } else { -+#if 0 -+ /* if erase mark present, need to skip it when doing check */ -+ for (i = 0; i < nftl->EraseSize; i += SECTORSIZE) { -+ /* check free sector */ -+ if (check_free_sectors (nftl, block * nftl->EraseSize + i, -+ SECTORSIZE, 0) != 0) -+ return -1; -+ -+ if (MTD_READOOB(nftl->mbd.mtd, block * nftl->EraseSize + i, -+ 16, &retlen, buf) < 0) -+ return -1; -+ if (i == SECTORSIZE) { -+ /* skip erase mark */ -+ if (memcmpb(buf, 0xff, 8)) -+ return -1; -+ } else { -+ if (memcmpb(buf, 0xff, 16)) -+ return -1; -+ } -+ } -+#endif -+ } -+ -+ return 0; -+} -+ -+/* get_fold_mark: Read fold mark from Unit Control Information #2, we use FOLD_MARK_IN_PROGRESS -+ * to indicate that we are in the progression of a Virtual Unit Chain folding. If the UCI #2 -+ * is FOLD_MARK_IN_PROGRESS when mounting the NFTL, the (previous) folding process is interrupted -+ * for some reason. A clean up/check of the VUC is neceressary in this case. -+ * -+ * WARNING: return 0 if read error -+ */ -+static int get_fold_mark(struct NFTLrecord *nftl, unsigned int block) -+{ -+ struct nftl_uci2 uci; -+ size_t retlen; -+ -+ if (MTD_READOOB(nftl->mbd.mtd, block * nftl->EraseSize + 2 * SECTORSIZE + 8, -+ 8, &retlen, (char *)&uci) < 0) -+ return 0; -+ -+ return le16_to_cpu((uci.FoldMark | uci.FoldMark1)); -+} -+ -+int NFTL_mount(struct NFTLrecord *s) -+{ -+ int i; -+ unsigned int first_logical_block, logical_block, rep_block, nb_erases, erase_mark; -+ unsigned int block, first_block, is_first_block; -+ int chain_length, do_format_chain; -+ struct nftl_uci0 h0; -+ struct nftl_uci1 h1; -+ size_t retlen; -+ -+ /* search for NFTL MediaHeader and Spare NFTL Media Header */ -+ if (find_boot_record(s) < 0) { -+ printk("Could not find valid boot record\n"); -+ return -1; -+ } -+ -+ /* init the logical to physical table */ -+ for (i = 0; i < s->nb_blocks; i++) { -+ s->EUNtable[i] = BLOCK_NIL; -+ } -+ -+ /* first pass : explore each block chain */ -+ first_logical_block = 0; -+ for (first_block = 0; first_block < s->nb_blocks; first_block++) { -+ /* if the block was not already explored, we can look at it */ -+ if (s->ReplUnitTable[first_block] == BLOCK_NOTEXPLORED) { -+ block = first_block; -+ chain_length = 0; -+ do_format_chain = 0; -+ -+ for (;;) { -+ /* read the block header. If error, we format the chain */ -+ if (MTD_READOOB(s->mbd.mtd, block * s->EraseSize + 8, 8, -+ &retlen, (char *)&h0) < 0 || -+ MTD_READOOB(s->mbd.mtd, block * s->EraseSize + SECTORSIZE + 8, 8, -+ &retlen, (char *)&h1) < 0) { -+ s->ReplUnitTable[block] = BLOCK_NIL; -+ do_format_chain = 1; -+ break; -+ } -+ -+ logical_block = le16_to_cpu ((h0.VirtUnitNum | h0.SpareVirtUnitNum)); -+ rep_block = le16_to_cpu ((h0.ReplUnitNum | h0.SpareReplUnitNum)); -+ nb_erases = le32_to_cpu (h1.WearInfo); -+ erase_mark = le16_to_cpu ((h1.EraseMark | h1.EraseMark1)); -+ -+ is_first_block = !(logical_block >> 15); -+ logical_block = logical_block & 0x7fff; -+ -+ /* invalid/free block test */ -+ if (erase_mark != ERASE_MARK || logical_block >= s->nb_blocks) { -+ if (chain_length == 0) { -+ /* if not currently in a chain, we can handle it safely */ -+ if (check_and_mark_free_block(s, block) < 0) { -+ /* not really free: format it */ -+ printk("Formatting block %d\n", block); -+ if (NFTL_formatblock(s, block) < 0) { -+ /* could not format: reserve the block */ -+ s->ReplUnitTable[block] = BLOCK_RESERVED; -+ } else { -+ s->ReplUnitTable[block] = BLOCK_FREE; -+ } -+ } else { -+ /* free block: mark it */ -+ s->ReplUnitTable[block] = BLOCK_FREE; -+ } -+ /* directly examine the next block. */ -+ goto examine_ReplUnitTable; -+ } else { -+ /* the block was in a chain : this is bad. We -+ must format all the chain */ -+ printk("Block %d: free but referenced in chain %d\n", -+ block, first_block); -+ s->ReplUnitTable[block] = BLOCK_NIL; -+ do_format_chain = 1; -+ break; -+ } -+ } -+ -+ /* we accept only first blocks here */ -+ if (chain_length == 0) { -+ /* this block is not the first block in chain : -+ ignore it, it will be included in a chain -+ later, or marked as not explored */ -+ if (!is_first_block) -+ goto examine_ReplUnitTable; -+ first_logical_block = logical_block; -+ } else { -+ if (logical_block != first_logical_block) { -+ printk("Block %d: incorrect logical block: %d expected: %d\n", -+ block, logical_block, first_logical_block); -+ /* the chain is incorrect : we must format it, -+ but we need to read it completly */ -+ do_format_chain = 1; -+ } -+ if (is_first_block) { -+ /* we accept that a block is marked as first -+ block while being last block in a chain -+ only if the chain is being folded */ -+ if (get_fold_mark(s, block) != FOLD_MARK_IN_PROGRESS || -+ rep_block != 0xffff) { -+ printk("Block %d: incorrectly marked as first block in chain\n", -+ block); -+ /* the chain is incorrect : we must format it, -+ but we need to read it completly */ -+ do_format_chain = 1; -+ } else { -+ printk("Block %d: folding in progress - ignoring first block flag\n", -+ block); -+ } -+ } -+ } -+ chain_length++; -+ if (rep_block == 0xffff) { -+ /* no more blocks after */ -+ s->ReplUnitTable[block] = BLOCK_NIL; -+ break; -+ } else if (rep_block >= s->nb_blocks) { -+ printk("Block %d: referencing invalid block %d\n", -+ block, rep_block); -+ do_format_chain = 1; -+ s->ReplUnitTable[block] = BLOCK_NIL; -+ break; -+ } else if (s->ReplUnitTable[rep_block] != BLOCK_NOTEXPLORED) { -+ /* same problem as previous 'is_first_block' test: -+ we accept that the last block of a chain has -+ the first_block flag set if folding is in -+ progress. We handle here the case where the -+ last block appeared first */ -+ if (s->ReplUnitTable[rep_block] == BLOCK_NIL && -+ s->EUNtable[first_logical_block] == rep_block && -+ get_fold_mark(s, first_block) == FOLD_MARK_IN_PROGRESS) { -+ /* EUNtable[] will be set after */ -+ printk("Block %d: folding in progress - ignoring first block flag\n", -+ rep_block); -+ s->ReplUnitTable[block] = rep_block; -+ s->EUNtable[first_logical_block] = BLOCK_NIL; -+ } else { -+ printk("Block %d: referencing block %d already in another chain\n", -+ block, rep_block); -+ /* XXX: should handle correctly fold in progress chains */ -+ do_format_chain = 1; -+ s->ReplUnitTable[block] = BLOCK_NIL; -+ } -+ break; -+ } else { -+ /* this is OK */ -+ s->ReplUnitTable[block] = rep_block; -+ block = rep_block; -+ } -+ } -+ -+ /* the chain was completely explored. Now we can decide -+ what to do with it */ -+ if (do_format_chain) { -+ /* invalid chain : format it */ -+ format_chain(s, first_block); -+ } else { -+ unsigned int first_block1, chain_to_format, chain_length1; -+ int fold_mark; -+ -+ /* valid chain : get foldmark */ -+ fold_mark = get_fold_mark(s, first_block); -+ if (fold_mark == 0) { -+ /* cannot get foldmark : format the chain */ -+ printk("Could read foldmark at block %d\n", first_block); -+ format_chain(s, first_block); -+ } else { -+ if (fold_mark == FOLD_MARK_IN_PROGRESS) -+ check_sectors_in_chain(s, first_block); -+ -+ /* now handle the case where we find two chains at the -+ same virtual address : we select the longer one, -+ because the shorter one is the one which was being -+ folded if the folding was not done in place */ -+ first_block1 = s->EUNtable[first_logical_block]; -+ if (first_block1 != BLOCK_NIL) { -+ /* XXX: what to do if same length ? */ -+ chain_length1 = calc_chain_length(s, first_block1); -+ printk("Two chains at blocks %d (len=%d) and %d (len=%d)\n", -+ first_block1, chain_length1, first_block, chain_length); -+ -+ if (chain_length >= chain_length1) { -+ chain_to_format = first_block1; -+ s->EUNtable[first_logical_block] = first_block; -+ } else { -+ chain_to_format = first_block; -+ } -+ format_chain(s, chain_to_format); -+ } else { -+ s->EUNtable[first_logical_block] = first_block; -+ } -+ } -+ } -+ } -+ examine_ReplUnitTable:; -+ } -+ -+ /* second pass to format unreferenced blocks and init free block count */ -+ s->numfreeEUNs = 0; -+ s->LastFreeEUN = le16_to_cpu(s->MediaHdr.FirstPhysicalEUN); -+ -+ for (block = 0; block < s->nb_blocks; block++) { -+ if (s->ReplUnitTable[block] == BLOCK_NOTEXPLORED) { -+ printk("Unreferenced block %d, formatting it\n", block); -+ if (NFTL_formatblock(s, block) < 0) -+ s->ReplUnitTable[block] = BLOCK_RESERVED; -+ else -+ s->ReplUnitTable[block] = BLOCK_FREE; -+ } -+ if (s->ReplUnitTable[block] == BLOCK_FREE) { -+ s->numfreeEUNs++; -+ s->LastFreeEUN = block; -+ } -+ } -+ -+ return 0; -+} -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/redboot.c + nftl->ReplUnitTable[block] = BLOCK_RESERVED; + } else { + nftl->ReplUnitTable[block] = BLOCK_FREE; +Index: linux-2.6.5/drivers/mtd/redboot.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/redboot.c 2004-04-03 22:37:23.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/redboot.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/redboot.c 2004-04-03 22:37:23.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/redboot.c 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: redboot.c,v 1.11 2003/05/21 10:39:26 dwmw2 Exp $ @@ -33970,10 +30493,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/redboot.c return ret; } -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/ssfdc.c +Index: linux-2.6.5/drivers/mtd/ssfdc.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/drivers/mtd/ssfdc.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/ssfdc.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/drivers/mtd/ssfdc.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/drivers/mtd/ssfdc.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,1132 @@ +/* + * drivers/mtd/ssfdc.c @@ -35107,10 +31630,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/drivers/mtd/ssfdc.c + + + -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/cfi.h +Index: linux-2.6.5/include/linux/mtd/cfi.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/linux/mtd/cfi.h 2004-04-03 22:36:56.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/cfi.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/include/linux/mtd/cfi.h 2004-04-03 22:36:56.000000000 -0500 ++++ linux-2.6.5/include/linux/mtd/cfi.h 2005-02-01 17:11:17.000000000 -0500 @@ -1,7 +1,7 @@ /* Common Flash Interface structures @@ -35778,10 +32301,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/cfi.h + + #endif /* __MTD_CFI_H__ */ -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/compatmac.h +Index: linux-2.6.5/include/linux/mtd/compatmac.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/linux/mtd/compatmac.h 2004-04-03 22:38:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/compatmac.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/include/linux/mtd/compatmac.h 2004-04-03 22:38:00.000000000 -0500 ++++ linux-2.6.5/include/linux/mtd/compatmac.h 2005-02-01 17:11:17.000000000 -0500 @@ -1,10 +1,210 @@ +/* + * $Id: compatmac.h,v 1.68 2004/09/17 22:00:30 eric Exp $ @@ -35997,10 +32520,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/compatmac +#endif #endif /* __LINUX_MTD_COMPATMAC_H__ */ -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/doc2000.h +Index: linux-2.6.5/include/linux/mtd/doc2000.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/linux/mtd/doc2000.h 2004-04-03 22:37:07.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/doc2000.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/include/linux/mtd/doc2000.h 2004-04-03 22:37:07.000000000 -0500 ++++ linux-2.6.5/include/linux/mtd/doc2000.h 2005-02-01 17:11:17.000000000 -0500 @@ -1,13 +1,21 @@ - -/* Linux driver for Disk-On-Chip 2000 */ @@ -36084,10 +32607,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/doc2000.h int ioreg; unsigned long mfr; /* Flash IDs - only one type of flash per device */ -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/flashchip.h +Index: linux-2.6.5/include/linux/mtd/flashchip.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/linux/mtd/flashchip.h 2004-04-03 22:38:13.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/flashchip.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/include/linux/mtd/flashchip.h 2004-04-03 22:38:13.000000000 -0500 ++++ linux-2.6.5/include/linux/mtd/flashchip.h 2005-02-01 17:11:17.000000000 -0500 @@ -6,7 +6,7 @@ * * (C) 2000 Red Hat. GPLd. @@ -36133,10 +32656,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/flashchip #endif /* __MTD_FLASHCHIP_H__ */ -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/ftl.h +Index: linux-2.6.5/include/linux/mtd/ftl.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/linux/mtd/ftl.h 2004-04-03 22:37:37.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/ftl.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/include/linux/mtd/ftl.h 2004-04-03 22:37:37.000000000 -0500 ++++ linux-2.6.5/include/linux/mtd/ftl.h 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: ftl.h,v 1.5 2001/06/02 20:35:51 dwmw2 Exp $ @@ -36144,10 +32667,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/ftl.h * * Derived from (and probably identical to): * ftl.h 1.7 1999/10/25 20:23:17 -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/gen_probe.h +Index: linux-2.6.5/include/linux/mtd/gen_probe.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/linux/mtd/gen_probe.h 2004-04-03 22:37:25.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/gen_probe.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/include/linux/mtd/gen_probe.h 2004-04-03 22:37:25.000000000 -0500 ++++ linux-2.6.5/include/linux/mtd/gen_probe.h 2005-02-01 17:11:17.000000000 -0500 @@ -1,7 +1,7 @@ /* * (C) 2001, 2001 Red Hat, Inc. @@ -36172,10 +32695,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/gen_probe }; struct mtd_info *mtd_do_chip_probe(struct map_info *map, struct chip_probe *cp); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/inftl.h +Index: linux-2.6.5/include/linux/mtd/inftl.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/linux/mtd/inftl.h 2004-04-03 22:38:14.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/inftl.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/include/linux/mtd/inftl.h 2004-04-03 22:38:14.000000000 -0500 ++++ linux-2.6.5/include/linux/mtd/inftl.h 2005-02-01 17:11:17.000000000 -0500 @@ -3,105 +3,32 @@ * * (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com) @@ -36298,10 +32821,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/inftl.h }; int INFTL_mount(struct INFTLrecord *s); -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/map.h +Index: linux-2.6.5/include/linux/mtd/map.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/linux/mtd/map.h 2004-04-03 22:36:56.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/map.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/include/linux/mtd/map.h 2004-04-03 22:36:56.000000000 -0500 ++++ linux-2.6.5/include/linux/mtd/map.h 2005-02-01 17:11:17.000000000 -0500 @@ -1,6 +1,6 @@ /* Overhauled routines for dealing with different mmap regions of flash */ @@ -36747,10 +33270,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/map.h #define map_is_linear(map) (1) #endif /* !CONFIG_MTD_COMPLEX_MAPPINGS */ -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/mtd.h +Index: linux-2.6.5/include/linux/mtd/mtd.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/linux/mtd/mtd.h 2004-11-11 10:28:27.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/mtd.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/include/linux/mtd/mtd.h 2005-02-01 16:55:50.000000000 -0500 ++++ linux-2.6.5/include/linux/mtd/mtd.h 2005-02-01 17:11:17.000000000 -0500 @@ -1,10 +1,17 @@ - -/* $Id: mtd.h,v 1.45 2003/05/20 21:56:40 dwmw2 Exp $ */ @@ -36976,10 +33499,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/mtd.h -#endif /* __KERNEL__ */ - #endif /* __MTD_MTD_H__ */ -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/nand.h +Index: linux-2.6.5/include/linux/mtd/nand.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/linux/mtd/nand.h 2004-04-03 22:38:14.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/nand.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/include/linux/mtd/nand.h 2004-04-03 22:38:14.000000000 -0500 ++++ linux-2.6.5/include/linux/mtd/nand.h 2005-02-01 17:11:17.000000000 -0500 @@ -5,7 +5,7 @@ * Steven J. Hill * Thomas Gleixner @@ -37485,10 +34008,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/nand.h +#define NAND_LARGE_BADBLOCK_POS 0 #endif /* __LINUX_MTD_NAND_H */ -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/nand_ecc.h +Index: linux-2.6.5/include/linux/mtd/nand_ecc.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/linux/mtd/nand_ecc.h 2004-04-03 22:37:07.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/nand_ecc.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/include/linux/mtd/nand_ecc.h 2004-04-03 22:37:07.000000000 -0500 ++++ linux-2.6.5/include/linux/mtd/nand_ecc.h 2005-02-01 17:11:17.000000000 -0500 @@ -3,7 +3,7 @@ * * Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com) @@ -37524,10 +34047,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/nand_ecc. +int nand_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc); + +#endif /* __MTD_NAND_ECC_H__ */ -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/nftl.h +Index: linux-2.6.5/include/linux/mtd/nftl.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/linux/mtd/nftl.h 2004-04-03 22:37:43.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/nftl.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/include/linux/mtd/nftl.h 2004-04-03 22:37:43.000000000 -0500 ++++ linux-2.6.5/include/linux/mtd/nftl.h 2005-02-01 17:11:17.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Id: nftl.h,v 1.13 2003/05/23 11:25:02 dwmw2 Exp $ @@ -37623,10 +34146,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/nftl.h -#endif /* __KERNEL__ */ - #endif /* __MTD_NFTL_H__ */ -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/partitions.h +Index: linux-2.6.5/include/linux/mtd/partitions.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/linux/mtd/partitions.h 2004-04-03 22:38:16.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/partitions.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/include/linux/mtd/partitions.h 2004-04-03 22:38:16.000000000 -0500 ++++ linux-2.6.5/include/linux/mtd/partitions.h 2005-02-01 17:11:17.000000000 -0500 @@ -5,7 +5,7 @@ * * This code is GPL @@ -37645,10 +34168,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/partition int del_mtd_partitions(struct mtd_info *); /* -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/physmap.h +Index: linux-2.6.5/include/linux/mtd/physmap.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/linux/mtd/physmap.h 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/physmap.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/include/linux/mtd/physmap.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/include/linux/mtd/physmap.h 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,61 @@ +/* + * For boards with physically mapped flash and using @@ -37711,10 +34234,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/mtd/physmap.h + +#endif /* __LINUX_MTD_PHYSMAP__ */ + -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/rslib.h +Index: linux-2.6.5/include/linux/rslib.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/linux/rslib.h 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/rslib.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/include/linux/rslib.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/include/linux/rslib.h 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,99 @@ +/* + * include/linux/rslib.h @@ -37815,10 +34338,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/rslib.h + +#endif + -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/mtd/inftl-user.h +Index: linux-2.6.5/include/mtd/inftl-user.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/mtd/inftl-user.h 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/mtd/inftl-user.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/include/mtd/inftl-user.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/include/mtd/inftl-user.h 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,91 @@ +/* + * $Id: inftl-user.h,v 1.1 2004/05/05 15:17:00 dwmw2 Exp $ @@ -37911,10 +34434,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/mtd/inftl-user.h +#endif /* __MTD_INFTL_USER_H__ */ + + -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/mtd/jffs2-user.h +Index: linux-2.6.5/include/mtd/jffs2-user.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/mtd/jffs2-user.h 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/mtd/jffs2-user.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/include/mtd/jffs2-user.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/include/mtd/jffs2-user.h 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,35 @@ +/* + * $Id: jffs2-user.h,v 1.1 2004/05/05 11:57:54 dwmw2 Exp $ @@ -37951,10 +34474,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/mtd/jffs2-user.h +#define jemode_to_cpu(x) (t32((x).m)) + +#endif /* __JFFS2_USER_H__ */ -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/mtd/mtd-abi.h +Index: linux-2.6.5/include/mtd/mtd-abi.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/mtd/mtd-abi.h 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/mtd/mtd-abi.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/include/mtd/mtd-abi.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/include/mtd/mtd-abi.h 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,102 @@ +/* + * $Id: mtd-abi.h,v 1.6 2004/08/09 13:38:30 dwmw2 Exp $ @@ -38058,10 +34581,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/mtd/mtd-abi.h +}; + +#endif /* __MTD_ABI_H__ */ -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/mtd/mtd-user.h +Index: linux-2.6.5/include/mtd/mtd-user.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/mtd/mtd-user.h 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/mtd/mtd-user.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/include/mtd/mtd-user.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/include/mtd/mtd-user.h 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,20 @@ +/* + * $Id: mtd-user.h,v 1.2 2004/05/05 14:44:57 dwmw2 Exp $ @@ -38083,10 +34606,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/mtd/mtd-user.h +typedef struct nand_oobinfo nand_oobinfo_t; + +#endif /* __MTD_USER_H__ */ -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/mtd/nftl-user.h +Index: linux-2.6.5/include/mtd/nftl-user.h =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/mtd/nftl-user.h 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/mtd/nftl-user.h 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/include/mtd/nftl-user.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/include/mtd/nftl-user.h 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,76 @@ +/* + * $Id: nftl-user.h,v 1.1 2004/05/05 14:44:57 dwmw2 Exp $ @@ -38164,10 +34687,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/mtd/nftl-user.h + + +#endif /* __MTD_NFTL_USER_H__ */ -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/lib/Kconfig +Index: linux-2.6.5/lib/Kconfig =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/lib/Kconfig 2004-11-11 10:27:14.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/lib/Kconfig 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/lib/Kconfig 2005-02-01 16:55:08.000000000 -0500 ++++ linux-2.6.5/lib/Kconfig 2005-02-01 17:11:17.000000000 -0500 @@ -24,5 +24,11 @@ config ZLIB_DEFLATE tristate @@ -38180,10 +34703,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/lib/Kconfig + endmenu -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/lib/Kconfig.orig +Index: linux-2.6.5/lib/Kconfig.orig =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/lib/Kconfig.orig 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/lib/Kconfig.orig 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/lib/Kconfig.orig 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/lib/Kconfig.orig 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,28 @@ +# +# Library configuration @@ -38213,10 +34736,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/lib/Kconfig.orig + +endmenu + -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/lib/Makefile +Index: linux-2.6.5/lib/Makefile =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/lib/Makefile 2004-11-11 10:28:34.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/lib/Makefile 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/lib/Makefile 2005-02-01 16:55:56.000000000 -0500 ++++ linux-2.6.5/lib/Makefile 2005-02-01 17:11:17.000000000 -0500 @@ -23,6 +23,7 @@ obj-$(CONFIG_ZLIB_INFLATE) += zlib_inflate/ @@ -38225,10 +34748,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/lib/Makefile host-progs := gen_crc32table clean-files := crc32table.h -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/lib/reed_solomon/Makefile +Index: linux-2.6.5/lib/reed_solomon/Makefile =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/lib/reed_solomon/Makefile 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/lib/reed_solomon/Makefile 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/lib/reed_solomon/Makefile 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/lib/reed_solomon/Makefile 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,6 @@ +# +# This is a modified version of reed solomon lib, @@ -38236,10 +34759,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/lib/reed_solomon/Makefile + +obj-$(CONFIG_REED_SOLOMON) += reed_solomon.o + -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/lib/reed_solomon/decode_rs.c +Index: linux-2.6.5/lib/reed_solomon/decode_rs.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/lib/reed_solomon/decode_rs.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/lib/reed_solomon/decode_rs.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/lib/reed_solomon/decode_rs.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/lib/reed_solomon/decode_rs.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,225 @@ +/* + * lib/reed_solomon/decode_rs.c @@ -38466,10 +34989,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/lib/reed_solomon/decode_rs. + return count; + +} -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/lib/reed_solomon/encode_rs.c +Index: linux-2.6.5/lib/reed_solomon/encode_rs.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/lib/reed_solomon/encode_rs.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/lib/reed_solomon/encode_rs.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/lib/reed_solomon/encode_rs.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/lib/reed_solomon/encode_rs.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,47 @@ +/* + * lib/reed_solomon/encode_rs.c @@ -38518,10 +35041,10 @@ Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/lib/reed_solomon/encode_rs. + } + return 0; +} -Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/lib/reed_solomon/rslib.c +Index: linux-2.6.5/lib/reed_solomon/rslib.c =================================================================== ---- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/lib/reed_solomon/rslib.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/lib/reed_solomon/rslib.c 2004-11-18 18:39:09.000000000 -0500 +--- linux-2.6.5.orig/lib/reed_solomon/rslib.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.5/lib/reed_solomon/rslib.c 2005-02-01 17:11:17.000000000 -0500 @@ -0,0 +1,366 @@ +/* + * lib/reed_solomon/lib_rs.c diff --git a/lustre/kernel_patches/targets/2.6-suse.target.in b/lustre/kernel_patches/targets/2.6-suse.target.in index 7f464ac..a228049 100644 --- a/lustre/kernel_patches/targets/2.6-suse.target.in +++ b/lustre/kernel_patches/targets/2.6-suse.target.in @@ -1,7 +1,7 @@ lnxmaj="2.6.5" -lnxrel="SLES9_SP1_20041111" +lnxrel="7.141" -KERNEL=linux-$lnxmaj-$lnxrel.tar.gz +KERNEL=linux-$lnxmaj-$lnxrel.tar.bz2 # they include our patches SERIES=2.6-suse-lnxi.series VERSION=$lnxmaj -- 1.8.3.1