epcs.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  1. /*
  2. * (C) Copyright 2004, Psyent Corporation <www.psyent.com>
  3. * Scott McNutt <smcnutt@psyent.com>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <common.h>
  8. #if defined(CONFIG_SYS_NIOS_EPCSBASE)
  9. #include <command.h>
  10. #include <asm/io.h>
  11. #include <nios2-io.h>
  12. #include <nios2-epcs.h>
  13. /*-----------------------------------------------------------------------*/
  14. #define SHORT_HELP\
  15. "epcs - read/write Cyclone EPCS configuration device.\n"
  16. #define LONG_HELP\
  17. "\n"\
  18. "epcs erase start [end]\n"\
  19. " - erase sector start or sectors start through end.\n"\
  20. "epcs info\n"\
  21. " - display EPCS device information.\n"\
  22. "epcs protect on | off\n"\
  23. " - turn device protection on or off.\n"\
  24. "epcs read addr offset count\n"\
  25. " - read count bytes from offset to addr.\n"\
  26. "epcs write addr offset count\n"\
  27. " - write count bytes to offset from addr.\n"\
  28. "epcs verify addr offset count\n"\
  29. " - verify count bytes at offset from addr."
  30. /*-----------------------------------------------------------------------*/
  31. /* Operation codes for serial configuration devices
  32. */
  33. #define EPCS_WRITE_ENA 0x06 /* Write enable */
  34. #define EPCS_WRITE_DIS 0x04 /* Write disable */
  35. #define EPCS_READ_STAT 0x05 /* Read status */
  36. #define EPCS_READ_BYTES 0x03 /* Read bytes */
  37. #define EPCS_READ_ID 0xab /* Read silicon id */
  38. #define EPCS_WRITE_STAT 0x01 /* Write status */
  39. #define EPCS_WRITE_BYTES 0x02 /* Write bytes */
  40. #define EPCS_ERASE_BULK 0xc7 /* Erase entire device */
  41. #define EPCS_ERASE_SECT 0xd8 /* Erase sector */
  42. /* Device status register bits
  43. */
  44. #define EPCS_STATUS_WIP (1<<0) /* Write in progress */
  45. #define EPCS_STATUS_WEL (1<<1) /* Write enable latch */
  46. /* Misc
  47. */
  48. #define EPCS_TIMEOUT 100 /* 100 msec timeout */
  49. static nios_spi_t *epcs = (nios_spi_t *)CONFIG_SYS_NIOS_EPCSBASE;
  50. /***********************************************************************
  51. * Device access
  52. ***********************************************************************/
  53. static int epcs_cs (int assert)
  54. {
  55. ulong start;
  56. unsigned tmp;
  57. if (assert) {
  58. tmp = readl (&epcs->control);
  59. writel (tmp | NIOS_SPI_SSO, &epcs->control);
  60. } else {
  61. /* Let all bits shift out */
  62. start = get_timer (0);
  63. while ((readl (&epcs->status) & NIOS_SPI_TMT) == 0)
  64. if (get_timer (start) > EPCS_TIMEOUT)
  65. return (-1);
  66. tmp = readl (&epcs->control);
  67. writel (tmp & ~NIOS_SPI_SSO, &epcs->control);
  68. }
  69. return (0);
  70. }
  71. static int epcs_tx (unsigned char c)
  72. {
  73. ulong start;
  74. start = get_timer (0);
  75. while ((readl (&epcs->status) & NIOS_SPI_TRDY) == 0)
  76. if (get_timer (start) > EPCS_TIMEOUT)
  77. return (-1);
  78. writel (c, &epcs->txdata);
  79. return (0);
  80. }
  81. static int epcs_rx (void)
  82. {
  83. ulong start;
  84. start = get_timer (0);
  85. while ((readl (&epcs->status) & NIOS_SPI_RRDY) == 0)
  86. if (get_timer (start) > EPCS_TIMEOUT)
  87. return (-1);
  88. return (readl (&epcs->rxdata));
  89. }
  90. static unsigned char bitrev[] = {
  91. 0x00, 0x08, 0x04, 0x0c, 0x02, 0x0a, 0x06, 0x0e,
  92. 0x01, 0x09, 0x05, 0x0d, 0x03, 0x0b, 0x07, 0x0f
  93. };
  94. static unsigned char epcs_bitrev (unsigned char c)
  95. {
  96. unsigned char val;
  97. val = bitrev[c>>4];
  98. val |= bitrev[c & 0x0f]<<4;
  99. return (val);
  100. }
  101. static void epcs_rcv (unsigned char *dst, int len)
  102. {
  103. while (len--) {
  104. epcs_tx (0);
  105. *dst++ = epcs_rx ();
  106. }
  107. }
  108. static void epcs_rrcv (unsigned char *dst, int len)
  109. {
  110. while (len--) {
  111. epcs_tx (0);
  112. *dst++ = epcs_bitrev (epcs_rx ());
  113. }
  114. }
  115. static void epcs_snd (unsigned char *src, int len)
  116. {
  117. while (len--) {
  118. epcs_tx (*src++);
  119. epcs_rx ();
  120. }
  121. }
  122. static void epcs_rsnd (unsigned char *src, int len)
  123. {
  124. while (len--) {
  125. epcs_tx (epcs_bitrev (*src++));
  126. epcs_rx ();
  127. }
  128. }
  129. static void epcs_wr_enable (void)
  130. {
  131. epcs_cs (1);
  132. epcs_tx (EPCS_WRITE_ENA);
  133. epcs_rx ();
  134. epcs_cs (0);
  135. }
  136. static unsigned char epcs_status_rd (void)
  137. {
  138. unsigned char status;
  139. epcs_cs (1);
  140. epcs_tx (EPCS_READ_STAT);
  141. epcs_rx ();
  142. epcs_tx (0);
  143. status = epcs_rx ();
  144. epcs_cs (0);
  145. return (status);
  146. }
  147. static void epcs_status_wr (unsigned char status)
  148. {
  149. epcs_wr_enable ();
  150. epcs_cs (1);
  151. epcs_tx (EPCS_WRITE_STAT);
  152. epcs_rx ();
  153. epcs_tx (status);
  154. epcs_rx ();
  155. epcs_cs (0);
  156. return;
  157. }
  158. /***********************************************************************
  159. * Device information
  160. ***********************************************************************/
  161. static struct epcs_devinfo_t devinfo[] = {
  162. { "EPCS1 ", 0x10, 17, 4, 15, 8, 0x0c },
  163. { "EPCS4 ", 0x12, 19, 8, 16, 8, 0x1c },
  164. { "EPCS16", 0x14, 21, 32, 16, 8, 0x1c },
  165. { "EPCS64", 0x16, 23,128, 16, 8, 0x1c },
  166. { 0, 0, 0, 0, 0, 0 }
  167. };
  168. int epcs_reset (void)
  169. {
  170. /* When booting from an epcs controller, the epcs bootrom
  171. * code may leave the slave select in an asserted state.
  172. * This causes two problems: (1) The initial epcs access
  173. * will fail -- not a big deal, and (2) a software reset
  174. * will cause the bootrom code to hang since it does not
  175. * ensure the select is negated prior to first access -- a
  176. * big deal. Here we just negate chip select and everything
  177. * gets better :-)
  178. */
  179. epcs_cs (0); /* Negate chip select */
  180. return (0);
  181. }
  182. epcs_devinfo_t *epcs_dev_find (void)
  183. {
  184. unsigned char buf[4];
  185. unsigned char id;
  186. int i;
  187. struct epcs_devinfo_t *dev = NULL;
  188. /* Read silicon id requires 3 "dummy bytes" before it's put
  189. * on the wire.
  190. */
  191. buf[0] = EPCS_READ_ID;
  192. buf[1] = 0;
  193. buf[2] = 0;
  194. buf[3] = 0;
  195. epcs_cs (1);
  196. epcs_snd (buf,4);
  197. epcs_rcv (buf,1);
  198. if (epcs_cs (0) == -1)
  199. return (NULL);
  200. id = buf[0];
  201. /* Find the info struct */
  202. i = 0;
  203. while (devinfo[i].name) {
  204. if (id == devinfo[i].id) {
  205. dev = &devinfo[i];
  206. break;
  207. }
  208. i++;
  209. }
  210. return (dev);
  211. }
  212. /***********************************************************************
  213. * Misc Utilities
  214. ***********************************************************************/
  215. int epcs_cfgsz (void)
  216. {
  217. int sz = 0;
  218. unsigned char buf[128];
  219. unsigned char *p;
  220. struct epcs_devinfo_t *dev = epcs_dev_find ();
  221. if (!dev)
  222. return (-1);
  223. /* Read in the first 128 bytes of the device */
  224. buf[0] = EPCS_READ_BYTES;
  225. buf[1] = 0;
  226. buf[2] = 0;
  227. buf[3] = 0;
  228. epcs_cs (1);
  229. epcs_snd (buf,4);
  230. epcs_rrcv (buf, sizeof(buf));
  231. epcs_cs (0);
  232. /* Search for the starting 0x6a which is followed by the
  233. * 4-byte 'register' and 4-byte bit-count.
  234. */
  235. p = buf;
  236. while (p < buf + sizeof(buf)-8) {
  237. if ( *p == 0x6a ) {
  238. /* Point to bit count and extract */
  239. p += 5;
  240. sz = *p++;
  241. sz |= *p++ << 8;
  242. sz |= *p++ << 16;
  243. sz |= *p++ << 24;
  244. /* Convert to byte count */
  245. sz += 7;
  246. sz >>= 3;
  247. } else if (*p == 0xff) {
  248. /* 0xff is ok ... just skip */
  249. p++;
  250. continue;
  251. } else {
  252. /* Not 0xff or 0x6a ... something's not
  253. * right ... report 'unknown' (sz=0).
  254. */
  255. break;
  256. }
  257. }
  258. return (sz);
  259. }
  260. int epcs_erase (unsigned start, unsigned end)
  261. {
  262. unsigned off, sectsz;
  263. unsigned char buf[4];
  264. struct epcs_devinfo_t *dev = epcs_dev_find ();
  265. if (!dev || (start>end))
  266. return (-1);
  267. /* Erase the requested sectors. An address is required
  268. * that lies within the requested sector -- we'll just
  269. * use the first address in the sector.
  270. */
  271. printf ("epcs erasing sector %d ", start);
  272. if (start != end)
  273. printf ("to %d ", end);
  274. sectsz = (1 << dev->sz_sect);
  275. while (start <= end) {
  276. off = start * sectsz;
  277. start++;
  278. buf[0] = EPCS_ERASE_SECT;
  279. buf[1] = off >> 16;
  280. buf[2] = off >> 8;
  281. buf[3] = off;
  282. epcs_wr_enable ();
  283. epcs_cs (1);
  284. epcs_snd (buf,4);
  285. epcs_cs (0);
  286. printf ("."); /* Some user feedback */
  287. /* Wait for erase to complete */
  288. while (epcs_status_rd() & EPCS_STATUS_WIP)
  289. ;
  290. }
  291. printf (" done.\n");
  292. return (0);
  293. }
  294. int epcs_read (ulong addr, ulong off, ulong cnt)
  295. {
  296. unsigned char buf[4];
  297. struct epcs_devinfo_t *dev = epcs_dev_find ();
  298. if (!dev)
  299. return (-1);
  300. buf[0] = EPCS_READ_BYTES;
  301. buf[1] = off >> 16;
  302. buf[2] = off >> 8;
  303. buf[3] = off;
  304. epcs_cs (1);
  305. epcs_snd (buf,4);
  306. epcs_rrcv ((unsigned char *)addr, cnt);
  307. epcs_cs (0);
  308. return (0);
  309. }
  310. int epcs_write (ulong addr, ulong off, ulong cnt)
  311. {
  312. ulong wrcnt;
  313. unsigned pgsz;
  314. unsigned char buf[4];
  315. struct epcs_devinfo_t *dev = epcs_dev_find ();
  316. if (!dev)
  317. return (-1);
  318. pgsz = (1<<dev->sz_page);
  319. while (cnt) {
  320. if (off % pgsz)
  321. wrcnt = pgsz - (off % pgsz);
  322. else
  323. wrcnt = pgsz;
  324. wrcnt = (wrcnt > cnt) ? cnt : wrcnt;
  325. buf[0] = EPCS_WRITE_BYTES;
  326. buf[1] = off >> 16;
  327. buf[2] = off >> 8;
  328. buf[3] = off;
  329. epcs_wr_enable ();
  330. epcs_cs (1);
  331. epcs_snd (buf,4);
  332. epcs_rsnd ((unsigned char *)addr, wrcnt);
  333. epcs_cs (0);
  334. /* Wait for write to complete */
  335. while (epcs_status_rd() & EPCS_STATUS_WIP)
  336. ;
  337. cnt -= wrcnt;
  338. off += wrcnt;
  339. addr += wrcnt;
  340. }
  341. return (0);
  342. }
  343. int epcs_verify (ulong addr, ulong off, ulong cnt, ulong *err)
  344. {
  345. ulong rdcnt;
  346. unsigned char buf[256];
  347. unsigned char *start,*end;
  348. int i;
  349. start = end = (unsigned char *)addr;
  350. while (cnt) {
  351. rdcnt = (cnt>sizeof(buf)) ? sizeof(buf) : cnt;
  352. epcs_read ((ulong)buf, off, rdcnt);
  353. for (i=0; i<rdcnt; i++) {
  354. if (*end != buf[i]) {
  355. *err = end - start;
  356. return(-1);
  357. }
  358. end++;
  359. }
  360. cnt -= rdcnt;
  361. off += rdcnt;
  362. }
  363. return (0);
  364. }
  365. static int epcs_sect_erased (int sect, unsigned *offset,
  366. struct epcs_devinfo_t *dev)
  367. {
  368. unsigned char buf[128];
  369. unsigned off, end;
  370. unsigned sectsz;
  371. int i;
  372. sectsz = (1 << dev->sz_sect);
  373. off = sectsz * sect;
  374. end = off + sectsz;
  375. while (off < end) {
  376. epcs_read ((ulong)buf, off, sizeof(buf));
  377. for (i=0; i < sizeof(buf); i++) {
  378. if (buf[i] != 0xff) {
  379. *offset = off + i;
  380. return (0);
  381. }
  382. }
  383. off += sizeof(buf);
  384. }
  385. return (1);
  386. }
  387. /***********************************************************************
  388. * Commands
  389. ***********************************************************************/
  390. static
  391. void do_epcs_info (struct epcs_devinfo_t *dev, int argc, char * const argv[])
  392. {
  393. int i;
  394. unsigned char stat;
  395. unsigned tmp;
  396. int erased;
  397. /* Basic device info */
  398. printf ("%s: %d kbytes (%d sectors x %d kbytes,"
  399. " %d bytes/page)\n",
  400. dev->name, 1 << (dev->size-10),
  401. dev->num_sects, 1 << (dev->sz_sect-10),
  402. 1 << dev->sz_page );
  403. /* Status -- for now protection is all-or-nothing */
  404. stat = epcs_status_rd();
  405. printf ("status: 0x%02x (WIP:%d, WEL:%d, PROT:%s)\n",
  406. stat,
  407. (stat & EPCS_STATUS_WIP) ? 1 : 0,
  408. (stat & EPCS_STATUS_WEL) ? 1 : 0,
  409. (stat & dev->prot_mask) ? "on" : "off" );
  410. /* Configuration */
  411. tmp = epcs_cfgsz ();
  412. if (tmp) {
  413. printf ("config: 0x%06x (%d) bytes\n", tmp, tmp );
  414. } else {
  415. printf ("config: unknown\n" );
  416. }
  417. /* Sector info */
  418. for (i=0; (i < dev->num_sects) && (argc > 1); i++) {
  419. erased = epcs_sect_erased (i, &tmp, dev);
  420. if ((i & 0x03) == 0) printf ("\n");
  421. printf ("%4d: %07x ",
  422. i, i*(1<<dev->sz_sect) );
  423. if (erased)
  424. printf ("E ");
  425. else
  426. printf (" ");
  427. }
  428. printf ("\n");
  429. return;
  430. }
  431. static
  432. void do_epcs_erase (struct epcs_devinfo_t *dev, int argc, char * const argv[])
  433. {
  434. unsigned start,end;
  435. if ((argc < 3) || (argc > 4)) {
  436. printf ("USAGE: epcs erase sect [end]\n");
  437. return;
  438. }
  439. if ((epcs_status_rd() & dev->prot_mask) != 0) {
  440. printf ( "epcs: device protected.\n");
  441. return;
  442. }
  443. start = simple_strtoul (argv[2], NULL, 10);
  444. if (argc > 3)
  445. end = simple_strtoul (argv[3], NULL, 10);
  446. else
  447. end = start;
  448. if ((start >= dev->num_sects) || (start > end)) {
  449. printf ("epcs: invalid sector range: [%d:%d]\n",
  450. start, end );
  451. return;
  452. }
  453. epcs_erase (start, end);
  454. return;
  455. }
  456. static
  457. void do_epcs_protect (struct epcs_devinfo_t *dev, int argc, char * const argv[])
  458. {
  459. unsigned char stat;
  460. /* For now protection is all-or-nothing to keep things
  461. * simple. The protection bits don't map in a linear
  462. * fashion ... and we would rather protect the bottom
  463. * of the device since it contains the config data and
  464. * leave the top unprotected for app use. But unfortunately
  465. * protection works from top-to-bottom so it does
  466. * really help very much from a software app point-of-view.
  467. */
  468. if (argc < 3) {
  469. printf ("USAGE: epcs protect on | off\n");
  470. return;
  471. }
  472. if (!dev)
  473. return;
  474. /* Protection on/off is just a matter of setting/clearing
  475. * all protection bits in the status register.
  476. */
  477. stat = epcs_status_rd ();
  478. if (strcmp ("on", argv[2]) == 0) {
  479. stat |= dev->prot_mask;
  480. } else if (strcmp ("off", argv[2]) == 0 ) {
  481. stat &= ~dev->prot_mask;
  482. } else {
  483. printf ("epcs: unknown protection: %s\n", argv[2]);
  484. return;
  485. }
  486. epcs_status_wr (stat);
  487. return;
  488. }
  489. static
  490. void do_epcs_read (struct epcs_devinfo_t *dev, int argc, char * const argv[])
  491. {
  492. ulong addr,off,cnt;
  493. ulong sz;
  494. if (argc < 5) {
  495. printf ("USAGE: epcs read addr offset count\n");
  496. return;
  497. }
  498. sz = 1 << dev->size;
  499. addr = simple_strtoul (argv[2], NULL, 16);
  500. off = simple_strtoul (argv[3], NULL, 16);
  501. cnt = simple_strtoul (argv[4], NULL, 16);
  502. if (off > sz) {
  503. printf ("offset is greater than device size"
  504. "... aborting.\n");
  505. return;
  506. }
  507. if ((off + cnt) > sz) {
  508. printf ("request exceeds device size"
  509. "... truncating.\n");
  510. cnt = sz - off;
  511. }
  512. printf ("epcs: read %08lx <- %06lx (0x%lx bytes)\n",
  513. addr, off, cnt);
  514. epcs_read (addr, off, cnt);
  515. return;
  516. }
  517. static
  518. void do_epcs_write (struct epcs_devinfo_t *dev, int argc, char * const argv[])
  519. {
  520. ulong addr,off,cnt;
  521. ulong sz;
  522. ulong err;
  523. if (argc < 5) {
  524. printf ("USAGE: epcs write addr offset count\n");
  525. return;
  526. }
  527. if ((epcs_status_rd() & dev->prot_mask) != 0) {
  528. printf ( "epcs: device protected.\n");
  529. return;
  530. }
  531. sz = 1 << dev->size;
  532. addr = simple_strtoul (argv[2], NULL, 16);
  533. off = simple_strtoul (argv[3], NULL, 16);
  534. cnt = simple_strtoul (argv[4], NULL, 16);
  535. if (off > sz) {
  536. printf ("offset is greater than device size"
  537. "... aborting.\n");
  538. return;
  539. }
  540. if ((off + cnt) > sz) {
  541. printf ("request exceeds device size"
  542. "... truncating.\n");
  543. cnt = sz - off;
  544. }
  545. printf ("epcs: write %08lx -> %06lx (0x%lx bytes)\n",
  546. addr, off, cnt);
  547. epcs_write (addr, off, cnt);
  548. if (epcs_verify (addr, off, cnt, &err) != 0)
  549. printf ("epcs: write error at offset %06lx\n", err);
  550. return;
  551. }
  552. static
  553. void do_epcs_verify (struct epcs_devinfo_t *dev, int argc, char * const argv[])
  554. {
  555. ulong addr,off,cnt;
  556. ulong sz;
  557. ulong err;
  558. if (argc < 5) {
  559. printf ("USAGE: epcs verify addr offset count\n");
  560. return;
  561. }
  562. sz = 1 << dev->size;
  563. addr = simple_strtoul (argv[2], NULL, 16);
  564. off = simple_strtoul (argv[3], NULL, 16);
  565. cnt = simple_strtoul (argv[4], NULL, 16);
  566. if (off > sz) {
  567. printf ("offset is greater than device size"
  568. "... aborting.\n");
  569. return;
  570. }
  571. if ((off + cnt) > sz) {
  572. printf ("request exceeds device size"
  573. "... truncating.\n");
  574. cnt = sz - off;
  575. }
  576. printf ("epcs: verify %08lx -> %06lx (0x%lx bytes)\n",
  577. addr, off, cnt);
  578. if (epcs_verify (addr, off, cnt, &err) != 0)
  579. printf ("epcs: verify error at offset %06lx\n", err);
  580. return;
  581. }
  582. /*-----------------------------------------------------------------------*/
  583. int do_epcs (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  584. {
  585. int len;
  586. struct epcs_devinfo_t *dev = epcs_dev_find ();
  587. if (!dev) {
  588. printf ("epcs: device not found.\n");
  589. return (-1);
  590. }
  591. if (argc < 2) {
  592. do_epcs_info (dev, argc, argv);
  593. return (0);
  594. }
  595. len = strlen (argv[1]);
  596. if (strncmp ("info", argv[1], len) == 0) {
  597. do_epcs_info (dev, argc, argv);
  598. } else if (strncmp ("erase", argv[1], len) == 0) {
  599. do_epcs_erase (dev, argc, argv);
  600. } else if (strncmp ("protect", argv[1], len) == 0) {
  601. do_epcs_protect (dev, argc, argv);
  602. } else if (strncmp ("read", argv[1], len) == 0) {
  603. do_epcs_read (dev, argc, argv);
  604. } else if (strncmp ("write", argv[1], len) == 0) {
  605. do_epcs_write (dev, argc, argv);
  606. } else if (strncmp ("verify", argv[1], len) == 0) {
  607. do_epcs_verify (dev, argc, argv);
  608. } else {
  609. printf ("epcs: unknown operation: %s\n", argv[1]);
  610. }
  611. return (0);
  612. }
  613. /*-----------------------------------------------------------------------*/
  614. U_BOOT_CMD( epcs, 5, 0, do_epcs, SHORT_HELP, LONG_HELP );
  615. #endif /* CONFIG_NIOS_EPCS */