Subject: Fixes to MTD flash driver on AMD Alchemy db1100 board

From: Josh Green <[email-masked]>
Date: Sun, 20 Feb 2005 21:01:45 -0800

Hello, I found a couple compile problems with the
drivers/mtd/maps/db1x00-flash.c MTD driver.  I'm using linux-mips CVS
from a few weeks back, corresponding to 2.6.11rc2.  I noticed some
recent CVS traffic in regards to this driver, but I didn't see them in
cvsweb on the linux-mips site.  My apologies if this is something that
has already been reported.  Fixes in the patch below:

- Specify proper paths for #include of au1000.h and db1x00.h
- Cast return value of ioremap to (void __iomem *) to get rid of warning
concerning conversion of integer to pointer
- Setup DB1X00_BOTH_BANKS, DB1X00_BOOT_ONLY, and DB1X00_USER_ONLY
defines in db1x00.h (used pb1550.h as an example) since they seemed to
be missing which was causing the following to be triggered:

#error MTD_DB1X00 define combo error /* should never happen */

I can see the partitions in /dev/mtd now, but I have not thoroughly
tested it yet to see if there are any other problems.

Best regards,
	Josh Green

---------------

diff -ruN a/drivers/mtd/maps/db1x00-flash.c b/drivers/mtd/maps/db1x00-flash.c
--- a/drivers/mtd/maps/db1x00-flash.c	2005-02-20 20:29:30.268844944 -0800
+++ b/drivers/mtd/maps/db1x00-flash.c	2005-02-20 20:29:36.025969728 -0800
@@ -18,8 +18,8 @@
 #include <linux/mtd/partitions.h>
 
 #include <asm/io.h>
-#include <asm/au1000.h>
-#include <asm/db1x00.h>
+#include <asm/mach-au1x00/au1000.h>
+#include <asm/mach-db1x00/db1x00.h>
 
 #ifdef 	DEBUG_RW
 #define	DBG(x...)	printk(x)
@@ -192,7 +192,7 @@
 	 */
 	printk(KERN_NOTICE "Db1xxx flash: probing %d-bit flash bus\n", 
 			db1xxx_mtd_map.bankwidth*8);
-	db1xxx_mtd_map.virt = (unsigned long)ioremap(window_addr, window_size);
+	db1xxx_mtd_map.virt = (void __iomem *)ioremap(window_addr, window_size);
 	db1xxx_mtd = do_map_probe("cfi_probe", &db1xxx_mtd_map);
 	if (!db1xxx_mtd) return -ENXIO;
 	db1xxx_mtd->owner = THIS_MODULE;
diff -ruN a/include/asm-mips/mach-db1x00/db1x00.h b/include/asm-mips/mach-db1x00/db1x00.h
--- a/include/asm-mips/mach-db1x00/db1x00.h	2005-02-20 20:30:51.710463936 -0800
+++ b/include/asm-mips/mach-db1x00/db1x00.h	2005-02-20 20:31:00.671101712 -0800
@@ -134,6 +134,14 @@
 #define SET_VCC_VPP(VCC, VPP, SLOT)\
 	((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8))
 
