• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * SiliconBackplane GCI core hardware definitions
3  *
4  * Copyright (C) 1999-2019, Broadcom.
5  *
6  *      Unless you and Broadcom execute a separate written software license
7  * agreement governing use of this software, this software is licensed to you
8  * under the terms of the GNU General Public License version 2 (the "GPL"),
9  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10  * following added to such license:
11  *
12  *      As a special exception, the copyright holders of this software give you
13  * permission to link this software with independent modules, and to copy and
14  * distribute the resulting executable under terms of your choice, provided that
15  * you also meet, for each linked independent module, the terms and conditions
16  * of the license of that module.  An independent module is a module which is
17  * not derived from this software.  The special exception does not apply to any
18  * modifications of the software.
19  *
20  *      Notwithstanding the above, under no circumstances may you combine this
21  * software in any way with any other Broadcom software provided under a license
22  * other than the GPL, without Broadcom's express prior written consent.
23  *
24  *
25  * <<Broadcom-WL-IPTag/Open:>>
26  *
27  * $Id: sbgci.h 696881 2017-04-28 17:20:35Z $
28  */
29 
30 #ifndef _SBGCI_H
31 #define _SBGCI_H
32 
33 #include <bcmutils.h>
34 
35 #if !defined(_LANGUAGE_ASSEMBLY) && !defined(__ASSEMBLY__)
36 
37 /* cpp contortions to concatenate w/arg prescan */
38 #ifndef PAD
39 #define _PADLINE(line) pad##line
40 #define _XSTR(line) _PADLINE(line)
41 #define PAD _XSTR(__LINE__)
42 #endif /* PAD */
43 
44 #define GCI_OFFSETOF(sih, reg)                                                 \
45     (AOB_ENAB(sih) ? OFFSETOF(gciregs_t, reg) : OFFSETOF(chipcregs_t, reg))
46 #define GCI_CORE_IDX(sih)                                                      \
47     (AOB_ENAB(sih) ? si_findcoreidx(sih, GCI_CORE_ID, 0) : SI_CC_IDX)
48 
49 typedef volatile struct {
50     uint32 gci_corecaps0;        /* 0x000 */
51     uint32 gci_corecaps1;        /* 0x004 */
52     uint32 gci_corecaps2;        /* 0x008 */
53     uint32 gci_corectrl;         /* 0x00c */
54     uint32 gci_corestat;         /* 0x010 */
55     uint32 gci_intstat;          /* 0x014 */
56     uint32 gci_intmask;          /* 0x018 */
57     uint32 gci_wakemask;         /* 0x01c */
58     uint32 gci_levelintstat;     /* 0x020 */
59     uint32 gci_eventintstat;     /* 0x024 */
60     uint32 gci_wakelevelintstat; /* 0x028 */
61     uint32 gci_wakeeventintstat; /* 0x02c */
62     uint32 semaphoreintstatus;   /* 0x030 */
63     uint32 semaphoreintmask;     /* 0x034 */
64     uint32 semaphorerequest;     /* 0x038 */
65     uint32 semaphorereserve;     /* 0x03c */
66     uint32 gci_indirect_addr;    /* 0x040 */
67     uint32 gci_gpioctl;          /* 0x044 */
68     uint32 gci_gpiostatus;       /* 0x048 */
69     uint32 gci_gpiomask;         /* 0x04c */
70     uint32 gci_eventsummary;     /* 0x050 */
71     uint32 gci_miscctl;          /* 0x054 */
72     uint32 gci_gpiointmask;      /* 0x058 */
73     uint32 gci_gpiowakemask;     /* 0x05c */
74     uint32 gci_input[32];        /* 0x060 */
75     uint32 gci_event[32];        /* 0x0e0 */
76     uint32 gci_output[4];        /* 0x160 */
77     uint32 gci_control_0;        /* 0x170 */
78     uint32 gci_control_1;        /* 0x174 */
79     uint32 gci_intpolreg;        /* 0x178 */
80     uint32 gci_levelintmask;     /* 0x17c */
81     uint32 gci_eventintmask;     /* 0x180 */
82     uint32 wakelevelintmask;     /* 0x184 */
83     uint32 wakeeventintmask;     /* 0x188 */
84     uint32 hwmask;               /* 0x18c */
85     uint32 PAD;
86     uint32 gci_inbandeventintmask; /* 0x194 */
87     uint32 PAD;
88     uint32 gci_inbandeventstatus;                 /* 0x19c */
89     uint32 gci_seciauxtx;                         /* 0x1a0 */
90     uint32 gci_seciauxrx;                         /* 0x1a4 */
91     uint32 gci_secitx_datatag;                    /* 0x1a8 */
92     uint32 gci_secirx_datatag;                    /* 0x1ac */
93     uint32 gci_secitx_datamask;                   /* 0x1b0 */
94     uint32 gci_seciusef0tx_reg;                   /* 0x1b4 */
95     uint32 gci_secif0tx_offset;                   /* 0x1b8 */
96     uint32 gci_secif0rx_offset;                   /* 0x1bc */
97     uint32 gci_secif1tx_offset;                   /* 0x1c0 */
98     uint32 gci_rxfifo_common_ctrl;                /* 0x1c4 */
99     uint32 gci_rxfifoctrl;                        /* 0x1c8 */
100     uint32 gci_hw_sema_status;                    /* 0x1cc */
101     uint32 gci_seciuartescval;                    /* 0x1d0 */
102     uint32 gic_seciuartautobaudctr;               /* 0x1d4 */
103     uint32 gci_secififolevel;                     /* 0x1d8 */
104     uint32 gci_seciuartdata;                      /* 0x1dc */
105     uint32 gci_secibauddiv;                       /* 0x1e0 */
106     uint32 gci_secifcr;                           /* 0x1e4 */
107     uint32 gci_secilcr;                           /* 0x1e8 */
108     uint32 gci_secimcr;                           /* 0x1ec */
109     uint32 gci_secilsr;                           /* 0x1f0 */
110     uint32 gci_secimsr;                           /* 0x1f4 */
111     uint32 gci_baudadj;                           /* 0x1f8 */
112     uint32 gci_inbandintmask;                     /* 0x1fc */
113     uint32 gci_chipctrl;                          /* 0x200 */
114     uint32 gci_chipsts;                           /* 0x204 */
115     uint32 gci_gpioout;                           /* 0x208 */
116     uint32 gci_gpioout_read;                      /* 0x20C */
117     uint32 gci_mpwaketx;                          /* 0x210 */
118     uint32 gci_mpwakedetect;                      /* 0x214 */
119     uint32 gci_seciin_ctrl;                       /* 0x218 */
120     uint32 gci_seciout_ctrl;                      /* 0x21C */
121     uint32 gci_seciin_auxfifo_en;                 /* 0x220 */
122     uint32 gci_seciout_txen_txbr;                 /* 0x224 */
123     uint32 gci_seciin_rxbrstatus;                 /* 0x228 */
124     uint32 gci_seciin_rxerrstatus;                /* 0x22C */
125     uint32 gci_seciin_fcstatus;                   /* 0x230 */
126     uint32 gci_seciout_txstatus;                  /* 0x234 */
127     uint32 gci_seciout_txbrstatus;                /* 0x238 */
128     uint32 wlan_mem_info;                         /* 0x23C */
129     uint32 wlan_bankxinfo;                        /* 0x240 */
130     uint32 bt_smem_select;                        /* 0x244 */
131     uint32 bt_smem_stby;                          /* 0x248 */
132     uint32 bt_smem_status;                        /* 0x24C */
133     uint32 wlan_bankxactivepda;                   /* 0x250 */
134     uint32 wlan_bankxsleeppda;                    /* 0x254 */
135     uint32 wlan_bankxkill;                        /* 0x258 */
136     uint32 PAD[PADSZ(0x25c, 0x268)];              /* 0x25c-0x268 */
137     uint32 bt_smem_control0;                      /* 0x26C */
138     uint32 bt_smem_control1;                      /* 0x270 */
139     uint32 PAD[PADSZ(0x274, 0x2fc)];              /* 0x274-0x2fc */
140     uint32 gci_chipid;                            /* 0x300 */
141     uint32 PAD[PADSZ(0x304, 0x30c)];              /* 0x304-0x30c */
142     uint32 otpstatus;                             /* 0x310 */
143     uint32 otpcontrol;                            /* 0x314 */
144     uint32 otpprog;                               /* 0x318 */
145     uint32 otplayout;                             /* 0x31c */
146     uint32 otplayoutextension;                    /* 0x320 */
147     uint32 otpcontrol1;                           /* 0x324 */
148     uint32 otpprogdata;                           /* 0x328 */
149     uint32 PAD[PADSZ(0x32c, 0x3f8)];              /* 0x32c-0x3f8 */
150     uint32 otpECCstatus;                          /* 0x3FC */
151     uint32 PAD[PADSZ(0x400, 0xbfc)];              /* 0x400-0xbfc */
152     uint32 lhl_core_capab_adr;                    /* 0xC00 */
153     uint32 lhl_main_ctl_adr;                      /* 0xC04 */
154     uint32 lhl_pmu_ctl_adr;                       /* 0xC08 */
155     uint32 lhl_extlpo_ctl_adr;                    /* 0xC0C */
156     uint32 lpo_ctl_adr;                           /* 0xC10 */
157     uint32 lhl_lpo2_ctl_adr;                      /* 0xC14 */
158     uint32 lhl_osc32k_ctl_adr;                    /* 0xC18 */
159     uint32 lhl_clk_status_adr;                    /* 0xC1C */
160     uint32 lhl_clk_det_ctl_adr;                   /* 0xC20 */
161     uint32 lhl_clk_sel_adr;                       /* 0xC24 */
162     uint32 hidoff_cnt_adr[2];                     /* 0xC28-0xC2C */
163     uint32 lhl_autoclk_ctl_adr;                   /* 0xC30 */
164     uint32 PAD;                                   /* reserved */
165     uint32 lhl_hibtim_adr;                        /* 0xC38 */
166     uint32 lhl_wl_ilp_val_adr;                    /* 0xC3C */
167     uint32 lhl_wl_armtim0_intrp_adr;              /* 0xC40 */
168     uint32 lhl_wl_armtim0_st_adr;                 /* 0xC44 */
169     uint32 lhl_wl_armtim0_adr;                    /* 0xC48 */
170     uint32 PAD[PADSZ(0xc4c, 0xc6c)];              /* 0xC4C-0xC6C */
171     uint32 lhl_wl_mactim0_intrp_adr;              /* 0xC70 */
172     uint32 lhl_wl_mactim0_st_adr;                 /* 0xC74 */
173     uint32 lhl_wl_mactim_int0_adr;                /* 0xC78 */
174     uint32 lhl_wl_mactim_frac0_adr;               /* 0xC7C */
175     uint32 lhl_wl_mactim1_intrp_adr;              /* 0xC80 */
176     uint32 lhl_wl_mactim1_st_adr;                 /* 0xC84 */
177     uint32 lhl_wl_mactim_int1_adr;                /* 0xC88 */
178     uint32 lhl_wl_mactim_frac1_adr;               /* 0xC8C */
179     uint32 PAD[PADSZ(0xc90, 0xcac)];              /* 0xC90-0xCAC */
180     uint32 gpio_int_en_port_adr[4];               /* 0xCB0-0xCBC */
181     uint32 gpio_int_st_port_adr[4];               /* 0xCC0-0xCCC */
182     uint32 gpio_ctrl_iocfg_p_adr[40];             /* 0xCD0-0xD6C */
183     uint32 lhl_lp_up_ctl1_adr;                    /* 0xd70 */
184     uint32 lhl_lp_dn_ctl1_adr;                    /* 0xd74 */
185     uint32 PAD[PADSZ(0xd78, 0xdb4)];              /* 0xd78-0xdb4 */
186     uint32 lhl_sleep_timer_adr;                   /* 0xDB8 */
187     uint32 lhl_sleep_timer_ctl_adr;               /* 0xDBC */
188     uint32 lhl_sleep_timer_load_val_adr;          /* 0xDC0 */
189     uint32 lhl_lp_main_ctl_adr;                   /* 0xDC4 */
190     uint32 lhl_lp_up_ctl_adr;                     /* 0xDC8 */
191     uint32 lhl_lp_dn_ctl_adr;                     /* 0xDCC */
192     uint32 gpio_gctrl_iocfg_p0_p39_adr;           /* 0xDD0 */
193     uint32 gpio_gdsctrl_iocfg_p0_p25_p30_p39_adr; /* 0xDD4 */
194     uint32 gpio_gdsctrl_iocfg_p26_p29_adr;        /* 0xDD8 */
195     uint32 PAD[PADSZ(0xddc, 0xdf8)];              /* 0xDDC-0xDF8 */
196     uint32 lhl_gpio_din0_adr;                     /* 0xDFC */
197     uint32 lhl_gpio_din1_adr;                     /* 0xE00 */
198     uint32 lhl_wkup_status_adr;                   /* 0xE04 */
199     uint32 lhl_ctl_adr;                           /* 0xE08 */
200     uint32 lhl_adc_ctl_adr;                       /* 0xE0C */
201     uint32 lhl_qdxyz_in_dly_adr;                  /* 0xE10 */
202     uint32 lhl_optctl_adr;                        /* 0xE14 */
203     uint32 lhl_optct2_adr;                        /* 0xE18 */
204     uint32 lhl_scanp_cntr_init_val_adr;           /* 0xE1C */
205     uint32 lhl_opt_togg_val_adr[6];               /* 0xE20-0xE34 */
206     uint32 lhl_optx_smp_val_adr;                  /* 0xE38 */
207     uint32 lhl_opty_smp_val_adr;                  /* 0xE3C */
208     uint32 lhl_optz_smp_val_adr;                  /* 0xE40 */
209     uint32 lhl_hidoff_keepstate_adr[3];           /* 0xE44-0xE4C */
210     uint32 lhl_bt_slmboot_ctl0_adr[4];            /* 0xE50-0xE5C */
211     uint32 lhl_wl_fw_ctl;                         /* 0xE60 */
212     uint32 lhl_wl_hw_ctl_adr[2];                  /* 0xE64-0xE68 */
213     uint32 lhl_bt_hw_ctl_adr;                     /* 0xE6C */
214     uint32 lhl_top_pwrseq_en_adr;                 /* 0xE70 */
215     uint32 lhl_top_pwrdn_ctl_adr;                 /* 0xE74 */
216     uint32 lhl_top_pwrup_ctl_adr;                 /* 0xE78 */
217     uint32 lhl_top_pwrseq_ctl_adr;                /* 0xE7C */
218     uint32 lhl_top_pwrdn2_ctl_adr;                /* 0xE80 */
219     uint32 lhl_top_pwrup2_ctl_adr;                /* 0xE84 */
220     uint32 wpt_regon_intrp_cfg_adr;               /* 0xE88 */
221     uint32 bt_regon_intrp_cfg_adr;                /* 0xE8C */
222     uint32 wl_regon_intrp_cfg_adr;                /* 0xE90 */
223     uint32 regon_intrp_st_adr;                    /* 0xE94 */
224     uint32 regon_intrp_en_adr;                    /* 0xE98 */
225     uint32 PAD[PADSZ(0xe9c, 0xeb4)];              /* 0xe9c-0xeb4 */
226     uint32 lhl_lp_main_ctl1_adr;                  /* 0xeb8 */
227     uint32 lhl_lp_up_ctl2_adr;                    /* 0xebc */
228     uint32 lhl_lp_dn_ctl2_adr;                    /* 0xec0 */
229     uint32 lhl_lp_up_ctl3_adr;                    /* 0xec4 */
230     uint32 lhl_lp_dn_ctl3_adr;                    /* 0xec8 */
231     uint32 PAD[PADSZ(0xecc, 0xed8)];              /* 0xecc-0xed8 */
232     uint32 lhl_lp_main_ctl2_adr;                  /* 0xedc */
233     uint32 lhl_lp_up_ctl4_adr;                    /* 0xee0 */
234     uint32 lhl_lp_dn_ctl4_adr;                    /* 0xee4 */
235     uint32 lhl_lp_up_ctl5_adr;                    /* 0xee8 */
236     uint32 lhl_lp_dn_ctl5_adr;                    /* 0xeec */
237 } gciregs_t;
238 
239 #define GCI_CAP0_REV_MASK 0x000000ff
240 
241 /* GCI Capabilities registers */
242 #define GCI_CORE_CAP_0_COREREV_MASK 0xFF
243 #define GCI_CORE_CAP_0_COREREV_SHIFT 0
244 
245 #define GCI_INDIRECT_ADDRESS_REG_REGINDEX_MASK 0x3F
246 #define GCI_INDIRECT_ADDRESS_REG_REGINDEX_SHIFT 0
247 #define GCI_INDIRECT_ADDRESS_REG_GPIOINDEX_MASK 0xF
248 #define GCI_INDIRECT_ADDRESS_REG_GPIOINDEX_SHIFT 16
249 
250 #define WLAN_BANKX_SLEEPPDA_REG_SLEEPPDA_MASK 0xFFFF
251 
252 #define WLAN_BANKX_PKILL_REG_SLEEPPDA_MASK 0x1
253 
254 /* WLAN BankXInfo Register */
255 #define WLAN_BANKXINFO_BANK_SIZE_MASK 0x00FFF000
256 #define WLAN_BANKXINFO_BANK_SIZE_SHIFT 12
257 
258 /* WLAN Mem Info Register */
259 #define WLAN_MEM_INFO_REG_NUMSOCRAMBANKS_MASK 0x000000FF
260 #define WLAN_MEM_INFO_REG_NUMSOCRAMBANKS_SHIFT 0
261 
262 #define WLAN_MEM_INFO_REG_NUMD11MACBM_MASK 0x0000FF00
263 #define WLAN_MEM_INFO_REG_NUMD11MACBM_SHIFT 8
264 
265 #define WLAN_MEM_INFO_REG_NUMD11MACUCM_MASK 0x00FF0000
266 #define WLAN_MEM_INFO_REG_NUMD11MACUCM_SHIFT 16
267 
268 #define WLAN_MEM_INFO_REG_NUMD11MACSHM_MASK 0xFF000000
269 #define WLAN_MEM_INFO_REG_NUMD11MACSHM_SHIFT 24
270 
271 #endif /* !_LANGUAGE_ASSEMBLY && !__ASSEMBLY__ */
272 
273 #endif /* _SBGCI_H */
274