31 #define EXT_ILP_HZ 32768
38 #define ILP_CALC_DUR 10
41 #define PCTL_ILP_DIV_MASK 0xffff0000
42 #define PCTL_ILP_DIV_SHIFT 16
43 #define PCTL_PLL_PLLCTL_UPD 0x00000400
44 #define PCTL_NOILP_ON_WAIT 0x00000200
45 #define PCTL_HT_REQ_EN 0x00000100
46 #define PCTL_ALP_REQ_EN 0x00000080
47 #define PCTL_XTALFREQ_MASK 0x0000007c
48 #define PCTL_XTALFREQ_SHIFT 2
49 #define PCTL_ILP_DIV_EN 0x00000002
50 #define PCTL_LPO_SEL 0x00000001
53 #define ILP_CLOCK 32000
56 #define ALP_CLOCK 20000000
59 #define PST_EXTLPOAVAIL 0x0100
60 #define PST_WDRESET 0x0080
61 #define PST_INTPEND 0x0040
62 #define PST_SBCLKST 0x0030
63 #define PST_SBCLKST_ILP 0x0010
64 #define PST_SBCLKST_ALP 0x0020
65 #define PST_SBCLKST_HT 0x0030
66 #define PST_ALPAVAIL 0x0008
67 #define PST_HTAVAIL 0x0004
68 #define PST_RESINIT 0x0003
71 #define PMURES_BIT(bit) (1 << (bit))
79 #define PMU_XTALFREQ_REG_ILPCTR_MASK 0x00001FFF
80 #define PMU_XTALFREQ_REG_MEASURE_MASK 0x80000000
81 #define PMU_XTALFREQ_REG_MEASURE_SHIFT 31
84 #define RES4313_BB_PU_RSRC 0
85 #define RES4313_ILP_REQ_RSRC 1
86 #define RES4313_XTAL_PU_RSRC 2
87 #define RES4313_ALP_AVAIL_RSRC 3
88 #define RES4313_RADIO_PU_RSRC 4
89 #define RES4313_BG_PU_RSRC 5
90 #define RES4313_VREG1P4_PU_RSRC 6
91 #define RES4313_AFE_PWRSW_RSRC 7
92 #define RES4313_RX_PWRSW_RSRC 8
93 #define RES4313_TX_PWRSW_RSRC 9
94 #define RES4313_BB_PWRSW_RSRC 10
95 #define RES4313_SYNTH_PWRSW_RSRC 11
96 #define RES4313_MISC_PWRSW_RSRC 12
97 #define RES4313_BB_PLL_PWRSW_RSRC 13
98 #define RES4313_HT_AVAIL_RSRC 14
99 #define RES4313_MACPHY_CLK_AVAIL_RSRC 15
105 switch (ai_get_chip_id(sih)) {
158 switch (ai_get_chip_id(sih)) {
163 clock = 20000 * 1000;
178 if (ai_get_pmurev(sih) < 10)
182 core = sii->
icbus->drv_cc.core;
198 ilp_ctr = bcma_read32(core,
CHIPCREGOFFS(pmu_xtalfreq)) &
214 alp_khz = (alp_hz + 50000) / 100000 * 100;