+#if defined(CONFIG_MTD_DB1X00_BOOT) && defined(CONFIG_MTD_DB1X00_USER)
+#define DB1X00_BOTH_BANKS
+#elif defined(CONFIG_MTD_DB1X00_BOOT) && !defined(CONFIG_MTD_DB1X00_USER)
+#define DB1X00_BOOT_ONLY
+#elif !defined(CONFIG_MTD_DB1X00_BOOT) && defined(CONFIG_MTD_DB1X00_USER)
+#define DB1X00_USER_ONLY
+#endif
+
 /* SD controller macros */
 /*
  * Detect card.

---

From: Pete Popov <[email-masked]>
Date: Sun, 20 Feb 2005 21:23:26 -0800

> tested it yet to see if there are any other problems.

The latest mtd driver(s) are in the mtd tree and the db1x00 driver 
there should work. Ralf pulls the mtd code from kernel.org and .. 
I'm not sure when and how the code gets in kernel.org. The problem 
is that if I pull from the mtd tree and push the latest drivers in 
linux-mips, they'll still get overwritten with the code from 
kernel.org. I'm not sure what's the best way to maintain these 
drivers and avoid the confusion.

Pete

---

From: Ulrich Eckhardt <[email-masked]>
Date: Mon, 21 Feb 2005 11:44:58 +0100

Josh Green wrote:
> has already been reported.  

Even if reported, it hasn't been fixed - I have similar problems.

> concerning conversion of integer to pointer

This one needs further inspection, I'd say. Grepping through the sources, I 
see that some platforms define ioremap to return 'void*' and some use 'void 
__iomem*'. The same class inconsistencies exist for iounmap(), I think the 
right thing is 'iounmap( void __iomem*)'.

I found a comment that the value returned from ioremap() is not to be used as 
a virtual address, so it can't be used directly anyway, so a  qualifier like 
volatile is not even necessary. The qualifier becomes necessary inside the 
functions that perform the actual IO like readb(), but everything outside 
should not even attempt to look at this pointer.
Yes, on MIPS it can be used as virtual address AFAICT, some (broken?) code 
might even do so. If that code then relies on the volatile qualifier it will 
break...

I went ahead and changed the functions in asm-mips/io.h, and my Au1100 board 
still seems to work as before. Several other architectures need these fixes, 
too, and several cases where the returnvalue of ioremap() or the parameter to 
iounmap() is cast falsely/unnecessarily are also present. 

Hacking on above stuff, I came across another thing that escapes me: inside 
functions like writes*() and reads*(), the the buffer to write to or read is 
taken as 'void*', then to be cast to 'volatile void*'. In the case of 
writes*(), IMHO the pointer should be const. In neither cases does it make 
sense to me to add the volatile to the pointer. What is the reason for this?

Disclaimer: I'm far from being a kernel expert, so if I'm talking crap 
somebody please enlighten me. I just looked at the code and saw what to me 
looked inconsistent.

> defines in db1x00.h (used pb1550.h as an example) 

I copied over the code from the db1x00.h of Linux 2.4 to achieve the same. 
However, I didn't put this in any header because its use is limited to just 
one file, AFAICT.
 Hmm, I just looked a bit further, and now I wonder why there are so many 
drivers for Au1xx0 based boards. pb1550-flash.c and db1550-flash.c are almost 
similar, including the comment about the file they are based on (look at it, 
seems like search&replace gone amok).
 I haven't looked too far into it, but I really wonder if not at least 
db1x00-flash.c and db1550-flash.c could be merged with pb1xxx-flash.c and 
pb1550-flash.c, if not even all four could be merged into a single driver. 
Point is that the main difference seem to be the memory layout of the flash, 
all the rest seems generic enough.

> tested it yet to see if there are any other problems.

Can you tell me how you created /dev/mtd? My version (Debian/x86) of MAKEDEV 
doesn't know these. Also, could you tell me how you configured your kernel? I 
have never seen an MTD working, so I don't even know if what I'm doing is 
supposed to work. :(

Uli

---

From: Josh Green <[email-masked]>
Date: Mon, 21 Feb 2005 15:57:55 -0800

> somebody please enlighten me. I just looked at the code and saw what to me 

I'm no kernel expert either, so no comments from me :)

> have never seen an MTD working, so I don't even know if what I'm doing is 

I used a CVS checkout of buildroot from linux-mips.org to build my
initial cross compile x86->mips tool chain and root file system.  I'm
now building most of the software separately (kernel, busybox, hostap,
wireless-tools, wavemon, pcmcia-cs, etc) since I've found it to be more
flexible.  So to answer your question, buildroot made the device files
for me.  You could easily create them though using mknod:

mknod /dev/mtdblock0 b 31 0
mknod /dev/mtdblock1 b 31 1
mknod /dev/mtdblock2 b 31 2
mknod /dev/mtdblock3 b 31 3

You could do the same for the mtd0-3 devices, although I don't have use
for them myself.  They are major 90, minor 0, 2, 4, 6 for mtd0,1,2,3
respectively.

Another note concerning the MTD stuff.  It did not work for me until I
enabled some chip drivers in the RAM/ROM/Flash chip drivers section,
specifically:
<*> Detect flash chips by Common Flash Interface (CFI) probe
<*> Support for AMD/Fujitsu flash chips

Some additional options I have enabled in the MTD section:
[*] MTD partitioning support
<*> MTD concatenating support  (I think this is might be needed for the
case where you enable both user and boot chips, but I wouldn't be
surprised if I'm wrong about that)
<*> Caching block device access to MTD devices

Once I had that enabled I now see the "user FS", "kernel", "yamon" MTD
partitions in the kernel dmesg output.

> Uli

I am now building a compressed kernel (using some patches I found from
Pete Popov in a mailing list archive here:
http://www.spinics.net/lists/mips/msg18196.html) and have successfully
flashed and booted it by copying it to the correct mtdblock device.

I've also got jffs2 working on the User FS partition, but I get a whole
bunch of errors when it boots (regardless it still seems to function).
I'll post these in another thread if I can't get it resolved.

Best regards,
	Josh Green

---

From: Josh Green <[email-masked]>
Date: Mon, 21 Feb 2005 22:06:52 -0800

> I'll post these in another thread if I can't get it resolved.

Just to complete this thread, I did figure out what my trouble was.  I
erroneously thought that I didn't need the mtd0-3 dev support, but I
ended up needing it for the flash_erase (sometimes called just "erase")
command, which was what I had to run before my jffs2 errors went away.
Things seem to be working fine now :)  Make sure to erase the partition
using the correct count, I had to do:

flash_erase /dev/mtd0 0 0xe0

The first parameter is the offset, the second is the number of "erase
size" blocks to erase (likely different for your case).  This can be
found from your total flash size divided by the erase size
(cat /proc/mtd for this info).  Gee, funny how things work when you do
it right :)  I must say documentation is lacking for the mtd tools
though, I had to look at the code, sheesh, ha ha.  Cheers.
	Josh Green

---

From: Pete Popov <[email-masked]>
Date: Mon, 21 Feb 2005 23:25:42 -0800

Here is a 2.6 patch that gets rid of all the Au1x mapping files and 
replaces them with a single file. The driver doesn't check for 
different flash densities supported by the Db1x  boards, but it 
turns out AMD always shipped the boards with a single configuration 
only. This file should work on all boards. And I think it should 
work with 2.4 as well, as long as the entire tree is patched. 
Though, I need to first update the 2.4 style Config.in in the mtd tree.

Pete

> though, I had to look at the code, sheesh, ha ha.  Cheers.

diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/configs/db1000_defconfig linux-2.6-dev/arch/mips/configs/db1000_defconfig
--- linux-2.6-orig/arch/mips/configs/db1000_defconfig	2005-01-30 21:44:53.000000000 -0800
+++ linux-2.6-dev/arch/mips/configs/db1000_defconfig	2005-02-21 22:27:29.000000000 -0800
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.11-rc2
-# Sun Jan 30 19:02:48 2005
+# Mon Feb 21 22:20:54 2005
 #
 CONFIG_MIPS=y
 
@@ -182,6 +182,7 @@
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 CONFIG_TRAD_SIGNALS=y
+# CONFIG_PM is not set
 
 #
 # Device Drivers
@@ -197,7 +198,67 @@
 #
 # Memory Technology Devices (MTD)
 #
-# CONFIG_MTD is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_CONCAT is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_ALCHEMY=y
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLKMTD is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+
+#
+# NAND Flash Device Drivers
+#
+# CONFIG_MTD_NAND is not set
 
 #
 # Parallel port support
@@ -486,7 +547,8 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-CONFIG_RTC=y
+# CONFIG_RTC is not set
+# CONFIG_GEN_RTC is not set
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 
@@ -634,6 +696,8 @@
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
 CONFIG_CRAMFS=m
 # CONFIG_VXFS_FS is not set
 # CONFIG_HPFS_FS is not set
diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/configs/db1100_defconfig linux-2.6-dev/arch/mips/configs/db1100_defconfig
--- linux-2.6-orig/arch/mips/configs/db1100_defconfig	2005-01-30 21:44:53.000000000 -0800
+++ linux-2.6-dev/arch/mips/configs/db1100_defconfig	2005-02-21 22:34:42.000000000 -0800
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.11-rc2
-# Sun Jan 30 19:02:50 2005
+# Mon Feb 21 22:33:43 2005
 #
 CONFIG_MIPS=y
 
@@ -146,7 +146,7 @@
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_CPU_HAS_PREFETCH=y
-# CONFIG_64BIT_PHYS_ADDR is not set
+CONFIG_64BIT_PHYS_ADDR=y
 # CONFIG_CPU_ADVANCED is not set
 CONFIG_CPU_HAS_LLSC=y
 CONFIG_CPU_HAS_SYNC=y
@@ -180,6 +180,7 @@
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 CONFIG_TRAD_SIGNALS=y
+# CONFIG_PM is not set
 
 #
 # Device Drivers
@@ -195,7 +196,67 @@
 #
 # Memory Technology Devices (MTD)
 #
-# CONFIG_MTD is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_CONCAT is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_ALCHEMY=y
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLKMTD is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+
+#
+# NAND Flash Device Drivers
+#
+# CONFIG_MTD_NAND is not set
 
 #
 # Parallel port support
@@ -481,7 +542,8 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-CONFIG_RTC=y
+# CONFIG_RTC is not set
+# CONFIG_GEN_RTC is not set
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 
@@ -629,6 +691,8 @@
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
 CONFIG_CRAMFS=m
 # CONFIG_VXFS_FS is not set
 # CONFIG_HPFS_FS is not set
diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/configs/db1500_defconfig linux-2.6-dev/arch/mips/configs/db1500_defconfig
--- linux-2.6-orig/arch/mips/configs/db1500_defconfig	2005-01-30 21:44:53.000000000 -0800
+++ linux-2.6-dev/arch/mips/configs/db1500_defconfig	2005-02-21 21:48:46.000000000 -0800
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.11-rc2
-# Sun Jan 30 19:02:54 2005
+# Mon Feb 21 21:33:53 2005
 #
 CONFIG_MIPS=y
 
@@ -104,7 +104,7 @@
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
-CONFIG_DMA_COHERENT=y
+CONFIG_DMA_NONCOHERENT=y
 CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y
 # CONFIG_CPU_BIG_ENDIAN is not set
 CONFIG_CPU_LITTLE_ENDIAN=y
@@ -190,6 +190,7 @@
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 CONFIG_TRAD_SIGNALS=y
+# CONFIG_PM is not set
 
 #
 # Device Drivers
@@ -253,9 +254,7 @@
 #
 # CONFIG_MTD_COMPLEX_MAPPINGS is not set
 # CONFIG_MTD_PHYSMAP is not set
-CONFIG_MTD_DB1X00=y
-CONFIG_MTD_DB1X00_BOOT=y
-CONFIG_MTD_DB1X00_USER=y
+CONFIG_MTD_ALCHEMY=y
 
 #
 # Self-contained MTD device drivers
@@ -617,7 +616,8 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-CONFIG_RTC=y
+# CONFIG_RTC is not set
+# CONFIG_GEN_RTC is not set
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/configs/db1550_defconfig linux-2.6-dev/arch/mips/configs/db1550_defconfig
--- linux-2.6-orig/arch/mips/configs/db1550_defconfig	2005-01-30 21:44:53.000000000 -0800
+++ linux-2.6-dev/arch/mips/configs/db1550_defconfig	2005-02-21 22:46:50.000000000 -0800
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.11-rc2
-# Sun Jan 30 19:02:57 2005
+# Mon Feb 21 22:40:28 2005
 #
 CONFIG_MIPS=y
 
@@ -104,7 +104,7 @@
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
-CONFIG_DMA_COHERENT=y
+CONFIG_DMA_NONCOHERENT=y
 CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y
 # CONFIG_CPU_BIG_ENDIAN is not set
 CONFIG_CPU_LITTLE_ENDIAN=y
@@ -190,6 +190,7 @@
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 CONFIG_TRAD_SIGNALS=y
+# CONFIG_PM is not set
 
 #
 # Device Drivers
@@ -252,9 +253,7 @@
 #
 # CONFIG_MTD_COMPLEX_MAPPINGS is not set
 # CONFIG_MTD_PHYSMAP is not set
-CONFIG_MTD_DB1550=y
-CONFIG_MTD_DB1550_BOOT=y
-CONFIG_MTD_DB1550_USER=y
+CONFIG_MTD_ALCHEMY=y
 
 #
 # Self-contained MTD device drivers
diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/configs/pb1100_defconfig linux-2.6-dev/arch/mips/configs/pb1100_defconfig
--- linux-2.6-orig/arch/mips/configs/pb1100_defconfig	2005-01-30 21:44:55.000000000 -0800
+++ linux-2.6-dev/arch/mips/configs/pb1100_defconfig	2005-02-21 22:00:40.000000000 -0800
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.11-rc2
-# Sun Jan 30 19:03:55 2005
+# Mon Feb 21 22:00:32 2005
 #
 CONFIG_MIPS=y
 
@@ -148,7 +148,7 @@
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_CPU_HAS_PREFETCH=y
-# CONFIG_64BIT_PHYS_ADDR is not set
+CONFIG_64BIT_PHYS_ADDR=y
 # CONFIG_CPU_ADVANCED is not set
 CONFIG_CPU_HAS_LLSC=y
 CONFIG_CPU_HAS_SYNC=y
@@ -184,6 +184,7 @@
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 CONFIG_TRAD_SIGNALS=y
+# CONFIG_PM is not set
 
 #
 # Device Drivers
@@ -246,9 +247,7 @@
 #
 # CONFIG_MTD_COMPLEX_MAPPINGS is not set
 # CONFIG_MTD_PHYSMAP is not set
-CONFIG_MTD_PB1100=y
-CONFIG_MTD_PB1500_BOOT=y
-CONFIG_MTD_PB1500_USER=y
+CONFIG_MTD_ALCHEMY=y
 
 #
 # Self-contained MTD device drivers
@@ -547,7 +546,8 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-CONFIG_RTC=y
+# CONFIG_RTC is not set
+# CONFIG_GEN_RTC is not set
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 
diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/configs/pb1500_defconfig linux-2.6-dev/arch/mips/configs/pb1500_defconfig
--- linux-2.6-orig/arch/mips/configs/pb1500_defconfig	2005-01-30 21:44:55.000000000 -0800
+++ linux-2.6-dev/arch/mips/configs/pb1500_defconfig	2005-02-21 22:11:42.000000000 -0800
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.11-rc2
-# Sun Jan 30 19:03:58 2005
+# Mon Feb 21 22:05:25 2005
 #
 CONFIG_MIPS=y
 
@@ -104,7 +104,7 @@
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
-CONFIG_DMA_COHERENT=y
+CONFIG_DMA_NONCOHERENT=y
 # CONFIG_CPU_BIG_ENDIAN is not set
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
@@ -191,6 +191,7 @@
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 CONFIG_TRAD_SIGNALS=y
+# CONFIG_PM is not set
 
 #
 # Device Drivers
@@ -206,7 +207,68 @@
 #
 # Memory Technology Devices (MTD)
 #
-# CONFIG_MTD is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_CONCAT is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_ALCHEMY=y
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLKMTD is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+
+#
+# NAND Flash Device Drivers
+#
+# CONFIG_MTD_NAND is not set
 
 #
 # Parallel port support
@@ -726,6 +788,8 @@
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
 CONFIG_CRAMFS=m
 # CONFIG_VXFS_FS is not set
 # CONFIG_HPFS_FS is not set
diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/configs/pb1550_defconfig linux-2.6-dev/arch/mips/configs/pb1550_defconfig
--- linux-2.6-orig/arch/mips/configs/pb1550_defconfig	2005-01-30 21:44:55.000000000 -0800
+++ linux-2.6-dev/arch/mips/configs/pb1550_defconfig	2005-02-21 22:19:48.000000000 -0800
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.11-rc2
-# Sun Jan 30 19:04:01 2005
+# Mon Feb 21 22:19:39 2005
 #
 CONFIG_MIPS=y
 
@@ -104,7 +104,7 @@
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
-CONFIG_DMA_COHERENT=y
+CONFIG_DMA_NONCOHERENT=y
 CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y
 # CONFIG_CPU_BIG_ENDIAN is not set
 CONFIG_CPU_LITTLE_ENDIAN=y
@@ -191,6 +191,7 @@
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 CONFIG_TRAD_SIGNALS=y
+# CONFIG_PM is not set
 
 #
 # Device Drivers
@@ -206,7 +207,68 @@
 #
 # Memory Technology Devices (MTD)
 #
-# CONFIG_MTD is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_CONCAT is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_ALCHEMY=y
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLKMTD is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+
+#
+# NAND Flash Device Drivers
+#
+# CONFIG_MTD_NAND is not set
 
 #
 # Parallel port support
@@ -718,6 +780,8 @@
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
 CONFIG_CRAMFS=m
 # CONFIG_VXFS_FS is not set
 # CONFIG_HPFS_FS is not set
diff -Naur --exclude=CVS linux-2.6-orig/drivers/mtd/maps/alchemy-flash.c linux-2.6-dev/drivers/mtd/maps/alchemy-flash.c
--- linux-2.6-orig/drivers/mtd/maps/alchemy-flash.c	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6-dev/drivers/mtd/maps/alchemy-flash.c	2005-02-21 21:35:35.000000000 -0800
@@ -0,0 +1,189 @@
+/*
+ * Flash memory access on AMD Alchemy evaluation boards
+ * 
+ * $Id: alchey-flash.c,v 1.0 2004/11/04 13:24:14 gleixner Exp $
+ *
+ * (C) 2003, 2004 Pete Popov <[email-masked]>
+ * 
+ */
+
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/map.h>
+#include <linux/mtd/partitions.h>
+
+#include <asm/io.h>
+
+#ifdef 	DEBUG_RW
+#define	DBG(x...)	printk(x)
+#else
+#define	DBG(x...)	
+#endif
+
+#ifdef CONFIG_MIPS_PB1000
+#define BOARD_MAP_NAME "Pb1000 Flash"
+#define BOARD_FLASH_SIZE 0x00800000 /* 8MB */
+#define BOARD_FLASH_WIDTH 4 /* 32-bits */
+#endif
+
+#ifdef CONFIG_MIPS_PB1500
+#define BOARD_MAP_NAME "Pb1500 Flash"
+#define BOARD_FLASH_SIZE 0x04000000 /* 64MB */
+#define BOARD_FLASH_WIDTH 4 /* 32-bits */
+#endif
+
+#ifdef CONFIG_MIPS_PB1100
+#define BOARD_MAP_NAME "Pb1100 Flash"
+#define BOARD_FLASH_SIZE 0x04000000 /* 64MB */
+#define BOARD_FLASH_WIDTH 4 /* 32-bits */
+#endif
+
+#ifdef CONFIG_MIPS_PB1550
+#define BOARD_MAP_NAME "Pb1550 Flash"
+#define BOARD_FLASH_SIZE 0x08000000 /* 128MB */
+#define BOARD_FLASH_WIDTH 4 /* 32-bits */
+#endif
+
+#ifdef CONFIG_MIPS_PB1200
+#define BOARD_MAP_NAME "Pb1200 Flash"
+#define BOARD_FLASH_SIZE 0x08000000 /* 128MB */
+#define BOARD_FLASH_WIDTH 2 /* 16-bits */
+#endif
+
+#ifdef CONFIG_MIPS_DB1000
+#define BOARD_MAP_NAME "Db1000 Flash"
+#define BOARD_FLASH_SIZE 0x02000000 /* 32MB */
+#define BOARD_FLASH_WIDTH 4 /* 32-bits */
+#endif
+
+#ifdef CONFIG_MIPS_DB1500
+#define BOARD_MAP_NAME "Db1500 Flash"
+#define BOARD_FLASH_SIZE 0x02000000 /* 32MB */
+#define BOARD_FLASH_WIDTH 4 /* 32-bits */
+#endif
+
+#ifdef CONFIG_MIPS_DB1100
+#define BOARD_MAP_NAME "Db1100 Flash"
+#define BOARD_FLASH_SIZE 0x02000000 /* 32MB */
+#define BOARD_FLASH_WIDTH 4 /* 32-bits */
+#endif
+
+#ifdef CONFIG_MIPS_DB1550
+#define BOARD_MAP_NAME "Db1550 Flash"
+#define BOARD_FLASH_SIZE 0x08000000 /* 128MB */
+#define BOARD_FLASH_WIDTH 4 /* 32-bits */
+#endif
+
+#ifdef CONFIG_MIPS_DB1200
+#define BOARD_MAP_NAME "Db1200 Flash"
+#define BOARD_FLASH_SIZE 0x04000000 /* 64MB */
+#define BOARD_FLASH_WIDTH 2 /* 16-bits */
+#endif
+
+#ifdef CONFIG_MIPS_HYDROGEN3
+#define BOARD_MAP_NAME "Hydrogen3 Flash"
+#define BOARD_FLASH_SIZE 0x02000000 /* 32MB */
+#define BOARD_FLASH_WIDTH 4 /* 32-bits */
+#define USE_LOCAL_ACCESSORS /* why? */
+#endif
+
+#ifdef CONFIG_MIPS_BOSPORUS
+#define BOARD_MAP_NAME "Bosporus Flash"
+#define BOARD_FLASH_SIZE 0x01000000 /* 16MB */
+#define BOARD_FLASH_WIDTH 2 /* 16-bits */
+#endif
+
+#ifdef CONFIG_MIPS_MIRAGE
+#define BOARD_MAP_NAME "Mirage Flash"
+#define BOARD_FLASH_SIZE 0x04000000 /* 64MB */
+#define BOARD_FLASH_WIDTH 4 /* 32-bits */
+#define USE_LOCAL_ACCESSORS /* why? */
+#endif
+
+static struct map_info alchemy_map = {
+	.name =	BOARD_MAP_NAME,
+};
+
+static struct mtd_partition alchemy_partitions[] = {
+        {
+                .name = "User FS",
+                .size = BOARD_FLASH_SIZE - 0x00400000,
+                .offset = 0x0000000
+        },{
+                .name = "YAMON",
+                .size = 0x0100000,
+		.offset = MTDPART_OFS_APPEND,
+                .mask_flags = MTD_WRITEABLE
+        },{
+                .name = "raw kernel",
+		.size = (0x300000 - 0x40000), /* last 256KB is yamon env */
+		.offset = MTDPART_OFS_APPEND,
+        }
+};
+
+#define NB_OF(x)  (sizeof(x)/sizeof(x[0]))
+
+static struct mtd_info *mymtd;
+
+int __init alchemy_mtd_init(void)
+{
+	struct mtd_partition *parts;
+	int nb_parts = 0;
+	unsigned long window_addr;
+	unsigned long window_size;
+	
+	/* Default flash buswidth */
+	alchemy_map.bankwidth = BOARD_FLASH_WIDTH;
+
+	window_addr = 0x20000000 - BOARD_FLASH_SIZE;
+	window_size = BOARD_FLASH_SIZE;
+#ifdef CONFIG_MIPS_MIRAGE_WHY
+	/* Boot ROM flash bank only; no user bank */
+	window_addr = 0x1C000000;
+	window_size = 0x04000000;
+	/* USERFS from 0x1C00 0000 to 0x1FC00000 */
+	alchemy_partitions[0].size = 0x03C00000;
+#endif
+
+	/*
+	 * Static partition definition selection
+	 */
+	parts = alchemy_partitions;
+	nb_parts = NB_OF(alchemy_partitions);
+	alchemy_map.size = window_size;
+
+	/*
+	 * Now let's probe for the actual flash.  Do it here since
+	 * specific machine settings might have been set above.
+	 */
+	printk(KERN_NOTICE BOARD_MAP_NAME ": probing %d-bit flash bus\n", 
+			alchemy_map.bankwidth*8);
+	alchemy_map.virt = ioremap(window_addr, window_size);
+	mymtd = do_map_probe("cfi_probe", &alchemy_map);
+	if (!mymtd) return -ENXIO;
+	mymtd->owner = THIS_MODULE;
+
+	add_mtd_partitions(mymtd, parts, nb_parts);
+	return 0;
+}
+
+static void __exit alchemy_mtd_cleanup(void)
+{
+	if (mymtd) {
+		del_mtd_partitions(mymtd);
+		map_destroy(mymtd);
+		iounmap((void *) alchemy_map.virt);
+	}
+}
+
+module_init(alchemy_mtd_init);
+module_exit(alchemy_mtd_cleanup);
+
+MODULE_AUTHOR("Embedded Alley Solutions, Inc");
+MODULE_DESCRIPTION(BOARD_MAP_NAME " MTD driver");
+MODULE_LICENSE("GPL");
diff -Naur --exclude=CVS linux-2.6-orig/drivers/mtd/maps/Kconfig linux-2.6-dev/drivers/mtd/maps/Kconfig
--- linux-2.6-orig/drivers/mtd/maps/Kconfig	2005-01-30 21:45:19.000000000 -0800
+++ linux-2.6-dev/drivers/mtd/maps/Kconfig	2005-02-21 22:13:00.000000000 -0800
@@ -207,52 +207,6 @@
 	help
 	  Support for flash chips on NETtel/SecureEdge/SnapGear boards.
 
