cvmx-fau.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  1. /***********************license start***************
  2. * Author: Cavium Networks
  3. *
  4. * Contact: support@caviumnetworks.com
  5. * This file is part of the OCTEON SDK
  6. *
  7. * Copyright (c) 2003-2008 Cavium Networks
  8. *
  9. * This file is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License, Version 2, as
  11. * published by the Free Software Foundation.
  12. *
  13. * This file is distributed in the hope that it will be useful, but
  14. * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
  15. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
  16. * NONINFRINGEMENT. See the GNU General Public License for more
  17. * details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this file; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  22. * or visit http://www.gnu.org/licenses/.
  23. *
  24. * This file may also be available under a different license from Cavium.
  25. * Contact Cavium Networks for more information
  26. ***********************license end**************************************/
  27. /*
  28. * Interface to the hardware Fetch and Add Unit.
  29. */
  30. #ifndef __CVMX_FAU_H__
  31. #define __CVMX_FAU_H__
  32. /*
  33. * Octeon Fetch and Add Unit (FAU)
  34. */
  35. #define CVMX_FAU_LOAD_IO_ADDRESS cvmx_build_io_address(0x1e, 0)
  36. #define CVMX_FAU_BITS_SCRADDR 63, 56
  37. #define CVMX_FAU_BITS_LEN 55, 48
  38. #define CVMX_FAU_BITS_INEVAL 35, 14
  39. #define CVMX_FAU_BITS_TAGWAIT 13, 13
  40. #define CVMX_FAU_BITS_NOADD 13, 13
  41. #define CVMX_FAU_BITS_SIZE 12, 11
  42. #define CVMX_FAU_BITS_REGISTER 10, 0
  43. typedef enum {
  44. CVMX_FAU_OP_SIZE_8 = 0,
  45. CVMX_FAU_OP_SIZE_16 = 1,
  46. CVMX_FAU_OP_SIZE_32 = 2,
  47. CVMX_FAU_OP_SIZE_64 = 3
  48. } cvmx_fau_op_size_t;
  49. /**
  50. * Tagwait return definition. If a timeout occurs, the error
  51. * bit will be set. Otherwise the value of the register before
  52. * the update will be returned.
  53. */
  54. typedef struct {
  55. uint64_t error:1;
  56. int64_t value:63;
  57. } cvmx_fau_tagwait64_t;
  58. /**
  59. * Tagwait return definition. If a timeout occurs, the error
  60. * bit will be set. Otherwise the value of the register before
  61. * the update will be returned.
  62. */
  63. typedef struct {
  64. uint64_t error:1;
  65. int32_t value:31;
  66. } cvmx_fau_tagwait32_t;
  67. /**
  68. * Tagwait return definition. If a timeout occurs, the error
  69. * bit will be set. Otherwise the value of the register before
  70. * the update will be returned.
  71. */
  72. typedef struct {
  73. uint64_t error:1;
  74. int16_t value:15;
  75. } cvmx_fau_tagwait16_t;
  76. /**
  77. * Tagwait return definition. If a timeout occurs, the error
  78. * bit will be set. Otherwise the value of the register before
  79. * the update will be returned.
  80. */
  81. typedef struct {
  82. uint64_t error:1;
  83. int8_t value:7;
  84. } cvmx_fau_tagwait8_t;
  85. /**
  86. * Asynchronous tagwait return definition. If a timeout occurs,
  87. * the error bit will be set. Otherwise the value of the
  88. * register before the update will be returned.
  89. */
  90. typedef union {
  91. uint64_t u64;
  92. struct {
  93. uint64_t invalid:1;
  94. uint64_t data:63; /* unpredictable if invalid is set */
  95. } s;
  96. } cvmx_fau_async_tagwait_result_t;
  97. /**
  98. * Builds a store I/O address for writing to the FAU
  99. *
  100. * @noadd: 0 = Store value is atomically added to the current value
  101. * 1 = Store value is atomically written over the current value
  102. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  103. * - Step by 2 for 16 bit access.
  104. * - Step by 4 for 32 bit access.
  105. * - Step by 8 for 64 bit access.
  106. * Returns Address to store for atomic update
  107. */
  108. static inline uint64_t __cvmx_fau_store_address(uint64_t noadd, uint64_t reg)
  109. {
  110. return CVMX_ADD_IO_SEG(CVMX_FAU_LOAD_IO_ADDRESS) |
  111. cvmx_build_bits(CVMX_FAU_BITS_NOADD, noadd) |
  112. cvmx_build_bits(CVMX_FAU_BITS_REGISTER, reg);
  113. }
  114. /**
  115. * Builds a I/O address for accessing the FAU
  116. *
  117. * @tagwait: Should the atomic add wait for the current tag switch
  118. * operation to complete.
  119. * - 0 = Don't wait
  120. * - 1 = Wait for tag switch to complete
  121. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  122. * - Step by 2 for 16 bit access.
  123. * - Step by 4 for 32 bit access.
  124. * - Step by 8 for 64 bit access.
  125. * @value: Signed value to add.
  126. * Note: When performing 32 and 64 bit access, only the low
  127. * 22 bits are available.
  128. * Returns Address to read from for atomic update
  129. */
  130. static inline uint64_t __cvmx_fau_atomic_address(uint64_t tagwait, uint64_t reg,
  131. int64_t value)
  132. {
  133. return CVMX_ADD_IO_SEG(CVMX_FAU_LOAD_IO_ADDRESS) |
  134. cvmx_build_bits(CVMX_FAU_BITS_INEVAL, value) |
  135. cvmx_build_bits(CVMX_FAU_BITS_TAGWAIT, tagwait) |
  136. cvmx_build_bits(CVMX_FAU_BITS_REGISTER, reg);
  137. }
  138. /**
  139. * Perform an atomic 64 bit add
  140. *
  141. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  142. * - Step by 8 for 64 bit access.
  143. * @value: Signed value to add.
  144. * Note: Only the low 22 bits are available.
  145. * Returns Value of the register before the update
  146. */
  147. static inline int64_t cvmx_fau_fetch_and_add64(cvmx_fau_reg_64_t reg,
  148. int64_t value)
  149. {
  150. return cvmx_read64_int64(__cvmx_fau_atomic_address(0, reg, value));
  151. }
  152. /**
  153. * Perform an atomic 32 bit add
  154. *
  155. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  156. * - Step by 4 for 32 bit access.
  157. * @value: Signed value to add.
  158. * Note: Only the low 22 bits are available.
  159. * Returns Value of the register before the update
  160. */
  161. static inline int32_t cvmx_fau_fetch_and_add32(cvmx_fau_reg_32_t reg,
  162. int32_t value)
  163. {
  164. return cvmx_read64_int32(__cvmx_fau_atomic_address(0, reg, value));
  165. }
  166. /**
  167. * Perform an atomic 16 bit add
  168. *
  169. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  170. * - Step by 2 for 16 bit access.
  171. * @value: Signed value to add.
  172. * Returns Value of the register before the update
  173. */
  174. static inline int16_t cvmx_fau_fetch_and_add16(cvmx_fau_reg_16_t reg,
  175. int16_t value)
  176. {
  177. return cvmx_read64_int16(__cvmx_fau_atomic_address(0, reg, value));
  178. }
  179. /**
  180. * Perform an atomic 8 bit add
  181. *
  182. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  183. * @value: Signed value to add.
  184. * Returns Value of the register before the update
  185. */
  186. static inline int8_t cvmx_fau_fetch_and_add8(cvmx_fau_reg_8_t reg, int8_t value)
  187. {
  188. return cvmx_read64_int8(__cvmx_fau_atomic_address(0, reg, value));
  189. }
  190. /**
  191. * Perform an atomic 64 bit add after the current tag switch
  192. * completes
  193. *
  194. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  195. * - Step by 8 for 64 bit access.
  196. * @value: Signed value to add.
  197. * Note: Only the low 22 bits are available.
  198. * Returns If a timeout occurs, the error bit will be set. Otherwise
  199. * the value of the register before the update will be
  200. * returned
  201. */
  202. static inline cvmx_fau_tagwait64_t
  203. cvmx_fau_tagwait_fetch_and_add64(cvmx_fau_reg_64_t reg, int64_t value)
  204. {
  205. union {
  206. uint64_t i64;
  207. cvmx_fau_tagwait64_t t;
  208. } result;
  209. result.i64 =
  210. cvmx_read64_int64(__cvmx_fau_atomic_address(1, reg, value));
  211. return result.t;
  212. }
  213. /**
  214. * Perform an atomic 32 bit add after the current tag switch
  215. * completes
  216. *
  217. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  218. * - Step by 4 for 32 bit access.
  219. * @value: Signed value to add.
  220. * Note: Only the low 22 bits are available.
  221. * Returns If a timeout occurs, the error bit will be set. Otherwise
  222. * the value of the register before the update will be
  223. * returned
  224. */
  225. static inline cvmx_fau_tagwait32_t
  226. cvmx_fau_tagwait_fetch_and_add32(cvmx_fau_reg_32_t reg, int32_t value)
  227. {
  228. union {
  229. uint64_t i32;
  230. cvmx_fau_tagwait32_t t;
  231. } result;
  232. result.i32 =
  233. cvmx_read64_int32(__cvmx_fau_atomic_address(1, reg, value));
  234. return result.t;
  235. }
  236. /**
  237. * Perform an atomic 16 bit add after the current tag switch
  238. * completes
  239. *
  240. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  241. * - Step by 2 for 16 bit access.
  242. * @value: Signed value to add.
  243. * Returns If a timeout occurs, the error bit will be set. Otherwise
  244. * the value of the register before the update will be
  245. * returned
  246. */
  247. static inline cvmx_fau_tagwait16_t
  248. cvmx_fau_tagwait_fetch_and_add16(cvmx_fau_reg_16_t reg, int16_t value)
  249. {
  250. union {
  251. uint64_t i16;
  252. cvmx_fau_tagwait16_t t;
  253. } result;
  254. result.i16 =
  255. cvmx_read64_int16(__cvmx_fau_atomic_address(1, reg, value));
  256. return result.t;
  257. }
  258. /**
  259. * Perform an atomic 8 bit add after the current tag switch
  260. * completes
  261. *
  262. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  263. * @value: Signed value to add.
  264. * Returns If a timeout occurs, the error bit will be set. Otherwise
  265. * the value of the register before the update will be
  266. * returned
  267. */
  268. static inline cvmx_fau_tagwait8_t
  269. cvmx_fau_tagwait_fetch_and_add8(cvmx_fau_reg_8_t reg, int8_t value)
  270. {
  271. union {
  272. uint64_t i8;
  273. cvmx_fau_tagwait8_t t;
  274. } result;
  275. result.i8 = cvmx_read64_int8(__cvmx_fau_atomic_address(1, reg, value));
  276. return result.t;
  277. }
  278. /**
  279. * Builds I/O data for async operations
  280. *
  281. * @scraddr: Scratch pad byte address to write to. Must be 8 byte aligned
  282. * @value: Signed value to add.
  283. * Note: When performing 32 and 64 bit access, only the low
  284. * 22 bits are available.
  285. * @tagwait: Should the atomic add wait for the current tag switch
  286. * operation to complete.
  287. * - 0 = Don't wait
  288. * - 1 = Wait for tag switch to complete
  289. * @size: The size of the operation:
  290. * - CVMX_FAU_OP_SIZE_8 (0) = 8 bits
  291. * - CVMX_FAU_OP_SIZE_16 (1) = 16 bits
  292. * - CVMX_FAU_OP_SIZE_32 (2) = 32 bits
  293. * - CVMX_FAU_OP_SIZE_64 (3) = 64 bits
  294. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  295. * - Step by 2 for 16 bit access.
  296. * - Step by 4 for 32 bit access.
  297. * - Step by 8 for 64 bit access.
  298. * Returns Data to write using cvmx_send_single
  299. */
  300. static inline uint64_t __cvmx_fau_iobdma_data(uint64_t scraddr, int64_t value,
  301. uint64_t tagwait,
  302. cvmx_fau_op_size_t size,
  303. uint64_t reg)
  304. {
  305. return CVMX_FAU_LOAD_IO_ADDRESS |
  306. cvmx_build_bits(CVMX_FAU_BITS_SCRADDR, scraddr >> 3) |
  307. cvmx_build_bits(CVMX_FAU_BITS_LEN, 1) |
  308. cvmx_build_bits(CVMX_FAU_BITS_INEVAL, value) |
  309. cvmx_build_bits(CVMX_FAU_BITS_TAGWAIT, tagwait) |
  310. cvmx_build_bits(CVMX_FAU_BITS_SIZE, size) |
  311. cvmx_build_bits(CVMX_FAU_BITS_REGISTER, reg);
  312. }
  313. /**
  314. * Perform an async atomic 64 bit add. The old value is
  315. * placed in the scratch memory at byte address scraddr.
  316. *
  317. * @scraddr: Scratch memory byte address to put response in.
  318. * Must be 8 byte aligned.
  319. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  320. * - Step by 8 for 64 bit access.
  321. * @value: Signed value to add.
  322. * Note: Only the low 22 bits are available.
  323. * Returns Placed in the scratch pad register
  324. */
  325. static inline void cvmx_fau_async_fetch_and_add64(uint64_t scraddr,
  326. cvmx_fau_reg_64_t reg,
  327. int64_t value)
  328. {
  329. cvmx_send_single(__cvmx_fau_iobdma_data
  330. (scraddr, value, 0, CVMX_FAU_OP_SIZE_64, reg));
  331. }
  332. /**
  333. * Perform an async atomic 32 bit add. The old value is
  334. * placed in the scratch memory at byte address scraddr.
  335. *
  336. * @scraddr: Scratch memory byte address to put response in.
  337. * Must be 8 byte aligned.
  338. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  339. * - Step by 4 for 32 bit access.
  340. * @value: Signed value to add.
  341. * Note: Only the low 22 bits are available.
  342. * Returns Placed in the scratch pad register
  343. */
  344. static inline void cvmx_fau_async_fetch_and_add32(uint64_t scraddr,
  345. cvmx_fau_reg_32_t reg,
  346. int32_t value)
  347. {
  348. cvmx_send_single(__cvmx_fau_iobdma_data
  349. (scraddr, value, 0, CVMX_FAU_OP_SIZE_32, reg));
  350. }
  351. /**
  352. * Perform an async atomic 16 bit add. The old value is
  353. * placed in the scratch memory at byte address scraddr.
  354. *
  355. * @scraddr: Scratch memory byte address to put response in.
  356. * Must be 8 byte aligned.
  357. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  358. * - Step by 2 for 16 bit access.
  359. * @value: Signed value to add.
  360. * Returns Placed in the scratch pad register
  361. */
  362. static inline void cvmx_fau_async_fetch_and_add16(uint64_t scraddr,
  363. cvmx_fau_reg_16_t reg,
  364. int16_t value)
  365. {
  366. cvmx_send_single(__cvmx_fau_iobdma_data
  367. (scraddr, value, 0, CVMX_FAU_OP_SIZE_16, reg));
  368. }
  369. /**
  370. * Perform an async atomic 8 bit add. The old value is
  371. * placed in the scratch memory at byte address scraddr.
  372. *
  373. * @scraddr: Scratch memory byte address to put response in.
  374. * Must be 8 byte aligned.
  375. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  376. * @value: Signed value to add.
  377. * Returns Placed in the scratch pad register
  378. */
  379. static inline void cvmx_fau_async_fetch_and_add8(uint64_t scraddr,
  380. cvmx_fau_reg_8_t reg,
  381. int8_t value)
  382. {
  383. cvmx_send_single(__cvmx_fau_iobdma_data
  384. (scraddr, value, 0, CVMX_FAU_OP_SIZE_8, reg));
  385. }
  386. /**
  387. * Perform an async atomic 64 bit add after the current tag
  388. * switch completes.
  389. *
  390. * @scraddr: Scratch memory byte address to put response in. Must be
  391. * 8 byte aligned. If a timeout occurs, the error bit (63)
  392. * will be set. Otherwise the value of the register before
  393. * the update will be returned
  394. *
  395. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  396. * - Step by 8 for 64 bit access.
  397. * @value: Signed value to add.
  398. * Note: Only the low 22 bits are available.
  399. * Returns Placed in the scratch pad register
  400. */
  401. static inline void cvmx_fau_async_tagwait_fetch_and_add64(uint64_t scraddr,
  402. cvmx_fau_reg_64_t reg,
  403. int64_t value)
  404. {
  405. cvmx_send_single(__cvmx_fau_iobdma_data
  406. (scraddr, value, 1, CVMX_FAU_OP_SIZE_64, reg));
  407. }
  408. /**
  409. * Perform an async atomic 32 bit add after the current tag
  410. * switch completes.
  411. *
  412. * @scraddr: Scratch memory byte address to put response in. Must be
  413. * 8 byte aligned. If a timeout occurs, the error bit (63)
  414. * will be set. Otherwise the value of the register before
  415. * the update will be returned
  416. *
  417. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  418. * - Step by 4 for 32 bit access.
  419. * @value: Signed value to add.
  420. * Note: Only the low 22 bits are available.
  421. * Returns Placed in the scratch pad register
  422. */
  423. static inline void cvmx_fau_async_tagwait_fetch_and_add32(uint64_t scraddr,
  424. cvmx_fau_reg_32_t reg,
  425. int32_t value)
  426. {
  427. cvmx_send_single(__cvmx_fau_iobdma_data
  428. (scraddr, value, 1, CVMX_FAU_OP_SIZE_32, reg));
  429. }
  430. /**
  431. * Perform an async atomic 16 bit add after the current tag
  432. * switch completes.
  433. *
  434. * @scraddr: Scratch memory byte address to put response in. Must be
  435. * 8 byte aligned. If a timeout occurs, the error bit (63)
  436. * will be set. Otherwise the value of the register before
  437. * the update will be returned
  438. *
  439. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  440. * - Step by 2 for 16 bit access.
  441. * @value: Signed value to add.
  442. *
  443. * Returns Placed in the scratch pad register
  444. */
  445. static inline void cvmx_fau_async_tagwait_fetch_and_add16(uint64_t scraddr,
  446. cvmx_fau_reg_16_t reg,
  447. int16_t value)
  448. {
  449. cvmx_send_single(__cvmx_fau_iobdma_data
  450. (scraddr, value, 1, CVMX_FAU_OP_SIZE_16, reg));
  451. }
  452. /**
  453. * Perform an async atomic 8 bit add after the current tag
  454. * switch completes.
  455. *
  456. * @scraddr: Scratch memory byte address to put response in. Must be
  457. * 8 byte aligned. If a timeout occurs, the error bit (63)
  458. * will be set. Otherwise the value of the register before
  459. * the update will be returned
  460. *
  461. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  462. * @value: Signed value to add.
  463. *
  464. * Returns Placed in the scratch pad register
  465. */
  466. static inline void cvmx_fau_async_tagwait_fetch_and_add8(uint64_t scraddr,
  467. cvmx_fau_reg_8_t reg,
  468. int8_t value)
  469. {
  470. cvmx_send_single(__cvmx_fau_iobdma_data
  471. (scraddr, value, 1, CVMX_FAU_OP_SIZE_8, reg));
  472. }
  473. /**
  474. * Perform an atomic 64 bit add
  475. *
  476. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  477. * - Step by 8 for 64 bit access.
  478. * @value: Signed value to add.
  479. */
  480. static inline void cvmx_fau_atomic_add64(cvmx_fau_reg_64_t reg, int64_t value)
  481. {
  482. cvmx_write64_int64(__cvmx_fau_store_address(0, reg), value);
  483. }
  484. /**
  485. * Perform an atomic 32 bit add
  486. *
  487. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  488. * - Step by 4 for 32 bit access.
  489. * @value: Signed value to add.
  490. */
  491. static inline void cvmx_fau_atomic_add32(cvmx_fau_reg_32_t reg, int32_t value)
  492. {
  493. cvmx_write64_int32(__cvmx_fau_store_address(0, reg), value);
  494. }
  495. /**
  496. * Perform an atomic 16 bit add
  497. *
  498. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  499. * - Step by 2 for 16 bit access.
  500. * @value: Signed value to add.
  501. */
  502. static inline void cvmx_fau_atomic_add16(cvmx_fau_reg_16_t reg, int16_t value)
  503. {
  504. cvmx_write64_int16(__cvmx_fau_store_address(0, reg), value);
  505. }
  506. /**
  507. * Perform an atomic 8 bit add
  508. *
  509. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  510. * @value: Signed value to add.
  511. */
  512. static inline void cvmx_fau_atomic_add8(cvmx_fau_reg_8_t reg, int8_t value)
  513. {
  514. cvmx_write64_int8(__cvmx_fau_store_address(0, reg), value);
  515. }
  516. /**
  517. * Perform an atomic 64 bit write
  518. *
  519. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  520. * - Step by 8 for 64 bit access.
  521. * @value: Signed value to write.
  522. */
  523. static inline void cvmx_fau_atomic_write64(cvmx_fau_reg_64_t reg, int64_t value)
  524. {
  525. cvmx_write64_int64(__cvmx_fau_store_address(1, reg), value);
  526. }
  527. /**
  528. * Perform an atomic 32 bit write
  529. *
  530. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  531. * - Step by 4 for 32 bit access.
  532. * @value: Signed value to write.
  533. */
  534. static inline void cvmx_fau_atomic_write32(cvmx_fau_reg_32_t reg, int32_t value)
  535. {
  536. cvmx_write64_int32(__cvmx_fau_store_address(1, reg), value);
  537. }
  538. /**
  539. * Perform an atomic 16 bit write
  540. *
  541. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  542. * - Step by 2 for 16 bit access.
  543. * @value: Signed value to write.
  544. */
  545. static inline void cvmx_fau_atomic_write16(cvmx_fau_reg_16_t reg, int16_t value)
  546. {
  547. cvmx_write64_int16(__cvmx_fau_store_address(1, reg), value);
  548. }
  549. /**
  550. * Perform an atomic 8 bit write
  551. *
  552. * @reg: FAU atomic register to access. 0 <= reg < 2048.
  553. * @value: Signed value to write.
  554. */
  555. static inline void cvmx_fau_atomic_write8(cvmx_fau_reg_8_t reg, int8_t value)
  556. {
  557. cvmx_write64_int8(__cvmx_fau_store_address(1, reg), value);
  558. }
  559. #endif /* __CVMX_FAU_H__ */