w100fb.h 23 KB

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