-config MTD_PB1550
-	tristate "Flash devices on Alchemy PB1550 board"
-	depends on MIPS && MIPS_PB1550
-	help
-	  Flash memory access on Alchemy Pb1550 board
-
-config MTD_PB1550_BOOT
-	bool "PB1550 boot flash device"
-	depends on MTD_PB1550
-	help
-	  Use the first of the two 64MiB flash banks on Pb1550 board.
-	  You can say 'Y' to both this and 'MTD_PB1550_USER' below, to use
-	  both banks.
-
-config MTD_PB1550_USER
-	bool "PB1550 user flash device"
-	depends on MTD_PB1550
-	default y if MTD_PB1550_BOOT = n
-	help
-	  Use the second of the two 64MiB flash banks on Pb1550 board.
-	  You can say 'Y' to both this and 'MTD_PB1550_BOOT' above, to use
-	  both banks.
-
-config MTD_DB1550
-	tristate "Flash devices on Alchemy DB1550 board"
-	depends on MIPS && MIPS_DB1550
-	help
-	  Flash memory access on Alchemy Db1550 board
-
-config MTD_DB1550_BOOT
-	bool "DB1550 boot flash device"
-	depends on MTD_DB1550
-	help
-	  Use the first of the two 64MiB flash banks on Db1550 board.
-	  You can say 'Y' to both this and 'MTD_DB1550_USER' below, to use
-	  both banks.
-
-config MTD_DB1550_USER
-	bool "DB1550 user flash device"
-	depends on MTD_DB1550
-	default y if MTD_DB1550_BOOT = n
-	help
-	  Use the second of the two 64MiB flash banks on Db1550 board.
-	  You can say 'Y' to both this and 'MTD_DB1550_BOOT' above, to use
-	  both banks.
-
 config MTD_DILNETPC
 	tristate "CFI Flash device mapped on DIL/Net PC"
 	depends on X86 && MTD_CONCAT && MTD_PARTITIONS && MTD_CFI_INTELEXT
