18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright (c) 2015 Qualcomm Atheros Inc.
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Permission to use, copy, modify, and/or distribute this software for any
58c2ecf20Sopenharmony_ci * purpose with or without fee is hereby granted, provided that the above
68c2ecf20Sopenharmony_ci * copyright notice and this permission notice appear in all copies.
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
98c2ecf20Sopenharmony_ci * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
108c2ecf20Sopenharmony_ci * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
118c2ecf20Sopenharmony_ci * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
128c2ecf20Sopenharmony_ci * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
138c2ecf20Sopenharmony_ci * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
148c2ecf20Sopenharmony_ci * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
158c2ecf20Sopenharmony_ci */
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#ifndef REG_AIC_H
188c2ecf20Sopenharmony_ci#define REG_AIC_H
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci#define AR_SM_BASE                              0xa200
218c2ecf20Sopenharmony_ci#define AR_SM1_BASE                             0xb200
228c2ecf20Sopenharmony_ci#define AR_AGC_BASE                             0x9e00
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CTRL_0_B0                    (AR_SM_BASE + 0x4b0)
258c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CTRL_1_B0                    (AR_SM_BASE + 0x4b4)
268c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CTRL_2_B0                    (AR_SM_BASE + 0x4b8)
278c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CTRL_3_B0                    (AR_SM_BASE + 0x4bc)
288c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CTRL_4_B0                    (AR_SM_BASE + 0x4c0)
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#define AR_PHY_AIC_STAT_0_B0                    (AR_SM_BASE + 0x4c4)
318c2ecf20Sopenharmony_ci#define AR_PHY_AIC_STAT_1_B0                    (AR_SM_BASE + 0x4c8)
328c2ecf20Sopenharmony_ci#define AR_PHY_AIC_STAT_2_B0                    (AR_SM_BASE + 0x4cc)
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CTRL_0_B1                    (AR_SM1_BASE + 0x4b0)
358c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CTRL_1_B1                    (AR_SM1_BASE + 0x4b4)
368c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CTRL_4_B1                    (AR_SM1_BASE + 0x4c0)
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci#define AR_PHY_AIC_STAT_0_B1                    (AR_SM1_BASE + 0x4c4)
398c2ecf20Sopenharmony_ci#define AR_PHY_AIC_STAT_1_B1                    (AR_SM1_BASE + 0x4c8)
408c2ecf20Sopenharmony_ci#define AR_PHY_AIC_STAT_2_B1                    (AR_SM1_BASE + 0x4cc)
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci#define AR_PHY_AIC_SRAM_ADDR_B0                 (AR_SM_BASE + 0x5f0)
438c2ecf20Sopenharmony_ci#define AR_PHY_AIC_SRAM_DATA_B0                 (AR_SM_BASE + 0x5f4)
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci#define AR_PHY_AIC_SRAM_ADDR_B1                 (AR_SM1_BASE + 0x5f0)
468c2ecf20Sopenharmony_ci#define AR_PHY_AIC_SRAM_DATA_B1                 (AR_SM1_BASE + 0x5f4)
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci#define AR_PHY_BT_COEX_4                        (AR_AGC_BASE + 0x60)
498c2ecf20Sopenharmony_ci#define AR_PHY_BT_COEX_5                        (AR_AGC_BASE + 0x64)
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci/* AIC fields */
528c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MON_ENABLE                   0x80000000
538c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MON_ENABLE_S                 31
548c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_MAX_HOP_COUNT            0x7F000000
558c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_MAX_HOP_COUNT_S          24
568c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_MIN_VALID_COUNT          0x00FE0000
578c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_MIN_VALID_COUNT_S        17
588c2ecf20Sopenharmony_ci#define AR_PHY_AIC_F_WLAN                       0x0001FC00
598c2ecf20Sopenharmony_ci#define AR_PHY_AIC_F_WLAN_S                     10
608c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_CH_VALID_RESET           0x00000200
618c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_CH_VALID_RESET_S         9
628c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_ENABLE                   0x00000100
638c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_ENABLE_S                 8
648c2ecf20Sopenharmony_ci#define AR_PHY_AIC_BTTX_PWR_THR                 0x000000FE
658c2ecf20Sopenharmony_ci#define AR_PHY_AIC_BTTX_PWR_THR_S               1
668c2ecf20Sopenharmony_ci#define AR_PHY_AIC_ENABLE                       0x00000001
678c2ecf20Sopenharmony_ci#define AR_PHY_AIC_ENABLE_S                     0
688c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_BT_REF_DELAY             0x00F00000
698c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_BT_REF_DELAY_S           20
708c2ecf20Sopenharmony_ci#define AR_PHY_AIC_BT_IDLE_CFG                  0x00080000
718c2ecf20Sopenharmony_ci#define AR_PHY_AIC_BT_IDLE_CFG_S                19
728c2ecf20Sopenharmony_ci#define AR_PHY_AIC_STDBY_COND                   0x00060000
738c2ecf20Sopenharmony_ci#define AR_PHY_AIC_STDBY_COND_S                 17
748c2ecf20Sopenharmony_ci#define AR_PHY_AIC_STDBY_ROT_ATT_DB             0x0001F800
758c2ecf20Sopenharmony_ci#define AR_PHY_AIC_STDBY_ROT_ATT_DB_S           11
768c2ecf20Sopenharmony_ci#define AR_PHY_AIC_STDBY_COM_ATT_DB             0x00000700
778c2ecf20Sopenharmony_ci#define AR_PHY_AIC_STDBY_COM_ATT_DB_S           8
788c2ecf20Sopenharmony_ci#define AR_PHY_AIC_RSSI_MAX                     0x000000F0
798c2ecf20Sopenharmony_ci#define AR_PHY_AIC_RSSI_MAX_S                   4
808c2ecf20Sopenharmony_ci#define AR_PHY_AIC_RSSI_MIN                     0x0000000F
818c2ecf20Sopenharmony_ci#define AR_PHY_AIC_RSSI_MIN_S                   0
828c2ecf20Sopenharmony_ci#define AR_PHY_AIC_RADIO_DELAY                  0x7F000000
838c2ecf20Sopenharmony_ci#define AR_PHY_AIC_RADIO_DELAY_S                24
848c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_STEP_SIZE_CORR           0x00F00000
858c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_STEP_SIZE_CORR_S         20
868c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_ROT_IDX_CORR             0x000F8000
878c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_ROT_IDX_CORR_S           15
888c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_CONV_CHECK_FACTOR        0x00006000
898c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_CONV_CHECK_FACTOR_S      13
908c2ecf20Sopenharmony_ci#define AR_PHY_AIC_ROT_IDX_COUNT_MAX            0x00001C00
918c2ecf20Sopenharmony_ci#define AR_PHY_AIC_ROT_IDX_COUNT_MAX_S          10
928c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_SYNTH_TOGGLE             0x00000200
938c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_SYNTH_TOGGLE_S           9
948c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_SYNTH_AFTER_BTRX         0x00000100
958c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_SYNTH_AFTER_BTRX_S       8
968c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_SYNTH_SETTLING           0x000000FF
978c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_SYNTH_SETTLING_S         0
988c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MON_MAX_HOP_COUNT            0x07F00000
998c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MON_MAX_HOP_COUNT_S          20
1008c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MON_MIN_STALE_COUNT          0x000FE000
1018c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MON_MIN_STALE_COUNT_S        13
1028c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MON_PWR_EST_LONG             0x00001000
1038c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MON_PWR_EST_LONG_S           12
1048c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MON_PD_TALLY_SCALING         0x00000C00
1058c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MON_PD_TALLY_SCALING_S       10
1068c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MON_PERF_THR                 0x000003E0
1078c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MON_PERF_THR_S               5
1088c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_TARGET_MAG_SETTING       0x00000018
1098c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_TARGET_MAG_SETTING_S     3
1108c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_PERF_CHECK_FACTOR        0x00000006
1118c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_PERF_CHECK_FACTOR_S      1
1128c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_PWR_EST_LONG             0x00000001
1138c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_PWR_EST_LONG_S           0
1148c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MON_DONE                     0x80000000
1158c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MON_DONE_S                   31
1168c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MON_ACTIVE                   0x40000000
1178c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MON_ACTIVE_S                 30
1188c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MEAS_COUNT                   0x3F000000
1198c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MEAS_COUNT_S                 24
1208c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_ANT_ISO_EST              0x00FC0000
1218c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_ANT_ISO_EST_S            18
1228c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_HOP_COUNT                0x0003F800
1238c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_HOP_COUNT_S              11
1248c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_VALID_COUNT              0x000007F0
1258c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_VALID_COUNT_S            4
1268c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_BT_TOO_WEAK_ERR          0x00000008
1278c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_BT_TOO_WEAK_ERR_S        3
1288c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_BT_TOO_STRONG_ERR        0x00000004
1298c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_BT_TOO_STRONG_ERR_S      2
1308c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_DONE                     0x00000002
1318c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_DONE_S                   1
1328c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_ACTIVE                   0x00000001
1338c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_ACTIVE_S                 0
1348c2ecf20Sopenharmony_ci
1358c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MEAS_MAG_MIN                 0xFFC00000
1368c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MEAS_MAG_MIN_S               22
1378c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MON_STALE_COUNT              0x003F8000
1388c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MON_STALE_COUNT_S            15
1398c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MON_HOP_COUNT                0x00007F00
1408c2ecf20Sopenharmony_ci#define AR_PHY_AIC_MON_HOP_COUNT_S              8
1418c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_AIC_SM                   0x000000F8
1428c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_AIC_SM_S                 3
1438c2ecf20Sopenharmony_ci#define AR_PHY_AIC_SM                           0x00000007
1448c2ecf20Sopenharmony_ci#define AR_PHY_AIC_SM_S                         0
1458c2ecf20Sopenharmony_ci#define AR_PHY_AIC_SRAM_VALID                   0x00000001
1468c2ecf20Sopenharmony_ci#define AR_PHY_AIC_SRAM_VALID_S                 0
1478c2ecf20Sopenharmony_ci#define AR_PHY_AIC_SRAM_ROT_QUAD_ATT_DB         0x0000007E
1488c2ecf20Sopenharmony_ci#define AR_PHY_AIC_SRAM_ROT_QUAD_ATT_DB_S       1
1498c2ecf20Sopenharmony_ci#define AR_PHY_AIC_SRAM_VGA_QUAD_SIGN           0x00000080
1508c2ecf20Sopenharmony_ci#define AR_PHY_AIC_SRAM_VGA_QUAD_SIGN_S         7
1518c2ecf20Sopenharmony_ci#define AR_PHY_AIC_SRAM_ROT_DIR_ATT_DB          0x00003F00
1528c2ecf20Sopenharmony_ci#define AR_PHY_AIC_SRAM_ROT_DIR_ATT_DB_S        8
1538c2ecf20Sopenharmony_ci#define AR_PHY_AIC_SRAM_VGA_DIR_SIGN            0x00004000
1548c2ecf20Sopenharmony_ci#define AR_PHY_AIC_SRAM_VGA_DIR_SIGN_S          14
1558c2ecf20Sopenharmony_ci#define AR_PHY_AIC_SRAM_COM_ATT_6DB             0x00038000
1568c2ecf20Sopenharmony_ci#define AR_PHY_AIC_SRAM_COM_ATT_6DB_S           15
1578c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_ROT_ATT_DB_EST_ISO       0x0000E000
1588c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_ROT_ATT_DB_EST_ISO_S     13
1598c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_COM_ATT_DB_EST_ISO       0x00001E00
1608c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_COM_ATT_DB_EST_ISO_S     9
1618c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_ISO_EST_INIT_SETTING     0x000001F8
1628c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_ISO_EST_INIT_SETTING_S   3
1638c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_COM_ATT_DB_BACKOFF       0x00000006
1648c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_COM_ATT_DB_BACKOFF_S     1
1658c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_COM_ATT_DB_FIXED         0x00000001
1668c2ecf20Sopenharmony_ci#define AR_PHY_AIC_CAL_COM_ATT_DB_FIXED_S       0
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_ci#endif /* REG_AIC_H */
169