hal_pg.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  17. *
  18. *
  19. ******************************************************************************/
  20. #ifndef __HAL_PG_H__
  21. #define __HAL_PG_H__
  22. //====================================================
  23. // EEPROM/Efuse PG Offset for 8192 CE/CU
  24. //====================================================
  25. #define EEPROM_VID_92C 0x0A
  26. #define EEPROM_PID_92C 0x0C
  27. #define EEPROM_DID_92C 0x0C
  28. #define EEPROM_SVID_92C 0x0E
  29. #define EEPROM_SMID_92C 0x10
  30. #define EEPROM_MAC_ADDR_92C 0x16
  31. #define EEPROM_MAC_ADDR 0x16
  32. #define EEPROM_TV_OPTION 0x50
  33. #define EEPROM_SUBCUSTOMER_ID_92C 0x59
  34. #define EEPROM_CCK_TX_PWR_INX 0x5A
  35. #define EEPROM_HT40_1S_TX_PWR_INX 0x60
  36. #define EEPROM_HT40_2S_TX_PWR_INX_DIFF 0x66
  37. #define EEPROM_HT20_TX_PWR_INX_DIFF 0x69
  38. #define EEPROM_OFDM_TX_PWR_INX_DIFF 0x6C
  39. #define EEPROM_HT40_MAX_PWR_OFFSET 0x6F
  40. #define EEPROM_HT20_MAX_PWR_OFFSET 0x72
  41. #define EEPROM_CHANNEL_PLAN_92C 0x75
  42. #define EEPROM_TSSI_A 0x76
  43. #define EEPROM_TSSI_B 0x77
  44. #define EEPROM_THERMAL_METER_92C 0x78
  45. #define EEPROM_RF_OPT1_92C 0x79
  46. #define EEPROM_RF_OPT2_92C 0x7A
  47. #define EEPROM_RF_OPT3_92C 0x7B
  48. #define EEPROM_RF_OPT4_92C 0x7C
  49. #define EEPROM_VERSION_92C 0x7E
  50. #define EEPROM_CUSTOMER_ID_92C 0x7F
  51. #define EEPROM_NORMAL_CHANNEL_PLAN 0x75
  52. #define EEPROM_NORMAL_BoardType_92C EEPROM_RF_OPT1_92C
  53. #define BOARD_TYPE_NORMAL_MASK 0xE0
  54. #define BOARD_TYPE_TEST_MASK 0xF
  55. #define EEPROM_TYPE_ID 0x7E
  56. // EEPROM address for Test chip
  57. #define EEPROM_TEST_USB_OPT 0x0E
  58. #define EEPROM_EASY_REPLACEMENT 0x50//BIT0 1 for build-in module, 0 for external dongle
  59. //====================================================
  60. // EEPROM/Efuse PG Offset for 8723AE/8723AU/8723AS
  61. //====================================================
  62. #define EEPROM_CCK_TX_PWR_INX_8723A 0x10
  63. #define EEPROM_HT40_1S_TX_PWR_INX_8723A 0x16
  64. #define EEPROM_HT20_TX_PWR_INX_DIFF_8723A 0x1C
  65. #define EEPROM_OFDM_TX_PWR_INX_DIFF_8723A 0x1F
  66. #define EEPROM_HT40_MAX_PWR_OFFSET_8723A 0x22
  67. #define EEPROM_HT20_MAX_PWR_OFFSET_8723A 0x25
  68. #define EEPROM_ChannelPlan_8723A 0x28
  69. #define EEPROM_TSSI_A_8723A 0x29
  70. #define EEPROM_THERMAL_METER_8723A 0x2A
  71. #define RF_OPTION1_8723A 0x2B
  72. #define RF_OPTION2_8723A 0x2C
  73. #define RF_OPTION3_8723A 0x2D
  74. #define RF_OPTION4_8723A 0x2E
  75. #define EEPROM_VERSION_8723A 0x30
  76. #define EEPROM_CustomID_8723A 0x31
  77. #define EEPROM_SubCustomID_8723A 0x32
  78. #define EEPROM_XTAL_K_8723A 0x33
  79. #define EEPROM_Chipset_8723A 0x34
  80. // RTL8723AE
  81. #define EEPROM_VID_8723AE 0x49
  82. #define EEPROM_DID_8723AE 0x4B
  83. #define EEPROM_SVID_8723AE 0x4D
  84. #define EEPROM_SMID_8723AE 0x4F
  85. #define EEPROM_MAC_ADDR_8723AE 0x67
  86. //RTL8723AU
  87. #define EEPROM_MAC_ADDR_8723AU 0xC6
  88. #define EEPROM_VID_8723AU 0xB7
  89. #define EEPROM_PID_8723AU 0xB9
  90. // RTL8723AS
  91. #define EEPROM_MAC_ADDR_8723AS 0xAA
  92. //====================================================
  93. // EEPROM/Efuse PG Offset for 8192 DE/DU
  94. //====================================================
  95. // pcie
  96. #define RTL8190_EEPROM_ID 0x8129 // 0-1
  97. #define EEPROM_HPON 0x02 // LDO settings.2-5
  98. #define EEPROM_CLK 0x06 // Clock settings.6-7
  99. #define EEPROM_MAC_FUNCTION 0x08 // SE Test mode.8
  100. #define EEPROM_MAC_ADDR_MAC0_92DE 0x55
  101. #define EEPROM_MAC_ADDR_MAC1_92DE 0x5B
  102. //usb
  103. #define EEPROM_ENDPOINT_SETTING 0x10
  104. #define EEPROM_CHIRP_K 0x12 // Changed
  105. #define EEPROM_USB_PHY 0x13 // Changed
  106. #define EEPROM_STRING 0x1F
  107. #define EEPROM_SUBCUSTOMER_ID_92D 0x59
  108. #define EEPROM_MAC_ADDR_MAC0_92DU 0x19
  109. #define EEPROM_MAC_ADDR_MAC1_92DU 0x5B
  110. //----------------------------------------------------------------
  111. // 2.4G band Tx power index setting
  112. #define EEPROM_CCK_TX_PWR_INX_2G_92D 0x61
  113. #define EEPROM_HT40_1S_TX_PWR_INX_2G_92D 0x67
  114. #define EEPROM_HT40_2S_TX_PWR_INX_DIFF_2G_92D 0x6D
  115. #define EEPROM_HT20_TX_PWR_INX_DIFF_2G_92D 0x70
  116. #define EEPROM_OFDM_TX_PWR_INX_DIFF_2G_92D 0x73
  117. #define EEPROM_HT40_MAX_PWR_OFFSET_2G_92D 0x76
  118. #define EEPROM_HT20_MAX_PWR_OFFSET_2G_92D 0x79
  119. //5GL channel 32-64
  120. #define EEPROM_HT40_1S_TX_PWR_INX_5GL_92D 0x7C
  121. #define EEPROM_HT40_2S_TX_PWR_INX_DIFF_5GL_92D 0x82
  122. #define EEPROM_HT20_TX_PWR_INX_DIFF_5GL_92D 0x85
  123. #define EEPROM_OFDM_TX_PWR_INX_DIFF_5GL_92D 0x88
  124. #define EEPROM_HT40_MAX_PWR_OFFSET_5GL_92D 0x8B
  125. #define EEPROM_HT20_MAX_PWR_OFFSET_5GL_92D 0x8E
  126. //5GM channel 100-140
  127. #define EEPROM_HT40_1S_TX_PWR_INX_5GM_92D 0x91
  128. #define EEPROM_HT40_2S_TX_PWR_INX_DIFF_5GM_92D 0x97
  129. #define EEPROM_HT20_TX_PWR_INX_DIFF_5GM_92D 0x9A
  130. #define EEPROM_OFDM_TX_PWR_INX_DIFF_5GM_92D 0x9D
  131. #define EEPROM_HT40_MAX_PWR_OFFSET_5GM_92D 0xA0
  132. #define EEPROM_HT20_MAX_PWR_OFFSET_5GM_92D 0xA3
  133. //5GH channel 149-165
  134. #define EEPROM_HT40_1S_TX_PWR_INX_5GH_92D 0xA6
  135. #define EEPROM_HT40_2S_TX_PWR_INX_DIFF_5GH_92D 0xAC
  136. #define EEPROM_HT20_TX_PWR_INX_DIFF_5GH_92D 0xAF
  137. #define EEPROM_OFDM_TX_PWR_INX_DIFF_5GH_92D 0xB2
  138. #define EEPROM_HT40_MAX_PWR_OFFSET_5GH_92D 0xB5
  139. #define EEPROM_HT20_MAX_PWR_OFFSET_5GH_92D 0xB8
  140. #define EEPROM_CHANNEL_PLAN_92D 0xBB // Map of supported channels.
  141. #define EEPROM_TEST_CHANNEL_PLAN_92D 0xBB
  142. #define EEPROM_THERMAL_METER_92D 0xC3 //[4:0]
  143. #define EEPROM_IQK_DELTA_92D 0xBC
  144. #define EEPROM_LCK_DELTA_92D 0xBC
  145. #define EEPROM_XTAL_K_92D 0xBD //[7:5]
  146. #define EEPROM_TSSI_A_5G_92D 0xBE
  147. #define EEPROM_TSSI_B_5G_92D 0xBF
  148. #define EEPROM_TSSI_AB_5G_92D 0xC0
  149. #define EEPROM_RF_OPT1_92D 0xC4
  150. #define EEPROM_RF_OPT2_92D 0xC5
  151. #define EEPROM_RF_OPT3_92D 0xC6
  152. #define EEPROM_RF_OPT4_92D 0xC7
  153. #define EEPROM_RF_OPT5_92D 0xC8
  154. #define EEPROM_RF_OPT6_92D 0xC9
  155. #define EEPROM_RF_OPT7_92D 0xCC
  156. #define EEPROM_NORMAL_BoardType_92D EEPROM_RF_OPT1_92D //[7:5]
  157. #define EEPROM_WIDIPAIRING_ADDR 0xF0
  158. #define EEPROM_WIDIPAIRING_KEY 0xF6
  159. #define EEPROM_DEF_PART_NO 0x3FD //Byte
  160. #define EEPROME_CHIP_VERSION_L 0x3FF
  161. #define EEPROME_CHIP_VERSION_H 0x3FE
  162. //----------------------------------------------------------------
  163. #define EEPROM_VID_92DE 0x28
  164. #define EEPROM_PID_92DE 0x2A
  165. #define EEPROM_SVID_92DE 0x2C
  166. #define EEPROM_SMID_92DE 0x2E
  167. #define EEPROM_PATHDIV_92D 0xC4
  168. #define EEPROM_BOARD_OPTIONS_92D 0xC4
  169. #define EEPROM_5G_LNA_GAIN_92D 0xC6
  170. #define EEPROM_FEATURE_OPTIONS_92D 0xC7
  171. #define EEPROM_BT_SETTING_92D 0xC8
  172. #define EEPROM_VERSION_92D 0xCA
  173. #define EEPROM_CUSTOMER_ID_92D 0xCB
  174. #define EEPROM_VID_92DU 0xC
  175. #define EEPROM_PID_92DU 0xE
  176. //====================================================
  177. // EEPROM/Efuse PG Offset for 88EE/88EU/88ES
  178. //====================================================
  179. #define EEPROM_TX_PWR_INX_88E 0x10
  180. #define EEPROM_ChannelPlan_88E 0xB8
  181. #define EEPROM_XTAL_88E 0xB9
  182. #define EEPROM_THERMAL_METER_88E 0xBA
  183. #define EEPROM_IQK_LCK_88E 0xBB
  184. #define EEPROM_RF_BOARD_OPTION_88E 0xC1
  185. #define EEPROM_RF_FEATURE_OPTION_88E 0xC2
  186. #define EEPROM_RF_BT_SETTING_88E 0xC3
  187. #define EEPROM_VERSION_88E 0xC4
  188. #define EEPROM_CustomID_88E 0xC5
  189. #define EEPROM_RF_ANTENNA_OPT_88E 0xC9
  190. // RTL88EE
  191. #define EEPROM_MAC_ADDR_88EE 0xD0
  192. #define EEPROM_VID_88EE 0xD6
  193. #define EEPROM_DID_88EE 0xD8
  194. #define EEPROM_SVID_88EE 0xDA
  195. #define EEPROM_SMID_88EE 0xDC
  196. //RTL88EU
  197. #define EEPROM_MAC_ADDR_88EU 0xD7
  198. #define EEPROM_VID_88EU 0xD0
  199. #define EEPROM_PID_88EU 0xD2
  200. #define EEPROM_USB_OPTIONAL_FUNCTION0 0xD4
  201. // RTL88ES
  202. #define EEPROM_MAC_ADDR_88ES 0x11A
  203. //====================================================
  204. // EEPROM/Efuse PG Offset for 8192EE/8192EU/8192ES
  205. //====================================================
  206. // 0x10 ~ 0x63 = TX power area.
  207. #define EEPROM_TX_PWR_INX_8192E 0x10
  208. #define EEPROM_ChannelPlan_8192E 0xB8
  209. #define EEPROM_XTAL_8192E 0xB9
  210. #define EEPROM_THERMAL_METER_8192E 0xBA
  211. #define EEPROM_IQK_LCK_8192E 0xBB
  212. #define EEPROM_2G_5G_PA_TYPE_8192E 0xBC
  213. #define EEPROM_2G_LNA_TYPE_GAIN_SEL_8192E 0xBD
  214. #define EEPROM_5G_LNA_TYPE_GAIN_SEL_8192E 0xBF
  215. #define EEPROM_RF_BOARD_OPTION_8192E 0xC1
  216. #define EEPROM_RF_FEATURE_OPTION_8192E 0xC2
  217. #define EEPROM_RF_BT_SETTING_8192E 0xC3
  218. #define EEPROM_VERSION_8192E 0xC4
  219. #define EEPROM_CustomID_8192E 0xC5
  220. #define EEPROM_TX_BBSWING_2G_8192E 0xC6
  221. #define EEPROM_TX_BBSWING_5G_8192E 0xC7
  222. #define EEPROM_TX_PWR_CALIBRATE_RATE_8192E 0xC8
  223. #define EEPROM_RF_ANTENNA_OPT_8192E 0xC9
  224. // RTL8192EE
  225. #define EEPROM_MAC_ADDR_8192EE 0xD0
  226. #define EEPROM_VID_8192EE 0xD6
  227. #define EEPROM_DID_8192EE 0xD8
  228. #define EEPROM_SVID_8192EE 0xDA
  229. #define EEPROM_SMID_8192EE 0xDC
  230. //RTL8192EU
  231. #define EEPROM_MAC_ADDR_8192EU 0xD7
  232. #define EEPROM_VID_8192EU 0xD0
  233. #define EEPROM_PID_8192EU 0xD2
  234. #define EEPROM_PA_TYPE_8192EU 0xBC
  235. #define EEPROM_LNA_TYPE_2G_8192EU 0xBD
  236. #define EEPROM_LNA_TYPE_5G_8192EU 0xBF
  237. // RTL8192ES
  238. #define EEPROM_MAC_ADDR_8192ES 0x11B
  239. //====================================================
  240. // EEPROM/Efuse PG Offset for 8812AE/8812AU/8812AS
  241. //====================================================
  242. // 0x10 ~ 0x63 = TX power area.
  243. #define EEPROM_USB_MODE_8812 0x08
  244. #define EEPROM_TX_PWR_INX_8812 0x10
  245. #define EEPROM_ChannelPlan_8812 0xB8
  246. #define EEPROM_XTAL_8812 0xB9
  247. #define EEPROM_THERMAL_METER_8812 0xBA
  248. #define EEPROM_IQK_LCK_8812 0xBB
  249. #define EEPROM_2G_5G_PA_TYPE_8812 0xBC
  250. #define EEPROM_2G_LNA_TYPE_GAIN_SEL_8812 0xBD
  251. #define EEPROM_5G_LNA_TYPE_GAIN_SEL_8812 0xBF
  252. #define EEPROM_RF_BOARD_OPTION_8812 0xC1
  253. #define EEPROM_RF_FEATURE_OPTION_8812 0xC2
  254. #define EEPROM_RF_BT_SETTING_8812 0xC3
  255. #define EEPROM_VERSION_8812 0xC4
  256. #define EEPROM_CustomID_8812 0xC5
  257. #define EEPROM_TX_BBSWING_2G_8812 0xC6
  258. #define EEPROM_TX_BBSWING_5G_8812 0xC7
  259. #define EEPROM_TX_PWR_CALIBRATE_RATE_8812 0xC8
  260. #define EEPROM_RF_ANTENNA_OPT_8812 0xC9
  261. #define EEPROM_RFE_OPTION_8812 0xCA
  262. // RTL8812AE
  263. #define EEPROM_MAC_ADDR_8812AE 0xD0
  264. #define EEPROM_VID_8812AE 0xD6
  265. #define EEPROM_DID_8812AE 0xD8
  266. #define EEPROM_SVID_8812AE 0xDA
  267. #define EEPROM_SMID_8812AE 0xDC
  268. //RTL8812AU
  269. #define EEPROM_MAC_ADDR_8812AU 0xD7
  270. #define EEPROM_VID_8812AU 0xD0
  271. #define EEPROM_PID_8812AU 0xD2
  272. #define EEPROM_PA_TYPE_8812AU 0xBC
  273. #define EEPROM_LNA_TYPE_2G_8812AU 0xBD
  274. #define EEPROM_LNA_TYPE_5G_8812AU 0xBF
  275. //====================================================
  276. // EEPROM/Efuse PG Offset for 8821AE/8821AU/8821AS
  277. //====================================================
  278. #define EEPROM_TX_PWR_INX_8821 0x10
  279. #define EEPROM_ChannelPlan_8821 0xB8
  280. #define EEPROM_XTAL_8821 0xB9
  281. #define EEPROM_THERMAL_METER_8821 0xBA
  282. #define EEPROM_IQK_LCK_8821 0xBB
  283. #define EEPROM_RF_BOARD_OPTION_8821 0xC1
  284. #define EEPROM_RF_FEATURE_OPTION_8821 0xC2
  285. #define EEPROM_RF_BT_SETTING_8821 0xC3
  286. #define EEPROM_VERSION_8821 0xC4
  287. #define EEPROM_CustomID_8821 0xC5
  288. #define EEPROM_RF_ANTENNA_OPT_8821 0xC9
  289. // RTL8821AE
  290. #define EEPROM_MAC_ADDR_8821AE 0xD0
  291. #define EEPROM_VID_8821AE 0xD6
  292. #define EEPROM_DID_8821AE 0xD8
  293. #define EEPROM_SVID_8821AE 0xDA
  294. #define EEPROM_SMID_8821AE 0xDC
  295. //RTL8821AU
  296. #define EEPROM_PA_TYPE_8821AU 0xBC
  297. #define EEPROM_LNA_TYPE_8821AU 0xBF
  298. // RTL8821AS
  299. #define EEPROM_MAC_ADDR_8821AS 0x11A
  300. //RTL8821AU
  301. #define EEPROM_MAC_ADDR_8821AU 0x107
  302. #define EEPROM_VID_8821AU 0x100
  303. #define EEPROM_PID_8821AU 0x102
  304. //====================================================
  305. // EEPROM/Efuse PG Offset for 8192 SE/SU
  306. //====================================================
  307. #define EEPROM_VID_92SE 0x0A
  308. #define EEPROM_DID_92SE 0x0C
  309. #define EEPROM_SVID_92SE 0x0E
  310. #define EEPROM_SMID_92SE 0x10
  311. #define EEPROM_MAC_ADDR_92S 0x12
  312. #define EEPROM_TSSI_A_92SE 0x74
  313. #define EEPROM_TSSI_B_92SE 0x75
  314. #define EEPROM_Version_92SE 0x7C
  315. #define EEPROM_VID_92SU 0x08
  316. #define EEPROM_PID_92SU 0x0A
  317. #define EEPROM_Version_92SU 0x50
  318. #define EEPROM_TSSI_A_92SU 0x6b
  319. #define EEPROM_TSSI_B_92SU 0x6c
  320. //====================================================
  321. // EEPROM/Efuse PG Offset for 8723BE/8723BU/8723BS
  322. //====================================================
  323. // 0x10 ~ 0x63 = TX power area.
  324. #define EEPROM_TX_PWR_INX_8723B 0x10
  325. #define EEPROM_ChannelPlan_8723B 0xB8
  326. #define EEPROM_XTAL_8723B 0xB9
  327. #define EEPROM_THERMAL_METER_8723B 0xBA
  328. #define EEPROM_IQK_LCK_8723B 0xBB
  329. #define EEPROM_2G_5G_PA_TYPE_8723B 0xBC
  330. #define EEPROM_2G_LNA_TYPE_GAIN_SEL_8723B 0xBD
  331. #define EEPROM_5G_LNA_TYPE_GAIN_SEL_8723B 0xBF
  332. #define EEPROM_RF_BOARD_OPTION_8723B 0xC1
  333. #define EEPROM_FEATURE_OPTION_8723B 0xC2
  334. #define EEPROM_RF_BT_SETTING_8723B 0xC3
  335. #define EEPROM_VERSION_8723B 0xC4
  336. #define EEPROM_CustomID_8723B 0xC5
  337. #define EEPROM_TX_BBSWING_2G_8723B 0xC6
  338. #define EEPROM_TX_PWR_CALIBRATE_RATE_8723B 0xC8
  339. #define EEPROM_RF_ANTENNA_OPT_8723B 0xC9
  340. #define EEPROM_RFE_OPTION_8723B 0xCA
  341. // RTL8723BE
  342. #define EEPROM_MAC_ADDR_8723BE 0xD0
  343. #define EEPROM_VID_8723BE 0xD6
  344. #define EEPROM_DID_8723BE 0xD8
  345. #define EEPROM_SVID_8723BE 0xDA
  346. #define EEPROM_SMID_8723BE 0xDC
  347. //RTL8723BU
  348. #define EEPROM_MAC_ADDR_8723BU 0xD7
  349. #define EEPROM_VID_8723BU 0xD0
  350. #define EEPROM_PID_8723BU 0xD2
  351. #define EEPROM_PA_TYPE_8723BU 0xBC
  352. #define EEPROM_LNA_TYPE_2G_8723BU 0xBD
  353. //RTL8723BS
  354. #define EEPROM_MAC_ADDR_8723BS 0x11A
  355. //====================================================
  356. // EEPROM/Efuse Value Type
  357. //====================================================
  358. #define EETYPE_TX_PWR 0x0
  359. //====================================================
  360. // EEPROM/Efuse Default Value
  361. //====================================================
  362. #define EEPROM_CID_DEFAULT 0x0
  363. #define EEPROM_CID_DEFAULT_EXT 0xFF // Reserved for Realtek
  364. #define EEPROM_CID_TOSHIBA 0x4
  365. #define EEPROM_CID_CCX 0x10
  366. #define EEPROM_CID_QMI 0x0D
  367. #define EEPROM_CID_WHQL 0xFE
  368. #define EEPROM_CHANNEL_PLAN_FCC 0x0
  369. #define EEPROM_CHANNEL_PLAN_IC 0x1
  370. #define EEPROM_CHANNEL_PLAN_ETSI 0x2
  371. #define EEPROM_CHANNEL_PLAN_SPAIN 0x3
  372. #define EEPROM_CHANNEL_PLAN_FRANCE 0x4
  373. #define EEPROM_CHANNEL_PLAN_MKK 0x5
  374. #define EEPROM_CHANNEL_PLAN_MKK1 0x6
  375. #define EEPROM_CHANNEL_PLAN_ISRAEL 0x7
  376. #define EEPROM_CHANNEL_PLAN_TELEC 0x8
  377. #define EEPROM_CHANNEL_PLAN_GLOBAL_DOMAIN 0x9
  378. #define EEPROM_CHANNEL_PLAN_WORLD_WIDE_13 0xA
  379. #define EEPROM_CHANNEL_PLAN_NCC_TAIWAN 0xB
  380. #define EEPROM_CHANNEL_PLAN_CHIAN 0XC
  381. #define EEPROM_CHANNEL_PLAN_SINGAPORE_INDIA_MEXICO 0XD
  382. #define EEPROM_CHANNEL_PLAN_KOREA 0xE
  383. #define EEPROM_CHANNEL_PLAN_TURKEY 0xF
  384. #define EEPROM_CHANNEL_PLAN_JAPAN 0x10
  385. #define EEPROM_CHANNEL_PLAN_FCC_NO_DFS 0x11
  386. #define EEPROM_CHANNEL_PLAN_JAPAN_NO_DFS 0x12
  387. #define EEPROM_CHANNEL_PLAN_WORLD_WIDE_5G 0x13
  388. #define EEPROM_CHANNEL_PLAN_TAIWAN_NO_DFS 0x14
  389. #define EEPROM_USB_OPTIONAL1 0xE
  390. #define EEPROM_CHANNEL_PLAN_BY_HW_MASK 0x80
  391. #define RTL_EEPROM_ID 0x8129
  392. #define EEPROM_Default_TSSI 0x0
  393. #define EEPROM_Default_BoardType 0x02
  394. #define EEPROM_Default_ThermalMeter 0x12
  395. #define EEPROM_Default_ThermalMeter_92SU 0x7
  396. #define EEPROM_Default_ThermalMeter_88E 0x18
  397. #define EEPROM_Default_ThermalMeter_8812 0x18
  398. #define EEPROM_Default_ThermalMeter_8192E 0x1A
  399. #define EEPROM_Default_ThermalMeter_8723B 0x18
  400. #define EEPROM_Default_CrystalCap 0x0
  401. #define EEPROM_Default_CrystalCap_8723A 0x20
  402. #define EEPROM_Default_CrystalCap_88E 0x20
  403. #define EEPROM_Default_CrystalCap_8812 0x20
  404. #define EEPROM_Default_CrystalCap_8192E 0x20
  405. #define EEPROM_Default_CrystalCap_8723B 0x20
  406. #define EEPROM_Default_CrystalFreq 0x0
  407. #define EEPROM_Default_TxPowerLevel_92C 0x22
  408. #define EEPROM_Default_TxPowerLevel_2G 0x2C
  409. #define EEPROM_Default_TxPowerLevel_5G 0x22
  410. #define EEPROM_Default_TxPowerLevel 0x22
  411. #define EEPROM_Default_HT40_2SDiff 0x0
  412. #define EEPROM_Default_HT20_Diff 2
  413. #define EEPROM_Default_LegacyHTTxPowerDiff 0x3
  414. #define EEPROM_Default_LegacyHTTxPowerDiff_92C 0x3
  415. #define EEPROM_Default_LegacyHTTxPowerDiff_92D 0x4
  416. #define EEPROM_Default_HT40_PwrMaxOffset 0
  417. #define EEPROM_Default_HT20_PwrMaxOffset 0
  418. #define EEPROM_Default_PID 0x1234
  419. #define EEPROM_Default_VID 0x5678
  420. #define EEPROM_Default_CustomerID 0xAB
  421. #define EEPROM_Default_CustomerID_8188E 0x00
  422. #define EEPROM_Default_SubCustomerID 0xCD
  423. #define EEPROM_Default_Version 0
  424. #define EEPROM_Default_externalPA_C9 0x00
  425. #define EEPROM_Default_externalPA_CC 0xFF
  426. #define EEPROM_Default_internalPA_SP3T_C9 0xAA
  427. #define EEPROM_Default_internalPA_SP3T_CC 0xAF
  428. #define EEPROM_Default_internalPA_SPDT_C9 0xAA
  429. #ifdef CONFIG_PCI_HCI
  430. #define EEPROM_Default_internalPA_SPDT_CC 0xA0
  431. #else
  432. #define EEPROM_Default_internalPA_SPDT_CC 0xFA
  433. #endif
  434. #define EEPROM_Default_PAType 0
  435. #define EEPROM_Default_LNAType 0
  436. //New EFUSE deafult value
  437. #define EEPROM_DEFAULT_24G_INDEX 0x2A
  438. #define EEPROM_DEFAULT_24G_HT20_DIFF 0X02
  439. #define EEPROM_DEFAULT_24G_OFDM_DIFF 0X04
  440. #define EEPROM_DEFAULT_5G_INDEX 0X2A
  441. #define EEPROM_DEFAULT_5G_HT20_DIFF 0X00
  442. #define EEPROM_DEFAULT_5G_OFDM_DIFF 0X04
  443. #define EEPROM_DEFAULT_DIFF 0XFE
  444. #define EEPROM_DEFAULT_CHANNEL_PLAN 0x7F
  445. #define EEPROM_DEFAULT_BOARD_OPTION 0x00
  446. #define EEPROM_DEFAULT_RFE_OPTION 0x04
  447. #define EEPROM_DEFAULT_FEATURE_OPTION 0x00
  448. #define EEPROM_DEFAULT_BT_OPTION 0x10
  449. #define EEPROM_DEFAULT_TX_CALIBRATE_RATE 0x00
  450. //
  451. // For VHT series TX power by rate table.
  452. // VHT TX power by rate off setArray =
  453. // Band:-2G&5G = 0 / 1
  454. // RF: at most 4*4 = ABCD=0/1/2/3
  455. // CCK=0 OFDM=1/2 HT-MCS 0-15=3/4/56 VHT=7/8/9/10/11
  456. //
  457. #define TX_PWR_BY_RATE_NUM_BAND 2
  458. #define TX_PWR_BY_RATE_NUM_RF 4
  459. #define TX_PWR_BY_RATE_NUM_SECTION 12
  460. //----------------------------------------------------------------------------
  461. // EEPROM/EFUSE data structure definition.
  462. //----------------------------------------------------------------------------
  463. #define MAX_RF_PATH_NUM 2
  464. #define MAX_CHNL_GROUP 3+9
  465. typedef struct _TxPowerInfo{
  466. u8 CCKIndex[MAX_RF_PATH_NUM][MAX_CHNL_GROUP];
  467. u8 HT40_1SIndex[MAX_RF_PATH_NUM][MAX_CHNL_GROUP];
  468. u8 HT40_2SIndexDiff[MAX_RF_PATH_NUM][MAX_CHNL_GROUP];
  469. s8 HT20IndexDiff[MAX_RF_PATH_NUM][MAX_CHNL_GROUP];
  470. u8 OFDMIndexDiff[MAX_RF_PATH_NUM][MAX_CHNL_GROUP];
  471. u8 HT40MaxOffset[MAX_RF_PATH_NUM][MAX_CHNL_GROUP];
  472. u8 HT20MaxOffset[MAX_RF_PATH_NUM][MAX_CHNL_GROUP];
  473. u8 TSSI_A[3];
  474. u8 TSSI_B[3];
  475. u8 TSSI_A_5G[3]; //5GL/5GM/5GH
  476. u8 TSSI_B_5G[3];
  477. }TxPowerInfo, *PTxPowerInfo;
  478. //For 88E new structure
  479. /*
  480. 2.4G:
  481. {
  482. {1,2},
  483. {3,4,5},
  484. {6,7,8},
  485. {9,10,11},
  486. {12,13},
  487. {14}
  488. }
  489. 5G:
  490. {
  491. {36,38,40},
  492. {44,46,48},
  493. {52,54,56},
  494. {60,62,64},
  495. {100,102,104},
  496. {108,110,112},
  497. {116,118,120},
  498. {124,126,128},
  499. {132,134,136},
  500. {140,142,144},
  501. {149,151,153},
  502. {157,159,161},
  503. {173,175,177},
  504. }
  505. */
  506. #define MAX_RF_PATH 4
  507. #define RF_PATH_MAX MAX_RF_PATH
  508. #define MAX_CHNL_GROUP_24G 6
  509. #define MAX_CHNL_GROUP_5G 14
  510. //It must always set to 4, otherwise read efuse table secquence will be wrong.
  511. #define MAX_TX_COUNT 4
  512. typedef struct _TxPowerInfo24G{
  513. u8 IndexCCK_Base[MAX_RF_PATH][MAX_CHNL_GROUP_24G];
  514. u8 IndexBW40_Base[MAX_RF_PATH][MAX_CHNL_GROUP_24G-1];
  515. //If only one tx, only BW20 and OFDM are used.
  516. s8 CCK_Diff[MAX_RF_PATH][MAX_TX_COUNT];
  517. s8 OFDM_Diff[MAX_RF_PATH][MAX_TX_COUNT];
  518. s8 BW20_Diff[MAX_RF_PATH][MAX_TX_COUNT];
  519. s8 BW40_Diff[MAX_RF_PATH][MAX_TX_COUNT];
  520. }TxPowerInfo24G, *PTxPowerInfo24G;
  521. typedef struct _TxPowerInfo5G{
  522. u8 IndexBW40_Base[MAX_RF_PATH][MAX_CHNL_GROUP_5G];
  523. //If only one tx, only BW20, OFDM, BW80 and BW160 are used.
  524. s8 OFDM_Diff[MAX_RF_PATH][MAX_TX_COUNT];
  525. s8 BW20_Diff[MAX_RF_PATH][MAX_TX_COUNT];
  526. s8 BW40_Diff[MAX_RF_PATH][MAX_TX_COUNT];
  527. s8 BW80_Diff[MAX_RF_PATH][MAX_TX_COUNT];
  528. s8 BW160_Diff[MAX_RF_PATH][MAX_TX_COUNT];
  529. }TxPowerInfo5G, *PTxPowerInfo5G;
  530. typedef enum _BT_Ant_NUM{
  531. Ant_x2 = 0,
  532. Ant_x1 = 1
  533. } BT_Ant_NUM, *PBT_Ant_NUM;
  534. typedef enum _BT_CoType{
  535. BT_2Wire = 0,
  536. BT_ISSC_3Wire = 1,
  537. BT_ACCEL = 2,
  538. BT_CSR_BC4 = 3,
  539. BT_CSR_BC8 = 4,
  540. BT_RTL8756 = 5,
  541. BT_RTL8723A = 6,
  542. BT_RTL8821 = 7,
  543. BT_RTL8723B = 8,
  544. } BT_CoType, *PBT_CoType;
  545. typedef enum _BT_RadioShared{
  546. BT_Radio_Shared = 0,
  547. BT_Radio_Individual = 1,
  548. } BT_RadioShared, *PBT_RadioShared;
  549. #endif