@@ -328,67 +282,11 @@
 	  Mapping for the Flaga digital module. If you don't have one, ignore
 	  this setting.
 
-config MTD_PB1000
-	tristate "Pb1000 Boot Flash device"
-	depends on MIPS && MIPS_PB1000
-	help
-	  Flash memory access on Alchemy Pb1000
-
-config MTD_PB1100
-	tristate "Pb1100 Flash device"
-	depends on MIPS && MIPS_PB1100
-	help
-	  Flash memory access on Alchemy Pb1100
-
-config MTD_PB1500
-	tristate "Pb1500 Flash device"
-	depends on MIPS && MIPS_PB1500
-	help
-	  Flash memory access on Alchemy Pb1500
-
-config MTD_PB1500_BOOT
-	bool "Pb1100/Pb1500 Boot Flash device"
-	depends on MIPS && (MTD_PB1500 || MTD_PB1100)
-	help
-	  Use the first of the two 32MB flash banks on Pb1100/Pb1500 board.
-	  You can say 'Y' to both this and the USER flash option, to use
-	  both banks.
-
-config MTD_PB1500_USER
-	bool "Pb1100/Pb1500 User Flash device (2nd 32MB bank)"
-	depends on MIPS && (MTD_PB1500 || MTD_PB1100)
-	help
-	  Use the second of the two 32MB flash banks on Pb1100/Pb1500 board.
-	  You can say 'Y' to both this and the BOOT flash option, to use
-	  both banks.
-
-config MTD_DB1X00
-	tristate "Db1X00 Flash device"
-	depends on MIPS && (MIPS_DB1000 || MIPS_DB1100 || MIPS_DB1500)
-	help
-	  Flash memory access on Alchemy Db1X00 Boards
-
-config MTD_DB1X00_BOOT
-	bool "Db1X00 Boot Flash device"
-	depends on MIPS && MTD_DB1X00
-	help
-	  Use the first of the two 32MB flash banks on Db1X00 board.
-	  You can say 'Y' to both this and the USER flash option, to use
-	  both banks.
-
-config MTD_DB1X00_USER
-	bool "Db1X00 User Flash device (2nd 32MB bank)"
-	depends on MIPS && MTD_DB1X00
-	help
-	  Use the second of the two 32MB flash banks on Db1X00 boards.
-	  You can say 'Y' to both this and the BOOT flash option, to use
-	  both banks.
-
-config MTD_BOSPORUS
-	tristate "Bosporus Flash device"
-	depends on MIPS && MIPS_BOSPORUS
+config MTD_ALCHEMY
+	tristate '  AMD Alchemy Pb1xxx/Db1xxx/RDK MTD support' 
+	depends on MIPS && SOC_AU1X00
 	help
