blob: 78ffd3e2fe05d3c1d726e96ee738328405bf0253 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +05302/*
Jagan Teki697cdaa2015-09-02 11:39:45 +05303 * (C) Copyright 2013 Xilinx, Inc.
Jagan Tekif2125762015-06-27 00:51:31 +05304 * (C) Copyright 2015 Jagan Teki <jteki@openedev.com>
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +05305 *
6 * Xilinx Zynq PS SPI controller driver (master mode only)
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +05307 */
8
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +05309#include <common.h>
Jagan Tekif2125762015-06-27 00:51:31 +053010#include <dm.h>
Simon Glass0f2af882020-05-10 11:40:05 -060011#include <log.h>
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +053012#include <malloc.h>
13#include <spi.h>
Simon Glass495a5dc2019-11-14 12:57:30 -070014#include <time.h>
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +053015#include <asm/io.h>
Simon Glass4dcacfc2020-05-10 11:40:13 -060016#include <linux/bitops.h>
Simon Glassdbd79542020-05-10 11:40:11 -060017#include <linux/delay.h>
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +053018
Jagan Teki82081632015-06-27 00:51:34 +053019DECLARE_GLOBAL_DATA_PTR;
20
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +053021/* zynq spi register bit masks ZYNQ_SPI_<REG>_<BIT>_MASK */
Jagan Tekif94b3f72015-10-22 20:40:16 +053022#define ZYNQ_SPI_CR_MSA_MASK BIT(15) /* Manual start enb */
23#define ZYNQ_SPI_CR_MCS_MASK BIT(14) /* Manual chip select */
Jagan Tekie1af6ae2015-10-22 21:06:37 +053024#define ZYNQ_SPI_CR_CS_MASK GENMASK(13, 10) /* Chip select */
25#define ZYNQ_SPI_CR_BAUD_MASK GENMASK(5, 3) /* Baud rate div */
Jagan Tekif94b3f72015-10-22 20:40:16 +053026#define ZYNQ_SPI_CR_CPHA_MASK BIT(2) /* Clock phase */
27#define ZYNQ_SPI_CR_CPOL_MASK BIT(1) /* Clock polarity */
28#define ZYNQ_SPI_CR_MSTREN_MASK BIT(0) /* Mode select */
29#define ZYNQ_SPI_IXR_RXNEMPTY_MASK BIT(4) /* RX_FIFO_not_empty */
30#define ZYNQ_SPI_IXR_TXOW_MASK BIT(2) /* TX_FIFO_not_full */
Jagan Tekie1af6ae2015-10-22 21:06:37 +053031#define ZYNQ_SPI_IXR_ALL_MASK GENMASK(6, 0) /* All IXR bits */
Jagan Tekif94b3f72015-10-22 20:40:16 +053032#define ZYNQ_SPI_ENR_SPI_EN_MASK BIT(0) /* SPI Enable */
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +053033
Jagan Tekibe47fc32015-08-17 18:25:03 +053034#define ZYNQ_SPI_CR_BAUD_MAX 8 /* Baud rate divisor max val */
35#define ZYNQ_SPI_CR_BAUD_SHIFT 3 /* Baud rate divisor shift */
36#define ZYNQ_SPI_CR_SS_SHIFT 10 /* Slave select shift */
37
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +053038#define ZYNQ_SPI_FIFO_DEPTH 128
Ashok Reddy Somacaecfe62020-05-18 01:11:00 -060039#define ZYNQ_SPI_WAIT (CONFIG_SYS_HZ / 100) /* 10 ms */
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +053040
41/* zynq spi register set */
42struct zynq_spi_regs {
43 u32 cr; /* 0x00 */
44 u32 isr; /* 0x04 */
45 u32 ier; /* 0x08 */
46 u32 idr; /* 0x0C */
47 u32 imr; /* 0x10 */
48 u32 enr; /* 0x14 */
49 u32 dr; /* 0x18 */
50 u32 txdr; /* 0x1C */
51 u32 rxdr; /* 0x20 */
52};
53
Jagan Tekif2125762015-06-27 00:51:31 +053054
55/* zynq spi platform data */
56struct zynq_spi_platdata {
57 struct zynq_spi_regs *regs;
58 u32 frequency; /* input frequency */
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +053059 u32 speed_hz;
Moritz Fischer50b7d032016-12-08 12:11:09 -080060 uint deactivate_delay_us; /* Delay to wait after deactivate */
61 uint activate_delay_us; /* Delay to wait after activate */
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +053062};
63
Jagan Tekif2125762015-06-27 00:51:31 +053064/* zynq spi priv */
65struct zynq_spi_priv {
66 struct zynq_spi_regs *regs;
Jagan Teki12c941e2015-08-17 18:31:39 +053067 u8 cs;
Jagan Tekif2125762015-06-27 00:51:31 +053068 u8 mode;
Moritz Fischer50b7d032016-12-08 12:11:09 -080069 ulong last_transaction_us; /* Time of last transaction end */
Jagan Tekif2125762015-06-27 00:51:31 +053070 u8 fifo_depth;
71 u32 freq; /* required frequency */
72};
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +053073
Jagan Tekif2125762015-06-27 00:51:31 +053074static int zynq_spi_ofdata_to_platdata(struct udevice *bus)
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +053075{
Jagan Tekif2125762015-06-27 00:51:31 +053076 struct zynq_spi_platdata *plat = bus->platdata;
Jagan Teki82081632015-06-27 00:51:34 +053077 const void *blob = gd->fdt_blob;
Simon Glassdd79d6e2017-01-17 16:52:55 -070078 int node = dev_of_offset(bus);
Jagan Tekif2125762015-06-27 00:51:31 +053079
Simon Glassba1dea42017-05-17 17:18:05 -060080 plat->regs = (struct zynq_spi_regs *)devfdt_get_addr(bus);
Jagan Teki82081632015-06-27 00:51:34 +053081
82 /* FIXME: Use 250MHz as a suitable default */
83 plat->frequency = fdtdec_get_int(blob, node, "spi-max-frequency",
84 250000000);
Moritz Fischer50b7d032016-12-08 12:11:09 -080085 plat->deactivate_delay_us = fdtdec_get_int(blob, node,
86 "spi-deactivate-delay", 0);
87 plat->activate_delay_us = fdtdec_get_int(blob, node,
88 "spi-activate-delay", 0);
Jagan Tekif2125762015-06-27 00:51:31 +053089 plat->speed_hz = plat->frequency / 2;
90
Michal Simek2e0ddea2015-07-21 07:54:11 +020091 debug("%s: regs=%p max-frequency=%d\n", __func__,
Jagan Teki82081632015-06-27 00:51:34 +053092 plat->regs, plat->frequency);
93
Jagan Tekif2125762015-06-27 00:51:31 +053094 return 0;
95}
96
97static void zynq_spi_init_hw(struct zynq_spi_priv *priv)
98{
99 struct zynq_spi_regs *regs = priv->regs;
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530100 u32 confr;
101
102 /* Disable SPI */
Michal Simekebbac2f2016-09-01 12:51:27 +0200103 confr = ZYNQ_SPI_ENR_SPI_EN_MASK;
104 writel(~confr, &regs->enr);
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530105
106 /* Disable Interrupts */
Jagan Tekif2125762015-06-27 00:51:31 +0530107 writel(ZYNQ_SPI_IXR_ALL_MASK, &regs->idr);
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530108
109 /* Clear RX FIFO */
Jagan Tekif2125762015-06-27 00:51:31 +0530110 while (readl(&regs->isr) &
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530111 ZYNQ_SPI_IXR_RXNEMPTY_MASK)
Jagan Tekif2125762015-06-27 00:51:31 +0530112 readl(&regs->rxdr);
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530113
114 /* Clear Interrupts */
Jagan Tekif2125762015-06-27 00:51:31 +0530115 writel(ZYNQ_SPI_IXR_ALL_MASK, &regs->isr);
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530116
117 /* Manual slave select and Auto start */
118 confr = ZYNQ_SPI_CR_MCS_MASK | ZYNQ_SPI_CR_CS_MASK |
119 ZYNQ_SPI_CR_MSTREN_MASK;
120 confr &= ~ZYNQ_SPI_CR_MSA_MASK;
Jagan Tekif2125762015-06-27 00:51:31 +0530121 writel(confr, &regs->cr);
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530122
123 /* Enable SPI */
Jagan Tekif2125762015-06-27 00:51:31 +0530124 writel(ZYNQ_SPI_ENR_SPI_EN_MASK, &regs->enr);
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530125}
126
Jagan Tekif2125762015-06-27 00:51:31 +0530127static int zynq_spi_probe(struct udevice *bus)
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530128{
Jagan Tekif2125762015-06-27 00:51:31 +0530129 struct zynq_spi_platdata *plat = dev_get_platdata(bus);
130 struct zynq_spi_priv *priv = dev_get_priv(bus);
131
132 priv->regs = plat->regs;
133 priv->fifo_depth = ZYNQ_SPI_FIFO_DEPTH;
134
135 /* init the zynq spi hw */
136 zynq_spi_init_hw(priv);
137
138 return 0;
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530139}
140
Jagan Teki12c941e2015-08-17 18:31:39 +0530141static void spi_cs_activate(struct udevice *dev)
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530142{
Jagan Tekif2125762015-06-27 00:51:31 +0530143 struct udevice *bus = dev->parent;
Moritz Fischer50b7d032016-12-08 12:11:09 -0800144 struct zynq_spi_platdata *plat = bus->platdata;
Jagan Tekif2125762015-06-27 00:51:31 +0530145 struct zynq_spi_priv *priv = dev_get_priv(bus);
146 struct zynq_spi_regs *regs = priv->regs;
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530147 u32 cr;
148
Moritz Fischer50b7d032016-12-08 12:11:09 -0800149 /* If it's too soon to do another transaction, wait */
150 if (plat->deactivate_delay_us && priv->last_transaction_us) {
151 ulong delay_us; /* The delay completed so far */
152 delay_us = timer_get_us() - priv->last_transaction_us;
153 if (delay_us < plat->deactivate_delay_us)
154 udelay(plat->deactivate_delay_us - delay_us);
155 }
156
Jagan Tekif2125762015-06-27 00:51:31 +0530157 clrbits_le32(&regs->cr, ZYNQ_SPI_CR_CS_MASK);
158 cr = readl(&regs->cr);
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530159 /*
160 * CS cal logic: CS[13:10]
161 * xxx0 - cs0
162 * xx01 - cs1
163 * x011 - cs2
164 */
Jagan Teki12c941e2015-08-17 18:31:39 +0530165 cr |= (~(1 << priv->cs) << ZYNQ_SPI_CR_SS_SHIFT) & ZYNQ_SPI_CR_CS_MASK;
Jagan Tekif2125762015-06-27 00:51:31 +0530166 writel(cr, &regs->cr);
Moritz Fischer50b7d032016-12-08 12:11:09 -0800167
168 if (plat->activate_delay_us)
169 udelay(plat->activate_delay_us);
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530170}
171
Jagan Tekif2125762015-06-27 00:51:31 +0530172static void spi_cs_deactivate(struct udevice *dev)
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530173{
Jagan Tekif2125762015-06-27 00:51:31 +0530174 struct udevice *bus = dev->parent;
Moritz Fischer50b7d032016-12-08 12:11:09 -0800175 struct zynq_spi_platdata *plat = bus->platdata;
Jagan Tekif2125762015-06-27 00:51:31 +0530176 struct zynq_spi_priv *priv = dev_get_priv(bus);
177 struct zynq_spi_regs *regs = priv->regs;
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530178
Jagan Tekif2125762015-06-27 00:51:31 +0530179 setbits_le32(&regs->cr, ZYNQ_SPI_CR_CS_MASK);
Moritz Fischer50b7d032016-12-08 12:11:09 -0800180
181 /* Remember time of this transaction so we can honour the bus delay */
182 if (plat->deactivate_delay_us)
183 priv->last_transaction_us = timer_get_us();
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530184}
185
Jagan Tekif2125762015-06-27 00:51:31 +0530186static int zynq_spi_claim_bus(struct udevice *dev)
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530187{
Jagan Tekif2125762015-06-27 00:51:31 +0530188 struct udevice *bus = dev->parent;
189 struct zynq_spi_priv *priv = dev_get_priv(bus);
190 struct zynq_spi_regs *regs = priv->regs;
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530191
Jagan Tekif2125762015-06-27 00:51:31 +0530192 writel(ZYNQ_SPI_ENR_SPI_EN_MASK, &regs->enr);
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530193
Jagan Tekif2125762015-06-27 00:51:31 +0530194 return 0;
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530195}
196
Jagan Tekif2125762015-06-27 00:51:31 +0530197static int zynq_spi_release_bus(struct udevice *dev)
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530198{
Jagan Tekif2125762015-06-27 00:51:31 +0530199 struct udevice *bus = dev->parent;
200 struct zynq_spi_priv *priv = dev_get_priv(bus);
201 struct zynq_spi_regs *regs = priv->regs;
Michal Simekebbac2f2016-09-01 12:51:27 +0200202 u32 confr;
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530203
Michal Simekebbac2f2016-09-01 12:51:27 +0200204 confr = ZYNQ_SPI_ENR_SPI_EN_MASK;
205 writel(~confr, &regs->enr);
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530206
207 return 0;
208}
209
Jagan Tekif2125762015-06-27 00:51:31 +0530210static int zynq_spi_xfer(struct udevice *dev, unsigned int bitlen,
211 const void *dout, void *din, unsigned long flags)
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530212{
Jagan Tekif2125762015-06-27 00:51:31 +0530213 struct udevice *bus = dev->parent;
214 struct zynq_spi_priv *priv = dev_get_priv(bus);
215 struct zynq_spi_regs *regs = priv->regs;
216 struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530217 u32 len = bitlen / 8;
218 u32 tx_len = len, rx_len = len, tx_tvl;
219 const u8 *tx_buf = dout;
220 u8 *rx_buf = din, buf;
221 u32 ts, status;
222
223 debug("spi_xfer: bus:%i cs:%i bitlen:%i len:%i flags:%lx\n",
Jagan Tekif2125762015-06-27 00:51:31 +0530224 bus->seq, slave_plat->cs, bitlen, len, flags);
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530225
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530226 if (bitlen % 8) {
227 debug("spi_xfer: Non byte aligned SPI transfer\n");
228 return -1;
229 }
230
Jagan Teki12c941e2015-08-17 18:31:39 +0530231 priv->cs = slave_plat->cs;
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530232 if (flags & SPI_XFER_BEGIN)
Jagan Teki12c941e2015-08-17 18:31:39 +0530233 spi_cs_activate(dev);
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530234
235 while (rx_len > 0) {
236 /* Write the data into TX FIFO - tx threshold is fifo_depth */
237 tx_tvl = 0;
Jagan Tekif2125762015-06-27 00:51:31 +0530238 while ((tx_tvl < priv->fifo_depth) && tx_len) {
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530239 if (tx_buf)
240 buf = *tx_buf++;
241 else
242 buf = 0;
Jagan Tekif2125762015-06-27 00:51:31 +0530243 writel(buf, &regs->txdr);
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530244 tx_len--;
245 tx_tvl++;
246 }
247
248 /* Check TX FIFO completion */
249 ts = get_timer(0);
Jagan Tekif2125762015-06-27 00:51:31 +0530250 status = readl(&regs->isr);
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530251 while (!(status & ZYNQ_SPI_IXR_TXOW_MASK)) {
Ashok Reddy Somacaecfe62020-05-18 01:11:00 -0600252 if (get_timer(ts) > ZYNQ_SPI_WAIT) {
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530253 printf("spi_xfer: Timeout! TX FIFO not full\n");
254 return -1;
255 }
Jagan Tekif2125762015-06-27 00:51:31 +0530256 status = readl(&regs->isr);
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530257 }
258
259 /* Read the data from RX FIFO */
Jagan Tekif2125762015-06-27 00:51:31 +0530260 status = readl(&regs->isr);
Lad, Prabhakar636ef592016-07-30 22:28:24 +0100261 while ((status & ZYNQ_SPI_IXR_RXNEMPTY_MASK) && rx_len) {
Jagan Tekif2125762015-06-27 00:51:31 +0530262 buf = readl(&regs->rxdr);
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530263 if (rx_buf)
264 *rx_buf++ = buf;
Jagan Tekif2125762015-06-27 00:51:31 +0530265 status = readl(&regs->isr);
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530266 rx_len--;
267 }
268 }
269
270 if (flags & SPI_XFER_END)
Jagan Tekif2125762015-06-27 00:51:31 +0530271 spi_cs_deactivate(dev);
272
273 return 0;
274}
275
276static int zynq_spi_set_speed(struct udevice *bus, uint speed)
277{
278 struct zynq_spi_platdata *plat = bus->platdata;
279 struct zynq_spi_priv *priv = dev_get_priv(bus);
280 struct zynq_spi_regs *regs = priv->regs;
281 uint32_t confr;
282 u8 baud_rate_val = 0;
283
284 if (speed > plat->frequency)
285 speed = plat->frequency;
286
287 /* Set the clock frequency */
288 confr = readl(&regs->cr);
289 if (speed == 0) {
290 /* Set baudrate x8, if the freq is 0 */
291 baud_rate_val = 0x2;
292 } else if (plat->speed_hz != speed) {
Jagan Tekibe47fc32015-08-17 18:25:03 +0530293 while ((baud_rate_val < ZYNQ_SPI_CR_BAUD_MAX) &&
Jagan Tekif2125762015-06-27 00:51:31 +0530294 ((plat->frequency /
295 (2 << baud_rate_val)) > speed))
296 baud_rate_val++;
297 plat->speed_hz = speed / (2 << baud_rate_val);
298 }
Jagan Teki08dd0952015-08-17 18:27:47 +0530299 confr &= ~ZYNQ_SPI_CR_BAUD_MASK;
Jagan Tekibe47fc32015-08-17 18:25:03 +0530300 confr |= (baud_rate_val << ZYNQ_SPI_CR_BAUD_SHIFT);
Jagan Tekif2125762015-06-27 00:51:31 +0530301
302 writel(confr, &regs->cr);
303 priv->freq = speed;
304
Jagan Tekia61e2162015-09-08 01:38:50 +0530305 debug("zynq_spi_set_speed: regs=%p, speed=%d\n",
306 priv->regs, priv->freq);
Jagan Tekif2125762015-06-27 00:51:31 +0530307
308 return 0;
309}
310
311static int zynq_spi_set_mode(struct udevice *bus, uint mode)
312{
313 struct zynq_spi_priv *priv = dev_get_priv(bus);
314 struct zynq_spi_regs *regs = priv->regs;
315 uint32_t confr;
316
317 /* Set the SPI Clock phase and polarities */
318 confr = readl(&regs->cr);
319 confr &= ~(ZYNQ_SPI_CR_CPHA_MASK | ZYNQ_SPI_CR_CPOL_MASK);
320
Jagan Tekia61e2162015-09-08 01:38:50 +0530321 if (mode & SPI_CPHA)
Jagan Tekif2125762015-06-27 00:51:31 +0530322 confr |= ZYNQ_SPI_CR_CPHA_MASK;
Jagan Tekia61e2162015-09-08 01:38:50 +0530323 if (mode & SPI_CPOL)
Jagan Tekif2125762015-06-27 00:51:31 +0530324 confr |= ZYNQ_SPI_CR_CPOL_MASK;
325
326 writel(confr, &regs->cr);
327 priv->mode = mode;
328
329 debug("zynq_spi_set_mode: regs=%p, mode=%d\n", priv->regs, priv->mode);
Jagannadha Sutradharudu Teki216ec092013-07-29 23:45:16 +0530330
331 return 0;
332}
Jagan Tekif2125762015-06-27 00:51:31 +0530333
334static const struct dm_spi_ops zynq_spi_ops = {
335 .claim_bus = zynq_spi_claim_bus,
336 .release_bus = zynq_spi_release_bus,
337 .xfer = zynq_spi_xfer,
338 .set_speed = zynq_spi_set_speed,
339 .set_mode = zynq_spi_set_mode,
340};
341
342static const struct udevice_id zynq_spi_ids[] = {
Michal Simek0cf97aa2015-07-22 10:47:33 +0200343 { .compatible = "xlnx,zynq-spi-r1p6" },
Michal Simek8eb23ec2015-12-07 13:06:54 +0100344 { .compatible = "cdns,spi-r1p6" },
Jagan Tekif2125762015-06-27 00:51:31 +0530345 { }
346};
347
348U_BOOT_DRIVER(zynq_spi) = {
349 .name = "zynq_spi",
350 .id = UCLASS_SPI,
351 .of_match = zynq_spi_ids,
352 .ops = &zynq_spi_ops,
353 .ofdata_to_platdata = zynq_spi_ofdata_to_platdata,
354 .platdata_auto_alloc_size = sizeof(struct zynq_spi_platdata),
355 .priv_auto_alloc_size = sizeof(struct zynq_spi_priv),
356 .probe = zynq_spi_probe,
357};