drxd_firm.c 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * drxd_firm.c : DRXD firmware tables
  4. *
  5. * Copyright (C) 2006-2007 Micronas
  6. */
  7. /* TODO: generate this file with a script from a settings file */
  8. /* Contains A2 firmware version: 1.4.2
  9. * Contains B1 firmware version: 3.3.33
  10. * Contains settings from driver 1.4.23
  11. */
  12. #include "drxd_firm.h"
  13. #define ADDRESS(x) ((x) & 0xFF), (((x)>>8) & 0xFF), (((x)>>16) & 0xFF), (((x)>>24) & 0xFF)
  14. #define LENGTH(x) ((x) & 0xFF), (((x)>>8) & 0xFF)
  15. /* Is written via block write, must be little endian */
  16. #define DATA16(x) ((x) & 0xFF), (((x)>>8) & 0xFF)
  17. #define WRBLOCK(a, l) ADDRESS(a), LENGTH(l)
  18. #define WR16(a, d) ADDRESS(a), LENGTH(1), DATA16(d)
  19. #define END_OF_TABLE 0xFF, 0xFF, 0xFF, 0xFF
  20. /* HI firmware patches */
  21. #define HI_TR_FUNC_ADDR HI_IF_RAM_USR_BEGIN__A
  22. #define HI_TR_FUNC_SIZE 9 /* size of this function in instruction words */
  23. u8 DRXD_InitAtomicRead[] = {
  24. WRBLOCK(HI_TR_FUNC_ADDR, HI_TR_FUNC_SIZE),
  25. 0x26, 0x00, /* 0 -> ring.rdy; */
  26. 0x60, 0x04, /* r0rami.dt -> ring.xba; */
  27. 0x61, 0x04, /* r0rami.dt -> ring.xad; */
  28. 0xE3, 0x07, /* HI_RA_RAM_USR_BEGIN -> ring.iad; */
  29. 0x40, 0x00, /* (long immediate) */
  30. 0x64, 0x04, /* r0rami.dt -> ring.len; */
  31. 0x65, 0x04, /* r0rami.dt -> ring.ctl; */
  32. 0x26, 0x00, /* 0 -> ring.rdy; */
  33. 0x38, 0x00, /* 0 -> jumps.ad; */
  34. END_OF_TABLE
  35. };
  36. /* Pins D0 and D1 of the parallel MPEG output can be used
  37. to set the I2C address of a device. */
  38. #define HI_RST_FUNC_ADDR (HI_IF_RAM_USR_BEGIN__A + HI_TR_FUNC_SIZE)
  39. #define HI_RST_FUNC_SIZE 54 /* size of this function in instruction words */
  40. /* D0 Version */
  41. u8 DRXD_HiI2cPatch_1[] = {
  42. WRBLOCK(HI_RST_FUNC_ADDR, HI_RST_FUNC_SIZE),
  43. 0xC8, 0x07, 0x01, 0x00, /* MASK -> reg0.dt; */
  44. 0xE0, 0x07, 0x15, 0x02, /* (EC__BLK << 6) + EC_OC_REG__BNK -> ring.xba; */
  45. 0xE1, 0x07, 0x12, 0x00, /* EC_OC_REG_OC_MPG_SIO__A -> ring.xad; */
  46. 0xA2, 0x00, /* M_BNK_ID_DAT -> ring.iba; */
  47. 0x23, 0x00, /* &data -> ring.iad; */
  48. 0x24, 0x00, /* 0 -> ring.len; */
  49. 0xA5, 0x02, /* M_RC_CTR_SWAP | M_RC_CTR_READ -> ring.ctl; */
  50. 0x26, 0x00, /* 0 -> ring.rdy; */
  51. 0x42, 0x00, /* &data+1 -> w0ram.ad; */
  52. 0xC0, 0x07, 0xFF, 0x0F, /* -1 -> w0ram.dt; */
  53. 0x63, 0x00, /* &data+1 -> ring.iad; */
  54. 0x65, 0x02, /* M_RC_CTR_SWAP | M_RC_CTR_WRITE -> ring.ctl; */
  55. 0x26, 0x00, /* 0 -> ring.rdy; */
  56. 0xE1, 0x07, 0x38, 0x00, /* EC_OC_REG_OCR_MPG_USR_DAT__A -> ring.xad; */
  57. 0xA5, 0x02, /* M_RC_CTR_SWAP | M_RC_CTR_READ -> ring.ctl; */
  58. 0x26, 0x00, /* 0 -> ring.rdy; */
  59. 0xE1, 0x07, 0x12, 0x00, /* EC_OC_REG_OC_MPG_SIO__A -> ring.xad; */
  60. 0x23, 0x00, /* &data -> ring.iad; */
  61. 0x65, 0x02, /* M_RC_CTR_SWAP | M_RC_CTR_WRITE -> ring.ctl; */
  62. 0x26, 0x00, /* 0 -> ring.rdy; */
  63. 0x42, 0x00, /* &data+1 -> w0ram.ad; */
  64. 0x0F, 0x04, /* r0ram.dt -> and.op; */
  65. 0x1C, 0x06, /* reg0.dt -> and.tr; */
  66. 0xCF, 0x04, /* and.rs -> add.op; */
  67. 0xD0, 0x07, 0x70, 0x00, /* DEF_DEV_ID -> add.tr; */
  68. 0xD0, 0x04, /* add.rs -> add.tr; */
  69. 0xC8, 0x04, /* add.rs -> reg0.dt; */
  70. 0x60, 0x00, /* reg0.dt -> w0ram.dt; */
  71. 0xC2, 0x07, 0x10, 0x00, /* SLV0_BASE -> w0rami.ad; */
  72. 0x01, 0x00, /* 0 -> w0rami.dt; */
  73. 0x01, 0x06, /* reg0.dt -> w0rami.dt; */
  74. 0xC2, 0x07, 0x20, 0x00, /* SLV1_BASE -> w0rami.ad; */
  75. 0x01, 0x00, /* 0 -> w0rami.dt; */
  76. 0x01, 0x06, /* reg0.dt -> w0rami.dt; */
  77. 0xC2, 0x07, 0x30, 0x00, /* CMD_BASE -> w0rami.ad; */
  78. 0x01, 0x00, /* 0 -> w0rami.dt; */
  79. 0x01, 0x00, /* 0 -> w0rami.dt; */
  80. 0x01, 0x00, /* 0 -> w0rami.dt; */
  81. 0x68, 0x00, /* M_IC_SEL_PT1 -> i2c.sel; */
  82. 0x29, 0x00, /* M_IC_CMD_RESET -> i2c.cmd; */
  83. 0x28, 0x00, /* M_IC_SEL_PT0 -> i2c.sel; */
  84. 0x29, 0x00, /* M_IC_CMD_RESET -> i2c.cmd; */
  85. 0xF8, 0x07, 0x2F, 0x00, /* 0x2F -> jumps.ad; */
  86. WR16((B_HI_IF_RAM_TRP_BPT0__AX + ((2 * 0) + 1)),
  87. (u16) (HI_RST_FUNC_ADDR & 0x3FF)),
  88. WR16((B_HI_IF_RAM_TRP_BPT0__AX + ((2 * 1) + 1)),
  89. (u16) (HI_RST_FUNC_ADDR & 0x3FF)),
  90. WR16((B_HI_IF_RAM_TRP_BPT0__AX + ((2 * 2) + 1)),
  91. (u16) (HI_RST_FUNC_ADDR & 0x3FF)),
  92. WR16((B_HI_IF_RAM_TRP_BPT0__AX + ((2 * 3) + 1)),
  93. (u16) (HI_RST_FUNC_ADDR & 0x3FF)),
  94. /* Force quick and dirty reset */
  95. WR16(B_HI_CT_REG_COMM_STATE__A, 0),
  96. END_OF_TABLE
  97. };
  98. /* D0,D1 Version */
  99. u8 DRXD_HiI2cPatch_3[] = {
  100. WRBLOCK(HI_RST_FUNC_ADDR, HI_RST_FUNC_SIZE),
  101. 0xC8, 0x07, 0x03, 0x00, /* MASK -> reg0.dt; */
  102. 0xE0, 0x07, 0x15, 0x02, /* (EC__BLK << 6) + EC_OC_REG__BNK -> ring.xba; */
  103. 0xE1, 0x07, 0x12, 0x00, /* EC_OC_REG_OC_MPG_SIO__A -> ring.xad; */
  104. 0xA2, 0x00, /* M_BNK_ID_DAT -> ring.iba; */
  105. 0x23, 0x00, /* &data -> ring.iad; */
  106. 0x24, 0x00, /* 0 -> ring.len; */
  107. 0xA5, 0x02, /* M_RC_CTR_SWAP | M_RC_CTR_READ -> ring.ctl; */
  108. 0x26, 0x00, /* 0 -> ring.rdy; */
  109. 0x42, 0x00, /* &data+1 -> w0ram.ad; */
  110. 0xC0, 0x07, 0xFF, 0x0F, /* -1 -> w0ram.dt; */
  111. 0x63, 0x00, /* &data+1 -> ring.iad; */
  112. 0x65, 0x02, /* M_RC_CTR_SWAP | M_RC_CTR_WRITE -> ring.ctl; */
  113. 0x26, 0x00, /* 0 -> ring.rdy; */
  114. 0xE1, 0x07, 0x38, 0x00, /* EC_OC_REG_OCR_MPG_USR_DAT__A -> ring.xad; */
  115. 0xA5, 0x02, /* M_RC_CTR_SWAP | M_RC_CTR_READ -> ring.ctl; */
  116. 0x26, 0x00, /* 0 -> ring.rdy; */
  117. 0xE1, 0x07, 0x12, 0x00, /* EC_OC_REG_OC_MPG_SIO__A -> ring.xad; */
  118. 0x23, 0x00, /* &data -> ring.iad; */
  119. 0x65, 0x02, /* M_RC_CTR_SWAP | M_RC_CTR_WRITE -> ring.ctl; */
  120. 0x26, 0x00, /* 0 -> ring.rdy; */
  121. 0x42, 0x00, /* &data+1 -> w0ram.ad; */
  122. 0x0F, 0x04, /* r0ram.dt -> and.op; */
  123. 0x1C, 0x06, /* reg0.dt -> and.tr; */
  124. 0xCF, 0x04, /* and.rs -> add.op; */
  125. 0xD0, 0x07, 0x70, 0x00, /* DEF_DEV_ID -> add.tr; */
  126. 0xD0, 0x04, /* add.rs -> add.tr; */
  127. 0xC8, 0x04, /* add.rs -> reg0.dt; */
  128. 0x60, 0x00, /* reg0.dt -> w0ram.dt; */
  129. 0xC2, 0x07, 0x10, 0x00, /* SLV0_BASE -> w0rami.ad; */
  130. 0x01, 0x00, /* 0 -> w0rami.dt; */
  131. 0x01, 0x06, /* reg0.dt -> w0rami.dt; */
  132. 0xC2, 0x07, 0x20, 0x00, /* SLV1_BASE -> w0rami.ad; */
  133. 0x01, 0x00, /* 0 -> w0rami.dt; */
  134. 0x01, 0x06, /* reg0.dt -> w0rami.dt; */
  135. 0xC2, 0x07, 0x30, 0x00, /* CMD_BASE -> w0rami.ad; */
  136. 0x01, 0x00, /* 0 -> w0rami.dt; */
  137. 0x01, 0x00, /* 0 -> w0rami.dt; */
  138. 0x01, 0x00, /* 0 -> w0rami.dt; */
  139. 0x68, 0x00, /* M_IC_SEL_PT1 -> i2c.sel; */
  140. 0x29, 0x00, /* M_IC_CMD_RESET -> i2c.cmd; */
  141. 0x28, 0x00, /* M_IC_SEL_PT0 -> i2c.sel; */
  142. 0x29, 0x00, /* M_IC_CMD_RESET -> i2c.cmd; */
  143. 0xF8, 0x07, 0x2F, 0x00, /* 0x2F -> jumps.ad; */
  144. WR16((B_HI_IF_RAM_TRP_BPT0__AX + ((2 * 0) + 1)),
  145. (u16) (HI_RST_FUNC_ADDR & 0x3FF)),
  146. WR16((B_HI_IF_RAM_TRP_BPT0__AX + ((2 * 1) + 1)),
  147. (u16) (HI_RST_FUNC_ADDR & 0x3FF)),
  148. WR16((B_HI_IF_RAM_TRP_BPT0__AX + ((2 * 2) + 1)),
  149. (u16) (HI_RST_FUNC_ADDR & 0x3FF)),
  150. WR16((B_HI_IF_RAM_TRP_BPT0__AX + ((2 * 3) + 1)),
  151. (u16) (HI_RST_FUNC_ADDR & 0x3FF)),
  152. /* Force quick and dirty reset */
  153. WR16(B_HI_CT_REG_COMM_STATE__A, 0),
  154. END_OF_TABLE
  155. };
  156. u8 DRXD_ResetCEFR[] = {
  157. WRBLOCK(CE_REG_FR_TREAL00__A, 57),
  158. 0x52, 0x00, /* CE_REG_FR_TREAL00__A */
  159. 0x00, 0x00, /* CE_REG_FR_TIMAG00__A */
  160. 0x52, 0x00, /* CE_REG_FR_TREAL01__A */
  161. 0x00, 0x00, /* CE_REG_FR_TIMAG01__A */
  162. 0x52, 0x00, /* CE_REG_FR_TREAL02__A */
  163. 0x00, 0x00, /* CE_REG_FR_TIMAG02__A */
  164. 0x52, 0x00, /* CE_REG_FR_TREAL03__A */
  165. 0x00, 0x00, /* CE_REG_FR_TIMAG03__A */
  166. 0x52, 0x00, /* CE_REG_FR_TREAL04__A */
  167. 0x00, 0x00, /* CE_REG_FR_TIMAG04__A */
  168. 0x52, 0x00, /* CE_REG_FR_TREAL05__A */
  169. 0x00, 0x00, /* CE_REG_FR_TIMAG05__A */
  170. 0x52, 0x00, /* CE_REG_FR_TREAL06__A */
  171. 0x00, 0x00, /* CE_REG_FR_TIMAG06__A */
  172. 0x52, 0x00, /* CE_REG_FR_TREAL07__A */
  173. 0x00, 0x00, /* CE_REG_FR_TIMAG07__A */
  174. 0x52, 0x00, /* CE_REG_FR_TREAL08__A */
  175. 0x00, 0x00, /* CE_REG_FR_TIMAG08__A */
  176. 0x52, 0x00, /* CE_REG_FR_TREAL09__A */
  177. 0x00, 0x00, /* CE_REG_FR_TIMAG09__A */
  178. 0x52, 0x00, /* CE_REG_FR_TREAL10__A */
  179. 0x00, 0x00, /* CE_REG_FR_TIMAG10__A */
  180. 0x52, 0x00, /* CE_REG_FR_TREAL11__A */
  181. 0x00, 0x00, /* CE_REG_FR_TIMAG11__A */
  182. 0x52, 0x00, /* CE_REG_FR_MID_TAP__A */
  183. 0x0B, 0x00, /* CE_REG_FR_SQS_G00__A */
  184. 0x0B, 0x00, /* CE_REG_FR_SQS_G01__A */
  185. 0x0B, 0x00, /* CE_REG_FR_SQS_G02__A */
  186. 0x0B, 0x00, /* CE_REG_FR_SQS_G03__A */
  187. 0x0B, 0x00, /* CE_REG_FR_SQS_G04__A */
  188. 0x0B, 0x00, /* CE_REG_FR_SQS_G05__A */
  189. 0x0B, 0x00, /* CE_REG_FR_SQS_G06__A */
  190. 0x0B, 0x00, /* CE_REG_FR_SQS_G07__A */
  191. 0x0B, 0x00, /* CE_REG_FR_SQS_G08__A */
  192. 0x0B, 0x00, /* CE_REG_FR_SQS_G09__A */
  193. 0x0B, 0x00, /* CE_REG_FR_SQS_G10__A */
  194. 0x0B, 0x00, /* CE_REG_FR_SQS_G11__A */
  195. 0x0B, 0x00, /* CE_REG_FR_SQS_G12__A */
  196. 0xFF, 0x01, /* CE_REG_FR_RIO_G00__A */
  197. 0x90, 0x01, /* CE_REG_FR_RIO_G01__A */
  198. 0x0B, 0x01, /* CE_REG_FR_RIO_G02__A */
  199. 0xC8, 0x00, /* CE_REG_FR_RIO_G03__A */
  200. 0xA0, 0x00, /* CE_REG_FR_RIO_G04__A */
  201. 0x85, 0x00, /* CE_REG_FR_RIO_G05__A */
  202. 0x72, 0x00, /* CE_REG_FR_RIO_G06__A */
  203. 0x64, 0x00, /* CE_REG_FR_RIO_G07__A */
  204. 0x59, 0x00, /* CE_REG_FR_RIO_G08__A */
  205. 0x50, 0x00, /* CE_REG_FR_RIO_G09__A */
  206. 0x49, 0x00, /* CE_REG_FR_RIO_G10__A */
  207. 0x10, 0x00, /* CE_REG_FR_MODE__A */
  208. 0x78, 0x00, /* CE_REG_FR_SQS_TRH__A */
  209. 0x00, 0x00, /* CE_REG_FR_RIO_GAIN__A */
  210. 0x00, 0x02, /* CE_REG_FR_BYPASS__A */
  211. 0x0D, 0x00, /* CE_REG_FR_PM_SET__A */
  212. 0x07, 0x00, /* CE_REG_FR_ERR_SH__A */
  213. 0x04, 0x00, /* CE_REG_FR_MAN_SH__A */
  214. 0x06, 0x00, /* CE_REG_FR_TAP_SH__A */
  215. END_OF_TABLE
  216. };
  217. u8 DRXD_InitFEA2_1[] = {
  218. WRBLOCK(FE_AD_REG_PD__A, 3),
  219. 0x00, 0x00, /* FE_AD_REG_PD__A */
  220. 0x01, 0x00, /* FE_AD_REG_INVEXT__A */
  221. 0x00, 0x00, /* FE_AD_REG_CLKNEG__A */
  222. WRBLOCK(FE_AG_REG_DCE_AUR_CNT__A, 2),
  223. 0x10, 0x00, /* FE_AG_REG_DCE_AUR_CNT__A */
  224. 0x10, 0x00, /* FE_AG_REG_DCE_RUR_CNT__A */
  225. WRBLOCK(FE_AG_REG_ACE_AUR_CNT__A, 2),
  226. 0x0E, 0x00, /* FE_AG_REG_ACE_AUR_CNT__A */
  227. 0x00, 0x00, /* FE_AG_REG_ACE_RUR_CNT__A */
  228. WRBLOCK(FE_AG_REG_EGC_FLA_RGN__A, 5),
  229. 0x04, 0x00, /* FE_AG_REG_EGC_FLA_RGN__A */
  230. 0x1F, 0x00, /* FE_AG_REG_EGC_SLO_RGN__A */
  231. 0x00, 0x00, /* FE_AG_REG_EGC_JMP_PSN__A */
  232. 0x00, 0x00, /* FE_AG_REG_EGC_FLA_INC__A */
  233. 0x00, 0x00, /* FE_AG_REG_EGC_FLA_DEC__A */
  234. WRBLOCK(FE_AG_REG_GC1_AGC_MAX__A, 2),
  235. 0xFF, 0x01, /* FE_AG_REG_GC1_AGC_MAX__A */
  236. 0x00, 0xFE, /* FE_AG_REG_GC1_AGC_MIN__A */
  237. WRBLOCK(FE_AG_REG_IND_WIN__A, 29),
  238. 0x00, 0x00, /* FE_AG_REG_IND_WIN__A */
  239. 0x05, 0x00, /* FE_AG_REG_IND_THD_LOL__A */
  240. 0x0F, 0x00, /* FE_AG_REG_IND_THD_HIL__A */
  241. 0x00, 0x00, /* FE_AG_REG_IND_DEL__A don't care */
  242. 0x1E, 0x00, /* FE_AG_REG_IND_PD1_WRI__A */
  243. 0x0C, 0x00, /* FE_AG_REG_PDA_AUR_CNT__A */
  244. 0x00, 0x00, /* FE_AG_REG_PDA_RUR_CNT__A */
  245. 0x00, 0x00, /* FE_AG_REG_PDA_AVE_DAT__A don't care */
  246. 0x00, 0x00, /* FE_AG_REG_PDC_RUR_CNT__A */
  247. 0x01, 0x00, /* FE_AG_REG_PDC_SET_LVL__A */
  248. 0x02, 0x00, /* FE_AG_REG_PDC_FLA_RGN__A */
  249. 0x00, 0x00, /* FE_AG_REG_PDC_JMP_PSN__A don't care */
  250. 0xFF, 0xFF, /* FE_AG_REG_PDC_FLA_STP__A */
  251. 0xFF, 0xFF, /* FE_AG_REG_PDC_SLO_STP__A */
  252. 0x00, 0x1F, /* FE_AG_REG_PDC_PD2_WRI__A don't care */
  253. 0x00, 0x00, /* FE_AG_REG_PDC_MAP_DAT__A don't care */
  254. 0x02, 0x00, /* FE_AG_REG_PDC_MAX__A */
  255. 0x0C, 0x00, /* FE_AG_REG_TGA_AUR_CNT__A */
  256. 0x00, 0x00, /* FE_AG_REG_TGA_RUR_CNT__A */
  257. 0x00, 0x00, /* FE_AG_REG_TGA_AVE_DAT__A don't care */
  258. 0x00, 0x00, /* FE_AG_REG_TGC_RUR_CNT__A */
  259. 0x22, 0x00, /* FE_AG_REG_TGC_SET_LVL__A */
  260. 0x15, 0x00, /* FE_AG_REG_TGC_FLA_RGN__A */
  261. 0x00, 0x00, /* FE_AG_REG_TGC_JMP_PSN__A don't care */
  262. 0x01, 0x00, /* FE_AG_REG_TGC_FLA_STP__A */
  263. 0x0A, 0x00, /* FE_AG_REG_TGC_SLO_STP__A */
  264. 0x00, 0x00, /* FE_AG_REG_TGC_MAP_DAT__A don't care */
  265. 0x10, 0x00, /* FE_AG_REG_FGA_AUR_CNT__A */
  266. 0x10, 0x00, /* FE_AG_REG_FGA_RUR_CNT__A */
  267. WRBLOCK(FE_AG_REG_BGC_FGC_WRI__A, 2),
  268. 0x00, 0x00, /* FE_AG_REG_BGC_FGC_WRI__A */
  269. 0x00, 0x00, /* FE_AG_REG_BGC_CGC_WRI__A */
  270. WRBLOCK(FE_FD_REG_SCL__A, 3),
  271. 0x05, 0x00, /* FE_FD_REG_SCL__A */
  272. 0x03, 0x00, /* FE_FD_REG_MAX_LEV__A */
  273. 0x05, 0x00, /* FE_FD_REG_NR__A */
  274. WRBLOCK(FE_CF_REG_SCL__A, 5),
  275. 0x16, 0x00, /* FE_CF_REG_SCL__A */
  276. 0x04, 0x00, /* FE_CF_REG_MAX_LEV__A */
  277. 0x06, 0x00, /* FE_CF_REG_NR__A */
  278. 0x00, 0x00, /* FE_CF_REG_IMP_VAL__A */
  279. 0x01, 0x00, /* FE_CF_REG_MEAS_VAL__A */
  280. WRBLOCK(FE_CU_REG_FRM_CNT_RST__A, 2),
  281. 0x00, 0x08, /* FE_CU_REG_FRM_CNT_RST__A */
  282. 0x00, 0x00, /* FE_CU_REG_FRM_CNT_STR__A */
  283. END_OF_TABLE
  284. };
  285. /* with PGA */
  286. /* WR16COND( DRXD_WITH_PGA, FE_AG_REG_AG_PGA_MODE__A , 0x0004), */
  287. /* without PGA */
  288. /* WR16COND( DRXD_WITHOUT_PGA, FE_AG_REG_AG_PGA_MODE__A , 0x0001), */
  289. /* WR16(FE_AG_REG_AG_AGC_SIO__A, (extAttr -> FeAgRegAgAgcSio), 0x0000 );*/
  290. /* WR16(FE_AG_REG_AG_PWD__A ,(extAttr -> FeAgRegAgPwd), 0x0000 );*/
  291. u8 DRXD_InitFEA2_2[] = {
  292. WR16(FE_AG_REG_CDR_RUR_CNT__A, 0x0010),
  293. WR16(FE_AG_REG_FGM_WRI__A, 48),
  294. /* Activate measurement, activate scale */
  295. WR16(FE_FD_REG_MEAS_VAL__A, 0x0001),
  296. WR16(FE_CU_REG_COMM_EXEC__A, 0x0001),
  297. WR16(FE_CF_REG_COMM_EXEC__A, 0x0001),
  298. WR16(FE_IF_REG_COMM_EXEC__A, 0x0001),
  299. WR16(FE_FD_REG_COMM_EXEC__A, 0x0001),
  300. WR16(FE_FS_REG_COMM_EXEC__A, 0x0001),
  301. WR16(FE_AD_REG_COMM_EXEC__A, 0x0001),
  302. WR16(FE_AG_REG_COMM_EXEC__A, 0x0001),
  303. WR16(FE_AG_REG_AG_MODE_LOP__A, 0x895E),
  304. END_OF_TABLE
  305. };
  306. u8 DRXD_InitFEB1_1[] = {
  307. WR16(B_FE_AD_REG_PD__A, 0x0000),
  308. WR16(B_FE_AD_REG_CLKNEG__A, 0x0000),
  309. WR16(B_FE_AG_REG_BGC_FGC_WRI__A, 0x0000),
  310. WR16(B_FE_AG_REG_BGC_CGC_WRI__A, 0x0000),
  311. WR16(B_FE_AG_REG_AG_MODE_LOP__A, 0x000a),
  312. WR16(B_FE_AG_REG_IND_PD1_WRI__A, 35),
  313. WR16(B_FE_AG_REG_IND_WIN__A, 0),
  314. WR16(B_FE_AG_REG_IND_THD_LOL__A, 8),
  315. WR16(B_FE_AG_REG_IND_THD_HIL__A, 8),
  316. WR16(B_FE_CF_REG_IMP_VAL__A, 1),
  317. WR16(B_FE_AG_REG_EGC_FLA_RGN__A, 7),
  318. END_OF_TABLE
  319. };
  320. /* with PGA */
  321. /* WR16(B_FE_AG_REG_AG_PGA_MODE__A , 0x0000, 0x0000); */
  322. /* without PGA */
  323. /* WR16(B_FE_AG_REG_AG_PGA_MODE__A ,
  324. B_FE_AG_REG_AG_PGA_MODE_PFN_PCN_AFY_REN, 0x0000);*/
  325. /* WR16(B_FE_AG_REG_AG_AGC_SIO__A,(extAttr -> FeAgRegAgAgcSio), 0x0000 );*//*added HS 23-05-2005 */
  326. /* WR16(B_FE_AG_REG_AG_PWD__A ,(extAttr -> FeAgRegAgPwd), 0x0000 );*/
  327. u8 DRXD_InitFEB1_2[] = {
  328. WR16(B_FE_COMM_EXEC__A, 0x0001),
  329. /* RF-AGC setup */
  330. WR16(B_FE_AG_REG_PDA_AUR_CNT__A, 0x0C),
  331. WR16(B_FE_AG_REG_PDC_SET_LVL__A, 0x01),
  332. WR16(B_FE_AG_REG_PDC_FLA_RGN__A, 0x02),
  333. WR16(B_FE_AG_REG_PDC_FLA_STP__A, 0xFFFF),
  334. WR16(B_FE_AG_REG_PDC_SLO_STP__A, 0xFFFF),
  335. WR16(B_FE_AG_REG_PDC_MAX__A, 0x02),
  336. WR16(B_FE_AG_REG_TGA_AUR_CNT__A, 0x0C),
  337. WR16(B_FE_AG_REG_TGC_SET_LVL__A, 0x22),
  338. WR16(B_FE_AG_REG_TGC_FLA_RGN__A, 0x15),
  339. WR16(B_FE_AG_REG_TGC_FLA_STP__A, 0x01),
  340. WR16(B_FE_AG_REG_TGC_SLO_STP__A, 0x0A),
  341. WR16(B_FE_CU_REG_DIV_NFC_CLP__A, 0),
  342. WR16(B_FE_CU_REG_CTR_NFC_OCR__A, 25000),
  343. WR16(B_FE_CU_REG_CTR_NFC_ICR__A, 1),
  344. END_OF_TABLE
  345. };
  346. u8 DRXD_InitCPA2[] = {
  347. WRBLOCK(CP_REG_BR_SPL_OFFSET__A, 2),
  348. 0x07, 0x00, /* CP_REG_BR_SPL_OFFSET__A */
  349. 0x0A, 0x00, /* CP_REG_BR_STR_DEL__A */
  350. WRBLOCK(CP_REG_RT_ANG_INC0__A, 4),
  351. 0x00, 0x00, /* CP_REG_RT_ANG_INC0__A */
  352. 0x00, 0x00, /* CP_REG_RT_ANG_INC1__A */
  353. 0x03, 0x00, /* CP_REG_RT_DETECT_ENA__A */
  354. 0x03, 0x00, /* CP_REG_RT_DETECT_TRH__A */
  355. WRBLOCK(CP_REG_AC_NEXP_OFFS__A, 5),
  356. 0x32, 0x00, /* CP_REG_AC_NEXP_OFFS__A */
  357. 0x62, 0x00, /* CP_REG_AC_AVER_POW__A */
  358. 0x82, 0x00, /* CP_REG_AC_MAX_POW__A */
  359. 0x26, 0x00, /* CP_REG_AC_WEIGHT_MAN__A */
  360. 0x0F, 0x00, /* CP_REG_AC_WEIGHT_EXP__A */
  361. WRBLOCK(CP_REG_AC_AMP_MODE__A, 2),
  362. 0x02, 0x00, /* CP_REG_AC_AMP_MODE__A */
  363. 0x01, 0x00, /* CP_REG_AC_AMP_FIX__A */
  364. WR16(CP_REG_INTERVAL__A, 0x0005),
  365. WR16(CP_REG_RT_EXP_MARG__A, 0x0004),
  366. WR16(CP_REG_AC_ANG_MODE__A, 0x0003),
  367. WR16(CP_REG_COMM_EXEC__A, 0x0001),
  368. END_OF_TABLE
  369. };
  370. u8 DRXD_InitCPB1[] = {
  371. WR16(B_CP_REG_BR_SPL_OFFSET__A, 0x0008),
  372. WR16(B_CP_COMM_EXEC__A, 0x0001),
  373. END_OF_TABLE
  374. };
  375. u8 DRXD_InitCEA2[] = {
  376. WRBLOCK(CE_REG_AVG_POW__A, 4),
  377. 0x62, 0x00, /* CE_REG_AVG_POW__A */
  378. 0x78, 0x00, /* CE_REG_MAX_POW__A */
  379. 0x62, 0x00, /* CE_REG_ATT__A */
  380. 0x17, 0x00, /* CE_REG_NRED__A */
  381. WRBLOCK(CE_REG_NE_ERR_SELECT__A, 2),
  382. 0x07, 0x00, /* CE_REG_NE_ERR_SELECT__A */
  383. 0xEB, 0xFF, /* CE_REG_NE_TD_CAL__A */
  384. WRBLOCK(CE_REG_NE_MIXAVG__A, 2),
  385. 0x06, 0x00, /* CE_REG_NE_MIXAVG__A */
  386. 0x00, 0x00, /* CE_REG_NE_NUPD_OFS__A */
  387. WRBLOCK(CE_REG_PE_NEXP_OFFS__A, 2),
  388. 0x00, 0x00, /* CE_REG_PE_NEXP_OFFS__A */
  389. 0x00, 0x00, /* CE_REG_PE_TIMESHIFT__A */
  390. WRBLOCK(CE_REG_TP_A0_TAP_NEW__A, 3),
  391. 0x00, 0x01, /* CE_REG_TP_A0_TAP_NEW__A */
  392. 0x01, 0x00, /* CE_REG_TP_A0_TAP_NEW_VALID__A */
  393. 0x0E, 0x00, /* CE_REG_TP_A0_MU_LMS_STEP__A */
  394. WRBLOCK(CE_REG_TP_A1_TAP_NEW__A, 3),
  395. 0x00, 0x00, /* CE_REG_TP_A1_TAP_NEW__A */
  396. 0x01, 0x00, /* CE_REG_TP_A1_TAP_NEW_VALID__A */
  397. 0x0A, 0x00, /* CE_REG_TP_A1_MU_LMS_STEP__A */
  398. WRBLOCK(CE_REG_FI_SHT_INCR__A, 2),
  399. 0x12, 0x00, /* CE_REG_FI_SHT_INCR__A */
  400. 0x0C, 0x00, /* CE_REG_FI_EXP_NORM__A */
  401. WRBLOCK(CE_REG_IR_INPUTSEL__A, 3),
  402. 0x00, 0x00, /* CE_REG_IR_INPUTSEL__A */
  403. 0x00, 0x00, /* CE_REG_IR_STARTPOS__A */
  404. 0xFF, 0x00, /* CE_REG_IR_NEXP_THRES__A */
  405. WR16(CE_REG_TI_NEXP_OFFS__A, 0x0000),
  406. END_OF_TABLE
  407. };
  408. u8 DRXD_InitCEB1[] = {
  409. WR16(B_CE_REG_TI_PHN_ENABLE__A, 0x0001),
  410. WR16(B_CE_REG_FR_PM_SET__A, 0x000D),
  411. END_OF_TABLE
  412. };
  413. u8 DRXD_InitEQA2[] = {
  414. WRBLOCK(EQ_REG_OT_QNT_THRES0__A, 4),
  415. 0x1E, 0x00, /* EQ_REG_OT_QNT_THRES0__A */
  416. 0x1F, 0x00, /* EQ_REG_OT_QNT_THRES1__A */
  417. 0x06, 0x00, /* EQ_REG_OT_CSI_STEP__A */
  418. 0x02, 0x00, /* EQ_REG_OT_CSI_OFFSET__A */
  419. WR16(EQ_REG_TD_REQ_SMB_CNT__A, 0x0200),
  420. WR16(EQ_REG_IS_CLIP_EXP__A, 0x001F),
  421. WR16(EQ_REG_SN_OFFSET__A, (u16) (-7)),
  422. WR16(EQ_REG_RC_SEL_CAR__A, 0x0002),
  423. WR16(EQ_REG_COMM_EXEC__A, 0x0001),
  424. END_OF_TABLE
  425. };
  426. u8 DRXD_InitEQB1[] = {
  427. WR16(B_EQ_REG_COMM_EXEC__A, 0x0001),
  428. END_OF_TABLE
  429. };
  430. u8 DRXD_ResetECRAM[] = {
  431. /* Reset packet sync bytes in EC_VD ram */
  432. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (0 * 17), 0x0000),
  433. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (1 * 17), 0x0000),
  434. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (2 * 17), 0x0000),
  435. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (3 * 17), 0x0000),
  436. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (4 * 17), 0x0000),
  437. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (5 * 17), 0x0000),
  438. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (6 * 17), 0x0000),
  439. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (7 * 17), 0x0000),
  440. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (8 * 17), 0x0000),
  441. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (9 * 17), 0x0000),
  442. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (10 * 17), 0x0000),
  443. /* Reset packet sync bytes in EC_RS ram */
  444. WR16(EC_RS_EC_RAM__A, 0x0000),
  445. WR16(EC_RS_EC_RAM__A + 204, 0x0000),
  446. END_OF_TABLE
  447. };
  448. u8 DRXD_InitECA2[] = {
  449. WRBLOCK(EC_SB_REG_CSI_HI__A, 6),
  450. 0x1F, 0x00, /* EC_SB_REG_CSI_HI__A */
  451. 0x1E, 0x00, /* EC_SB_REG_CSI_LO__A */
  452. 0x01, 0x00, /* EC_SB_REG_SMB_TGL__A */
  453. 0x7F, 0x00, /* EC_SB_REG_SNR_HI__A */
  454. 0x7F, 0x00, /* EC_SB_REG_SNR_MID__A */
  455. 0x7F, 0x00, /* EC_SB_REG_SNR_LO__A */
  456. WRBLOCK(EC_RS_REG_REQ_PCK_CNT__A, 2),
  457. 0x00, 0x10, /* EC_RS_REG_REQ_PCK_CNT__A */
  458. DATA16(EC_RS_REG_VAL_PCK), /* EC_RS_REG_VAL__A */
  459. WRBLOCK(EC_OC_REG_TMD_TOP_MODE__A, 5),
  460. 0x03, 0x00, /* EC_OC_REG_TMD_TOP_MODE__A */
  461. 0xF4, 0x01, /* EC_OC_REG_TMD_TOP_CNT__A */
  462. 0xC0, 0x03, /* EC_OC_REG_TMD_HIL_MAR__A */
  463. 0x40, 0x00, /* EC_OC_REG_TMD_LOL_MAR__A */
  464. 0x03, 0x00, /* EC_OC_REG_TMD_CUR_CNT__A */
  465. WRBLOCK(EC_OC_REG_AVR_ASH_CNT__A, 2),
  466. 0x06, 0x00, /* EC_OC_REG_AVR_ASH_CNT__A */
  467. 0x02, 0x00, /* EC_OC_REG_AVR_BSH_CNT__A */
  468. WRBLOCK(EC_OC_REG_RCN_MODE__A, 7),
  469. 0x07, 0x00, /* EC_OC_REG_RCN_MODE__A */
  470. 0x00, 0x00, /* EC_OC_REG_RCN_CRA_LOP__A */
  471. 0xc0, 0x00, /* EC_OC_REG_RCN_CRA_HIP__A */
  472. 0x00, 0x10, /* EC_OC_REG_RCN_CST_LOP__A */
  473. 0x00, 0x00, /* EC_OC_REG_RCN_CST_HIP__A */
  474. 0xFF, 0x01, /* EC_OC_REG_RCN_SET_LVL__A */
  475. 0x0D, 0x00, /* EC_OC_REG_RCN_GAI_LVL__A */
  476. WRBLOCK(EC_OC_REG_RCN_CLP_LOP__A, 2),
  477. 0x00, 0x00, /* EC_OC_REG_RCN_CLP_LOP__A */
  478. 0xC0, 0x00, /* EC_OC_REG_RCN_CLP_HIP__A */
  479. WR16(EC_SB_REG_CSI_OFS__A, 0x0001),
  480. WR16(EC_VD_REG_FORCE__A, 0x0002),
  481. WR16(EC_VD_REG_REQ_SMB_CNT__A, 0x0001),
  482. WR16(EC_VD_REG_RLK_ENA__A, 0x0001),
  483. WR16(EC_OD_REG_SYNC__A, 0x0664),
  484. WR16(EC_OC_REG_OC_MON_SIO__A, 0x0000),
  485. WR16(EC_OC_REG_SNC_ISC_LVL__A, 0x0D0C),
  486. /* Output zero on monitorbus pads, power saving */
  487. WR16(EC_OC_REG_OCR_MON_UOS__A,
  488. (EC_OC_REG_OCR_MON_UOS_DAT_0_ENABLE |
  489. EC_OC_REG_OCR_MON_UOS_DAT_1_ENABLE |
  490. EC_OC_REG_OCR_MON_UOS_DAT_2_ENABLE |
  491. EC_OC_REG_OCR_MON_UOS_DAT_3_ENABLE |
  492. EC_OC_REG_OCR_MON_UOS_DAT_4_ENABLE |
  493. EC_OC_REG_OCR_MON_UOS_DAT_5_ENABLE |
  494. EC_OC_REG_OCR_MON_UOS_DAT_6_ENABLE |
  495. EC_OC_REG_OCR_MON_UOS_DAT_7_ENABLE |
  496. EC_OC_REG_OCR_MON_UOS_DAT_8_ENABLE |
  497. EC_OC_REG_OCR_MON_UOS_DAT_9_ENABLE |
  498. EC_OC_REG_OCR_MON_UOS_VAL_ENABLE |
  499. EC_OC_REG_OCR_MON_UOS_CLK_ENABLE)),
  500. WR16(EC_OC_REG_OCR_MON_WRI__A,
  501. EC_OC_REG_OCR_MON_WRI_INIT),
  502. /* CHK_ERROR(ResetECRAM(demod)); */
  503. /* Reset packet sync bytes in EC_VD ram */
  504. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (0 * 17), 0x0000),
  505. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (1 * 17), 0x0000),
  506. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (2 * 17), 0x0000),
  507. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (3 * 17), 0x0000),
  508. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (4 * 17), 0x0000),
  509. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (5 * 17), 0x0000),
  510. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (6 * 17), 0x0000),
  511. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (7 * 17), 0x0000),
  512. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (8 * 17), 0x0000),
  513. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (9 * 17), 0x0000),
  514. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (10 * 17), 0x0000),
  515. /* Reset packet sync bytes in EC_RS ram */
  516. WR16(EC_RS_EC_RAM__A, 0x0000),
  517. WR16(EC_RS_EC_RAM__A + 204, 0x0000),
  518. WR16(EC_SB_REG_COMM_EXEC__A, 0x0001),
  519. WR16(EC_VD_REG_COMM_EXEC__A, 0x0001),
  520. WR16(EC_OD_REG_COMM_EXEC__A, 0x0001),
  521. WR16(EC_RS_REG_COMM_EXEC__A, 0x0001),
  522. END_OF_TABLE
  523. };
  524. u8 DRXD_InitECB1[] = {
  525. WR16(B_EC_SB_REG_CSI_OFS0__A, 0x0001),
  526. WR16(B_EC_SB_REG_CSI_OFS1__A, 0x0001),
  527. WR16(B_EC_SB_REG_CSI_OFS2__A, 0x0001),
  528. WR16(B_EC_SB_REG_CSI_LO__A, 0x000c),
  529. WR16(B_EC_SB_REG_CSI_HI__A, 0x0018),
  530. WR16(B_EC_SB_REG_SNR_HI__A, 0x007f),
  531. WR16(B_EC_SB_REG_SNR_MID__A, 0x007f),
  532. WR16(B_EC_SB_REG_SNR_LO__A, 0x007f),
  533. WR16(B_EC_OC_REG_DTO_CLKMODE__A, 0x0002),
  534. WR16(B_EC_OC_REG_DTO_PER__A, 0x0006),
  535. WR16(B_EC_OC_REG_DTO_BUR__A, 0x0001),
  536. WR16(B_EC_OC_REG_RCR_CLKMODE__A, 0x0000),
  537. WR16(B_EC_OC_REG_RCN_GAI_LVL__A, 0x000D),
  538. WR16(B_EC_OC_REG_OC_MPG_SIO__A, 0x0000),
  539. /* Needed because shadow registers do not have correct default value */
  540. WR16(B_EC_OC_REG_RCN_CST_LOP__A, 0x1000),
  541. WR16(B_EC_OC_REG_RCN_CST_HIP__A, 0x0000),
  542. WR16(B_EC_OC_REG_RCN_CRA_LOP__A, 0x0000),
  543. WR16(B_EC_OC_REG_RCN_CRA_HIP__A, 0x00C0),
  544. WR16(B_EC_OC_REG_RCN_CLP_LOP__A, 0x0000),
  545. WR16(B_EC_OC_REG_RCN_CLP_HIP__A, 0x00C0),
  546. WR16(B_EC_OC_REG_DTO_INC_LOP__A, 0x0000),
  547. WR16(B_EC_OC_REG_DTO_INC_HIP__A, 0x00C0),
  548. WR16(B_EC_OD_REG_SYNC__A, 0x0664),
  549. WR16(B_EC_RS_REG_REQ_PCK_CNT__A, 0x1000),
  550. /* CHK_ERROR(ResetECRAM(demod)); */
  551. /* Reset packet sync bytes in EC_VD ram */
  552. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (0 * 17), 0x0000),
  553. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (1 * 17), 0x0000),
  554. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (2 * 17), 0x0000),
  555. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (3 * 17), 0x0000),
  556. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (4 * 17), 0x0000),
  557. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (5 * 17), 0x0000),
  558. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (6 * 17), 0x0000),
  559. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (7 * 17), 0x0000),
  560. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (8 * 17), 0x0000),
  561. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (9 * 17), 0x0000),
  562. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (10 * 17), 0x0000),
  563. /* Reset packet sync bytes in EC_RS ram */
  564. WR16(EC_RS_EC_RAM__A, 0x0000),
  565. WR16(EC_RS_EC_RAM__A + 204, 0x0000),
  566. WR16(B_EC_SB_REG_COMM_EXEC__A, 0x0001),
  567. WR16(B_EC_VD_REG_COMM_EXEC__A, 0x0001),
  568. WR16(B_EC_OD_REG_COMM_EXEC__A, 0x0001),
  569. WR16(B_EC_RS_REG_COMM_EXEC__A, 0x0001),
  570. END_OF_TABLE
  571. };
  572. u8 DRXD_ResetECA2[] = {
  573. WR16(EC_OC_REG_COMM_EXEC__A, 0x0000),
  574. WR16(EC_OD_REG_COMM_EXEC__A, 0x0000),
  575. WRBLOCK(EC_OC_REG_TMD_TOP_MODE__A, 5),
  576. 0x03, 0x00, /* EC_OC_REG_TMD_TOP_MODE__A */
  577. 0xF4, 0x01, /* EC_OC_REG_TMD_TOP_CNT__A */
  578. 0xC0, 0x03, /* EC_OC_REG_TMD_HIL_MAR__A */
  579. 0x40, 0x00, /* EC_OC_REG_TMD_LOL_MAR__A */
  580. 0x03, 0x00, /* EC_OC_REG_TMD_CUR_CNT__A */
  581. WRBLOCK(EC_OC_REG_AVR_ASH_CNT__A, 2),
  582. 0x06, 0x00, /* EC_OC_REG_AVR_ASH_CNT__A */
  583. 0x02, 0x00, /* EC_OC_REG_AVR_BSH_CNT__A */
  584. WRBLOCK(EC_OC_REG_RCN_MODE__A, 7),
  585. 0x07, 0x00, /* EC_OC_REG_RCN_MODE__A */
  586. 0x00, 0x00, /* EC_OC_REG_RCN_CRA_LOP__A */
  587. 0xc0, 0x00, /* EC_OC_REG_RCN_CRA_HIP__A */
  588. 0x00, 0x10, /* EC_OC_REG_RCN_CST_LOP__A */
  589. 0x00, 0x00, /* EC_OC_REG_RCN_CST_HIP__A */
  590. 0xFF, 0x01, /* EC_OC_REG_RCN_SET_LVL__A */
  591. 0x0D, 0x00, /* EC_OC_REG_RCN_GAI_LVL__A */
  592. WRBLOCK(EC_OC_REG_RCN_CLP_LOP__A, 2),
  593. 0x00, 0x00, /* EC_OC_REG_RCN_CLP_LOP__A */
  594. 0xC0, 0x00, /* EC_OC_REG_RCN_CLP_HIP__A */
  595. WR16(EC_OD_REG_SYNC__A, 0x0664),
  596. WR16(EC_OC_REG_OC_MON_SIO__A, 0x0000),
  597. WR16(EC_OC_REG_SNC_ISC_LVL__A, 0x0D0C),
  598. /* Output zero on monitorbus pads, power saving */
  599. WR16(EC_OC_REG_OCR_MON_UOS__A,
  600. (EC_OC_REG_OCR_MON_UOS_DAT_0_ENABLE |
  601. EC_OC_REG_OCR_MON_UOS_DAT_1_ENABLE |
  602. EC_OC_REG_OCR_MON_UOS_DAT_2_ENABLE |
  603. EC_OC_REG_OCR_MON_UOS_DAT_3_ENABLE |
  604. EC_OC_REG_OCR_MON_UOS_DAT_4_ENABLE |
  605. EC_OC_REG_OCR_MON_UOS_DAT_5_ENABLE |
  606. EC_OC_REG_OCR_MON_UOS_DAT_6_ENABLE |
  607. EC_OC_REG_OCR_MON_UOS_DAT_7_ENABLE |
  608. EC_OC_REG_OCR_MON_UOS_DAT_8_ENABLE |
  609. EC_OC_REG_OCR_MON_UOS_DAT_9_ENABLE |
  610. EC_OC_REG_OCR_MON_UOS_VAL_ENABLE |
  611. EC_OC_REG_OCR_MON_UOS_CLK_ENABLE)),
  612. WR16(EC_OC_REG_OCR_MON_WRI__A,
  613. EC_OC_REG_OCR_MON_WRI_INIT),
  614. /* CHK_ERROR(ResetECRAM(demod)); */
  615. /* Reset packet sync bytes in EC_VD ram */
  616. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (0 * 17), 0x0000),
  617. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (1 * 17), 0x0000),
  618. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (2 * 17), 0x0000),
  619. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (3 * 17), 0x0000),
  620. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (4 * 17), 0x0000),
  621. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (5 * 17), 0x0000),
  622. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (6 * 17), 0x0000),
  623. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (7 * 17), 0x0000),
  624. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (8 * 17), 0x0000),
  625. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (9 * 17), 0x0000),
  626. WR16(EC_OD_DEINT_RAM__A + 0x3b7 + (10 * 17), 0x0000),
  627. /* Reset packet sync bytes in EC_RS ram */
  628. WR16(EC_RS_EC_RAM__A, 0x0000),
  629. WR16(EC_RS_EC_RAM__A + 204, 0x0000),
  630. WR16(EC_OD_REG_COMM_EXEC__A, 0x0001),
  631. END_OF_TABLE
  632. };
  633. u8 DRXD_InitSC[] = {
  634. WR16(SC_COMM_EXEC__A, 0),
  635. WR16(SC_COMM_STATE__A, 0),
  636. #ifdef COMPILE_FOR_QT
  637. WR16(SC_RA_RAM_BE_OPT_DELAY__A, 0x100),
  638. #endif
  639. /* SC is not started, this is done in SetChannels() */
  640. END_OF_TABLE
  641. };
  642. /* Diversity settings */
  643. u8 DRXD_InitDiversityFront[] = {
  644. /* Start demod ********* RF in , diversity out **************************** */
  645. WR16(B_SC_RA_RAM_CONFIG__A, B_SC_RA_RAM_CONFIG_FR_ENABLE__M |
  646. B_SC_RA_RAM_CONFIG_FREQSCAN__M),
  647. WR16(B_SC_RA_RAM_LC_ABS_2K__A, 0x7),
  648. WR16(B_SC_RA_RAM_LC_ABS_8K__A, 0x7),
  649. WR16(B_SC_RA_RAM_IR_COARSE_8K_LENGTH__A, IRLEN_COARSE_8K),
  650. WR16(B_SC_RA_RAM_IR_COARSE_8K_FREQINC__A, 1 << (11 - IRLEN_COARSE_8K)),
  651. WR16(B_SC_RA_RAM_IR_COARSE_8K_KAISINC__A, 1 << (17 - IRLEN_COARSE_8K)),
  652. WR16(B_SC_RA_RAM_IR_FINE_8K_LENGTH__A, IRLEN_FINE_8K),
  653. WR16(B_SC_RA_RAM_IR_FINE_8K_FREQINC__A, 1 << (11 - IRLEN_FINE_8K)),
  654. WR16(B_SC_RA_RAM_IR_FINE_8K_KAISINC__A, 1 << (17 - IRLEN_FINE_8K)),
  655. WR16(B_SC_RA_RAM_IR_COARSE_2K_LENGTH__A, IRLEN_COARSE_2K),
  656. WR16(B_SC_RA_RAM_IR_COARSE_2K_FREQINC__A, 1 << (11 - IRLEN_COARSE_2K)),
  657. WR16(B_SC_RA_RAM_IR_COARSE_2K_KAISINC__A, 1 << (17 - IRLEN_COARSE_2K)),
  658. WR16(B_SC_RA_RAM_IR_FINE_2K_LENGTH__A, IRLEN_FINE_2K),
  659. WR16(B_SC_RA_RAM_IR_FINE_2K_FREQINC__A, 1 << (11 - IRLEN_FINE_2K)),
  660. WR16(B_SC_RA_RAM_IR_FINE_2K_KAISINC__A, 1 << (17 - IRLEN_FINE_2K)),
  661. WR16(B_LC_RA_RAM_FILTER_CRMM_A__A, 7),
  662. WR16(B_LC_RA_RAM_FILTER_CRMM_B__A, 4),
  663. WR16(B_LC_RA_RAM_FILTER_SRMM_A__A, 7),
  664. WR16(B_LC_RA_RAM_FILTER_SRMM_B__A, 4),
  665. WR16(B_LC_RA_RAM_FILTER_SYM_SET__A, 500),
  666. WR16(B_CC_REG_DIVERSITY__A, 0x0001),
  667. WR16(B_EC_OC_REG_OC_MODE_HIP__A, 0x0010),
  668. WR16(B_EQ_REG_RC_SEL_CAR__A, B_EQ_REG_RC_SEL_CAR_PASS_B_CE |
  669. B_EQ_REG_RC_SEL_CAR_LOCAL_B_CE | B_EQ_REG_RC_SEL_CAR_MEAS_B_CE),
  670. /* 0x2a ), *//* CE to PASS mux */
  671. END_OF_TABLE
  672. };
  673. u8 DRXD_InitDiversityEnd[] = {
  674. /* End demod *********** combining RF in and diversity in, MPEG TS out **** */
  675. /* disable near/far; switch on timing slave mode */
  676. WR16(B_SC_RA_RAM_CONFIG__A, B_SC_RA_RAM_CONFIG_FR_ENABLE__M |
  677. B_SC_RA_RAM_CONFIG_FREQSCAN__M |
  678. B_SC_RA_RAM_CONFIG_DIV_ECHO_ENABLE__M |
  679. B_SC_RA_RAM_CONFIG_SLAVE__M |
  680. B_SC_RA_RAM_CONFIG_DIV_BLANK_ENABLE__M
  681. /* MV from CtrlDiversity */
  682. ),
  683. #ifdef DRXDDIV_SRMM_SLAVING
  684. WR16(SC_RA_RAM_LC_ABS_2K__A, 0x3c7),
  685. WR16(SC_RA_RAM_LC_ABS_8K__A, 0x3c7),
  686. #else
  687. WR16(SC_RA_RAM_LC_ABS_2K__A, 0x7),
  688. WR16(SC_RA_RAM_LC_ABS_8K__A, 0x7),
  689. #endif
  690. WR16(B_SC_RA_RAM_IR_COARSE_8K_LENGTH__A, IRLEN_COARSE_8K),
  691. WR16(B_SC_RA_RAM_IR_COARSE_8K_FREQINC__A, 1 << (11 - IRLEN_COARSE_8K)),
  692. WR16(B_SC_RA_RAM_IR_COARSE_8K_KAISINC__A, 1 << (17 - IRLEN_COARSE_8K)),
  693. WR16(B_SC_RA_RAM_IR_FINE_8K_LENGTH__A, IRLEN_FINE_8K),
  694. WR16(B_SC_RA_RAM_IR_FINE_8K_FREQINC__A, 1 << (11 - IRLEN_FINE_8K)),
  695. WR16(B_SC_RA_RAM_IR_FINE_8K_KAISINC__A, 1 << (17 - IRLEN_FINE_8K)),
  696. WR16(B_SC_RA_RAM_IR_COARSE_2K_LENGTH__A, IRLEN_COARSE_2K),
  697. WR16(B_SC_RA_RAM_IR_COARSE_2K_FREQINC__A, 1 << (11 - IRLEN_COARSE_2K)),
  698. WR16(B_SC_RA_RAM_IR_COARSE_2K_KAISINC__A, 1 << (17 - IRLEN_COARSE_2K)),
  699. WR16(B_SC_RA_RAM_IR_FINE_2K_LENGTH__A, IRLEN_FINE_2K),
  700. WR16(B_SC_RA_RAM_IR_FINE_2K_FREQINC__A, 1 << (11 - IRLEN_FINE_2K)),
  701. WR16(B_SC_RA_RAM_IR_FINE_2K_KAISINC__A, 1 << (17 - IRLEN_FINE_2K)),
  702. WR16(B_LC_RA_RAM_FILTER_CRMM_A__A, 7),
  703. WR16(B_LC_RA_RAM_FILTER_CRMM_B__A, 4),
  704. WR16(B_LC_RA_RAM_FILTER_SRMM_A__A, 7),
  705. WR16(B_LC_RA_RAM_FILTER_SRMM_B__A, 4),
  706. WR16(B_LC_RA_RAM_FILTER_SYM_SET__A, 500),
  707. WR16(B_CC_REG_DIVERSITY__A, 0x0001),
  708. END_OF_TABLE
  709. };
  710. u8 DRXD_DisableDiversity[] = {
  711. WR16(B_SC_RA_RAM_LC_ABS_2K__A, B_SC_RA_RAM_LC_ABS_2K__PRE),
  712. WR16(B_SC_RA_RAM_LC_ABS_8K__A, B_SC_RA_RAM_LC_ABS_8K__PRE),
  713. WR16(B_SC_RA_RAM_IR_COARSE_8K_LENGTH__A,
  714. B_SC_RA_RAM_IR_COARSE_8K_LENGTH__PRE),
  715. WR16(B_SC_RA_RAM_IR_COARSE_8K_FREQINC__A,
  716. B_SC_RA_RAM_IR_COARSE_8K_FREQINC__PRE),
  717. WR16(B_SC_RA_RAM_IR_COARSE_8K_KAISINC__A,
  718. B_SC_RA_RAM_IR_COARSE_8K_KAISINC__PRE),
  719. WR16(B_SC_RA_RAM_IR_FINE_8K_LENGTH__A,
  720. B_SC_RA_RAM_IR_FINE_8K_LENGTH__PRE),
  721. WR16(B_SC_RA_RAM_IR_FINE_8K_FREQINC__A,
  722. B_SC_RA_RAM_IR_FINE_8K_FREQINC__PRE),
  723. WR16(B_SC_RA_RAM_IR_FINE_8K_KAISINC__A,
  724. B_SC_RA_RAM_IR_FINE_8K_KAISINC__PRE),
  725. WR16(B_SC_RA_RAM_IR_COARSE_2K_LENGTH__A,
  726. B_SC_RA_RAM_IR_COARSE_2K_LENGTH__PRE),
  727. WR16(B_SC_RA_RAM_IR_COARSE_2K_FREQINC__A,
  728. B_SC_RA_RAM_IR_COARSE_2K_FREQINC__PRE),
  729. WR16(B_SC_RA_RAM_IR_COARSE_2K_KAISINC__A,
  730. B_SC_RA_RAM_IR_COARSE_2K_KAISINC__PRE),
  731. WR16(B_SC_RA_RAM_IR_FINE_2K_LENGTH__A,
  732. B_SC_RA_RAM_IR_FINE_2K_LENGTH__PRE),
  733. WR16(B_SC_RA_RAM_IR_FINE_2K_FREQINC__A,
  734. B_SC_RA_RAM_IR_FINE_2K_FREQINC__PRE),
  735. WR16(B_SC_RA_RAM_IR_FINE_2K_KAISINC__A,
  736. B_SC_RA_RAM_IR_FINE_2K_KAISINC__PRE),
  737. WR16(B_LC_RA_RAM_FILTER_CRMM_A__A, B_LC_RA_RAM_FILTER_CRMM_A__PRE),
  738. WR16(B_LC_RA_RAM_FILTER_CRMM_B__A, B_LC_RA_RAM_FILTER_CRMM_B__PRE),
  739. WR16(B_LC_RA_RAM_FILTER_SRMM_A__A, B_LC_RA_RAM_FILTER_SRMM_A__PRE),
  740. WR16(B_LC_RA_RAM_FILTER_SRMM_B__A, B_LC_RA_RAM_FILTER_SRMM_B__PRE),
  741. WR16(B_LC_RA_RAM_FILTER_SYM_SET__A, B_LC_RA_RAM_FILTER_SYM_SET__PRE),
  742. WR16(B_CC_REG_DIVERSITY__A, 0x0000),
  743. WR16(B_EQ_REG_RC_SEL_CAR__A, B_EQ_REG_RC_SEL_CAR_INIT), /* combining disabled */
  744. END_OF_TABLE
  745. };
  746. u8 DRXD_StartDiversityFront[] = {
  747. /* Start demod, RF in and diversity out, no combining */
  748. WR16(B_FE_CF_REG_IMP_VAL__A, 0x0),
  749. WR16(B_FE_AD_REG_FDB_IN__A, 0x0),
  750. WR16(B_FE_AD_REG_INVEXT__A, 0x0),
  751. WR16(B_EQ_REG_COMM_MB__A, 0x12), /* EQ to MB out */
  752. WR16(B_EQ_REG_RC_SEL_CAR__A, B_EQ_REG_RC_SEL_CAR_PASS_B_CE | /* CE to PASS mux */
  753. B_EQ_REG_RC_SEL_CAR_LOCAL_B_CE | B_EQ_REG_RC_SEL_CAR_MEAS_B_CE),
  754. WR16(SC_RA_RAM_ECHO_SHIFT_LIM__A, 2),
  755. END_OF_TABLE
  756. };
  757. u8 DRXD_StartDiversityEnd[] = {
  758. /* End demod, combining RF in and diversity in, MPEG TS out */
  759. WR16(B_FE_CF_REG_IMP_VAL__A, 0x0), /* disable impulse noise cruncher */
  760. WR16(B_FE_AD_REG_INVEXT__A, 0x0), /* clock inversion (for sohard board) */
  761. WR16(B_CP_REG_BR_STR_DEL__A, 10), /* apparently no mb delay matching is best */
  762. WR16(B_EQ_REG_RC_SEL_CAR__A, B_EQ_REG_RC_SEL_CAR_DIV_ON | /* org = 0x81 combining enabled */
  763. B_EQ_REG_RC_SEL_CAR_MEAS_A_CC |
  764. B_EQ_REG_RC_SEL_CAR_PASS_A_CC | B_EQ_REG_RC_SEL_CAR_LOCAL_A_CC),
  765. END_OF_TABLE
  766. };
  767. u8 DRXD_DiversityDelay8MHZ[] = {
  768. WR16(B_SC_RA_RAM_DIVERSITY_DELAY_2K_32__A, 1150 - 50),
  769. WR16(B_SC_RA_RAM_DIVERSITY_DELAY_2K_16__A, 1100 - 50),
  770. WR16(B_SC_RA_RAM_DIVERSITY_DELAY_2K_8__A, 1000 - 50),
  771. WR16(B_SC_RA_RAM_DIVERSITY_DELAY_2K_4__A, 800 - 50),
  772. WR16(B_SC_RA_RAM_DIVERSITY_DELAY_8K_32__A, 5420 - 50),
  773. WR16(B_SC_RA_RAM_DIVERSITY_DELAY_8K_16__A, 5200 - 50),
  774. WR16(B_SC_RA_RAM_DIVERSITY_DELAY_8K_8__A, 4800 - 50),
  775. WR16(B_SC_RA_RAM_DIVERSITY_DELAY_8K_4__A, 4000 - 50),
  776. END_OF_TABLE
  777. };
  778. u8 DRXD_DiversityDelay6MHZ[] = /* also used ok for 7 MHz */
  779. {
  780. WR16(B_SC_RA_RAM_DIVERSITY_DELAY_2K_32__A, 1100 - 50),
  781. WR16(B_SC_RA_RAM_DIVERSITY_DELAY_2K_16__A, 1000 - 50),
  782. WR16(B_SC_RA_RAM_DIVERSITY_DELAY_2K_8__A, 900 - 50),
  783. WR16(B_SC_RA_RAM_DIVERSITY_DELAY_2K_4__A, 600 - 50),
  784. WR16(B_SC_RA_RAM_DIVERSITY_DELAY_8K_32__A, 5300 - 50),
  785. WR16(B_SC_RA_RAM_DIVERSITY_DELAY_8K_16__A, 5000 - 50),
  786. WR16(B_SC_RA_RAM_DIVERSITY_DELAY_8K_8__A, 4500 - 50),
  787. WR16(B_SC_RA_RAM_DIVERSITY_DELAY_8K_4__A, 3500 - 50),
  788. END_OF_TABLE
  789. };