nand.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. /*
  2. * (C) Copyright 2006 DENX Software Engineering
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. #include <common.h>
  23. #if defined(CONFIG_CMD_NAND)
  24. #ifdef CONFIG_NEW_NAND_CODE
  25. #include <nand.h>
  26. #include <asm/arch/pxa-regs.h>
  27. #ifdef CFG_DFC_DEBUG1
  28. # define DFC_DEBUG1(fmt, args...) printf(fmt, ##args)
  29. #else
  30. # define DFC_DEBUG1(fmt, args...)
  31. #endif
  32. #ifdef CFG_DFC_DEBUG2
  33. # define DFC_DEBUG2(fmt, args...) printf(fmt, ##args)
  34. #else
  35. # define DFC_DEBUG2(fmt, args...)
  36. #endif
  37. #ifdef CFG_DFC_DEBUG3
  38. # define DFC_DEBUG3(fmt, args...) printf(fmt, ##args)
  39. #else
  40. # define DFC_DEBUG3(fmt, args...)
  41. #endif
  42. #define MIN(x, y) ((x < y) ? x : y)
  43. /* These really don't belong here, as they are specific to the NAND Model */
  44. static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
  45. static struct nand_bbt_descr delta_bbt_descr = {
  46. .options = 0,
  47. .offs = 0,
  48. .len = 2,
  49. .pattern = scan_ff_pattern
  50. };
  51. static struct nand_ecclayout delta_oob = {
  52. .eccbytes = 6,
  53. .eccpos = {2, 3, 4, 5, 6, 7},
  54. .oobfree = { {8, 2}, {12, 4} }
  55. };
  56. /*
  57. * not required for Monahans DFC
  58. */
  59. static void dfc_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
  60. {
  61. return;
  62. }
  63. #if 0
  64. /* read device ready pin */
  65. static int dfc_device_ready(struct mtd_info *mtdinfo)
  66. {
  67. if(NDSR & NDSR_RDY)
  68. return 1;
  69. else
  70. return 0;
  71. return 0;
  72. }
  73. #endif
  74. /*
  75. * Write buf to the DFC Controller Data Buffer
  76. */
  77. static void dfc_write_buf(struct mtd_info *mtd, const u_char *buf, int len)
  78. {
  79. unsigned long bytes_multi = len & 0xfffffffc;
  80. unsigned long rest = len & 0x3;
  81. unsigned long *long_buf;
  82. int i;
  83. DFC_DEBUG2("dfc_write_buf: writing %d bytes starting with 0x%x.\n", len, *((unsigned long*) buf));
  84. if(bytes_multi) {
  85. for(i=0; i<bytes_multi; i+=4) {
  86. long_buf = (unsigned long*) &buf[i];
  87. NDDB = *long_buf;
  88. }
  89. }
  90. if(rest) {
  91. printf("dfc_write_buf: ERROR, writing non 4-byte aligned data.\n");
  92. }
  93. return;
  94. }
  95. /* The original:
  96. * static void dfc_read_buf(struct mtd_info *mtd, const u_char *buf, int len)
  97. *
  98. * Shouldn't this be "u_char * const buf" ?
  99. */
  100. static void dfc_read_buf(struct mtd_info *mtd, u_char* const buf, int len)
  101. {
  102. int i=0, j;
  103. /* we have to be carefull not to overflow the buffer if len is
  104. * not a multiple of 4 */
  105. unsigned long bytes_multi = len & 0xfffffffc;
  106. unsigned long rest = len & 0x3;
  107. unsigned long *long_buf;
  108. DFC_DEBUG3("dfc_read_buf: reading %d bytes.\n", len);
  109. /* if there are any, first copy multiple of 4 bytes */
  110. if(bytes_multi) {
  111. for(i=0; i<bytes_multi; i+=4) {
  112. long_buf = (unsigned long*) &buf[i];
  113. *long_buf = NDDB;
  114. }
  115. }
  116. /* ...then the rest */
  117. if(rest) {
  118. unsigned long rest_data = NDDB;
  119. for(j=0;j<rest; j++)
  120. buf[i+j] = (u_char) ((rest_data>>j) & 0xff);
  121. }
  122. return;
  123. }
  124. /*
  125. * read a word. Not implemented as not used in NAND code.
  126. */
  127. static u16 dfc_read_word(struct mtd_info *mtd)
  128. {
  129. printf("dfc_read_word: UNIMPLEMENTED.\n");
  130. return 0;
  131. }
  132. /* global var, too bad: mk@tbd: move to ->priv pointer */
  133. static unsigned long read_buf = 0;
  134. static int bytes_read = -1;
  135. /*
  136. * read a byte from NDDB Because we can only read 4 bytes from NDDB at
  137. * a time, we buffer the remaining bytes. The buffer is reset when a
  138. * new command is sent to the chip.
  139. *
  140. * WARNING:
  141. * This function is currently only used to read status and id
  142. * bytes. For these commands always 8 bytes need to be read from
  143. * NDDB. So we read and discard these bytes right now. In case this
  144. * function is used for anything else in the future, we must check
  145. * what was the last command issued and read the appropriate amount of
  146. * bytes respectively.
  147. */
  148. static u_char dfc_read_byte(struct mtd_info *mtd)
  149. {
  150. unsigned char byte;
  151. unsigned long dummy;
  152. if(bytes_read < 0) {
  153. read_buf = NDDB;
  154. dummy = NDDB;
  155. bytes_read = 0;
  156. }
  157. byte = (unsigned char) (read_buf>>(8 * bytes_read++));
  158. if(bytes_read >= 4)
  159. bytes_read = -1;
  160. DFC_DEBUG2("dfc_read_byte: byte %u: 0x%x of (0x%x).\n", bytes_read - 1, byte, read_buf);
  161. return byte;
  162. }
  163. /* calculate delta between OSCR values start and now */
  164. static unsigned long get_delta(unsigned long start)
  165. {
  166. unsigned long cur = OSCR;
  167. if(cur < start) /* OSCR overflowed */
  168. return (cur + (start^0xffffffff));
  169. else
  170. return (cur - start);
  171. }
  172. /* delay function, this doesn't belong here */
  173. static void wait_us(unsigned long us)
  174. {
  175. unsigned long start = OSCR;
  176. us *= OSCR_CLK_FREQ;
  177. while (get_delta(start) < us) {
  178. /* do nothing */
  179. }
  180. }
  181. static void dfc_clear_nddb(void)
  182. {
  183. NDCR &= ~NDCR_ND_RUN;
  184. wait_us(CFG_NAND_OTHER_TO);
  185. }
  186. /* wait_event with timeout */
  187. static unsigned long dfc_wait_event(unsigned long event)
  188. {
  189. unsigned long ndsr, timeout, start = OSCR;
  190. if(!event)
  191. return 0xff000000;
  192. else if(event & (NDSR_CS0_CMDD | NDSR_CS0_BBD))
  193. timeout = CFG_NAND_PROG_ERASE_TO * OSCR_CLK_FREQ;
  194. else
  195. timeout = CFG_NAND_OTHER_TO * OSCR_CLK_FREQ;
  196. while(1) {
  197. ndsr = NDSR;
  198. if(ndsr & event) {
  199. NDSR |= event;
  200. break;
  201. }
  202. if(get_delta(start) > timeout) {
  203. DFC_DEBUG1("dfc_wait_event: TIMEOUT waiting for event: 0x%lx.\n", event);
  204. return 0xff000000;
  205. }
  206. }
  207. return ndsr;
  208. }
  209. /* we don't always wan't to do this */
  210. static void dfc_new_cmd(void)
  211. {
  212. int retry = 0;
  213. unsigned long status;
  214. while(retry++ <= CFG_NAND_SENDCMD_RETRY) {
  215. /* Clear NDSR */
  216. NDSR = 0xFFF;
  217. /* set NDCR[NDRUN] */
  218. if(!(NDCR & NDCR_ND_RUN))
  219. NDCR |= NDCR_ND_RUN;
  220. status = dfc_wait_event(NDSR_WRCMDREQ);
  221. if(status & NDSR_WRCMDREQ)
  222. return;
  223. DFC_DEBUG2("dfc_new_cmd: FAILED to get WRITECMDREQ, retry: %d.\n", retry);
  224. dfc_clear_nddb();
  225. }
  226. DFC_DEBUG1("dfc_new_cmd: giving up after %d retries.\n", retry);
  227. }
  228. /* this function is called after Programm and Erase Operations to
  229. * check for success or failure */
  230. static int dfc_wait(struct mtd_info *mtd, struct nand_chip *this)
  231. {
  232. unsigned long ndsr=0, event=0;
  233. int state = this->state;
  234. if(state == FL_WRITING) {
  235. event = NDSR_CS0_CMDD | NDSR_CS0_BBD;
  236. } else if(state == FL_ERASING) {
  237. event = NDSR_CS0_CMDD | NDSR_CS0_BBD;
  238. }
  239. ndsr = dfc_wait_event(event);
  240. if((ndsr & NDSR_CS0_BBD) || (ndsr & 0xff000000))
  241. return(0x1); /* Status Read error */
  242. return 0;
  243. }
  244. /* cmdfunc send commands to the DFC */
  245. static void dfc_cmdfunc(struct mtd_info *mtd, unsigned command,
  246. int column, int page_addr)
  247. {
  248. /* register struct nand_chip *this = mtd->priv; */
  249. unsigned long ndcb0=0, ndcb1=0, ndcb2=0, event=0;
  250. /* clear the ugly byte read buffer */
  251. bytes_read = -1;
  252. read_buf = 0;
  253. switch (command) {
  254. case NAND_CMD_READ0:
  255. DFC_DEBUG3("dfc_cmdfunc: NAND_CMD_READ0, page_addr: 0x%x, column: 0x%x.\n", page_addr, (column>>1));
  256. dfc_new_cmd();
  257. ndcb0 = (NAND_CMD_READ0 | (4<<16));
  258. column >>= 1; /* adjust for 16 bit bus */
  259. ndcb1 = (((column>>1) & 0xff) |
  260. ((page_addr<<8) & 0xff00) |
  261. ((page_addr<<8) & 0xff0000) |
  262. ((page_addr<<8) & 0xff000000)); /* make this 0x01000000 ? */
  263. event = NDSR_RDDREQ;
  264. goto write_cmd;
  265. case NAND_CMD_READ1:
  266. DFC_DEBUG2("dfc_cmdfunc: NAND_CMD_READ1 unimplemented!\n");
  267. goto end;
  268. case NAND_CMD_READOOB:
  269. DFC_DEBUG1("dfc_cmdfunc: NAND_CMD_READOOB unimplemented!\n");
  270. goto end;
  271. case NAND_CMD_READID:
  272. dfc_new_cmd();
  273. DFC_DEBUG2("dfc_cmdfunc: NAND_CMD_READID.\n");
  274. ndcb0 = (NAND_CMD_READID | (3 << 21) | (1 << 16)); /* addr cycles*/
  275. event = NDSR_RDDREQ;
  276. goto write_cmd;
  277. case NAND_CMD_PAGEPROG:
  278. /* sent as a multicommand in NAND_CMD_SEQIN */
  279. DFC_DEBUG2("dfc_cmdfunc: NAND_CMD_PAGEPROG empty due to multicmd.\n");
  280. goto end;
  281. case NAND_CMD_ERASE1:
  282. DFC_DEBUG2("dfc_cmdfunc: NAND_CMD_ERASE1, page_addr: 0x%x, column: 0x%x.\n", page_addr, (column>>1));
  283. dfc_new_cmd();
  284. ndcb0 = (0xd060 | (1<<25) | (2<<21) | (1<<19) | (3<<16));
  285. ndcb1 = (page_addr & 0x00ffffff);
  286. goto write_cmd;
  287. case NAND_CMD_ERASE2:
  288. DFC_DEBUG2("dfc_cmdfunc: NAND_CMD_ERASE2 empty due to multicmd.\n");
  289. goto end;
  290. case NAND_CMD_SEQIN:
  291. /* send PAGE_PROG command(0x1080) */
  292. dfc_new_cmd();
  293. DFC_DEBUG2("dfc_cmdfunc: NAND_CMD_SEQIN/PAGE_PROG, page_addr: 0x%x, column: 0x%x.\n", page_addr, (column>>1));
  294. ndcb0 = (0x1080 | (1<<25) | (1<<21) | (1<<19) | (4<<16));
  295. column >>= 1; /* adjust for 16 bit bus */
  296. ndcb1 = (((column>>1) & 0xff) |
  297. ((page_addr<<8) & 0xff00) |
  298. ((page_addr<<8) & 0xff0000) |
  299. ((page_addr<<8) & 0xff000000)); /* make this 0x01000000 ? */
  300. event = NDSR_WRDREQ;
  301. goto write_cmd;
  302. case NAND_CMD_STATUS:
  303. DFC_DEBUG2("dfc_cmdfunc: NAND_CMD_STATUS.\n");
  304. dfc_new_cmd();
  305. ndcb0 = NAND_CMD_STATUS | (4<<21);
  306. event = NDSR_RDDREQ;
  307. goto write_cmd;
  308. case NAND_CMD_RESET:
  309. DFC_DEBUG2("dfc_cmdfunc: NAND_CMD_RESET.\n");
  310. ndcb0 = NAND_CMD_RESET | (5<<21);
  311. event = NDSR_CS0_CMDD;
  312. goto write_cmd;
  313. default:
  314. printk("dfc_cmdfunc: error, unsupported command.\n");
  315. goto end;
  316. }
  317. write_cmd:
  318. NDCB0 = ndcb0;
  319. NDCB0 = ndcb1;
  320. NDCB0 = ndcb2;
  321. /* wait_event: */
  322. dfc_wait_event(event);
  323. end:
  324. return;
  325. }
  326. static void dfc_gpio_init(void)
  327. {
  328. DFC_DEBUG2("Setting up DFC GPIO's.\n");
  329. /* no idea what is done here, see zylonite.c */
  330. GPIO4 = 0x1;
  331. DF_ALE_WE1 = 0x00000001;
  332. DF_ALE_WE2 = 0x00000001;
  333. DF_nCS0 = 0x00000001;
  334. DF_nCS1 = 0x00000001;
  335. DF_nWE = 0x00000001;
  336. DF_nRE = 0x00000001;
  337. DF_IO0 = 0x00000001;
  338. DF_IO8 = 0x00000001;
  339. DF_IO1 = 0x00000001;
  340. DF_IO9 = 0x00000001;
  341. DF_IO2 = 0x00000001;
  342. DF_IO10 = 0x00000001;
  343. DF_IO3 = 0x00000001;
  344. DF_IO11 = 0x00000001;
  345. DF_IO4 = 0x00000001;
  346. DF_IO12 = 0x00000001;
  347. DF_IO5 = 0x00000001;
  348. DF_IO13 = 0x00000001;
  349. DF_IO6 = 0x00000001;
  350. DF_IO14 = 0x00000001;
  351. DF_IO7 = 0x00000001;
  352. DF_IO15 = 0x00000001;
  353. DF_nWE = 0x1901;
  354. DF_nRE = 0x1901;
  355. DF_CLE_NOE = 0x1900;
  356. DF_ALE_WE1 = 0x1901;
  357. DF_INT_RnB = 0x1900;
  358. }
  359. /*
  360. * Board-specific NAND initialization. The following members of the
  361. * argument are board-specific (per include/linux/mtd/nand_new.h):
  362. * - IO_ADDR_R?: address to read the 8 I/O lines of the flash device
  363. * - IO_ADDR_W?: address to write the 8 I/O lines of the flash device
  364. * - cmd_ctrl: hardwarespecific function for accesing control-lines
  365. * - dev_ready: hardwarespecific function for accesing device ready/busy line
  366. * - enable_hwecc?: function to enable (reset) hardware ecc generator. Must
  367. * only be provided if a hardware ECC is available
  368. * - ecc.mode: mode of ecc, see defines
  369. * - chip_delay: chip dependent delay for transfering data from array to
  370. * read regs (tR)
  371. * - options: various chip options. They can partly be set to inform
  372. * nand_scan about special functionality. See the defines for further
  373. * explanation
  374. * Members with a "?" were not set in the merged testing-NAND branch,
  375. * so they are not set here either.
  376. */
  377. int board_nand_init(struct nand_chip *nand)
  378. {
  379. unsigned long tCH, tCS, tWH, tWP, tRH, tRP, tRP_high, tR, tWHR, tAR;
  380. /* set up GPIO Control Registers */
  381. dfc_gpio_init();
  382. /* turn on the NAND Controller Clock (104 MHz @ D0) */
  383. CKENA |= (CKENA_4_NAND | CKENA_9_SMC);
  384. #undef CFG_TIMING_TIGHT
  385. #ifndef CFG_TIMING_TIGHT
  386. tCH = MIN(((unsigned long) (NAND_TIMING_tCH * DFC_CLK_PER_US) + 1),
  387. DFC_MAX_tCH);
  388. tCS = MIN(((unsigned long) (NAND_TIMING_tCS * DFC_CLK_PER_US) + 1),
  389. DFC_MAX_tCS);
  390. tWH = MIN(((unsigned long) (NAND_TIMING_tWH * DFC_CLK_PER_US) + 1),
  391. DFC_MAX_tWH);
  392. tWP = MIN(((unsigned long) (NAND_TIMING_tWP * DFC_CLK_PER_US) + 1),
  393. DFC_MAX_tWP);
  394. tRH = MIN(((unsigned long) (NAND_TIMING_tRH * DFC_CLK_PER_US) + 1),
  395. DFC_MAX_tRH);
  396. tRP = MIN(((unsigned long) (NAND_TIMING_tRP * DFC_CLK_PER_US) + 1),
  397. DFC_MAX_tRP);
  398. tR = MIN(((unsigned long) (NAND_TIMING_tR * DFC_CLK_PER_US) + 1),
  399. DFC_MAX_tR);
  400. tWHR = MIN(((unsigned long) (NAND_TIMING_tWHR * DFC_CLK_PER_US) + 1),
  401. DFC_MAX_tWHR);
  402. tAR = MIN(((unsigned long) (NAND_TIMING_tAR * DFC_CLK_PER_US) + 1),
  403. DFC_MAX_tAR);
  404. #else /* this is the tight timing */
  405. tCH = MIN(((unsigned long) (NAND_TIMING_tCH * DFC_CLK_PER_US)),
  406. DFC_MAX_tCH);
  407. tCS = MIN(((unsigned long) (NAND_TIMING_tCS * DFC_CLK_PER_US)),
  408. DFC_MAX_tCS);
  409. tWH = MIN(((unsigned long) (NAND_TIMING_tWH * DFC_CLK_PER_US)),
  410. DFC_MAX_tWH);
  411. tWP = MIN(((unsigned long) (NAND_TIMING_tWP * DFC_CLK_PER_US)),
  412. DFC_MAX_tWP);
  413. tRH = MIN(((unsigned long) (NAND_TIMING_tRH * DFC_CLK_PER_US)),
  414. DFC_MAX_tRH);
  415. tRP = MIN(((unsigned long) (NAND_TIMING_tRP * DFC_CLK_PER_US)),
  416. DFC_MAX_tRP);
  417. tR = MIN(((unsigned long) (NAND_TIMING_tR * DFC_CLK_PER_US) - tCH - 2),
  418. DFC_MAX_tR);
  419. tWHR = MIN(((unsigned long) (NAND_TIMING_tWHR * DFC_CLK_PER_US) - tCH - 2),
  420. DFC_MAX_tWHR);
  421. tAR = MIN(((unsigned long) (NAND_TIMING_tAR * DFC_CLK_PER_US) - 2),
  422. DFC_MAX_tAR);
  423. #endif /* CFG_TIMING_TIGHT */
  424. DFC_DEBUG2("tCH=%u, tCS=%u, tWH=%u, tWP=%u, tRH=%u, tRP=%u, tR=%u, tWHR=%u, tAR=%u.\n", tCH, tCS, tWH, tWP, tRH, tRP, tR, tWHR, tAR);
  425. /* tRP value is split in the register */
  426. if(tRP & (1 << 4)) {
  427. tRP_high = 1;
  428. tRP &= ~(1 << 4);
  429. } else {
  430. tRP_high = 0;
  431. }
  432. NDTR0CS0 = (tCH << 19) |
  433. (tCS << 16) |
  434. (tWH << 11) |
  435. (tWP << 8) |
  436. (tRP_high << 6) |
  437. (tRH << 3) |
  438. (tRP << 0);
  439. NDTR1CS0 = (tR << 16) |
  440. (tWHR << 4) |
  441. (tAR << 0);
  442. /* If it doesn't work (unlikely) think about:
  443. * - ecc enable
  444. * - chip select don't care
  445. * - read id byte count
  446. *
  447. * Intentionally enabled by not setting bits:
  448. * - dma (DMA_EN)
  449. * - page size = 512
  450. * - cs don't care, see if we can enable later!
  451. * - row address start position (after second cycle)
  452. * - pages per block = 32
  453. * - ND_RDY : clears command buffer
  454. */
  455. /* NDCR_NCSX | /\* Chip select busy don't care *\/ */
  456. NDCR = (NDCR_SPARE_EN | /* use the spare area */
  457. NDCR_DWIDTH_C | /* 16bit DFC data bus width */
  458. NDCR_DWIDTH_M | /* 16 bit Flash device data bus width */
  459. (2 << 16) | /* read id count = 7 ???? mk@tbd */
  460. NDCR_ND_ARB_EN | /* enable bus arbiter */
  461. NDCR_RDYM | /* flash device ready ir masked */
  462. NDCR_CS0_PAGEDM | /* ND_nCSx page done ir masked */
  463. NDCR_CS1_PAGEDM |
  464. NDCR_CS0_CMDDM | /* ND_CSx command done ir masked */
  465. NDCR_CS1_CMDDM |
  466. NDCR_CS0_BBDM | /* ND_CSx bad block detect ir masked */
  467. NDCR_CS1_BBDM |
  468. NDCR_DBERRM | /* double bit error ir masked */
  469. NDCR_SBERRM | /* single bit error ir masked */
  470. NDCR_WRDREQM | /* write data request ir masked */
  471. NDCR_RDDREQM | /* read data request ir masked */
  472. NDCR_WRCMDREQM); /* write command request ir masked */
  473. /* wait 10 us due to cmd buffer clear reset */
  474. /* wait(10); */
  475. nand->cmd_ctrl = dfc_hwcontrol;
  476. /* nand->dev_ready = dfc_device_ready; */
  477. nand->ecc.mode = NAND_ECC_SOFT;
  478. nand->ecc.layout = &delta_oob;
  479. nand->options = NAND_BUSWIDTH_16;
  480. nand->waitfunc = dfc_wait;
  481. nand->read_byte = dfc_read_byte;
  482. nand->read_word = dfc_read_word;
  483. nand->read_buf = dfc_read_buf;
  484. nand->write_buf = dfc_write_buf;
  485. nand->cmdfunc = dfc_cmdfunc;
  486. nand->badblock_pattern = &delta_bbt_descr;
  487. return 0;
  488. }
  489. #else
  490. #error "U-Boot legacy NAND support not available for Monahans DFC."
  491. #endif
  492. #endif