Merge git://git.infradead.org/mtd-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 21 May 2010 14:25:43 +0000 (07:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 21 May 2010 14:25:43 +0000 (07:25 -0700)
* git://git.infradead.org/mtd-2.6: (154 commits)
  mtd: cfi_cmdset_0002: use AMD standard command-set with Winbond flash chips
  mtd: cfi_cmdset_0002: Fix MODULE_ALIAS and linkage for new 0701 commandset ID
  mtd: mxc_nand: Remove duplicate NAND_CMD_RESET case value
  mtd: update gfp/slab.h includes
  jffs2: Stop triggering block erases from jffs2_write_super()
  jffs2: Rename jffs2_erase_pending_trigger() to jffs2_dirty_trigger()
  jffs2: Use jffs2_garbage_collect_trigger() to trigger pending erases
  jffs2: Require jffs2_garbage_collect_trigger() to be called with lock held
  jffs2: Wake GC thread when there are blocks to be erased
  jffs2: Erase pending blocks in GC pass, avoid invalid -EIO return
  jffs2: Add 'work_done' return value from jffs2_erase_pending_blocks()
  mtd: mtdchar: Do not corrupt backing device of device node inode
  mtd/maps/pcmciamtd: Fix printk format for ssize_t in debug messages
  drivers/mtd: Use kmemdup
  mtd: cfi_cmdset_0002: Fix argument order in bootloc warning
  mtd: nand: add Toshiba TC58NVG0 device ID
  pcmciamtd: add another ID
  pcmciamtd: coding style cleanups
  pcmciamtd: fixing obvious errors
  mtd: chips: add SST39WF160x NOR-flashes
  ...

Trivial conflicts due to dev_node removal in drivers/mtd/maps/pcmciamtd.c

1  2 
MAINTAINERS
arch/arm/mach-ep93xx/ts72xx.c
drivers/mtd/maps/pcmciamtd.c

diff --combined MAINTAINERS
@@@ -131,12 -131,19 +131,12 @@@ L:      netdev@vger.kernel.or
  S:    Maintained
  F:    drivers/net/typhoon*
  
 -3W-9XXX SATA-RAID CONTROLLER DRIVER
 -M:    Adam Radford <linuxraid@amcc.com>
 +3WARE SAS/SATA-RAID SCSI DRIVERS (3W-XXXX, 3W-9XXX, 3W-SAS)
 +M:    Adam Radford <linuxraid@lsi.com>
  L:    linux-scsi@vger.kernel.org
 -W:    http://www.amcc.com
 +W:    http://www.lsi.com
  S:    Supported
 -F:    drivers/scsi/3w-9xxx*
 -
 -3W-XXXX ATA-RAID CONTROLLER DRIVER
 -M:    Adam Radford <linuxraid@amcc.com>
 -L:    linux-scsi@vger.kernel.org
 -W:    http://www.amcc.com
 -S:    Supported
 -F:    drivers/scsi/3w-xxxx*
 +F:    drivers/scsi/3w-*
  
  53C700 AND 53C700-66 SCSI DRIVER
  M:    "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
@@@ -579,12 -586,6 +579,12 @@@ F:       drivers/mtd/nand/bcm_umi_bch.
  F:    drivers/mtd/nand/bcm_umi_hamming.c
  F:    drivers/mtd/nand/nand_bcm_umi.h
  
 +ARM/CAVIUM NETWORKS CNS3XXX MACHINE SUPPORT
 +M:    Anton Vorontsov <avorontsov@mvista.com>
 +S:    Maintained
 +F:    arch/arm/mach-cns3xxx/
 +T:    git git://git.infradead.org/users/cbou/linux-cns3xxx.git
 +
  ARM/CIRRUS LOGIC EP93XX ARM ARCHITECTURE
  M:    Hartley Sweeten <hsweeten@visionengravers.com>
  M:    Ryan Mallon <ryan@bluewatersys.com>
@@@ -774,10 -775,11 +774,10 @@@ M:      Philipp Zabel <philipp.zabel@gmail.c
  S:    Maintained
  
  ARM/Marvell Loki/Kirkwood/MV78xx0/Orion SOC support
 -M:    Lennert Buytenhek <buytenh@marvell.com>
 -M:    Nicolas Pitre <nico@marvell.com>
 +M:    Lennert Buytenhek <kernel@wantstofly.org>
 +M:    Nicolas Pitre <nico@fluxnic.net>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -T:    git git://git.marvell.com/orion
 -S:    Maintained
 +S:    Odd Fixes
  F:    arch/arm/mach-loki/
  F:    arch/arm/mach-kirkwood/
  F:    arch/arm/mach-mv78xx0/
@@@ -812,7 -814,6 +812,7 @@@ ARM/QUALCOMM MSM MACHINE SUPPOR
  M:    David Brown <davidb@codeaurora.org>
  M:    Daniel Walker <dwalker@codeaurora.org>
  M:    Bryan Huntsman <bryanh@codeaurora.org>
 +L:    linux-arm-msm@vger.kernel.org
  F:    arch/arm/mach-msm/
  F:    drivers/video/msm/
  F:    drivers/mmc/host/msm_sdcc.c
