spi-mpc512x-psc.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * MPC512x PSC in SPI mode driver.
  4. *
  5. * Copyright (C) 2007,2008 Freescale Semiconductor Inc.
  6. * Original port from 52xx driver:
  7. * Hongjun Chen <[email protected]>
  8. *
  9. * Fork of mpc52xx_psc_spi.c:
  10. * Copyright (C) 2006 TOPTICA Photonics AG., Dragos Carp
  11. */
  12. #include <linux/module.h>
  13. #include <linux/kernel.h>
  14. #include <linux/errno.h>
  15. #include <linux/interrupt.h>
  16. #include <linux/of_address.h>
  17. #include <linux/of_irq.h>
  18. #include <linux/of_platform.h>
  19. #include <linux/completion.h>
  20. #include <linux/io.h>
  21. #include <linux/delay.h>
  22. #include <linux/clk.h>
  23. #include <linux/spi/spi.h>
  24. #include <linux/fsl_devices.h>
  25. #include <asm/mpc52xx_psc.h>
  26. enum {
  27. TYPE_MPC5121,
  28. TYPE_MPC5125,
  29. };
  30. /*
  31. * This macro abstracts the differences in the PSC register layout between
  32. * MPC5121 (which uses a struct mpc52xx_psc) and MPC5125 (using mpc5125_psc).
  33. */
  34. #define psc_addr(mps, regname) ({ \
  35. void *__ret = NULL; \
  36. switch (mps->type) { \
  37. case TYPE_MPC5121: { \
  38. struct mpc52xx_psc __iomem *psc = mps->psc; \
  39. __ret = &psc->regname; \
  40. }; \
  41. break; \
  42. case TYPE_MPC5125: { \
  43. struct mpc5125_psc __iomem *psc = mps->psc; \
  44. __ret = &psc->regname; \
  45. }; \
  46. break; \
  47. } \
  48. __ret; })
  49. struct mpc512x_psc_spi {
  50. void (*cs_control)(struct spi_device *spi, bool on);
  51. /* driver internal data */
  52. int type;
  53. void __iomem *psc;
  54. struct mpc512x_psc_fifo __iomem *fifo;
  55. unsigned int irq;
  56. u8 bits_per_word;
  57. struct clk *clk_mclk;
  58. struct clk *clk_ipg;
  59. u32 mclk_rate;
  60. struct completion txisrdone;
  61. };
  62. /* controller state */
  63. struct mpc512x_psc_spi_cs {
  64. int bits_per_word;
  65. int speed_hz;
  66. };
  67. /* set clock freq, clock ramp, bits per work
  68. * if t is NULL then reset the values to the default values
  69. */
  70. static int mpc512x_psc_spi_transfer_setup(struct spi_device *spi,
  71. struct spi_transfer *t)
  72. {
  73. struct mpc512x_psc_spi_cs *cs = spi->controller_state;
  74. cs->speed_hz = (t && t->speed_hz)
  75. ? t->speed_hz : spi->max_speed_hz;
  76. cs->bits_per_word = (t && t->bits_per_word)
  77. ? t->bits_per_word : spi->bits_per_word;
  78. cs->bits_per_word = ((cs->bits_per_word + 7) / 8) * 8;
  79. return 0;
  80. }
  81. static void mpc512x_psc_spi_activate_cs(struct spi_device *spi)
  82. {
  83. struct mpc512x_psc_spi_cs *cs = spi->controller_state;
  84. struct mpc512x_psc_spi *mps = spi_master_get_devdata(spi->master);
  85. u32 sicr;
  86. u32 ccr;
  87. int speed;
  88. u16 bclkdiv;
  89. sicr = in_be32(psc_addr(mps, sicr));
  90. /* Set clock phase and polarity */
  91. if (spi->mode & SPI_CPHA)
  92. sicr |= 0x00001000;
  93. else
  94. sicr &= ~0x00001000;
  95. if (spi->mode & SPI_CPOL)
  96. sicr |= 0x00002000;
  97. else
  98. sicr &= ~0x00002000;
  99. if (spi->mode & SPI_LSB_FIRST)
  100. sicr |= 0x10000000;
  101. else
  102. sicr &= ~0x10000000;
  103. out_be32(psc_addr(mps, sicr), sicr);
  104. ccr = in_be32(psc_addr(mps, ccr));
  105. ccr &= 0xFF000000;
  106. speed = cs->speed_hz;
  107. if (!speed)
  108. speed = 1000000; /* default 1MHz */
  109. bclkdiv = (mps->mclk_rate / speed) - 1;
  110. ccr |= (((bclkdiv & 0xff) << 16) | (((bclkdiv >> 8) & 0xff) << 8));
  111. out_be32(psc_addr(mps, ccr), ccr);
  112. mps->bits_per_word = cs->bits_per_word;
  113. if (spi->cs_gpiod) {
  114. if (mps->cs_control)
  115. /* boardfile override */
  116. mps->cs_control(spi, (spi->mode & SPI_CS_HIGH) ? 1 : 0);
  117. else
  118. /* gpiolib will deal with the inversion */
  119. gpiod_set_value(spi->cs_gpiod, 1);
  120. }
  121. }
  122. static void mpc512x_psc_spi_deactivate_cs(struct spi_device *spi)
  123. {
  124. struct mpc512x_psc_spi *mps = spi_master_get_devdata(spi->master);
  125. if (spi->cs_gpiod) {
  126. if (mps->cs_control)
  127. /* boardfile override */
  128. mps->cs_control(spi, (spi->mode & SPI_CS_HIGH) ? 0 : 1);
  129. else
  130. /* gpiolib will deal with the inversion */
  131. gpiod_set_value(spi->cs_gpiod, 0);
  132. }
  133. }
  134. /* extract and scale size field in txsz or rxsz */
  135. #define MPC512x_PSC_FIFO_SZ(sz) ((sz & 0x7ff) << 2);
  136. #define EOFBYTE 1
  137. static int mpc512x_psc_spi_transfer_rxtx(struct spi_device *spi,
  138. struct spi_transfer *t)
  139. {
  140. struct mpc512x_psc_spi *mps = spi_master_get_devdata(spi->master);
  141. struct mpc512x_psc_fifo __iomem *fifo = mps->fifo;
  142. size_t tx_len = t->len;
  143. size_t rx_len = t->len;
  144. u8 *tx_buf = (u8 *)t->tx_buf;
  145. u8 *rx_buf = (u8 *)t->rx_buf;
  146. if (!tx_buf && !rx_buf && t->len)
  147. return -EINVAL;
  148. while (rx_len || tx_len) {
  149. size_t txcount;
  150. u8 data;
  151. size_t fifosz;
  152. size_t rxcount;
  153. int rxtries;
  154. /*
  155. * send the TX bytes in as large a chunk as possible
  156. * but neither exceed the TX nor the RX FIFOs
  157. */
  158. fifosz = MPC512x_PSC_FIFO_SZ(in_be32(&fifo->txsz));
  159. txcount = min(fifosz, tx_len);
  160. fifosz = MPC512x_PSC_FIFO_SZ(in_be32(&fifo->rxsz));
  161. fifosz -= in_be32(&fifo->rxcnt) + 1;
  162. txcount = min(fifosz, txcount);
  163. if (txcount) {
  164. /* fill the TX FIFO */
  165. while (txcount-- > 0) {
  166. data = tx_buf ? *tx_buf++ : 0;
  167. if (tx_len == EOFBYTE && t->cs_change)
  168. setbits32(&fifo->txcmd,
  169. MPC512x_PSC_FIFO_EOF);
  170. out_8(&fifo->txdata_8, data);
  171. tx_len--;
  172. }
  173. /* have the ISR trigger when the TX FIFO is empty */
  174. reinit_completion(&mps->txisrdone);
  175. out_be32(&fifo->txisr, MPC512x_PSC_FIFO_EMPTY);
  176. out_be32(&fifo->tximr, MPC512x_PSC_FIFO_EMPTY);
  177. wait_for_completion(&mps->txisrdone);
  178. }
  179. /*
  180. * consume as much RX data as the FIFO holds, while we
  181. * iterate over the transfer's TX data length
  182. *
  183. * only insist in draining all the remaining RX bytes
  184. * when the TX bytes were exhausted (that's at the very
  185. * end of this transfer, not when still iterating over
  186. * the transfer's chunks)
  187. */
  188. rxtries = 50;
  189. do {
  190. /*
  191. * grab whatever was in the FIFO when we started
  192. * looking, don't bother fetching what was added to
  193. * the FIFO while we read from it -- we'll return
  194. * here eventually and prefer sending out remaining
  195. * TX data
  196. */
  197. fifosz = in_be32(&fifo->rxcnt);
  198. rxcount = min(fifosz, rx_len);
  199. while (rxcount-- > 0) {
  200. data = in_8(&fifo->rxdata_8);
  201. if (rx_buf)
  202. *rx_buf++ = data;
  203. rx_len--;
  204. }
  205. /*
  206. * come back later if there still is TX data to send,
  207. * bail out of the RX drain loop if all of the TX data
  208. * was sent and all of the RX data was received (i.e.
  209. * when the transmission has completed)
  210. */
  211. if (tx_len)
  212. break;
  213. if (!rx_len)
  214. break;
  215. /*
  216. * TX data transmission has completed while RX data
  217. * is still pending -- that's a transient situation
  218. * which depends on wire speed and specific
  219. * hardware implementation details (buffering) yet
  220. * should resolve very quickly
  221. *
  222. * just yield for a moment to not hog the CPU for
  223. * too long when running SPI at low speed
  224. *
  225. * the timeout range is rather arbitrary and tries
  226. * to balance throughput against system load; the
  227. * chosen values result in a minimal timeout of 50
  228. * times 10us and thus work at speeds as low as
  229. * some 20kbps, while the maximum timeout at the
  230. * transfer's end could be 5ms _if_ nothing else
  231. * ticks in the system _and_ RX data still wasn't
  232. * received, which only occurs in situations that
  233. * are exceptional; removing the unpredictability
  234. * of the timeout either decreases throughput
  235. * (longer timeouts), or puts more load on the
  236. * system (fixed short timeouts) or requires the
  237. * use of a timeout API instead of a counter and an
  238. * unknown inner delay
  239. */
  240. usleep_range(10, 100);
  241. } while (--rxtries > 0);
  242. if (!tx_len && rx_len && !rxtries) {
  243. /*
  244. * not enough RX bytes even after several retries
  245. * and the resulting rather long timeout?
  246. */
  247. rxcount = in_be32(&fifo->rxcnt);
  248. dev_warn(&spi->dev,
  249. "short xfer, missing %zd RX bytes, FIFO level %zd\n",
  250. rx_len, rxcount);
  251. }
  252. /*
  253. * drain and drop RX data which "should not be there" in
  254. * the first place, for undisturbed transmission this turns
  255. * into a NOP (except for the FIFO level fetch)
  256. */
  257. if (!tx_len && !rx_len) {
  258. while (in_be32(&fifo->rxcnt))
  259. in_8(&fifo->rxdata_8);
  260. }
  261. }
  262. return 0;
  263. }
  264. static int mpc512x_psc_spi_msg_xfer(struct spi_master *master,
  265. struct spi_message *m)
  266. {
  267. struct spi_device *spi;
  268. unsigned cs_change;
  269. int status;
  270. struct spi_transfer *t;
  271. spi = m->spi;
  272. cs_change = 1;
  273. status = 0;
  274. list_for_each_entry(t, &m->transfers, transfer_list) {
  275. status = mpc512x_psc_spi_transfer_setup(spi, t);
  276. if (status < 0)
  277. break;
  278. if (cs_change)
  279. mpc512x_psc_spi_activate_cs(spi);
  280. cs_change = t->cs_change;
  281. status = mpc512x_psc_spi_transfer_rxtx(spi, t);
  282. if (status)
  283. break;
  284. m->actual_length += t->len;
  285. spi_transfer_delay_exec(t);
  286. if (cs_change)
  287. mpc512x_psc_spi_deactivate_cs(spi);
  288. }
  289. m->status = status;
  290. if (m->complete)
  291. m->complete(m->context);
  292. if (status || !cs_change)
  293. mpc512x_psc_spi_deactivate_cs(spi);
  294. mpc512x_psc_spi_transfer_setup(spi, NULL);
  295. spi_finalize_current_message(master);
  296. return status;
  297. }
  298. static int mpc512x_psc_spi_prep_xfer_hw(struct spi_master *master)
  299. {
  300. struct mpc512x_psc_spi *mps = spi_master_get_devdata(master);
  301. dev_dbg(&master->dev, "%s()\n", __func__);
  302. /* Zero MR2 */
  303. in_8(psc_addr(mps, mr2));
  304. out_8(psc_addr(mps, mr2), 0x0);
  305. /* enable transmitter/receiver */
  306. out_8(psc_addr(mps, command), MPC52xx_PSC_TX_ENABLE | MPC52xx_PSC_RX_ENABLE);
  307. return 0;
  308. }
  309. static int mpc512x_psc_spi_unprep_xfer_hw(struct spi_master *master)
  310. {
  311. struct mpc512x_psc_spi *mps = spi_master_get_devdata(master);
  312. struct mpc512x_psc_fifo __iomem *fifo = mps->fifo;
  313. dev_dbg(&master->dev, "%s()\n", __func__);
  314. /* disable transmitter/receiver and fifo interrupt */
  315. out_8(psc_addr(mps, command), MPC52xx_PSC_TX_DISABLE | MPC52xx_PSC_RX_DISABLE);
  316. out_be32(&fifo->tximr, 0);
  317. return 0;
  318. }
  319. static int mpc512x_psc_spi_setup(struct spi_device *spi)
  320. {
  321. struct mpc512x_psc_spi_cs *cs = spi->controller_state;
  322. if (spi->bits_per_word % 8)
  323. return -EINVAL;
  324. if (!cs) {
  325. cs = kzalloc(sizeof(*cs), GFP_KERNEL);
  326. if (!cs)
  327. return -ENOMEM;
  328. spi->controller_state = cs;
  329. }
  330. cs->bits_per_word = spi->bits_per_word;
  331. cs->speed_hz = spi->max_speed_hz;
  332. return 0;
  333. }
  334. static void mpc512x_psc_spi_cleanup(struct spi_device *spi)
  335. {
  336. kfree(spi->controller_state);
  337. }
  338. static int mpc512x_psc_spi_port_config(struct spi_master *master,
  339. struct mpc512x_psc_spi *mps)
  340. {
  341. struct mpc512x_psc_fifo __iomem *fifo = mps->fifo;
  342. u32 sicr;
  343. u32 ccr;
  344. int speed;
  345. u16 bclkdiv;
  346. /* Reset the PSC into a known state */
  347. out_8(psc_addr(mps, command), MPC52xx_PSC_RST_RX);
  348. out_8(psc_addr(mps, command), MPC52xx_PSC_RST_TX);
  349. out_8(psc_addr(mps, command), MPC52xx_PSC_TX_DISABLE | MPC52xx_PSC_RX_DISABLE);
  350. /* Disable psc interrupts all useful interrupts are in fifo */
  351. out_be16(psc_addr(mps, isr_imr.imr), 0);
  352. /* Disable fifo interrupts, will be enabled later */
  353. out_be32(&fifo->tximr, 0);
  354. out_be32(&fifo->rximr, 0);
  355. /* Setup fifo slice address and size */
  356. /*out_be32(&fifo->txsz, 0x0fe00004);*/
  357. /*out_be32(&fifo->rxsz, 0x0ff00004);*/
  358. sicr = 0x01000000 | /* SIM = 0001 -- 8 bit */
  359. 0x00800000 | /* GenClk = 1 -- internal clk */
  360. 0x00008000 | /* SPI = 1 */
  361. 0x00004000 | /* MSTR = 1 -- SPI master */
  362. 0x00000800; /* UseEOF = 1 -- SS low until EOF */
  363. out_be32(psc_addr(mps, sicr), sicr);
  364. ccr = in_be32(psc_addr(mps, ccr));
  365. ccr &= 0xFF000000;
  366. speed = 1000000; /* default 1MHz */
  367. bclkdiv = (mps->mclk_rate / speed) - 1;
  368. ccr |= (((bclkdiv & 0xff) << 16) | (((bclkdiv >> 8) & 0xff) << 8));
  369. out_be32(psc_addr(mps, ccr), ccr);
  370. /* Set 2ms DTL delay */
  371. out_8(psc_addr(mps, ctur), 0x00);
  372. out_8(psc_addr(mps, ctlr), 0x82);
  373. /* we don't use the alarms */
  374. out_be32(&fifo->rxalarm, 0xfff);
  375. out_be32(&fifo->txalarm, 0);
  376. /* Enable FIFO slices for Rx/Tx */
  377. out_be32(&fifo->rxcmd,
  378. MPC512x_PSC_FIFO_ENABLE_SLICE | MPC512x_PSC_FIFO_ENABLE_DMA);
  379. out_be32(&fifo->txcmd,
  380. MPC512x_PSC_FIFO_ENABLE_SLICE | MPC512x_PSC_FIFO_ENABLE_DMA);
  381. mps->bits_per_word = 8;
  382. return 0;
  383. }
  384. static irqreturn_t mpc512x_psc_spi_isr(int irq, void *dev_id)
  385. {
  386. struct mpc512x_psc_spi *mps = (struct mpc512x_psc_spi *)dev_id;
  387. struct mpc512x_psc_fifo __iomem *fifo = mps->fifo;
  388. /* clear interrupt and wake up the rx/tx routine */
  389. if (in_be32(&fifo->txisr) &
  390. in_be32(&fifo->tximr) & MPC512x_PSC_FIFO_EMPTY) {
  391. out_be32(&fifo->txisr, MPC512x_PSC_FIFO_EMPTY);
  392. out_be32(&fifo->tximr, 0);
  393. complete(&mps->txisrdone);
  394. return IRQ_HANDLED;
  395. }
  396. return IRQ_NONE;
  397. }
  398. static int mpc512x_psc_spi_do_probe(struct device *dev, u32 regaddr,
  399. u32 size, unsigned int irq)
  400. {
  401. struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
  402. struct mpc512x_psc_spi *mps;
  403. struct spi_master *master;
  404. int ret;
  405. void *tempp;
  406. struct clk *clk;
  407. master = spi_alloc_master(dev, sizeof(*mps));
  408. if (master == NULL)
  409. return -ENOMEM;
  410. dev_set_drvdata(dev, master);
  411. mps = spi_master_get_devdata(master);
  412. mps->type = (int)of_device_get_match_data(dev);
  413. mps->irq = irq;
  414. if (pdata) {
  415. mps->cs_control = pdata->cs_control;
  416. master->bus_num = pdata->bus_num;
  417. master->num_chipselect = pdata->max_chipselect;
  418. }
  419. master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST;
  420. master->setup = mpc512x_psc_spi_setup;
  421. master->prepare_transfer_hardware = mpc512x_psc_spi_prep_xfer_hw;
  422. master->transfer_one_message = mpc512x_psc_spi_msg_xfer;
  423. master->unprepare_transfer_hardware = mpc512x_psc_spi_unprep_xfer_hw;
  424. master->use_gpio_descriptors = true;
  425. master->cleanup = mpc512x_psc_spi_cleanup;
  426. master->dev.of_node = dev->of_node;
  427. tempp = devm_ioremap(dev, regaddr, size);
  428. if (!tempp) {
  429. dev_err(dev, "could not ioremap I/O port range\n");
  430. ret = -EFAULT;
  431. goto free_master;
  432. }
  433. mps->psc = tempp;
  434. mps->fifo =
  435. (struct mpc512x_psc_fifo *)(tempp + sizeof(struct mpc52xx_psc));
  436. ret = devm_request_irq(dev, mps->irq, mpc512x_psc_spi_isr, IRQF_SHARED,
  437. "mpc512x-psc-spi", mps);
  438. if (ret)
  439. goto free_master;
  440. init_completion(&mps->txisrdone);
  441. clk = devm_clk_get(dev, "mclk");
  442. if (IS_ERR(clk)) {
  443. ret = PTR_ERR(clk);
  444. goto free_master;
  445. }
  446. ret = clk_prepare_enable(clk);
  447. if (ret)
  448. goto free_master;
  449. mps->clk_mclk = clk;
  450. mps->mclk_rate = clk_get_rate(clk);
  451. clk = devm_clk_get(dev, "ipg");
  452. if (IS_ERR(clk)) {
  453. ret = PTR_ERR(clk);
  454. goto free_mclk_clock;
  455. }
  456. ret = clk_prepare_enable(clk);
  457. if (ret)
  458. goto free_mclk_clock;
  459. mps->clk_ipg = clk;
  460. ret = mpc512x_psc_spi_port_config(master, mps);
  461. if (ret < 0)
  462. goto free_ipg_clock;
  463. ret = devm_spi_register_master(dev, master);
  464. if (ret < 0)
  465. goto free_ipg_clock;
  466. return ret;
  467. free_ipg_clock:
  468. clk_disable_unprepare(mps->clk_ipg);
  469. free_mclk_clock:
  470. clk_disable_unprepare(mps->clk_mclk);
  471. free_master:
  472. spi_master_put(master);
  473. return ret;
  474. }
  475. static int mpc512x_psc_spi_do_remove(struct device *dev)
  476. {
  477. struct spi_master *master = dev_get_drvdata(dev);
  478. struct mpc512x_psc_spi *mps = spi_master_get_devdata(master);
  479. clk_disable_unprepare(mps->clk_mclk);
  480. clk_disable_unprepare(mps->clk_ipg);
  481. return 0;
  482. }
  483. static int mpc512x_psc_spi_of_probe(struct platform_device *op)
  484. {
  485. const u32 *regaddr_p;
  486. u64 regaddr64, size64;
  487. regaddr_p = of_get_address(op->dev.of_node, 0, &size64, NULL);
  488. if (!regaddr_p) {
  489. dev_err(&op->dev, "Invalid PSC address\n");
  490. return -EINVAL;
  491. }
  492. regaddr64 = of_translate_address(op->dev.of_node, regaddr_p);
  493. return mpc512x_psc_spi_do_probe(&op->dev, (u32) regaddr64, (u32) size64,
  494. irq_of_parse_and_map(op->dev.of_node, 0));
  495. }
  496. static int mpc512x_psc_spi_of_remove(struct platform_device *op)
  497. {
  498. return mpc512x_psc_spi_do_remove(&op->dev);
  499. }
  500. static const struct of_device_id mpc512x_psc_spi_of_match[] = {
  501. { .compatible = "fsl,mpc5121-psc-spi", .data = (void *)TYPE_MPC5121 },
  502. { .compatible = "fsl,mpc5125-psc-spi", .data = (void *)TYPE_MPC5125 },
  503. {},
  504. };
  505. MODULE_DEVICE_TABLE(of, mpc512x_psc_spi_of_match);
  506. static struct platform_driver mpc512x_psc_spi_of_driver = {
  507. .probe = mpc512x_psc_spi_of_probe,
  508. .remove = mpc512x_psc_spi_of_remove,
  509. .driver = {
  510. .name = "mpc512x-psc-spi",
  511. .of_match_table = mpc512x_psc_spi_of_match,
  512. },
  513. };
  514. module_platform_driver(mpc512x_psc_spi_of_driver);
  515. MODULE_AUTHOR("John Rigby");
  516. MODULE_DESCRIPTION("MPC512x PSC SPI Driver");
  517. MODULE_LICENSE("GPL");