6 #include <soc/infracfg.h>
7 #include <soc/pmic_wrap.h>
22 if (return_value != 0) {
23 pwrap_err(
"%s fail,return_value=%#x\n", __func__, return_value);
30 pwrap_err(
"fail,dio_en = %#x, READ_TEST rdata=%#x\n", dio_en,
51 for (i = 0; i < 4; i++) {
77 case (1 << 0) | (1 << 1):
80 case (1 << 1) | (1 << 2):
83 case (1 << 2) | (1 << 3):
87 case (1 << 0) | (1 << 1) | (1 << 2):
90 case (1 << 1) | (1 << 2) | (1 << 3):
94 case (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3):
99 die(
"sidly pass range not continuous\n");
116 wdata = (rdata & (~(0x3 << 10))) | (0x1 << 10);
118 wdata = rdata & (~(0x3 << 10));
122 if (rdata != wdata) {
123 pwrap_err(
"%s,rdata=%#x\n", __func__, rdata);
172 if (sub_return != 0) {
173 pwrap_err(
"error,pwrap_reset_spislv fail,sub_return=%#x\n",
184 if (sub_return != 0) {
185 pwrap_err(
"error,pwrap_init_sidly fail,sub_return=%#x\n",
194 if (sub_return != 0) {
195 pwrap_err(
"error,pwrap_init_reg_clock fail,sub_return=%#x\n",
206 if ((sub_return != 0) || (sub_return1 != 0)) {
207 pwrap_err(
"Enable PMIC fail, sub_return=%#x sub_return1=%#x\n",
208 sub_return, sub_return1);
213 if (sub_return != 0) {
214 pwrap_err(
"pwrap_init_dio error code=%#x, sub_return=%#x\n",
226 || (sub_return1 != 0)) {
227 pwrap_err(
"write error, rdata=%#x, return=%#x, return1=%#x\n",
228 rdata, sub_return, sub_return1);
236 if (sub_return != 0) {
237 pwrap_err(
"enable CRC fail,sub_return=%#x\n", sub_return);
256 pwrap_err(
"!!switch event pin fail,sub_return=%d\n",
static void write32(void *addr, uint32_t val)
s32 pwrap_reset_spislv(void)
u32 wait_for_state_ready(loop_condition_fp fp, u32 timeout_us, void *wacs_register, u32 *read_reg)
s32 pwrap_wacs2(u32 write, u16 addr, u16 wdata, u16 *rdata, u32 init_check)
void __noreturn die(const char *fmt,...)
#define setbits32(addr, set)
#define clrbits32(addr, clear)
static struct mt8173_infracfg_regs *const mt8173_infracfg
static struct mt8173_pwrap_regs *const mtk_pwrap
static s32 pwrap_init_dio(u32 dio_en)
static s32 pwrap_init_reg_clock(enum pmic_regck regck_sel)
static s32 pwrap_init_sidly(void)
static s32 pwrap_write_nochk(u16 addr, u16 wdata)
#define pwrap_err(fmt, arg ...)
static u32 wait_for_idle_and_sync(u32 x)
static s32 pwrap_read_nochk(u16 addr, u16 *rdata)
#define DEFAULT_VALUE_READ_TEST