@@@ -993,20 -994,6 +993,20 @@@ W:       http://www.arm.linux.org.uk
  S:    Maintained
  F:    arch/arm/vfp/
  
 +ARM/VOIPAC PXA270 SUPPORT
 +M:    Marek Vasut <marek.vasut@gmail.com>
 +L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 +S:    Maintained
 +F:    arch/arm/mach-pxa/vpac270.c
 +F:    arch/arm/mach-pxa/include/mach-pxa/vpac270.h
 +
 +ARM/ZIPIT Z2 SUPPORT
 +M:    Marek Vasut <marek.vasut@gmail.com>
 +L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 +S:    Maintained
 +F:    arch/arm/mach-pxa/z2.c
 +F:    arch/arm/mach-pxa/include/mach-pxa/z2.h
 +
  ASC7621 HARDWARE MONITOR DRIVER
  M:    George Joseph <george.joseph@fairview5.com>
  L:    lm-sensors@lm-sensors.org
@@@ -1514,10 -1501,9 +1514,10 @@@ M:    Andy Whitcroft <apw@canonical.com
  S:    Supported
  F:    scripts/checkpatch.pl
  
 -CISCO 10G ETHERNET DRIVER
 +CISCO VIC ETHERNET NIC DRIVER
  M:    Scott Feldman <scofeldm@cisco.com>
 -M:    Joe Eykholt <jeykholt@cisco.com>
 +M:    Vasanthy Kolluri <vkolluri@cisco.com>
 +M:    Roopa Prabhu <roprabhu@cisco.com>
  S:    Supported
  F:    drivers/net/enic/
  
@@@ -1743,20 -1729,6 +1743,20 @@@ W:    http://www.openfabrics.or
  S:    Supported
  F:    drivers/infiniband/hw/cxgb3/
  
 +CXGB4 ETHERNET DRIVER (CXGB4)
 +M:    Dimitris Michailidis <dm@chelsio.com>
 +L:    netdev@vger.kernel.org
 +W:    http://www.chelsio.com
 +S:    Supported
 +F:    drivers/net/cxgb4/
 +
 +CXGB4 IWARP RNIC DRIVER (IW_CXGB4)
 +M:    Steve Wise <swise@chelsio.com>
 +L:    linux-rdma@vger.kernel.org
 +W:    http://www.openfabrics.org
 +S:    Supported
 +F:    drivers/infiniband/hw/cxgb4/
 +
  CYBERPRO FB DRIVER
  M:    Russell King <linux@arm.linux.org.uk>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -2695,12 -2667,16 +2695,12 @@@ F:   Documentation/timers/hpet.tx
  F:    drivers/char/hpet.c
  F:    include/linux/hpet.h
  
 -HPET: i386
 -M:    "Venkatesh Pallipadi (Venki)" <venkatesh.pallipadi@intel.com>
 +HPET: x86
 +M:    "Venkatesh Pallipadi (Venki)" <venki@google.com>
  S:    Maintained
  F:    arch/x86/kernel/hpet.c
  F:    arch/x86/include/asm/hpet.h
  
 -HPET: x86_64
 -M:    Vojtech Pavlik <vojtech@suse.cz>
 -S:    Maintained
 -
  HPET: ACPI
  M:    Bob Picco <bob.picco@hp.com>
  S:    Maintained
@@@ -2741,7 -2717,6 +2741,7 @@@ M:      "Ben Dooks (embedded platforms)" <be
  L:    linux-i2c@vger.kernel.org
  W:    http://i2c.wiki.kernel.org/
  T:    quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-i2c/
 +T:    git git://git.fluff.org/bjdooks/linux.git
  S:    Maintained
  F:    Documentation/i2c/
  F:    drivers/i2c/
@@@ -2978,17 -2953,6 +2978,17 @@@ S:    Odd Fixe
  F:    Documentation/networking/README.ipw2200
  F:    drivers/net/wireless/ipw2x00/ipw2200.*
  
 +INTEL(R) TRUSTED EXECUTION TECHNOLOGY (TXT)
 +M:    Joseph Cihula <joseph.cihula@intel.com>
 +M:    Shane Wang <shane.wang@intel.com>
 +L:    tboot-devel@lists.sourceforge.net
 +W:    http://tboot.sourceforge.net
 +T:    Mercurial http://www.bughost.org/repos.hg/tboot.hg
 +S:    Supported
 +F:    Documentation/intel_txt.txt
 +F:    include/linux/tboot.h
 +F:    arch/x86/kernel/tboot.c
 +
  INTEL WIRELESS WIMAX CONNECTION 2400
  M:    Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
  M:    linux-wimax@intel.com
@@@ -3038,9 -3002,10 +3038,9 @@@ F:     net/ipv4/netfilter/ipt_MASQUERADE.
  IP1000A 10/100/1000 GIGABIT ETHERNET DRIVER
  M:    Francois Romieu <romieu@fr.zoreil.com>
  M:    Sorbica Shieh <sorbica@icplus.com.tw>
 -M:    Jesse Huang <jesse@icplus.com.tw>
  L:    netdev@vger.kernel.org
  S:    Maintained
 -F:    drivers/net/ipg.c
 +F:    drivers/net/ipg.*
  
  IPATH DRIVER
  M:    Ralph Campbell <infinipath@qlogic.com>
