mtd/drivers/mtd/devices Config.in,1.9,1.10 Kconfig,1.1,1.2
Makefile.common,1.1,1.2 docprobe.c,1.35,1.36
David Woodhouse
dwmw2 at infradead.org
Fri May 23 07:29:37 EDT 2003
Update of /home/cvs/mtd/drivers/mtd/devices
In directory phoenix.infradead.org:/tmp/cvs-serv22251/drivers/mtd/devices
Modified Files:
Config.in Kconfig Makefile.common docprobe.c
Log Message:
Updates for new DiskOnChip Millennium Plus driver.
Index: Config.in
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/devices/Config.in,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Config.in 10 Feb 2003 12:28:13 -0000 1.9
+++ Config.in 23 May 2003 11:29:34 -0000 1.10
@@ -31,10 +31,11 @@
dep_tristate ' M-Systems Disk-On-Chip 1000' CONFIG_MTD_DOC1000 $CONFIG_MTD
dep_tristate ' M-Systems Disk-On-Chip 2000 and Millennium' CONFIG_MTD_DOC2000 $CONFIG_MTD
dep_tristate ' M-Systems Disk-On-Chip Millennium-only alternative driver (see help)' CONFIG_MTD_DOC2001 $CONFIG_MTD
- if [ "$CONFIG_MTD_DOC2001" = "y" -o "$CONFIG_MTD_DOC2000" = "y" ]; then
+ dep_tristate ' M-Systems Disk-On-Chip Millennium Plus driver (see help)' CONFIG_MTD_DOC2001PLUS $CONFIG_MTD
+ if [ "$CONFIG_MTD_DOC2001PLUS" = "y" -o "$CONFIG_MTD_DOC2001" = "y" -o "$CONFIG_MTD_DOC2000" = "y" ]; then
define_bool CONFIG_MTD_DOCPROBE y
else
- if [ "$CONFIG_MTD_DOC2001" = "m" -o "$CONFIG_MTD_DOC2000" = "m" ]; then
+ if [ "$CONFIG_MTD_DOC2001PLUS" = "m" -o "$CONFIG_MTD_DOC2001" = "m" -o "$CONFIG_MTD_DOC2000" = "m" ]; then
define_bool CONFIG_MTD_DOCPROBE m
else
define_bool CONFIG_MTD_DOCPROBE n
Index: Kconfig
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/devices/Kconfig,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Kconfig 26 Nov 2002 22:30:06 -0000 1.1
+++ Kconfig 23 May 2003 11:29:34 -0000 1.2
@@ -148,10 +148,26 @@
emulate a block device by using a kind of file system on the flash
chips.
+config MTD_DOC2001PLUS
+ tristate "M-Systems Disk-On-Chip Millennium-only alternative driver (see help)"
+ depends on MTD
+ ---help---
+ This provides an alternative MTD device driver for the M-Systems
+ DiskOnChip Millennium devices. Use this if you have problems with
+ the combined DiskOnChip 2000 and Millennium driver above. To get
+ the DiskOnChip probe code to load and use this driver instead of
+ the other one, you will need to undefine DOC_SINGLE_DRIVER near
+ the beginning of <file:drivers/mtd/devices/docprobe.c>.
+
+ If you use this device, you probably also want to enable the NFTL
+ 'NAND Flash Translation Layer' option below, which is used to
+ emulate a block device by using a kind of file system on the flash
+ chips.
+
config MTD_DOCPROBE
tristate
- default m if MTD_DOC2001!=y && MTD_DOC2000!=y && (MTD_DOC2001=m || MTD_DOC2000=m)
- default y if MTD_DOC2001=y || MTD_DOC2000=y
+ default m if MTD_DOC2001!=y && MTD_DOC2000!=y && MTD_DOC2001PLUS!=y && (MTD_DOC2001=m || MTD_DOC2000=m || MOD_DOC2001PLUS=m)
+ default y if MTD_DOC2001=y || MTD_DOC2000=y || MTD_DOC2001PLUS=y
help
This isn't a real config option, it's derived.
Index: Makefile.common
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/devices/Makefile.common,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Makefile.common 21 May 2003 15:00:02 -0000 1.1
+++ Makefile.common 23 May 2003 11:29:34 -0000 1.2
@@ -18,6 +18,7 @@
obj-$(CONFIG_MTD_DOC1000) += doc1000.o
obj-$(CONFIG_MTD_DOC2000) += doc2000.o
obj-$(CONFIG_MTD_DOC2001) += doc2001.o
+obj-$(CONFIG_MTD_DOC2001PLUS) += doc2001plus.o
obj-$(CONFIG_MTD_DOCPROBE) += docprobe.o docecc.o
obj-$(CONFIG_MTD_SLRAM) += slram.o
obj-$(CONFIG_MTD_PMC551) += pmc551.o
Index: docprobe.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/devices/docprobe.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- docprobe.c 21 May 2003 15:15:06 -0000 1.35
+++ docprobe.c 23 May 2003 11:29:34 -0000 1.36
@@ -31,14 +31,12 @@
/* DOC_SINGLE_DRIVER:
Millennium driver has been merged into DOC2000 driver.
- The newly-merged driver doesn't appear to work for writing. It's the
- same with the DiskOnChip 2000 and the Millennium. If you have a
- Millennium and you want write support to work, remove the definition
- of DOC_SINGLE_DRIVER below to use the old doc2001-specific driver.
-
- Otherwise, it's left on in the hope that it'll annoy someone with
- a Millennium enough that they go through and work out what the
- difference is :)
+ The old Millennium-only driver has been retained just in case there
+ are problems with the new code. If the combined driver doesn't work
+ for you, you can try the old one by undefining DOC_SINGLE_DRIVER
+ below and also enabling it in your configuration. If this fixes the
+ problems, please send a report to the MTD mailing list at
+ <linux-mtd at lists.infradead.org>.
*/
#define DOC_SINGLE_DRIVER
@@ -92,14 +90,14 @@
##else
#warning Unknown architecture for DiskOnChip. No default probe locations defined
#endif
- 0 };
+ 0xffffffff };
/* doccheck: Probe a given memory window to see if there's a DiskOnChip present */
static inline int __init doccheck(unsigned long potential, unsigned long physadr)
{
unsigned long window=potential;
- unsigned char tmp, ChipID;
+ unsigned char tmp, tmpb, tmpc, ChipID;
#ifndef DOC_PASSIVE_PROBE
unsigned char tmp2;
#endif
@@ -142,19 +140,65 @@
switch (ChipID) {
case DOC_ChipID_Doc2k:
/* Check the TOGGLE bit in the ECC register */
- tmp = ReadDOC(window, 2k_ECCStatus) & DOC_TOGGLE_BIT;
- if ((ReadDOC(window, 2k_ECCStatus) & DOC_TOGGLE_BIT) != tmp)
+ tmp = ReadDOC(window, 2k_ECCStatus) & DOC_TOGGLE_BIT;
+ tmpb = ReadDOC(window, 2k_ECCStatus) & DOC_TOGGLE_BIT;
+ tmpc = ReadDOC(window, 2k_ECCStatus) & DOC_TOGGLE_BIT;
+ if (tmp != tmpb && tmp == tmpc)
return ChipID;
break;
case DOC_ChipID_DocMil:
/* Check the TOGGLE bit in the ECC register */
- tmp = ReadDOC(window, ECCConf) & DOC_TOGGLE_BIT;
- if ((ReadDOC(window, ECCConf) & DOC_TOGGLE_BIT) != tmp)
+ tmp = ReadDOC(window, ECCConf) & DOC_TOGGLE_BIT;
+ tmpb = ReadDOC(window, ECCConf) & DOC_TOGGLE_BIT;
+ tmpc = ReadDOC(window, ECCConf) & DOC_TOGGLE_BIT;
+ if (tmp != tmpb && tmp == tmpc)
return ChipID;
break;
+ case DOC_ChipID_DocMilPlus16:
+ case DOC_ChipID_DocMilPlus32:
+ case 0:
+ /* Possible Millennium+, need to do more checks */
+#ifndef DOC_PASSIVE_PROBE
+ /* Possibly release from power down mode */
+ for (tmp = 0; (tmp < 4); tmp++)
+ ReadDOC(window, Mplus_Power);
+
+ /* Reset the DiskOnChip ASIC */
+ tmp = DOC_MODE_RESET | DOC_MODE_MDWREN | DOC_MODE_RST_LAT |
+ DOC_MODE_BDECT;
+ WriteDOC(tmp, window, Mplus_DOCControl);
+ WriteDOC(~tmp, window, Mplus_CtrlConfirm);
+
+ mdelay(1);
+ /* Enable the DiskOnChip ASIC */
+ tmp = DOC_MODE_NORMAL | DOC_MODE_MDWREN | DOC_MODE_RST_LAT |
+ DOC_MODE_BDECT;
+ WriteDOC(tmp, window, Mplus_DOCControl);
+ WriteDOC(~tmp, window, Mplus_CtrlConfirm);
+ mdelay(1);
+#endif /* !DOC_PASSIVE_PROBE */
+
+ ChipID = ReadDOC(window, ChipID);
+
+ switch (ChipID) {
+ case DOC_ChipID_DocMilPlus16:
+ case DOC_ChipID_DocMilPlus32:
+ /* Check the TOGGLE bit in the toggle register */
+ tmp = ReadDOC(window, Mplus_Toggle) & DOC_TOGGLE_BIT;
+ tmpb = ReadDOC(window, Mplus_Toggle) & DOC_TOGGLE_BIT;
+ tmpc = ReadDOC(window, Mplus_Toggle) & DOC_TOGGLE_BIT;
+ if (tmp != tmpb && tmp == tmpc)
+ return ChipID;
+ break;
+ default:
+ break;
+ }
+ /* FALL TRHU */
+
default:
+
#ifndef CONFIG_MTD_DOCPROBE_55AA
printk(KERN_WARNING "Possible DiskOnChip with unknown ChipID %2.2X found at 0x%lx\n",
ChipID, physadr);
@@ -234,6 +278,13 @@
im_modname = "doc2001";
#endif /* DOC_SINGLE_DRIVER */
break;
+
+ case DOC_ChipID_DocMilPlus16:
+ case DOC_ChipID_DocMilPlus32:
+ name="MillenniumPlus";
+ im_funcname = "DoCMilPlus_init";
+ im_modname = "doc2001plus";
+ break;
}
if (im_funcname)
@@ -265,7 +316,7 @@
printk(KERN_INFO "Using configured DiskOnChip probe address 0x%lx\n", doc_config_location);
DoC_Probe(doc_config_location);
} else {
- for (i=0; doc_locations[i]; i++) {
+ for (i=0; (doc_locations[i] != 0xffffffff); i++) {
DoC_Probe(doc_locations[i]);
}
}
More information about the linux-mtd-cvs
mailing list