![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <console/console.h>
Go to the source code of this file.
Macros | |
#define | PWRAPTAG "[PWRAP] " |
#define | pwrap_err(fmt, arg ...) |
Typedefs | |
typedef u32(* | loop_condition_fp) (u32) |
Functions | |
s32 | pwrap_wacs2 (u32 write, u16 adr, u16 wdata, u16 *rdata, u32 init_check) |
s32 | pwrap_init (void) |
static s32 | pwrap_read (u16 addr, u16 *rdata) |
static s32 | pwrap_write (u16 addr, u16 wdata) |
static u16 | pwrap_read_field (u16 reg, u16 mask, u16 shift) |
static void | pwrap_write_field (u16 reg, u16 val, u16 mask, u16 shift) |
s32 | pwrap_reset_spislv (void) |
static s32 | pwrap_read_nochk (u16 addr, u16 *rdata) |
static s32 | pwrap_write_nochk (u16 addr, u16 wdata) |
static u32 | wait_for_fsm_vldclr (u32 x) |
static u32 | wait_for_sync (u32 x) |
static u32 | wait_for_idle_and_sync (u32 x) |
static u32 | wait_for_cipher_ready (u32 x) |
u32 | wait_for_state_idle (u32 timeout_us, void *wacs_register, void *wacs_vldclr_register, u32 *read_reg) |
u32 | wait_for_state_ready (loop_condition_fp fp, u32 timeout_us, void *wacs_register, u32 *read_reg) |
#define pwrap_err | ( | fmt, | |
arg ... | |||
) |
Definition at line 9 of file pmic_wrap_common.h.
#define PWRAPTAG "[PWRAP] " |
Definition at line 8 of file pmic_wrap_common.h.
Definition at line 144 of file pmic_wrap_common.h.
anonymous enum |
Enumerator | |
---|---|
DEFAULT_VALUE_READ_TEST | |
WRITE_TEST_VALUE |
Definition at line 60 of file pmic_wrap_common.h.
anonymous enum |
Enumerator | |
---|---|
TIMEOUT_READ_US | |
TIMEOUT_WAIT_IDLE_US |
Definition at line 66 of file pmic_wrap_common.h.
anonymous enum |
Enumerator | |
---|---|
OP_WR | |
OP_CSH | |
OP_CSL | |
OP_OUTS |
Definition at line 72 of file pmic_wrap_common.h.
anonymous enum |
Enumerator | |
---|---|
RDATA_WACS_RDATA_SHIFT | |
RDATA_WACS_FSM_SHIFT | |
RDATA_WACS_REQ_SHIFT | |
RDATA_SYNC_IDLE_SHIFT | |
RDATA_INIT_DONE_V1_SHIFT | |
RDATA_SYS_IDLE_V1_SHIFT |
Definition at line 79 of file pmic_wrap_common.h.
anonymous enum |
Enumerator | |
---|---|
RDATA_INIT_DONE_V2_SHIFT | |
RDATA_SYS_IDLE_V2_SHIFT |
Definition at line 88 of file pmic_wrap_common.h.
anonymous enum |
Enumerator | |
---|---|
RDATA_WACS_RDATA_MASK | |
RDATA_WACS_FSM_MASK | |
RDATA_WACS_REQ_MASK | |
RDATA_SYNC_IDLE_MASK | |
RDATA_INIT_DONE_MASK | |
RDATA_SYS_IDLE_MASK |
Definition at line 93 of file pmic_wrap_common.h.
anonymous enum |
Enumerator | |
---|---|
WACS_FSM_IDLE | |
WACS_FSM_REQ | |
WACS_FSM_WFDLE | |
WACS_FSM_WFVLDCLR | |
WACS_INIT_DONE | |
WACS_SYNC_IDLE | |
WACS_SYNC_BUSY |
Definition at line 103 of file pmic_wrap_common.h.
anonymous enum |
Definition at line 115 of file pmic_wrap_common.h.
Definition at line 154 of file pmic_wrap.c.
References clrbits32, mt8173_pwrap_regs::crc_en, mt8173_pwrap_regs::dcm_dbc_prd, mt8173_pwrap_regs::dcm_en, DEW_CRC_EN, DEW_CRC_VAL, DEW_WRITE_TEST, E_PWR_INIT_DIO, E_PWR_INIT_ENABLE_CRC, E_PWR_INIT_ENABLE_PMIC, E_PWR_INIT_REG_CLOCK, E_PWR_INIT_RESET_SPI, E_PWR_INIT_SIDLY, E_PWR_INIT_WRITE_TEST, mt8173_pwrap_regs::hiprio_arb_en, INFRA_PMIC_WRAP_RST, mt8173_infracfg_regs::infra_rst0, mt8173_pwrap_regs::init_done0, mt8173_pwrap_regs::init_done1, mt8173_pwrap_regs::init_done2, mt8173_infracfg, mtk_pwrap, PMIC_DEW_WRITE_TEST, PMIC_TOP_CKCON3, PMIC_WRP_CKPDN, PMIC_WRP_RST_CON, PRIORITY_IN_SEL_2, PRIORITY_OUT_SEL_2, pwrap_enable(), pwrap_err, pwrap_init_dio(), pwrap_init_reg_clock(), pwrap_init_sidly(), pwrap_init_sistrobe(), pwrap_init_spislv(), pwrap_initstaupd(), pwrap_lock_spislvreg(), pwrap_read_nochk(), pwrap_reset_spislv(), pwrap_spi_clk_set(), pwrap_starve_set(), pwrap_write_nochk(), REG_CLOCK_26MHZ, setbits32, mt8173_pwrap_regs::sig_adr, mt8173_pwrap_regs::sig_mode, udelay(), mt8173_pwrap_regs::wacs0_en, mt8173_pwrap_regs::wacs1_en, WACS2, mt8173_pwrap_regs::wacs2_en, mt8173_pwrap_regs::wrap_en, write32(), and WRITE_TEST_VALUE.
Referenced by mt6358_init(), mt6366_init(), and mt6391_init().
Definition at line 15 of file pmic_wrap_common.h.
References addr, and pwrap_wacs2().
Referenced by mt6391_gpio_get(), pwrap_read_field(), pwrap_write_field(), and rtc_read().
Definition at line 25 of file pmic_wrap_common.h.
References mask, and pwrap_read().
Referenced by mt6391_configure_ca53_voltage(), mt6391_default_buck_voltage(), pmic_check_hwcid(), pmic_get_vcn33_vol(), pmic_get_vcore_vol(), pmic_get_vddq_vol(), pmic_get_vdram1_vol(), pmic_get_vmc_vol(), pmic_get_vmch_vol(), pmic_get_vproc12_vol(), pmic_get_vrf12_vol(), pmic_get_vsram_proc12_vol(), pmic_read_efuse(), and wk_sleep_voltage_by_ddr().
Definition at line 49 of file pmic_wrap_common.h.
References addr, and pwrap_wacs2().
Referenced by pwrap_init(), pwrap_init_dio(), pwrap_init_reg_clock(), and pwrap_init_sistrobe().
Definition at line 66 of file pmic_wrap.c.
References mt8173_pwrap_regs::dio_en, E_PWR_TIMEOUT, mt8173_pwrap_regs::hiprio_arb_en, mt8173_pwrap_regs::man_cmd, mt8173_pwrap_regs::man_en, mtk_pwrap, mt8173_pwrap_regs::mux_sel, OP_CSH, OP_CSL, OP_OUTS, OP_WR, TIMEOUT_WAIT_IDLE_US, mt8173_pwrap_regs::wacs2_rdata, wait_for_state_ready(), wait_for_sync(), mt8173_pwrap_regs::wrap_en, and write32().
Referenced by pwrap_init().
Definition at line 99 of file pmic_wrap.c.
References addr, CONFIG, E_PWR_INVALID_ARG, E_PWR_NOT_INIT_DONE, E_PWR_WAIT_IDLE_TIMEOUT, E_PWR_WAIT_IDLE_TIMEOUT_READ, mtk_pwrap, NULL, pwrap_err, RDATA_INIT_DONE_MASK, RDATA_INIT_DONE_V1_SHIFT, RDATA_INIT_DONE_V2_SHIFT, RDATA_WACS_RDATA_MASK, RDATA_WACS_RDATA_SHIFT, read32(), TIMEOUT_READ_US, TIMEOUT_WAIT_IDLE_US, mt8173_pwrap_regs::wacs2_cmd, mt8173_pwrap_regs::wacs2_rdata, mt8173_pwrap_regs::wacs2_vldclr, WACS_INIT_DONE, wait_for_fsm_vldclr(), wait_for_state_idle(), wait_for_state_ready(), and write32().
Referenced by pwrap_init_sidly(), pwrap_read(), pwrap_read_nochk(), pwrap_write(), and pwrap_write_nochk().
Definition at line 20 of file pmic_wrap_common.h.
References addr, and pwrap_wacs2().
Referenced by mt6391_gpio_set(), mt6391_gpio_set_dir(), mt6391_gpio_set_pull(), pwrap_write_field(), rtc_write(), and wfc_id().
Definition at line 36 of file pmic_wrap_common.h.
References mask, pwrap_read(), pwrap_write(), and val.
Referenced by dram_vcore_adjust(), dram_vmem_adjust(), mt6358_init_setting(), mt6358_lp_setting(), mt6366_init_scp_voltage(), mt6366_init_setting(), mt6366_lp_setting(), mt6366_protect_control(), mt6366_set_power_hold(), mt6366_set_vsim2_cali_mv(), mt6391_configure_ca53_voltage(), mt6391_configure_ldo(), mt6391_configure_vcama(), mt6391_default_buck_voltage(), mt6391_enable_reset_when_ap_resets(), mt6391_gpio_set_mode(), mt6391_init_setting(), pmic_enable_vrf12(), pmic_init_scp_voltage(), pmic_read_efuse(), pmic_set_power_hold(), pmic_set_vcn33_vol(), pmic_set_vcore_vol(), pmic_set_vddq_vol(), pmic_set_vdram1_vol(), pmic_set_vmc_vol(), pmic_set_vmch_vol(), pmic_set_vproc12_vol(), pmic_set_vsim2_cali(), pmic_set_vsram_proc12_vol(), pmic_wdt_set(), rtc_bbpu_power_on(), rtc_boot(), rtc_get_frequency_meter(), rtc_gpio_init(), rtc_init(), rtc_lpd_init(), wk_power_down_seq(), and wk_sleep_voltage_by_ddr().
Definition at line 54 of file pmic_wrap_common.h.
References addr, and pwrap_wacs2().
Referenced by pwrap_init(), pwrap_init_dio(), pwrap_init_reg_clock(), pwrap_init_sistrobe(), pwrap_init_spislv(), pwrap_initstaupd(), and pwrap_lock_spislvreg().
Definition at line 165 of file pmic_wrap_common.h.
References x.
Definition at line 146 of file pmic_wrap_common.h.
References RDATA_WACS_FSM_MASK, RDATA_WACS_FSM_SHIFT, WACS_FSM_WFVLDCLR, and x.
Referenced by pwrap_wacs2().
Definition at line 158 of file pmic_wrap_common.h.
References RDATA_SYNC_IDLE_MASK, RDATA_SYNC_IDLE_SHIFT, RDATA_WACS_FSM_MASK, RDATA_WACS_FSM_SHIFT, WACS_FSM_IDLE, WACS_SYNC_IDLE, and x.
Referenced by pwrap_init_dio().
u32 wait_for_state_idle | ( | u32 | timeout_us, |
void * | wacs_register, | ||
void * | wacs_vldclr_register, | ||
u32 * | read_reg | ||
) |
Definition at line 7 of file pmic_wrap.c.
References E_PWR_WAIT_IDLE_TIMEOUT, pwrap_err, RDATA_WACS_FSM_MASK, RDATA_WACS_FSM_SHIFT, read32(), read_reg(), stopwatch_expired(), stopwatch_init_usecs_expire(), WACS_FSM_IDLE, WACS_FSM_REQ, WACS_FSM_WFDLE, WACS_FSM_WFVLDCLR, and write32().
Referenced by pwrap_wacs2().
u32 wait_for_state_ready | ( | loop_condition_fp | fp, |
u32 | timeout_us, | ||
void * | wacs_register, | ||
u32 * | read_reg | ||
) |
Definition at line 46 of file pmic_wrap.c.
References E_PWR_WAIT_IDLE_TIMEOUT, pwrap_err, read32(), read_reg(), stopwatch_expired(), and stopwatch_init_usecs_expire().
Referenced by pwrap_init_dio(), pwrap_reset_spislv(), and pwrap_wacs2().
Definition at line 152 of file pmic_wrap_common.h.
References RDATA_SYNC_IDLE_MASK, RDATA_SYNC_IDLE_SHIFT, WACS_SYNC_IDLE, and x.
Referenced by pwrap_reset_spislv().