Blame view

drivers/spi/spi-sh.c 11.1 KB
9135bac32   Wolfram Sang   spi: use SPDX ide...
1
  // SPDX-License-Identifier: GPL-2.0
5c05dd075   Yoshihiro Shimoda   spi: add support ...
2
3
4
5
6
7
8
  /*
   * SH SPI bus driver
   *
   * Copyright (C) 2011  Renesas Solutions Corp.
   *
   * Based on pxa2xx_spi.c:
   * Copyright (C) 2005 Stephen Street / StreetFire Sound Labs
5c05dd075   Yoshihiro Shimoda   spi: add support ...
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
   */
  
  #include <linux/module.h>
  #include <linux/kernel.h>
  #include <linux/sched.h>
  #include <linux/errno.h>
  #include <linux/timer.h>
  #include <linux/delay.h>
  #include <linux/list.h>
  #include <linux/workqueue.h>
  #include <linux/interrupt.h>
  #include <linux/platform_device.h>
  #include <linux/io.h>
  #include <linux/spi/spi.h>
  
  #define SPI_SH_TBR		0x00
  #define SPI_SH_RBR		0x00
  #define SPI_SH_CR1		0x08
  #define SPI_SH_CR2		0x10
  #define SPI_SH_CR3		0x18
  #define SPI_SH_CR4		0x20
  #define SPI_SH_CR5		0x28
  
  /* CR1 */
  #define SPI_SH_TBE		0x80
  #define SPI_SH_TBF		0x40
  #define SPI_SH_RBE		0x20
  #define SPI_SH_RBF		0x10
  #define SPI_SH_PFONRD		0x08
  #define SPI_SH_SSDB		0x04
  #define SPI_SH_SSD		0x02
  #define SPI_SH_SSA		0x01
  
  /* CR2 */
  #define SPI_SH_RSTF		0x80
  #define SPI_SH_LOOPBK		0x40
  #define SPI_SH_CPOL		0x20
  #define SPI_SH_CPHA		0x10
  #define SPI_SH_L1M0		0x08
  
  /* CR3 */
  #define SPI_SH_MAX_BYTE		0xFF
  
  /* CR4 */
  #define SPI_SH_TBEI		0x80
  #define SPI_SH_TBFI		0x40
  #define SPI_SH_RBEI		0x20
  #define SPI_SH_RBFI		0x10
  #define SPI_SH_WPABRT		0x04
  #define SPI_SH_SSS		0x01
  
  /* CR8 */
  #define SPI_SH_P1L0		0x80
  #define SPI_SH_PP1L0		0x40
  #define SPI_SH_MUXI		0x20
  #define SPI_SH_MUXIRQ		0x10
  
  #define SPI_SH_FIFO_SIZE	32
  #define SPI_SH_SEND_TIMEOUT	(3 * HZ)
  #define SPI_SH_RECEIVE_TIMEOUT	(HZ >> 3)
  
  #undef DEBUG
  
  struct spi_sh_data {
  	void __iomem *addr;
  	int irq;
  	struct spi_master *master;
  	struct list_head queue;
5c05dd075   Yoshihiro Shimoda   spi: add support ...
77
78
79
80
  	struct work_struct ws;
  	unsigned long cr1;
  	wait_queue_head_t wait;
  	spinlock_t lock;
0eb8880fa   Shimoda, Yoshihiro   spi/spi-sh: add I...
81
  	int width;
5c05dd075   Yoshihiro Shimoda   spi: add support ...
82
83
84
85
86
  };
  
  static void spi_sh_write(struct spi_sh_data *ss, unsigned long data,
  			     unsigned long offset)
  {
0eb8880fa   Shimoda, Yoshihiro   spi/spi-sh: add I...
87
88
89
90
  	if (ss->width == 8)
  		iowrite8(data, ss->addr + (offset >> 2));
  	else if (ss->width == 32)
  		iowrite32(data, ss->addr + offset);
5c05dd075   Yoshihiro Shimoda   spi: add support ...
91
92
93
94
  }
  
  static unsigned long spi_sh_read(struct spi_sh_data *ss, unsigned long offset)
  {
0eb8880fa   Shimoda, Yoshihiro   spi/spi-sh: add I...
95
96
97
98
99
100
  	if (ss->width == 8)
  		return ioread8(ss->addr + (offset >> 2));
  	else if (ss->width == 32)
  		return ioread32(ss->addr + offset);
  	else
  		return 0;
5c05dd075   Yoshihiro Shimoda   spi: add support ...
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
  }
  
  static void spi_sh_set_bit(struct spi_sh_data *ss, unsigned long val,
  				unsigned long offset)
  {
  	unsigned long tmp;
  
  	tmp = spi_sh_read(ss, offset);
  	tmp |= val;
  	spi_sh_write(ss, tmp, offset);
  }
  
  static void spi_sh_clear_bit(struct spi_sh_data *ss, unsigned long val,
  				unsigned long offset)
  {
  	unsigned long tmp;
  
  	tmp = spi_sh_read(ss, offset);
  	tmp &= ~val;
  	spi_sh_write(ss, tmp, offset);
  }
  
  static void clear_fifo(struct spi_sh_data *ss)
  {
  	spi_sh_set_bit(ss, SPI_SH_RSTF, SPI_SH_CR2);
  	spi_sh_clear_bit(ss, SPI_SH_RSTF, SPI_SH_CR2);
  }
  
  static int spi_sh_wait_receive_buffer(struct spi_sh_data *ss)
  {
  	int timeout = 100000;
  
  	while (spi_sh_read(ss, SPI_SH_CR1) & SPI_SH_RBE) {
  		udelay(10);
  		if (timeout-- < 0)
  			return -ETIMEDOUT;
  	}
  	return 0;
  }
  
  static int spi_sh_wait_write_buffer_empty(struct spi_sh_data *ss)
  {
  	int timeout = 100000;
  
  	while (!(spi_sh_read(ss, SPI_SH_CR1) & SPI_SH_TBE)) {
  		udelay(10);
  		if (timeout-- < 0)
  			return -ETIMEDOUT;
  	}
  	return 0;
  }
  
  static int spi_sh_send(struct spi_sh_data *ss, struct spi_message *mesg,
  			struct spi_transfer *t)
  {
  	int i, retval = 0;
  	int remain = t->len;
  	int cur_len;
  	unsigned char *data;
5c05dd075   Yoshihiro Shimoda   spi: add support ...
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
  	long ret;
  
  	if (t->len)
  		spi_sh_set_bit(ss, SPI_SH_SSA, SPI_SH_CR1);
  
  	data = (unsigned char *)t->tx_buf;
  	while (remain > 0) {
  		cur_len = min(SPI_SH_FIFO_SIZE, remain);
  		for (i = 0; i < cur_len &&
  				!(spi_sh_read(ss, SPI_SH_CR4) &
  							SPI_SH_WPABRT) &&
  				!(spi_sh_read(ss, SPI_SH_CR1) & SPI_SH_TBF);
  				i++)
  			spi_sh_write(ss, (unsigned long)data[i], SPI_SH_TBR);
  
  		if (spi_sh_read(ss, SPI_SH_CR4) & SPI_SH_WPABRT) {
  			/* Abort SPI operation */
  			spi_sh_set_bit(ss, SPI_SH_WPABRT, SPI_SH_CR4);
  			retval = -EIO;
  			break;
  		}
  
  		cur_len = i;
  
  		remain -= cur_len;
  		data += cur_len;
  
  		if (remain > 0) {
  			ss->cr1 &= ~SPI_SH_TBE;
  			spi_sh_set_bit(ss, SPI_SH_TBE, SPI_SH_CR4);
  			ret = wait_event_interruptible_timeout(ss->wait,
  						 ss->cr1 & SPI_SH_TBE,
  						 SPI_SH_SEND_TIMEOUT);
  			if (ret == 0 && !(ss->cr1 & SPI_SH_TBE)) {
  				printk(KERN_ERR "%s: timeout
  ", __func__);
  				return -ETIMEDOUT;
  			}
  		}
  	}
  
  	if (list_is_last(&t->transfer_list, &mesg->transfers)) {
909e709c7   Axel Lin   spi: sh: Use spi_...
202
  		spi_sh_clear_bit(ss, SPI_SH_SSD | SPI_SH_SSDB, SPI_SH_CR1);
5c05dd075   Yoshihiro Shimoda   spi: add support ...
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
  		spi_sh_set_bit(ss, SPI_SH_SSA, SPI_SH_CR1);
  
  		ss->cr1 &= ~SPI_SH_TBE;
  		spi_sh_set_bit(ss, SPI_SH_TBE, SPI_SH_CR4);
  		ret = wait_event_interruptible_timeout(ss->wait,
  					 ss->cr1 & SPI_SH_TBE,
  					 SPI_SH_SEND_TIMEOUT);
  		if (ret == 0 && (ss->cr1 & SPI_SH_TBE)) {
  			printk(KERN_ERR "%s: timeout
  ", __func__);
  			return -ETIMEDOUT;
  		}
  	}
  
  	return retval;
  }
  
  static int spi_sh_receive(struct spi_sh_data *ss, struct spi_message *mesg,
  			  struct spi_transfer *t)
  {
  	int i;
  	int remain = t->len;
  	int cur_len;
  	unsigned char *data;
5c05dd075   Yoshihiro Shimoda   spi: add support ...
227
228
229
230
231
232
  	long ret;
  
  	if (t->len > SPI_SH_MAX_BYTE)
  		spi_sh_write(ss, SPI_SH_MAX_BYTE, SPI_SH_CR3);
  	else
  		spi_sh_write(ss, t->len, SPI_SH_CR3);
909e709c7   Axel Lin   spi: sh: Use spi_...
233
  	spi_sh_clear_bit(ss, SPI_SH_SSD | SPI_SH_SSDB, SPI_SH_CR1);
5c05dd075   Yoshihiro Shimoda   spi: add support ...
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
  	spi_sh_set_bit(ss, SPI_SH_SSA, SPI_SH_CR1);
  
  	spi_sh_wait_write_buffer_empty(ss);
  
  	data = (unsigned char *)t->rx_buf;
  	while (remain > 0) {
  		if (remain >= SPI_SH_FIFO_SIZE) {
  			ss->cr1 &= ~SPI_SH_RBF;
  			spi_sh_set_bit(ss, SPI_SH_RBF, SPI_SH_CR4);
  			ret = wait_event_interruptible_timeout(ss->wait,
  						 ss->cr1 & SPI_SH_RBF,
  						 SPI_SH_RECEIVE_TIMEOUT);
  			if (ret == 0 &&
  			    spi_sh_read(ss, SPI_SH_CR1) & SPI_SH_RBE) {
  				printk(KERN_ERR "%s: timeout
  ", __func__);
  				return -ETIMEDOUT;
  			}
  		}
  
  		cur_len = min(SPI_SH_FIFO_SIZE, remain);
  		for (i = 0; i < cur_len; i++) {
  			if (spi_sh_wait_receive_buffer(ss))
  				break;
  			data[i] = (unsigned char)spi_sh_read(ss, SPI_SH_RBR);
  		}
  
  		remain -= cur_len;
  		data += cur_len;
  	}
  
  	/* deassert CS when SPI is receiving. */
  	if (t->len > SPI_SH_MAX_BYTE) {
  		clear_fifo(ss);
  		spi_sh_write(ss, 1, SPI_SH_CR3);
  	} else {
  		spi_sh_write(ss, 0, SPI_SH_CR3);
  	}
  
  	return 0;
  }
  
  static void spi_sh_work(struct work_struct *work)
  {
  	struct spi_sh_data *ss = container_of(work, struct spi_sh_data, ws);
  	struct spi_message *mesg;
  	struct spi_transfer *t;
  	unsigned long flags;
  	int ret;
  
  	pr_debug("%s: enter
  ", __func__);
  
  	spin_lock_irqsave(&ss->lock, flags);
  	while (!list_empty(&ss->queue)) {
  		mesg = list_entry(ss->queue.next, struct spi_message, queue);
  		list_del_init(&mesg->queue);
  
  		spin_unlock_irqrestore(&ss->lock, flags);
  		list_for_each_entry(t, &mesg->transfers, transfer_list) {
  			pr_debug("tx_buf = %p, rx_buf = %p
  ",
  					t->tx_buf, t->rx_buf);
  			pr_debug("len = %d, delay_usecs = %d
  ",
  					t->len, t->delay_usecs);
  
  			if (t->tx_buf) {
  				ret = spi_sh_send(ss, mesg, t);
  				if (ret < 0)
  					goto error;
  			}
  			if (t->rx_buf) {
  				ret = spi_sh_receive(ss, mesg, t);
  				if (ret < 0)
  					goto error;
  			}
  			mesg->actual_length += t->len;
  		}
  		spin_lock_irqsave(&ss->lock, flags);
  
  		mesg->status = 0;
0a6d38795   Axel Lin   spi: Always check...
316
317
  		if (mesg->complete)
  			mesg->complete(mesg->context);
5c05dd075   Yoshihiro Shimoda   spi: add support ...
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
  	}
  
  	clear_fifo(ss);
  	spi_sh_set_bit(ss, SPI_SH_SSD, SPI_SH_CR1);
  	udelay(100);
  
  	spi_sh_clear_bit(ss, SPI_SH_SSA | SPI_SH_SSDB | SPI_SH_SSD,
  			 SPI_SH_CR1);
  
  	clear_fifo(ss);
  
  	spin_unlock_irqrestore(&ss->lock, flags);
  
  	return;
  
   error:
  	mesg->status = ret;
0a6d38795   Axel Lin   spi: Always check...
335
336
  	if (mesg->complete)
  		mesg->complete(mesg->context);
5c05dd075   Yoshihiro Shimoda   spi: add support ...
337
338
339
340
341
342
343
344
345
346
  
  	spi_sh_clear_bit(ss, SPI_SH_SSA | SPI_SH_SSDB | SPI_SH_SSD,
  			 SPI_SH_CR1);
  	clear_fifo(ss);
  
  }
  
  static int spi_sh_setup(struct spi_device *spi)
  {
  	struct spi_sh_data *ss = spi_master_get_devdata(spi->master);
5c05dd075   Yoshihiro Shimoda   spi: add support ...
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
  	pr_debug("%s: enter
  ", __func__);
  
  	spi_sh_write(ss, 0xfe, SPI_SH_CR1);	/* SPI sycle stop */
  	spi_sh_write(ss, 0x00, SPI_SH_CR1);	/* CR1 init */
  	spi_sh_write(ss, 0x00, SPI_SH_CR3);	/* CR3 init */
  
  	clear_fifo(ss);
  
  	/* 1/8 clock */
  	spi_sh_write(ss, spi_sh_read(ss, SPI_SH_CR2) | 0x07, SPI_SH_CR2);
  	udelay(10);
  
  	return 0;
  }
  
  static int spi_sh_transfer(struct spi_device *spi, struct spi_message *mesg)
  {
  	struct spi_sh_data *ss = spi_master_get_devdata(spi->master);
  	unsigned long flags;
  
  	pr_debug("%s: enter
  ", __func__);
  	pr_debug("\tmode = %02x
  ", spi->mode);
  
  	spin_lock_irqsave(&ss->lock, flags);
  
  	mesg->actual_length = 0;
  	mesg->status = -EINPROGRESS;
  
  	spi_sh_clear_bit(ss, SPI_SH_SSA, SPI_SH_CR1);
  
  	list_add_tail(&mesg->queue, &ss->queue);
38e099208   Bhaktipriya Shridhar   spi: spi-sh: Remo...
381
  	schedule_work(&ss->ws);
5c05dd075   Yoshihiro Shimoda   spi: add support ...
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
  
  	spin_unlock_irqrestore(&ss->lock, flags);
  
  	return 0;
  }
  
  static void spi_sh_cleanup(struct spi_device *spi)
  {
  	struct spi_sh_data *ss = spi_master_get_devdata(spi->master);
  
  	pr_debug("%s: enter
  ", __func__);
  
  	spi_sh_clear_bit(ss, SPI_SH_SSA | SPI_SH_SSDB | SPI_SH_SSD,
  			 SPI_SH_CR1);
  }
  
  static irqreturn_t spi_sh_irq(int irq, void *_ss)
  {
  	struct spi_sh_data *ss = (struct spi_sh_data *)_ss;
  	unsigned long cr1;
  
  	cr1 = spi_sh_read(ss, SPI_SH_CR1);
  	if (cr1 & SPI_SH_TBE)
  		ss->cr1 |= SPI_SH_TBE;
  	if (cr1 & SPI_SH_TBF)
  		ss->cr1 |= SPI_SH_TBF;
  	if (cr1 & SPI_SH_RBE)
  		ss->cr1 |= SPI_SH_RBE;
  	if (cr1 & SPI_SH_RBF)
  		ss->cr1 |= SPI_SH_RBF;
  
  	if (ss->cr1) {
  		spi_sh_clear_bit(ss, ss->cr1, SPI_SH_CR4);
  		wake_up(&ss->wait);
  	}
  
  	return IRQ_HANDLED;
  }
fd4a319bc   Grant Likely   spi: Remove HOTPL...
421
  static int spi_sh_remove(struct platform_device *pdev)
5c05dd075   Yoshihiro Shimoda   spi: add support ...
422
  {
24b5a82cf   Jingoo Han   spi: use platform...
423
  	struct spi_sh_data *ss = platform_get_drvdata(pdev);
5c05dd075   Yoshihiro Shimoda   spi: add support ...
424

680c1305e   Axel Lin   spi/spi_sh: use s...
425
  	spi_unregister_master(ss->master);
38e099208   Bhaktipriya Shridhar   spi: spi-sh: Remo...
426
  	flush_work(&ss->ws);
5c05dd075   Yoshihiro Shimoda   spi: add support ...
427
  	free_irq(ss->irq, ss);
5c05dd075   Yoshihiro Shimoda   spi: add support ...
428
429
430
  
  	return 0;
  }
fd4a319bc   Grant Likely   spi: Remove HOTPL...
431
  static int spi_sh_probe(struct platform_device *pdev)
5c05dd075   Yoshihiro Shimoda   spi: add support ...
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
  {
  	struct resource *res;
  	struct spi_master *master;
  	struct spi_sh_data *ss;
  	int ret, irq;
  
  	/* get base addr */
  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  	if (unlikely(res == NULL)) {
  		dev_err(&pdev->dev, "invalid resource
  ");
  		return -EINVAL;
  	}
  
  	irq = platform_get_irq(pdev, 0);
6b8ac10e0   Stephen Boyd   spi: Remove dev_e...
447
  	if (irq < 0)
345fef75d   Gustavo A. R. Silva   spi: spi-sh: fix ...
448
  		return irq;
5c05dd075   Yoshihiro Shimoda   spi: add support ...
449
450
451
452
453
454
455
456
457
  
  	master = spi_alloc_master(&pdev->dev, sizeof(struct spi_sh_data));
  	if (master == NULL) {
  		dev_err(&pdev->dev, "spi_alloc_master error.
  ");
  		return -ENOMEM;
  	}
  
  	ss = spi_master_get_devdata(master);
24b5a82cf   Jingoo Han   spi: use platform...
458
  	platform_set_drvdata(pdev, ss);
5c05dd075   Yoshihiro Shimoda   spi: add support ...
459

0eb8880fa   Shimoda, Yoshihiro   spi/spi-sh: add I...
460
461
462
463
464
465
466
467
468
469
470
471
472
  	switch (res->flags & IORESOURCE_MEM_TYPE_MASK) {
  	case IORESOURCE_MEM_8BIT:
  		ss->width = 8;
  		break;
  	case IORESOURCE_MEM_32BIT:
  		ss->width = 32;
  		break;
  	default:
  		dev_err(&pdev->dev, "No support width
  ");
  		ret = -ENODEV;
  		goto error1;
  	}
5c05dd075   Yoshihiro Shimoda   spi: add support ...
473
474
  	ss->irq = irq;
  	ss->master = master;
e9d42d152   Himangi Saraogi   spi/spi-sh: Use d...
475
  	ss->addr = devm_ioremap(&pdev->dev, res->start, resource_size(res));
5c05dd075   Yoshihiro Shimoda   spi: add support ...
476
477
478
479
480
481
482
483
484
485
  	if (ss->addr == NULL) {
  		dev_err(&pdev->dev, "ioremap error.
  ");
  		ret = -ENOMEM;
  		goto error1;
  	}
  	INIT_LIST_HEAD(&ss->queue);
  	spin_lock_init(&ss->lock);
  	INIT_WORK(&ss->ws, spi_sh_work);
  	init_waitqueue_head(&ss->wait);
5c05dd075   Yoshihiro Shimoda   spi: add support ...
486

38ada214f   Yong Zhang   spi: irq: Remove ...
487
  	ret = request_irq(irq, spi_sh_irq, 0, "spi_sh", ss);
5c05dd075   Yoshihiro Shimoda   spi: add support ...
488
489
490
  	if (ret < 0) {
  		dev_err(&pdev->dev, "request_irq error
  ");
38e099208   Bhaktipriya Shridhar   spi: spi-sh: Remo...
491
  		goto error1;
5c05dd075   Yoshihiro Shimoda   spi: add support ...
492
493
494
495
496
497
498
499
500
501
502
503
  	}
  
  	master->num_chipselect = 2;
  	master->bus_num = pdev->id;
  	master->setup = spi_sh_setup;
  	master->transfer = spi_sh_transfer;
  	master->cleanup = spi_sh_cleanup;
  
  	ret = spi_register_master(master);
  	if (ret < 0) {
  		printk(KERN_ERR "spi_register_master error.
  ");
e9d42d152   Himangi Saraogi   spi/spi-sh: Use d...
504
  		goto error3;
5c05dd075   Yoshihiro Shimoda   spi: add support ...
505
506
507
  	}
  
  	return 0;
5c05dd075   Yoshihiro Shimoda   spi: add support ...
508
   error3:
e9d42d152   Himangi Saraogi   spi/spi-sh: Use d...
509
  	free_irq(irq, ss);
5c05dd075   Yoshihiro Shimoda   spi: add support ...
510
511
512
513
514
515
516
517
   error1:
  	spi_master_put(master);
  
  	return ret;
  }
  
  static struct platform_driver spi_sh_driver = {
  	.probe = spi_sh_probe,
fd4a319bc   Grant Likely   spi: Remove HOTPL...
518
  	.remove = spi_sh_remove,
5c05dd075   Yoshihiro Shimoda   spi: add support ...
519
520
  	.driver = {
  		.name = "sh_spi",
5c05dd075   Yoshihiro Shimoda   spi: add support ...
521
522
  	},
  };
940ab8896   Grant Likely   drivercore: Add h...
523
  module_platform_driver(spi_sh_driver);
5c05dd075   Yoshihiro Shimoda   spi: add support ...
524
525
  
  MODULE_DESCRIPTION("SH SPI bus driver");
9135bac32   Wolfram Sang   spi: use SPDX ide...
526
  MODULE_LICENSE("GPL v2");
5c05dd075   Yoshihiro Shimoda   spi: add support ...
527
528
  MODULE_AUTHOR("Yoshihiro Shimoda");
  MODULE_ALIAS("platform:sh_spi");