-	  Flash memory access on Alchemy Bosporus Board
+	  Flash memory access on AMD Alchemy Pb/Db/RDK Reference Boards
 
 config MTD_XXS1500
 	tristate "MyCable XXS1500 Flash device"
diff -Naur --exclude=CVS linux-2.6-orig/drivers/mtd/maps/Makefile linux-2.6-dev/drivers/mtd/maps/Makefile
--- linux-2.6-orig/drivers/mtd/maps/Makefile	2005-01-17 21:23:31.000000000 -0800
+++ linux-2.6-dev/drivers/mtd/maps/Makefile	2005-02-21 21:17:59.000000000 -0800
@@ -69,7 +69,4 @@
 obj-$(CONFIG_MTD_IXP2000)	+= ixp2000.o
 obj-$(CONFIG_MTD_WRSBC8260)	+= wr_sbc82xx_flash.o
 obj-$(CONFIG_MTD_DMV182)	+= dmv182.o
-obj-$(CONFIG_MTD_PB1000)        += pb1xxx-flash.o
-obj-$(CONFIG_MTD_PB1100)        += pb1xxx-flash.o
-obj-$(CONFIG_MTD_PB1500)        += pb1xxx-flash.o
-obj-$(CONFIG_MTD_DB1X00)        += db1x00-flash.o
+obj-$(CONFIG_MTD_ALCHEMY)       += alchemy-flash.o

