1/*
2 * HND SiliconBackplane PMU support.
3 *
4 * Copyright (C) 2010, Broadcom Corporation. All Rights Reserved.
5 *
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 *
18 * $Id: hndpmu.h,v 13.36.2.7 2011-02-11 05:22:13 Exp $
19 */
20
21#ifndef _hndpmu_h_
22#define _hndpmu_h_
23
24#define SET_LDO_VOLTAGE_LDO1	1
25#define SET_LDO_VOLTAGE_LDO2	2
26#define SET_LDO_VOLTAGE_LDO3	3
27#define SET_LDO_VOLTAGE_PAREF	4
28#define SET_LDO_VOLTAGE_CLDO_PWM	5
29#define SET_LDO_VOLTAGE_CLDO_BURST	6
30#define SET_LDO_VOLTAGE_CBUCK_PWM	7
31#define SET_LDO_VOLTAGE_CBUCK_BURST	8
32#define SET_LDO_VOLTAGE_LNLDO1	9
33#define SET_LDO_VOLTAGE_LNLDO2_SEL	10
34
35extern void si_pmu_init(si_t *sih, osl_t *osh);
36extern void si_pmu_chip_init(si_t *sih, osl_t *osh);
37extern void si_pmu_pll_init(si_t *sih, osl_t *osh, uint32 xtalfreq);
38extern void si_pmu_res_init(si_t *sih, osl_t *osh);
39extern void si_pmu_swreg_init(si_t *sih, osl_t *osh);
40extern void si_pmu_4313_htavail_res_mask_war(si_t *sih, osl_t *osh);
41extern uint32 si_pmu_force_ilp(si_t *sih, osl_t *osh, bool force);
42extern void si_pmu_res_4319_swctrl_war(si_t *sih, osl_t *osh, bool enable);
43
44extern uint32 si_pmu_si_clock(si_t *sih, osl_t *osh);
45extern uint32 si_pmu_cpu_clock(si_t *sih, osl_t *osh);
46extern uint32 si_pmu_mem_clock(si_t *sih, osl_t *osh);
47extern uint32 si_pmu_alp_clock(si_t *sih, osl_t *osh);
48extern uint32 si_pmu_ilp_clock(si_t *sih, osl_t *osh);
49
50extern void si_pmu_set_switcher_voltage(si_t *sih, osl_t *osh, uint8 bb_voltage, uint8 rf_voltage);
51extern void si_pmu_set_ldo_voltage(si_t *sih, osl_t *osh, uint8 ldo, uint8 voltage);
52extern void si_pmu_paref_ldo_enable(si_t *sih, osl_t *osh, bool enable);
53extern uint16 si_pmu_fast_pwrup_delay(si_t *sih, osl_t *osh);
54extern void si_pmu_minresmask_htavail_set(si_t *sih, osl_t *osh, bool set_clear);
55extern uint si_pll_minresmask_reset(si_t *sih, osl_t *osh);
56extern void si_pmu_rcal(si_t *sih, osl_t *osh);
57extern void si_pmu_pllupd(si_t *sih);
58extern void si_pmu_spuravoid(si_t *sih, osl_t *osh, uint8 spuravoid);
59extern void si_pmu_gband_spurwar(si_t *sih, osl_t *osh);
60
61extern bool si_pmu_is_otp_powered(si_t *sih, osl_t *osh);
62extern uint32 si_pmu_measure_alpclk(si_t *sih, osl_t *osh);
63
64extern uint32 si_pmu_chipcontrol(si_t *sih, uint reg, uint32 mask, uint32 val);
65extern uint32 si_pmu_regcontrol(si_t *sih, uint reg, uint32 mask, uint32 val);
66extern uint32 si_pmu_pllcontrol(si_t *sih, uint reg, uint32 mask, uint32 val);
67extern void si_pmu_pllupd(si_t *sih);
68extern bool si_pmu_is_sprom_enabled(si_t *sih, osl_t *osh);
69extern void si_pmu_sprom_enable(si_t *sih, osl_t *osh, bool enable);
70
71extern void si_pmu_radio_enable(si_t *sih, bool enable);
72extern uint32 si_pmu_waitforclk_on_backplane(si_t *sih, osl_t *osh, uint32 clk, uint32 delay);
73extern void si_pmu_set_4330_plldivs(si_t *sih, uint8 dacrate);
74extern void si_pmu_pllreset(si_t *sih);
75
76
77extern void si_pmu_otp_power(si_t *sih, osl_t *osh, bool on);
78extern void si_sdiod_drive_strength_init(si_t *sih, osl_t *osh, uint32 drivestrength);
79
80#endif /* _hndpmu_h_ */
81