aon_spi.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _AON_SPI_H_
  13. #define _AON_SPI_H_
  14. // Auto generated by dtools(see dtools.txt for its version).
  15. // Don't edit it manually!
  16. #define REG_AON_SPI_BASE (0x5150c000)
  17. typedef volatile struct
  18. {
  19. uint32_t spi_txd; // 0x00000000
  20. uint32_t spi_clkd; // 0x00000004
  21. uint32_t spi_ctl0; // 0x00000008
  22. uint32_t spi_ctl1; // 0x0000000c
  23. uint32_t spi_ctl2; // 0x00000010
  24. uint32_t spi_ctl3; // 0x00000014
  25. uint32_t spi_ctl4; // 0x00000018
  26. uint32_t spi_ctl5; // 0x0000001c
  27. uint32_t spi_int_en; // 0x00000020
  28. uint32_t spi_int_clr; // 0x00000024
  29. uint32_t spi_int_raw_sts; // 0x00000028
  30. uint32_t spi_int_mask_sts; // 0x0000002c
  31. uint32_t spi_sts1; // 0x00000030
  32. uint32_t spi_sts2; // 0x00000034
  33. uint32_t spi_dspwait; // 0x00000038
  34. uint32_t spi_sts3; // 0x0000003c
  35. uint32_t spi_ctl6; // 0x00000040
  36. uint32_t spi_sts4; // 0x00000044
  37. uint32_t spi_fifo_rst; // 0x00000048
  38. uint32_t spi_ctl7; // 0x0000004c
  39. uint32_t spi_sts5; // 0x00000050
  40. uint32_t spi_ctl8; // 0x00000054
  41. uint32_t spi_ctl9; // 0x00000058
  42. uint32_t spi_ctl10; // 0x0000005c
  43. uint32_t spi_ctl11; // 0x00000060
  44. uint32_t spi_ctl12; // 0x00000064
  45. uint32_t spi_sts6; // 0x00000068
  46. uint32_t spi_sts7; // 0x0000006c
  47. uint32_t spi_sts8; // 0x00000070
  48. uint32_t spi_sts9; // 0x00000074
  49. uint32_t spi_version; // 0x00000078
  50. } HWP_AON_SPI_T;
  51. #define hwp_aonSpi ((HWP_AON_SPI_T *)REG_ACCESS_ADDRESS(REG_AON_SPI_BASE))
  52. // spi_clkd
  53. typedef union {
  54. uint32_t v;
  55. struct
  56. {
  57. uint32_t spi_clkd : 16; // [15:0]
  58. uint32_t __31_16 : 16; // [31:16]
  59. } b;
  60. } REG_AON_SPI_SPI_CLKD_T;
  61. // spi_ctl0
  62. typedef union {
  63. uint32_t v;
  64. struct
  65. {
  66. uint32_t ng_rx : 1; // [0]
  67. uint32_t ng_tx : 1; // [1]
  68. uint32_t chnl_len : 5; // [6:2]
  69. uint32_t lsb : 1; // [7]
  70. uint32_t spi_csn_pre : 4; // [11:8]
  71. uint32_t __12_12 : 1; // [12]
  72. uint32_t is_sck_rev : 1; // [13]
  73. uint32_t sync_md : 1; // [14]
  74. uint32_t sync_3wrd_pol : 1; // [15]
  75. uint32_t __31_16 : 16; // [31:16]
  76. } b;
  77. } REG_AON_SPI_SPI_CTL0_T;
  78. // spi_ctl1
  79. typedef union {
  80. uint32_t v;
  81. struct
  82. {
  83. uint32_t s3w_pos : 5; // [4:0]
  84. uint32_t s3w_md : 1; // [5]
  85. uint32_t cs_h_md : 1; // [6]
  86. uint32_t s8_md : 1; // [7]
  87. uint32_t sync_csn_sel : 4; // [11:8]
  88. uint32_t is_rxmd : 1; // [12]
  89. uint32_t is_txmd : 1; // [13]
  90. uint32_t do_hold_en : 2; // [15:14]
  91. uint32_t __31_16 : 16; // [31:16]
  92. } b;
  93. } REG_AON_SPI_SPI_CTL1_T;
  94. // spi_ctl2
  95. typedef union {
  96. uint32_t v;
  97. struct
  98. {
  99. uint32_t s3w_rd_strt : 5; // [4:0]
  100. uint32_t is_slvd : 1; // [5]
  101. uint32_t dma_en : 1; // [6]
  102. uint32_t rx_only_nhd : 1; // [7]
  103. uint32_t rx_dma_sel : 1; // [8]
  104. uint32_t tx_dma_sel : 1; // [9]
  105. uint32_t dma_req_seq_sel : 1; // [10]
  106. uint32_t __31_11 : 21; // [31:11]
  107. } b;
  108. } REG_AON_SPI_SPI_CTL2_T;
  109. // spi_ctl3
  110. typedef union {
  111. uint32_t v;
  112. struct
  113. {
  114. uint32_t rxf_full_thrhld : 5; // [4:0]
  115. uint32_t __7_5 : 3; // [7:5]
  116. uint32_t rxf_empty_thrhld : 5; // [12:8]
  117. uint32_t __31_13 : 19; // [31:13]
  118. } b;
  119. } REG_AON_SPI_SPI_CTL3_T;
  120. // spi_ctl4
  121. typedef union {
  122. uint32_t v;
  123. struct
  124. {
  125. uint32_t block_num : 9; // [8:0]
  126. uint32_t is_rx_only : 1; // [9]
  127. uint32_t sync_half : 1; // [10]
  128. uint32_t sync_clkmask_en : 1; // [11]
  129. uint32_t phs_dly : 2; // [13:12]
  130. uint32_t is_fst : 1; // [14]
  131. uint32_t rx_only_do : 1; // [15]
  132. uint32_t __31_16 : 16; // [31:16]
  133. } b;
  134. } REG_AON_SPI_SPI_CTL4_T;
  135. // spi_ctl5
  136. typedef union {
  137. uint32_t v;
  138. struct
  139. {
  140. uint32_t itvl_num_sam : 16; // [15:0]
  141. uint32_t __31_16 : 16; // [31:16]
  142. } b;
  143. } REG_AON_SPI_SPI_CTL5_T;
  144. // spi_int_en
  145. typedef union {
  146. uint32_t v;
  147. struct
  148. {
  149. uint32_t rxf_full_int_en : 1; // [0]
  150. uint32_t rxf_empty_int_en : 1; // [1]
  151. uint32_t txf_full_int_en : 1; // [2]
  152. uint32_t txf_empty_int_en : 1; // [3]
  153. uint32_t rxf_ovf_int_en : 1; // [4]
  154. uint32_t time_out_int_en : 1; // [5]
  155. uint32_t rxf_r_full_int_en : 1; // [6]
  156. uint32_t txf_w_empty_int_en : 1; // [7]
  157. uint32_t tx_end_int_en : 1; // [8]
  158. uint32_t rx_end_int_en : 1; // [9]
  159. uint32_t __31_10 : 22; // [31:10]
  160. } b;
  161. } REG_AON_SPI_SPI_INT_EN_T;
  162. // spi_int_clr
  163. typedef union {
  164. uint32_t v;
  165. struct
  166. {
  167. uint32_t rxf_full_int_clr : 1; // [0]
  168. uint32_t rxf_empty_int_clr : 1; // [1]
  169. uint32_t txf_full_int_clr : 1; // [2]
  170. uint32_t txf_empty_int_clr : 1; // [3]
  171. uint32_t rx_ovf_int_clr : 1; // [4]
  172. uint32_t time_out_int_clr : 1; // [5]
  173. uint32_t __7_6 : 2; // [7:6]
  174. uint32_t tx_end_int_clr : 1; // [8]
  175. uint32_t rx_end_int_clr : 1; // [9]
  176. uint32_t __31_10 : 22; // [31:10]
  177. } b;
  178. } REG_AON_SPI_SPI_INT_CLR_T;
  179. // spi_int_raw_sts
  180. typedef union {
  181. uint32_t v;
  182. struct
  183. {
  184. uint32_t rxf_full_raw_sts : 1; // [0], read only
  185. uint32_t rxf_empty_raw_sts : 1; // [1], read only
  186. uint32_t txf_full_raw_sts : 1; // [2], read only
  187. uint32_t tx_fifo_empty_w : 1; // [3], read only
  188. uint32_t rx_ovf_raw_sts : 1; // [4], read only
  189. uint32_t time_out_raw_sts : 1; // [5], read only
  190. uint32_t rxf_full_r : 1; // [6], read only
  191. uint32_t txf_empty_w : 1; // [7], read only
  192. uint32_t tx_end_irq : 1; // [8], read only
  193. uint32_t rx_end_irq : 1; // [9], read only
  194. uint32_t __31_10 : 22; // [31:10]
  195. } b;
  196. } REG_AON_SPI_SPI_INT_RAW_STS_T;
  197. // spi_int_mask_sts
  198. typedef union {
  199. uint32_t v;
  200. struct
  201. {
  202. uint32_t __0_0 : 1; // [0]
  203. uint32_t rxf_empty_mask_sts : 1; // [1], read only
  204. uint32_t txf_full_mask_sts : 1; // [2], read only
  205. uint32_t __3_3 : 1; // [3]
  206. uint32_t rx_ovf_mask_sts : 1; // [4], read only
  207. uint32_t time_out_mask_sts : 1; // [5], read only
  208. uint32_t rxf_full_mask_sts : 1; // [6], read only
  209. uint32_t txf_empty_mask_sts : 1; // [7], read only
  210. uint32_t tx_end_irq_mask_sts : 1; // [8], read only
  211. uint32_t rx_end_irq_mask_sts : 1; // [9], read only
  212. uint32_t __31_10 : 22; // [31:10]
  213. } b;
  214. } REG_AON_SPI_SPI_INT_MASK_STS_T;
  215. // spi_sts1
  216. typedef union {
  217. uint32_t v;
  218. struct
  219. {
  220. uint32_t rxf_raddr : 5; // [4:0], read only
  221. uint32_t __7_5 : 3; // [7:5]
  222. uint32_t rxf_waddr : 5; // [12:8], read only
  223. uint32_t __31_13 : 19; // [31:13]
  224. } b;
  225. } REG_AON_SPI_SPI_STS1_T;
  226. // spi_sts2
  227. typedef union {
  228. uint32_t v;
  229. struct
  230. {
  231. uint32_t rxf_full : 1; // [0], read only
  232. uint32_t rxf_empty : 1; // [1], read only
  233. uint32_t txf_full : 1; // [2], read only
  234. uint32_t txf_empty : 1; // [3], read only
  235. uint32_t rxf_real_full : 1; // [4], read only
  236. uint32_t rxf_real_empty : 1; // [5], read only
  237. uint32_t txf_real_full : 1; // [6], read only
  238. uint32_t txf_real_empty : 1; // [7], read only
  239. uint32_t busy : 1; // [8], read only
  240. uint32_t spi_rxd : 1; // [9], read only
  241. uint32_t spi_txd : 1; // [10], read only
  242. uint32_t spi_sck : 1; // [11], read only
  243. uint32_t spi_cs : 1; // [12], read only
  244. uint32_t __31_13 : 19; // [31:13]
  245. } b;
  246. } REG_AON_SPI_SPI_STS2_T;
  247. // spi_dspwait
  248. typedef union {
  249. uint32_t v;
  250. struct
  251. {
  252. uint32_t spi_dspwait : 4; // [3:0]
  253. uint32_t rx_data_swt : 2; // [5:4]
  254. uint32_t tx_data_swt : 2; // [7:6]
  255. uint32_t __31_8 : 24; // [31:8]
  256. } b;
  257. } REG_AON_SPI_SPI_DSPWAIT_T;
  258. // spi_sts3
  259. typedef union {
  260. uint32_t v;
  261. struct
  262. {
  263. uint32_t rx_cnt : 9; // [8:0], read only
  264. uint32_t __31_9 : 23; // [31:9]
  265. } b;
  266. } REG_AON_SPI_SPI_STS3_T;
  267. // spi_ctl6
  268. typedef union {
  269. uint32_t v;
  270. struct
  271. {
  272. uint32_t txf_full_thrhld : 5; // [4:0]
  273. uint32_t __7_5 : 3; // [7:5]
  274. uint32_t txf_empty_thrhld : 5; // [12:8]
  275. uint32_t __31_13 : 19; // [31:13]
  276. } b;
  277. } REG_AON_SPI_SPI_CTL6_T;
  278. // spi_sts4
  279. typedef union {
  280. uint32_t v;
  281. struct
  282. {
  283. uint32_t txf_raddr : 5; // [4:0], read only
  284. uint32_t __7_5 : 3; // [7:5]
  285. uint32_t txf_waddr : 5; // [12:8], read only
  286. uint32_t __31_13 : 19; // [31:13]
  287. } b;
  288. } REG_AON_SPI_SPI_STS4_T;
  289. // spi_fifo_rst
  290. typedef union {
  291. uint32_t v;
  292. struct
  293. {
  294. uint32_t spi_fifo_rst : 1; // [0]
  295. uint32_t __31_1 : 31; // [31:1]
  296. } b;
  297. } REG_AON_SPI_SPI_FIFO_RST_T;
  298. // spi_ctl7
  299. typedef union {
  300. uint32_t v;
  301. struct
  302. {
  303. uint32_t csn_ie_ctl : 1; // [0]
  304. uint32_t csn_i_sel : 2; // [2:1]
  305. uint32_t spi_mode : 3; // [5:3]
  306. uint32_t tx_cmd_set : 1; // [6]
  307. uint32_t spi_tx_hld_en : 1; // [7]
  308. uint32_t spi_rx_hld_en : 1; // [8]
  309. uint32_t data_in_mode : 1; // [9]
  310. uint32_t spi_slv_en : 1; // [10]
  311. uint32_t spi_slv_sel : 1; // [11]
  312. uint32_t rgb888_en : 1; // [12]
  313. uint32_t rgb666_en : 1; // [13]
  314. uint32_t rgb565_en : 1; // [14]
  315. uint32_t data_line2_en : 1; // [15]
  316. uint32_t __31_16 : 16; // [31:16]
  317. } b;
  318. } REG_AON_SPI_SPI_CTL7_T;
  319. // spi_sts5
  320. typedef union {
  321. uint32_t v;
  322. struct
  323. {
  324. uint32_t csn_in_sync2 : 1; // [0], read only
  325. uint32_t __3_1 : 3; // [3:1]
  326. uint32_t csn_in_err_sync2 : 1; // [4], read only
  327. uint32_t __31_5 : 27; // [31:5]
  328. } b;
  329. } REG_AON_SPI_SPI_STS5_T;
  330. // spi_ctl8
  331. typedef union {
  332. uint32_t v;
  333. struct
  334. {
  335. uint32_t spi_tx_data_len_h : 4; // [3:0]
  336. uint32_t spi_tx_dumy_len : 6; // [9:4]
  337. uint32_t __10_10 : 1; // [10]
  338. uint32_t data_line2_sw : 1; // [11]
  339. uint32_t rgb_pix_mode : 1; // [12]
  340. uint32_t cd_data2_sel : 1; // [13]
  341. uint32_t spi_cd_bit2 : 1; // [14]
  342. uint32_t spi_cd_bit : 1; // [15]
  343. uint32_t __31_16 : 16; // [31:16]
  344. } b;
  345. } REG_AON_SPI_SPI_CTL8_T;
  346. // spi_ctl9
  347. typedef union {
  348. uint32_t v;
  349. struct
  350. {
  351. uint32_t spi_tx_data_len_l : 16; // [15:0]
  352. uint32_t __31_16 : 16; // [31:16]
  353. } b;
  354. } REG_AON_SPI_SPI_CTL9_T;
  355. // spi_ctl10
  356. typedef union {
  357. uint32_t v;
  358. struct
  359. {
  360. uint32_t spi_rx_data_len_h : 4; // [3:0]
  361. uint32_t spi_rx_dumy_len : 6; // [9:4]
  362. uint32_t __31_10 : 22; // [31:10]
  363. } b;
  364. } REG_AON_SPI_SPI_CTL10_T;
  365. // spi_ctl11
  366. typedef union {
  367. uint32_t v;
  368. struct
  369. {
  370. uint32_t spi_rx_data_len_l : 16; // [15:0]
  371. uint32_t __31_16 : 16; // [31:16]
  372. } b;
  373. } REG_AON_SPI_SPI_CTL11_T;
  374. // spi_ctl12
  375. typedef union {
  376. uint32_t v;
  377. struct
  378. {
  379. uint32_t sw_rx_req : 1; // [0]
  380. uint32_t sw_tx_req : 1; // [1]
  381. uint32_t __31_2 : 30; // [31:2]
  382. } b;
  383. } REG_AON_SPI_SPI_CTL12_T;
  384. // spi_sts6
  385. typedef union {
  386. uint32_t v;
  387. struct
  388. {
  389. uint32_t tx_data_cnt : 16; // [15:0], read only
  390. uint32_t __31_16 : 16; // [31:16]
  391. } b;
  392. } REG_AON_SPI_SPI_STS6_T;
  393. // spi_sts7
  394. typedef union {
  395. uint32_t v;
  396. struct
  397. {
  398. uint32_t tx_data_cnt : 4; // [3:0], read only
  399. uint32_t __9_4 : 6; // [9:4]
  400. uint32_t tx_dummy_cnt : 6; // [15:10], read only
  401. uint32_t __31_16 : 16; // [31:16]
  402. } b;
  403. } REG_AON_SPI_SPI_STS7_T;
  404. // spi_sts8
  405. typedef union {
  406. uint32_t v;
  407. struct
  408. {
  409. uint32_t rx_data_cnt : 16; // [15:0], read only
  410. uint32_t __31_16 : 16; // [31:16]
  411. } b;
  412. } REG_AON_SPI_SPI_STS8_T;
  413. // spi_sts9
  414. typedef union {
  415. uint32_t v;
  416. struct
  417. {
  418. uint32_t rx_data_cnt : 4; // [3:0], read only
  419. uint32_t __9_4 : 6; // [9:4]
  420. uint32_t rx_dummy_cnt : 6; // [15:10], read only
  421. uint32_t __31_16 : 16; // [31:16]
  422. } b;
  423. } REG_AON_SPI_SPI_STS9_T;
  424. // spi_version
  425. typedef union {
  426. uint32_t v;
  427. struct
  428. {
  429. uint32_t spi_version : 16; // [15:0]
  430. uint32_t __31_16 : 16; // [31:16]
  431. } b;
  432. } REG_AON_SPI_SPI_VERSION_T;
  433. // spi_clkd
  434. #define AON_SPI_SPI_CLKD(n) (((n)&0xffff) << 0)
  435. // spi_ctl0
  436. #define AON_SPI_NG_RX (1 << 0)
  437. #define AON_SPI_NG_TX (1 << 1)
  438. #define AON_SPI_CHNL_LEN(n) (((n)&0x1f) << 2)
  439. #define AON_SPI_LSB (1 << 7)
  440. #define AON_SPI_SPI_CSN_PRE(n) (((n)&0xf) << 8)
  441. #define AON_SPI_IS_SCK_REV (1 << 13)
  442. #define AON_SPI_SYNC_MD (1 << 14)
  443. #define AON_SPI_SYNC_3WRD_POL (1 << 15)
  444. // spi_ctl1
  445. #define AON_SPI_S3W_POS(n) (((n)&0x1f) << 0)
  446. #define AON_SPI_S3W_MD (1 << 5)
  447. #define AON_SPI_CS_H_MD (1 << 6)
  448. #define AON_SPI_S8_MD (1 << 7)
  449. #define AON_SPI_SYNC_CSN_SEL(n) (((n)&0xf) << 8)
  450. #define AON_SPI_IS_RXMD (1 << 12)
  451. #define AON_SPI_IS_TXMD (1 << 13)
  452. #define AON_SPI_DO_HOLD_EN(n) (((n)&0x3) << 14)
  453. // spi_ctl2
  454. #define AON_SPI_S3W_RD_STRT(n) (((n)&0x1f) << 0)
  455. #define AON_SPI_IS_SLVD (1 << 5)
  456. #define AON_SPI_DMA_EN (1 << 6)
  457. #define AON_SPI_RX_ONLY_NHD (1 << 7)
  458. #define AON_SPI_RX_DMA_SEL (1 << 8)
  459. #define AON_SPI_TX_DMA_SEL (1 << 9)
  460. #define AON_SPI_DMA_REQ_SEQ_SEL (1 << 10)
  461. // spi_ctl3
  462. #define AON_SPI_RXF_FULL_THRHLD(n) (((n)&0x1f) << 0)
  463. #define AON_SPI_RXF_EMPTY_THRHLD(n) (((n)&0x1f) << 8)
  464. // spi_ctl4
  465. #define AON_SPI_BLOCK_NUM(n) (((n)&0x1ff) << 0)
  466. #define AON_SPI_IS_RX_ONLY (1 << 9)
  467. #define AON_SPI_SYNC_HALF (1 << 10)
  468. #define AON_SPI_SYNC_CLKMASK_EN (1 << 11)
  469. #define AON_SPI_PHS_DLY(n) (((n)&0x3) << 12)
  470. #define AON_SPI_IS_FST (1 << 14)
  471. #define AON_SPI_RX_ONLY_DO (1 << 15)
  472. // spi_ctl5
  473. #define AON_SPI_ITVL_NUM_SAM(n) (((n)&0xffff) << 0)
  474. // spi_int_en
  475. #define AON_SPI_RXF_FULL_INT_EN (1 << 0)
  476. #define AON_SPI_RXF_EMPTY_INT_EN (1 << 1)
  477. #define AON_SPI_TXF_FULL_INT_EN (1 << 2)
  478. #define AON_SPI_TXF_EMPTY_EN (1 << 3)
  479. #define AON_SPI_RX_OVF_INT_EN (1 << 4)
  480. #define AON_SPI_TIME_OUT_INT_EN (1 << 5)
  481. #define AON_SPI_RXF_R_FULL_INT_EN (1 << 6)
  482. #define AON_SPI_TXF_W_EMPTY_INT_EN (1 << 7)
  483. #define AON_SPI_TX_END_INT_EN (1 << 8)
  484. #define AON_SPI_RX_END_INT_EN (1 << 9)
  485. // spi_int_clr
  486. #define AON_SPI_RXF_FULL_INT_CLR (1 << 0)
  487. #define AON_SPI_RXF_EMPTY_INT_CLR (1 << 1)
  488. #define AON_SPI_TXF_FULL_INT_CLR (1 << 2)
  489. #define AON_SPI_TXF_EMPTY_INT_CLR (1 << 3)
  490. #define AON_SPI_RX_OVF_INT_CLR (1 << 4)
  491. #define AON_SPI_TIME_OUT_INT_CLR (1 << 5)
  492. #define AON_SPI_TX_END_INT_CLR (1 << 8)
  493. #define AON_SPI_RX_END_INT_CLR (1 << 9)
  494. // spi_int_raw_sts
  495. #define AON_SPI_RX_FULL_RAW_STS (1 << 0)
  496. #define AON_SPI_RXF_EMPTY_RAW_STS (1 << 1)
  497. #define AON_SPI_TXF_FULL_RAW_STS (1 << 2)
  498. #define AON_SPI_TX_FIFO_EMPTY_W (1 << 3)
  499. #define AON_SPI_RX_OVF_RAW_STS (1 << 4)
  500. #define AON_SPI_TIME_OUT_RAW_STS (1 << 5)
  501. #define AON_SPI_RXF_FULL_R (1 << 6)
  502. #define AON_SPI_TXF_EMPTY_W (1 << 7)
  503. #define AON_SPI_TX_END_IRQ (1 << 8)
  504. #define AON_SPI_RX_END_IRQ (1 << 9)
  505. // spi_int_mask_sts
  506. #define AON_SPI_RXF_EMPTY_MASK_STS (1 << 1)
  507. #define AON_SPI_TXF_FULL_MASK_STS (1 << 2)
  508. #define AON_SPI_RX_OVF_MASK_STS (1 << 4)
  509. #define AON_SPI_TIME_OUT_MASK_STS (1 << 5)
  510. #define AON_SPI_RXF_FULL_MASK_STS (1 << 6)
  511. #define AON_SPI_TXF_EMPTY_MASK_STS (1 << 7)
  512. #define AON_SPI_TX_END_IRQ_MASK_STS (1 << 8)
  513. #define AON_SPI_RX_END_IRQ_MASK_STS (1 << 9)
  514. // spi_sts1
  515. #define AON_SPI_RXF_RADDR(n) (((n)&0x1f) << 0)
  516. #define AON_SPI_RXF_WADDR(n) (((n)&0x1f) << 8)
  517. // spi_sts2
  518. #define AON_SPI_RXF_FULL (1 << 0)
  519. #define AON_SPI_RXF_EMPTY (1 << 1)
  520. #define AON_SPI_TXF_FULL (1 << 2)
  521. #define AON_SPI_TXF_EMPTY (1 << 3)
  522. #define AON_SPI_RXF_REAL_FULL (1 << 4)
  523. #define AON_SPI_RXF_REAL_EMPTY (1 << 5)
  524. #define AON_SPI_TXF_REAL_FULL (1 << 6)
  525. #define AON_SPI_TXF_REAL_EMPTY (1 << 7)
  526. #define AON_SPI_BUSY (1 << 8)
  527. #define AON_SPI_SPI_RXD (1 << 9)
  528. #define AON_SPI_SPI_TXD (1 << 10)
  529. #define AON_SPI_SPI_SCK (1 << 11)
  530. #define AON_SPI_SPI_CS (1 << 12)
  531. // spi_dspwait
  532. #define AON_SPI_SPI_DSPWAIT(n) (((n)&0xf) << 0)
  533. #define AON_SPI_RX_DATA_SWT(n) (((n)&0x3) << 4)
  534. #define AON_SPI_TX_DATA_SWT(n) (((n)&0x3) << 6)
  535. // spi_sts3
  536. #define AON_SPI_RX_CNT(n) (((n)&0x1ff) << 0)
  537. // spi_ctl6
  538. #define AON_SPI_TXF_FULL_THRHLD(n) (((n)&0x1f) << 0)
  539. #define AON_SPI_TXF_EMPTY_THRHLD(n) (((n)&0x1f) << 8)
  540. // spi_sts4
  541. #define AON_SPI_TXF_RADDR(n) (((n)&0x1f) << 0)
  542. #define AON_SPI_TXF_WADDR(n) (((n)&0x1f) << 8)
  543. // spi_fifo_rst
  544. #define AON_SPI_SPI_FIFO_RST (1 << 0)
  545. // spi_ctl7
  546. #define AON_SPI_CSN_IE_CTL (1 << 0)
  547. #define AON_SPI_CSN_I_SEL(n) (((n)&0x3) << 1)
  548. #define AON_SPI_SPI_MODE(n) (((n)&0x7) << 3)
  549. #define AON_SPI_TX_CMD_SET (1 << 6)
  550. #define AON_SPI_SPI_TX_HLD_EN (1 << 7)
  551. #define AON_SPI_SPI_RX_HLD_EN (1 << 8)
  552. #define AON_SPI_DATA_IN_MODE (1 << 9)
  553. #define AON_SPI_SPI_SLV_EN (1 << 10)
  554. #define AON_SPI_SPI_SLV_SEL (1 << 11)
  555. #define AON_SPI_RGB888_EN (1 << 12)
  556. #define AON_SPI_RGB666_EN (1 << 13)
  557. #define AON_SPI_RGB565_EN (1 << 14)
  558. #define AON_SPI_DATA_LINE2_EN (1 << 15)
  559. // spi_sts5
  560. #define AON_SPI_CSN_IN_SYNC2 (1 << 0)
  561. #define AON_SPI_CSN_IN_ERR_SYNC2 (1 << 4)
  562. // spi_ctl8
  563. #define AON_SPI_SPI_TX_DATA_LEN_H(n) (((n)&0xf) << 0)
  564. #define AON_SPI_SPI_TX_DUMY_LEN(n) (((n)&0x3f) << 4)
  565. #define AON_SPI_DATA_LINE2_SW (1 << 11)
  566. #define AON_SPI_RGB_PIX_MODE (1 << 12)
  567. #define AON_SPI_CD_DATA2_SEL (1 << 13)
  568. #define AON_SPI_SPI_CD_BIT2 (1 << 14)
  569. #define AON_SPI_SPI_CD_BIT (1 << 15)
  570. // spi_ctl9
  571. #define AON_SPI_SPI_TX_DATA_LEN_L(n) (((n)&0xffff) << 0)
  572. // spi_ctl10
  573. #define AON_SPI_SPI_RX_DATA_LEN_H(n) (((n)&0xf) << 0)
  574. #define AON_SPI_SPI_RX_DUMY_LEN(n) (((n)&0x3f) << 4)
  575. // spi_ctl11
  576. #define AON_SPI_SPI_RX_DATA_LEN_L(n) (((n)&0xffff) << 0)
  577. // spi_ctl12
  578. #define AON_SPI_SW_RX_REQ (1 << 0)
  579. #define AON_SPI_SW_TX_REQ (1 << 1)
  580. // spi_sts6
  581. #define AON_SPI_SPI_STS6_TX_DATA_CNT(n) (((n)&0xffff) << 0)
  582. // spi_sts7
  583. #define AON_SPI_SPI_STS7_TX_DATA_CNT(n) (((n)&0xf) << 0)
  584. #define AON_SPI_TX_DUMMY_CNT(n) (((n)&0x3f) << 10)
  585. // spi_sts8
  586. #define AON_SPI_SPI_STS8_RX_DATA_CNT(n) (((n)&0xffff) << 0)
  587. // spi_sts9
  588. #define AON_SPI_SPI_STS9_RX_DATA_CNT(n) (((n)&0xf) << 0)
  589. #define AON_SPI_RX_DUMMY_CNT(n) (((n)&0x3f) << 10)
  590. // spi_version
  591. #define AON_SPI_SPI_VERSION(n) (((n)&0xffff) << 0)
  592. #endif // _AON_SPI_H_