---

From: Ulrich Eckhardt <[email-masked]>
Date: Tue, 22 Feb 2005 16:32:53 +0100

Pete Popov wrote:
> replaces them with a single file. 

Big step forward, this looks much cleaner and easier to maintain!

Just a few nits:

1. mymtd = do_map_probe("cfi_probe", &alchemy_map);

Doesn't this mean that the Alchemy flash driver depends on the CFI interface? 
I also see that CONFIG_MTD_CFI is not set in the configfiles for some boards.

2. If above do_map_probe() returns NULL, the ioremap()ed memory is leaked. 
Doesn't matter that much probably, but is trivial to fix.

 if (!mymtd)
 {
  iounmap( alchemy_map.virt);
  return -ENXIO;
 }

3. No need to cast the parameter to iounmap(), it should happily digest 
whatever ioremap() returns. If that gives warnings, something different is 
going wrong in between. ;)

I finally figured out that my board is based largely on db1100, but the 
on-board flash in particular isn't, it's just one 16MBit chip on board. Also, 
the access width is 16 bit and not 32. Seems like I'm going to introduce 
another board type TTP1100...

One more question on the partition layout: is this a real hardware property or 
is this just convention? Can't I configure the flash as I want to?

I'm making progress, thank you all!

Uli

---

From: Pete Popov <[email-masked]>
Date: Sat, 26 Feb 2005 14:04:03 -0800

> going wrong in between. ;)

Thanks, I took care of all this. I removed the multiple drivers in 
favor of the single, simplied driver. I pushed the updates in 
linux-mips head, and the mtd community tree. To use these changes 
with linux-mips 2.4 branch, you have to patch-in the entire mtd 
tree. However, even then I had some compile problems that were not 
related to the changes I made, so I don't know if you can still use 
the latest mtd tree with a 2.4 kernel.

Pete