diff --git a/board/lt527x/init_dram/main.c b/board/lt527x/init_dram/main.c index 321c9fc5..46c2f420 100644 --- a/board/lt527x/init_dram/main.c +++ b/board/lt527x/init_dram/main.c @@ -21,11 +21,44 @@ extern sunxi_i2c_t i2c_pmu; extern void set_rpio_power_mode(void); extern void rtc_set_vccio_det_spare(void); +static void set_axp323_pmu_fin_voltage(char* power_name, uint32_t voltage){ + int set_vol = voltage; + int temp_vol, src_vol = pmu_axp1530_get_vol(&i2c_pmu, power_name); + if (src_vol > voltage) { + for (temp_vol = src_vol; temp_vol >= voltage; temp_vol -= 50) { + pmu_axp1530_set_vol(&i2c_pmu, power_name, temp_vol, 1); + } + } else if (src_vol < voltage) { + for (temp_vol = src_vol; temp_vol <= voltage; temp_vol += 50) { + pmu_axp1530_set_vol(&i2c_pmu, power_name, temp_vol, 1); + } + } + mdelay(30); /* Delay 300ms for pmu bootup */ +} + +static void set_axp717_pmu_fin_voltage(char* power_name, uint32_t voltage){ + int set_vol = voltage; + int temp_vol, src_vol = pmu_axp2202_get_vol(&i2c_pmu, power_name); + if (src_vol > voltage) { + for (temp_vol = src_vol; temp_vol >= voltage; temp_vol -= 50) { + pmu_axp2202_set_vol(&i2c_pmu, power_name, temp_vol, 1); + } + } else if (src_vol < voltage) { + for (temp_vol = src_vol; temp_vol <= voltage; temp_vol += 50) { + pmu_axp2202_set_vol(&i2c_pmu, power_name, temp_vol, 1); + } + } + mdelay(30); /* Delay 300ms for pmu bootup */ +} + int main(void) { sunxi_serial_init(&uart_dbg); show_banner(); + printk(LOG_LEVEL_INFO, "Board: Myir Tech LT527X-E, Chip: Allwinner T527\n"); + printk(LOG_LEVEL_INFO, "SoC: Arm Octa-Core Cortex-A55 v65 r2p0\n"); + sunxi_clk_init(); sunxi_clk_dump();