1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2013 Broadcom
20 // types of PMB devices
32 uint32_t num_sr_bits
:8;
33 uint32_t devType
:4; // see enum above
34 uint32_t reserved1
:12;
37 } BPCM_CAPABILITES_REG
;
53 uint32_t thresh_en_s
:1;
54 uint32_t thresh_en_h
:1;
55 uint32_t continuous_s
:1;
56 uint32_t continuous_h
:1;
65 } BPCM_AVS_ROSC_CONTROL_REG
;
69 uint32_t thresh_lo
:16;
70 uint32_t thresh_hi
:16;
73 } BPCM_AVS_ROSC_THRESHOLD
;
81 } BPCM_AVS_ROSC_COUNT
;
86 uint32_t pwd_alert_sel
:1;
97 } BPCM_AVS_PWD_CONTROL
;
104 } BPCM_PWD_ACCUM_CONTROL
;
112 uint32_t wan_main_rst_n
:1;
113 uint32_t wan_top_bb_rst_n
:1;
114 uint32_t rbus_rst_n
:1;
115 uint32_t reserved1
:2;
116 uint32_t core_soft_rst_n
:1;
117 uint32_t i_zn_sw_init
:1;
118 uint32_t reserved2
:1;
119 uint32_t epon_main_rst_n
:1;
120 uint32_t epon_rx_rst_n
:1;
121 uint32_t epon_tx_rst_n
:1;
122 uint32_t epon_core_rst_n
:1;
123 uint32_t ae_rx_rclk16_sw_reset_n
:1;
124 uint32_t ae_rx_rbc125_sw_reset_n
:1; /* for B0 */
125 uint32_t ae_tx_tclk16_sw_reset_n
:1; /* for B0 */
126 uint32_t ae_tx_clk125_sw_reset_n
:1;
127 uint32_t gpon_main_rst_n
:1;
128 uint32_t gpon_rx_rst_n
:1;
129 uint32_t gpon_tx_rst_n
:1;
130 uint32_t gpon_8khz_rst_n
:1;
131 uint32_t ngpon_main_rst_n
:1;
132 uint32_t ngpon_rx_rst_n
:1;
133 uint32_t ngpon_tx_rst_n
:1;
134 uint32_t ngpon_8khz_rst_n
:1;
135 uint32_t reserved3
:2;
136 uint32_t gpon_nco_rst_n
:1;
137 uint32_t epon_rx_rclk16_sw_reset_n
:1; /* for B0 */
138 uint32_t epon_rx_rbc125_sw_reset_n
:1; /* for B0 */
139 uint32_t epon_tx_tclk16_sw_reset_n
:1; /* for B0 */
140 uint32_t epon_tx_clk125_sw_reset_n
:1; /* for B0 */
141 uint32_t reserved4
:1;
144 uint32_t vdsl_bpcm_early_reset
:1;
145 uint32_t vdsl_bpcm_reset
:1;
146 uint32_t mips_ubus_soft_reset_bpcm_reset
:1;
147 uint32_t qproc_1_bpcm_reset
:1;
148 uint32_t qproc_2_bpcm_reset
:1;
149 uint32_t sar_bpcm_soft_reset
:1;
150 uint32_t vdsl_ubus_soft_bpcm_reset
:1;
151 uint32_t reserved1
:1;
163 uint32_t vdsl_arm_por_reset_n
:1;
164 uint32_t vdsl_arm_reset_n
:1;
165 uint32_t vdsl_arm_debug_reset_n
:1;
166 uint32_t vdsl_arm_l2_reset_n
:1;
167 uint32_t vdsl_arm_cdbgrstreq_en
:1;
168 uint32_t vdsl_arm_niden_a7_b0
:1;
169 uint32_t vdsl_arm_spniden_a7_b0
:1;
170 uint32_t vdsl_arm_nsocdbgreset_a7
:1;
171 uint32_t axi4_ubus4_pass_through_disable
:1;
172 uint32_t vdsl_arm_dbgen_a7_b0
:1;
173 uint32_t vdsl_arm_spiden_a7_b0
:1;
174 uint32_t vdsl_arm_scratch_reg
:21;
176 } BPCM_VDSL_ARM_RST_CTL
;
180 uint32_t z2_p_wan_phy_sel
:3; /* 0-2 */
181 uint32_t reserved0
:1; /* 3 */
182 uint32_t z2_switch_p3_phy_sel
:3; /* 4-6 */
183 uint32_t reserved1
:1; /* 7 */
184 uint32_t z2_switch_p4_phy_sel
:3; /* 8-10 */
185 uint32_t reserved2
:1; /* 11 */
186 uint32_t z0_mux_sel
:1; /* 12 */
187 uint32_t z1_gphy_mux_sel
:1; /* 13 */
188 uint32_t z2_gphy_mux_sel
:1; /* 14 */
189 uint32_t z2_crossbar_mux_sel
:1; /* 15 */
190 uint32_t reserved3
:1; /* 16 */
191 uint32_t z1_pda_en
:1; /* 17 */
192 uint32_t z1_ck250_clk_en
:1; /* 18 */
193 uint32_t z1_ck25_clk_dis
:1; /* 19 */
194 uint32_t reserved4
:2; /* 20-21 */
195 uint32_t z2_ck250_clk_en
:1; /* 22 */
196 uint32_t z2_ck25_clk_dis
:1; /* 23 */
197 uint32_t z2_serdes_clk_en
:1; /* 24 */
198 uint32_t z2_serdes_reset_mdioregs
:1; /* 25 */
199 uint32_t z2_sedes_reset_pll
:1; /* 26 */
200 uint32_t z2_serdes_reset
:1; /* 27 */
201 uint32_t z2_serdes_mux_sel
:1; /* 28 */
202 uint32_t reserved5
:1; /* 29 */
203 uint32_t z1_gphy_reset
:1; /* 30 */
204 uint32_t z2_gphy_reset
:1; /* 31 */
211 uint32_t z0_mux_sel
:1; // = r_Z0_GLOBAL_CNTL[0];
212 uint32_t reserverd_1
:1; // unused
213 uint32_t z3_pda_en
:1; // = r_Z0_GLOBAL_CNTL[2];
214 uint32_t rx_sys_clk_en
:1; // = r_Z0_GLOBAL_CNTL[3];
215 uint32_t tx_sys_clk_en
:1; // = r_Z0_GLOBAL_CNTL[4];
216 uint32_t gmii_rx_clk_en
:1; // = r_Z0_GLOBAL_CNTL[5];
217 uint32_t gmii_tx_clk_en
:1; // = r_Z0_GLOBAL_CNTL[6];
222 } BPCM_GLOBAL_CNTL_0
;
226 uint32_t z1_pda_en
:1; //= r_Z1_GLOBAL_CNTL[0];
228 uint32_t z1_ck250_clk_en
:1; //= r_Z1_GLOBAL_CNTL[3];
229 uint32_t z1_ref_clk_dis
:1; //= r_Z1_GLOBAL_CNTL[4];
230 uint32_t z1_mux_sel
:1; //= r_Z1_GLOBAL_CNTL[5];
231 uint32_t z1_gphy_reset
:1; //= r_Z1_GLOBAL_CNTL[6];
232 uint32_t z1_gphy_iddq_global_pwr
:1; //= r_Z1_GLOBAL_CNTL[7];
233 uint32_t z1_gphy_force_dll_en
:1; //= r_Z1_GLOBAL_CNTL[8];
234 uint32_t z1_gphy_ext_pwr_down
:4; //= r_Z1_GLOBAL_CNTL[12:9];
235 uint32_t z1_gphy_iddq_bias
:1; //= r_Z1_GLOBAL_CNTL[13];
236 uint32_t z1_switch_p3_phy_sel
:1; //= r_Z1_GLOBAL_CNTL[14];
237 uint32_t z1_switch_p8_sel
:1; //= r_Z1_GLOBAL_CNTL[15];
242 } BPCM_GLOBAL_CNTL_1
;
246 uint32_t z2_pda_en
:1; //= r_Z2_GLOBAL_CNTL[0];
248 uint32_t z2_ck250_clk_en
:1; //= r_Z2_GLOBAL_CNTL[2];
249 uint32_t z2_ref_clk_dis
:1; //= r_Z2_GLOBAL_CNTL[3];
250 uint32_t z2_serdes_clk_en
:1; //= r_Z2_GLOBAL_CNTL[4];
251 uint32_t z2_gphy_mux_sel
:1; //= r_Z2_GLOBAL_CNTL[5];
252 uint32_t z2_gphy_reset
:1; //= r_Z2_GLOBAL_CNTL[6];
253 uint32_t z2_gphy_iddq_global_pwr
:1; //= r_Z2_GLOBAL_CNTL[7];
254 uint32_t z2_gphy_force_dll_en
:1; //= r_Z2_GLOBAL_CNTL[8];
255 uint32_t z2_gphy_ext_pwr_down
:1; //= r_Z2_GLOBAL_CNTL[9];
256 uint32_t z2_gphy_iddq_bias
:1; //= r_Z2_GLOBAL_CNTL[10];
257 uint32_t z2_crossbar_mux_sel
:1; //= r_Z2_GLOBAL_CNTL[11];
258 uint32_t z2_p_wan_phy_sel
:2; //= r_Z2_GLOBAL_CNTL[13:12];
259 uint32_t z2_switch_p4_phy_sel
:2; //= r_Z2_GLOBAL_CNTL[15:14];
260 uint32_t z2_switch_p6_phy_sel
:2; //= r_Z2_GLOBAL_CNTL[17:16];
261 uint32_t z2_serdes_mux_sel
:1; //= r_Z2_GLOBAL_CNTL[18];
262 uint32_t z2_serdes_iddq
:1; //= r_Z2_GLOBAL_CNTL[19];
263 uint32_t z2_serdes_pwrdwn
:1; //= r_Z2_GLOBAL_CNTL[20];
264 uint32_t z2_serdes_reset
:1; //= r_Z2_GLOBAL_CNTL[21];
265 uint32_t z2_serdes_reset_mdioregs
:1; //= r_Z2_GLOBAL_CNTL[22];
266 uint32_t z2_serdes_reset_pll
:1; //= r_Z2_GLOBAL_CNTL[23];
267 uint32_t z2_serdes_refclk_sel
:3; //= r_Z2_GLOBAL_CNTL[26:24];
268 uint32_t z2_pll_clk125_250_sel
:1; //= r_Z2_GLOBAL_CNTL[27];
269 uint32_t z2_pll_mux_clk250_sel
:1; //= r_Z2_GLOBAL_CNTL[28];
274 } BPCM_GLOBAL_CNTL_2
;
281 uint32_t iddq_bias
:1; /* 0 */
282 uint32_t ext_pwr_down
:4; /* 1-4 */
283 uint32_t force_dll_en
:1; /* 5 */
284 uint32_t iddq_global_pwr
:1; /* 6 */
285 uint32_t reserved
:25;
286 } Bits_switch_z1_qgphy
;
288 uint32_t iddq_bias
:1; /* 0 */
289 uint32_t ext_pwr_down
:1; /* 1 */
290 uint32_t force_dll_en
:1; /* 2 */
291 uint32_t iddq_global_pwd
:1; /* 3 */
292 uint32_t ck25_dis
:1; /* 4 */
293 uint32_t phy_reset
:1; /* 5 */
294 uint32_t reserved0
:2;
295 uint32_t phy_ad
:5; /* 8-12 */
296 uint32_t reserved1
:18;
297 uint32_t ctrl_en
:1; /* 31 */
300 uint32_t iddq_bias
:1; /* 0 */
301 uint32_t ext_pwr_down
:4; /* 1-4 */
302 uint32_t force_dll_en
:1; /* 5 */
303 uint32_t iddq_global_pwd
:1; /* 6 */
304 uint32_t ck25_dis
:1; /* 7 */
305 uint32_t phy_reset
:1; /* 8 */
306 uint32_t reserved0
:3;
307 uint32_t phy_ad
:5; /* 12-16 */
308 uint32_t reserved1
:14;
309 uint32_t ctrl_en
:1; /* 31 */
312 uint32_t iddq_bias
:1; /* 0 */
313 uint32_t ext_pwr_down
:4; /* 1-4 */
314 uint32_t force_dll_en
:1; /* 5 */
315 uint32_t iddq_global_pwr
:1; /* 6 */
316 uint32_t reserved0
:25; /* 7-31 */
322 uint32_t alt_bfc_vector
:12; /* 00-11 */
323 uint32_t reserved0
:3;
324 uint32_t alt_bfc_en
:1; /* 15 */
325 uint32_t reset_dly_cfg
:2; /* 16-17 */
326 uint32_t reserved1
:8;
327 uint32_t ext_mclk_en_reset
:1; /* 26 */
328 uint32_t ext_mclk_en
:1; /* 27 */
329 uint32_t por_reset_n_ctl
:1; /* 28 */
330 uint32_t reset_n_ctl
:1; /* 29 */
331 uint32_t reserved2
:1;
332 uint32_t clken
:1; /* 31 */
342 uint32_t alt_bfc_vector
:12; /* 00-11 */
343 uint32_t reserved0
:3;
344 uint32_t alt_bfc_en
:1; /* 15 */
345 uint32_t reset_dly_cfg
:2; /* 16-17 */
346 uint32_t reserved1
:8;
347 uint32_t ext_mclk_en_reset
:1; /* 26 */
348 uint32_t ext_mclk_en
:1; /* 27 */
349 uint32_t por_reset_n_ctl
:1; /* 28 */
350 uint32_t reset_n_ctl
:1; /* 29 */
351 uint32_t reserved2
:1;
352 uint32_t clken
:1; /* 31 */
353 } Bits_vdsl_mips
; /* second PHY MIPS core */
355 } BPCM_MISC_CONTROL2
;
359 uint32_t gphy_iddq_bias
:1; /* 00 */
360 uint32_t gphy_ext_pwr_down
:1; /* 01 */
361 uint32_t gphy_force_dll_en
:1; /* 02 */
362 uint32_t gphy_iddq_global_pwr
:1; /* 03 */
363 uint32_t serdes_iddq
:1; /* 04 */
364 uint32_t serdes_pwrdwn
:1; /* 05 */
365 uint32_t reserved0
:2; /* 07:06 */
366 uint32_t serdes_refclk_sel
:3; /* 10:08 */
367 uint32_t reserved1
:5; /* 15:11 */
368 uint32_t pll_clk125_250_sel
:1; /* 16 */
369 uint32_t pll_mux_clk_250_sel
:1; /* 17 */
370 uint32_t reserved2
:14; /* 31:18 */
384 uint32_t cpu_reset_n
:8; // 07:00 R/W
385 uint32_t c0l2_reset
:1; // 08:08 R/W
386 uint32_t c1l2_reset
:1; // 09:09 R/W
387 uint32_t reserved0
:6; // 15:10 R/O
388 uint32_t cpu_bpcm_init_on
:8; // 23:16 R/W
389 uint32_t c0l2_bpcm_init_on
:1; // 24:24 R/W
390 uint32_t c1l2_bpcm_init_on
:1; // 25:25 R/W
391 uint32_t ubus_sr
:1; // 26:26 R/W
392 uint32_t cci_sr
:1; // 27:27 R/W
393 uint32_t webcores_sr
:1; // 28:28 R/W
394 uint32_t hw_done
:1; // 29:29 R/O
395 uint32_t sw_done
:1; // 30:30 R/W
396 uint32_t start
:1; // 31:31 R/W
403 uint32_t mem_pwr_ok
:1; // 00:00 R/W
404 uint32_t mem_pwr_on
:1; // 01:01 R/W
405 uint32_t mem_clamp_on
:1; // 02:02 R/W
406 uint32_t reserved2
:1; // 03:03 R/W
407 uint32_t mem_pwr_ok_status
:1; // 04:04 R/O
408 uint32_t mem_pwr_on_status
:1; // 05:05 R/O
409 uint32_t reserved1
:2; // 07:06 R/W
410 uint32_t mem_pda
:4; // 11:08 R/W only LS bit for CPU0/1, all four bits for neon_l2
411 uint32_t reserved0
:3; // 14:12 R/W
412 uint32_t clamp_on
:1; // 15:15 R/W
413 uint32_t pwr_ok
:4; // 19:16 R/W ditto
414 uint32_t pwr_on
:4; // 23:20 R/W ditto
415 uint32_t pwr_ok_status
:4; // 27:24 R/O ditto
416 uint32_t pwr_on_status
:4; // 31:28 R/O only LS 2-bits for CPU1, only LS 1 bit for neon_l2
419 } ARM_CPUx_PWR_CTRL_REG
;
423 uint32_t resetb
:1; // 00:00
424 uint32_t post_resetb
:1; // 01:01
425 uint32_t pwrdwn
:1; // 02:02
426 uint32_t master_reset
:1; // 03:03
427 uint32_t pwrdwn_ldo
:1; // 04:04
428 uint32_t iso
:1; // 05:05 // only used in afepll
429 uint32_t reserved0
:2; // 07:06
430 uint32_t ldo_ctrl
:6; // 13:08
431 uint32_t reserved1
:1; // 14:14
432 uint32_t hold_ch_all
:1; // 15:15
433 uint32_t reserved2
:4; // 16:19
434 uint32_t byp_wait
:1; // 20:20 // only used in b15pll
435 uint32_t reserved3
:11; // 21:31
442 uint32_t fb_offset
:12; // 11:00
443 uint32_t fb_phase_en
:1; // 12:12
444 uint32_t _8phase_en
:1; // 13:13
445 uint32_t sr
:18; // 31:14
452 uint32_t ndiv_int
:10; // 09:00
453 uint32_t ndiv_frac
:20; // 29:10
454 uint32_t reserved0
:1; // 30
455 uint32_t ndiv_override
:1; // 31
462 uint32_t pdiv
:3; // 02:00
463 uint32_t reserved0
:28; // 30:03
464 uint32_t ndiv_pdiv_override
:1; // 31:31
471 uint32_t mdiv0
:8; // 07:00
472 uint32_t enableb_ch0
:1; // 08:08
473 uint32_t hold_ch0
:1; // 09:09
474 uint32_t load_en_ch0
:1; // 10:10
475 uint32_t mdel0
:1; // 11:11
476 uint32_t reserved0
:3; // 14:12
477 uint32_t mdiv_override0
:1; // 15:15
478 uint32_t mdiv1
:8; // 23:16
479 uint32_t enableb_ch1
:1; // 24:24
480 uint32_t hold_ch1
:1; // 25:25
481 uint32_t load_en_ch1
:1; // 26:26
482 uint32_t mdel1
:1; // 27:27
483 uint32_t reserved1
:3; // 30:28
484 uint32_t mdiv_override1
:1; // 31:31
491 uint32_t reserved0
:4; // 03:00
492 uint32_t ka
:3; // 06:04
493 uint32_t reserved1
:1; // 07:07
494 uint32_t ki
:3; // 10:08
495 uint32_t reserved2
:1; // 11:11
496 uint32_t kp
:4; // 15:12
497 uint32_t ssc_step
:16; // 31:16
504 uint32_t ssc_limit
:22; // 21:00
505 uint32_t reserved0
:2; // 23:22
506 uint32_t ssc_clkdiv
:4; // 27:24
507 uint32_t ssc_status
:1; // 28:28
508 uint32_t reserved1
:2; // 30:29
509 uint32_t ssc_mode
:1; // 31:31
516 uint32_t fdco_ctrl_bypass
:16; // 15:00
517 uint32_t fdco_bypass_en
:1; // 16:16
518 uint32_t fdco_dac_sel
:1; // 17:17
519 uint32_t state_reset
:1; // 18:18
520 uint32_t state_mode
:2; // 20:19
521 uint32_t state_sel
:3; // 23:21
522 uint32_t state_update
:1; // 24:24
523 uint32_t dco_en
:1; // 25:25
524 uint32_t dco_div2_div4
:1; // 26:26
525 uint32_t dco_bias_boost
:1; // 27:27
526 uint32_t bb_en
:1; // 28:28
527 uint32_t t2d_offset
:3; // 31:29
534 uint32_t t2d_offset_msb
:1; // 00:00
535 uint32_t t2d_clk_enable
:1; // 01:01
536 uint32_t t2d_clk_sel
:1; // 02:02
537 uint32_t kpp
:4; // 06:03
538 uint32_t pwm_ctrl
:2; // 08:07
539 uint32_t port_reset_mode
:2; // 10:09
540 uint32_t byp2_en
:1; // 11:11
541 uint32_t byp1_en
:1; // 12:12
542 uint32_t ref_diff_sel
:1; // 13:13
543 uint32_t ki_startlow
:1; // 14:14
544 uint32_t en_500ohm
:1; // 15:15
545 uint32_t refd2c_bias
:3; // 18:16
546 uint32_t post_div2_div3
:1; // 19:19
547 uint32_t ki_boost
:1; // 20:20
548 uint32_t reserved0
:11; // 31:21
555 uint32_t en_cml
:3; // 02:00
556 uint32_t tri_en
:1; // 03:03
557 uint32_t test_sel
:3; // 06:04
558 uint32_t test_en
:1; // 07:07
559 uint32_t reserved0
:24;
566 uint32_t out
:12; // 11:00
567 uint32_t reserved
:19; // 30:12
568 uint32_t lock
:1; // 31:31
575 uint32_t ndiv_int
:10; // 09:00
576 uint32_t reserved0
:2; // 11:10
577 uint32_t ndiv_frac
:20; // 31:12
584 uint32_t pdiv
:4; // 03:00
585 uint32_t reserved0
:12; // 15:04
586 uint32_t mdiv0
:8; // 23:16
587 uint32_t mdiv1
:8; // 31:24
594 uint32_t mdiv2
:8; // 07:00
595 uint32_t mdiv3
:8; // 15:08
596 uint32_t mdiv4
:8; // 23:16
597 uint32_t mdiv5
:8; // 31:24
604 uint32_t manual_clk_en
:1;
605 uint32_t manual_reset_ctl
:1;
606 uint32_t freq_scale_used
:1; // R/O
607 uint32_t dpg_capable
:1; // R/O
608 uint32_t manual_mem_pwr
:2;
609 uint32_t manual_iso_ctl
:1;
610 uint32_t manual_ctl
:1;
611 uint32_t dpg_ctl_en
:1;
612 uint32_t pwr_dn_req
:1;
613 uint32_t pwr_up_req
:1;
614 uint32_t mem_pwr_ctl_en
:1;
615 uint32_t blk_reset_assert
:1;
618 uint32_t pwr_cntl_state
:5;
619 uint32_t freq_scalar_dyn_sel
:1; // R/O
620 uint32_t pwr_off_state
:1; // R/O
621 uint32_t pwr_on_state
:1; // R/O
622 uint32_t pwr_good
:1; // R/O
623 uint32_t dpg_pwr_state
:1; // R/O
624 uint32_t mem_pwr_state
:1; // R/O
625 uint32_t iso_state
:1; // R/O
626 uint32_t reset_state
:1; // R/O
629 } BPCM_PWR_ZONE_N_CONTROL
;
633 uint32_t pwr_ok_delay_sel
:3;
634 uint32_t pwk_ok_thresh
:2;
636 uint32_t iso_on_delay
:4;
637 uint32_t iso_off_delay
:4;
638 uint32_t clock_on_delay
:4;
639 uint32_t clock_off_delay
:4;
640 uint32_t reset_on_delay
:4;
641 uint32_t reset_off_delay
:4;
644 } BPCM_PWR_ZONE_N_CONFIG1
;
648 uint32_t delay_prescale_sel
:3;
649 uint32_t slew_prescale_sel
:3;
651 uint32_t dpgn_on_delay
:4;
652 uint32_t dpg1_on_delay
:4;
653 uint32_t dpg_off_delay
:4;
654 uint32_t mem_on_delay
:4;
655 uint32_t mem_off_delay
:4;
658 } BPCM_PWR_ZONE_N_CONFIG2
;
662 uint32_t fs_bypass_en
:1;
664 uint32_t use_dyn_gear_sel
:1;
665 uint32_t reserved2
:1;
666 uint32_t low_gear_div
:3;
667 uint32_t high_gear_div
:3;
668 uint32_t reserved
:22;
671 } BPCM_ZONE_N_FREQ_SCALAR_CONTROL
;
674 BPCM_PWR_ZONE_N_CONTROL control
;
675 BPCM_PWR_ZONE_N_CONFIG1 config1
;
676 BPCM_PWR_ZONE_N_CONFIG2 config2
;
677 BPCM_ZONE_N_FREQ_SCALAR_CONTROL freq_scalar_control
;
680 #define BPCMZoneOffset(reg) offsetof(BPCM_ZONE,reg)
681 #define BPCMZoneRegOffset(reg) (BPCMZoneOffset(reg) >> 2)
687 uint32_t module_id
:16;
694 uint32_t num_zones
:8;
695 uint32_t sr_reg_bits
:8;
697 uint32_t reserved0
:1;
699 uint32_t reserved1
:12;
702 } BPCM_UBUS_CAPABILITES_REG
;
706 uint32_t ctrl_eswap
:4;
707 uint32_t reserved0
:4;
709 uint32_t reserved1
:4;
710 uint32_t ctrl_seclev
:8;
711 uint32_t reqout_seclev
:8;
714 } BPCM_UBUS_CTRL_REG
;
719 uint64_t addr_out
:24;
732 // There is a 20-bit address used to access any given BPCM register. The upper 8-bits
733 // is the device address and the lower 12-bits is used to represent the BPCM register
734 // set for that device. 32-bit registers are allocated on 4-byte boundaries
735 // (i.e. 0, 1, 2, 3...) rather than on byte boundaries (0x00, 0x04, 0x08, 0x0c...)
736 // Thus, to get the actual address of any given register within the device's address
737 // space, I'll use the "C" offsetof macro and divide the result by 4
739 // int regOffset = offsetof(BPCM_REGS,BPCM_AVS_PWD_CONTROL); // yields the byte offset of the target register
740 // int regAddress = regOffset/4; // yields the 32-bit word offset of the target register
741 // The ReadBPCMReg and WriteBPCMReg functions will always take a device address
742 // (address of the BPCM device) and register offset (like regOffset above). The offset
743 // will be divided by 4 and used as the lower 12-bits of the actual target address, while the
744 // device address will serve as the upper 8-bits of the actual address.
746 BPCM_ID_REG id_reg
; // offset = 0x00, actual offset = 0
747 BPCM_CAPABILITES_REG capabilities
; // offset = 0x04, actual offset = 1
748 uint32_t control
; // offset = 0x08, actual offset = 2
749 BPCM_STATUS_REG status
; // offset = 0x0c, actual offset = 3
750 BPCM_AVS_ROSC_CONTROL_REG rosc_control
; // offset = 0x10, actual offset = 4
751 BPCM_AVS_ROSC_THRESHOLD rosc_thresh_h
; // offset = 0x14, actual offset = 5
752 BPCM_AVS_ROSC_THRESHOLD rosc_thresh_s
; // offset = 0x18, actual offset = 6
753 BPCM_AVS_ROSC_COUNT rosc_count
; // offset = 0x1c, actual offset = 7
754 BPCM_AVS_PWD_CONTROL pwd_control
; // offset = 0x20, actual offset = 8
755 BPCM_PWD_ACCUM_CONTROL pwd_accum_control
; // offset = 0x24, actual offset = 9
756 BPCM_SR_CONTROL sr_control
; // offset = 0x28, actual offset = 10
757 uint32_t reserved
; // offset = 0x2c, actual offset = 11
758 BPCM_GLOBAL_CNTL_0 global_control
; // offset = 0x30, actual offset = 12
759 BPCM_GLOBAL_CNTL_1 global_control_1
; // offset = 0x34, actual offset = 13
760 BPCM_GLOBAL_CNTL_2 global_control_2
; // offset = 0x38, actual offset = 14
761 uint32_t global_status
; // offset = 0x3c, actual offset = 15
762 BPCM_ZONE zones
[1020]; // offset = 0x40..0x3FFC, actual offset = 16..4095 (1020 * 4 = 4080 + 16 = 4096)
763 } BPCM_REGS
; // total offset space = 4096
765 #define BPCMOffset(reg) offsetof(BPCM_REGS,reg)
766 #define BPCMRegOffset(reg) (BPCMOffset(reg) >> 2)
770 BPCM_ID_REG id_reg
; // offset = 0x00, actual offset = 0
771 BPCM_CAPABILITES_REG capabilities
; // offset = 0x04, actual offset = 1
772 uint32_t control
; // offset = 0x08, actual offset = 2
773 BPCM_STATUS_REG status
; // offset = 0x0c, actual offset = 3
774 BPCM_AVS_ROSC_CONTROL_REG rosc_control
; // offset = 0x10, actual offset = 4
775 BPCM_AVS_ROSC_THRESHOLD rosc_thresh_h
; // offset = 0x14, actual offset = 5
776 BPCM_AVS_ROSC_THRESHOLD rosc_thresh_s
; // offset = 0x18, actual offset = 6
777 BPCM_AVS_ROSC_COUNT rosc_count
; // offset = 0x1c, actual offset = 7
778 BPCM_AVS_PWD_CONTROL pwd_control
; // offset = 0x20, actual offset = 8
779 BPCM_PWD_ACCUM_CONTROL pwd_accum_control
; // offset = 0x24, actual offset = 9
780 BPCM_SR_CONTROL sr_control
; // offset = 0x28, actual offset = 10
781 BPCM_GLOBAL_CNTL global_control
; // offset = 0x2c, actual offset = 11
782 BPCM_MISC_CONTROL misc_control
; // offset = 0x30, actual offset = 12
783 BPCM_MISC_CONTROL2 misc_control2
; // offset = 0x34, actual offset = 13
785 BPCM_ZONE zones
[1020]; // offset = 0x40..0x3FFC, actual offset = 16..4095 (1020 * 4 = 4080 + 16 = 4096)
786 } BPCM_VDSL_REGS
; // total offset space = 4096
788 #define BPCMVDSLOffset(reg) offsetof(BPCM_VDSL_REGS,reg)
789 #define BPCMVDSLRegOffset(reg) (BPCMVDSLOffset(reg) >> 2)
791 // ARM BPCM addresses as used by 63138/63148 and possibly others (28nm)
793 BPCM_ID_REG id_reg
; // offset = 0x00, actual offset = 0
794 BPCM_CAPABILITES_REG capabilities
; // offset = 0x04, actual offset = 1
795 uint32_t control
; // offset = 0x08, actual offset = 2
796 BPCM_STATUS_REG status
; // offset = 0x0c, actual offset = 3
797 BPCM_AVS_ROSC_CONTROL_REG rosc_control
; // offset = 0x10, actual offset = 4
798 BPCM_AVS_ROSC_THRESHOLD rosc_thresh_h
; // offset = 0x14, actual offset = 5
799 BPCM_AVS_ROSC_THRESHOLD rosc_thresh_s
; // offset = 0x18, actual offset = 6
800 BPCM_AVS_ROSC_COUNT rosc_count
; // offset = 0x1c, actual offset = 7
801 BPCM_AVS_PWD_CONTROL pwd_control
; // offset = 0x20, actual offset = 8
802 BPCM_PWD_ACCUM_CONTROL pwd_accum_control
; // offset = 0x24, actual offset = 9
803 BPCM_SR_CONTROL sr_control
; // offset = 0x28, actual offset = 10
804 uint32_t reserved
; // offset = 0x2c, actual offset = 11
805 ARM_CONTROL_REG arm_control
; // offset = 0x30, actual offset = 12
806 BPCM_ZONE zones
[1020]; // offset = 0x40..0x3FFC, actual offset = 16..4095 (1020 * 4 = 4080 + 16 = 4096)
808 #define ARMBPCMOffset(reg) offsetof(ARM_BPCM_REGS,reg)
809 #define ARMBPCMRegOffset(reg) (ARMBPCMOffset(reg) >> 2)
812 BPCM_ID_REG id_reg
; // offset = 0x00, actual offset = 0
813 BPCM_CAPABILITES_REG capabilities
; // offset = 0x04, actual offset = 1
814 uint32_t reserved0
[2]; // offset = 0x08..0x0c, actual offset 2..3
815 PLL_CTRL_REG resets
; // offset = 0x10, actual offset = 4
816 PLL_CFG0_REG cfg0
; // offset = 0x14, actual offset = 5
817 PLL_CFG1_REG cfg1
; // offset = 0x18, actual offset = 6
818 PLL_NDIV_REG ndiv
; // offset = 0x1c, actual offset = 7
819 PLL_PDIV_REG pdiv
; // offset = 0x20, actual offset = 8
820 PLL_LOOP0_REG loop0
; // offset = 0x24, actual offset = 9
821 PLL_LOOP1_REG loop1
; // offset = 0x28, actual offset = a
822 PLL_CHCFG_REG ch01_cfg
; // offset = 0x2c, actual offset = b
823 PLL_CHCFG_REG ch23_cfg
; // offset = 0x30, actual offset = c
824 PLL_CHCFG_REG ch45_cfg
; // offset = 0x34, actual offset = d
825 PLL_OCTRL_REG octrl
; // offset = 0x38, actual offset = e
826 PLL_STAT_REG stat
; // offset = 0x3c, actual offset = f
827 uint32_t strap
; // offset = 0x40, actual offset = 0x10
828 uint32_t decndiv
; // offset = 0x44, actual offset = 0x11
829 uint32_t decpdiv
; // offset = 0x48, actual offset = 0x12
830 uint32_t decch25
; // offset = 0x4c, actual offset = 0x13
833 #define PLLBPCMOffset(reg) offsetof(PLL_BPCM_REGS,reg)
834 #define PLLBPCMRegOffset(reg) (PLLBPCMOffset(reg) >> 2)
837 BPCM_UBUS_ID_REG id_reg
; /* offset = 0x00, actual offset = 0 */
838 BPCM_UBUS_CAPABILITES_REG capabilities
; /* offset = 0x04, actual offset = 1 */
839 uint32_t reserved0
; /* offset = 0x08, actual offset = 2 */
840 BPCM_UBUS_CTRL_REG ctrl
; /* offset = 0x0c, actual offset = 3 */
841 BPCM_UBUS_CFG_REG cfg
[4]; /* offset = 0x10..0x2c, actual offset = 4..11 */
844 #define UBUSBPCMOffset(reg) offsetof(BPCM_UBUS_REG,reg)
845 #define UBUSBPCMRegOffset(reg) (UBUSBPCMOffset(reg) >> 2)
848 BPCM_ID_REG id_reg
; // offset = 0x00, actual offset = 0
849 BPCM_CAPABILITES_REG capabilities
; // offset = 0x04, actual offset = 1
850 uint32_t control
; // offset = 0x08, actual offset = 2
851 BPCM_STATUS_REG status
; // offset = 0x0c, actual offset = 3
852 BPCM_AVS_ROSC_CONTROL_REG rosc_control
; // offset = 0x10, actual offset = 4
853 BPCM_AVS_ROSC_THRESHOLD rosc_thresh_h
; // offset = 0x14, actual offset = 5
854 BPCM_AVS_ROSC_THRESHOLD rosc_thresh_s
; // offset = 0x18, actual offset = 6
855 BPCM_AVS_ROSC_COUNT rosc_count
; // offset = 0x1c, actual offset = 7
856 BPCM_AVS_PWD_CONTROL pwd_control
; // offset = 0x20, actual offset = 8
857 uint32_t reserved0
; // offset = 0x24, actual offset = 9
858 BPCM_SR_CONTROL sr_control
; // offset = 0x28, actual offset = 10
859 uint32_t reserved1
; // offset = 0x2c, actual offset = 11
860 uint32_t clkrst_cfg
; // offset = 0x30, actual offset = 12
861 uint32_t clkrst_control
; // offset = 0x34, actual offset = 13
862 uint32_t xtal_control
; // offset = 0x38, actual offset = 14
863 uint32_t clkrst_stat
; // offset = 0x3c, actual offset = 15
866 #define CLKRSTBPCMOffset(reg) offsetof(BPCM_CLKRST_REGS, reg)
867 #define CLKRSTBPCMRegOffset(reg) (CLKRSTBPCMOffset(reg) >> 2)
869 // *************************** macros ******************************
871 #define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)