atmel_nand.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. /*
  2. * Copyright (C) 2003 Rick Bronson
  3. *
  4. * Derived from drivers/mtd/nand/autcpu12.c
  5. * Copyright (c) 2001 Thomas Gleixner (gleixner@autronix.de)
  6. *
  7. * Derived from drivers/mtd/spia.c
  8. * Copyright (C) 2000 Steven J. Hill (sjhill@cotw.com)
  9. *
  10. *
  11. * Add Hardware ECC support for AT91SAM9260 / AT91SAM9263
  12. * Richard Genoud (richard.genoud@gmail.com), Adeneo Copyright (C) 2007
  13. *
  14. * Derived from Das U-Boot source code
  15. * (u-boot-1.1.5/board/atmel/at91sam9263ek/nand.c)
  16. * (C) Copyright 2006 ATMEL Rousset, Lacressonniere Nicolas
  17. *
  18. *
  19. * This program is free software; you can redistribute it and/or modify
  20. * it under the terms of the GNU General Public License version 2 as
  21. * published by the Free Software Foundation.
  22. *
  23. */
  24. #include <linux/slab.h>
  25. #include <linux/module.h>
  26. #include <linux/platform_device.h>
  27. #include <linux/mtd/mtd.h>
  28. #include <linux/mtd/nand.h>
  29. #include <linux/mtd/partitions.h>
  30. #include <linux/gpio.h>
  31. #include <linux/io.h>
  32. #include <mach/board.h>
  33. #include <mach/cpu.h>
  34. #ifdef CONFIG_MTD_NAND_ATMEL_ECC_HW
  35. #define hard_ecc 1
  36. #else
  37. #define hard_ecc 0
  38. #endif
  39. #ifdef CONFIG_MTD_NAND_ATMEL_ECC_NONE
  40. #define no_ecc 1
  41. #else
  42. #define no_ecc 0
  43. #endif
  44. /* Register access macros */
  45. #define ecc_readl(add, reg) \
  46. __raw_readl(add + ATMEL_ECC_##reg)
  47. #define ecc_writel(add, reg, value) \
  48. __raw_writel((value), add + ATMEL_ECC_##reg)
  49. #include "atmel_nand_ecc.h" /* Hardware ECC registers */
  50. /* oob layout for large page size
  51. * bad block info is on bytes 0 and 1
  52. * the bytes have to be consecutives to avoid
  53. * several NAND_CMD_RNDOUT during read
  54. */
  55. static struct nand_ecclayout atmel_oobinfo_large = {
  56. .eccbytes = 4,
  57. .eccpos = {60, 61, 62, 63},
  58. .oobfree = {
  59. {2, 58}
  60. },
  61. };
  62. /* oob layout for small page size
  63. * bad block info is on bytes 4 and 5
  64. * the bytes have to be consecutives to avoid
  65. * several NAND_CMD_RNDOUT during read
  66. */
  67. static struct nand_ecclayout atmel_oobinfo_small = {
  68. .eccbytes = 4,
  69. .eccpos = {0, 1, 2, 3},
  70. .oobfree = {
  71. {6, 10}
  72. },
  73. };
  74. struct atmel_nand_host {
  75. struct nand_chip nand_chip;
  76. struct mtd_info mtd;
  77. void __iomem *io_base;
  78. struct atmel_nand_data *board;
  79. struct device *dev;
  80. void __iomem *ecc;
  81. };
  82. /*
  83. * Enable NAND.
  84. */
  85. static void atmel_nand_enable(struct atmel_nand_host *host)
  86. {
  87. if (host->board->enable_pin)
  88. gpio_set_value(host->board->enable_pin, 0);
  89. }
  90. /*
  91. * Disable NAND.
  92. */
  93. static void atmel_nand_disable(struct atmel_nand_host *host)
  94. {
  95. if (host->board->enable_pin)
  96. gpio_set_value(host->board->enable_pin, 1);
  97. }
  98. /*
  99. * Hardware specific access to control-lines
  100. */
  101. static void atmel_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
  102. {
  103. struct nand_chip *nand_chip = mtd->priv;
  104. struct atmel_nand_host *host = nand_chip->priv;
  105. if (ctrl & NAND_CTRL_CHANGE) {
  106. if (ctrl & NAND_NCE)
  107. atmel_nand_enable(host);
  108. else
  109. atmel_nand_disable(host);
  110. }
  111. if (cmd == NAND_CMD_NONE)
  112. return;
  113. if (ctrl & NAND_CLE)
  114. writeb(cmd, host->io_base + (1 << host->board->cle));
  115. else
  116. writeb(cmd, host->io_base + (1 << host->board->ale));
  117. }
  118. /*
  119. * Read the Device Ready pin.
  120. */
  121. static int atmel_nand_device_ready(struct mtd_info *mtd)
  122. {
  123. struct nand_chip *nand_chip = mtd->priv;
  124. struct atmel_nand_host *host = nand_chip->priv;
  125. return gpio_get_value(host->board->rdy_pin);
  126. }
  127. /*
  128. * Minimal-overhead PIO for data access.
  129. */
  130. static void atmel_read_buf(struct mtd_info *mtd, u8 *buf, int len)
  131. {
  132. struct nand_chip *nand_chip = mtd->priv;
  133. __raw_readsb(nand_chip->IO_ADDR_R, buf, len);
  134. }
  135. static void atmel_read_buf16(struct mtd_info *mtd, u8 *buf, int len)
  136. {
  137. struct nand_chip *nand_chip = mtd->priv;
  138. __raw_readsw(nand_chip->IO_ADDR_R, buf, len / 2);
  139. }
  140. static void atmel_write_buf(struct mtd_info *mtd, const u8 *buf, int len)
  141. {
  142. struct nand_chip *nand_chip = mtd->priv;
  143. __raw_writesb(nand_chip->IO_ADDR_W, buf, len);
  144. }
  145. static void atmel_write_buf16(struct mtd_info *mtd, const u8 *buf, int len)
  146. {
  147. struct nand_chip *nand_chip = mtd->priv;
  148. __raw_writesw(nand_chip->IO_ADDR_W, buf, len / 2);
  149. }
  150. /*
  151. * write oob for small pages
  152. */
  153. static int atmel_nand_write_oob_512(struct mtd_info *mtd,
  154. struct nand_chip *chip, int page)
  155. {
  156. int chunk = chip->ecc.bytes + chip->ecc.prepad + chip->ecc.postpad;
  157. int eccsize = chip->ecc.size, length = mtd->oobsize;
  158. int len, pos, status = 0;
  159. const uint8_t *bufpoi = chip->oob_poi;
  160. pos = eccsize + chunk;
  161. chip->cmdfunc(mtd, NAND_CMD_SEQIN, pos, page);
  162. len = min_t(int, length, chunk);
  163. chip->write_buf(mtd, bufpoi, len);
  164. bufpoi += len;
  165. length -= len;
  166. if (length > 0)
  167. chip->write_buf(mtd, bufpoi, length);
  168. chip->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1);
  169. status = chip->waitfunc(mtd, chip);
  170. return status & NAND_STATUS_FAIL ? -EIO : 0;
  171. }
  172. /*
  173. * read oob for small pages
  174. */
  175. static int atmel_nand_read_oob_512(struct mtd_info *mtd,
  176. struct nand_chip *chip, int page, int sndcmd)
  177. {
  178. if (sndcmd) {
  179. chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
  180. sndcmd = 0;
  181. }
  182. chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
  183. return sndcmd;
  184. }
  185. /*
  186. * Calculate HW ECC
  187. *
  188. * function called after a write
  189. *
  190. * mtd: MTD block structure
  191. * dat: raw data (unused)
  192. * ecc_code: buffer for ECC
  193. */
  194. static int atmel_nand_calculate(struct mtd_info *mtd,
  195. const u_char *dat, unsigned char *ecc_code)
  196. {
  197. struct nand_chip *nand_chip = mtd->priv;
  198. struct atmel_nand_host *host = nand_chip->priv;
  199. uint32_t *eccpos = nand_chip->ecc.layout->eccpos;
  200. unsigned int ecc_value;
  201. /* get the first 2 ECC bytes */
  202. ecc_value = ecc_readl(host->ecc, PR);
  203. ecc_code[eccpos[0]] = ecc_value & 0xFF;
  204. ecc_code[eccpos[1]] = (ecc_value >> 8) & 0xFF;
  205. /* get the last 2 ECC bytes */
  206. ecc_value = ecc_readl(host->ecc, NPR) & ATMEL_ECC_NPARITY;
  207. ecc_code[eccpos[2]] = ecc_value & 0xFF;
  208. ecc_code[eccpos[3]] = (ecc_value >> 8) & 0xFF;
  209. return 0;
  210. }
  211. /*
  212. * HW ECC read page function
  213. *
  214. * mtd: mtd info structure
  215. * chip: nand chip info structure
  216. * buf: buffer to store read data
  217. */
  218. static int atmel_nand_read_page(struct mtd_info *mtd,
  219. struct nand_chip *chip, uint8_t *buf)
  220. {
  221. int eccsize = chip->ecc.size;
  222. int eccbytes = chip->ecc.bytes;
  223. uint32_t *eccpos = chip->ecc.layout->eccpos;
  224. uint8_t *p = buf;
  225. uint8_t *oob = chip->oob_poi;
  226. uint8_t *ecc_pos;
  227. int stat;
  228. /*
  229. * Errata: ALE is incorrectly wired up to the ECC controller
  230. * on the AP7000, so it will include the address cycles in the
  231. * ECC calculation.
  232. *
  233. * Workaround: Reset the parity registers before reading the
  234. * actual data.
  235. */
  236. if (cpu_is_at32ap7000()) {
  237. struct atmel_nand_host *host = chip->priv;
  238. ecc_writel(host->ecc, CR, ATMEL_ECC_RST);
  239. }
  240. /* read the page */
  241. chip->read_buf(mtd, p, eccsize);
  242. /* move to ECC position if needed */
  243. if (eccpos[0] != 0) {
  244. /* This only works on large pages
  245. * because the ECC controller waits for
  246. * NAND_CMD_RNDOUTSTART after the
  247. * NAND_CMD_RNDOUT.
  248. * anyway, for small pages, the eccpos[0] == 0
  249. */
  250. chip->cmdfunc(mtd, NAND_CMD_RNDOUT,
  251. mtd->writesize + eccpos[0], -1);
  252. }
  253. /* the ECC controller needs to read the ECC just after the data */
  254. ecc_pos = oob + eccpos[0];
  255. chip->read_buf(mtd, ecc_pos, eccbytes);
  256. /* check if there's an error */
  257. stat = chip->ecc.correct(mtd, p, oob, NULL);
  258. if (stat < 0)
  259. mtd->ecc_stats.failed++;
  260. else
  261. mtd->ecc_stats.corrected += stat;
  262. /* get back to oob start (end of page) */
  263. chip->cmdfunc(mtd, NAND_CMD_RNDOUT, mtd->writesize, -1);
  264. /* read the oob */
  265. chip->read_buf(mtd, oob, mtd->oobsize);
  266. return 0;
  267. }
  268. /*
  269. * HW ECC Correction
  270. *
  271. * function called after a read
  272. *
  273. * mtd: MTD block structure
  274. * dat: raw data read from the chip
  275. * read_ecc: ECC from the chip (unused)
  276. * isnull: unused
  277. *
  278. * Detect and correct a 1 bit error for a page
  279. */
  280. static int atmel_nand_correct(struct mtd_info *mtd, u_char *dat,
  281. u_char *read_ecc, u_char *isnull)
  282. {
  283. struct nand_chip *nand_chip = mtd->priv;
  284. struct atmel_nand_host *host = nand_chip->priv;
  285. unsigned int ecc_status;
  286. unsigned int ecc_word, ecc_bit;
  287. /* get the status from the Status Register */
  288. ecc_status = ecc_readl(host->ecc, SR);
  289. /* if there's no error */
  290. if (likely(!(ecc_status & ATMEL_ECC_RECERR)))
  291. return 0;
  292. /* get error bit offset (4 bits) */
  293. ecc_bit = ecc_readl(host->ecc, PR) & ATMEL_ECC_BITADDR;
  294. /* get word address (12 bits) */
  295. ecc_word = ecc_readl(host->ecc, PR) & ATMEL_ECC_WORDADDR;
  296. ecc_word >>= 4;
  297. /* if there are multiple errors */
  298. if (ecc_status & ATMEL_ECC_MULERR) {
  299. /* check if it is a freshly erased block
  300. * (filled with 0xff) */
  301. if ((ecc_bit == ATMEL_ECC_BITADDR)
  302. && (ecc_word == (ATMEL_ECC_WORDADDR >> 4))) {
  303. /* the block has just been erased, return OK */
  304. return 0;
  305. }
  306. /* it doesn't seems to be a freshly
  307. * erased block.
  308. * We can't correct so many errors */
  309. dev_dbg(host->dev, "atmel_nand : multiple errors detected."
  310. " Unable to correct.\n");
  311. return -EIO;
  312. }
  313. /* if there's a single bit error : we can correct it */
  314. if (ecc_status & ATMEL_ECC_ECCERR) {
  315. /* there's nothing much to do here.
  316. * the bit error is on the ECC itself.
  317. */
  318. dev_dbg(host->dev, "atmel_nand : one bit error on ECC code."
  319. " Nothing to correct\n");
  320. return 0;
  321. }
  322. dev_dbg(host->dev, "atmel_nand : one bit error on data."
  323. " (word offset in the page :"
  324. " 0x%x bit offset : 0x%x)\n",
  325. ecc_word, ecc_bit);
  326. /* correct the error */
  327. if (nand_chip->options & NAND_BUSWIDTH_16) {
  328. /* 16 bits words */
  329. ((unsigned short *) dat)[ecc_word] ^= (1 << ecc_bit);
  330. } else {
  331. /* 8 bits words */
  332. dat[ecc_word] ^= (1 << ecc_bit);
  333. }
  334. dev_dbg(host->dev, "atmel_nand : error corrected\n");
  335. return 1;
  336. }
  337. /*
  338. * Enable HW ECC : unused on most chips
  339. */
  340. static void atmel_nand_hwctl(struct mtd_info *mtd, int mode)
  341. {
  342. if (cpu_is_at32ap7000()) {
  343. struct nand_chip *nand_chip = mtd->priv;
  344. struct atmel_nand_host *host = nand_chip->priv;
  345. ecc_writel(host->ecc, CR, ATMEL_ECC_RST);
  346. }
  347. }
  348. #ifdef CONFIG_MTD_PARTITIONS
  349. static const char *part_probes[] = { "cmdlinepart", NULL };
  350. #endif
  351. /*
  352. * Probe for the NAND device.
  353. */
  354. static int __init atmel_nand_probe(struct platform_device *pdev)
  355. {
  356. struct atmel_nand_host *host;
  357. struct mtd_info *mtd;
  358. struct nand_chip *nand_chip;
  359. struct resource *regs;
  360. struct resource *mem;
  361. int res;
  362. #ifdef CONFIG_MTD_PARTITIONS
  363. struct mtd_partition *partitions = NULL;
  364. int num_partitions = 0;
  365. #endif
  366. mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  367. if (!mem) {
  368. printk(KERN_ERR "atmel_nand: can't get I/O resource mem\n");
  369. return -ENXIO;
  370. }
  371. /* Allocate memory for the device structure (and zero it) */
  372. host = kzalloc(sizeof(struct atmel_nand_host), GFP_KERNEL);
  373. if (!host) {
  374. printk(KERN_ERR "atmel_nand: failed to allocate device structure.\n");
  375. return -ENOMEM;
  376. }
  377. host->io_base = ioremap(mem->start, mem->end - mem->start + 1);
  378. if (host->io_base == NULL) {
  379. printk(KERN_ERR "atmel_nand: ioremap failed\n");
  380. res = -EIO;
  381. goto err_nand_ioremap;
  382. }
  383. mtd = &host->mtd;
  384. nand_chip = &host->nand_chip;
  385. host->board = pdev->dev.platform_data;
  386. host->dev = &pdev->dev;
  387. nand_chip->priv = host; /* link the private data structures */
  388. mtd->priv = nand_chip;
  389. mtd->owner = THIS_MODULE;
  390. /* Set address of NAND IO lines */
  391. nand_chip->IO_ADDR_R = host->io_base;
  392. nand_chip->IO_ADDR_W = host->io_base;
  393. nand_chip->cmd_ctrl = atmel_nand_cmd_ctrl;
  394. if (host->board->rdy_pin)
  395. nand_chip->dev_ready = atmel_nand_device_ready;
  396. regs = platform_get_resource(pdev, IORESOURCE_MEM, 1);
  397. if (!regs && hard_ecc) {
  398. printk(KERN_ERR "atmel_nand: can't get I/O resource "
  399. "regs\nFalling back on software ECC\n");
  400. }
  401. nand_chip->ecc.mode = NAND_ECC_SOFT; /* enable ECC */
  402. if (no_ecc)
  403. nand_chip->ecc.mode = NAND_ECC_NONE;
  404. if (hard_ecc && regs) {
  405. host->ecc = ioremap(regs->start, regs->end - regs->start + 1);
  406. if (host->ecc == NULL) {
  407. printk(KERN_ERR "atmel_nand: ioremap failed\n");
  408. res = -EIO;
  409. goto err_ecc_ioremap;
  410. }
  411. nand_chip->ecc.mode = NAND_ECC_HW_SYNDROME;
  412. nand_chip->ecc.calculate = atmel_nand_calculate;
  413. nand_chip->ecc.correct = atmel_nand_correct;
  414. nand_chip->ecc.hwctl = atmel_nand_hwctl;
  415. nand_chip->ecc.read_page = atmel_nand_read_page;
  416. nand_chip->ecc.bytes = 4;
  417. nand_chip->ecc.prepad = 0;
  418. nand_chip->ecc.postpad = 0;
  419. }
  420. nand_chip->chip_delay = 20; /* 20us command delay time */
  421. if (host->board->bus_width_16) { /* 16-bit bus width */
  422. nand_chip->options |= NAND_BUSWIDTH_16;
  423. nand_chip->read_buf = atmel_read_buf16;
  424. nand_chip->write_buf = atmel_write_buf16;
  425. } else {
  426. nand_chip->read_buf = atmel_read_buf;
  427. nand_chip->write_buf = atmel_write_buf;
  428. }
  429. platform_set_drvdata(pdev, host);
  430. atmel_nand_enable(host);
  431. if (host->board->det_pin) {
  432. if (gpio_get_value(host->board->det_pin)) {
  433. printk("No SmartMedia card inserted.\n");
  434. res = ENXIO;
  435. goto err_no_card;
  436. }
  437. }
  438. /* first scan to find the device and get the page size */
  439. if (nand_scan_ident(mtd, 1)) {
  440. res = -ENXIO;
  441. goto err_scan_ident;
  442. }
  443. if (nand_chip->ecc.mode == NAND_ECC_HW_SYNDROME) {
  444. /* ECC is calculated for the whole page (1 step) */
  445. nand_chip->ecc.size = mtd->writesize;
  446. /* set ECC page size and oob layout */
  447. switch (mtd->writesize) {
  448. case 512:
  449. nand_chip->ecc.layout = &atmel_oobinfo_small;
  450. nand_chip->ecc.read_oob = atmel_nand_read_oob_512;
  451. nand_chip->ecc.write_oob = atmel_nand_write_oob_512;
  452. ecc_writel(host->ecc, MR, ATMEL_ECC_PAGESIZE_528);
  453. break;
  454. case 1024:
  455. nand_chip->ecc.layout = &atmel_oobinfo_large;
  456. ecc_writel(host->ecc, MR, ATMEL_ECC_PAGESIZE_1056);
  457. break;
  458. case 2048:
  459. nand_chip->ecc.layout = &atmel_oobinfo_large;
  460. ecc_writel(host->ecc, MR, ATMEL_ECC_PAGESIZE_2112);
  461. break;
  462. case 4096:
  463. nand_chip->ecc.layout = &atmel_oobinfo_large;
  464. ecc_writel(host->ecc, MR, ATMEL_ECC_PAGESIZE_4224);
  465. break;
  466. default:
  467. /* page size not handled by HW ECC */
  468. /* switching back to soft ECC */
  469. nand_chip->ecc.mode = NAND_ECC_SOFT;
  470. nand_chip->ecc.calculate = NULL;
  471. nand_chip->ecc.correct = NULL;
  472. nand_chip->ecc.hwctl = NULL;
  473. nand_chip->ecc.read_page = NULL;
  474. nand_chip->ecc.postpad = 0;
  475. nand_chip->ecc.prepad = 0;
  476. nand_chip->ecc.bytes = 0;
  477. break;
  478. }
  479. }
  480. /* second phase scan */
  481. if (nand_scan_tail(mtd)) {
  482. res = -ENXIO;
  483. goto err_scan_tail;
  484. }
  485. #ifdef CONFIG_MTD_PARTITIONS
  486. #ifdef CONFIG_MTD_CMDLINE_PARTS
  487. mtd->name = "atmel_nand";
  488. num_partitions = parse_mtd_partitions(mtd, part_probes,
  489. &partitions, 0);
  490. #endif
  491. if (num_partitions <= 0 && host->board->partition_info)
  492. partitions = host->board->partition_info(mtd->size,
  493. &num_partitions);
  494. if ((!partitions) || (num_partitions == 0)) {
  495. printk(KERN_ERR "atmel_nand: No parititions defined, or unsupported device.\n");
  496. res = ENXIO;
  497. goto err_no_partitions;
  498. }
  499. res = add_mtd_partitions(mtd, partitions, num_partitions);
  500. #else
  501. res = add_mtd_device(mtd);
  502. #endif
  503. if (!res)
  504. return res;
  505. #ifdef CONFIG_MTD_PARTITIONS
  506. err_no_partitions:
  507. #endif
  508. nand_release(mtd);
  509. err_scan_tail:
  510. err_scan_ident:
  511. err_no_card:
  512. atmel_nand_disable(host);
  513. platform_set_drvdata(pdev, NULL);
  514. if (host->ecc)
  515. iounmap(host->ecc);
  516. err_ecc_ioremap:
  517. iounmap(host->io_base);
  518. err_nand_ioremap:
  519. kfree(host);
  520. return res;
  521. }
  522. /*
  523. * Remove a NAND device.
  524. */
  525. static int __exit atmel_nand_remove(struct platform_device *pdev)
  526. {
  527. struct atmel_nand_host *host = platform_get_drvdata(pdev);
  528. struct mtd_info *mtd = &host->mtd;
  529. nand_release(mtd);
  530. atmel_nand_disable(host);
  531. if (host->ecc)
  532. iounmap(host->ecc);
  533. iounmap(host->io_base);
  534. kfree(host);
  535. return 0;
  536. }
  537. static struct platform_driver atmel_nand_driver = {
  538. .remove = __exit_p(atmel_nand_remove),
  539. .driver = {
  540. .name = "atmel_nand",
  541. .owner = THIS_MODULE,
  542. },
  543. };
  544. static int __init atmel_nand_init(void)
  545. {
  546. return platform_driver_probe(&atmel_nand_driver, atmel_nand_probe);
  547. }
  548. static void __exit atmel_nand_exit(void)
  549. {
  550. platform_driver_unregister(&atmel_nand_driver);
  551. }
  552. module_init(atmel_nand_init);
  553. module_exit(atmel_nand_exit);
  554. MODULE_LICENSE("GPL");
  555. MODULE_AUTHOR("Rick Bronson");
  556. MODULE_DESCRIPTION("NAND/SmartMedia driver for AT91 / AVR32");
  557. MODULE_ALIAS("platform:atmel_nand");