[Top] [All Lists]

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

To: Josh Green <>
Subject: Re: Fixes to MTD flash driver on AMD Alchemy db1100 board
From: Pete Popov <>
Date: Sun, 20 Feb 2005 21:23:26 -0800
In-reply-to: <1108962105.6611.24.camel@SillyPuddy.localdomain>
Organization: Embedded Alley Solutions, Inc
Original-recipient: rfc822;
References: <1108962105.6611.24.camel@SillyPuddy.localdomain>
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913
Josh Green wrote:
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
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.

The latest mtd driver(s) are in the mtd tree and the db1x00 driver there should work. Ralf pulls the mtd code from and .. I'm not sure when and how the code gets in 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 I'm not sure what's the best way to maintain these drivers and avoid the confusion.


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 
--- a/include/asm-mips/mach-db1x00/db1x00.h     2005-02-20 20:30:51.710463936 
+++ b/include/asm-mips/mach-db1x00/db1x00.h     2005-02-20 20:31:00.671101712 
@@ -134,6 +134,14 @@
        ((((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
 /* SD controller macros */
  * Detect card.

<Prev in Thread] Current Thread [Next in Thread>