@@@ -3659,8 -3624,7 +3659,8 @@@ F:      drivers/net/wireless/mwl8k.
  
  MARVELL SOC MMC/SD/SDIO CONTROLLER DRIVER
  M:    Nicolas Pitre <nico@fluxnic.net>
 -S:    Maintained
 +S:    Odd Fixes
 +F: drivers/mmc/host/mvsdio.*
  
  MARVELL YUKON / SYSKONNECT DRIVER
  M:    Mirko Lindner <mlindner@syskonnect.de>
@@@ -3888,6 -3852,7 +3888,6 @@@ M:      Ramkrishna Vepa <ram.vepa@neterion.c
  M:    Rastapur Santosh <santosh.rastapur@neterion.com>
  M:    Sivakumar Subramani <sivakumar.subramani@neterion.com>
  M:    Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
 -M:    Anil Murthy <anil.murthy@neterion.com>
  L:    netdev@vger.kernel.org
  W:    http://trac.neterion.com/cgi-bin/trac.cgi/wiki/Linux?Anonymous
  W:    http://trac.neterion.com/cgi-bin/trac.cgi/wiki/X3100Linux?Anonymous
@@@ -3992,7 -3957,6 +3992,7 @@@ F:      net/rfkill
  F:    net/wireless/
  F:    include/net/ieee80211*
  F:    include/linux/wireless.h
 +F:    include/linux/iw_handler.h
  F:    drivers/net/wireless/
  
  NETWORKING DRIVERS
@@@ -4201,7 -4165,6 +4201,7 @@@ OPROFIL
  M:    Robert Richter <robert.richter@amd.com>
  L:    oprofile-list@lists.sf.net
  S:    Maintained
 +F:    arch/*/include/asm/oprofile*.h
  F:    arch/*/oprofile/
  F:    drivers/oprofile/
  F:    include/linux/oprofile.h
@@@ -4390,13 -4353,13 +4390,13 @@@ M:   Paul Mackerras <paulus@samba.org
  M:    Ingo Molnar <mingo@elte.hu>
  M:    Arnaldo Carvalho de Melo <acme@redhat.com>
  S:    Supported
 -F:    kernel/perf_event.c
 +F:    kernel/perf_event*.c
  F:    include/linux/perf_event.h
 -F:    arch/*/kernel/perf_event.c
 -F:    arch/*/kernel/*/perf_event.c
 -F:    arch/*/kernel/*/*/perf_event.c
 +F:    arch/*/kernel/perf_event*.c
 +F:    arch/*/kernel/*/perf_event*.c
 +F:    arch/*/kernel/*/*/perf_event*.c
  F:    arch/*/include/asm/perf_event.h
 -F:    arch/*/lib/perf_event.c
 +F:    arch/*/lib/perf_event*.c
  F:    arch/*/kernel/perf_callchain.c
  F:    tools/perf/
  
@@@ -4614,14 -4577,6 +4614,14 @@@ S:    Supporte
  F:    Documentation/scsi/LICENSE.qla2xxx
  F:    drivers/scsi/qla2xxx/
  
 +QLOGIC QLA4XXX iSCSI DRIVER
 +M:    Ravi Anand <ravi.anand@qlogic.com>
 +M:    Vikas Chaudhary <vikas.chaudhary@qlogic.com>
 +M:    iscsi-driver@qlogic.com
 +L:    linux-scsi@vger.kernel.org
 +S:    Supported
 +F:    drivers/scsi/qla4xxx/
 +
  QLOGIC QLA3XXX NETWORK DRIVER
  M:    Ron Mercer <ron.mercer@qlogic.com>
  M:    linux-driver@qlogic.com
@@@ -4632,7 -4587,6 +4632,7 @@@ F:      drivers/net/qla3xxx.
  
  QLOGIC QLCNIC (1/10)Gb ETHERNET DRIVER
  M:    Amit Kumar Salecha <amit.salecha@qlogic.com>
 +M:    Anirban Chakraborty <anirban.chakraborty@qlogic.com>
  M:    linux-driver@qlogic.com
  L:    netdev@vger.kernel.org
  S:    Supported
@@@ -4762,6 -4716,12 +4762,12 @@@ S:    Maintaine
  F:    Documentation/rfkill.txt
  F:    net/rfkill/
  
+ RICOH SMARTMEDIA/XD DRIVER
+ M:    Maxim Levitsky <maximlevitsky@gmail.com>
+ S:    Maintained
+ F:    drivers/mtd/nand/r822.c
+ F:    drivers/mtd/nand/r822.h
  RISCOM8 DRIVER
  S:    Orphan
  F:    Documentation/serial/riscom8.txt
@@@ -5167,7 -5127,7 +5173,7 @@@ F:      mm/sl?b.
  
  SMC91x ETHERNET DRIVER
  M:    Nicolas Pitre <nico@fluxnic.net>
 -S:    Maintained
 +S:    Odd Fixes
  F:    drivers/net/smc91x.*
  
  SMSC47B397 HARDWARE MONITOR DRIVER
