![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <device/mmio.h>
#include <soc/infracfg.h>
#include <soc/pll.h>
#include <soc/pmic_wrap.h>
#include <timer.h>
Go to the source code of this file.
Macros | |
#define | PRIORITY_FIELD(x) ((x % 4) * 8) |
#define | PRIORITY_IN(id, priority) (id << PRIORITY_FIELD(priority)) |
#define | PRIORITY_OUT(id, priority) (priority << PRIORITY_FIELD(id)) |
#define | PENDING_US(x) x |
Enumerations | |
enum | { MD_ADCINF0 = 8 , MD_ADCINF1 = 9 , STAUPD = 10 , GPSINF0 = 11 , PRIORITY_IN_SEL_2 , PRIORITY_OUT_SEL_2 } |
enum | { STARVE_ENABLE = 0x1 << 10 , COUNTER0_PENDING_THRES = STARVE_ENABLE | PENDING_US(0x2) , COUNTER1_PENDING_THRES = STARVE_ENABLE | PENDING_US(0x3) , COUNTER2_PENDING_THRES = STARVE_ENABLE | PENDING_US(0x3) , COUNTER3_PENDING_THRES = STARVE_ENABLE | PENDING_US(0x3) , COUNTER4_PENDING_THRES = STARVE_ENABLE | PENDING_US(0xf) , COUNTER5_PENDING_THRES = STARVE_ENABLE | PENDING_US(0x20) , COUNTER6_PENDING_THRES = STARVE_ENABLE | PENDING_US(0x28) , COUNTER7_PENDING_THRES = STARVE_ENABLE | PENDING_US(0x28) , COUNTER8_PENDING_THRES = STARVE_ENABLE | PENDING_US(0x13) , COUNTER9_PENDING_THRES = STARVE_ENABLE | PENDING_US(0x17) , COUNTER10_PENDING_THRES = STARVE_ENABLE | PENDING_US(0x17) , COUNTER11_PENDING_THRES = STARVE_ENABLE | PENDING_US(0x7c) , COUNTER12_PENDING_THRES = STARVE_ENABLE | PENDING_US(0x7c) , COUNTER13_PENDING_THRES = STARVE_ENABLE | PENDING_US(0x340) , COUNTER16_PENDING_THRES = STARVE_ENABLE | PENDING_US(0x340) } |
Functions | |
static void | pwrap_soft_reset (void) |
static void | pwrap_spi_clk_set (void) |
static s32 | pwrap_init_dio (u16 dio_en) |
static void | pwrap_lock_spislvreg (void) |
static void | pwrap_initstaupd (void) |
static void | pwrap_starve_set (void) |
static void | pwrap_enable (void) |
static s32 | pwrap_init_sistrobe (void) |
static void | pwrap_init_spislv (void) |
static void | pwrap_init_reg_clock (void) |
s32 | pwrap_init (void) |
Definition at line 35 of file pmic_wrap.c.
Definition at line 14 of file pmic_wrap.c.
#define PRIORITY_IN | ( | id, | |
priority | |||
) | (id << PRIORITY_FIELD(priority)) |
Definition at line 15 of file pmic_wrap.c.
#define PRIORITY_OUT | ( | id, | |
priority | |||
) | (priority << PRIORITY_FIELD(id)) |
Definition at line 16 of file pmic_wrap.c.
anonymous enum |
Enumerator | |
---|---|
MD_ADCINF0 | |
MD_ADCINF1 | |
STAUPD | |
GPSINF0 | |
PRIORITY_IN_SEL_2 | |
PRIORITY_OUT_SEL_2 |
Definition at line 18 of file pmic_wrap.c.
anonymous enum |
Definition at line 36 of file pmic_wrap.c.
Definition at line 147 of file pmic_wrap.c.
References ARB_USER_EN, mt8173_pwrap_regs::hiprio_arb_en, INT0_MONITOR, INT1_MONITOR, mtk_pwrap, STA_PD_98_5_US, mt8173_pwrap_regs::wacs0_en, mt8173_pwrap_regs::wacs2_en, WATCHDOG_TIMER_7_5_MS, WDT_MONITOR_ALL, and write32().
Referenced by pwrap_init().
Definition at line 252 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 79 of file pmic_wrap.c.
References mt8173_pwrap_regs::dio_en, mtk_pwrap, PMIC_DEW_DIO_EN, pwrap_write_nochk(), read32(), mt8173_pwrap_regs::wacs2_rdata, wait_for_idle_and_sync(), wait_us, and write32().
Referenced by pwrap_init().
Definition at line 239 of file pmic_wrap.c.
References mt8173_pwrap_regs::cshext_read, mt8173_pwrap_regs::cshext_write, DUMMY_READ_CYCLES, mtk_pwrap, PMIC_DEW_RDDMY_NO, pwrap_write_nochk(), mt8173_pwrap_regs::rddmy, and write32().
Referenced by pwrap_init().
Definition at line 163 of file pmic_wrap.c.
References DEFAULT_VALUE_READ_TEST, E_CLK_EDGE, E_CLK_LAST_SETTING, E_PWR_READ_TEST_FAIL, mtk_pwrap, PMIC_DEW_READ_TEST, PMIC_DEW_WRITE_TEST, PMIC_RG_SPI_CON2, pwrap_err, pwrap_read_nochk(), pwrap_write_nochk(), and write32().
Referenced by pwrap_init().
Definition at line 225 of file pmic_wrap.c.
References PMIC_DRV_CON1, PMIC_FILTER_CON0, PMIC_GPIO_PULLEN0_CLR, PMIC_RG_SPI_CON0, PMIC_SMT_CON1, pwrap_write_nochk(), SPI_DRIVING, SPI_FILTER, SPI_PULL_DISABLE, and SPI_SMT.
Referenced by pwrap_init().
Definition at line 96 of file pmic_wrap.c.
References mt8173_pwrap_regs::crc_en, GPS_ADC_DATA0, GPS_ADC_DATA1, GPS_MAIN, GPS_SUBSYS, INT_STA_PMIC_0, MD_ADC_DATA0, MD_ADC_DATA1, mtk_pwrap, PMIC_AUXADC_ADC17, PMIC_AUXADC_ADC31, PMIC_AUXADC_ADC32, PMIC_AUXADC_ADC35, PMIC_AUXADC_RQST0, PMIC_AUXADC_RQST1, PMIC_CPU_INT_STA, PMIC_DEW_CRC_EN, PMIC_DEW_CRC_VAL, pwrap_write_nochk(), mt8173_pwrap_regs::sig_adr, SIG_PMIC_0, mt8173_pwrap_regs::staupd_grpen, and write32().
Referenced by pwrap_init().
Definition at line 91 of file pmic_wrap.c.
References PMIC_SPISLV_KEY, and pwrap_write_nochk().
Referenced by pwrap_init().
Definition at line 55 of file pmic_wrap.c.
References mt8186_infracfg_ao_regs::infra_globalcon_rst2_clr, mt8186_infracfg_ao_regs::infra_globalcon_rst2_set, mt8186_infracfg_ao, and write32().
Referenced by pwrap_spi_clk_set().
Definition at line 61 of file pmic_wrap.c.
References mt8186_infracfg_ao_regs::module_sw_cg_0_clr, mt8186_infracfg_ao_regs::module_sw_cg_0_set, mt8186_infracfg_ao_regs::module_sw_cg_2_clr, mt8186_infracfg_ao_regs::module_sw_cg_2_set, mt8186_infracfg_ao, mtk_topckgen, mt8186_infracfg_ao_regs::pmicw_clock_ctrl, pwrap_soft_reset(), read32(), and write32().
Referenced by pwrap_init().
Definition at line 127 of file pmic_wrap.c.
References ARB_PRIORITY, COUNTER0_PENDING_THRES, COUNTER10_PENDING_THRES, COUNTER11_PENDING_THRES, COUNTER12_PENDING_THRES, COUNTER13_PENDING_THRES, COUNTER16_PENDING_THRES, COUNTER1_PENDING_THRES, COUNTER2_PENDING_THRES, COUNTER3_PENDING_THRES, COUNTER4_PENDING_THRES, COUNTER5_PENDING_THRES, COUNTER6_PENDING_THRES, COUNTER7_PENDING_THRES, COUNTER8_PENDING_THRES, COUNTER9_PENDING_THRES, mt8173_pwrap_regs::harb_hprio, mtk_pwrap, and write32().
Referenced by pwrap_init().