samsung.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  1. /*
  2. * S3C64XX/S5PC100 OneNAND driver at U-Boot
  3. *
  4. * Copyright (C) 2008-2009 Samsung Electronics
  5. * Kyungmin Park <kyungmin.park@samsung.com>
  6. *
  7. * Implementation:
  8. * Emulate the pseudo BufferRAM
  9. *
  10. * See file CREDITS for list of people who contributed to this
  11. * project.
  12. *
  13. * This program is free software; you can redistribute it and/or
  14. * modify it under the terms of the GNU General Public License as
  15. * published by the Free Software Foundation; either version 2 of
  16. * the License, or (at your option) any later version.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU General Public License
  24. * along with this program; if not, write to the Free Software
  25. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  26. * MA 02111-1307 USA
  27. */
  28. #include <common.h>
  29. #include <malloc.h>
  30. #include <linux/mtd/compat.h>
  31. #include <linux/mtd/mtd.h>
  32. #include <linux/mtd/onenand.h>
  33. #include <linux/mtd/samsung_onenand.h>
  34. #include <asm/io.h>
  35. #include <asm/errno.h>
  36. #ifdef ONENAND_DEBUG
  37. #define DPRINTK(format, args...) \
  38. do { \
  39. printf("%s[%d]: " format "\n", __func__, __LINE__, ##args); \
  40. } while (0)
  41. #else
  42. #define DPRINTK(...) do { } while (0)
  43. #endif
  44. #define ONENAND_ERASE_STATUS 0x00
  45. #define ONENAND_MULTI_ERASE_SET 0x01
  46. #define ONENAND_ERASE_START 0x03
  47. #define ONENAND_UNLOCK_START 0x08
  48. #define ONENAND_UNLOCK_END 0x09
  49. #define ONENAND_LOCK_START 0x0A
  50. #define ONENAND_LOCK_END 0x0B
  51. #define ONENAND_LOCK_TIGHT_START 0x0C
  52. #define ONENAND_LOCK_TIGHT_END 0x0D
  53. #define ONENAND_UNLOCK_ALL 0x0E
  54. #define ONENAND_OTP_ACCESS 0x12
  55. #define ONENAND_SPARE_ACCESS_ONLY 0x13
  56. #define ONENAND_MAIN_ACCESS_ONLY 0x14
  57. #define ONENAND_ERASE_VERIFY 0x15
  58. #define ONENAND_MAIN_SPARE_ACCESS 0x16
  59. #define ONENAND_PIPELINE_READ 0x4000
  60. #if defined(CONFIG_S3C64XX)
  61. #define MAP_00 (0x0 << 24)
  62. #define MAP_01 (0x1 << 24)
  63. #define MAP_10 (0x2 << 24)
  64. #define MAP_11 (0x3 << 24)
  65. #elif defined(CONFIG_S5P)
  66. #define MAP_00 (0x0 << 26)
  67. #define MAP_01 (0x1 << 26)
  68. #define MAP_10 (0x2 << 26)
  69. #define MAP_11 (0x3 << 26)
  70. #endif
  71. /* read/write of XIP buffer */
  72. #define CMD_MAP_00(mem_addr) (MAP_00 | ((mem_addr) << 1))
  73. /* read/write to the memory device */
  74. #define CMD_MAP_01(mem_addr) (MAP_01 | (mem_addr))
  75. /* control special functions of the memory device */
  76. #define CMD_MAP_10(mem_addr) (MAP_10 | (mem_addr))
  77. /* direct interface(direct access) with the memory device */
  78. #define CMD_MAP_11(mem_addr) (MAP_11 | ((mem_addr) << 2))
  79. struct s3c_onenand {
  80. struct mtd_info *mtd;
  81. void __iomem *base;
  82. void __iomem *ahb_addr;
  83. int bootram_command;
  84. void __iomem *page_buf;
  85. void __iomem *oob_buf;
  86. unsigned int (*mem_addr)(int fba, int fpa, int fsa);
  87. struct samsung_onenand *reg;
  88. };
  89. static struct s3c_onenand *onenand;
  90. static int s3c_read_cmd(unsigned int cmd)
  91. {
  92. return readl(onenand->ahb_addr + cmd);
  93. }
  94. static void s3c_write_cmd(int value, unsigned int cmd)
  95. {
  96. writel(value, onenand->ahb_addr + cmd);
  97. }
  98. /*
  99. * MEM_ADDR
  100. *
  101. * fba: flash block address
  102. * fpa: flash page address
  103. * fsa: flash sector address
  104. *
  105. * return the buffer address on the memory device
  106. * It will be combined with CMD_MAP_XX
  107. */
  108. #if defined(CONFIG_S3C64XX)
  109. static unsigned int s3c_mem_addr(int fba, int fpa, int fsa)
  110. {
  111. return (fba << 12) | (fpa << 6) | (fsa << 4);
  112. }
  113. #elif defined(CONFIG_S5P)
  114. static unsigned int s3c_mem_addr(int fba, int fpa, int fsa)
  115. {
  116. return (fba << 13) | (fpa << 7) | (fsa << 5);
  117. }
  118. #endif
  119. static void s3c_onenand_reset(void)
  120. {
  121. unsigned long timeout = 0x10000;
  122. int stat;
  123. writel(ONENAND_MEM_RESET_COLD, &onenand->reg->mem_reset);
  124. while (timeout--) {
  125. stat = readl(&onenand->reg->int_err_stat);
  126. if (stat & RST_CMP)
  127. break;
  128. }
  129. stat = readl(&onenand->reg->int_err_stat);
  130. writel(stat, &onenand->reg->int_err_ack);
  131. /* Clear interrupt */
  132. writel(0x0, &onenand->reg->int_err_ack);
  133. /* Clear the ECC status */
  134. writel(0x0, &onenand->reg->ecc_err_stat);
  135. }
  136. static unsigned short s3c_onenand_readw(void __iomem *addr)
  137. {
  138. struct onenand_chip *this = onenand->mtd->priv;
  139. int reg = addr - this->base;
  140. int word_addr = reg >> 1;
  141. int value;
  142. /* It's used for probing time */
  143. switch (reg) {
  144. case ONENAND_REG_MANUFACTURER_ID:
  145. return readl(&onenand->reg->manufact_id);
  146. case ONENAND_REG_DEVICE_ID:
  147. return readl(&onenand->reg->device_id);
  148. case ONENAND_REG_VERSION_ID:
  149. return readl(&onenand->reg->flash_ver_id);
  150. case ONENAND_REG_DATA_BUFFER_SIZE:
  151. return readl(&onenand->reg->data_buf_size);
  152. case ONENAND_REG_TECHNOLOGY:
  153. return readl(&onenand->reg->tech);
  154. case ONENAND_REG_SYS_CFG1:
  155. return readl(&onenand->reg->mem_cfg);
  156. /* Used at unlock all status */
  157. case ONENAND_REG_CTRL_STATUS:
  158. return 0;
  159. case ONENAND_REG_WP_STATUS:
  160. return ONENAND_WP_US;
  161. default:
  162. break;
  163. }
  164. /* BootRAM access control */
  165. if (reg < ONENAND_DATARAM && onenand->bootram_command) {
  166. if (word_addr == 0)
  167. return readl(&onenand->reg->manufact_id);
  168. if (word_addr == 1)
  169. return readl(&onenand->reg->device_id);
  170. if (word_addr == 2)
  171. return readl(&onenand->reg->flash_ver_id);
  172. }
  173. value = s3c_read_cmd(CMD_MAP_11(word_addr)) & 0xffff;
  174. printk(KERN_INFO "s3c_onenand_readw: Illegal access"
  175. " at reg 0x%x, value 0x%x\n", word_addr, value);
  176. return value;
  177. }
  178. static void s3c_onenand_writew(unsigned short value, void __iomem *addr)
  179. {
  180. struct onenand_chip *this = onenand->mtd->priv;
  181. int reg = addr - this->base;
  182. int word_addr = reg >> 1;
  183. /* It's used for probing time */
  184. switch (reg) {
  185. case ONENAND_REG_SYS_CFG1:
  186. writel(value, &onenand->reg->mem_cfg);
  187. return;
  188. case ONENAND_REG_START_ADDRESS1:
  189. case ONENAND_REG_START_ADDRESS2:
  190. return;
  191. /* Lock/lock-tight/unlock/unlock_all */
  192. case ONENAND_REG_START_BLOCK_ADDRESS:
  193. return;
  194. default:
  195. break;
  196. }
  197. /* BootRAM access control */
  198. if (reg < ONENAND_DATARAM) {
  199. if (value == ONENAND_CMD_READID) {
  200. onenand->bootram_command = 1;
  201. return;
  202. }
  203. if (value == ONENAND_CMD_RESET) {
  204. writel(ONENAND_MEM_RESET_COLD,
  205. &onenand->reg->mem_reset);
  206. onenand->bootram_command = 0;
  207. return;
  208. }
  209. }
  210. printk(KERN_INFO "s3c_onenand_writew: Illegal access"
  211. " at reg 0x%x, value 0x%x\n", word_addr, value);
  212. s3c_write_cmd(value, CMD_MAP_11(word_addr));
  213. }
  214. static int s3c_onenand_wait(struct mtd_info *mtd, int state)
  215. {
  216. unsigned int flags = INT_ACT;
  217. unsigned int stat, ecc;
  218. unsigned long timeout = 0x100000;
  219. switch (state) {
  220. case FL_READING:
  221. flags |= BLK_RW_CMP | LOAD_CMP;
  222. break;
  223. case FL_WRITING:
  224. flags |= BLK_RW_CMP | PGM_CMP;
  225. break;
  226. case FL_ERASING:
  227. flags |= BLK_RW_CMP | ERS_CMP;
  228. break;
  229. case FL_LOCKING:
  230. flags |= BLK_RW_CMP;
  231. break;
  232. default:
  233. break;
  234. }
  235. while (timeout--) {
  236. stat = readl(&onenand->reg->int_err_stat);
  237. if (stat & flags)
  238. break;
  239. }
  240. /* To get correct interrupt status in timeout case */
  241. stat = readl(&onenand->reg->int_err_stat);
  242. writel(stat, &onenand->reg->int_err_ack);
  243. /*
  244. * In the Spec. it checks the controller status first
  245. * However if you get the correct information in case of
  246. * power off recovery (POR) test, it should read ECC status first
  247. */
  248. if (stat & LOAD_CMP) {
  249. ecc = readl(&onenand->reg->ecc_err_stat);
  250. if (ecc & ONENAND_ECC_4BIT_UNCORRECTABLE) {
  251. printk(KERN_INFO "%s: ECC error = 0x%04x\n",
  252. __func__, ecc);
  253. mtd->ecc_stats.failed++;
  254. return -EBADMSG;
  255. }
  256. }
  257. if (stat & (LOCKED_BLK | ERS_FAIL | PGM_FAIL | LD_FAIL_ECC_ERR)) {
  258. printk(KERN_INFO "%s: controller error = 0x%04x\n",
  259. __func__, stat);
  260. if (stat & LOCKED_BLK)
  261. printk(KERN_INFO "%s: it's locked error = 0x%04x\n",
  262. __func__, stat);
  263. return -EIO;
  264. }
  265. return 0;
  266. }
  267. static int s3c_onenand_command(struct mtd_info *mtd, int cmd,
  268. loff_t addr, size_t len)
  269. {
  270. struct onenand_chip *this = mtd->priv;
  271. unsigned int *m, *s;
  272. int fba, fpa, fsa = 0;
  273. unsigned int mem_addr;
  274. int i, mcount, scount;
  275. int index;
  276. fba = (int) (addr >> this->erase_shift);
  277. fpa = (int) (addr >> this->page_shift);
  278. fpa &= this->page_mask;
  279. mem_addr = onenand->mem_addr(fba, fpa, fsa);
  280. switch (cmd) {
  281. case ONENAND_CMD_READ:
  282. case ONENAND_CMD_READOOB:
  283. case ONENAND_CMD_BUFFERRAM:
  284. ONENAND_SET_NEXT_BUFFERRAM(this);
  285. default:
  286. break;
  287. }
  288. index = ONENAND_CURRENT_BUFFERRAM(this);
  289. /*
  290. * Emulate Two BufferRAMs and access with 4 bytes pointer
  291. */
  292. m = (unsigned int *) onenand->page_buf;
  293. s = (unsigned int *) onenand->oob_buf;
  294. if (index) {
  295. m += (this->writesize >> 2);
  296. s += (mtd->oobsize >> 2);
  297. }
  298. mcount = mtd->writesize >> 2;
  299. scount = mtd->oobsize >> 2;
  300. switch (cmd) {
  301. case ONENAND_CMD_READ:
  302. /* Main */
  303. for (i = 0; i < mcount; i++)
  304. *m++ = s3c_read_cmd(CMD_MAP_01(mem_addr));
  305. return 0;
  306. case ONENAND_CMD_READOOB:
  307. writel(TSRF, &onenand->reg->trans_spare);
  308. /* Main */
  309. for (i = 0; i < mcount; i++)
  310. *m++ = s3c_read_cmd(CMD_MAP_01(mem_addr));
  311. /* Spare */
  312. for (i = 0; i < scount; i++)
  313. *s++ = s3c_read_cmd(CMD_MAP_01(mem_addr));
  314. writel(0, &onenand->reg->trans_spare);
  315. return 0;
  316. case ONENAND_CMD_PROG:
  317. /* Main */
  318. for (i = 0; i < mcount; i++)
  319. s3c_write_cmd(*m++, CMD_MAP_01(mem_addr));
  320. return 0;
  321. case ONENAND_CMD_PROGOOB:
  322. writel(TSRF, &onenand->reg->trans_spare);
  323. /* Main - dummy write */
  324. for (i = 0; i < mcount; i++)
  325. s3c_write_cmd(0xffffffff, CMD_MAP_01(mem_addr));
  326. /* Spare */
  327. for (i = 0; i < scount; i++)
  328. s3c_write_cmd(*s++, CMD_MAP_01(mem_addr));
  329. writel(0, &onenand->reg->trans_spare);
  330. return 0;
  331. case ONENAND_CMD_UNLOCK_ALL:
  332. s3c_write_cmd(ONENAND_UNLOCK_ALL, CMD_MAP_10(mem_addr));
  333. return 0;
  334. case ONENAND_CMD_ERASE:
  335. s3c_write_cmd(ONENAND_ERASE_START, CMD_MAP_10(mem_addr));
  336. return 0;
  337. case ONENAND_CMD_MULTIBLOCK_ERASE:
  338. s3c_write_cmd(ONENAND_MULTI_ERASE_SET, CMD_MAP_10(mem_addr));
  339. return 0;
  340. case ONENAND_CMD_ERASE_VERIFY:
  341. s3c_write_cmd(ONENAND_ERASE_VERIFY, CMD_MAP_10(mem_addr));
  342. return 0;
  343. default:
  344. break;
  345. }
  346. return 0;
  347. }
  348. static unsigned char *s3c_get_bufferram(struct mtd_info *mtd, int area)
  349. {
  350. struct onenand_chip *this = mtd->priv;
  351. int index = ONENAND_CURRENT_BUFFERRAM(this);
  352. unsigned char *p;
  353. if (area == ONENAND_DATARAM) {
  354. p = (unsigned char *) onenand->page_buf;
  355. if (index == 1)
  356. p += this->writesize;
  357. } else {
  358. p = (unsigned char *) onenand->oob_buf;
  359. if (index == 1)
  360. p += mtd->oobsize;
  361. }
  362. return p;
  363. }
  364. static int onenand_read_bufferram(struct mtd_info *mtd, loff_t addr, int area,
  365. unsigned char *buffer, int offset,
  366. size_t count)
  367. {
  368. unsigned char *p;
  369. p = s3c_get_bufferram(mtd, area);
  370. memcpy(buffer, p + offset, count);
  371. return 0;
  372. }
  373. static int onenand_write_bufferram(struct mtd_info *mtd, loff_t addr, int area,
  374. const unsigned char *buffer, int offset,
  375. size_t count)
  376. {
  377. unsigned char *p;
  378. p = s3c_get_bufferram(mtd, area);
  379. memcpy(p + offset, buffer, count);
  380. return 0;
  381. }
  382. static int s3c_onenand_bbt_wait(struct mtd_info *mtd, int state)
  383. {
  384. struct samsung_onenand *reg = (struct samsung_onenand *)onenand->base;
  385. unsigned int flags = INT_ACT | LOAD_CMP;
  386. unsigned int stat;
  387. unsigned long timeout = 0x10000;
  388. while (timeout--) {
  389. stat = readl(&reg->int_err_stat);
  390. if (stat & flags)
  391. break;
  392. }
  393. /* To get correct interrupt status in timeout case */
  394. stat = readl(&onenand->reg->int_err_stat);
  395. writel(stat, &onenand->reg->int_err_ack);
  396. if (stat & LD_FAIL_ECC_ERR) {
  397. s3c_onenand_reset();
  398. return ONENAND_BBT_READ_ERROR;
  399. }
  400. if (stat & LOAD_CMP) {
  401. int ecc = readl(&onenand->reg->ecc_err_stat);
  402. if (ecc & ONENAND_ECC_4BIT_UNCORRECTABLE) {
  403. s3c_onenand_reset();
  404. return ONENAND_BBT_READ_ERROR;
  405. }
  406. }
  407. return 0;
  408. }
  409. static void s3c_onenand_check_lock_status(struct mtd_info *mtd)
  410. {
  411. struct onenand_chip *this = mtd->priv;
  412. unsigned int block, end;
  413. int tmp;
  414. end = this->chipsize >> this->erase_shift;
  415. for (block = 0; block < end; block++) {
  416. tmp = s3c_read_cmd(CMD_MAP_01(onenand->mem_addr(block, 0, 0)));
  417. if (readl(&onenand->reg->int_err_stat) & LOCKED_BLK) {
  418. printf("block %d is write-protected!\n", block);
  419. writel(LOCKED_BLK, &onenand->reg->int_err_ack);
  420. }
  421. }
  422. }
  423. static void s3c_onenand_do_lock_cmd(struct mtd_info *mtd, loff_t ofs,
  424. size_t len, int cmd)
  425. {
  426. struct onenand_chip *this = mtd->priv;
  427. int start, end, start_mem_addr, end_mem_addr;
  428. start = ofs >> this->erase_shift;
  429. start_mem_addr = onenand->mem_addr(start, 0, 0);
  430. end = start + (len >> this->erase_shift) - 1;
  431. end_mem_addr = onenand->mem_addr(end, 0, 0);
  432. if (cmd == ONENAND_CMD_LOCK) {
  433. s3c_write_cmd(ONENAND_LOCK_START, CMD_MAP_10(start_mem_addr));
  434. s3c_write_cmd(ONENAND_LOCK_END, CMD_MAP_10(end_mem_addr));
  435. } else {
  436. s3c_write_cmd(ONENAND_UNLOCK_START, CMD_MAP_10(start_mem_addr));
  437. s3c_write_cmd(ONENAND_UNLOCK_END, CMD_MAP_10(end_mem_addr));
  438. }
  439. this->wait(mtd, FL_LOCKING);
  440. }
  441. static void s3c_onenand_unlock_all(struct mtd_info *mtd)
  442. {
  443. struct onenand_chip *this = mtd->priv;
  444. loff_t ofs = 0;
  445. size_t len = this->chipsize;
  446. /* FIXME workaround */
  447. this->subpagesize = mtd->writesize;
  448. mtd->subpage_sft = 0;
  449. if (this->options & ONENAND_HAS_UNLOCK_ALL) {
  450. /* Write unlock command */
  451. this->command(mtd, ONENAND_CMD_UNLOCK_ALL, 0, 0);
  452. /* No need to check return value */
  453. this->wait(mtd, FL_LOCKING);
  454. /* Workaround for all block unlock in DDP */
  455. if (!ONENAND_IS_DDP(this)) {
  456. s3c_onenand_check_lock_status(mtd);
  457. return;
  458. }
  459. /* All blocks on another chip */
  460. ofs = this->chipsize >> 1;
  461. len = this->chipsize >> 1;
  462. }
  463. s3c_onenand_do_lock_cmd(mtd, ofs, len, ONENAND_CMD_UNLOCK);
  464. s3c_onenand_check_lock_status(mtd);
  465. }
  466. #ifdef CONFIG_S3C64XX
  467. static void s3c_set_width_regs(struct onenand_chip *this)
  468. {
  469. int dev_id, density;
  470. int fba, fpa, fsa;
  471. int dbs_dfs;
  472. dev_id = DEVICE_ID0_REG;
  473. density = (dev_id >> ONENAND_DEVICE_DENSITY_SHIFT) & 0xf;
  474. dbs_dfs = !!(dev_id & ONENAND_DEVICE_IS_DDP);
  475. fba = density + 7;
  476. if (dbs_dfs)
  477. fba--; /* Decrease the fba */
  478. fpa = 6;
  479. if (density >= ONENAND_DEVICE_DENSITY_512Mb)
  480. fsa = 2;
  481. else
  482. fsa = 1;
  483. DPRINTK("FBA %lu, FPA %lu, FSA %lu, DDP %lu",
  484. FBA_WIDTH0_REG, FPA_WIDTH0_REG, FSA_WIDTH0_REG,
  485. DDP_DEVICE_REG);
  486. DPRINTK("mem_cfg0 0x%lx, sync mode %lu, "
  487. "dev_page_size %lu, BURST LEN %lu",
  488. MEM_CFG0_REG, SYNC_MODE_REG,
  489. DEV_PAGE_SIZE_REG, BURST_LEN0_REG);
  490. DEV_PAGE_SIZE_REG = 0x1;
  491. FBA_WIDTH0_REG = fba;
  492. FPA_WIDTH0_REG = fpa;
  493. FSA_WIDTH0_REG = fsa;
  494. DBS_DFS_WIDTH0_REG = dbs_dfs;
  495. }
  496. #endif
  497. void s3c_onenand_init(struct mtd_info *mtd)
  498. {
  499. struct onenand_chip *this = mtd->priv;
  500. u32 size = (4 << 10); /* 4 KiB */
  501. onenand = malloc(sizeof(struct s3c_onenand));
  502. if (!onenand)
  503. return;
  504. onenand->page_buf = malloc(size * sizeof(char));
  505. if (!onenand->page_buf)
  506. return;
  507. memset(onenand->page_buf, 0xff, size);
  508. onenand->oob_buf = malloc(128 * sizeof(char));
  509. if (!onenand->oob_buf)
  510. return;
  511. memset(onenand->oob_buf, 0xff, 128);
  512. onenand->mtd = mtd;
  513. #if defined(CONFIG_S3C64XX)
  514. onenand->base = (void *)0x70100000;
  515. onenand->ahb_addr = (void *)0x20000000;
  516. #elif defined(CONFIG_S5P)
  517. onenand->base = (void *)0xE7100000;
  518. onenand->ahb_addr = (void *)0xB0000000;
  519. #endif
  520. onenand->mem_addr = s3c_mem_addr;
  521. onenand->reg = (struct samsung_onenand *)onenand->base;
  522. this->read_word = s3c_onenand_readw;
  523. this->write_word = s3c_onenand_writew;
  524. this->wait = s3c_onenand_wait;
  525. this->bbt_wait = s3c_onenand_bbt_wait;
  526. this->unlock_all = s3c_onenand_unlock_all;
  527. this->command = s3c_onenand_command;
  528. this->read_bufferram = onenand_read_bufferram;
  529. this->write_bufferram = onenand_write_bufferram;
  530. this->options |= ONENAND_RUNTIME_BADBLOCK_CHECK;
  531. }