@@@ -5298,46 -5258,6 +5304,46 @@@ F:    drivers/serial/sunsu.
  F:    drivers/serial/sunzilog.c
  F:    drivers/serial/sunzilog.h
  
 +SPEAR PLATFORM SUPPORT
 +M:    Viresh Kumar <viresh.kumar@st.com>
 +W:    http://www.st.com/spear
 +S:    Maintained
 +F:    arch/arm/plat-spear/
 +
 +SPEAR3XX MACHINE SUPPORT
 +M:    Viresh Kumar <viresh.kumar@st.com>
 +W:    http://www.st.com/spear
 +S:    Maintained
 +F:    arch/arm/mach-spear3xx/
 +
 +SPEAR6XX MACHINE SUPPORT
 +M:    Rajeev Kumar <rajeev-dlh.kumar@st.com>
 +W:    http://www.st.com/spear
 +S:    Maintained
 +F:    arch/arm/mach-spear6xx/
 +
 +SPEAR CLOCK FRAMEWORK SUPPORT
 +M:    Viresh Kumar <viresh.kumar@st.com>
 +W:    http://www.st.com/spear
 +S:    Maintained
 +F:    arch/arm/mach-spear*/clock.c
 +F:    arch/arm/mach-spear*/include/mach/clkdev.h
 +F:    arch/arm/plat-spear/clock.c
 +F:    arch/arm/plat-spear/include/plat/clock.h and clkdev.h
 +
 +SPEAR PAD MULTIPLEXING SUPPORT
 +M:    Viresh Kumar <viresh.kumar@st.com>
 +W:    http://www.st.com/spear
 +S:    Maintained
 +F:    arch/arm/plat-spear/include/plat/padmux.h
 +F:    arch/arm/plat-spear/padmux.c
 +F:    arch/arm/mach-spear*/spear*xx.c
 +F:    arch/arm/mach-spear*/include/mach/generic.h
 +F:    arch/arm/mach-spear3xx/spear3*0.c
 +F:    arch/arm/mach-spear3xx/spear3*0_evb.c
 +F:    arch/arm/mach-spear6xx/spear600.c
 +F:    arch/arm/mach-spear6xx/spear600_evb.c
 +
  SPECIALIX IO8+ MULTIPORT SERIAL CARD DRIVER
  M:    Roger Wolff <R.E.Wolff@BitWizard.nl>
  S:    Supported
@@@ -5578,7 -5498,7 +5584,7 @@@ S:      Maintaine
  F:    drivers/mmc/host/tmio_mmc.*
  
  TMPFS (SHMEM FILESYSTEM)
 -M:    Hugh Dickins <hugh.dickins@tiscali.co.uk>
 +M:    Hugh Dickins <hughd@google.com>
  L:    linux-mm@kvack.org
  S:    Maintained
  F:    include/linux/shmem_fs.h
@@@ -5966,7 -5886,7 +5972,7 @@@ M:      Laurent Pinchart <laurent.pinchart@s
  L:    linux-uvc-devel@lists.berlios.de (subscribers-only)
  L:    linux-media@vger.kernel.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
 -W:    http://linux-uvc.berlios.de
 +W:    http://www.ideasonboard.org/uvc/
  S:    Maintained
  F:    drivers/media/video/uvc/
  
   * your option) any later version.
   */
  
+ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
  #include <linux/io.h>
  #include <linux/m48t86.h>
  #include <linux/mtd/physmap.h>
+ #include <linux/mtd/nand.h>
+ #include <linux/mtd/partitions.h>
  
  #include <mach/hardware.h>
  #include <mach/ts72xx.h>
@@@ -54,92 -58,162 +58,162 @@@ static struct map_desc ts72xx_io_desc[
        }
  };
  
