w100fb.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * linux/drivers/video/w100fb.h
  4. *
  5. * Frame Buffer Device for ATI w100 (Wallaby)
  6. *
  7. * Copyright (C) 2002, ATI Corp.
  8. * Copyright (C) 2004-2005 Richard Purdie
  9. * Copyright (c) 2005 Ian Molton <spyro@f2s.com>
  10. *
  11. * Modified to work with 2.6 by Richard Purdie <rpurdie@rpsys.net>
  12. *
  13. * w32xx support by Ian Molton
  14. */
  15. #if !defined (_W100FB_H)
  16. #define _W100FB_H
  17. /* Block CIF Start: */
  18. #define mmCHIP_ID 0x0000
  19. #define mmREVISION_ID 0x0004
  20. #define mmWRAP_BUF_A 0x0008
  21. #define mmWRAP_BUF_B 0x000C
  22. #define mmWRAP_TOP_DIR 0x0010
  23. #define mmWRAP_START_DIR 0x0014
  24. #define mmCIF_CNTL 0x0018
  25. #define mmCFGREG_BASE 0x001C
  26. #define mmCIF_IO 0x0020
  27. #define mmCIF_READ_DBG 0x0024
  28. #define mmCIF_WRITE_DBG 0x0028
  29. #define cfgIND_ADDR_A_0 0x0000
  30. #define cfgIND_ADDR_A_1 0x0001
  31. #define cfgIND_ADDR_A_2 0x0002
  32. #define cfgIND_DATA_A 0x0003
  33. #define cfgREG_BASE 0x0004
  34. #define cfgINTF_CNTL 0x0005
  35. #define cfgSTATUS 0x0006
  36. #define cfgCPU_DEFAULTS 0x0007
  37. #define cfgIND_ADDR_B_0 0x0008
  38. #define cfgIND_ADDR_B_1 0x0009
  39. #define cfgIND_ADDR_B_2 0x000A
  40. #define cfgIND_DATA_B 0x000B
  41. #define cfgPM4_RPTR 0x000C
  42. #define cfgSCRATCH 0x000D
  43. #define cfgPM4_WRPTR_0 0x000E
  44. #define cfgPM4_WRPTR_1 0x000F
  45. /* Block CIF End: */
  46. /* Block CP Start: */
  47. #define mmSCRATCH_UMSK 0x0280
  48. #define mmSCRATCH_ADDR 0x0284
  49. #define mmGEN_INT_CNTL 0x0200
  50. #define mmGEN_INT_STATUS 0x0204
  51. /* Block CP End: */
  52. /* Block DISPLAY Start: */
  53. #define mmLCD_FORMAT 0x0410
  54. #define mmGRAPHIC_CTRL 0x0414
  55. #define mmGRAPHIC_OFFSET 0x0418
  56. #define mmGRAPHIC_PITCH 0x041C
  57. #define mmCRTC_TOTAL 0x0420
  58. #define mmACTIVE_H_DISP 0x0424
  59. #define mmACTIVE_V_DISP 0x0428
  60. #define mmGRAPHIC_H_DISP 0x042C
  61. #define mmGRAPHIC_V_DISP 0x0430
  62. #define mmVIDEO_CTRL 0x0434
  63. #define mmGRAPHIC_KEY 0x0438
  64. #define mmBRIGHTNESS_CNTL 0x045C
  65. #define mmDISP_INT_CNTL 0x0488
  66. #define mmCRTC_SS 0x048C
  67. #define mmCRTC_LS 0x0490
  68. #define mmCRTC_REV 0x0494
  69. #define mmCRTC_DCLK 0x049C
  70. #define mmCRTC_GS 0x04A0
  71. #define mmCRTC_VPOS_GS 0x04A4
  72. #define mmCRTC_GCLK 0x04A8
  73. #define mmCRTC_GOE 0x04AC
  74. #define mmCRTC_FRAME 0x04B0
  75. #define mmCRTC_FRAME_VPOS 0x04B4
  76. #define mmGPIO_DATA 0x04B8
  77. #define mmGPIO_CNTL1 0x04BC
  78. #define mmGPIO_CNTL2 0x04C0
  79. #define mmLCDD_CNTL1 0x04C4
  80. #define mmLCDD_CNTL2 0x04C8
  81. #define mmGENLCD_CNTL1 0x04CC
  82. #define mmGENLCD_CNTL2 0x04D0
  83. #define mmDISP_DEBUG 0x04D4
  84. #define mmDISP_DB_BUF_CNTL 0x04D8
  85. #define mmDISP_CRC_SIG 0x04DC
  86. #define mmCRTC_DEFAULT_COUNT 0x04E0
  87. #define mmLCD_BACKGROUND_COLOR 0x04E4
  88. #define mmCRTC_PS2 0x04E8
  89. #define mmCRTC_PS2_VPOS 0x04EC
  90. #define mmCRTC_PS1_ACTIVE 0x04F0
  91. #define mmCRTC_PS1_NACTIVE 0x04F4
  92. #define mmCRTC_GCLK_EXT 0x04F8
  93. #define mmCRTC_ALW 0x04FC
  94. #define mmCRTC_ALW_VPOS 0x0500
  95. #define mmCRTC_PSK 0x0504
  96. #define mmCRTC_PSK_HPOS 0x0508
  97. #define mmCRTC_CV4_START 0x050C
  98. #define mmCRTC_CV4_END 0x0510
  99. #define mmCRTC_CV4_HPOS 0x0514
  100. #define mmCRTC_ECK 0x051C
  101. #define mmREFRESH_CNTL 0x0520
  102. #define mmGENLCD_CNTL3 0x0524
  103. #define mmGPIO_DATA2 0x0528
  104. #define mmGPIO_CNTL3 0x052C
  105. #define mmGPIO_CNTL4 0x0530
  106. #define mmCHIP_STRAP 0x0534
  107. #define mmDISP_DEBUG2 0x0538
  108. #define mmDEBUG_BUS_CNTL 0x053C
  109. #define mmGAMMA_VALUE1 0x0540
  110. #define mmGAMMA_VALUE2 0x0544
  111. #define mmGAMMA_SLOPE 0x0548
  112. #define mmGEN_STATUS 0x054C
  113. #define mmHW_INT 0x0550
  114. /* Block DISPLAY End: */
  115. /* Block GFX Start: */
  116. #define mmDST_OFFSET 0x1004
  117. #define mmDST_PITCH 0x1008
  118. #define mmDST_Y_X 0x1038
  119. #define mmDST_WIDTH_HEIGHT 0x1198
  120. #define mmDP_GUI_MASTER_CNTL 0x106C
  121. #define mmBRUSH_OFFSET 0x108C
  122. #define mmBRUSH_Y_X 0x1074
  123. #define mmDP_BRUSH_FRGD_CLR 0x107C
  124. #define mmSRC_OFFSET 0x11AC
  125. #define mmSRC_PITCH 0x11B0
  126. #define mmSRC_Y_X 0x1034
  127. #define mmDEFAULT_PITCH_OFFSET 0x10A0
  128. #define mmDEFAULT_SC_BOTTOM_RIGHT 0x10A8
  129. #define mmDEFAULT2_SC_BOTTOM_RIGHT 0x10AC
  130. #define mmSC_TOP_LEFT 0x11BC
  131. #define mmSC_BOTTOM_RIGHT 0x11C0
  132. #define mmSRC_SC_BOTTOM_RIGHT 0x11C4
  133. #define mmGLOBAL_ALPHA 0x1210
  134. #define mmFILTER_COEF 0x1214
  135. #define mmMVC_CNTL_START 0x11E0
  136. #define mmE2_ARITHMETIC_CNTL 0x1220
  137. #define mmDP_CNTL 0x11C8
  138. #define mmDP_CNTL_DST_DIR 0x11CC
  139. #define mmDP_DATATYPE 0x12C4
  140. #define mmDP_MIX 0x12C8
  141. #define mmDP_WRITE_MSK 0x12CC
  142. #define mmENG_CNTL 0x13E8
  143. #define mmENG_PERF_CNT 0x13F0
  144. /* Block GFX End: */
  145. /* Block IDCT Start: */
  146. #define mmIDCT_RUNS 0x0C00
  147. #define mmIDCT_LEVELS 0x0C04
  148. #define mmIDCT_CONTROL 0x0C3C
  149. #define mmIDCT_AUTH_CONTROL 0x0C08
  150. #define mmIDCT_AUTH 0x0C0C
  151. /* Block IDCT End: */
  152. /* Block MC Start: */
  153. #define mmMEM_CNTL 0x0180
  154. #define mmMEM_ARB 0x0184
  155. #define mmMC_FB_LOCATION 0x0188
  156. #define mmMEM_EXT_CNTL 0x018C
  157. #define mmMC_EXT_MEM_LOCATION 0x0190
  158. #define mmMEM_EXT_TIMING_CNTL 0x0194
  159. #define mmMEM_SDRAM_MODE_REG 0x0198
  160. #define mmMEM_IO_CNTL 0x019C
  161. #define mmMC_DEBUG 0x01A0
  162. #define mmMC_BIST_CTRL 0x01A4
  163. #define mmMC_BIST_COLLAR_READ 0x01A8
  164. #define mmTC_MISMATCH 0x01AC
  165. #define mmMC_PERF_MON_CNTL 0x01B0
  166. #define mmMC_PERF_COUNTERS 0x01B4
  167. /* Block MC End: */
  168. /* Block BM Start: */
  169. #define mmBM_EXT_MEM_BANDWIDTH 0x0A00
  170. #define mmBM_OFFSET 0x0A04
  171. #define mmBM_MEM_EXT_TIMING_CNTL 0x0A08
  172. #define mmBM_MEM_EXT_CNTL 0x0A0C
  173. #define mmBM_MEM_MODE_REG 0x0A10
  174. #define mmBM_MEM_IO_CNTL 0x0A18
  175. #define mmBM_CONFIG 0x0A1C
  176. #define mmBM_STATUS 0x0A20
  177. #define mmBM_DEBUG 0x0A24
  178. #define mmBM_PERF_MON_CNTL 0x0A28
  179. #define mmBM_PERF_COUNTERS 0x0A2C
  180. #define mmBM_PERF2_MON_CNTL 0x0A30
  181. #define mmBM_PERF2_COUNTERS 0x0A34
  182. /* Block BM End: */
  183. /* Block RBBM Start: */
  184. #define mmWAIT_UNTIL 0x1400
  185. #define mmISYNC_CNTL 0x1404
  186. #define mmRBBM_STATUS 0x0140
  187. #define mmRBBM_CNTL 0x0144
  188. #define mmNQWAIT_UNTIL 0x0150
  189. /* Block RBBM End: */
  190. /* Block CG Start: */
  191. #define mmCLK_PIN_CNTL 0x0080
  192. #define mmPLL_REF_FB_DIV 0x0084
  193. #define mmPLL_CNTL 0x0088
  194. #define mmSCLK_CNTL 0x008C
  195. #define mmPCLK_CNTL 0x0090
  196. #define mmCLK_TEST_CNTL 0x0094
  197. #define mmPWRMGT_CNTL 0x0098
  198. #define mmPWRMGT_STATUS 0x009C
  199. /* Block CG End: */
  200. /* default value definitions */
  201. #define defWRAP_TOP_DIR 0x00000000
  202. #define defWRAP_START_DIR 0x00000000
  203. #define defCFGREG_BASE 0x00000000
  204. #define defCIF_IO 0x000C0902
  205. #define defINTF_CNTL 0x00000011
  206. #define defCPU_DEFAULTS 0x00000006
  207. #define defHW_INT 0x00000000
  208. #define defMC_EXT_MEM_LOCATION 0x07ff0000
  209. #define defTC_MISMATCH 0x00000000
  210. #define W100_CFG_BASE 0x0
  211. #define W100_CFG_LEN 0x10
  212. #define W100_REG_BASE 0x10000
  213. #define W100_REG_LEN 0x2000
  214. #define MEM_INT_BASE_VALUE 0x100000
  215. #define MEM_EXT_BASE_VALUE 0x800000
  216. #define MEM_INT_SIZE 0x05ffff
  217. #define MEM_WINDOW_BASE 0x100000
  218. #define MEM_WINDOW_SIZE 0xf00000
  219. #define WRAP_BUF_BASE_VALUE 0x80000
  220. #define WRAP_BUF_TOP_VALUE 0xbffff
  221. #define CHIP_ID_W100 0x57411002
  222. #define CHIP_ID_W3200 0x56441002
  223. #define CHIP_ID_W3220 0x57441002
  224. /* Register structure definitions */
  225. struct wrap_top_dir_t {
  226. u32 top_addr : 23;
  227. u32 : 9;
  228. } __attribute__((packed));
  229. union wrap_top_dir_u {
  230. u32 val : 32;
  231. struct wrap_top_dir_t f;
  232. } __attribute__((packed));
  233. struct wrap_start_dir_t {
  234. u32 start_addr : 23;
  235. u32 : 9;
  236. } __attribute__((packed));
  237. union wrap_start_dir_u {
  238. u32 val : 32;
  239. struct wrap_start_dir_t f;
  240. } __attribute__((packed));
  241. struct cif_cntl_t {
  242. u32 swap_reg : 2;
  243. u32 swap_fbuf_1 : 2;
  244. u32 swap_fbuf_2 : 2;
  245. u32 swap_fbuf_3 : 2;
  246. u32 pmi_int_disable : 1;
  247. u32 pmi_schmen_disable : 1;
  248. u32 intb_oe : 1;
  249. u32 en_wait_to_compensate_dq_prop_dly : 1;
  250. u32 compensate_wait_rd_size : 2;
  251. u32 wait_asserted_timeout_val : 2;
  252. u32 wait_masked_val : 2;
  253. u32 en_wait_timeout : 1;
  254. u32 en_one_clk_setup_before_wait : 1;
  255. u32 interrupt_active_high : 1;
  256. u32 en_overwrite_straps : 1;
  257. u32 strap_wait_active_hi : 1;
  258. u32 lat_busy_count : 2;
  259. u32 lat_rd_pm4_sclk_busy : 1;
  260. u32 dis_system_bits : 1;
  261. u32 dis_mr : 1;
  262. u32 cif_spare_1 : 4;
  263. } __attribute__((packed));
  264. union cif_cntl_u {
  265. u32 val : 32;
  266. struct cif_cntl_t f;
  267. } __attribute__((packed));
  268. struct cfgreg_base_t {
  269. u32 cfgreg_base : 24;
  270. u32 : 8;
  271. } __attribute__((packed));
  272. union cfgreg_base_u {
  273. u32 val : 32;
  274. struct cfgreg_base_t f;
  275. } __attribute__((packed));
  276. struct cif_io_t {
  277. u32 dq_srp : 1;
  278. u32 dq_srn : 1;
  279. u32 dq_sp : 4;
  280. u32 dq_sn : 4;
  281. u32 waitb_srp : 1;
  282. u32 waitb_srn : 1;
  283. u32 waitb_sp : 4;
  284. u32 waitb_sn : 4;
  285. u32 intb_srp : 1;
  286. u32 intb_srn : 1;
  287. u32 intb_sp : 4;
  288. u32 intb_sn : 4;
  289. u32 : 2;
  290. } __attribute__((packed));
  291. union cif_io_u {
  292. u32 val : 32;
  293. struct cif_io_t f;
  294. } __attribute__((packed));
  295. struct cif_read_dbg_t {
  296. u32 unpacker_pre_fetch_trig_gen : 2;
  297. u32 dly_second_rd_fetch_trig : 1;
  298. u32 rst_rd_burst_id : 1;
  299. u32 dis_rd_burst_id : 1;
  300. u32 en_block_rd_when_packer_is_not_emp : 1;
  301. u32 dis_pre_fetch_cntl_sm : 1;
  302. u32 rbbm_chrncy_dis : 1;
  303. u32 rbbm_rd_after_wr_lat : 2;
  304. u32 dis_be_during_rd : 1;
  305. u32 one_clk_invalidate_pulse : 1;
  306. u32 dis_chnl_priority : 1;
  307. u32 rst_read_path_a_pls : 1;
  308. u32 rst_read_path_b_pls : 1;
  309. u32 dis_reg_rd_fetch_trig : 1;
  310. u32 dis_rd_fetch_trig_from_ind_addr : 1;
  311. u32 dis_rd_same_byte_to_trig_fetch : 1;
  312. u32 dis_dir_wrap : 1;
  313. u32 dis_ring_buf_to_force_dec : 1;
  314. u32 dis_addr_comp_in_16bit : 1;
  315. u32 clr_w : 1;
  316. u32 err_rd_tag_is_3 : 1;
  317. u32 err_load_when_ful_a : 1;
  318. u32 err_load_when_ful_b : 1;
  319. u32 : 7;
  320. } __attribute__((packed));
  321. union cif_read_dbg_u {
  322. u32 val : 32;
  323. struct cif_read_dbg_t f;
  324. } __attribute__((packed));
  325. struct cif_write_dbg_t {
  326. u32 packer_timeout_count : 2;
  327. u32 en_upper_load_cond : 1;
  328. u32 en_chnl_change_cond : 1;
  329. u32 dis_addr_comp_cond : 1;
  330. u32 dis_load_same_byte_addr_cond : 1;
  331. u32 dis_timeout_cond : 1;
  332. u32 dis_timeout_during_rbbm : 1;
  333. u32 dis_packer_ful_during_rbbm_timeout : 1;
  334. u32 en_dword_split_to_rbbm : 1;
  335. u32 en_dummy_val : 1;
  336. u32 dummy_val_sel : 1;
  337. u32 mask_pm4_wrptr_dec : 1;
  338. u32 dis_mc_clean_cond : 1;
  339. u32 err_two_reqi_during_ful : 1;
  340. u32 err_reqi_during_idle_clk : 1;
  341. u32 err_global : 1;
  342. u32 en_wr_buf_dbg_load : 1;
  343. u32 en_wr_buf_dbg_path : 1;
  344. u32 sel_wr_buf_byte : 3;
  345. u32 dis_rd_flush_wr : 1;
  346. u32 dis_packer_ful_cond : 1;
  347. u32 dis_invalidate_by_ops_chnl : 1;
  348. u32 en_halt_when_reqi_err : 1;
  349. u32 cif_spare_2 : 5;
  350. u32 : 1;
  351. } __attribute__((packed));
  352. union cif_write_dbg_u {
  353. u32 val : 32;
  354. struct cif_write_dbg_t f;
  355. } __attribute__((packed));
  356. struct intf_cntl_t {
  357. unsigned char ad_inc_a : 1;
  358. unsigned char ring_buf_a : 1;
  359. unsigned char rd_fetch_trigger_a : 1;
  360. unsigned char rd_data_rdy_a : 1;
  361. unsigned char ad_inc_b : 1;
  362. unsigned char ring_buf_b : 1;
  363. unsigned char rd_fetch_trigger_b : 1;
  364. unsigned char rd_data_rdy_b : 1;
  365. } __attribute__((packed));
  366. union intf_cntl_u {
  367. unsigned char val : 8;
  368. struct intf_cntl_t f;
  369. } __attribute__((packed));
  370. struct cpu_defaults_t {
  371. unsigned char unpack_rd_data : 1;
  372. unsigned char access_ind_addr_a : 1;
  373. unsigned char access_ind_addr_b : 1;
  374. unsigned char access_scratch_reg : 1;
  375. unsigned char pack_wr_data : 1;
  376. unsigned char transition_size : 1;
  377. unsigned char en_read_buf_mode : 1;
  378. unsigned char rd_fetch_scratch : 1;
  379. } __attribute__((packed));
  380. union cpu_defaults_u {
  381. unsigned char val : 8;
  382. struct cpu_defaults_t f;
  383. } __attribute__((packed));
  384. struct crtc_total_t {
  385. u32 crtc_h_total : 10;
  386. u32 : 6;
  387. u32 crtc_v_total : 10;
  388. u32 : 6;
  389. } __attribute__((packed));
  390. union crtc_total_u {
  391. u32 val : 32;
  392. struct crtc_total_t f;
  393. } __attribute__((packed));
  394. struct crtc_ss_t {
  395. u32 ss_start : 10;
  396. u32 : 6;
  397. u32 ss_end : 10;
  398. u32 : 2;
  399. u32 ss_align : 1;
  400. u32 ss_pol : 1;
  401. u32 ss_run_mode : 1;
  402. u32 ss_en : 1;
  403. } __attribute__((packed));
  404. union crtc_ss_u {
  405. u32 val : 32;
  406. struct crtc_ss_t f;
  407. } __attribute__((packed));
  408. struct active_h_disp_t {
  409. u32 active_h_start : 10;
  410. u32 : 6;
  411. u32 active_h_end : 10;
  412. u32 : 6;
  413. } __attribute__((packed));
  414. union active_h_disp_u {
  415. u32 val : 32;
  416. struct active_h_disp_t f;
  417. } __attribute__((packed));
  418. struct active_v_disp_t {
  419. u32 active_v_start : 10;
  420. u32 : 6;
  421. u32 active_v_end : 10;
  422. u32 : 6;
  423. } __attribute__((packed));
  424. union active_v_disp_u {
  425. u32 val : 32;
  426. struct active_v_disp_t f;
  427. } __attribute__((packed));
  428. struct graphic_h_disp_t {
  429. u32 graphic_h_start : 10;
  430. u32 : 6;
  431. u32 graphic_h_end : 10;
  432. u32 : 6;
  433. } __attribute__((packed));
  434. union graphic_h_disp_u {
  435. u32 val : 32;
  436. struct graphic_h_disp_t f;
  437. } __attribute__((packed));
  438. struct graphic_v_disp_t {
  439. u32 graphic_v_start : 10;
  440. u32 : 6;
  441. u32 graphic_v_end : 10;
  442. u32 : 6;
  443. } __attribute__((packed));
  444. union graphic_v_disp_u{
  445. u32 val : 32;
  446. struct graphic_v_disp_t f;
  447. } __attribute__((packed));
  448. struct graphic_ctrl_t_w100 {
  449. u32 color_depth : 3;
  450. u32 portrait_mode : 2;
  451. u32 low_power_on : 1;
  452. u32 req_freq : 4;
  453. u32 en_crtc : 1;
  454. u32 en_graphic_req : 1;
  455. u32 en_graphic_crtc : 1;
  456. u32 total_req_graphic : 9;
  457. u32 lcd_pclk_on : 1;
  458. u32 lcd_sclk_on : 1;
  459. u32 pclk_running : 1;
  460. u32 sclk_running : 1;
  461. u32 : 6;
  462. } __attribute__((packed));
  463. struct graphic_ctrl_t_w32xx {
  464. u32 color_depth : 3;
  465. u32 portrait_mode : 2;
  466. u32 low_power_on : 1;
  467. u32 req_freq : 4;
  468. u32 en_crtc : 1;
  469. u32 en_graphic_req : 1;
  470. u32 en_graphic_crtc : 1;
  471. u32 total_req_graphic : 10;
  472. u32 lcd_pclk_on : 1;
  473. u32 lcd_sclk_on : 1;
  474. u32 pclk_running : 1;
  475. u32 sclk_running : 1;
  476. u32 : 5;
  477. } __attribute__((packed));
  478. union graphic_ctrl_u {
  479. u32 val : 32;
  480. struct graphic_ctrl_t_w100 f_w100;
  481. struct graphic_ctrl_t_w32xx f_w32xx;
  482. } __attribute__((packed));
  483. struct video_ctrl_t {
  484. u32 video_mode : 1;
  485. u32 keyer_en : 1;
  486. u32 en_video_req : 1;
  487. u32 en_graphic_req_video : 1;
  488. u32 en_video_crtc : 1;
  489. u32 video_hor_exp : 2;
  490. u32 video_ver_exp : 2;
  491. u32 uv_combine : 1;
  492. u32 total_req_video : 9;
  493. u32 video_ch_sel : 1;
  494. u32 video_portrait : 2;
  495. u32 yuv2rgb_en : 1;
  496. u32 yuv2rgb_option : 1;
  497. u32 video_inv_hor : 1;
  498. u32 video_inv_ver : 1;
  499. u32 gamma_sel : 2;
  500. u32 dis_limit : 1;
  501. u32 en_uv_hblend : 1;
  502. u32 rgb_gamma_sel : 2;
  503. } __attribute__((packed));
  504. union video_ctrl_u {
  505. u32 val : 32;
  506. struct video_ctrl_t f;
  507. } __attribute__((packed));
  508. struct disp_db_buf_cntl_rd_t {
  509. u32 en_db_buf : 1;
  510. u32 update_db_buf_done : 1;
  511. u32 db_buf_cntl : 6;
  512. u32 : 24;
  513. } __attribute__((packed));
  514. union disp_db_buf_cntl_rd_u {
  515. u32 val : 32;
  516. struct disp_db_buf_cntl_rd_t f;
  517. } __attribute__((packed));
  518. struct disp_db_buf_cntl_wr_t {
  519. u32 en_db_buf : 1;
  520. u32 update_db_buf : 1;
  521. u32 db_buf_cntl : 6;
  522. u32 : 24;
  523. } __attribute__((packed));
  524. union disp_db_buf_cntl_wr_u {
  525. u32 val : 32;
  526. struct disp_db_buf_cntl_wr_t f;
  527. } __attribute__((packed));
  528. struct gamma_value1_t {
  529. u32 gamma1 : 8;
  530. u32 gamma2 : 8;
  531. u32 gamma3 : 8;
  532. u32 gamma4 : 8;
  533. } __attribute__((packed));
  534. union gamma_value1_u {
  535. u32 val : 32;
  536. struct gamma_value1_t f;
  537. } __attribute__((packed));
  538. struct gamma_value2_t {
  539. u32 gamma5 : 8;
  540. u32 gamma6 : 8;
  541. u32 gamma7 : 8;
  542. u32 gamma8 : 8;
  543. } __attribute__((packed));
  544. union gamma_value2_u {
  545. u32 val : 32;
  546. struct gamma_value2_t f;
  547. } __attribute__((packed));
  548. struct gamma_slope_t {
  549. u32 slope1 : 3;
  550. u32 slope2 : 3;
  551. u32 slope3 : 3;
  552. u32 slope4 : 3;
  553. u32 slope5 : 3;
  554. u32 slope6 : 3;
  555. u32 slope7 : 3;
  556. u32 slope8 : 3;
  557. u32 : 8;
  558. } __attribute__((packed));
  559. union gamma_slope_u {
  560. u32 val : 32;
  561. struct gamma_slope_t f;
  562. } __attribute__((packed));
  563. struct mc_ext_mem_location_t {
  564. u32 mc_ext_mem_start : 16;
  565. u32 mc_ext_mem_top : 16;
  566. } __attribute__((packed));
  567. union mc_ext_mem_location_u {
  568. u32 val : 32;
  569. struct mc_ext_mem_location_t f;
  570. } __attribute__((packed));
  571. struct mc_fb_location_t {
  572. u32 mc_fb_start : 16;
  573. u32 mc_fb_top : 16;
  574. } __attribute__((packed));
  575. union mc_fb_location_u {
  576. u32 val : 32;
  577. struct mc_fb_location_t f;
  578. } __attribute__((packed));
  579. struct clk_pin_cntl_t {
  580. u32 osc_en : 1;
  581. u32 osc_gain : 5;
  582. u32 dont_use_xtalin : 1;
  583. u32 xtalin_pm_en : 1;
  584. u32 xtalin_dbl_en : 1;
  585. u32 : 7;
  586. u32 cg_debug : 16;
  587. } __attribute__((packed));
  588. union clk_pin_cntl_u {
  589. u32 val : 32;
  590. struct clk_pin_cntl_t f;
  591. } __attribute__((packed));
  592. struct pll_ref_fb_div_t {
  593. u32 pll_ref_div : 4;
  594. u32 : 4;
  595. u32 pll_fb_div_int : 6;
  596. u32 : 2;
  597. u32 pll_fb_div_frac : 3;
  598. u32 : 1;
  599. u32 pll_reset_time : 4;
  600. u32 pll_lock_time : 8;
  601. } __attribute__((packed));
  602. union pll_ref_fb_div_u {
  603. u32 val : 32;
  604. struct pll_ref_fb_div_t f;
  605. } __attribute__((packed));
  606. struct pll_cntl_t {
  607. u32 pll_pwdn : 1;
  608. u32 pll_reset : 1;
  609. u32 pll_pm_en : 1;
  610. u32 pll_mode : 1;
  611. u32 pll_refclk_sel : 1;
  612. u32 pll_fbclk_sel : 1;
  613. u32 pll_tcpoff : 1;
  614. u32 pll_pcp : 3;
  615. u32 pll_pvg : 3;
  616. u32 pll_vcofr : 1;
  617. u32 pll_ioffset : 2;
  618. u32 pll_pecc_mode : 2;
  619. u32 pll_pecc_scon : 2;
  620. u32 pll_dactal : 4;
  621. u32 pll_cp_clip : 2;
  622. u32 pll_conf : 3;
  623. u32 pll_mbctrl : 2;
  624. u32 pll_ring_off : 1;
  625. } __attribute__((packed));
  626. union pll_cntl_u {
  627. u32 val : 32;
  628. struct pll_cntl_t f;
  629. } __attribute__((packed));
  630. struct sclk_cntl_t {
  631. u32 sclk_src_sel : 2;
  632. u32 : 2;
  633. u32 sclk_post_div_fast : 4;
  634. u32 sclk_clkon_hys : 3;
  635. u32 sclk_post_div_slow : 4;
  636. u32 disp_cg_ok2switch_en : 1;
  637. u32 sclk_force_reg : 1;
  638. u32 sclk_force_disp : 1;
  639. u32 sclk_force_mc : 1;
  640. u32 sclk_force_extmc : 1;
  641. u32 sclk_force_cp : 1;
  642. u32 sclk_force_e2 : 1;
  643. u32 sclk_force_e3 : 1;
  644. u32 sclk_force_idct : 1;
  645. u32 sclk_force_bist : 1;
  646. u32 busy_extend_cp : 1;
  647. u32 busy_extend_e2 : 1;
  648. u32 busy_extend_e3 : 1;
  649. u32 busy_extend_idct : 1;
  650. u32 : 3;
  651. } __attribute__((packed));
  652. union sclk_cntl_u {
  653. u32 val : 32;
  654. struct sclk_cntl_t f;
  655. } __attribute__((packed));
  656. struct pclk_cntl_t {
  657. u32 pclk_src_sel : 2;
  658. u32 : 2;
  659. u32 pclk_post_div : 4;
  660. u32 : 8;
  661. u32 pclk_force_disp : 1;
  662. u32 : 15;
  663. } __attribute__((packed));
  664. union pclk_cntl_u {
  665. u32 val : 32;
  666. struct pclk_cntl_t f;
  667. } __attribute__((packed));
  668. #define TESTCLK_SRC_PLL 0x01
  669. #define TESTCLK_SRC_SCLK 0x02
  670. #define TESTCLK_SRC_PCLK 0x03
  671. /* 4 and 5 seem to by XTAL/M */
  672. #define TESTCLK_SRC_XTAL 0x06
  673. struct clk_test_cntl_t {
  674. u32 testclk_sel : 4;
  675. u32 : 3;
  676. u32 start_check_freq : 1;
  677. u32 tstcount_rst : 1;
  678. u32 : 15;
  679. u32 test_count : 8;
  680. } __attribute__((packed));
  681. union clk_test_cntl_u {
  682. u32 val : 32;
  683. struct clk_test_cntl_t f;
  684. } __attribute__((packed));
  685. struct pwrmgt_cntl_t {
  686. u32 pwm_enable : 1;
  687. u32 : 1;
  688. u32 pwm_mode_req : 2;
  689. u32 pwm_wakeup_cond : 2;
  690. u32 pwm_fast_noml_hw_en : 1;
  691. u32 pwm_noml_fast_hw_en : 1;
  692. u32 pwm_fast_noml_cond : 4;
  693. u32 pwm_noml_fast_cond : 4;
  694. u32 pwm_idle_timer : 8;
  695. u32 pwm_busy_timer : 8;
  696. } __attribute__((packed));
  697. union pwrmgt_cntl_u {
  698. u32 val : 32;
  699. struct pwrmgt_cntl_t f;
  700. } __attribute__((packed));
  701. #define SRC_DATATYPE_EQU_DST 3
  702. #define ROP3_SRCCOPY 0xcc
  703. #define ROP3_PATCOPY 0xf0
  704. #define GMC_BRUSH_SOLID_COLOR 13
  705. #define GMC_BRUSH_NONE 15
  706. #define DP_SRC_MEM_RECTANGULAR 2
  707. #define DP_OP_ROP 0
  708. struct dp_gui_master_cntl_t {
  709. u32 gmc_src_pitch_offset_cntl : 1;
  710. u32 gmc_dst_pitch_offset_cntl : 1;
  711. u32 gmc_src_clipping : 1;
  712. u32 gmc_dst_clipping : 1;
  713. u32 gmc_brush_datatype : 4;
  714. u32 gmc_dst_datatype : 4;
  715. u32 gmc_src_datatype : 3;
  716. u32 gmc_byte_pix_order : 1;
  717. u32 gmc_default_sel : 1;
  718. u32 gmc_rop3 : 8;
  719. u32 gmc_dp_src_source : 3;
  720. u32 gmc_clr_cmp_fcn_dis : 1;
  721. u32 : 1;
  722. u32 gmc_wr_msk_dis : 1;
  723. u32 gmc_dp_op : 1;
  724. } __attribute__((packed));
  725. union dp_gui_master_cntl_u {
  726. u32 val : 32;
  727. struct dp_gui_master_cntl_t f;
  728. } __attribute__((packed));
  729. struct rbbm_status_t {
  730. u32 cmdfifo_avail : 7;
  731. u32 : 1;
  732. u32 hirq_on_rbb : 1;
  733. u32 cprq_on_rbb : 1;
  734. u32 cfrq_on_rbb : 1;
  735. u32 hirq_in_rtbuf : 1;
  736. u32 cprq_in_rtbuf : 1;
  737. u32 cfrq_in_rtbuf : 1;
  738. u32 cf_pipe_busy : 1;
  739. u32 eng_ev_busy : 1;
  740. u32 cp_cmdstrm_busy : 1;
  741. u32 e2_busy : 1;
  742. u32 rb2d_busy : 1;
  743. u32 rb3d_busy : 1;
  744. u32 se_busy : 1;
  745. u32 re_busy : 1;
  746. u32 tam_busy : 1;
  747. u32 tdm_busy : 1;
  748. u32 pb_busy : 1;
  749. u32 : 6;
  750. u32 gui_active : 1;
  751. } __attribute__((packed));
  752. union rbbm_status_u {
  753. u32 val : 32;
  754. struct rbbm_status_t f;
  755. } __attribute__((packed));
  756. struct dp_datatype_t {
  757. u32 dp_dst_datatype : 4;
  758. u32 : 4;
  759. u32 dp_brush_datatype : 4;
  760. u32 dp_src2_type : 1;
  761. u32 dp_src2_datatype : 3;
  762. u32 dp_src_datatype : 3;
  763. u32 : 11;
  764. u32 dp_byte_pix_order : 1;
  765. u32 : 1;
  766. } __attribute__((packed));
  767. union dp_datatype_u {
  768. u32 val : 32;
  769. struct dp_datatype_t f;
  770. } __attribute__((packed));
  771. struct dp_mix_t {
  772. u32 : 8;
  773. u32 dp_src_source : 3;
  774. u32 dp_src2_source : 3;
  775. u32 : 2;
  776. u32 dp_rop3 : 8;
  777. u32 dp_op : 1;
  778. u32 : 7;
  779. } __attribute__((packed));
  780. union dp_mix_u {
  781. u32 val : 32;
  782. struct dp_mix_t f;
  783. } __attribute__((packed));
  784. struct eng_cntl_t {
  785. u32 erc_reg_rd_ws : 1;
  786. u32 erc_reg_wr_ws : 1;
  787. u32 erc_idle_reg_wr : 1;
  788. u32 dis_engine_triggers : 1;
  789. u32 dis_rop_src_uses_dst_w_h : 1;
  790. u32 dis_src_uses_dst_dirmaj : 1;
  791. u32 : 6;
  792. u32 force_3dclk_when_2dclk : 1;
  793. u32 : 19;
  794. } __attribute__((packed));
  795. union eng_cntl_u {
  796. u32 val : 32;
  797. struct eng_cntl_t f;
  798. } __attribute__((packed));
  799. struct dp_cntl_t {
  800. u32 dst_x_dir : 1;
  801. u32 dst_y_dir : 1;
  802. u32 src_x_dir : 1;
  803. u32 src_y_dir : 1;
  804. u32 dst_major_x : 1;
  805. u32 src_major_x : 1;
  806. u32 : 26;
  807. } __attribute__((packed));
  808. union dp_cntl_u {
  809. u32 val : 32;
  810. struct dp_cntl_t f;
  811. } __attribute__((packed));
  812. struct dp_cntl_dst_dir_t {
  813. u32 : 15;
  814. u32 dst_y_dir : 1;
  815. u32 : 15;
  816. u32 dst_x_dir : 1;
  817. } __attribute__((packed));
  818. union dp_cntl_dst_dir_u {
  819. u32 val : 32;
  820. struct dp_cntl_dst_dir_t f;
  821. } __attribute__((packed));
  822. #endif