cmd_nandbcb.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. /*
  2. * i.MX6 nand boot control block(bcb).
  3. *
  4. * Based on the common/imx-bbu-nand-fcb.c from barebox and imx kobs-ng
  5. *
  6. * Copyright (C) 2017 Jagan Teki <jagan@amarulasolutions.com>
  7. * Copyright (C) 2016 Sergey Kubushyn <ksi@koi8.net>
  8. *
  9. * SPDX-License-Identifier: GPL-2.0+
  10. */
  11. #include <common.h>
  12. #include <nand.h>
  13. #include <dm/devres.h>
  14. #include <asm/io.h>
  15. #include <jffs2/jffs2.h>
  16. #include <linux/bch.h>
  17. #include <linux/mtd/mtd.h>
  18. #include <asm/arch/sys_proto.h>
  19. #include <asm/mach-imx/imx-nandbcb.h>
  20. #include <asm/mach-imx/imximage.cfg>
  21. #include <mxs_nand.h>
  22. #include <linux/mtd/mtd.h>
  23. #include <nand.h>
  24. #include "../../../cmd/legacy-mtd-utils.h"
  25. #define BF_VAL(v, bf) (((v) & bf##_MASK) >> bf##_OFFSET)
  26. #define GETBIT(v, n) (((v) >> (n)) & 0x1)
  27. #if defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL)
  28. static uint8_t reverse_bit(uint8_t b)
  29. {
  30. b = (b & 0xf0) >> 4 | (b & 0x0f) << 4;
  31. b = (b & 0xcc) >> 2 | (b & 0x33) << 2;
  32. b = (b & 0xaa) >> 1 | (b & 0x55) << 1;
  33. return b;
  34. }
  35. static void encode_bch_ecc(void *buf, struct fcb_block *fcb, int eccbits)
  36. {
  37. int i, j, m = 13;
  38. int blocksize = 128;
  39. int numblocks = 8;
  40. int ecc_buf_size = (m * eccbits + 7) / 8;
  41. struct bch_control *bch = init_bch(m, eccbits, 0);
  42. u8 *ecc_buf = kzalloc(ecc_buf_size, GFP_KERNEL);
  43. u8 *tmp_buf = kzalloc(blocksize * numblocks, GFP_KERNEL);
  44. u8 *psrc, *pdst;
  45. /*
  46. * The blocks here are bit aligned. If eccbits is a multiple of 8,
  47. * we just can copy bytes. Otherwiese we must move the blocks to
  48. * the next free bit position.
  49. */
  50. WARN_ON(eccbits % 8);
  51. memcpy(tmp_buf, fcb, sizeof(*fcb));
  52. for (i = 0; i < numblocks; i++) {
  53. memset(ecc_buf, 0, ecc_buf_size);
  54. psrc = tmp_buf + i * blocksize;
  55. pdst = buf + i * (blocksize + ecc_buf_size);
  56. /* copy data byte aligned to destination buf */
  57. memcpy(pdst, psrc, blocksize);
  58. /*
  59. * imx-kobs use a modified encode_bch which reverse the
  60. * bit order of the data before calculating bch.
  61. * Do this in the buffer and use the bch lib here.
  62. */
  63. for (j = 0; j < blocksize; j++)
  64. psrc[j] = reverse_bit(psrc[j]);
  65. encode_bch(bch, psrc, blocksize, ecc_buf);
  66. /* reverse ecc bit */
  67. for (j = 0; j < ecc_buf_size; j++)
  68. ecc_buf[j] = reverse_bit(ecc_buf[j]);
  69. /* Here eccbuf is byte aligned and we can just copy it */
  70. memcpy(pdst + blocksize, ecc_buf, ecc_buf_size);
  71. }
  72. kfree(ecc_buf);
  73. kfree(tmp_buf);
  74. free_bch(bch);
  75. }
  76. #else
  77. static u8 calculate_parity_13_8(u8 d)
  78. {
  79. u8 p = 0;
  80. p |= (GETBIT(d, 6) ^ GETBIT(d, 5) ^ GETBIT(d, 3) ^ GETBIT(d, 2)) << 0;
  81. p |= (GETBIT(d, 7) ^ GETBIT(d, 5) ^ GETBIT(d, 4) ^ GETBIT(d, 2) ^
  82. GETBIT(d, 1)) << 1;
  83. p |= (GETBIT(d, 7) ^ GETBIT(d, 6) ^ GETBIT(d, 5) ^ GETBIT(d, 1) ^
  84. GETBIT(d, 0)) << 2;
  85. p |= (GETBIT(d, 7) ^ GETBIT(d, 4) ^ GETBIT(d, 3) ^ GETBIT(d, 0)) << 3;
  86. p |= (GETBIT(d, 6) ^ GETBIT(d, 4) ^ GETBIT(d, 3) ^ GETBIT(d, 2) ^
  87. GETBIT(d, 1) ^ GETBIT(d, 0)) << 4;
  88. return p;
  89. }
  90. static void encode_hamming_13_8(void *_src, void *_ecc, size_t size)
  91. {
  92. int i;
  93. u8 *src = _src;
  94. u8 *ecc = _ecc;
  95. for (i = 0; i < size; i++)
  96. ecc[i] = calculate_parity_13_8(src[i]);
  97. }
  98. #endif
  99. static u32 calc_chksum(void *buf, size_t size)
  100. {
  101. u32 chksum = 0;
  102. u8 *bp = buf;
  103. size_t i;
  104. for (i = 0; i < size; i++)
  105. chksum += bp[i];
  106. return ~chksum;
  107. }
  108. static void fill_fcb(struct fcb_block *fcb, struct mtd_info *mtd,
  109. u32 fw1_start, u32 fw2_start, u32 fw_pages)
  110. {
  111. struct nand_chip *chip = mtd_to_nand(mtd);
  112. struct mxs_nand_info *nand_info = nand_get_controller_data(chip);
  113. struct mxs_nand_layout l;
  114. mxs_nand_get_layout(mtd, &l);
  115. fcb->fingerprint = FCB_FINGERPRINT;
  116. fcb->version = FCB_VERSION_1;
  117. fcb->pagesize = mtd->writesize;
  118. fcb->oob_pagesize = mtd->writesize + mtd->oobsize;
  119. fcb->sectors = mtd->erasesize / mtd->writesize;
  120. fcb->meta_size = l.meta_size;
  121. fcb->nr_blocks = l.nblocks;
  122. fcb->ecc_nr = l.data0_size;
  123. fcb->ecc_level = l.ecc0;
  124. fcb->ecc_size = l.datan_size;
  125. fcb->ecc_type = l.eccn;
  126. /* Also hardcoded in kobs-ng */
  127. if (is_mx6()) {
  128. fcb->datasetup = 80;
  129. fcb->datahold = 60;
  130. fcb->addr_setup = 25;
  131. fcb->dsample_time = 6;
  132. } else if (is_mx7()) {
  133. fcb->datasetup = 10;
  134. fcb->datahold = 7;
  135. fcb->addr_setup = 15;
  136. fcb->dsample_time = 6;
  137. }
  138. /* DBBT search area starts at second page on first block */
  139. fcb->dbbt_start = 1;
  140. fcb->bb_byte = nand_info->bch_geometry.block_mark_byte_offset;
  141. fcb->bb_start_bit = nand_info->bch_geometry.block_mark_bit_offset;
  142. fcb->phy_offset = mtd->writesize;
  143. fcb->nr_blocks = mtd->writesize / fcb->ecc_nr - 1;
  144. fcb->disbbm = 0;
  145. fcb->disbbm_search = 0;
  146. fcb->fw1_start = fw1_start; /* Firmware image starts on this sector */
  147. fcb->fw2_start = fw2_start; /* Secondary FW Image starting Sector */
  148. fcb->fw1_pages = fw_pages; /* Number of sectors in firmware image */
  149. fcb->fw2_pages = fw_pages; /* Number of sector in secondary FW image */
  150. fcb->checksum = calc_chksum((void *)fcb + 4, sizeof(*fcb) - 4);
  151. }
  152. static int dbbt_fill_data(struct mtd_info *mtd, void *buf, int num_blocks)
  153. {
  154. int n, n_bad_blocks = 0;
  155. u32 *bb = buf + 0x8;
  156. u32 *n_bad_blocksp = buf + 0x4;
  157. for (n = 0; n < num_blocks; n++) {
  158. loff_t offset = n * mtd->erasesize;
  159. if (mtd_block_isbad(mtd, offset)) {
  160. n_bad_blocks++;
  161. *bb = n;
  162. bb++;
  163. }
  164. }
  165. *n_bad_blocksp = n_bad_blocks;
  166. return n_bad_blocks;
  167. }
  168. static int write_fcb_dbbt(struct mtd_info *mtd, struct fcb_block *fcb,
  169. struct dbbt_block *dbbt, void *dbbt_data_page,
  170. loff_t off)
  171. {
  172. void *fcb_raw_page = 0;
  173. int i, ret;
  174. size_t dummy;
  175. /*
  176. * We prepare raw page only for i.MX6, for i.MX7 we
  177. * leverage BCH hw module instead
  178. */
  179. if (is_mx6()) {
  180. /* write fcb/dbbt */
  181. fcb_raw_page = kzalloc(mtd->writesize + mtd->oobsize,
  182. GFP_KERNEL);
  183. if (!fcb_raw_page) {
  184. debug("failed to allocate fcb_raw_page\n");
  185. ret = -ENOMEM;
  186. return ret;
  187. }
  188. #if defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL)
  189. /* 40 bit BCH, for i.MX6UL(L) */
  190. encode_bch_ecc(fcb_raw_page + 32, fcb, 40);
  191. #else
  192. memcpy(fcb_raw_page + 12, fcb, sizeof(struct fcb_block));
  193. encode_hamming_13_8(fcb_raw_page + 12,
  194. fcb_raw_page + 12 + 512, 512);
  195. #endif
  196. /*
  197. * Set the first and second byte of OOB data to 0xFF,
  198. * not 0x00. These bytes are used as the Manufacturers Bad
  199. * Block Marker (MBBM). Since the FCB is mostly written to
  200. * the first page in a block, a scan for
  201. * factory bad blocks will detect these blocks as bad, e.g.
  202. * when function nand_scan_bbt() is executed to build a new
  203. * bad block table.
  204. */
  205. memset(fcb_raw_page + mtd->writesize, 0xFF, 2);
  206. }
  207. for (i = 0; i < 2; i++) {
  208. if (mtd_block_isbad(mtd, off)) {
  209. printf("Block %d is bad, skipped\n", i);
  210. continue;
  211. }
  212. /*
  213. * User BCH ECC hardware module for i.MX7
  214. */
  215. if (is_mx7()) {
  216. u32 off = i * mtd->erasesize;
  217. size_t rwsize = sizeof(*fcb);
  218. printf("Writing %d bytes to 0x%x: ", rwsize, off);
  219. /* switch nand BCH to FCB compatible settings */
  220. mxs_nand_mode_fcb(mtd);
  221. ret = nand_write(mtd, off, &rwsize,
  222. (unsigned char *)fcb);
  223. mxs_nand_mode_normal(mtd);
  224. printf("%s\n", ret ? "ERROR" : "OK");
  225. } else if (is_mx6()) {
  226. /* raw write */
  227. mtd_oob_ops_t ops = {
  228. .datbuf = (u8 *)fcb_raw_page,
  229. .oobbuf = ((u8 *)fcb_raw_page) +
  230. mtd->writesize,
  231. .len = mtd->writesize,
  232. .ooblen = mtd->oobsize,
  233. .mode = MTD_OPS_RAW
  234. };
  235. ret = mtd_write_oob(mtd, mtd->erasesize * i, &ops);
  236. if (ret)
  237. goto fcb_raw_page_err;
  238. debug("NAND fcb write: 0x%x offset 0x%x written: %s\n",
  239. mtd->erasesize * i, ops.len, ret ?
  240. "ERROR" : "OK");
  241. }
  242. ret = mtd_write(mtd, mtd->erasesize * i + mtd->writesize,
  243. mtd->writesize, &dummy, (void *)dbbt);
  244. if (ret)
  245. goto fcb_raw_page_err;
  246. debug("NAND dbbt write: 0x%x offset, 0x%x bytes written: %s\n",
  247. mtd->erasesize * i + mtd->writesize, dummy,
  248. ret ? "ERROR" : "OK");
  249. /* dbbtpages == 0 if no bad blocks */
  250. if (dbbt->dbbtpages > 0) {
  251. loff_t to = (mtd->erasesize * i + mtd->writesize * 5);
  252. ret = mtd_write(mtd, to, mtd->writesize, &dummy,
  253. dbbt_data_page);
  254. if (ret)
  255. goto fcb_raw_page_err;
  256. }
  257. }
  258. fcb_raw_page_err:
  259. if (is_mx6())
  260. kfree(fcb_raw_page);
  261. return ret;
  262. }
  263. static int nandbcb_update(struct mtd_info *mtd, loff_t off, size_t size,
  264. size_t maxsize, const u_char *buf)
  265. {
  266. nand_erase_options_t opts;
  267. struct fcb_block *fcb;
  268. struct dbbt_block *dbbt;
  269. loff_t fw1_off;
  270. void *fwbuf, *dbbt_page, *dbbt_data_page;
  271. u32 fw1_start, fw1_pages;
  272. int nr_blks, nr_blks_fcb, fw1_blk;
  273. size_t fwsize;
  274. int ret;
  275. /* erase */
  276. memset(&opts, 0, sizeof(opts));
  277. opts.offset = off;
  278. opts.length = maxsize - 1;
  279. ret = nand_erase_opts(mtd, &opts);
  280. if (ret) {
  281. printf("%s: erase failed (ret = %d)\n", __func__, ret);
  282. return ret;
  283. }
  284. /*
  285. * Reference documentation from i.MX6DQRM section 8.5.2.2
  286. *
  287. * Nand Boot Control Block(BCB) contains two data structures,
  288. * - Firmware Configuration Block(FCB)
  289. * - Discovered Bad Block Table(DBBT)
  290. *
  291. * FCB contains,
  292. * - nand timings
  293. * - DBBT search page address,
  294. * - start page address of primary firmware
  295. * - start page address of secondary firmware
  296. *
  297. * setup fcb:
  298. * - number of blocks = mtd partition size / mtd erasesize
  299. * - two firmware blocks, primary and secondary
  300. * - first 4 block for FCB/DBBT
  301. * - rest split in half for primary and secondary firmware
  302. * - same firmware will write two times
  303. */
  304. nr_blks_fcb = 2;
  305. nr_blks = maxsize / mtd->erasesize;
  306. fw1_blk = nr_blks_fcb;
  307. /* write fw */
  308. fwsize = ALIGN(size + FLASH_OFFSET_STANDARD + mtd->writesize,
  309. mtd->writesize);
  310. fwbuf = kzalloc(fwsize, GFP_KERNEL);
  311. if (!fwbuf) {
  312. debug("failed to allocate fwbuf\n");
  313. ret = -ENOMEM;
  314. goto err;
  315. }
  316. memcpy(fwbuf + FLASH_OFFSET_STANDARD, buf, size);
  317. fw1_off = fw1_blk * mtd->erasesize;
  318. ret = nand_write_skip_bad(mtd, fw1_off, &fwsize, NULL, maxsize,
  319. (u_char *)fwbuf, WITH_WR_VERIFY);
  320. printf("NAND fw write: 0x%llx offset, 0x%x bytes written: %s\n",
  321. fw1_off, fwsize, ret ? "ERROR" : "OK");
  322. if (ret)
  323. goto fwbuf_err;
  324. /* fill fcb */
  325. fcb = kzalloc(sizeof(*fcb), GFP_KERNEL);
  326. if (!fcb) {
  327. debug("failed to allocate fcb\n");
  328. ret = -ENOMEM;
  329. goto fwbuf_err;
  330. }
  331. fw1_start = (fw1_blk * mtd->erasesize) / mtd->writesize;
  332. fw1_pages = size / mtd->writesize + 1;
  333. fill_fcb(fcb, mtd, fw1_start, 0, fw1_pages);
  334. /* fill dbbt */
  335. dbbt_page = kzalloc(mtd->writesize, GFP_KERNEL);
  336. if (!dbbt_page) {
  337. debug("failed to allocate dbbt_page\n");
  338. ret = -ENOMEM;
  339. goto fcb_err;
  340. }
  341. dbbt_data_page = kzalloc(mtd->writesize, GFP_KERNEL);
  342. if (!dbbt_data_page) {
  343. debug("failed to allocate dbbt_data_page\n");
  344. ret = -ENOMEM;
  345. goto dbbt_page_err;
  346. }
  347. dbbt = dbbt_page;
  348. dbbt->checksum = 0;
  349. dbbt->fingerprint = DBBT_FINGERPRINT2;
  350. dbbt->version = DBBT_VERSION_1;
  351. ret = dbbt_fill_data(mtd, dbbt_data_page, nr_blks);
  352. if (ret < 0)
  353. goto dbbt_data_page_err;
  354. else if (ret > 0)
  355. dbbt->dbbtpages = 1;
  356. /* write fcb and dbbt to nand */
  357. ret = write_fcb_dbbt(mtd, fcb, dbbt, dbbt_data_page, off);
  358. if (ret < 0)
  359. printf("failed to write FCB/DBBT\n");
  360. dbbt_data_page_err:
  361. kfree(dbbt_data_page);
  362. dbbt_page_err:
  363. kfree(dbbt_page);
  364. fcb_err:
  365. kfree(fcb);
  366. fwbuf_err:
  367. kfree(fwbuf);
  368. err:
  369. return ret;
  370. }
  371. static int do_nandbcb_bcbonly(int argc, char * const argv[])
  372. {
  373. struct fcb_block *fcb;
  374. struct dbbt_block *dbbt;
  375. u32 fw_len, fw1_off, fw2_off;
  376. struct mtd_info *mtd;
  377. void *dbbt_page, *dbbt_data_page;
  378. int dev, ret;
  379. dev = nand_curr_device;
  380. if ((dev < 0) || (dev >= CONFIG_SYS_MAX_NAND_DEVICE) ||
  381. (!get_nand_dev_by_index(dev))) {
  382. puts("No devices available\n");
  383. return CMD_RET_FAILURE;
  384. }
  385. mtd = get_nand_dev_by_index(dev);
  386. if (argc < 3)
  387. return CMD_RET_FAILURE;
  388. fw_len = simple_strtoul(argv[1], NULL, 16);
  389. fw1_off = simple_strtoul(argv[2], NULL, 16);
  390. if (argc > 3)
  391. fw2_off = simple_strtoul(argv[3], NULL, 16);
  392. else
  393. fw2_off = fw1_off;
  394. /* fill fcb */
  395. fcb = kzalloc(sizeof(*fcb), GFP_KERNEL);
  396. if (!fcb) {
  397. debug("failed to allocate fcb\n");
  398. ret = -ENOMEM;
  399. return CMD_RET_FAILURE;
  400. }
  401. fill_fcb(fcb, mtd, fw1_off / mtd->writesize,
  402. fw2_off / mtd->writesize, fw_len / mtd->writesize);
  403. /* fill dbbt */
  404. dbbt_page = kzalloc(mtd->writesize, GFP_KERNEL);
  405. if (!dbbt_page) {
  406. debug("failed to allocate dbbt_page\n");
  407. ret = -ENOMEM;
  408. goto fcb_err;
  409. }
  410. dbbt_data_page = kzalloc(mtd->writesize, GFP_KERNEL);
  411. if (!dbbt_data_page) {
  412. debug("failed to allocate dbbt_data_page\n");
  413. ret = -ENOMEM;
  414. goto dbbt_page_err;
  415. }
  416. dbbt = dbbt_page;
  417. dbbt->checksum = 0;
  418. dbbt->fingerprint = DBBT_FINGERPRINT2;
  419. dbbt->version = DBBT_VERSION_1;
  420. ret = dbbt_fill_data(mtd, dbbt_data_page, 0);
  421. if (ret < 0)
  422. goto dbbt_data_page_err;
  423. else if (ret > 0)
  424. dbbt->dbbtpages = 1;
  425. /* write fcb and dbbt to nand */
  426. ret = write_fcb_dbbt(mtd, fcb, dbbt, dbbt_data_page, 0);
  427. dbbt_data_page_err:
  428. kfree(dbbt_data_page);
  429. dbbt_page_err:
  430. kfree(dbbt_page);
  431. fcb_err:
  432. kfree(fcb);
  433. if (ret < 0) {
  434. printf("failed to write FCB/DBBT\n");
  435. return CMD_RET_FAILURE;
  436. }
  437. return CMD_RET_SUCCESS;
  438. }
  439. static int do_nandbcb_update(int argc, char * const argv[])
  440. {
  441. struct mtd_info *mtd;
  442. loff_t addr, offset, size, maxsize;
  443. char *endp;
  444. u_char *buf;
  445. int dev;
  446. int ret;
  447. if (argc != 4)
  448. return CMD_RET_USAGE;
  449. dev = nand_curr_device;
  450. if (dev < 0) {
  451. printf("failed to get nand_curr_device, run nand device\n");
  452. return CMD_RET_FAILURE;
  453. }
  454. addr = simple_strtoul(argv[1], &endp, 16);
  455. if (*argv[1] == 0 || *endp != 0)
  456. return CMD_RET_FAILURE;
  457. mtd = get_nand_dev_by_index(dev);
  458. if (mtd_arg_off_size(argc - 2, argv + 2, &dev, &offset, &size,
  459. &maxsize, MTD_DEV_TYPE_NAND, mtd->size))
  460. return CMD_RET_FAILURE;
  461. buf = map_physmem(addr, size, MAP_WRBACK);
  462. if (!buf) {
  463. puts("failed to map physical memory\n");
  464. return CMD_RET_FAILURE;
  465. }
  466. ret = nandbcb_update(mtd, offset, size, maxsize, buf);
  467. return ret == 0 ? CMD_RET_SUCCESS : CMD_RET_FAILURE;
  468. }
  469. static int do_nandbcb(cmd_tbl_t *cmdtp, int flag, int argc,
  470. char * const argv[])
  471. {
  472. const char *cmd;
  473. int ret = 0;
  474. if (argc < 5)
  475. goto usage;
  476. cmd = argv[1];
  477. --argc;
  478. ++argv;
  479. if (strcmp(cmd, "update") == 0) {
  480. ret = do_nandbcb_update(argc, argv);
  481. goto done;
  482. }
  483. if (strcmp(cmd, "bcbonly") == 0) {
  484. ret = do_nandbcb_bcbonly(argc, argv);
  485. goto done;
  486. }
  487. done:
  488. if (ret != -1)
  489. return ret;
  490. usage:
  491. return CMD_RET_USAGE;
  492. }
  493. #ifdef CONFIG_SYS_LONGHELP
  494. static char nandbcb_help_text[] =
  495. "update addr off|partition len - update 'len' bytes starting at\n"
  496. " 'off|part' to memory address 'addr', skipping bad blocks\n"
  497. "bcbonly fw-size fw1-off [fw2-off] - write only BCB (FCB and DBBT)\n"
  498. " where `fw-size` is fw sizes in bytes, `fw1-off`\n"
  499. " and `fw2-off` - firmware offsets\n"
  500. " FIY, BCB isn't erased automatically, so mtd erase should\n"
  501. " be called in advance before writing new BCB:\n"
  502. " > mtd erase mx7-bcb";
  503. #endif
  504. U_BOOT_CMD(nandbcb, 5, 1, do_nandbcb,
  505. "i.MX6/i.MX7 NAND Boot Control Blocks write",
  506. nandbcb_help_text
  507. );