- static struct map_desc ts72xx_nand_io_desc[] __initdata = {
-       {
-               .virtual        = TS72XX_NAND_DATA_VIRT_BASE,
-               .pfn            = __phys_to_pfn(TS72XX_NAND1_DATA_PHYS_BASE),
-               .length         = TS72XX_NAND_DATA_SIZE,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = TS72XX_NAND_CONTROL_VIRT_BASE,
-               .pfn            = __phys_to_pfn(TS72XX_NAND1_CONTROL_PHYS_BASE),
-               .length         = TS72XX_NAND_CONTROL_SIZE,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = TS72XX_NAND_BUSY_VIRT_BASE,
-               .pfn            = __phys_to_pfn(TS72XX_NAND1_BUSY_PHYS_BASE),
-               .length         = TS72XX_NAND_BUSY_SIZE,
-               .type           = MT_DEVICE,
+ static void __init ts72xx_map_io(void)
+ {
+       ep93xx_map_io();
+       iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
+ }
+ /*************************************************************************
+  * NAND flash
+  *************************************************************************/
+ #define TS72XX_NAND_CONTROL_ADDR_LINE 22      /* 0xN0400000 */
+ #define TS72XX_NAND_BUSY_ADDR_LINE    23      /* 0xN0800000 */
+ static void ts72xx_nand_hwcontrol(struct mtd_info *mtd,
+                                 int cmd, unsigned int ctrl)
+ {
+       struct nand_chip *chip = mtd->priv;
+       if (ctrl & NAND_CTRL_CHANGE) {
+               void __iomem *addr = chip->IO_ADDR_R;
+               unsigned char bits;
+               addr += (1 << TS72XX_NAND_CONTROL_ADDR_LINE);
+               bits = __raw_readb(addr) & ~0x07;
+               bits |= (ctrl & NAND_NCE) << 2; /* bit 0 -> bit 2 */
+               bits |= (ctrl & NAND_CLE);      /* bit 1 -> bit 1 */
+               bits |= (ctrl & NAND_ALE) >> 2; /* bit 2 -> bit 0 */
+               __raw_writeb(bits, addr);
        }
- };
  
- static struct map_desc ts72xx_alternate_nand_io_desc[] __initdata = {
+       if (cmd != NAND_CMD_NONE)
+               __raw_writeb(cmd, chip->IO_ADDR_W);
+ }
+ static int ts72xx_nand_device_ready(struct mtd_info *mtd)
+ {
+       struct nand_chip *chip = mtd->priv;
+       void __iomem *addr = chip->IO_ADDR_R;
+       addr += (1 << TS72XX_NAND_BUSY_ADDR_LINE);
+       return !!(__raw_readb(addr) & 0x20);
+ }
+ static const char *ts72xx_nand_part_probes[] = { "cmdlinepart", NULL };
+ #define TS72XX_BOOTROM_PART_SIZE      (SZ_16K)
+ #define TS72XX_REDBOOT_PART_SIZE      (SZ_2M + SZ_1M)
+ static struct mtd_partition ts72xx_nand_parts[] = {
        {
-               .virtual        = TS72XX_NAND_DATA_VIRT_BASE,
-               .pfn            = __phys_to_pfn(TS72XX_NAND2_DATA_PHYS_BASE),
-               .length         = TS72XX_NAND_DATA_SIZE,
-               .type           = MT_DEVICE,
+               .name           = "TS-BOOTROM",
+               .offset         = 0,
+               .size           = TS72XX_BOOTROM_PART_SIZE,
+               .mask_flags     = MTD_WRITEABLE,        /* force read-only */
        }, {
-               .virtual        = TS72XX_NAND_CONTROL_VIRT_BASE,
-               .pfn            = __phys_to_pfn(TS72XX_NAND2_CONTROL_PHYS_BASE),
-               .length         = TS72XX_NAND_CONTROL_SIZE,
-               .type           = MT_DEVICE,
+               .name           = "Linux",
+               .offset         = MTDPART_OFS_APPEND,
+               .size           = 0,                    /* filled in later */
        }, {
-               .virtual        = TS72XX_NAND_BUSY_VIRT_BASE,
-               .pfn            = __phys_to_pfn(TS72XX_NAND2_BUSY_PHYS_BASE),
-               .length         = TS72XX_NAND_BUSY_SIZE,
-               .type           = MT_DEVICE,
-       }
+               .name           = "RedBoot",
+               .offset         = MTDPART_OFS_APPEND,
+               .size           = MTDPART_SIZ_FULL,
+               .mask_flags     = MTD_WRITEABLE,        /* force read-only */
+       },
  };
  
- static void __init ts72xx_map_io(void)
+ static void ts72xx_nand_set_parts(uint64_t size,
+                                 struct platform_nand_chip *chip)
  {
-       ep93xx_map_io();
-       iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
-       /*
-        * The TS-7200 has NOR flash, the other models have NAND flash.
-        */
-       if (!board_is_ts7200()) {
-               if (is_ts9420_installed()) {
-                       iotable_init(ts72xx_alternate_nand_io_desc,
-                               ARRAY_SIZE(ts72xx_alternate_nand_io_desc));
-               } else {
-                       iotable_init(ts72xx_nand_io_desc,
-                               ARRAY_SIZE(ts72xx_nand_io_desc));
-               }
+       /* Factory TS-72xx boards only come with 32MiB or 128MiB NAND options */
+       if (size == SZ_32M || size == SZ_128M) {
+               /* Set the "Linux" partition size */
+               ts72xx_nand_parts[1].size = size - TS72XX_REDBOOT_PART_SIZE;
+               chip->partitions = ts72xx_nand_parts;
+               chip->nr_partitions = ARRAY_SIZE(ts72xx_nand_parts);
+       } else {
+               pr_warning("Unknown nand disk size:%lluMiB\n", size >> 20);
        }
  }
  
+ static struct platform_nand_data ts72xx_nand_data = {
+       .chip = {
+               .nr_chips       = 1,
+               .chip_offset    = 0,
+               .chip_delay     = 15,
+               .part_probe_types = ts72xx_nand_part_probes,
+               .set_parts      = ts72xx_nand_set_parts,
+       },
+       .ctrl = {
+               .cmd_ctrl       = ts72xx_nand_hwcontrol,
+               .dev_ready      = ts72xx_nand_device_ready,
+       },
+ };
+ static struct resource ts72xx_nand_resource[] = {
+       {
+               .start          = 0,                    /* filled in later */
+               .end            = 0,                    /* filled in later */
+               .flags          = IORESOURCE_MEM,
+       },
+ };
+ static struct platform_device ts72xx_nand_flash = {
+       .name                   = "gen_nand",
+       .id                     = -1,
+       .dev.platform_data      = &ts72xx_nand_data,
+       .resource               = ts72xx_nand_resource,
+       .num_resources          = ARRAY_SIZE(ts72xx_nand_resource),
+ };
  /*************************************************************************
   * NOR flash (TS-7200 only)
   *************************************************************************/
- static struct physmap_flash_data ts72xx_flash_data = {
+ static struct physmap_flash_data ts72xx_nor_data = {
        .width          = 2,
  };
  
- static struct resource ts72xx_flash_resource = {
+ static struct resource ts72xx_nor_resource = {
        .start          = EP93XX_CS6_PHYS_BASE,
        .end            = EP93XX_CS6_PHYS_BASE + SZ_16M - 1,
        .flags          = IORESOURCE_MEM,
  };
  
- static struct platform_device ts72xx_flash = {
-       .name           = "physmap-flash",
-       .id             = 0,
-       .dev            = {
-               .platform_data  = &ts72xx_flash_data,
-       },
-       .num_resources  = 1,
-       .resource       = &ts72xx_flash_resource,
+ static struct platform_device ts72xx_nor_flash = {
+       .name                   = "physmap-flash",
+       .id                     = 0,
+       .dev.platform_data      = &ts72xx_nor_data,
+       .resource               = &ts72xx_nor_resource,
+       .num_resources          = 1,
  };
  
  static void __init ts72xx_register_flash(void)
  {
-       if (board_is_ts7200())
-               platform_device_register(&ts72xx_flash);
+       if (board_is_ts7200()) {
+               platform_device_register(&ts72xx_nor_flash);
+       } else {
+               resource_size_t start;
+               if (is_ts9420_installed())
+                       start = EP93XX_CS7_PHYS_BASE;
+               else
+                       start = EP93XX_CS6_PHYS_BASE;
+               ts72xx_nand_resource[0].start = start;
+               ts72xx_nand_resource[0].end = start + SZ_16M - 1;
+               platform_device_register(&ts72xx_nand_flash);
+       }
  }
  
  static unsigned char ts72xx_rtc_readbyte(unsigned long addr)
  {
        __raw_writeb(addr, TS72XX_RTC_INDEX_VIRT_BASE);
@@@ -186,7 -260,7 +260,7 @@@ static struct platform_device ts72xx_wd
        .resource       = ts72xx_wdt_resources,
  };
  
 -static struct ep93xx_eth_data ts72xx_eth_data = {
 +static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
        .phy_id         = 1,
  };
  
@@@ -40,10 -40,7 +40,7 @@@ MODULE_PARM_DESC(debug, "Set Debug Leve
  static const int debug = 0;
  #endif
  
- #define err(format, arg...) printk(KERN_ERR "pcmciamtd: " format "\n" , ## arg)
  #define info(format, arg...) printk(KERN_INFO "pcmciamtd: " format "\n" , ## arg)
- #define warn(format, arg...) printk(KERN_WARNING "pcmciamtd: " format "\n" , ## arg)
  
  #define DRIVER_DESC   "PCMCIA Flash memory card driver"
  
@@@ -52,6 -49,7 +49,6 @@@
  
  struct pcmciamtd_dev {
        struct pcmcia_device    *p_dev;
 -      dev_node_t      node;           /* device node */
        caddr_t         win_base;       /* ioremapped address of PCMCIA window */
        unsigned int    win_size;       /* size of window */
        unsigned int    offset;         /* offset into card the window currently points at */
@@@ -99,7 -97,9 +96,9 @@@ module_param(mem_type, int, 0)
  MODULE_PARM_DESC(mem_type, "Set Memory type (0=Flash, 1=RAM, 2=ROM, default=0)");
  
  
- /* read/write{8,16} copy_{from,to} routines with window remapping to access whole card */
+ /* read/write{8,16} copy_{from,to} routines with window remapping
+  * to access whole card
+  */
  static caddr_t remap_window(struct map_info *map, unsigned long to)
  {
        struct pcmciamtd_dev *dev = (struct pcmciamtd_dev *)map->map_priv_1;
@@@ -136,7 -136,7 +135,7 @@@ static map_word pcmcia_read8_remap(stru
                return d;
  
        d.x[0] = readb(addr);
-       DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%02x", ofs, addr, d.x[0]);
+       DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%02lx", ofs, addr, d.x[0]);
        return d;
  }
  
@@@ -151,7 -151,7 +150,7 @@@ static map_word pcmcia_read16_remap(str
                return d;
  
        d.x[0] = readw(addr);
-       DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%04x", ofs, addr, d.x[0]);
+       DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%04lx", ofs, addr, d.x[0]);
        return d;
  }
  
@@@ -161,7 -161,7 +160,7 @@@ static void pcmcia_copy_from_remap(stru
        struct pcmciamtd_dev *dev = (struct pcmciamtd_dev *)map->map_priv_1;
        unsigned long win_size = dev->win_size;
  
-       DEBUG(3, "to = %p from = %lu len = %u", to, from, len);
+       DEBUG(3, "to = %p from = %lu len = %zd", to, from, len);
        while(len) {
                int toread = win_size - (from & (win_size-1));
                caddr_t addr;
@@@ -189,7 -189,7 +188,7 @@@ static void pcmcia_write8_remap(struct 
        if(!addr)
                return;
  
-       DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%02x", adr, addr, d.x[0]);
+       DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%02lx", adr, addr, d.x[0]);
        writeb(d.x[0], addr);
  }
  
@@@ -200,7 -200,7 +199,7 @@@ static void pcmcia_write16_remap(struc
        if(!addr)
                return;
  
-       DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%04x", adr, addr, d.x[0]);
+       DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%04lx", adr, addr, d.x[0]);
        writew(d.x[0], addr);
  }
  
@@@ -210,7 -210,7 +209,7 @@@ static void pcmcia_copy_to_remap(struc
        struct pcmciamtd_dev *dev = (struct pcmciamtd_dev *)map->map_priv_1;
        unsigned long win_size = dev->win_size;
  
-       DEBUG(3, "to = %lu from = %p len = %u", to, from, len);
+       DEBUG(3, "to = %lu from = %p len = %zd", to, from, len);
        while(len) {
                int towrite = win_size - (to & (win_size-1));
                caddr_t addr;
@@@ -244,7 -244,8 +243,8 @@@ static map_word pcmcia_read8(struct map
                return d;
  
        d.x[0] = readb(win_base + ofs);
-       DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%02x", ofs, win_base + ofs, d.x[0]);
+       DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%02lx",
+             ofs, win_base + ofs, d.x[0]);
        return d;
  }
  
@@@ -258,7 -259,8 +258,8 @@@ static map_word pcmcia_read16(struct ma
                return d;
  
        d.x[0] = readw(win_base + ofs);
-       DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%04x", ofs, win_base + ofs, d.x[0]);
+       DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%04lx",
+             ofs, win_base + ofs, d.x[0]);
        return d;
  }
  
@@@ -270,32 -272,34 +271,34 @@@ static void pcmcia_copy_from(struct map
        if(DEV_REMOVED(map))
                return;
  
-       DEBUG(3, "to = %p from = %lu len = %u", to, from, len);
+       DEBUG(3, "to = %p from = %lu len = %zd", to, from, len);
        memcpy_fromio(to, win_base + from, len);
  }
  
  
- static void pcmcia_write8(struct map_info *map, u8 d, unsigned long adr)
+ static void pcmcia_write8(struct map_info *map, map_word d, unsigned long adr)
  {
        caddr_t win_base = (caddr_t)map->map_priv_2;
  
        if(DEV_REMOVED(map))
                return;
  
-       DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%02x", adr, win_base + adr, d);
-       writeb(d, win_base + adr);
+       DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%02lx",
+             adr, win_base + adr, d.x[0]);
+       writeb(d.x[0], win_base + adr);
  }
  
  
- static void pcmcia_write16(struct map_info *map, u16 d, unsigned long adr)
+ static void pcmcia_write16(struct map_info *map, map_word d, unsigned long adr)
  {
        caddr_t win_base = (caddr_t)map->map_priv_2;
  
        if(DEV_REMOVED(map))
                return;
  
-       DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%04x", adr, win_base + adr, d);
-       writew(d, win_base + adr);
+       DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%04lx",
+             adr, win_base + adr, d.x[0]);
+       writew(d.x[0], win_base + adr);
  }
  
  
@@@ -306,7 -310,7 +309,7 @@@ static void pcmcia_copy_to(struct map_i
        if(DEV_REMOVED(map))
                return;
  
-       DEBUG(3, "to = %lu from = %p len = %u", to, from, len);
+       DEBUG(3, "to = %lu from = %p len = %zd", to, from, len);
        memcpy_toio(win_base + to, from, len);
  }
  
@@@ -375,7 -379,8 +378,8 @@@ static int pcmciamtd_cistpl_jedec(struc
        if (!pcmcia_parse_tuple(tuple, &parse)) {
                cistpl_jedec_t *t = &parse.jedec;
                for (i = 0; i < t->nid; i++)
-                       DEBUG(2, "JEDEC: 0x%02x 0x%02x", t->id[i].mfr, t->id[i].info);
+                       DEBUG(2, "JEDEC: 0x%02x 0x%02x",
+                             t->id[i].mfr, t->id[i].info);
        }
        return -ENOSPC;
  }
@@@ -431,7 -436,7 +435,7 @@@ static int pcmciamtd_cistpl_geo(struct 
  }
  
  
- static void card_settings(struct pcmciamtd_dev *dev, struct pcmcia_device *link, int *new_name)
+ static void card_settings(struct pcmciamtd_dev *dev, struct pcmcia_device *p_dev, int *new_name)
  {
        int i;
  
        }
  
        DEBUG(1, "Device: Size: %lu Width:%d Name: %s",
-             dev->pcmcia_map.size, dev->pcmcia_map.bankwidth << 3, dev->mtd_name);
+             dev->pcmcia_map.size,
+             dev->pcmcia_map.bankwidth << 3, dev->mtd_name);
  }
  
  
@@@ -489,7 -495,6 +494,6 @@@ static int pcmciamtd_config(struct pcmc
  {
        struct pcmciamtd_dev *dev = link->priv;
        struct mtd_info *mtd = NULL;
-       cs_status_t status;
        win_req_t req;
        int ret;
        int i;
        if(setvpp == 1)
                dev->pcmcia_map.set_vpp = pcmciamtd_set_vpp;
  
-       /* Request a memory window for PCMCIA. Some architeures can map windows upto the maximum
-          that PCMCIA can support (64MiB) - this is ideal and we aim for a window the size of the
-          whole card - otherwise we try smaller windows until we succeed */
+       /* Request a memory window for PCMCIA. Some architeures can map windows
+        * upto the maximum that PCMCIA can support (64MiB) - this is ideal and
+        * we aim for a window the size of the whole card - otherwise we try
+        * smaller windows until we succeed
+        */
  
        req.Attributes =  WIN_MEMORY_TYPE_CM | WIN_ENABLE;
        req.Attributes |= (dev->pcmcia_map.bankwidth == 1) ? WIN_DATA_WIDTH_8 : WIN_DATA_WIDTH_16;
        DEBUG(2, "dev->win_size = %d", dev->win_size);
  
        if(!dev->win_size) {
-               err("Cant allocate memory window");
+               dev_err(&dev->p_dev->dev, "Cannot allocate memory window\n");
                pcmciamtd_release(link);
                return -ENODEV;
        }
        DEBUG(2, "window handle = 0x%8.8lx", (unsigned long)link->win);
        dev->win_base = ioremap(req.Base, req.Size);
        if(!dev->win_base) {
-               err("ioremap(%lu, %u) failed", req.Base, req.Size);
+               dev_err(&dev->p_dev->dev, "ioremap(%lu, %u) failed\n",
+                       req.Base, req.Size);
                pcmciamtd_release(link);
                return -ENODEV;
        }
        dev->pcmcia_map.map_priv_1 = (unsigned long)dev;
        dev->pcmcia_map.map_priv_2 = (unsigned long)link->win;
  
-       dev->vpp = (vpp) ? vpp : link->socket.socket.Vpp;
+       dev->vpp = (vpp) ? vpp : link->socket->socket.Vpp;
        link->conf.Attributes = 0;
        if(setvpp == 2) {
                link->conf.Vpp = dev->vpp;
        }
  
        if(!mtd) {
-               DEBUG(1, "Cant find an MTD");
+               DEBUG(1, "Can not find an MTD");
                pcmciamtd_release(link);
                return -ENODEV;
        }
        if(new_name) {
                int size = 0;
                char unit = ' ';
-               /* Since we are using a default name, make it better by adding in the
-                  size */
+               /* Since we are using a default name, make it better by adding
+                * in the size
+                */
                if(mtd->size < 1048576) { /* <1MiB in size, show size in KiB */
                        size = mtd->size >> 10;
                        unit = 'K';
        if(add_mtd_device(mtd)) {
                map_destroy(mtd);
                dev->mtd_info = NULL;
-               err("Couldnt register MTD device");
+               dev_err(&dev->p_dev->dev,
+                       "Could not register the MTD device\n");
                pcmciamtd_release(link);
                return -ENODEV;
        }
-       info("mtd%d: %s", mtd->index, mtd->name);
 -      snprintf(dev->node.dev_name, sizeof(dev->node.dev_name), "mtd%d", mtd->index);
+       dev_info(&dev->p_dev->dev, "mtd%d: %s\n", mtd->index, mtd->name);
 -      link->dev_node = &dev->node;
        return 0;
  
-  failed:
-       err("CS Error, exiting");
+       dev_err(&dev->p_dev->dev, "CS Error, exiting\n");
        pcmciamtd_release(link);
        return -ENODEV;
  }
@@@ -689,8 -700,9 +697,9 @@@ static void pcmciamtd_detach(struct pcm
  
        if(dev->mtd_info) {
                del_mtd_device(dev->mtd_info);
+               dev_info(&dev->p_dev->dev, "mtd%d: Removing\n",
+                        dev->mtd_info->index);
                map_destroy(dev->mtd_info);
-               info("mtd%d: Removed", dev->mtd_info->index);
        }
  
        pcmciamtd_release(link);
@@@ -734,8 -746,11 +743,11 @@@ static struct pcmcia_device_id pcmciamt
        PCMCIA_DEVICE_PROD_ID12("intel", "VALUE SERIES 100 ", 0x40ade711, 0xdf8506d8),
        PCMCIA_DEVICE_PROD_ID12("KINGMAX TECHNOLOGY INC.", "SRAM 256K Bytes", 0x54d0c69c, 0xad12c29c),
        PCMCIA_DEVICE_PROD_ID12("Maxtor", "MAXFL MobileMax Flash Memory Card", 0xb68968c8, 0x2dfb47b0),
+       PCMCIA_DEVICE_PROD_ID123("M-Systems", "M-SYS Flash Memory Card", "(c) M-Systems", 0x7ed2ad87, 0x675dc3fb, 0x7aef3965),
+       PCMCIA_DEVICE_PROD_ID12("PRETEC", "  2MB SRAM CARD", 0xebf91155, 0x805360ca),
        PCMCIA_DEVICE_PROD_ID12("SEIKO EPSON", "WWB101EN20", 0xf9876baf, 0xad0b207b),
        PCMCIA_DEVICE_PROD_ID12("SEIKO EPSON", "WWB513EN20", 0xf9876baf, 0xe8d884ad),
+       PCMCIA_DEVICE_PROD_ID12("SMART Modular Technologies", " 4MB FLASH Card", 0x96fd8277, 0x737a5b05),
        PCMCIA_DEVICE_PROD_ID12("Starfish, Inc.", "REX-3000", 0x05ddca47, 0xe7d67bca),
        PCMCIA_DEVICE_PROD_ID12("Starfish, Inc.", "REX-4100", 0x05ddca47, 0x7bc32944),
        /* the following was commented out in pcmcia-cs-3.2.7 */