| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | *  drivers/mtd/nand/au1550nd.c | 
|  | 3 | * | 
|  | 4 | *  Copyright (C) 2004 Embedded Edge, LLC | 
|  | 5 | * | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 6 | * $Id: au1550nd.c,v 1.13 2005/11/07 11:14:30 gleixner Exp $ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | * | 
|  | 8 | * This program is free software; you can redistribute it and/or modify | 
|  | 9 | * it under the terms of the GNU General Public License version 2 as | 
|  | 10 | * published by the Free Software Foundation. | 
|  | 11 | * | 
|  | 12 | */ | 
|  | 13 |  | 
|  | 14 | #include <linux/slab.h> | 
|  | 15 | #include <linux/init.h> | 
|  | 16 | #include <linux/module.h> | 
| Sergei Shtylyov | 35af68b | 2006-05-16 20:52:06 +0400 | [diff] [blame] | 17 | #include <linux/interrupt.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | #include <linux/mtd/mtd.h> | 
|  | 19 | #include <linux/mtd/nand.h> | 
|  | 20 | #include <linux/mtd/partitions.h> | 
| Olaf Hering | 733482e | 2005-11-08 21:34:55 -0800 | [diff] [blame] | 21 | #include <linux/version.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | #include <asm/io.h> | 
|  | 23 |  | 
| Pete Popov | ef6f0d1 | 2005-09-23 02:44:58 +0100 | [diff] [blame] | 24 | #include <asm/mach-au1x00/au1xxx.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 |  | 
|  | 26 | /* | 
|  | 27 | * MTD structure for NAND controller | 
|  | 28 | */ | 
|  | 29 | static struct mtd_info *au1550_mtd = NULL; | 
|  | 30 | static void __iomem *p_nand; | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 31 | static int nand_width = 1;	/* default x8 */ | 
| Thomas Gleixner | cad74f2 | 2006-05-23 23:28:48 +0200 | [diff] [blame] | 32 | static void (*au1550_write_byte)(struct mtd_info *, u_char); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | /* | 
|  | 35 | * Define partitions for flash device | 
|  | 36 | */ | 
| Jesper Juhl | 3c6bee1 | 2006-01-09 20:54:01 -0800 | [diff] [blame] | 37 | static const struct mtd_partition partition_info[] = { | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 38 | { | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 39 | .name = "NAND FS 0", | 
|  | 40 | .offset = 0, | 
|  | 41 | .size = 8 * 1024 * 1024}, | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 42 | { | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 43 | .name = "NAND FS 1", | 
|  | 44 | .offset = MTDPART_OFS_APPEND, | 
|  | 45 | .size = MTDPART_SIZ_FULL} | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | }; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 |  | 
|  | 48 | /** | 
|  | 49 | * au_read_byte -  read one byte from the chip | 
|  | 50 | * @mtd:	MTD device structure | 
|  | 51 | * | 
|  | 52 | *  read function for 8bit buswith | 
|  | 53 | */ | 
|  | 54 | static u_char au_read_byte(struct mtd_info *mtd) | 
|  | 55 | { | 
|  | 56 | struct nand_chip *this = mtd->priv; | 
|  | 57 | u_char ret = readb(this->IO_ADDR_R); | 
|  | 58 | au_sync(); | 
|  | 59 | return ret; | 
|  | 60 | } | 
|  | 61 |  | 
|  | 62 | /** | 
|  | 63 | * au_write_byte -  write one byte to the chip | 
|  | 64 | * @mtd:	MTD device structure | 
|  | 65 | * @byte:	pointer to data byte to write | 
|  | 66 | * | 
|  | 67 | *  write function for 8it buswith | 
|  | 68 | */ | 
|  | 69 | static void au_write_byte(struct mtd_info *mtd, u_char byte) | 
|  | 70 | { | 
|  | 71 | struct nand_chip *this = mtd->priv; | 
|  | 72 | writeb(byte, this->IO_ADDR_W); | 
|  | 73 | au_sync(); | 
|  | 74 | } | 
|  | 75 |  | 
|  | 76 | /** | 
|  | 77 | * au_read_byte16 -  read one byte endianess aware from the chip | 
|  | 78 | * @mtd:	MTD device structure | 
|  | 79 | * | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 80 | *  read function for 16bit buswith with | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | * endianess conversion | 
|  | 82 | */ | 
|  | 83 | static u_char au_read_byte16(struct mtd_info *mtd) | 
|  | 84 | { | 
|  | 85 | struct nand_chip *this = mtd->priv; | 
|  | 86 | u_char ret = (u_char) cpu_to_le16(readw(this->IO_ADDR_R)); | 
|  | 87 | au_sync(); | 
|  | 88 | return ret; | 
|  | 89 | } | 
|  | 90 |  | 
|  | 91 | /** | 
|  | 92 | * au_write_byte16 -  write one byte endianess aware to the chip | 
|  | 93 | * @mtd:	MTD device structure | 
|  | 94 | * @byte:	pointer to data byte to write | 
|  | 95 | * | 
|  | 96 | *  write function for 16bit buswith with | 
|  | 97 | * endianess conversion | 
|  | 98 | */ | 
|  | 99 | static void au_write_byte16(struct mtd_info *mtd, u_char byte) | 
|  | 100 | { | 
|  | 101 | struct nand_chip *this = mtd->priv; | 
|  | 102 | writew(le16_to_cpu((u16) byte), this->IO_ADDR_W); | 
|  | 103 | au_sync(); | 
|  | 104 | } | 
|  | 105 |  | 
|  | 106 | /** | 
|  | 107 | * au_read_word -  read one word from the chip | 
|  | 108 | * @mtd:	MTD device structure | 
|  | 109 | * | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 110 | *  read function for 16bit buswith without | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 111 | * endianess conversion | 
|  | 112 | */ | 
|  | 113 | static u16 au_read_word(struct mtd_info *mtd) | 
|  | 114 | { | 
|  | 115 | struct nand_chip *this = mtd->priv; | 
|  | 116 | u16 ret = readw(this->IO_ADDR_R); | 
|  | 117 | au_sync(); | 
|  | 118 | return ret; | 
|  | 119 | } | 
|  | 120 |  | 
|  | 121 | /** | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 122 | * au_write_buf -  write buffer to chip | 
|  | 123 | * @mtd:	MTD device structure | 
|  | 124 | * @buf:	data buffer | 
|  | 125 | * @len:	number of bytes to write | 
|  | 126 | * | 
|  | 127 | *  write function for 8bit buswith | 
|  | 128 | */ | 
|  | 129 | static void au_write_buf(struct mtd_info *mtd, const u_char *buf, int len) | 
|  | 130 | { | 
|  | 131 | int i; | 
|  | 132 | struct nand_chip *this = mtd->priv; | 
|  | 133 |  | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 134 | for (i = 0; i < len; i++) { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 135 | writeb(buf[i], this->IO_ADDR_W); | 
|  | 136 | au_sync(); | 
|  | 137 | } | 
|  | 138 | } | 
|  | 139 |  | 
|  | 140 | /** | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 141 | * au_read_buf -  read chip data into buffer | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 142 | * @mtd:	MTD device structure | 
|  | 143 | * @buf:	buffer to store date | 
|  | 144 | * @len:	number of bytes to read | 
|  | 145 | * | 
|  | 146 | *  read function for 8bit buswith | 
|  | 147 | */ | 
|  | 148 | static void au_read_buf(struct mtd_info *mtd, u_char *buf, int len) | 
|  | 149 | { | 
|  | 150 | int i; | 
|  | 151 | struct nand_chip *this = mtd->priv; | 
|  | 152 |  | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 153 | for (i = 0; i < len; i++) { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 154 | buf[i] = readb(this->IO_ADDR_R); | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 155 | au_sync(); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 156 | } | 
|  | 157 | } | 
|  | 158 |  | 
|  | 159 | /** | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 160 | * au_verify_buf -  Verify chip data against buffer | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 161 | * @mtd:	MTD device structure | 
|  | 162 | * @buf:	buffer containing the data to compare | 
|  | 163 | * @len:	number of bytes to compare | 
|  | 164 | * | 
|  | 165 | *  verify function for 8bit buswith | 
|  | 166 | */ | 
|  | 167 | static int au_verify_buf(struct mtd_info *mtd, const u_char *buf, int len) | 
|  | 168 | { | 
|  | 169 | int i; | 
|  | 170 | struct nand_chip *this = mtd->priv; | 
|  | 171 |  | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 172 | for (i = 0; i < len; i++) { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 173 | if (buf[i] != readb(this->IO_ADDR_R)) | 
|  | 174 | return -EFAULT; | 
|  | 175 | au_sync(); | 
|  | 176 | } | 
|  | 177 |  | 
|  | 178 | return 0; | 
|  | 179 | } | 
|  | 180 |  | 
|  | 181 | /** | 
|  | 182 | * au_write_buf16 -  write buffer to chip | 
|  | 183 | * @mtd:	MTD device structure | 
|  | 184 | * @buf:	data buffer | 
|  | 185 | * @len:	number of bytes to write | 
|  | 186 | * | 
|  | 187 | *  write function for 16bit buswith | 
|  | 188 | */ | 
|  | 189 | static void au_write_buf16(struct mtd_info *mtd, const u_char *buf, int len) | 
|  | 190 | { | 
|  | 191 | int i; | 
|  | 192 | struct nand_chip *this = mtd->priv; | 
|  | 193 | u16 *p = (u16 *) buf; | 
|  | 194 | len >>= 1; | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 195 |  | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 196 | for (i = 0; i < len; i++) { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 197 | writew(p[i], this->IO_ADDR_W); | 
|  | 198 | au_sync(); | 
|  | 199 | } | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 200 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 201 | } | 
|  | 202 |  | 
|  | 203 | /** | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 204 | * au_read_buf16 -  read chip data into buffer | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 205 | * @mtd:	MTD device structure | 
|  | 206 | * @buf:	buffer to store date | 
|  | 207 | * @len:	number of bytes to read | 
|  | 208 | * | 
|  | 209 | *  read function for 16bit buswith | 
|  | 210 | */ | 
|  | 211 | static void au_read_buf16(struct mtd_info *mtd, u_char *buf, int len) | 
|  | 212 | { | 
|  | 213 | int i; | 
|  | 214 | struct nand_chip *this = mtd->priv; | 
|  | 215 | u16 *p = (u16 *) buf; | 
|  | 216 | len >>= 1; | 
|  | 217 |  | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 218 | for (i = 0; i < len; i++) { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 219 | p[i] = readw(this->IO_ADDR_R); | 
|  | 220 | au_sync(); | 
|  | 221 | } | 
|  | 222 | } | 
|  | 223 |  | 
|  | 224 | /** | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 225 | * au_verify_buf16 -  Verify chip data against buffer | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 226 | * @mtd:	MTD device structure | 
|  | 227 | * @buf:	buffer containing the data to compare | 
|  | 228 | * @len:	number of bytes to compare | 
|  | 229 | * | 
|  | 230 | *  verify function for 16bit buswith | 
|  | 231 | */ | 
|  | 232 | static int au_verify_buf16(struct mtd_info *mtd, const u_char *buf, int len) | 
|  | 233 | { | 
|  | 234 | int i; | 
|  | 235 | struct nand_chip *this = mtd->priv; | 
|  | 236 | u16 *p = (u16 *) buf; | 
|  | 237 | len >>= 1; | 
|  | 238 |  | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 239 | for (i = 0; i < len; i++) { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 240 | if (p[i] != readw(this->IO_ADDR_R)) | 
|  | 241 | return -EFAULT; | 
|  | 242 | au_sync(); | 
|  | 243 | } | 
|  | 244 | return 0; | 
|  | 245 | } | 
|  | 246 |  | 
| Thomas Gleixner | 7abd3ef | 2006-05-23 23:25:53 +0200 | [diff] [blame] | 247 | /* Select the chip by setting nCE to low */ | 
|  | 248 | #define NAND_CTL_SETNCE		1 | 
|  | 249 | /* Deselect the chip by setting nCE to high */ | 
|  | 250 | #define NAND_CTL_CLRNCE		2 | 
|  | 251 | /* Select the command latch by setting CLE to high */ | 
|  | 252 | #define NAND_CTL_SETCLE		3 | 
|  | 253 | /* Deselect the command latch by setting CLE to low */ | 
|  | 254 | #define NAND_CTL_CLRCLE		4 | 
|  | 255 | /* Select the address latch by setting ALE to high */ | 
|  | 256 | #define NAND_CTL_SETALE		5 | 
|  | 257 | /* Deselect the address latch by setting ALE to low */ | 
|  | 258 | #define NAND_CTL_CLRALE		6 | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 259 |  | 
|  | 260 | static void au1550_hwcontrol(struct mtd_info *mtd, int cmd) | 
|  | 261 | { | 
|  | 262 | register struct nand_chip *this = mtd->priv; | 
|  | 263 |  | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 264 | switch (cmd) { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 265 |  | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 266 | case NAND_CTL_SETCLE: | 
|  | 267 | this->IO_ADDR_W = p_nand + MEM_STNAND_CMD; | 
|  | 268 | break; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 269 |  | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 270 | case NAND_CTL_CLRCLE: | 
|  | 271 | this->IO_ADDR_W = p_nand + MEM_STNAND_DATA; | 
|  | 272 | break; | 
|  | 273 |  | 
|  | 274 | case NAND_CTL_SETALE: | 
|  | 275 | this->IO_ADDR_W = p_nand + MEM_STNAND_ADDR; | 
|  | 276 | break; | 
|  | 277 |  | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 278 | case NAND_CTL_CLRALE: | 
|  | 279 | this->IO_ADDR_W = p_nand + MEM_STNAND_DATA; | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 280 | /* FIXME: Nobody knows why this is necessary, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 281 | * but it works only that way */ | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 282 | udelay(1); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 283 | break; | 
|  | 284 |  | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 285 | case NAND_CTL_SETNCE: | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 286 | /* assert (force assert) chip enable */ | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 287 | au_writel((1 << (4 + NAND_CS)), MEM_STNDCTL); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 288 | break; | 
|  | 289 |  | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 290 | case NAND_CTL_CLRNCE: | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 291 | /* deassert chip enable */ | 
|  | 292 | au_writel(0, MEM_STNDCTL); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 293 | break; | 
|  | 294 | } | 
|  | 295 |  | 
|  | 296 | this->IO_ADDR_R = this->IO_ADDR_W; | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 297 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 298 | /* Drain the writebuffer */ | 
|  | 299 | au_sync(); | 
|  | 300 | } | 
|  | 301 |  | 
|  | 302 | int au1550_device_ready(struct mtd_info *mtd) | 
|  | 303 | { | 
|  | 304 | int ret = (au_readl(MEM_STSTAT) & 0x1) ? 1 : 0; | 
|  | 305 | au_sync(); | 
|  | 306 | return ret; | 
|  | 307 | } | 
|  | 308 |  | 
| Sergei Shtylyov | 35af68b | 2006-05-16 20:52:06 +0400 | [diff] [blame] | 309 | /** | 
|  | 310 | * au1550_select_chip - control -CE line | 
|  | 311 | *	Forbid driving -CE manually permitting the NAND controller to do this. | 
|  | 312 | *	Keeping -CE asserted during the whole sector reads interferes with the | 
|  | 313 | *	NOR flash and PCMCIA drivers as it causes contention on the static bus. | 
|  | 314 | *	We only have to hold -CE low for the NAND read commands since the flash | 
|  | 315 | *	chip needs it to be asserted during chip not ready time but the NAND | 
|  | 316 | *	controller keeps it released. | 
|  | 317 | * | 
|  | 318 | * @mtd:	MTD device structure | 
|  | 319 | * @chip:	chipnumber to select, -1 for deselect | 
|  | 320 | */ | 
|  | 321 | static void au1550_select_chip(struct mtd_info *mtd, int chip) | 
|  | 322 | { | 
|  | 323 | } | 
|  | 324 |  | 
|  | 325 | /** | 
|  | 326 | * au1550_command - Send command to NAND device | 
|  | 327 | * @mtd:	MTD device structure | 
|  | 328 | * @command:	the command to be sent | 
|  | 329 | * @column:	the column address for this command, -1 if none | 
|  | 330 | * @page_addr:	the page address for this command, -1 if none | 
|  | 331 | */ | 
|  | 332 | static void au1550_command(struct mtd_info *mtd, unsigned command, int column, int page_addr) | 
|  | 333 | { | 
|  | 334 | register struct nand_chip *this = mtd->priv; | 
|  | 335 | int ce_override = 0, i; | 
|  | 336 | ulong flags; | 
|  | 337 |  | 
|  | 338 | /* Begin command latch cycle */ | 
| Thomas Gleixner | 7abd3ef | 2006-05-23 23:25:53 +0200 | [diff] [blame] | 339 | au1550_hwcontrol(mtd, NAND_CTL_SETCLE); | 
| Sergei Shtylyov | 35af68b | 2006-05-16 20:52:06 +0400 | [diff] [blame] | 340 | /* | 
|  | 341 | * Write out the command to the device. | 
|  | 342 | */ | 
|  | 343 | if (command == NAND_CMD_SEQIN) { | 
|  | 344 | int readcmd; | 
|  | 345 |  | 
| Joern Engel | 2831877 | 2006-05-22 23:18:05 +0200 | [diff] [blame] | 346 | if (column >= mtd->writesize) { | 
| Sergei Shtylyov | 35af68b | 2006-05-16 20:52:06 +0400 | [diff] [blame] | 347 | /* OOB area */ | 
| Joern Engel | 2831877 | 2006-05-22 23:18:05 +0200 | [diff] [blame] | 348 | column -= mtd->writesize; | 
| Sergei Shtylyov | 35af68b | 2006-05-16 20:52:06 +0400 | [diff] [blame] | 349 | readcmd = NAND_CMD_READOOB; | 
|  | 350 | } else if (column < 256) { | 
|  | 351 | /* First 256 bytes --> READ0 */ | 
|  | 352 | readcmd = NAND_CMD_READ0; | 
|  | 353 | } else { | 
|  | 354 | column -= 256; | 
|  | 355 | readcmd = NAND_CMD_READ1; | 
|  | 356 | } | 
| Thomas Gleixner | cad74f2 | 2006-05-23 23:28:48 +0200 | [diff] [blame] | 357 | au1550_write_byte(mtd, readcmd); | 
| Sergei Shtylyov | 35af68b | 2006-05-16 20:52:06 +0400 | [diff] [blame] | 358 | } | 
| Thomas Gleixner | cad74f2 | 2006-05-23 23:28:48 +0200 | [diff] [blame] | 359 | au1550_write_byte(mtd, command); | 
| Sergei Shtylyov | 35af68b | 2006-05-16 20:52:06 +0400 | [diff] [blame] | 360 |  | 
|  | 361 | /* Set ALE and clear CLE to start address cycle */ | 
| Thomas Gleixner | 7abd3ef | 2006-05-23 23:25:53 +0200 | [diff] [blame] | 362 | au1550_hwcontrol(mtd, NAND_CTL_CLRCLE); | 
| Sergei Shtylyov | 35af68b | 2006-05-16 20:52:06 +0400 | [diff] [blame] | 363 |  | 
|  | 364 | if (column != -1 || page_addr != -1) { | 
| Thomas Gleixner | 7abd3ef | 2006-05-23 23:25:53 +0200 | [diff] [blame] | 365 | au1550_hwcontrol(mtd, NAND_CTL_SETALE); | 
| Sergei Shtylyov | 35af68b | 2006-05-16 20:52:06 +0400 | [diff] [blame] | 366 |  | 
|  | 367 | /* Serially input address */ | 
|  | 368 | if (column != -1) { | 
|  | 369 | /* Adjust columns for 16 bit buswidth */ | 
|  | 370 | if (this->options & NAND_BUSWIDTH_16) | 
|  | 371 | column >>= 1; | 
| Thomas Gleixner | cad74f2 | 2006-05-23 23:28:48 +0200 | [diff] [blame] | 372 | au1550_write_byte(mtd, column); | 
| Sergei Shtylyov | 35af68b | 2006-05-16 20:52:06 +0400 | [diff] [blame] | 373 | } | 
|  | 374 | if (page_addr != -1) { | 
| Thomas Gleixner | cad74f2 | 2006-05-23 23:28:48 +0200 | [diff] [blame] | 375 | au1550_write_byte(mtd, (u8)(page_addr & 0xff)); | 
| Sergei Shtylyov | 35af68b | 2006-05-16 20:52:06 +0400 | [diff] [blame] | 376 |  | 
|  | 377 | if (command == NAND_CMD_READ0 || | 
|  | 378 | command == NAND_CMD_READ1 || | 
|  | 379 | command == NAND_CMD_READOOB) { | 
|  | 380 | /* | 
|  | 381 | * NAND controller will release -CE after | 
|  | 382 | * the last address byte is written, so we'll | 
|  | 383 | * have to forcibly assert it. No interrupts | 
|  | 384 | * are allowed while we do this as we don't | 
|  | 385 | * want the NOR flash or PCMCIA drivers to | 
|  | 386 | * steal our precious bytes of data... | 
|  | 387 | */ | 
|  | 388 | ce_override = 1; | 
|  | 389 | local_irq_save(flags); | 
| Thomas Gleixner | 7abd3ef | 2006-05-23 23:25:53 +0200 | [diff] [blame] | 390 | au1550_hwcontrol(mtd, NAND_CTL_SETNCE); | 
| Sergei Shtylyov | 35af68b | 2006-05-16 20:52:06 +0400 | [diff] [blame] | 391 | } | 
|  | 392 |  | 
| Thomas Gleixner | cad74f2 | 2006-05-23 23:28:48 +0200 | [diff] [blame] | 393 | au1550_write_byte(mtd, (u8)(page_addr >> 8)); | 
| Sergei Shtylyov | 35af68b | 2006-05-16 20:52:06 +0400 | [diff] [blame] | 394 |  | 
|  | 395 | /* One more address cycle for devices > 32MiB */ | 
|  | 396 | if (this->chipsize > (32 << 20)) | 
| Thomas Gleixner | cad74f2 | 2006-05-23 23:28:48 +0200 | [diff] [blame] | 397 | au1550_write_byte(mtd, (u8)((page_addr >> 16) & 0x0f)); | 
| Sergei Shtylyov | 35af68b | 2006-05-16 20:52:06 +0400 | [diff] [blame] | 398 | } | 
|  | 399 | /* Latch in address */ | 
| Thomas Gleixner | 7abd3ef | 2006-05-23 23:25:53 +0200 | [diff] [blame] | 400 | au1550_hwcontrol(mtd, NAND_CTL_CLRALE); | 
| Sergei Shtylyov | 35af68b | 2006-05-16 20:52:06 +0400 | [diff] [blame] | 401 | } | 
|  | 402 |  | 
|  | 403 | /* | 
|  | 404 | * Program and erase have their own busy handlers. | 
|  | 405 | * Status and sequential in need no delay. | 
|  | 406 | */ | 
|  | 407 | switch (command) { | 
|  | 408 |  | 
|  | 409 | case NAND_CMD_PAGEPROG: | 
|  | 410 | case NAND_CMD_ERASE1: | 
|  | 411 | case NAND_CMD_ERASE2: | 
|  | 412 | case NAND_CMD_SEQIN: | 
|  | 413 | case NAND_CMD_STATUS: | 
|  | 414 | return; | 
|  | 415 |  | 
|  | 416 | case NAND_CMD_RESET: | 
|  | 417 | break; | 
|  | 418 |  | 
|  | 419 | case NAND_CMD_READ0: | 
|  | 420 | case NAND_CMD_READ1: | 
|  | 421 | case NAND_CMD_READOOB: | 
|  | 422 | /* Check if we're really driving -CE low (just in case) */ | 
|  | 423 | if (unlikely(!ce_override)) | 
|  | 424 | break; | 
|  | 425 |  | 
|  | 426 | /* Apply a short delay always to ensure that we do wait tWB. */ | 
|  | 427 | ndelay(100); | 
|  | 428 | /* Wait for a chip to become ready... */ | 
|  | 429 | for (i = this->chip_delay; !this->dev_ready(mtd) && i > 0; --i) | 
|  | 430 | udelay(1); | 
|  | 431 |  | 
|  | 432 | /* Release -CE and re-enable interrupts. */ | 
| Thomas Gleixner | 7abd3ef | 2006-05-23 23:25:53 +0200 | [diff] [blame] | 433 | au1550_hwcontrol(mtd, NAND_CTL_CLRNCE); | 
| Sergei Shtylyov | 35af68b | 2006-05-16 20:52:06 +0400 | [diff] [blame] | 434 | local_irq_restore(flags); | 
|  | 435 | return; | 
|  | 436 | } | 
|  | 437 | /* Apply this short delay always to ensure that we do wait tWB. */ | 
|  | 438 | ndelay(100); | 
|  | 439 |  | 
|  | 440 | while(!this->dev_ready(mtd)); | 
|  | 441 | } | 
|  | 442 |  | 
|  | 443 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 444 | /* | 
|  | 445 | * Main initialization routine | 
|  | 446 | */ | 
| David Woodhouse | cead4db | 2006-05-16 13:54:50 +0100 | [diff] [blame] | 447 | static int __init au1xxx_nand_init(void) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 448 | { | 
|  | 449 | struct nand_chip *this; | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 450 | u16 boot_swapboot = 0;	/* default value */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 451 | int retval; | 
| Pete Popov | ef6f0d1 | 2005-09-23 02:44:58 +0100 | [diff] [blame] | 452 | u32 mem_staddr; | 
|  | 453 | u32 nand_phys; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 454 |  | 
|  | 455 | /* Allocate memory for MTD device structure and private data */ | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 456 | au1550_mtd = kmalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip), GFP_KERNEL); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 457 | if (!au1550_mtd) { | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 458 | printk("Unable to allocate NAND MTD dev structure.\n"); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 459 | return -ENOMEM; | 
|  | 460 | } | 
|  | 461 |  | 
|  | 462 | /* Get pointer to private data */ | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 463 | this = (struct nand_chip *)(&au1550_mtd[1]); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 464 |  | 
|  | 465 | /* Initialize structures */ | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 466 | memset(au1550_mtd, 0, sizeof(struct mtd_info)); | 
|  | 467 | memset(this, 0, sizeof(struct nand_chip)); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 468 |  | 
|  | 469 | /* Link the private data with the MTD structure */ | 
|  | 470 | au1550_mtd->priv = this; | 
| David Woodhouse | 552d920 | 2006-05-14 01:20:46 +0100 | [diff] [blame] | 471 | au1550_mtd->owner = THIS_MODULE; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 472 |  | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 473 |  | 
| Sergei Shtylyov | 155285c | 2006-05-16 20:16:41 +0400 | [diff] [blame] | 474 | /* MEM_STNDCTL: disable ints, disable nand boot */ | 
|  | 475 | au_writel(0, MEM_STNDCTL); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 476 |  | 
|  | 477 | #ifdef CONFIG_MIPS_PB1550 | 
|  | 478 | /* set gpio206 high */ | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 479 | au_writel(au_readl(GPIO2_DIR) & ~(1 << 6), GPIO2_DIR); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 480 |  | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 481 | boot_swapboot = (au_readl(MEM_STSTAT) & (0x7 << 1)) | ((bcsr->status >> 6) & 0x1); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 482 | switch (boot_swapboot) { | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 483 | case 0: | 
|  | 484 | case 2: | 
|  | 485 | case 8: | 
|  | 486 | case 0xC: | 
|  | 487 | case 0xD: | 
|  | 488 | /* x16 NAND Flash */ | 
|  | 489 | nand_width = 0; | 
|  | 490 | break; | 
|  | 491 | case 1: | 
|  | 492 | case 9: | 
|  | 493 | case 3: | 
|  | 494 | case 0xE: | 
|  | 495 | case 0xF: | 
|  | 496 | /* x8 NAND Flash */ | 
|  | 497 | nand_width = 1; | 
|  | 498 | break; | 
|  | 499 | default: | 
|  | 500 | printk("Pb1550 NAND: bad boot:swap\n"); | 
|  | 501 | retval = -EINVAL; | 
|  | 502 | goto outmem; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 503 | } | 
|  | 504 | #endif | 
|  | 505 |  | 
| Pete Popov | ef6f0d1 | 2005-09-23 02:44:58 +0100 | [diff] [blame] | 506 | /* Configure chip-select; normally done by boot code, e.g. YAMON */ | 
|  | 507 | #ifdef NAND_STCFG | 
|  | 508 | if (NAND_CS == 0) { | 
|  | 509 | au_writel(NAND_STCFG,  MEM_STCFG0); | 
|  | 510 | au_writel(NAND_STTIME, MEM_STTIME0); | 
|  | 511 | au_writel(NAND_STADDR, MEM_STADDR0); | 
|  | 512 | } | 
|  | 513 | if (NAND_CS == 1) { | 
|  | 514 | au_writel(NAND_STCFG,  MEM_STCFG1); | 
|  | 515 | au_writel(NAND_STTIME, MEM_STTIME1); | 
|  | 516 | au_writel(NAND_STADDR, MEM_STADDR1); | 
|  | 517 | } | 
|  | 518 | if (NAND_CS == 2) { | 
|  | 519 | au_writel(NAND_STCFG,  MEM_STCFG2); | 
|  | 520 | au_writel(NAND_STTIME, MEM_STTIME2); | 
|  | 521 | au_writel(NAND_STADDR, MEM_STADDR2); | 
|  | 522 | } | 
|  | 523 | if (NAND_CS == 3) { | 
|  | 524 | au_writel(NAND_STCFG,  MEM_STCFG3); | 
|  | 525 | au_writel(NAND_STTIME, MEM_STTIME3); | 
|  | 526 | au_writel(NAND_STADDR, MEM_STADDR3); | 
|  | 527 | } | 
|  | 528 | #endif | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 529 |  | 
| Pete Popov | ef6f0d1 | 2005-09-23 02:44:58 +0100 | [diff] [blame] | 530 | /* Locate NAND chip-select in order to determine NAND phys address */ | 
|  | 531 | mem_staddr = 0x00000000; | 
|  | 532 | if (((au_readl(MEM_STCFG0) & 0x7) == 0x5) && (NAND_CS == 0)) | 
|  | 533 | mem_staddr = au_readl(MEM_STADDR0); | 
|  | 534 | else if (((au_readl(MEM_STCFG1) & 0x7) == 0x5) && (NAND_CS == 1)) | 
|  | 535 | mem_staddr = au_readl(MEM_STADDR1); | 
|  | 536 | else if (((au_readl(MEM_STCFG2) & 0x7) == 0x5) && (NAND_CS == 2)) | 
|  | 537 | mem_staddr = au_readl(MEM_STADDR2); | 
|  | 538 | else if (((au_readl(MEM_STCFG3) & 0x7) == 0x5) && (NAND_CS == 3)) | 
|  | 539 | mem_staddr = au_readl(MEM_STADDR3); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 540 |  | 
| Pete Popov | ef6f0d1 | 2005-09-23 02:44:58 +0100 | [diff] [blame] | 541 | if (mem_staddr == 0x00000000) { | 
|  | 542 | printk("Au1xxx NAND: ERROR WITH NAND CHIP-SELECT\n"); | 
|  | 543 | kfree(au1550_mtd); | 
|  | 544 | return 1; | 
|  | 545 | } | 
|  | 546 | nand_phys = (mem_staddr << 4) & 0xFFFC0000; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 547 |  | 
| Pete Popov | ef6f0d1 | 2005-09-23 02:44:58 +0100 | [diff] [blame] | 548 | p_nand = (void __iomem *)ioremap(nand_phys, 0x1000); | 
|  | 549 |  | 
|  | 550 | /* make controller and MTD agree */ | 
|  | 551 | if (NAND_CS == 0) | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 552 | nand_width = au_readl(MEM_STCFG0) & (1 << 22); | 
| Pete Popov | ef6f0d1 | 2005-09-23 02:44:58 +0100 | [diff] [blame] | 553 | if (NAND_CS == 1) | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 554 | nand_width = au_readl(MEM_STCFG1) & (1 << 22); | 
| Pete Popov | ef6f0d1 | 2005-09-23 02:44:58 +0100 | [diff] [blame] | 555 | if (NAND_CS == 2) | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 556 | nand_width = au_readl(MEM_STCFG2) & (1 << 22); | 
| Pete Popov | ef6f0d1 | 2005-09-23 02:44:58 +0100 | [diff] [blame] | 557 | if (NAND_CS == 3) | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 558 | nand_width = au_readl(MEM_STCFG3) & (1 << 22); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 559 |  | 
|  | 560 | /* Set address of hardware control function */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 561 | this->dev_ready = au1550_device_ready; | 
| Sergei Shtylyov | 35af68b | 2006-05-16 20:52:06 +0400 | [diff] [blame] | 562 | this->select_chip = au1550_select_chip; | 
|  | 563 | this->cmdfunc = au1550_command; | 
|  | 564 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 565 | /* 30 us command delay time */ | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 566 | this->chip_delay = 30; | 
| Thomas Gleixner | 6dfc6d2 | 2006-05-23 12:00:46 +0200 | [diff] [blame] | 567 | this->ecc.mode = NAND_ECC_SOFT; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 568 |  | 
|  | 569 | this->options = NAND_NO_AUTOINCR; | 
|  | 570 |  | 
|  | 571 | if (!nand_width) | 
|  | 572 | this->options |= NAND_BUSWIDTH_16; | 
|  | 573 |  | 
|  | 574 | this->read_byte = (!nand_width) ? au_read_byte16 : au_read_byte; | 
| Thomas Gleixner | cad74f2 | 2006-05-23 23:28:48 +0200 | [diff] [blame] | 575 | au1550_write_byte = (!nand_width) ? au_write_byte16 : au_write_byte; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 576 | this->read_word = au_read_word; | 
|  | 577 | this->write_buf = (!nand_width) ? au_write_buf16 : au_write_buf; | 
|  | 578 | this->read_buf = (!nand_width) ? au_read_buf16 : au_read_buf; | 
|  | 579 | this->verify_buf = (!nand_width) ? au_verify_buf16 : au_verify_buf; | 
|  | 580 |  | 
|  | 581 | /* Scan to find existence of the device */ | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 582 | if (nand_scan(au1550_mtd, 1)) { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 583 | retval = -ENXIO; | 
|  | 584 | goto outio; | 
|  | 585 | } | 
|  | 586 |  | 
|  | 587 | /* Register the partitions */ | 
| Tobias Klauser | 87d10f3 | 2006-03-31 02:29:45 -0800 | [diff] [blame] | 588 | add_mtd_partitions(au1550_mtd, partition_info, ARRAY_SIZE(partition_info)); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 589 |  | 
|  | 590 | return 0; | 
|  | 591 |  | 
|  | 592 | outio: | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 593 | iounmap((void *)p_nand); | 
| Thomas Gleixner | 61b03bd | 2005-11-07 11:15:49 +0000 | [diff] [blame] | 594 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 595 | outmem: | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 596 | kfree(au1550_mtd); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 597 | return retval; | 
|  | 598 | } | 
|  | 599 |  | 
| Pete Popov | ef6f0d1 | 2005-09-23 02:44:58 +0100 | [diff] [blame] | 600 | module_init(au1xxx_nand_init); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 601 |  | 
|  | 602 | /* | 
|  | 603 | * Clean up routine | 
|  | 604 | */ | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 605 | static void __exit au1550_cleanup(void) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 606 | { | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 607 | struct nand_chip *this = (struct nand_chip *)&au1550_mtd[1]; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 608 |  | 
|  | 609 | /* Release resources, unregister device */ | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 610 | nand_release(au1550_mtd); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 611 |  | 
|  | 612 | /* Free the MTD device structure */ | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 613 | kfree(au1550_mtd); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 614 |  | 
|  | 615 | /* Unmap */ | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 616 | iounmap((void *)p_nand); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 617 | } | 
| David Woodhouse | e0c7d76 | 2006-05-13 18:07:53 +0100 | [diff] [blame] | 618 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 619 | module_exit(au1550_cleanup); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 620 |  | 
|  | 621 | MODULE_LICENSE("GPL"); | 
|  | 622 | MODULE_AUTHOR("Embedded Edge, LLC"); | 
|  | 623 | MODULE_DESCRIPTION("Board-specific glue layer for NAND flash on Pb1550 board"); |