mxic_nand.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (C) 2019 Macronix International Co., Ltd.
  4. *
  5. * Author:
  6. * Mason Yang <[email protected]>
  7. */
  8. #include <linux/clk.h>
  9. #include <linux/io.h>
  10. #include <linux/iopoll.h>
  11. #include <linux/interrupt.h>
  12. #include <linux/module.h>
  13. #include <linux/mtd/mtd.h>
  14. #include <linux/mtd/nand-ecc-sw-hamming.h>
  15. #include <linux/mtd/rawnand.h>
  16. #include <linux/platform_device.h>
  17. #include "internals.h"
  18. #define HC_CFG 0x0
  19. #define HC_CFG_IF_CFG(x) ((x) << 27)
  20. #define HC_CFG_DUAL_SLAVE BIT(31)
  21. #define HC_CFG_INDIVIDUAL BIT(30)
  22. #define HC_CFG_NIO(x) (((x) / 4) << 27)
  23. #define HC_CFG_TYPE(s, t) ((t) << (23 + ((s) * 2)))
  24. #define HC_CFG_TYPE_SPI_NOR 0
  25. #define HC_CFG_TYPE_SPI_NAND 1
  26. #define HC_CFG_TYPE_SPI_RAM 2
  27. #define HC_CFG_TYPE_RAW_NAND 3
  28. #define HC_CFG_SLV_ACT(x) ((x) << 21)
  29. #define HC_CFG_CLK_PH_EN BIT(20)
  30. #define HC_CFG_CLK_POL_INV BIT(19)
  31. #define HC_CFG_BIG_ENDIAN BIT(18)
  32. #define HC_CFG_DATA_PASS BIT(17)
  33. #define HC_CFG_IDLE_SIO_LVL(x) ((x) << 16)
  34. #define HC_CFG_MAN_START_EN BIT(3)
  35. #define HC_CFG_MAN_START BIT(2)
  36. #define HC_CFG_MAN_CS_EN BIT(1)
  37. #define HC_CFG_MAN_CS_ASSERT BIT(0)
  38. #define INT_STS 0x4
  39. #define INT_STS_EN 0x8
  40. #define INT_SIG_EN 0xc
  41. #define INT_STS_ALL GENMASK(31, 0)
  42. #define INT_RDY_PIN BIT(26)
  43. #define INT_RDY_SR BIT(25)
  44. #define INT_LNR_SUSP BIT(24)
  45. #define INT_ECC_ERR BIT(17)
  46. #define INT_CRC_ERR BIT(16)
  47. #define INT_LWR_DIS BIT(12)
  48. #define INT_LRD_DIS BIT(11)
  49. #define INT_SDMA_INT BIT(10)
  50. #define INT_DMA_FINISH BIT(9)
  51. #define INT_RX_NOT_FULL BIT(3)
  52. #define INT_RX_NOT_EMPTY BIT(2)
  53. #define INT_TX_NOT_FULL BIT(1)
  54. #define INT_TX_EMPTY BIT(0)
  55. #define HC_EN 0x10
  56. #define HC_EN_BIT BIT(0)
  57. #define TXD(x) (0x14 + ((x) * 4))
  58. #define RXD 0x24
  59. #define SS_CTRL(s) (0x30 + ((s) * 4))
  60. #define LRD_CFG 0x44
  61. #define LWR_CFG 0x80
  62. #define RWW_CFG 0x70
  63. #define OP_READ BIT(23)
  64. #define OP_DUMMY_CYC(x) ((x) << 17)
  65. #define OP_ADDR_BYTES(x) ((x) << 14)
  66. #define OP_CMD_BYTES(x) (((x) - 1) << 13)
  67. #define OP_OCTA_CRC_EN BIT(12)
  68. #define OP_DQS_EN BIT(11)
  69. #define OP_ENHC_EN BIT(10)
  70. #define OP_PREAMBLE_EN BIT(9)
  71. #define OP_DATA_DDR BIT(8)
  72. #define OP_DATA_BUSW(x) ((x) << 6)
  73. #define OP_ADDR_DDR BIT(5)
  74. #define OP_ADDR_BUSW(x) ((x) << 3)
  75. #define OP_CMD_DDR BIT(2)
  76. #define OP_CMD_BUSW(x) (x)
  77. #define OP_BUSW_1 0
  78. #define OP_BUSW_2 1
  79. #define OP_BUSW_4 2
  80. #define OP_BUSW_8 3
  81. #define OCTA_CRC 0x38
  82. #define OCTA_CRC_IN_EN(s) BIT(3 + ((s) * 16))
  83. #define OCTA_CRC_CHUNK(s, x) ((fls((x) / 32)) << (1 + ((s) * 16)))
  84. #define OCTA_CRC_OUT_EN(s) BIT(0 + ((s) * 16))
  85. #define ONFI_DIN_CNT(s) (0x3c + (s))
  86. #define LRD_CTRL 0x48
  87. #define RWW_CTRL 0x74
  88. #define LWR_CTRL 0x84
  89. #define LMODE_EN BIT(31)
  90. #define LMODE_SLV_ACT(x) ((x) << 21)
  91. #define LMODE_CMD1(x) ((x) << 8)
  92. #define LMODE_CMD0(x) (x)
  93. #define LRD_ADDR 0x4c
  94. #define LWR_ADDR 0x88
  95. #define LRD_RANGE 0x50
  96. #define LWR_RANGE 0x8c
  97. #define AXI_SLV_ADDR 0x54
  98. #define DMAC_RD_CFG 0x58
  99. #define DMAC_WR_CFG 0x94
  100. #define DMAC_CFG_PERIPH_EN BIT(31)
  101. #define DMAC_CFG_ALLFLUSH_EN BIT(30)
  102. #define DMAC_CFG_LASTFLUSH_EN BIT(29)
  103. #define DMAC_CFG_QE(x) (((x) + 1) << 16)
  104. #define DMAC_CFG_BURST_LEN(x) (((x) + 1) << 12)
  105. #define DMAC_CFG_BURST_SZ(x) ((x) << 8)
  106. #define DMAC_CFG_DIR_READ BIT(1)
  107. #define DMAC_CFG_START BIT(0)
  108. #define DMAC_RD_CNT 0x5c
  109. #define DMAC_WR_CNT 0x98
  110. #define SDMA_ADDR 0x60
  111. #define DMAM_CFG 0x64
  112. #define DMAM_CFG_START BIT(31)
  113. #define DMAM_CFG_CONT BIT(30)
  114. #define DMAM_CFG_SDMA_GAP(x) (fls((x) / 8192) << 2)
  115. #define DMAM_CFG_DIR_READ BIT(1)
  116. #define DMAM_CFG_EN BIT(0)
  117. #define DMAM_CNT 0x68
  118. #define LNR_TIMER_TH 0x6c
  119. #define RDM_CFG0 0x78
  120. #define RDM_CFG0_POLY(x) (x)
  121. #define RDM_CFG1 0x7c
  122. #define RDM_CFG1_RDM_EN BIT(31)
  123. #define RDM_CFG1_SEED(x) (x)
  124. #define LWR_SUSP_CTRL 0x90
  125. #define LWR_SUSP_CTRL_EN BIT(31)
  126. #define DMAS_CTRL 0x9c
  127. #define DMAS_CTRL_EN BIT(31)
  128. #define DMAS_CTRL_DIR_READ BIT(30)
  129. #define DATA_STROB 0xa0
  130. #define DATA_STROB_EDO_EN BIT(2)
  131. #define DATA_STROB_INV_POL BIT(1)
  132. #define DATA_STROB_DELAY_2CYC BIT(0)
  133. #define IDLY_CODE(x) (0xa4 + ((x) * 4))
  134. #define IDLY_CODE_VAL(x, v) ((v) << (((x) % 4) * 8))
  135. #define GPIO 0xc4
  136. #define GPIO_PT(x) BIT(3 + ((x) * 16))
  137. #define GPIO_RESET(x) BIT(2 + ((x) * 16))
  138. #define GPIO_HOLDB(x) BIT(1 + ((x) * 16))
  139. #define GPIO_WPB(x) BIT((x) * 16)
  140. #define HC_VER 0xd0
  141. #define HW_TEST(x) (0xe0 + ((x) * 4))
  142. #define MXIC_NFC_MAX_CLK_HZ 50000000
  143. #define IRQ_TIMEOUT 1000
  144. struct mxic_nand_ctlr {
  145. struct clk *ps_clk;
  146. struct clk *send_clk;
  147. struct clk *send_dly_clk;
  148. struct completion complete;
  149. void __iomem *regs;
  150. struct nand_controller controller;
  151. struct device *dev;
  152. struct nand_chip chip;
  153. };
  154. static int mxic_nfc_clk_enable(struct mxic_nand_ctlr *nfc)
  155. {
  156. int ret;
  157. ret = clk_prepare_enable(nfc->ps_clk);
  158. if (ret)
  159. return ret;
  160. ret = clk_prepare_enable(nfc->send_clk);
  161. if (ret)
  162. goto err_ps_clk;
  163. ret = clk_prepare_enable(nfc->send_dly_clk);
  164. if (ret)
  165. goto err_send_dly_clk;
  166. return ret;
  167. err_send_dly_clk:
  168. clk_disable_unprepare(nfc->send_clk);
  169. err_ps_clk:
  170. clk_disable_unprepare(nfc->ps_clk);
  171. return ret;
  172. }
  173. static void mxic_nfc_clk_disable(struct mxic_nand_ctlr *nfc)
  174. {
  175. clk_disable_unprepare(nfc->send_clk);
  176. clk_disable_unprepare(nfc->send_dly_clk);
  177. clk_disable_unprepare(nfc->ps_clk);
  178. }
  179. static void mxic_nfc_set_input_delay(struct mxic_nand_ctlr *nfc, u8 idly_code)
  180. {
  181. writel(IDLY_CODE_VAL(0, idly_code) |
  182. IDLY_CODE_VAL(1, idly_code) |
  183. IDLY_CODE_VAL(2, idly_code) |
  184. IDLY_CODE_VAL(3, idly_code),
  185. nfc->regs + IDLY_CODE(0));
  186. writel(IDLY_CODE_VAL(4, idly_code) |
  187. IDLY_CODE_VAL(5, idly_code) |
  188. IDLY_CODE_VAL(6, idly_code) |
  189. IDLY_CODE_VAL(7, idly_code),
  190. nfc->regs + IDLY_CODE(1));
  191. }
  192. static int mxic_nfc_clk_setup(struct mxic_nand_ctlr *nfc, unsigned long freq)
  193. {
  194. int ret;
  195. ret = clk_set_rate(nfc->send_clk, freq);
  196. if (ret)
  197. return ret;
  198. ret = clk_set_rate(nfc->send_dly_clk, freq);
  199. if (ret)
  200. return ret;
  201. /*
  202. * A constant delay range from 0x0 ~ 0x1F for input delay,
  203. * the unit is 78 ps, the max input delay is 2.418 ns.
  204. */
  205. mxic_nfc_set_input_delay(nfc, 0xf);
  206. /*
  207. * Phase degree = 360 * freq * output-delay
  208. * where output-delay is a constant value 1 ns in FPGA.
  209. *
  210. * Get Phase degree = 360 * freq * 1 ns
  211. * = 360 * freq * 1 sec / 1000000000
  212. * = 9 * freq / 25000000
  213. */
  214. ret = clk_set_phase(nfc->send_dly_clk, 9 * freq / 25000000);
  215. if (ret)
  216. return ret;
  217. return 0;
  218. }
  219. static int mxic_nfc_set_freq(struct mxic_nand_ctlr *nfc, unsigned long freq)
  220. {
  221. int ret;
  222. if (freq > MXIC_NFC_MAX_CLK_HZ)
  223. freq = MXIC_NFC_MAX_CLK_HZ;
  224. mxic_nfc_clk_disable(nfc);
  225. ret = mxic_nfc_clk_setup(nfc, freq);
  226. if (ret)
  227. return ret;
  228. ret = mxic_nfc_clk_enable(nfc);
  229. if (ret)
  230. return ret;
  231. return 0;
  232. }
  233. static irqreturn_t mxic_nfc_isr(int irq, void *dev_id)
  234. {
  235. struct mxic_nand_ctlr *nfc = dev_id;
  236. u32 sts;
  237. sts = readl(nfc->regs + INT_STS);
  238. if (sts & INT_RDY_PIN)
  239. complete(&nfc->complete);
  240. else
  241. return IRQ_NONE;
  242. return IRQ_HANDLED;
  243. }
  244. static void mxic_nfc_hw_init(struct mxic_nand_ctlr *nfc)
  245. {
  246. writel(HC_CFG_NIO(8) | HC_CFG_TYPE(1, HC_CFG_TYPE_RAW_NAND) |
  247. HC_CFG_SLV_ACT(0) | HC_CFG_MAN_CS_EN |
  248. HC_CFG_IDLE_SIO_LVL(1), nfc->regs + HC_CFG);
  249. writel(INT_STS_ALL, nfc->regs + INT_STS_EN);
  250. writel(INT_RDY_PIN, nfc->regs + INT_SIG_EN);
  251. writel(0x0, nfc->regs + ONFI_DIN_CNT(0));
  252. writel(0, nfc->regs + LRD_CFG);
  253. writel(0, nfc->regs + LRD_CTRL);
  254. writel(0x0, nfc->regs + HC_EN);
  255. }
  256. static void mxic_nfc_cs_enable(struct mxic_nand_ctlr *nfc)
  257. {
  258. writel(readl(nfc->regs + HC_CFG) | HC_CFG_MAN_CS_EN,
  259. nfc->regs + HC_CFG);
  260. writel(HC_CFG_MAN_CS_ASSERT | readl(nfc->regs + HC_CFG),
  261. nfc->regs + HC_CFG);
  262. }
  263. static void mxic_nfc_cs_disable(struct mxic_nand_ctlr *nfc)
  264. {
  265. writel(~HC_CFG_MAN_CS_ASSERT & readl(nfc->regs + HC_CFG),
  266. nfc->regs + HC_CFG);
  267. }
  268. static int mxic_nfc_wait_ready(struct nand_chip *chip)
  269. {
  270. struct mxic_nand_ctlr *nfc = nand_get_controller_data(chip);
  271. int ret;
  272. ret = wait_for_completion_timeout(&nfc->complete,
  273. msecs_to_jiffies(IRQ_TIMEOUT));
  274. if (!ret) {
  275. dev_err(nfc->dev, "nand device timeout\n");
  276. return -ETIMEDOUT;
  277. }
  278. return 0;
  279. }
  280. static int mxic_nfc_data_xfer(struct mxic_nand_ctlr *nfc, const void *txbuf,
  281. void *rxbuf, unsigned int len)
  282. {
  283. unsigned int pos = 0;
  284. while (pos < len) {
  285. unsigned int nbytes = len - pos;
  286. u32 data = 0xffffffff;
  287. u32 sts;
  288. int ret;
  289. if (nbytes > 4)
  290. nbytes = 4;
  291. if (txbuf)
  292. memcpy(&data, txbuf + pos, nbytes);
  293. ret = readl_poll_timeout(nfc->regs + INT_STS, sts,
  294. sts & INT_TX_EMPTY, 0, USEC_PER_SEC);
  295. if (ret)
  296. return ret;
  297. writel(data, nfc->regs + TXD(nbytes % 4));
  298. ret = readl_poll_timeout(nfc->regs + INT_STS, sts,
  299. sts & INT_TX_EMPTY, 0, USEC_PER_SEC);
  300. if (ret)
  301. return ret;
  302. ret = readl_poll_timeout(nfc->regs + INT_STS, sts,
  303. sts & INT_RX_NOT_EMPTY, 0,
  304. USEC_PER_SEC);
  305. if (ret)
  306. return ret;
  307. data = readl(nfc->regs + RXD);
  308. if (rxbuf) {
  309. data >>= (8 * (4 - nbytes));
  310. memcpy(rxbuf + pos, &data, nbytes);
  311. }
  312. if (readl(nfc->regs + INT_STS) & INT_RX_NOT_EMPTY)
  313. dev_warn(nfc->dev, "RX FIFO not empty\n");
  314. pos += nbytes;
  315. }
  316. return 0;
  317. }
  318. static int mxic_nfc_exec_op(struct nand_chip *chip,
  319. const struct nand_operation *op, bool check_only)
  320. {
  321. struct mxic_nand_ctlr *nfc = nand_get_controller_data(chip);
  322. const struct nand_op_instr *instr = NULL;
  323. int ret = 0;
  324. unsigned int op_id;
  325. if (check_only)
  326. return 0;
  327. mxic_nfc_cs_enable(nfc);
  328. init_completion(&nfc->complete);
  329. for (op_id = 0; op_id < op->ninstrs; op_id++) {
  330. instr = &op->instrs[op_id];
  331. switch (instr->type) {
  332. case NAND_OP_CMD_INSTR:
  333. writel(0, nfc->regs + HC_EN);
  334. writel(HC_EN_BIT, nfc->regs + HC_EN);
  335. writel(OP_CMD_BUSW(OP_BUSW_8) | OP_DUMMY_CYC(0x3F) |
  336. OP_CMD_BYTES(0), nfc->regs + SS_CTRL(0));
  337. ret = mxic_nfc_data_xfer(nfc,
  338. &instr->ctx.cmd.opcode,
  339. NULL, 1);
  340. break;
  341. case NAND_OP_ADDR_INSTR:
  342. writel(OP_ADDR_BUSW(OP_BUSW_8) | OP_DUMMY_CYC(0x3F) |
  343. OP_ADDR_BYTES(instr->ctx.addr.naddrs),
  344. nfc->regs + SS_CTRL(0));
  345. ret = mxic_nfc_data_xfer(nfc,
  346. instr->ctx.addr.addrs, NULL,
  347. instr->ctx.addr.naddrs);
  348. break;
  349. case NAND_OP_DATA_IN_INSTR:
  350. writel(0x0, nfc->regs + ONFI_DIN_CNT(0));
  351. writel(OP_DATA_BUSW(OP_BUSW_8) | OP_DUMMY_CYC(0x3F) |
  352. OP_READ, nfc->regs + SS_CTRL(0));
  353. ret = mxic_nfc_data_xfer(nfc, NULL,
  354. instr->ctx.data.buf.in,
  355. instr->ctx.data.len);
  356. break;
  357. case NAND_OP_DATA_OUT_INSTR:
  358. writel(instr->ctx.data.len,
  359. nfc->regs + ONFI_DIN_CNT(0));
  360. writel(OP_DATA_BUSW(OP_BUSW_8) | OP_DUMMY_CYC(0x3F),
  361. nfc->regs + SS_CTRL(0));
  362. ret = mxic_nfc_data_xfer(nfc,
  363. instr->ctx.data.buf.out, NULL,
  364. instr->ctx.data.len);
  365. break;
  366. case NAND_OP_WAITRDY_INSTR:
  367. ret = mxic_nfc_wait_ready(chip);
  368. break;
  369. }
  370. }
  371. mxic_nfc_cs_disable(nfc);
  372. return ret;
  373. }
  374. static int mxic_nfc_setup_interface(struct nand_chip *chip, int chipnr,
  375. const struct nand_interface_config *conf)
  376. {
  377. struct mxic_nand_ctlr *nfc = nand_get_controller_data(chip);
  378. const struct nand_sdr_timings *sdr;
  379. unsigned long freq;
  380. int ret;
  381. sdr = nand_get_sdr_timings(conf);
  382. if (IS_ERR(sdr))
  383. return PTR_ERR(sdr);
  384. if (chipnr == NAND_DATA_IFACE_CHECK_ONLY)
  385. return 0;
  386. freq = NSEC_PER_SEC / (sdr->tRC_min / 1000);
  387. ret = mxic_nfc_set_freq(nfc, freq);
  388. if (ret)
  389. dev_err(nfc->dev, "set freq:%ld failed\n", freq);
  390. if (sdr->tRC_min < 30000)
  391. writel(DATA_STROB_EDO_EN, nfc->regs + DATA_STROB);
  392. return 0;
  393. }
  394. static const struct nand_controller_ops mxic_nand_controller_ops = {
  395. .exec_op = mxic_nfc_exec_op,
  396. .setup_interface = mxic_nfc_setup_interface,
  397. };
  398. static int mxic_nfc_probe(struct platform_device *pdev)
  399. {
  400. struct device_node *nand_np, *np = pdev->dev.of_node;
  401. struct mtd_info *mtd;
  402. struct mxic_nand_ctlr *nfc;
  403. struct nand_chip *nand_chip;
  404. int err;
  405. int irq;
  406. nfc = devm_kzalloc(&pdev->dev, sizeof(struct mxic_nand_ctlr),
  407. GFP_KERNEL);
  408. if (!nfc)
  409. return -ENOMEM;
  410. nfc->ps_clk = devm_clk_get(&pdev->dev, "ps");
  411. if (IS_ERR(nfc->ps_clk))
  412. return PTR_ERR(nfc->ps_clk);
  413. nfc->send_clk = devm_clk_get(&pdev->dev, "send");
  414. if (IS_ERR(nfc->send_clk))
  415. return PTR_ERR(nfc->send_clk);
  416. nfc->send_dly_clk = devm_clk_get(&pdev->dev, "send_dly");
  417. if (IS_ERR(nfc->send_dly_clk))
  418. return PTR_ERR(nfc->send_dly_clk);
  419. nfc->regs = devm_platform_ioremap_resource(pdev, 0);
  420. if (IS_ERR(nfc->regs))
  421. return PTR_ERR(nfc->regs);
  422. nand_chip = &nfc->chip;
  423. mtd = nand_to_mtd(nand_chip);
  424. mtd->dev.parent = &pdev->dev;
  425. for_each_child_of_node(np, nand_np)
  426. nand_set_flash_node(nand_chip, nand_np);
  427. nand_chip->priv = nfc;
  428. nfc->dev = &pdev->dev;
  429. nfc->controller.ops = &mxic_nand_controller_ops;
  430. nand_controller_init(&nfc->controller);
  431. nand_chip->controller = &nfc->controller;
  432. irq = platform_get_irq(pdev, 0);
  433. if (irq < 0)
  434. return irq;
  435. mxic_nfc_hw_init(nfc);
  436. err = devm_request_irq(&pdev->dev, irq, mxic_nfc_isr,
  437. 0, "mxic-nfc", nfc);
  438. if (err)
  439. goto fail;
  440. err = nand_scan(nand_chip, 1);
  441. if (err)
  442. goto fail;
  443. err = mtd_device_register(mtd, NULL, 0);
  444. if (err)
  445. goto fail;
  446. platform_set_drvdata(pdev, nfc);
  447. return 0;
  448. fail:
  449. mxic_nfc_clk_disable(nfc);
  450. return err;
  451. }
  452. static int mxic_nfc_remove(struct platform_device *pdev)
  453. {
  454. struct mxic_nand_ctlr *nfc = platform_get_drvdata(pdev);
  455. struct nand_chip *chip = &nfc->chip;
  456. int ret;
  457. ret = mtd_device_unregister(nand_to_mtd(chip));
  458. WARN_ON(ret);
  459. nand_cleanup(chip);
  460. mxic_nfc_clk_disable(nfc);
  461. return 0;
  462. }
  463. static const struct of_device_id mxic_nfc_of_ids[] = {
  464. { .compatible = "mxic,multi-itfc-v009-nand-controller", },
  465. {},
  466. };
  467. MODULE_DEVICE_TABLE(of, mxic_nfc_of_ids);
  468. static struct platform_driver mxic_nfc_driver = {
  469. .probe = mxic_nfc_probe,
  470. .remove = mxic_nfc_remove,
  471. .driver = {
  472. .name = "mxic-nfc",
  473. .of_match_table = mxic_nfc_of_ids,
  474. },
  475. };
  476. module_platform_driver(mxic_nfc_driver);
  477. MODULE_AUTHOR("Mason Yang <[email protected]>");
  478. MODULE_DESCRIPTION("Macronix raw NAND controller driver");
  479. MODULE_LICENSE("GPL v2");