| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 |  | 
|  | 2 | /* Linux driver for Disk-On-Chip devices			*/ | 
|  | 3 | /* Probe routines common to all DoC devices			*/ | 
|  | 4 | /* (C) 1999 Machine Vision Holdings, Inc.			*/ | 
|  | 5 | /* (C) 1999-2003 David Woodhouse <dwmw2@infradead.org>		*/ | 
|  | 6 |  | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 7 | /* $Id: docprobe.c,v 1.46 2005/11/07 11:14:25 gleixner Exp $	*/ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 |  | 
|  | 9 |  | 
|  | 10 |  | 
|  | 11 | /* DOC_PASSIVE_PROBE: | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 12 | In order to ensure that the BIOS checksum is correct at boot time, and | 
|  | 13 | hence that the onboard BIOS extension gets executed, the DiskOnChip | 
|  | 14 | goes into reset mode when it is read sequentially: all registers | 
|  | 15 | return 0xff until the chip is woken up again by writing to the | 
|  | 16 | DOCControl register. | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 |  | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 18 | Unfortunately, this means that the probe for the DiskOnChip is unsafe, | 
|  | 19 | because one of the first things it does is write to where it thinks | 
|  | 20 | the DOCControl register should be - which may well be shared memory | 
|  | 21 | for another device. I've had machines which lock up when this is | 
|  | 22 | attempted. Hence the possibility to do a passive probe, which will fail | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | to detect a chip in reset mode, but is at least guaranteed not to lock | 
|  | 24 | the machine. | 
|  | 25 |  | 
|  | 26 | If you have this problem, uncomment the following line: | 
|  | 27 | #define DOC_PASSIVE_PROBE | 
|  | 28 | */ | 
|  | 29 |  | 
|  | 30 |  | 
|  | 31 | /* DOC_SINGLE_DRIVER: | 
|  | 32 | Millennium driver has been merged into DOC2000 driver. | 
|  | 33 |  | 
|  | 34 | The old Millennium-only driver has been retained just in case there | 
|  | 35 | are problems with the new code. If the combined driver doesn't work | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 36 | for you, you can try the old one by undefining DOC_SINGLE_DRIVER | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | below and also enabling it in your configuration. If this fixes the | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 38 | problems, please send a report to the MTD mailing list at | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | <linux-mtd@lists.infradead.org>. | 
|  | 40 | */ | 
|  | 41 | #define DOC_SINGLE_DRIVER | 
|  | 42 |  | 
|  | 43 | #include <linux/config.h> | 
|  | 44 | #include <linux/kernel.h> | 
|  | 45 | #include <linux/module.h> | 
|  | 46 | #include <asm/errno.h> | 
|  | 47 | #include <asm/io.h> | 
|  | 48 | #include <linux/delay.h> | 
|  | 49 | #include <linux/slab.h> | 
|  | 50 | #include <linux/init.h> | 
|  | 51 | #include <linux/types.h> | 
|  | 52 |  | 
|  | 53 | #include <linux/mtd/mtd.h> | 
|  | 54 | #include <linux/mtd/nand.h> | 
|  | 55 | #include <linux/mtd/doc2000.h> | 
|  | 56 | #include <linux/mtd/compatmac.h> | 
|  | 57 |  | 
|  | 58 | /* Where to look for the devices? */ | 
|  | 59 | #ifndef CONFIG_MTD_DOCPROBE_ADDRESS | 
|  | 60 | #define CONFIG_MTD_DOCPROBE_ADDRESS 0 | 
|  | 61 | #endif | 
|  | 62 |  | 
|  | 63 |  | 
|  | 64 | static unsigned long doc_config_location = CONFIG_MTD_DOCPROBE_ADDRESS; | 
|  | 65 | module_param(doc_config_location, ulong, 0); | 
|  | 66 | MODULE_PARM_DESC(doc_config_location, "Physical memory address at which to probe for DiskOnChip"); | 
|  | 67 |  | 
|  | 68 | static unsigned long __initdata doc_locations[] = { | 
|  | 69 | #if defined (__alpha__) || defined(__i386__) || defined(__x86_64__) | 
|  | 70 | #ifdef CONFIG_MTD_DOCPROBE_HIGH | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 71 | 0xfffc8000, 0xfffca000, 0xfffcc000, 0xfffce000, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | 0xfffd0000, 0xfffd2000, 0xfffd4000, 0xfffd6000, | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 73 | 0xfffd8000, 0xfffda000, 0xfffdc000, 0xfffde000, | 
|  | 74 | 0xfffe0000, 0xfffe2000, 0xfffe4000, 0xfffe6000, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | 0xfffe8000, 0xfffea000, 0xfffec000, 0xfffee000, | 
|  | 76 | #else /*  CONFIG_MTD_DOCPROBE_HIGH */ | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 77 | 0xc8000, 0xca000, 0xcc000, 0xce000, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | 0xd0000, 0xd2000, 0xd4000, 0xd6000, | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 79 | 0xd8000, 0xda000, 0xdc000, 0xde000, | 
|  | 80 | 0xe0000, 0xe2000, 0xe4000, 0xe6000, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | 0xe8000, 0xea000, 0xec000, 0xee000, | 
|  | 82 | #endif /*  CONFIG_MTD_DOCPROBE_HIGH */ | 
|  | 83 | #elif defined(__PPC__) | 
|  | 84 | 0xe4000000, | 
|  | 85 | #elif defined(CONFIG_MOMENCO_OCELOT) | 
|  | 86 | 0x2f000000, | 
|  | 87 | 0xff000000, | 
|  | 88 | #elif defined(CONFIG_MOMENCO_OCELOT_G) || defined (CONFIG_MOMENCO_OCELOT_C) | 
|  | 89 | 0xff000000, | 
|  | 90 | ##else | 
|  | 91 | #warning Unknown architecture for DiskOnChip. No default probe locations defined | 
|  | 92 | #endif | 
|  | 93 | 0xffffffff }; | 
|  | 94 |  | 
|  | 95 | /* doccheck: Probe a given memory window to see if there's a DiskOnChip present */ | 
|  | 96 |  | 
|  | 97 | static inline int __init doccheck(void __iomem *potential, unsigned long physadr) | 
|  | 98 | { | 
|  | 99 | void __iomem *window=potential; | 
|  | 100 | unsigned char tmp, tmpb, tmpc, ChipID; | 
|  | 101 | #ifndef DOC_PASSIVE_PROBE | 
|  | 102 | unsigned char tmp2; | 
|  | 103 | #endif | 
|  | 104 |  | 
|  | 105 | /* Routine copied from the Linux DOC driver */ | 
|  | 106 |  | 
|  | 107 | #ifdef CONFIG_MTD_DOCPROBE_55AA | 
|  | 108 | /* Check for 0x55 0xAA signature at beginning of window, | 
|  | 109 | this is no longer true once we remove the IPL (for Millennium */ | 
|  | 110 | if (ReadDOC(window, Sig1) != 0x55 || ReadDOC(window, Sig2) != 0xaa) | 
|  | 111 | return 0; | 
|  | 112 | #endif /* CONFIG_MTD_DOCPROBE_55AA */ | 
|  | 113 |  | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 114 | #ifndef DOC_PASSIVE_PROBE | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 115 | /* It's not possible to cleanly detect the DiskOnChip - the | 
|  | 116 | * bootup procedure will put the device into reset mode, and | 
|  | 117 | * it's not possible to talk to it without actually writing | 
|  | 118 | * to the DOCControl register. So we store the current contents | 
|  | 119 | * of the DOCControl register's location, in case we later decide | 
|  | 120 | * that it's not a DiskOnChip, and want to put it back how we | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 121 | * found it. | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 122 | */ | 
|  | 123 | tmp2 = ReadDOC(window, DOCControl); | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 124 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 125 | /* Reset the DiskOnChip ASIC */ | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 126 | WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_RESET, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 127 | window, DOCControl); | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 128 | WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_RESET, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 129 | window, DOCControl); | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 130 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 131 | /* Enable the DiskOnChip ASIC */ | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 132 | WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_NORMAL, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 133 | window, DOCControl); | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 134 | WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_NORMAL, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 135 | window, DOCControl); | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 136 | #endif /* !DOC_PASSIVE_PROBE */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 137 |  | 
|  | 138 | /* We need to read the ChipID register four times. For some | 
|  | 139 | newer DiskOnChip 2000 units, the first three reads will | 
|  | 140 | return the DiskOnChip Millennium ident. Don't ask. */ | 
|  | 141 | ChipID = ReadDOC(window, ChipID); | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 142 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 143 | switch (ChipID) { | 
|  | 144 | case DOC_ChipID_Doc2k: | 
|  | 145 | /* Check the TOGGLE bit in the ECC register */ | 
|  | 146 | tmp  = ReadDOC(window, 2k_ECCStatus) & DOC_TOGGLE_BIT; | 
|  | 147 | tmpb = ReadDOC(window, 2k_ECCStatus) & DOC_TOGGLE_BIT; | 
|  | 148 | tmpc = ReadDOC(window, 2k_ECCStatus) & DOC_TOGGLE_BIT; | 
|  | 149 | if (tmp != tmpb && tmp == tmpc) | 
|  | 150 | return ChipID; | 
|  | 151 | break; | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 152 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 153 | case DOC_ChipID_DocMil: | 
|  | 154 | /* Check for the new 2000 with Millennium ASIC */ | 
|  | 155 | ReadDOC(window, ChipID); | 
|  | 156 | ReadDOC(window, ChipID); | 
|  | 157 | if (ReadDOC(window, ChipID) != DOC_ChipID_DocMil) | 
|  | 158 | ChipID = DOC_ChipID_Doc2kTSOP; | 
|  | 159 |  | 
|  | 160 | /* Check the TOGGLE bit in the ECC register */ | 
|  | 161 | tmp  = ReadDOC(window, ECCConf) & DOC_TOGGLE_BIT; | 
|  | 162 | tmpb = ReadDOC(window, ECCConf) & DOC_TOGGLE_BIT; | 
|  | 163 | tmpc = ReadDOC(window, ECCConf) & DOC_TOGGLE_BIT; | 
|  | 164 | if (tmp != tmpb && tmp == tmpc) | 
|  | 165 | return ChipID; | 
|  | 166 | break; | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 167 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 168 | case DOC_ChipID_DocMilPlus16: | 
|  | 169 | case DOC_ChipID_DocMilPlus32: | 
|  | 170 | case 0: | 
|  | 171 | /* Possible Millennium+, need to do more checks */ | 
|  | 172 | #ifndef DOC_PASSIVE_PROBE | 
|  | 173 | /* Possibly release from power down mode */ | 
|  | 174 | for (tmp = 0; (tmp < 4); tmp++) | 
|  | 175 | ReadDOC(window, Mplus_Power); | 
|  | 176 |  | 
|  | 177 | /* Reset the DiskOnChip ASIC */ | 
|  | 178 | tmp = DOC_MODE_RESET | DOC_MODE_MDWREN | DOC_MODE_RST_LAT | | 
|  | 179 | DOC_MODE_BDECT; | 
|  | 180 | WriteDOC(tmp, window, Mplus_DOCControl); | 
|  | 181 | WriteDOC(~tmp, window, Mplus_CtrlConfirm); | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 182 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 183 | mdelay(1); | 
|  | 184 | /* Enable the DiskOnChip ASIC */ | 
|  | 185 | tmp = DOC_MODE_NORMAL | DOC_MODE_MDWREN | DOC_MODE_RST_LAT | | 
|  | 186 | DOC_MODE_BDECT; | 
|  | 187 | WriteDOC(tmp, window, Mplus_DOCControl); | 
|  | 188 | WriteDOC(~tmp, window, Mplus_CtrlConfirm); | 
|  | 189 | mdelay(1); | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 190 | #endif /* !DOC_PASSIVE_PROBE */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 191 |  | 
|  | 192 | ChipID = ReadDOC(window, ChipID); | 
|  | 193 |  | 
|  | 194 | switch (ChipID) { | 
|  | 195 | case DOC_ChipID_DocMilPlus16: | 
|  | 196 | case DOC_ChipID_DocMilPlus32: | 
|  | 197 | /* Check the TOGGLE bit in the toggle register */ | 
|  | 198 | tmp  = ReadDOC(window, Mplus_Toggle) & DOC_TOGGLE_BIT; | 
|  | 199 | tmpb = ReadDOC(window, Mplus_Toggle) & DOC_TOGGLE_BIT; | 
|  | 200 | tmpc = ReadDOC(window, Mplus_Toggle) & DOC_TOGGLE_BIT; | 
|  | 201 | if (tmp != tmpb && tmp == tmpc) | 
|  | 202 | return ChipID; | 
|  | 203 | default: | 
|  | 204 | break; | 
|  | 205 | } | 
|  | 206 | /* FALL TRHU */ | 
|  | 207 |  | 
|  | 208 | default: | 
|  | 209 |  | 
|  | 210 | #ifdef CONFIG_MTD_DOCPROBE_55AA | 
|  | 211 | printk(KERN_DEBUG "Possible DiskOnChip with unknown ChipID %2.2X found at 0x%lx\n", | 
|  | 212 | ChipID, physadr); | 
|  | 213 | #endif | 
|  | 214 | #ifndef DOC_PASSIVE_PROBE | 
|  | 215 | /* Put back the contents of the DOCControl register, in case it's not | 
|  | 216 | * actually a DiskOnChip. | 
|  | 217 | */ | 
|  | 218 | WriteDOC(tmp2, window, DOCControl); | 
|  | 219 | #endif | 
|  | 220 | return 0; | 
|  | 221 | } | 
|  | 222 |  | 
|  | 223 | printk(KERN_WARNING "DiskOnChip failed TOGGLE test, dropping.\n"); | 
|  | 224 |  | 
|  | 225 | #ifndef DOC_PASSIVE_PROBE | 
|  | 226 | /* Put back the contents of the DOCControl register: it's not a DiskOnChip */ | 
|  | 227 | WriteDOC(tmp2, window, DOCControl); | 
|  | 228 | #endif | 
|  | 229 | return 0; | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 230 | } | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 231 |  | 
|  | 232 | static int docfound; | 
|  | 233 |  | 
|  | 234 | static void __init DoC_Probe(unsigned long physadr) | 
|  | 235 | { | 
|  | 236 | void __iomem *docptr; | 
|  | 237 | struct DiskOnChip *this; | 
|  | 238 | struct mtd_info *mtd; | 
|  | 239 | int ChipID; | 
|  | 240 | char namebuf[15]; | 
|  | 241 | char *name = namebuf; | 
|  | 242 | char *im_funcname = NULL; | 
|  | 243 | char *im_modname = NULL; | 
|  | 244 | void (*initroutine)(struct mtd_info *) = NULL; | 
|  | 245 |  | 
|  | 246 | docptr = ioremap(physadr, DOC_IOREMAP_LEN); | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 247 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 248 | if (!docptr) | 
|  | 249 | return; | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 250 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 251 | if ((ChipID = doccheck(docptr, physadr))) { | 
|  | 252 | if (ChipID == DOC_ChipID_Doc2kTSOP) { | 
|  | 253 | /* Remove this at your own peril. The hardware driver works but nothing prevents you from erasing bad blocks */ | 
|  | 254 | printk(KERN_NOTICE "Refusing to drive DiskOnChip 2000 TSOP until Bad Block Table is correctly supported by INFTL\n"); | 
|  | 255 | iounmap(docptr); | 
|  | 256 | return; | 
|  | 257 | } | 
|  | 258 | docfound = 1; | 
|  | 259 | mtd = kmalloc(sizeof(struct DiskOnChip) + sizeof(struct mtd_info), GFP_KERNEL); | 
|  | 260 |  | 
|  | 261 | if (!mtd) { | 
|  | 262 | printk(KERN_WARNING "Cannot allocate memory for data structures. Dropping.\n"); | 
|  | 263 | iounmap(docptr); | 
|  | 264 | return; | 
|  | 265 | } | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 266 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 267 | this = (struct DiskOnChip *)(&mtd[1]); | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 268 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 269 | memset((char *)mtd,0, sizeof(struct mtd_info)); | 
|  | 270 | memset((char *)this, 0, sizeof(struct DiskOnChip)); | 
|  | 271 |  | 
|  | 272 | mtd->priv = this; | 
|  | 273 | this->virtadr = docptr; | 
|  | 274 | this->physadr = physadr; | 
|  | 275 | this->ChipID = ChipID; | 
|  | 276 | sprintf(namebuf, "with ChipID %2.2X", ChipID); | 
|  | 277 |  | 
|  | 278 | switch(ChipID) { | 
|  | 279 | case DOC_ChipID_Doc2kTSOP: | 
|  | 280 | name="2000 TSOP"; | 
|  | 281 | im_funcname = "DoC2k_init"; | 
|  | 282 | im_modname = "doc2000"; | 
|  | 283 | break; | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 284 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 285 | case DOC_ChipID_Doc2k: | 
|  | 286 | name="2000"; | 
|  | 287 | im_funcname = "DoC2k_init"; | 
|  | 288 | im_modname = "doc2000"; | 
|  | 289 | break; | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 290 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 291 | case DOC_ChipID_DocMil: | 
|  | 292 | name="Millennium"; | 
|  | 293 | #ifdef DOC_SINGLE_DRIVER | 
|  | 294 | im_funcname = "DoC2k_init"; | 
|  | 295 | im_modname = "doc2000"; | 
|  | 296 | #else | 
|  | 297 | im_funcname = "DoCMil_init"; | 
|  | 298 | im_modname = "doc2001"; | 
|  | 299 | #endif /* DOC_SINGLE_DRIVER */ | 
|  | 300 | break; | 
|  | 301 |  | 
|  | 302 | case DOC_ChipID_DocMilPlus16: | 
|  | 303 | case DOC_ChipID_DocMilPlus32: | 
|  | 304 | name="MillenniumPlus"; | 
|  | 305 | im_funcname = "DoCMilPlus_init"; | 
|  | 306 | im_modname = "doc2001plus"; | 
|  | 307 | break; | 
|  | 308 | } | 
|  | 309 |  | 
|  | 310 | if (im_funcname) | 
|  | 311 | initroutine = inter_module_get_request(im_funcname, im_modname); | 
|  | 312 |  | 
|  | 313 | if (initroutine) { | 
|  | 314 | (*initroutine)(mtd); | 
|  | 315 | inter_module_put(im_funcname); | 
|  | 316 | return; | 
|  | 317 | } | 
|  | 318 | printk(KERN_NOTICE "Cannot find driver for DiskOnChip %s at 0x%lX\n", name, physadr); | 
|  | 319 | kfree(mtd); | 
|  | 320 | } | 
|  | 321 | iounmap(docptr); | 
|  | 322 | } | 
|  | 323 |  | 
|  | 324 |  | 
|  | 325 | /**************************************************************************** | 
|  | 326 | * | 
|  | 327 | * Module stuff | 
|  | 328 | * | 
|  | 329 | ****************************************************************************/ | 
|  | 330 |  | 
|  | 331 | static int __init init_doc(void) | 
|  | 332 | { | 
|  | 333 | int i; | 
| Thomas Gleixner | e5580fb | 2005-11-07 11:15:40 +0000 | [diff] [blame] | 334 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 335 | if (doc_config_location) { | 
|  | 336 | printk(KERN_INFO "Using configured DiskOnChip probe address 0x%lx\n", doc_config_location); | 
|  | 337 | DoC_Probe(doc_config_location); | 
|  | 338 | } else { | 
|  | 339 | for (i=0; (doc_locations[i] != 0xffffffff); i++) { | 
|  | 340 | DoC_Probe(doc_locations[i]); | 
|  | 341 | } | 
|  | 342 | } | 
|  | 343 | /* No banner message any more. Print a message if no DiskOnChip | 
|  | 344 | found, so the user knows we at least tried. */ | 
|  | 345 | if (!docfound) | 
|  | 346 | printk(KERN_INFO "No recognised DiskOnChip devices found\n"); | 
|  | 347 | return -EAGAIN; | 
|  | 348 | } | 
|  | 349 |  | 
|  | 350 | module_init(init_doc); | 
|  | 351 |  | 
|  | 352 | MODULE_LICENSE("GPL"); | 
|  | 353 | MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>"); | 
|  | 354 | MODULE_DESCRIPTION("Probe code for DiskOnChip 2000 and Millennium devices"); | 
|  | 355 |  |