/* setup board specific PMIC */ int power_init_board(void) { int rc; #ifndef CONFIG_DM_I2C struct pmic *p = NULL; #endif if (board_is_idk()) { rc = power_tps62362_init(0); if (rc) goto done; #ifndef CONFIG_DM_I2C p = pmic_get("TPS62362"); if (!p || pmic_probe(p)) goto done; #endif puts("PMIC: TPS62362\n"); } else { rc = power_tps65218_init(0); if (rc) goto done; #ifndef CONFIG_DM_I2C p = pmic_get("TPS65218_PMIC"); if (!p || pmic_probe(p)) goto done; #endif puts("PMIC: TPS65218\n"); } done: return 0; }
void scale_vcores_generic(u32 m) { int mpu_vdd, ddr_volt; #ifndef CONFIG_DM_I2C if (i2c_probe(TPS65218_CHIP_PM)) return; #else if (power_tps65218_init(0)) return; #endif switch (m) { case 1000: mpu_vdd = TPS65218_DCDC_VOLT_SEL_1330MV; break; case 800: mpu_vdd = TPS65218_DCDC_VOLT_SEL_1260MV; break; case 720: mpu_vdd = TPS65218_DCDC_VOLT_SEL_1200MV; break; case 600: mpu_vdd = TPS65218_DCDC_VOLT_SEL_1100MV; break; case 300: mpu_vdd = TPS65218_DCDC_VOLT_SEL_0950MV; break; default: puts("Unknown MPU clock, not scaling\n"); return; } /* Set DCDC1 (CORE) voltage to 1.1V */ if (tps65218_voltage_update(TPS65218_DCDC1, TPS65218_DCDC_VOLT_SEL_1100MV)) { printf("%s failure\n", __func__); return; } /* Set DCDC2 (MPU) voltage */ if (tps65218_voltage_update(TPS65218_DCDC2, mpu_vdd)) { printf("%s failure\n", __func__); return; } if (board_is_eposevm()) ddr_volt = TPS65218_DCDC3_VOLT_SEL_1200MV; else ddr_volt = TPS65218_DCDC3_VOLT_SEL_1350MV; /* Set DCDC3 (DDR) voltage */ if (tps65218_voltage_update(TPS65218_DCDC3, ddr_volt)) { printf("%s failure\n", __func__); return; } }
/* setup board specific PMIC */ int power_init_board(void) { struct pmic *p; if (board_is_idk()) { power_tps62362_init(I2C_PMIC); p = pmic_get("TPS62362"); if (p && !pmic_probe(p)) puts("PMIC: TPS62362\n"); } else { power_tps65218_init(I2C_PMIC); p = pmic_get("TPS65218_PMIC"); if (p && !pmic_probe(p)) puts("PMIC: TPS65218\n"); } return 0; }