11 {0x3A8, 0x9CA6, 0xFFFF, 0},
12 {0x44A, 0xBADE, 0xFFFF, 0},
13 {0xA3A, 0x4729, 0xFFFF, 0},
14 {0xC58, 0x1605, 0xFFFF, 0},
15 {0xC5A, 0x1706, 0xFFFF, 0},
16 {0xC5C, 0x1807, 0xFFFF, 0},
17 {0xFB4, 0x6359, 0xFFFF, 0},
18 {0x1432, 0x5543, 0xFFFF, 0},
22 {79, 0xa0e, 0x1, 0xf},
23 {886, 0x198c, 0xf, 0x8},
24 {890, 0x198e, 0xf, 0x0},
25 {902, 0x1998, 0xf, 0x8},
26 {906, 0x1998, 0xf, 0xc},
27 {918, 0x19a2, 0xf, 0x8},
28 {922, 0x19a2, 0xf, 0xc},
29 {1014, 0x19ae, 0xf, 0x7},
30 {1018, 0x19ae, 0xf, 0xb},
31 {1158, 0x1a0a, 0xf, 0x7},
32 {1162, 0x1a0a, 0xf, 0xb},
33 {1206, 0x1a16, 0xf, 0x7},
34 {1210, 0x1a16, 0xf, 0xb},
35 {1254, 0x1a22, 0xf, 0x7},
36 {1258, 0x1a22, 0xf, 0xb},
37 {1304, 0x1a2c, 0x7, 0x4},
38 {1307, 0x1a32, 0x7, 0x8},
39 {1336, 0x1a34, 0x7, 0x4},
40 {1339, 0x1a3a, 0x7, 0x8},
41 {1683, 0x79c, 0xf, 0x4},
42 {1688, 0xc8a, 0x1, 0x3},
43 {1689, 0xc88, 0x1, 0x3},
44 {1690, 0xc88, 0x7, 0x0},
98 index = efuse_bit / 16;
99 shift = efuse_bit % 16;
116 efuse_data = (efuse_data >> shift) &
mask;
162 u32 vol_offset, vol_reg, vol;
165 die(
"ERROR: pmif_arb not initialized");
185 die(
"ERROR: Unknown buck_id %u", buck_id);
189 vol = (buck_uv - vol_offset) / 6250;
195 u32 vol_shift, vol_offset, vol_reg, vol;
198 die(
"ERROR: pmif_arb not initialized");
222 die(
"ERROR: Unknown buck_id %u", buck_id);
227 return vol_offset + vol * 6250;
232 u32 reg_vol, reg_cali;
235 die(
"ERROR: pmif_arb not initialized");
237 assert(vm18_uv >= 1700000);
238 assert(vm18_uv < 2000000);
241 reg_cali = ((vm18_uv / 1000) % 100) / 10;
247 u32 reg_vol, reg_cali;
250 die(
"ERROR: pmif_arb not initialized");
262 die(
"ERROR: No spi device");
266 die(
"ERROR - Failed to initialize pmif spi");
#define assert(statement)
static void mt6359p_write(u32 reg, u32 data)
void mt6359p_set_vm18_voltage(u32 vm18_uv)
static void pmic_wdt_set(void)
static void pmic_wk_vs2_voter_setting(void)
void mt6359p_write_field(u32 reg, u32 val, u32 mask, u32 shift)
static void pmic_efuse_setting(void)
static const struct pmic_setting key_protect_setting[]
static void init_pmif_arb(void)
u32 mt6359p_buck_get_voltage(u32 buck_id)
static void pmic_protect_key_setting(bool lock)
static void pmic_set_power_hold(void)
static u32 mt6359p_read_field(u32 reg, u32 mask, u32 shift)
static int check_idle(u32 timeout, u32 addr, u32 mask)
static u32 pmic_read_efuse(u32 efuse_bit, u32 mask)
static struct pmif * pmif_arb
static const struct pmic_efuse efuse_setting[]
void mt6359p_buck_set_voltage(u32 buck_id, u32 buck_uv)
u32 mt6359p_get_vm18_voltage(void)
#define printk(level,...)
void __noreturn die(const char *fmt,...)
#define wait_us(timeout_us, condition)
static void stopwatch_init(struct stopwatch *sw)
static long stopwatch_duration_msecs(struct stopwatch *sw)
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
@ PMIC_VSRAM_PROC1_VOSEL1
@ PMIC_VSRAM_PROC2_VOSEL1
#define VM18_VOL_REG_SHIFT
#define EFUSE_RG_VPA_OC_FT
void pmic_lp_setting(void)
void pmic_init_setting(void)
struct pmif * get_pmif_controller(int inf, int mstid)
static void lock(void *unused)
void(* write)(struct pmif *arb, u32 slvid, u32 reg, u32 data)
int(* is_pmif_init_done)(struct pmif *arb)
void(* write_field)(struct pmif *arb, u32 slvid, u32 reg, u32 val, u32 mask, u32 shift)
u32(* read_field)(struct pmif *arb, u32 slvid, u32 reg, u32 mask, u32 shift)