Skip to content

Commit

Permalink
[board] add init dram
Browse files Browse the repository at this point in the history
  • Loading branch information
YuzukiTsuru committed Jan 30, 2024
1 parent edce39e commit 6902cac
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions board/lt527x/init_dram/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 6902cac

Please sign in to comment.