drxd_firm.c 36 KB

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