psb_intel_reg.h 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350
  1. /*
  2. * Copyright (c) 2009, Intel Corporation.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms and conditions of the GNU General Public License,
  6. * version 2, as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope it will be useful, but WITHOUT
  9. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. * more details.
  12. *
  13. * You should have received a copy of the GNU General Public License along with
  14. * this program; if not, write to the Free Software Foundation, Inc.,
  15. * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  16. */
  17. #ifndef __PSB_INTEL_REG_H__
  18. #define __PSB_INTEL_REG_H__
  19. /*
  20. * GPIO regs
  21. */
  22. #define GPIOA 0x5010
  23. #define GPIOB 0x5014
  24. #define GPIOC 0x5018
  25. #define GPIOD 0x501c
  26. #define GPIOE 0x5020
  27. #define GPIOF 0x5024
  28. #define GPIOG 0x5028
  29. #define GPIOH 0x502c
  30. # define GPIO_CLOCK_DIR_MASK (1 << 0)
  31. # define GPIO_CLOCK_DIR_IN (0 << 1)
  32. # define GPIO_CLOCK_DIR_OUT (1 << 1)
  33. # define GPIO_CLOCK_VAL_MASK (1 << 2)
  34. # define GPIO_CLOCK_VAL_OUT (1 << 3)
  35. # define GPIO_CLOCK_VAL_IN (1 << 4)
  36. # define GPIO_CLOCK_PULLUP_DISABLE (1 << 5)
  37. # define GPIO_DATA_DIR_MASK (1 << 8)
  38. # define GPIO_DATA_DIR_IN (0 << 9)
  39. # define GPIO_DATA_DIR_OUT (1 << 9)
  40. # define GPIO_DATA_VAL_MASK (1 << 10)
  41. # define GPIO_DATA_VAL_OUT (1 << 11)
  42. # define GPIO_DATA_VAL_IN (1 << 12)
  43. # define GPIO_DATA_PULLUP_DISABLE (1 << 13)
  44. #define GMBUS0 0x5100 /* clock/port select */
  45. #define GMBUS_RATE_100KHZ (0<<8)
  46. #define GMBUS_RATE_50KHZ (1<<8)
  47. #define GMBUS_RATE_400KHZ (2<<8) /* reserved on Pineview */
  48. #define GMBUS_RATE_1MHZ (3<<8) /* reserved on Pineview */
  49. #define GMBUS_HOLD_EXT (1<<7) /* 300ns hold time, rsvd on Pineview */
  50. #define GMBUS_PORT_DISABLED 0
  51. #define GMBUS_PORT_SSC 1
  52. #define GMBUS_PORT_VGADDC 2
  53. #define GMBUS_PORT_PANEL 3
  54. #define GMBUS_PORT_DPC 4 /* HDMIC */
  55. #define GMBUS_PORT_DPB 5 /* SDVO, HDMIB */
  56. /* 6 reserved */
  57. #define GMBUS_PORT_DPD 7 /* HDMID */
  58. #define GMBUS_NUM_PORTS 8
  59. #define GMBUS1 0x5104 /* command/status */
  60. #define GMBUS_SW_CLR_INT (1<<31)
  61. #define GMBUS_SW_RDY (1<<30)
  62. #define GMBUS_ENT (1<<29) /* enable timeout */
  63. #define GMBUS_CYCLE_NONE (0<<25)
  64. #define GMBUS_CYCLE_WAIT (1<<25)
  65. #define GMBUS_CYCLE_INDEX (2<<25)
  66. #define GMBUS_CYCLE_STOP (4<<25)
  67. #define GMBUS_BYTE_COUNT_SHIFT 16
  68. #define GMBUS_SLAVE_INDEX_SHIFT 8
  69. #define GMBUS_SLAVE_ADDR_SHIFT 1
  70. #define GMBUS_SLAVE_READ (1<<0)
  71. #define GMBUS_SLAVE_WRITE (0<<0)
  72. #define GMBUS2 0x5108 /* status */
  73. #define GMBUS_INUSE (1<<15)
  74. #define GMBUS_HW_WAIT_PHASE (1<<14)
  75. #define GMBUS_STALL_TIMEOUT (1<<13)
  76. #define GMBUS_INT (1<<12)
  77. #define GMBUS_HW_RDY (1<<11)
  78. #define GMBUS_SATOER (1<<10)
  79. #define GMBUS_ACTIVE (1<<9)
  80. #define GMBUS3 0x510c /* data buffer bytes 3-0 */
  81. #define GMBUS4 0x5110 /* interrupt mask (Pineview+) */
  82. #define GMBUS_SLAVE_TIMEOUT_EN (1<<4)
  83. #define GMBUS_NAK_EN (1<<3)
  84. #define GMBUS_IDLE_EN (1<<2)
  85. #define GMBUS_HW_WAIT_EN (1<<1)
  86. #define GMBUS_HW_RDY_EN (1<<0)
  87. #define GMBUS5 0x5120 /* byte index */
  88. #define GMBUS_2BYTE_INDEX_EN (1<<31)
  89. #define BLC_PWM_CTL 0x61254
  90. #define BLC_PWM_CTL2 0x61250
  91. #define PWM_ENABLE (1 << 31)
  92. #define PWM_LEGACY_MODE (1 << 30)
  93. #define PWM_PIPE_B (1 << 29)
  94. #define BLC_PWM_CTL_C 0x62254
  95. #define BLC_PWM_CTL2_C 0x62250
  96. #define BACKLIGHT_MODULATION_FREQ_SHIFT (17)
  97. /*
  98. * This is the most significant 15 bits of the number of backlight cycles in a
  99. * complete cycle of the modulated backlight control.
  100. *
  101. * The actual value is this field multiplied by two.
  102. */
  103. #define BACKLIGHT_MODULATION_FREQ_MASK (0x7fff << 17)
  104. #define BLM_LEGACY_MODE (1 << 16)
  105. /*
  106. * This is the number of cycles out of the backlight modulation cycle for which
  107. * the backlight is on.
  108. *
  109. * This field must be no greater than the number of cycles in the complete
  110. * backlight modulation cycle.
  111. */
  112. #define BACKLIGHT_DUTY_CYCLE_SHIFT (0)
  113. #define BACKLIGHT_DUTY_CYCLE_MASK (0xffff)
  114. #define I915_GCFGC 0xf0
  115. #define I915_LOW_FREQUENCY_ENABLE (1 << 7)
  116. #define I915_DISPLAY_CLOCK_190_200_MHZ (0 << 4)
  117. #define I915_DISPLAY_CLOCK_333_MHZ (4 << 4)
  118. #define I915_DISPLAY_CLOCK_MASK (7 << 4)
  119. #define I855_HPLLCC 0xc0
  120. #define I855_CLOCK_CONTROL_MASK (3 << 0)
  121. #define I855_CLOCK_133_200 (0 << 0)
  122. #define I855_CLOCK_100_200 (1 << 0)
  123. #define I855_CLOCK_100_133 (2 << 0)
  124. #define I855_CLOCK_166_250 (3 << 0)
  125. /* I830 CRTC registers */
  126. #define HTOTAL_A 0x60000
  127. #define HBLANK_A 0x60004
  128. #define HSYNC_A 0x60008
  129. #define VTOTAL_A 0x6000c
  130. #define VBLANK_A 0x60010
  131. #define VSYNC_A 0x60014
  132. #define PIPEASRC 0x6001c
  133. #define BCLRPAT_A 0x60020
  134. #define VSYNCSHIFT_A 0x60028
  135. #define HTOTAL_B 0x61000
  136. #define HBLANK_B 0x61004
  137. #define HSYNC_B 0x61008
  138. #define VTOTAL_B 0x6100c
  139. #define VBLANK_B 0x61010
  140. #define VSYNC_B 0x61014
  141. #define PIPEBSRC 0x6101c
  142. #define BCLRPAT_B 0x61020
  143. #define VSYNCSHIFT_B 0x61028
  144. #define HTOTAL_C 0x62000
  145. #define HBLANK_C 0x62004
  146. #define HSYNC_C 0x62008
  147. #define VTOTAL_C 0x6200c
  148. #define VBLANK_C 0x62010
  149. #define VSYNC_C 0x62014
  150. #define PIPECSRC 0x6201c
  151. #define BCLRPAT_C 0x62020
  152. #define VSYNCSHIFT_C 0x62028
  153. #define PP_STATUS 0x61200
  154. # define PP_ON (1 << 31)
  155. /*
  156. * Indicates that all dependencies of the panel are on:
  157. *
  158. * - PLL enabled
  159. * - pipe enabled
  160. * - LVDS/DVOB/DVOC on
  161. */
  162. #define PP_READY (1 << 30)
  163. #define PP_SEQUENCE_NONE (0 << 28)
  164. #define PP_SEQUENCE_ON (1 << 28)
  165. #define PP_SEQUENCE_OFF (2 << 28)
  166. #define PP_SEQUENCE_MASK 0x30000000
  167. #define PP_CONTROL 0x61204
  168. #define POWER_TARGET_ON (1 << 0)
  169. #define LVDSPP_ON 0x61208
  170. #define LVDSPP_OFF 0x6120c
  171. #define PP_CYCLE 0x61210
  172. #define PP_ON_DELAYS 0x61208 /* Cedartrail */
  173. #define PP_OFF_DELAYS 0x6120c /* Cedartrail */
  174. #define PFIT_CONTROL 0x61230
  175. #define PFIT_ENABLE (1 << 31)
  176. #define PFIT_PIPE_MASK (3 << 29)
  177. #define PFIT_PIPE_SHIFT 29
  178. #define PFIT_SCALING_MODE_PILLARBOX (1 << 27)
  179. #define PFIT_SCALING_MODE_LETTERBOX (3 << 26)
  180. #define VERT_INTERP_DISABLE (0 << 10)
  181. #define VERT_INTERP_BILINEAR (1 << 10)
  182. #define VERT_INTERP_MASK (3 << 10)
  183. #define VERT_AUTO_SCALE (1 << 9)
  184. #define HORIZ_INTERP_DISABLE (0 << 6)
  185. #define HORIZ_INTERP_BILINEAR (1 << 6)
  186. #define HORIZ_INTERP_MASK (3 << 6)
  187. #define HORIZ_AUTO_SCALE (1 << 5)
  188. #define PANEL_8TO6_DITHER_ENABLE (1 << 3)
  189. #define PFIT_PGM_RATIOS 0x61234
  190. #define PFIT_VERT_SCALE_MASK 0xfff00000
  191. #define PFIT_HORIZ_SCALE_MASK 0x0000fff0
  192. #define PFIT_AUTO_RATIOS 0x61238
  193. #define DPLL_A 0x06014
  194. #define DPLL_B 0x06018
  195. #define DPLL_VCO_ENABLE (1 << 31)
  196. #define DPLL_DVO_HIGH_SPEED (1 << 30)
  197. #define DPLL_SYNCLOCK_ENABLE (1 << 29)
  198. #define DPLL_VGA_MODE_DIS (1 << 28)
  199. #define DPLLB_MODE_DAC_SERIAL (1 << 26) /* i915 */
  200. #define DPLLB_MODE_LVDS (2 << 26) /* i915 */
  201. #define DPLL_MODE_MASK (3 << 26)
  202. #define DPLL_DAC_SERIAL_P2_CLOCK_DIV_10 (0 << 24) /* i915 */
  203. #define DPLL_DAC_SERIAL_P2_CLOCK_DIV_5 (1 << 24) /* i915 */
  204. #define DPLLB_LVDS_P2_CLOCK_DIV_14 (0 << 24) /* i915 */
  205. #define DPLLB_LVDS_P2_CLOCK_DIV_7 (1 << 24) /* i915 */
  206. #define DPLL_P2_CLOCK_DIV_MASK 0x03000000 /* i915 */
  207. #define DPLL_FPA0h1_P1_POST_DIV_MASK 0x00ff0000 /* i915 */
  208. #define DPLL_LOCK (1 << 15) /* CDV */
  209. /*
  210. * The i830 generation, in DAC/serial mode, defines p1 as two plus this
  211. * bitfield, or just 2 if PLL_P1_DIVIDE_BY_TWO is set.
  212. */
  213. # define DPLL_FPA01_P1_POST_DIV_MASK_I830 0x001f0000
  214. /*
  215. * The i830 generation, in LVDS mode, defines P1 as the bit number set within
  216. * this field (only one bit may be set).
  217. */
  218. #define DPLL_FPA01_P1_POST_DIV_MASK_I830_LVDS 0x003f0000
  219. #define DPLL_FPA01_P1_POST_DIV_SHIFT 16
  220. #define PLL_P2_DIVIDE_BY_4 (1 << 23) /* i830, required
  221. * in DVO non-gang */
  222. # define PLL_P1_DIVIDE_BY_TWO (1 << 21) /* i830 */
  223. #define PLL_REF_INPUT_DREFCLK (0 << 13)
  224. #define PLL_REF_INPUT_TVCLKINA (1 << 13) /* i830 */
  225. #define PLL_REF_INPUT_TVCLKINBC (2 << 13) /* SDVO
  226. * TVCLKIN */
  227. #define PLLB_REF_INPUT_SPREADSPECTRUMIN (3 << 13)
  228. #define PLL_REF_INPUT_MASK (3 << 13)
  229. #define PLL_LOAD_PULSE_PHASE_SHIFT 9
  230. /*
  231. * Parallel to Serial Load Pulse phase selection.
  232. * Selects the phase for the 10X DPLL clock for the PCIe
  233. * digital display port. The range is 4 to 13; 10 or more
  234. * is just a flip delay. The default is 6
  235. */
  236. #define PLL_LOAD_PULSE_PHASE_MASK (0xf << PLL_LOAD_PULSE_PHASE_SHIFT)
  237. #define DISPLAY_RATE_SELECT_FPA1 (1 << 8)
  238. /*
  239. * SDVO multiplier for 945G/GM. Not used on 965.
  240. *
  241. * DPLL_MD_UDI_MULTIPLIER_MASK
  242. */
  243. #define SDVO_MULTIPLIER_MASK 0x000000ff
  244. #define SDVO_MULTIPLIER_SHIFT_HIRES 4
  245. #define SDVO_MULTIPLIER_SHIFT_VGA 0
  246. /*
  247. * PLL_MD
  248. */
  249. /* Pipe A SDVO/UDI clock multiplier/divider register for G965. */
  250. #define DPLL_A_MD 0x0601c
  251. /* Pipe B SDVO/UDI clock multiplier/divider register for G965. */
  252. #define DPLL_B_MD 0x06020
  253. /*
  254. * UDI pixel divider, controlling how many pixels are stuffed into a packet.
  255. *
  256. * Value is pixels minus 1. Must be set to 1 pixel for SDVO.
  257. */
  258. #define DPLL_MD_UDI_DIVIDER_MASK 0x3f000000
  259. #define DPLL_MD_UDI_DIVIDER_SHIFT 24
  260. /* UDI pixel divider for VGA, same as DPLL_MD_UDI_DIVIDER_MASK. */
  261. #define DPLL_MD_VGA_UDI_DIVIDER_MASK 0x003f0000
  262. #define DPLL_MD_VGA_UDI_DIVIDER_SHIFT 16
  263. /*
  264. * SDVO/UDI pixel multiplier.
  265. *
  266. * SDVO requires that the bus clock rate be between 1 and 2 Ghz, and the bus
  267. * clock rate is 10 times the DPLL clock. At low resolution/refresh rate
  268. * modes, the bus rate would be below the limits, so SDVO allows for stuffing
  269. * dummy bytes in the datastream at an increased clock rate, with both sides of
  270. * the link knowing how many bytes are fill.
  271. *
  272. * So, for a mode with a dotclock of 65Mhz, we would want to double the clock
  273. * rate to 130Mhz to get a bus rate of 1.30Ghz. The DPLL clock rate would be
  274. * set to 130Mhz, and the SDVO multiplier set to 2x in this register and
  275. * through an SDVO command.
  276. *
  277. * This register field has values of multiplication factor minus 1, with
  278. * a maximum multiplier of 5 for SDVO.
  279. */
  280. #define DPLL_MD_UDI_MULTIPLIER_MASK 0x00003f00
  281. #define DPLL_MD_UDI_MULTIPLIER_SHIFT 8
  282. /*
  283. * SDVO/UDI pixel multiplier for VGA, same as DPLL_MD_UDI_MULTIPLIER_MASK.
  284. * This best be set to the default value (3) or the CRT won't work. No,
  285. * I don't entirely understand what this does...
  286. */
  287. #define DPLL_MD_VGA_UDI_MULTIPLIER_MASK 0x0000003f
  288. #define DPLL_MD_VGA_UDI_MULTIPLIER_SHIFT 0
  289. #define DPLL_TEST 0x606c
  290. #define DPLLB_TEST_SDVO_DIV_1 (0 << 22)
  291. #define DPLLB_TEST_SDVO_DIV_2 (1 << 22)
  292. #define DPLLB_TEST_SDVO_DIV_4 (2 << 22)
  293. #define DPLLB_TEST_SDVO_DIV_MASK (3 << 22)
  294. #define DPLLB_TEST_N_BYPASS (1 << 19)
  295. #define DPLLB_TEST_M_BYPASS (1 << 18)
  296. #define DPLLB_INPUT_BUFFER_ENABLE (1 << 16)
  297. #define DPLLA_TEST_N_BYPASS (1 << 3)
  298. #define DPLLA_TEST_M_BYPASS (1 << 2)
  299. #define DPLLA_INPUT_BUFFER_ENABLE (1 << 0)
  300. #define ADPA 0x61100
  301. #define ADPA_DAC_ENABLE (1 << 31)
  302. #define ADPA_DAC_DISABLE 0
  303. #define ADPA_PIPE_SELECT_MASK (1 << 30)
  304. #define ADPA_PIPE_A_SELECT 0
  305. #define ADPA_PIPE_B_SELECT (1 << 30)
  306. #define ADPA_USE_VGA_HVPOLARITY (1 << 15)
  307. #define ADPA_SETS_HVPOLARITY 0
  308. #define ADPA_VSYNC_CNTL_DISABLE (1 << 11)
  309. #define ADPA_VSYNC_CNTL_ENABLE 0
  310. #define ADPA_HSYNC_CNTL_DISABLE (1 << 10)
  311. #define ADPA_HSYNC_CNTL_ENABLE 0
  312. #define ADPA_VSYNC_ACTIVE_HIGH (1 << 4)
  313. #define ADPA_VSYNC_ACTIVE_LOW 0
  314. #define ADPA_HSYNC_ACTIVE_HIGH (1 << 3)
  315. #define ADPA_HSYNC_ACTIVE_LOW 0
  316. #define FPA0 0x06040
  317. #define FPA1 0x06044
  318. #define FPB0 0x06048
  319. #define FPB1 0x0604c
  320. #define FP_N_DIV_MASK 0x003f0000
  321. #define FP_N_DIV_SHIFT 16
  322. #define FP_M1_DIV_MASK 0x00003f00
  323. #define FP_M1_DIV_SHIFT 8
  324. #define FP_M2_DIV_MASK 0x0000003f
  325. #define FP_M2_DIV_SHIFT 0
  326. #define PORT_HOTPLUG_EN 0x61110
  327. #define HDMIB_HOTPLUG_INT_EN (1 << 29)
  328. #define HDMIC_HOTPLUG_INT_EN (1 << 28)
  329. #define HDMID_HOTPLUG_INT_EN (1 << 27)
  330. #define SDVOB_HOTPLUG_INT_EN (1 << 26)
  331. #define SDVOC_HOTPLUG_INT_EN (1 << 25)
  332. #define TV_HOTPLUG_INT_EN (1 << 18)
  333. #define CRT_HOTPLUG_INT_EN (1 << 9)
  334. #define CRT_HOTPLUG_FORCE_DETECT (1 << 3)
  335. /* CDV.. */
  336. #define CRT_HOTPLUG_ACTIVATION_PERIOD_64 (1 << 8)
  337. #define CRT_HOTPLUG_DAC_ON_TIME_2M (0 << 7)
  338. #define CRT_HOTPLUG_DAC_ON_TIME_4M (1 << 7)
  339. #define CRT_HOTPLUG_VOLTAGE_COMPARE_40 (0 << 5)
  340. #define CRT_HOTPLUG_VOLTAGE_COMPARE_50 (1 << 5)
  341. #define CRT_HOTPLUG_VOLTAGE_COMPARE_60 (2 << 5)
  342. #define CRT_HOTPLUG_VOLTAGE_COMPARE_70 (3 << 5)
  343. #define CRT_HOTPLUG_VOLTAGE_COMPARE_MASK (3 << 5)
  344. #define CRT_HOTPLUG_DETECT_DELAY_1G (0 << 4)
  345. #define CRT_HOTPLUG_DETECT_DELAY_2G (1 << 4)
  346. #define CRT_HOTPLUG_DETECT_VOLTAGE_325MV (0 << 2)
  347. #define CRT_HOTPLUG_DETECT_VOLTAGE_475MV (1 << 2)
  348. #define CRT_HOTPLUG_DETECT_MASK 0x000000F8
  349. #define PORT_HOTPLUG_STAT 0x61114
  350. #define CRT_HOTPLUG_INT_STATUS (1 << 11)
  351. #define TV_HOTPLUG_INT_STATUS (1 << 10)
  352. #define CRT_HOTPLUG_MONITOR_MASK (3 << 8)
  353. #define CRT_HOTPLUG_MONITOR_COLOR (3 << 8)
  354. #define CRT_HOTPLUG_MONITOR_MONO (2 << 8)
  355. #define CRT_HOTPLUG_MONITOR_NONE (0 << 8)
  356. #define SDVOC_HOTPLUG_INT_STATUS (1 << 7)
  357. #define SDVOB_HOTPLUG_INT_STATUS (1 << 6)
  358. #define SDVOB 0x61140
  359. #define SDVOC 0x61160
  360. #define SDVO_ENABLE (1 << 31)
  361. #define SDVO_PIPE_B_SELECT (1 << 30)
  362. #define SDVO_STALL_SELECT (1 << 29)
  363. #define SDVO_INTERRUPT_ENABLE (1 << 26)
  364. #define SDVO_COLOR_RANGE_16_235 (1 << 8)
  365. #define SDVO_AUDIO_ENABLE (1 << 6)
  366. /**
  367. * 915G/GM SDVO pixel multiplier.
  368. *
  369. * Programmed value is multiplier - 1, up to 5x.
  370. *
  371. * DPLL_MD_UDI_MULTIPLIER_MASK
  372. */
  373. #define SDVO_PORT_MULTIPLY_MASK (7 << 23)
  374. #define SDVO_PORT_MULTIPLY_SHIFT 23
  375. #define SDVO_PHASE_SELECT_MASK (15 << 19)
  376. #define SDVO_PHASE_SELECT_DEFAULT (6 << 19)
  377. #define SDVO_CLOCK_OUTPUT_INVERT (1 << 18)
  378. #define SDVOC_GANG_MODE (1 << 16)
  379. #define SDVO_BORDER_ENABLE (1 << 7)
  380. #define SDVOB_PCIE_CONCURRENCY (1 << 3)
  381. #define SDVO_DETECTED (1 << 2)
  382. /* Bits to be preserved when writing */
  383. #define SDVOB_PRESERVE_MASK ((1 << 17) | (1 << 16) | (1 << 14))
  384. #define SDVOC_PRESERVE_MASK (1 << 17)
  385. /*
  386. * This register controls the LVDS output enable, pipe selection, and data
  387. * format selection.
  388. *
  389. * All of the clock/data pairs are force powered down by power sequencing.
  390. */
  391. #define LVDS 0x61180
  392. /*
  393. * Enables the LVDS port. This bit must be set before DPLLs are enabled, as
  394. * the DPLL semantics change when the LVDS is assigned to that pipe.
  395. */
  396. #define LVDS_PORT_EN (1 << 31)
  397. /* Selects pipe B for LVDS data. Must be set on pre-965. */
  398. #define LVDS_PIPEB_SELECT (1 << 30)
  399. /* Turns on border drawing to allow centered display. */
  400. #define LVDS_BORDER_EN (1 << 15)
  401. /*
  402. * Enables the A0-A2 data pairs and CLKA, containing 18 bits of color data per
  403. * pixel.
  404. */
  405. #define LVDS_A0A2_CLKA_POWER_MASK (3 << 8)
  406. #define LVDS_A0A2_CLKA_POWER_DOWN (0 << 8)
  407. #define LVDS_A0A2_CLKA_POWER_UP (3 << 8)
  408. /*
  409. * Controls the A3 data pair, which contains the additional LSBs for 24 bit
  410. * mode. Only enabled if LVDS_A0A2_CLKA_POWER_UP also indicates it should be
  411. * on.
  412. */
  413. #define LVDS_A3_POWER_MASK (3 << 6)
  414. #define LVDS_A3_POWER_DOWN (0 << 6)
  415. #define LVDS_A3_POWER_UP (3 << 6)
  416. /*
  417. * Controls the CLKB pair. This should only be set when LVDS_B0B3_POWER_UP
  418. * is set.
  419. */
  420. #define LVDS_CLKB_POWER_MASK (3 << 4)
  421. #define LVDS_CLKB_POWER_DOWN (0 << 4)
  422. #define LVDS_CLKB_POWER_UP (3 << 4)
  423. /*
  424. * Controls the B0-B3 data pairs. This must be set to match the DPLL p2
  425. * setting for whether we are in dual-channel mode. The B3 pair will
  426. * additionally only be powered up when LVDS_A3_POWER_UP is set.
  427. */
  428. #define LVDS_B0B3_POWER_MASK (3 << 2)
  429. #define LVDS_B0B3_POWER_DOWN (0 << 2)
  430. #define LVDS_B0B3_POWER_UP (3 << 2)
  431. #define PIPEACONF 0x70008
  432. #define PIPEACONF_ENABLE (1 << 31)
  433. #define PIPEACONF_DISABLE 0
  434. #define PIPEACONF_DOUBLE_WIDE (1 << 30)
  435. #define PIPECONF_ACTIVE (1 << 30)
  436. #define I965_PIPECONF_ACTIVE (1 << 30)
  437. #define PIPECONF_DSIPLL_LOCK (1 << 29)
  438. #define PIPEACONF_SINGLE_WIDE 0
  439. #define PIPEACONF_PIPE_UNLOCKED 0
  440. #define PIPEACONF_DSR (1 << 26)
  441. #define PIPEACONF_PIPE_LOCKED (1 << 25)
  442. #define PIPEACONF_PALETTE 0
  443. #define PIPECONF_FORCE_BORDER (1 << 25)
  444. #define PIPEACONF_GAMMA (1 << 24)
  445. #define PIPECONF_PROGRESSIVE (0 << 21)
  446. #define PIPECONF_INTERLACE_W_FIELD_INDICATION (6 << 21)
  447. #define PIPECONF_INTERLACE_FIELD_0_ONLY (7 << 21)
  448. #define PIPECONF_PLANE_OFF (1 << 19)
  449. #define PIPECONF_CURSOR_OFF (1 << 18)
  450. #define PIPEBCONF 0x71008
  451. #define PIPEBCONF_ENABLE (1 << 31)
  452. #define PIPEBCONF_DISABLE 0
  453. #define PIPEBCONF_DOUBLE_WIDE (1 << 30)
  454. #define PIPEBCONF_DISABLE 0
  455. #define PIPEBCONF_GAMMA (1 << 24)
  456. #define PIPEBCONF_PALETTE 0
  457. #define PIPECCONF 0x72008
  458. #define PIPEBGCMAXRED 0x71010
  459. #define PIPEBGCMAXGREEN 0x71014
  460. #define PIPEBGCMAXBLUE 0x71018
  461. #define PIPEASTAT 0x70024
  462. #define PIPEBSTAT 0x71024
  463. #define PIPECSTAT 0x72024
  464. #define PIPE_VBLANK_INTERRUPT_STATUS (1UL << 1)
  465. #define PIPE_START_VBLANK_INTERRUPT_STATUS (1UL << 2)
  466. #define PIPE_VBLANK_CLEAR (1 << 1)
  467. #define PIPE_VBLANK_STATUS (1 << 1)
  468. #define PIPE_TE_STATUS (1UL << 6)
  469. #define PIPE_DPST_EVENT_STATUS (1UL << 7)
  470. #define PIPE_VSYNC_CLEAR (1UL << 9)
  471. #define PIPE_VSYNC_STATUS (1UL << 9)
  472. #define PIPE_HDMI_AUDIO_UNDERRUN_STATUS (1UL << 10)
  473. #define PIPE_HDMI_AUDIO_BUFFER_DONE_STATUS (1UL << 11)
  474. #define PIPE_VBLANK_INTERRUPT_ENABLE (1UL << 17)
  475. #define PIPE_START_VBLANK_INTERRUPT_ENABLE (1UL << 18)
  476. #define PIPE_TE_ENABLE (1UL << 22)
  477. #define PIPE_DPST_EVENT_ENABLE (1UL << 23)
  478. #define PIPE_VSYNC_ENABL (1UL << 25)
  479. #define PIPE_HDMI_AUDIO_UNDERRUN (1UL << 26)
  480. #define PIPE_HDMI_AUDIO_BUFFER_DONE (1UL << 27)
  481. #define PIPE_FIFO_UNDERRUN (1UL << 31)
  482. #define PIPE_HDMI_AUDIO_INT_MASK (PIPE_HDMI_AUDIO_UNDERRUN | \
  483. PIPE_HDMI_AUDIO_BUFFER_DONE)
  484. #define PIPE_EVENT_MASK ((1 << 29)|(1 << 28)|(1 << 27)|(1 << 26)|(1 << 24)|(1 << 23)|(1 << 22)|(1 << 21)|(1 << 20)|(1 << 16))
  485. #define PIPE_VBLANK_MASK ((1 << 25)|(1 << 24)|(1 << 18)|(1 << 17))
  486. #define HISTOGRAM_INT_CONTROL 0x61268
  487. #define HISTOGRAM_BIN_DATA 0X61264
  488. #define HISTOGRAM_LOGIC_CONTROL 0x61260
  489. #define PWM_CONTROL_LOGIC 0x61250
  490. #define PIPE_HOTPLUG_INTERRUPT_STATUS (1UL << 10)
  491. #define HISTOGRAM_INTERRUPT_ENABLE (1UL << 31)
  492. #define HISTOGRAM_LOGIC_ENABLE (1UL << 31)
  493. #define PWM_LOGIC_ENABLE (1UL << 31)
  494. #define PWM_PHASEIN_ENABLE (1UL << 25)
  495. #define PWM_PHASEIN_INT_ENABLE (1UL << 24)
  496. #define PWM_PHASEIN_VB_COUNT 0x00001f00
  497. #define PWM_PHASEIN_INC 0x0000001f
  498. #define HISTOGRAM_INT_CTRL_CLEAR (1UL << 30)
  499. #define DPST_YUV_LUMA_MODE 0
  500. struct dpst_ie_histogram_control {
  501. union {
  502. uint32_t data;
  503. struct {
  504. uint32_t bin_reg_index:7;
  505. uint32_t reserved:4;
  506. uint32_t bin_reg_func_select:1;
  507. uint32_t sync_to_phase_in:1;
  508. uint32_t alt_enhancement_mode:2;
  509. uint32_t reserved1:1;
  510. uint32_t sync_to_phase_in_count:8;
  511. uint32_t histogram_mode_select:1;
  512. uint32_t reserved2:4;
  513. uint32_t ie_pipe_assignment:1;
  514. uint32_t ie_mode_table_enabled:1;
  515. uint32_t ie_histogram_enable:1;
  516. };
  517. };
  518. };
  519. struct dpst_guardband {
  520. union {
  521. uint32_t data;
  522. struct {
  523. uint32_t guardband:22;
  524. uint32_t guardband_interrupt_delay:8;
  525. uint32_t interrupt_status:1;
  526. uint32_t interrupt_enable:1;
  527. };
  528. };
  529. };
  530. #define PIPEAFRAMEHIGH 0x70040
  531. #define PIPEAFRAMEPIXEL 0x70044
  532. #define PIPEBFRAMEHIGH 0x71040
  533. #define PIPEBFRAMEPIXEL 0x71044
  534. #define PIPECFRAMEHIGH 0x72040
  535. #define PIPECFRAMEPIXEL 0x72044
  536. #define PIPE_FRAME_HIGH_MASK 0x0000ffff
  537. #define PIPE_FRAME_HIGH_SHIFT 0
  538. #define PIPE_FRAME_LOW_MASK 0xff000000
  539. #define PIPE_FRAME_LOW_SHIFT 24
  540. #define PIPE_PIXEL_MASK 0x00ffffff
  541. #define PIPE_PIXEL_SHIFT 0
  542. #define FW_BLC_SELF 0x20e0
  543. #define FW_BLC_SELF_EN (1<<15)
  544. #define DSPARB 0x70030
  545. #define DSPFW1 0x70034
  546. #define DSP_FIFO_SR_WM_MASK 0xFF800000
  547. #define DSP_FIFO_SR_WM_SHIFT 23
  548. #define CURSOR_B_FIFO_WM_MASK 0x003F0000
  549. #define CURSOR_B_FIFO_WM_SHIFT 16
  550. #define DSPFW2 0x70038
  551. #define CURSOR_A_FIFO_WM_MASK 0x3F00
  552. #define CURSOR_A_FIFO_WM_SHIFT 8
  553. #define DSP_PLANE_C_FIFO_WM_MASK 0x7F
  554. #define DSP_PLANE_C_FIFO_WM_SHIFT 0
  555. #define DSPFW3 0x7003c
  556. #define DSPFW4 0x70050
  557. #define DSPFW5 0x70054
  558. #define DSP_PLANE_B_FIFO_WM1_SHIFT 24
  559. #define DSP_PLANE_A_FIFO_WM1_SHIFT 16
  560. #define CURSOR_B_FIFO_WM1_SHIFT 8
  561. #define CURSOR_FIFO_SR_WM1_SHIFT 0
  562. #define DSPFW6 0x70058
  563. #define DSPCHICKENBIT 0x70400
  564. #define DSPACNTR 0x70180
  565. #define DSPBCNTR 0x71180
  566. #define DSPCCNTR 0x72180
  567. #define DISPLAY_PLANE_ENABLE (1 << 31)
  568. #define DISPLAY_PLANE_DISABLE 0
  569. #define DISPPLANE_GAMMA_ENABLE (1 << 30)
  570. #define DISPPLANE_GAMMA_DISABLE 0
  571. #define DISPPLANE_PIXFORMAT_MASK (0xf << 26)
  572. #define DISPPLANE_8BPP (0x2 << 26)
  573. #define DISPPLANE_15_16BPP (0x4 << 26)
  574. #define DISPPLANE_16BPP (0x5 << 26)
  575. #define DISPPLANE_32BPP_NO_ALPHA (0x6 << 26)
  576. #define DISPPLANE_32BPP (0x7 << 26)
  577. #define DISPPLANE_STEREO_ENABLE (1 << 25)
  578. #define DISPPLANE_STEREO_DISABLE 0
  579. #define DISPPLANE_SEL_PIPE_MASK (1 << 24)
  580. #define DISPPLANE_SEL_PIPE_POS 24
  581. #define DISPPLANE_SEL_PIPE_A 0
  582. #define DISPPLANE_SEL_PIPE_B (1 << 24)
  583. #define DISPPLANE_SRC_KEY_ENABLE (1 << 22)
  584. #define DISPPLANE_SRC_KEY_DISABLE 0
  585. #define DISPPLANE_LINE_DOUBLE (1 << 20)
  586. #define DISPPLANE_NO_LINE_DOUBLE 0
  587. #define DISPPLANE_STEREO_POLARITY_FIRST 0
  588. #define DISPPLANE_STEREO_POLARITY_SECOND (1 << 18)
  589. /* plane B only */
  590. #define DISPPLANE_ALPHA_TRANS_ENABLE (1 << 15)
  591. #define DISPPLANE_ALPHA_TRANS_DISABLE 0
  592. #define DISPPLANE_SPRITE_ABOVE_DISPLAYA 0
  593. #define DISPPLANE_SPRITE_ABOVE_OVERLAY (1)
  594. #define DISPPLANE_BOTTOM (4)
  595. #define DSPABASE 0x70184
  596. #define DSPALINOFF 0x70184
  597. #define DSPASTRIDE 0x70188
  598. #define DSPBBASE 0x71184
  599. #define DSPBLINOFF 0X71184
  600. #define DSPBADDR DSPBBASE
  601. #define DSPBSTRIDE 0x71188
  602. #define DSPCBASE 0x72184
  603. #define DSPCLINOFF 0x72184
  604. #define DSPCSTRIDE 0x72188
  605. #define DSPAKEYVAL 0x70194
  606. #define DSPAKEYMASK 0x70198
  607. #define DSPAPOS 0x7018C /* reserved */
  608. #define DSPASIZE 0x70190
  609. #define DSPBPOS 0x7118C
  610. #define DSPBSIZE 0x71190
  611. #define DSPCPOS 0x7218C
  612. #define DSPCSIZE 0x72190
  613. #define DSPASURF 0x7019C
  614. #define DSPATILEOFF 0x701A4
  615. #define DSPBSURF 0x7119C
  616. #define DSPBTILEOFF 0x711A4
  617. #define DSPCSURF 0x7219C
  618. #define DSPCTILEOFF 0x721A4
  619. #define DSPCKEYMAXVAL 0x721A0
  620. #define DSPCKEYMINVAL 0x72194
  621. #define DSPCKEYMSK 0x72198
  622. #define VGACNTRL 0x71400
  623. #define VGA_DISP_DISABLE (1 << 31)
  624. #define VGA_2X_MODE (1 << 30)
  625. #define VGA_PIPE_B_SELECT (1 << 29)
  626. /*
  627. * Overlay registers
  628. */
  629. #define OV_C_OFFSET 0x08000
  630. #define OV_OVADD 0x30000
  631. #define OV_DOVASTA 0x30008
  632. # define OV_PIPE_SELECT ((1 << 6)|(1 << 7))
  633. # define OV_PIPE_SELECT_POS 6
  634. # define OV_PIPE_A 0
  635. # define OV_PIPE_C 1
  636. #define OV_OGAMC5 0x30010
  637. #define OV_OGAMC4 0x30014
  638. #define OV_OGAMC3 0x30018
  639. #define OV_OGAMC2 0x3001C
  640. #define OV_OGAMC1 0x30020
  641. #define OV_OGAMC0 0x30024
  642. #define OVC_OVADD 0x38000
  643. #define OVC_DOVCSTA 0x38008
  644. #define OVC_OGAMC5 0x38010
  645. #define OVC_OGAMC4 0x38014
  646. #define OVC_OGAMC3 0x38018
  647. #define OVC_OGAMC2 0x3801C
  648. #define OVC_OGAMC1 0x38020
  649. #define OVC_OGAMC0 0x38024
  650. /*
  651. * Some BIOS scratch area registers. The 845 (and 830?) store the amount
  652. * of video memory available to the BIOS in SWF1.
  653. */
  654. #define SWF0 0x71410
  655. #define SWF1 0x71414
  656. #define SWF2 0x71418
  657. #define SWF3 0x7141c
  658. #define SWF4 0x71420
  659. #define SWF5 0x71424
  660. #define SWF6 0x71428
  661. /*
  662. * 855 scratch registers.
  663. */
  664. #define SWF00 0x70410
  665. #define SWF01 0x70414
  666. #define SWF02 0x70418
  667. #define SWF03 0x7041c
  668. #define SWF04 0x70420
  669. #define SWF05 0x70424
  670. #define SWF06 0x70428
  671. #define SWF10 SWF0
  672. #define SWF11 SWF1
  673. #define SWF12 SWF2
  674. #define SWF13 SWF3
  675. #define SWF14 SWF4
  676. #define SWF15 SWF5
  677. #define SWF16 SWF6
  678. #define SWF30 0x72414
  679. #define SWF31 0x72418
  680. #define SWF32 0x7241c
  681. /*
  682. * Palette registers
  683. */
  684. #define PALETTE_A 0x0a000
  685. #define PALETTE_B 0x0a800
  686. #define PALETTE_C 0x0ac00
  687. /* Cursor A & B regs */
  688. #define CURACNTR 0x70080
  689. #define CURSOR_MODE_DISABLE 0x00
  690. #define CURSOR_MODE_64_32B_AX 0x07
  691. #define CURSOR_MODE_64_ARGB_AX ((1 << 5) | CURSOR_MODE_64_32B_AX)
  692. #define MCURSOR_GAMMA_ENABLE (1 << 26)
  693. #define CURABASE 0x70084
  694. #define CURAPOS 0x70088
  695. #define CURSOR_POS_MASK 0x007FF
  696. #define CURSOR_POS_SIGN 0x8000
  697. #define CURSOR_X_SHIFT 0
  698. #define CURSOR_Y_SHIFT 16
  699. #define CURBCNTR 0x700c0
  700. #define CURBBASE 0x700c4
  701. #define CURBPOS 0x700c8
  702. #define CURCCNTR 0x700e0
  703. #define CURCBASE 0x700e4
  704. #define CURCPOS 0x700e8
  705. /*
  706. * Interrupt Registers
  707. */
  708. #define IER 0x020a0
  709. #define IIR 0x020a4
  710. #define IMR 0x020a8
  711. #define ISR 0x020ac
  712. /*
  713. * MOORESTOWN delta registers
  714. */
  715. #define MRST_DPLL_A 0x0f014
  716. #define MDFLD_DPLL_B 0x0f018
  717. #define MDFLD_INPUT_REF_SEL (1 << 14)
  718. #define MDFLD_VCO_SEL (1 << 16)
  719. #define DPLLA_MODE_LVDS (2 << 26) /* mrst */
  720. #define MDFLD_PLL_LATCHEN (1 << 28)
  721. #define MDFLD_PWR_GATE_EN (1 << 30)
  722. #define MDFLD_P1_MASK (0x1FF << 17)
  723. #define MRST_FPA0 0x0f040
  724. #define MRST_FPA1 0x0f044
  725. #define MDFLD_DPLL_DIV0 0x0f048
  726. #define MDFLD_DPLL_DIV1 0x0f04c
  727. #define MRST_PERF_MODE 0x020f4
  728. /*
  729. * MEDFIELD HDMI registers
  730. */
  731. #define HDMIPHYMISCCTL 0x61134
  732. #define HDMI_PHY_POWER_DOWN 0x7f
  733. #define HDMIB_CONTROL 0x61140
  734. #define HDMIB_PORT_EN (1 << 31)
  735. #define HDMIB_PIPE_B_SELECT (1 << 30)
  736. #define HDMIB_NULL_PACKET (1 << 9)
  737. #define HDMIB_HDCP_PORT (1 << 5)
  738. /* #define LVDS 0x61180 */
  739. #define MRST_PANEL_8TO6_DITHER_ENABLE (1 << 25)
  740. #define MRST_PANEL_24_DOT_1_FORMAT (1 << 24)
  741. #define LVDS_A3_POWER_UP_0_OUTPUT (1 << 6)
  742. #define MIPI 0x61190
  743. #define MIPI_C 0x62190
  744. #define MIPI_PORT_EN (1 << 31)
  745. /* Turns on border drawing to allow centered display. */
  746. #define SEL_FLOPPED_HSTX (1 << 23)
  747. #define PASS_FROM_SPHY_TO_AFE (1 << 16)
  748. #define MIPI_BORDER_EN (1 << 15)
  749. #define MIPIA_3LANE_MIPIC_1LANE 0x1
  750. #define MIPIA_2LANE_MIPIC_2LANE 0x2
  751. #define TE_TRIGGER_DSI_PROTOCOL (1 << 2)
  752. #define TE_TRIGGER_GPIO_PIN (1 << 3)
  753. #define MIPI_TE_COUNT 0x61194
  754. /* #define PP_CONTROL 0x61204 */
  755. #define POWER_DOWN_ON_RESET (1 << 1)
  756. /* #define PFIT_CONTROL 0x61230 */
  757. #define PFIT_PIPE_SELECT (3 << 29)
  758. #define PFIT_PIPE_SELECT_SHIFT (29)
  759. /* #define BLC_PWM_CTL 0x61254 */
  760. #define MRST_BACKLIGHT_MODULATION_FREQ_SHIFT (16)
  761. #define MRST_BACKLIGHT_MODULATION_FREQ_MASK (0xffff << 16)
  762. /* #define PIPEACONF 0x70008 */
  763. #define PIPEACONF_PIPE_STATE (1 << 30)
  764. /* #define DSPACNTR 0x70180 */
  765. #define MRST_DSPABASE 0x7019c
  766. #define MRST_DSPBBASE 0x7119c
  767. #define MDFLD_DSPCBASE 0x7219c
  768. /*
  769. * Moorestown registers.
  770. */
  771. /*
  772. * MIPI IP registers
  773. */
  774. #define MIPIC_REG_OFFSET 0x800
  775. #define DEVICE_READY_REG 0xb000
  776. #define LP_OUTPUT_HOLD (1 << 16)
  777. #define EXIT_ULPS_DEV_READY 0x3
  778. #define LP_OUTPUT_HOLD_RELEASE 0x810000
  779. # define ENTERING_ULPS (2 << 1)
  780. # define EXITING_ULPS (1 << 1)
  781. # define ULPS_MASK (3 << 1)
  782. # define BUS_POSSESSION (1 << 3)
  783. #define INTR_STAT_REG 0xb004
  784. #define RX_SOT_ERROR (1 << 0)
  785. #define RX_SOT_SYNC_ERROR (1 << 1)
  786. #define RX_ESCAPE_MODE_ENTRY_ERROR (1 << 3)
  787. #define RX_LP_TX_SYNC_ERROR (1 << 4)
  788. #define RX_HS_RECEIVE_TIMEOUT_ERROR (1 << 5)
  789. #define RX_FALSE_CONTROL_ERROR (1 << 6)
  790. #define RX_ECC_SINGLE_BIT_ERROR (1 << 7)
  791. #define RX_ECC_MULTI_BIT_ERROR (1 << 8)
  792. #define RX_CHECKSUM_ERROR (1 << 9)
  793. #define RX_DSI_DATA_TYPE_NOT_RECOGNIZED (1 << 10)
  794. #define RX_DSI_VC_ID_INVALID (1 << 11)
  795. #define TX_FALSE_CONTROL_ERROR (1 << 12)
  796. #define TX_ECC_SINGLE_BIT_ERROR (1 << 13)
  797. #define TX_ECC_MULTI_BIT_ERROR (1 << 14)
  798. #define TX_CHECKSUM_ERROR (1 << 15)
  799. #define TX_DSI_DATA_TYPE_NOT_RECOGNIZED (1 << 16)
  800. #define TX_DSI_VC_ID_INVALID (1 << 17)
  801. #define HIGH_CONTENTION (1 << 18)
  802. #define LOW_CONTENTION (1 << 19)
  803. #define DPI_FIFO_UNDER_RUN (1 << 20)
  804. #define HS_TX_TIMEOUT (1 << 21)
  805. #define LP_RX_TIMEOUT (1 << 22)
  806. #define TURN_AROUND_ACK_TIMEOUT (1 << 23)
  807. #define ACK_WITH_NO_ERROR (1 << 24)
  808. #define HS_GENERIC_WR_FIFO_FULL (1 << 27)
  809. #define LP_GENERIC_WR_FIFO_FULL (1 << 28)
  810. #define SPL_PKT_SENT (1 << 30)
  811. #define INTR_EN_REG 0xb008
  812. #define DSI_FUNC_PRG_REG 0xb00c
  813. #define DPI_CHANNEL_NUMBER_POS 0x03
  814. #define DBI_CHANNEL_NUMBER_POS 0x05
  815. #define FMT_DPI_POS 0x07
  816. #define FMT_DBI_POS 0x0A
  817. #define DBI_DATA_WIDTH_POS 0x0D
  818. /* DPI PIXEL FORMATS */
  819. #define RGB_565_FMT 0x01 /* RGB 565 FORMAT */
  820. #define RGB_666_FMT 0x02 /* RGB 666 FORMAT */
  821. #define LRGB_666_FMT 0x03 /* RGB LOOSELY PACKED
  822. * 666 FORMAT
  823. */
  824. #define RGB_888_FMT 0x04 /* RGB 888 FORMAT */
  825. #define VIRTUAL_CHANNEL_NUMBER_0 0x00 /* Virtual channel 0 */
  826. #define VIRTUAL_CHANNEL_NUMBER_1 0x01 /* Virtual channel 1 */
  827. #define VIRTUAL_CHANNEL_NUMBER_2 0x02 /* Virtual channel 2 */
  828. #define VIRTUAL_CHANNEL_NUMBER_3 0x03 /* Virtual channel 3 */
  829. #define DBI_NOT_SUPPORTED 0x00 /* command mode
  830. * is not supported
  831. */
  832. #define DBI_DATA_WIDTH_16BIT 0x01 /* 16 bit data */
  833. #define DBI_DATA_WIDTH_9BIT 0x02 /* 9 bit data */
  834. #define DBI_DATA_WIDTH_8BIT 0x03 /* 8 bit data */
  835. #define DBI_DATA_WIDTH_OPT1 0x04 /* option 1 */
  836. #define DBI_DATA_WIDTH_OPT2 0x05 /* option 2 */
  837. #define HS_TX_TIMEOUT_REG 0xb010
  838. #define LP_RX_TIMEOUT_REG 0xb014
  839. #define TURN_AROUND_TIMEOUT_REG 0xb018
  840. #define DEVICE_RESET_REG 0xb01C
  841. #define DPI_RESOLUTION_REG 0xb020
  842. #define RES_V_POS 0x10
  843. #define DBI_RESOLUTION_REG 0xb024 /* Reserved for MDFLD */
  844. #define HORIZ_SYNC_PAD_COUNT_REG 0xb028
  845. #define HORIZ_BACK_PORCH_COUNT_REG 0xb02C
  846. #define HORIZ_FRONT_PORCH_COUNT_REG 0xb030
  847. #define HORIZ_ACTIVE_AREA_COUNT_REG 0xb034
  848. #define VERT_SYNC_PAD_COUNT_REG 0xb038
  849. #define VERT_BACK_PORCH_COUNT_REG 0xb03c
  850. #define VERT_FRONT_PORCH_COUNT_REG 0xb040
  851. #define HIGH_LOW_SWITCH_COUNT_REG 0xb044
  852. #define DPI_CONTROL_REG 0xb048
  853. #define DPI_SHUT_DOWN (1 << 0)
  854. #define DPI_TURN_ON (1 << 1)
  855. #define DPI_COLOR_MODE_ON (1 << 2)
  856. #define DPI_COLOR_MODE_OFF (1 << 3)
  857. #define DPI_BACK_LIGHT_ON (1 << 4)
  858. #define DPI_BACK_LIGHT_OFF (1 << 5)
  859. #define DPI_LP (1 << 6)
  860. #define DPI_DATA_REG 0xb04c
  861. #define DPI_BACK_LIGHT_ON_DATA 0x07
  862. #define DPI_BACK_LIGHT_OFF_DATA 0x17
  863. #define INIT_COUNT_REG 0xb050
  864. #define MAX_RET_PAK_REG 0xb054
  865. #define VIDEO_FMT_REG 0xb058
  866. #define COMPLETE_LAST_PCKT (1 << 2)
  867. #define EOT_DISABLE_REG 0xb05c
  868. #define ENABLE_CLOCK_STOPPING (1 << 1)
  869. #define LP_BYTECLK_REG 0xb060
  870. #define LP_GEN_DATA_REG 0xb064
  871. #define HS_GEN_DATA_REG 0xb068
  872. #define LP_GEN_CTRL_REG 0xb06C
  873. #define HS_GEN_CTRL_REG 0xb070
  874. #define DCS_CHANNEL_NUMBER_POS 0x6
  875. #define MCS_COMMANDS_POS 0x8
  876. #define WORD_COUNTS_POS 0x8
  877. #define MCS_PARAMETER_POS 0x10
  878. #define GEN_FIFO_STAT_REG 0xb074
  879. #define HS_DATA_FIFO_FULL (1 << 0)
  880. #define HS_DATA_FIFO_HALF_EMPTY (1 << 1)
  881. #define HS_DATA_FIFO_EMPTY (1 << 2)
  882. #define LP_DATA_FIFO_FULL (1 << 8)
  883. #define LP_DATA_FIFO_HALF_EMPTY (1 << 9)
  884. #define LP_DATA_FIFO_EMPTY (1 << 10)
  885. #define HS_CTRL_FIFO_FULL (1 << 16)
  886. #define HS_CTRL_FIFO_HALF_EMPTY (1 << 17)
  887. #define HS_CTRL_FIFO_EMPTY (1 << 18)
  888. #define LP_CTRL_FIFO_FULL (1 << 24)
  889. #define LP_CTRL_FIFO_HALF_EMPTY (1 << 25)
  890. #define LP_CTRL_FIFO_EMPTY (1 << 26)
  891. #define DBI_FIFO_EMPTY (1 << 27)
  892. #define DPI_FIFO_EMPTY (1 << 28)
  893. #define HS_LS_DBI_ENABLE_REG 0xb078
  894. #define TXCLKESC_REG 0xb07c
  895. #define DPHY_PARAM_REG 0xb080
  896. #define DBI_BW_CTRL_REG 0xb084
  897. #define CLK_LANE_SWT_REG 0xb088
  898. /*
  899. * MIPI Adapter registers
  900. */
  901. #define MIPI_CONTROL_REG 0xb104
  902. #define MIPI_2X_CLOCK_BITS ((1 << 0) | (1 << 1))
  903. #define MIPI_DATA_ADDRESS_REG 0xb108
  904. #define MIPI_DATA_LENGTH_REG 0xb10C
  905. #define MIPI_COMMAND_ADDRESS_REG 0xb110
  906. #define MIPI_COMMAND_LENGTH_REG 0xb114
  907. #define MIPI_READ_DATA_RETURN_REG0 0xb118
  908. #define MIPI_READ_DATA_RETURN_REG1 0xb11C
  909. #define MIPI_READ_DATA_RETURN_REG2 0xb120
  910. #define MIPI_READ_DATA_RETURN_REG3 0xb124
  911. #define MIPI_READ_DATA_RETURN_REG4 0xb128
  912. #define MIPI_READ_DATA_RETURN_REG5 0xb12C
  913. #define MIPI_READ_DATA_RETURN_REG6 0xb130
  914. #define MIPI_READ_DATA_RETURN_REG7 0xb134
  915. #define MIPI_READ_DATA_VALID_REG 0xb138
  916. /* DBI COMMANDS */
  917. #define soft_reset 0x01
  918. /*
  919. * The display module performs a software reset.
  920. * Registers are written with their SW Reset default values.
  921. */
  922. #define get_power_mode 0x0a
  923. /*
  924. * The display module returns the current power mode
  925. */
  926. #define get_address_mode 0x0b
  927. /*
  928. * The display module returns the current status.
  929. */
  930. #define get_pixel_format 0x0c
  931. /*
  932. * This command gets the pixel format for the RGB image data
  933. * used by the interface.
  934. */
  935. #define get_display_mode 0x0d
  936. /*
  937. * The display module returns the Display Image Mode status.
  938. */
  939. #define get_signal_mode 0x0e
  940. /*
  941. * The display module returns the Display Signal Mode.
  942. */
  943. #define get_diagnostic_result 0x0f
  944. /*
  945. * The display module returns the self-diagnostic results following
  946. * a Sleep Out command.
  947. */
  948. #define enter_sleep_mode 0x10
  949. /*
  950. * This command causes the display module to enter the Sleep mode.
  951. * In this mode, all unnecessary blocks inside the display module are
  952. * disabled except interface communication. This is the lowest power
  953. * mode the display module supports.
  954. */
  955. #define exit_sleep_mode 0x11
  956. /*
  957. * This command causes the display module to exit Sleep mode.
  958. * All blocks inside the display module are enabled.
  959. */
  960. #define enter_partial_mode 0x12
  961. /*
  962. * This command causes the display module to enter the Partial Display
  963. * Mode. The Partial Display Mode window is described by the
  964. * set_partial_area command.
  965. */
  966. #define enter_normal_mode 0x13
  967. /*
  968. * This command causes the display module to enter the Normal mode.
  969. * Normal Mode is defined as Partial Display mode and Scroll mode are off
  970. */
  971. #define exit_invert_mode 0x20
  972. /*
  973. * This command causes the display module to stop inverting the image
  974. * data on the display device. The frame memory contents remain unchanged.
  975. * No status bits are changed.
  976. */
  977. #define enter_invert_mode 0x21
  978. /*
  979. * This command causes the display module to invert the image data only on
  980. * the display device. The frame memory contents remain unchanged.
  981. * No status bits are changed.
  982. */
  983. #define set_gamma_curve 0x26
  984. /*
  985. * This command selects the desired gamma curve for the display device.
  986. * Four fixed gamma curves are defined in section DCS spec.
  987. */
  988. #define set_display_off 0x28
  989. /* ************************************************************************* *\
  990. This command causes the display module to stop displaying the image data
  991. on the display device. The frame memory contents remain unchanged.
  992. No status bits are changed.
  993. \* ************************************************************************* */
  994. #define set_display_on 0x29
  995. /* ************************************************************************* *\
  996. This command causes the display module to start displaying the image data
  997. on the display device. The frame memory contents remain unchanged.
  998. No status bits are changed.
  999. \* ************************************************************************* */
  1000. #define set_column_address 0x2a
  1001. /*
  1002. * This command defines the column extent of the frame memory accessed by
  1003. * the hostprocessor with the read_memory_continue and
  1004. * write_memory_continue commands.
  1005. * No status bits are changed.
  1006. */
  1007. #define set_page_addr 0x2b
  1008. /*
  1009. * This command defines the page extent of the frame memory accessed by
  1010. * the host processor with the write_memory_continue and
  1011. * read_memory_continue command.
  1012. * No status bits are changed.
  1013. */
  1014. #define write_mem_start 0x2c
  1015. /*
  1016. * This command transfers image data from the host processor to the
  1017. * display modules frame memory starting at the pixel location specified
  1018. * by preceding set_column_address and set_page_address commands.
  1019. */
  1020. #define set_partial_area 0x30
  1021. /*
  1022. * This command defines the Partial Display mode s display area.
  1023. * There are two parameters associated with this command, the first
  1024. * defines the Start Row (SR) and the second the End Row (ER). SR and ER
  1025. * refer to the Frame Memory Line Pointer.
  1026. */
  1027. #define set_scroll_area 0x33
  1028. /*
  1029. * This command defines the display modules Vertical Scrolling Area.
  1030. */
  1031. #define set_tear_off 0x34
  1032. /*
  1033. * This command turns off the display modules Tearing Effect output
  1034. * signal on the TE signal line.
  1035. */
  1036. #define set_tear_on 0x35
  1037. /*
  1038. * This command turns on the display modules Tearing Effect output signal
  1039. * on the TE signal line.
  1040. */
  1041. #define set_address_mode 0x36
  1042. /*
  1043. * This command sets the data order for transfers from the host processor
  1044. * to display modules frame memory,bits B[7:5] and B3, and from the
  1045. * display modules frame memory to the display device, bits B[2:0] and B4.
  1046. */
  1047. #define set_scroll_start 0x37
  1048. /*
  1049. * This command sets the start of the vertical scrolling area in the frame
  1050. * memory. The vertical scrolling area is fully defined when this command
  1051. * is used with the set_scroll_area command The set_scroll_start command
  1052. * has one parameter, the Vertical Scroll Pointer. The VSP defines the
  1053. * line in the frame memory that is written to the display device as the
  1054. * first line of the vertical scroll area.
  1055. */
  1056. #define exit_idle_mode 0x38
  1057. /*
  1058. * This command causes the display module to exit Idle mode.
  1059. */
  1060. #define enter_idle_mode 0x39
  1061. /*
  1062. * This command causes the display module to enter Idle Mode.
  1063. * In Idle Mode, color expression is reduced. Colors are shown on the
  1064. * display device using the MSB of each of the R, G and B color
  1065. * components in the frame memory
  1066. */
  1067. #define set_pixel_format 0x3a
  1068. /*
  1069. * This command sets the pixel format for the RGB image data used by the
  1070. * interface.
  1071. * Bits D[6:4] DPI Pixel Format Definition
  1072. * Bits D[2:0] DBI Pixel Format Definition
  1073. * Bits D7 and D3 are not used.
  1074. */
  1075. #define DCS_PIXEL_FORMAT_3bpp 0x1
  1076. #define DCS_PIXEL_FORMAT_8bpp 0x2
  1077. #define DCS_PIXEL_FORMAT_12bpp 0x3
  1078. #define DCS_PIXEL_FORMAT_16bpp 0x5
  1079. #define DCS_PIXEL_FORMAT_18bpp 0x6
  1080. #define DCS_PIXEL_FORMAT_24bpp 0x7
  1081. #define write_mem_cont 0x3c
  1082. /*
  1083. * This command transfers image data from the host processor to the
  1084. * display module's frame memory continuing from the pixel location
  1085. * following the previous write_memory_continue or write_memory_start
  1086. * command.
  1087. */
  1088. #define set_tear_scanline 0x44
  1089. /*
  1090. * This command turns on the display modules Tearing Effect output signal
  1091. * on the TE signal line when the display module reaches line N.
  1092. */
  1093. #define get_scanline 0x45
  1094. /*
  1095. * The display module returns the current scanline, N, used to update the
  1096. * display device. The total number of scanlines on a display device is
  1097. * defined as VSYNC + VBP + VACT + VFP.The first scanline is defined as
  1098. * the first line of V Sync and is denoted as Line 0.
  1099. * When in Sleep Mode, the value returned by get_scanline is undefined.
  1100. */
  1101. /* MCS or Generic COMMANDS */
  1102. /* MCS/generic data type */
  1103. #define GEN_SHORT_WRITE_0 0x03 /* generic short write, no parameters */
  1104. #define GEN_SHORT_WRITE_1 0x13 /* generic short write, 1 parameters */
  1105. #define GEN_SHORT_WRITE_2 0x23 /* generic short write, 2 parameters */
  1106. #define GEN_READ_0 0x04 /* generic read, no parameters */
  1107. #define GEN_READ_1 0x14 /* generic read, 1 parameters */
  1108. #define GEN_READ_2 0x24 /* generic read, 2 parameters */
  1109. #define GEN_LONG_WRITE 0x29 /* generic long write */
  1110. #define MCS_SHORT_WRITE_0 0x05 /* MCS short write, no parameters */
  1111. #define MCS_SHORT_WRITE_1 0x15 /* MCS short write, 1 parameters */
  1112. #define MCS_READ 0x06 /* MCS read, no parameters */
  1113. #define MCS_LONG_WRITE 0x39 /* MCS long write */
  1114. /* MCS/generic commands */
  1115. /* TPO MCS */
  1116. #define write_display_profile 0x50
  1117. #define write_display_brightness 0x51
  1118. #define write_ctrl_display 0x53
  1119. #define write_ctrl_cabc 0x55
  1120. #define UI_IMAGE 0x01
  1121. #define STILL_IMAGE 0x02
  1122. #define MOVING_IMAGE 0x03
  1123. #define write_hysteresis 0x57
  1124. #define write_gamma_setting 0x58
  1125. #define write_cabc_min_bright 0x5e
  1126. #define write_kbbc_profile 0x60
  1127. /* TMD MCS */
  1128. #define tmd_write_display_brightness 0x8c
  1129. /*
  1130. * This command is used to control ambient light, panel backlight
  1131. * brightness and gamma settings.
  1132. */
  1133. #define BRIGHT_CNTL_BLOCK_ON (1 << 5)
  1134. #define AMBIENT_LIGHT_SENSE_ON (1 << 4)
  1135. #define DISPLAY_DIMMING_ON (1 << 3)
  1136. #define BACKLIGHT_ON (1 << 2)
  1137. #define DISPLAY_BRIGHTNESS_AUTO (1 << 1)
  1138. #define GAMMA_AUTO (1 << 0)
  1139. /* DCS Interface Pixel Formats */
  1140. #define DCS_PIXEL_FORMAT_3BPP 0x1
  1141. #define DCS_PIXEL_FORMAT_8BPP 0x2
  1142. #define DCS_PIXEL_FORMAT_12BPP 0x3
  1143. #define DCS_PIXEL_FORMAT_16BPP 0x5
  1144. #define DCS_PIXEL_FORMAT_18BPP 0x6
  1145. #define DCS_PIXEL_FORMAT_24BPP 0x7
  1146. /* ONE PARAMETER READ DATA */
  1147. #define addr_mode_data 0xfc
  1148. #define diag_res_data 0x00
  1149. #define disp_mode_data 0x23
  1150. #define pxl_fmt_data 0x77
  1151. #define pwr_mode_data 0x74
  1152. #define sig_mode_data 0x00
  1153. /* TWO PARAMETERS READ DATA */
  1154. #define scanline_data1 0xff
  1155. #define scanline_data2 0xff
  1156. #define NON_BURST_MODE_SYNC_PULSE 0x01 /* Non Burst Mode
  1157. * with Sync Pulse
  1158. */
  1159. #define NON_BURST_MODE_SYNC_EVENTS 0x02 /* Non Burst Mode
  1160. * with Sync events
  1161. */
  1162. #define BURST_MODE 0x03 /* Burst Mode */
  1163. #define DBI_COMMAND_BUFFER_SIZE 0x240 /* 0x32 */ /* 0x120 */
  1164. /* Allocate at least
  1165. * 0x100 Byte with 32
  1166. * byte alignment
  1167. */
  1168. #define DBI_DATA_BUFFER_SIZE 0x120 /* Allocate at least
  1169. * 0x100 Byte with 32
  1170. * byte alignment
  1171. */
  1172. #define DBI_CB_TIME_OUT 0xFFFF
  1173. #define GEN_FB_TIME_OUT 2000
  1174. #define SKU_83 0x01
  1175. #define SKU_100 0x02
  1176. #define SKU_100L 0x04
  1177. #define SKU_BYPASS 0x08
  1178. /* Some handy macros for playing with bitfields. */
  1179. #define PSB_MASK(high, low) (((1<<((high)-(low)+1))-1)<<(low))
  1180. #define SET_FIELD(value, field) (((value) << field ## _SHIFT) & field ## _MASK)
  1181. #define GET_FIELD(word, field) (((word) & field ## _MASK) >> field ## _SHIFT)
  1182. #define _PIPE(pipe, a, b) ((a) + (pipe)*((b)-(a)))
  1183. /* PCI config space */
  1184. #define SB_PCKT 0x02100 /* cedarview */
  1185. # define SB_OPCODE_MASK PSB_MASK(31, 16)
  1186. # define SB_OPCODE_SHIFT 16
  1187. # define SB_OPCODE_READ 0
  1188. # define SB_OPCODE_WRITE 1
  1189. # define SB_DEST_MASK PSB_MASK(15, 8)
  1190. # define SB_DEST_SHIFT 8
  1191. # define SB_DEST_DPLL 0x88
  1192. # define SB_BYTE_ENABLE_MASK PSB_MASK(7, 4)
  1193. # define SB_BYTE_ENABLE_SHIFT 4
  1194. # define SB_BUSY (1 << 0)
  1195. #define DSPCLK_GATE_D 0x6200
  1196. # define VRHUNIT_CLOCK_GATE_DISABLE (1 << 28) /* Fixed value on CDV */
  1197. # define DPOUNIT_CLOCK_GATE_DISABLE (1 << 11)
  1198. # define DPIOUNIT_CLOCK_GATE_DISABLE (1 << 6)
  1199. #define RAMCLK_GATE_D 0x6210
  1200. /* 32-bit value read/written from the DPIO reg. */
  1201. #define SB_DATA 0x02104 /* cedarview */
  1202. /* 32-bit address of the DPIO reg to be read/written. */
  1203. #define SB_ADDR 0x02108 /* cedarview */
  1204. #define DPIO_CFG 0x02110 /* cedarview */
  1205. # define DPIO_MODE_SELECT_1 (1 << 3)
  1206. # define DPIO_MODE_SELECT_0 (1 << 2)
  1207. # define DPIO_SFR_BYPASS (1 << 1)
  1208. /* reset is active low */
  1209. # define DPIO_CMN_RESET_N (1 << 0)
  1210. /* Cedarview sideband registers */
  1211. #define _SB_M_A 0x8008
  1212. #define _SB_M_B 0x8028
  1213. #define SB_M(pipe) _PIPE(pipe, _SB_M_A, _SB_M_B)
  1214. # define SB_M_DIVIDER_MASK (0xFF << 24)
  1215. # define SB_M_DIVIDER_SHIFT 24
  1216. #define _SB_N_VCO_A 0x8014
  1217. #define _SB_N_VCO_B 0x8034
  1218. #define SB_N_VCO(pipe) _PIPE(pipe, _SB_N_VCO_A, _SB_N_VCO_B)
  1219. #define SB_N_VCO_SEL_MASK PSB_MASK(31, 30)
  1220. #define SB_N_VCO_SEL_SHIFT 30
  1221. #define SB_N_DIVIDER_MASK PSB_MASK(29, 26)
  1222. #define SB_N_DIVIDER_SHIFT 26
  1223. #define SB_N_CB_TUNE_MASK PSB_MASK(25, 24)
  1224. #define SB_N_CB_TUNE_SHIFT 24
  1225. /* the bit 14:13 is used to select between the different reference clock for Pipe A/B */
  1226. #define SB_REF_DPLLA 0x8010
  1227. #define SB_REF_DPLLB 0x8030
  1228. #define REF_CLK_MASK (0x3 << 13)
  1229. #define REF_CLK_CORE (0 << 13)
  1230. #define REF_CLK_DPLL (1 << 13)
  1231. #define REF_CLK_DPLLA (2 << 13)
  1232. /* For the DPLL B, it will use the reference clk from DPLL A when using (2 << 13) */
  1233. #define _SB_REF_A 0x8018
  1234. #define _SB_REF_B 0x8038
  1235. #define SB_REF_SFR(pipe) _PIPE(pipe, _SB_REF_A, _SB_REF_B)
  1236. #define _SB_P_A 0x801c
  1237. #define _SB_P_B 0x803c
  1238. #define SB_P(pipe) _PIPE(pipe, _SB_P_A, _SB_P_B)
  1239. #define SB_P2_DIVIDER_MASK PSB_MASK(31, 30)
  1240. #define SB_P2_DIVIDER_SHIFT 30
  1241. #define SB_P2_10 0 /* HDMI, DP, DAC */
  1242. #define SB_P2_5 1 /* DAC */
  1243. #define SB_P2_14 2 /* LVDS single */
  1244. #define SB_P2_7 3 /* LVDS double */
  1245. #define SB_P1_DIVIDER_MASK PSB_MASK(15, 12)
  1246. #define SB_P1_DIVIDER_SHIFT 12
  1247. #define PSB_LANE0 0x120
  1248. #define PSB_LANE1 0x220
  1249. #define PSB_LANE2 0x2320
  1250. #define PSB_LANE3 0x2420
  1251. #define LANE_PLL_MASK (0x7 << 20)
  1252. #define LANE_PLL_ENABLE (0x3 << 20)
  1253. #define LANE_PLL_PIPE(p) (((p) == 0) ? (1 << 21) : (0 << 21))
  1254. #endif