imx233: move power init to system init
Do low level power init in system_init(). This can be needed since imx233 must be able to frequecy scale atfer system_init() and kernel_init() and this is only possible if power system was initialised. Change-Id: I27c66ec0dccd60bda26a45be24683c0bfe72c6da
This commit is contained in:
parent
f7132e4044
commit
2b1159dda0
3 changed files with 18 additions and 5 deletions
|
@ -81,7 +81,7 @@ void INT_VDD5V(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void power_init(void)
|
void imx233_power_init(void)
|
||||||
{
|
{
|
||||||
/* setup vbusvalid parameters: set threshold to 4v and power up comparators */
|
/* setup vbusvalid parameters: set threshold to 4v and power up comparators */
|
||||||
__REG_CLR(HW_POWER_5VCTRL) = HW_POWER_5VCTRL__VBUSVALID_TRSH_BM;
|
__REG_CLR(HW_POWER_5VCTRL) = HW_POWER_5VCTRL__VBUSVALID_TRSH_BM;
|
||||||
|
@ -110,6 +110,10 @@ void power_init(void)
|
||||||
__FIELD_SET(HW_POWER_LOOPCTRL, EN_RCSCALE, HW_POWER_LOOPCTRL__EN_RCSCALE__2X);
|
__FIELD_SET(HW_POWER_LOOPCTRL, EN_RCSCALE, HW_POWER_LOOPCTRL__EN_RCSCALE__2X);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void power_init(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void power_off(void)
|
void power_off(void)
|
||||||
{
|
{
|
||||||
/* wait a bit, useful for the user to stop touching anything */
|
/* wait a bit, useful for the user to stop touching anything */
|
||||||
|
|
|
@ -177,6 +177,8 @@
|
||||||
#define HW_POWER_RESET__UNLOCK 0x3E770000
|
#define HW_POWER_RESET__UNLOCK 0x3E770000
|
||||||
#define HW_POWER_RESET__PWD 0x1
|
#define HW_POWER_RESET__PWD 0x1
|
||||||
|
|
||||||
|
void imx233_power_init(void);
|
||||||
|
|
||||||
void imx233_power_set_charge_current(unsigned current); /* in mA */
|
void imx233_power_set_charge_current(unsigned current); /* in mA */
|
||||||
void imx233_power_set_stop_current(unsigned current); /* in mA */
|
void imx233_power_set_stop_current(unsigned current); /* in mA */
|
||||||
void imx233_power_enable_batadj(bool enable);
|
void imx233_power_enable_batadj(bool enable);
|
||||||
|
|
|
@ -101,6 +101,10 @@ void memory_init(void)
|
||||||
|
|
||||||
void system_init(void)
|
void system_init(void)
|
||||||
{
|
{
|
||||||
|
/* NOTE: don't use anything here that might require tick task !
|
||||||
|
* It is initialized by kernel_init *after* system_init().
|
||||||
|
* The main() will naturally set cpu speed to normal after kernel_init()
|
||||||
|
* so don't bother if the cpu is running at 24MHz here. */
|
||||||
imx233_clkctrl_enable_clock(CLK_PLL, true);
|
imx233_clkctrl_enable_clock(CLK_PLL, true);
|
||||||
imx233_rtc_init();
|
imx233_rtc_init();
|
||||||
imx233_icoll_init();
|
imx233_icoll_init();
|
||||||
|
@ -111,11 +115,9 @@ void system_init(void)
|
||||||
imx233_dcp_init();
|
imx233_dcp_init();
|
||||||
imx233_pwm_init();
|
imx233_pwm_init();
|
||||||
imx233_lradc_init();
|
imx233_lradc_init();
|
||||||
|
imx233_power_init();
|
||||||
imx233_i2c_init();
|
imx233_i2c_init();
|
||||||
#if !defined(BOOTLOADER) &&(defined(SANSA_FUZEPLUS) || \
|
|
||||||
defined(CREATIVE_ZENXFI3) || defined(CREATIVE_ZENXFI2))
|
|
||||||
fmradio_i2c_init();
|
|
||||||
#endif
|
|
||||||
imx233_clkctrl_enable_auto_slow_monitor(AS_CPU_INSTR, true);
|
imx233_clkctrl_enable_auto_slow_monitor(AS_CPU_INSTR, true);
|
||||||
imx233_clkctrl_enable_auto_slow_monitor(AS_CPU_DATA, true);
|
imx233_clkctrl_enable_auto_slow_monitor(AS_CPU_DATA, true);
|
||||||
imx233_clkctrl_enable_auto_slow_monitor(AS_TRAFFIC, true);
|
imx233_clkctrl_enable_auto_slow_monitor(AS_TRAFFIC, true);
|
||||||
|
@ -124,6 +126,11 @@ void system_init(void)
|
||||||
imx233_clkctrl_enable_auto_slow_monitor(AS_APBHDMA, true);
|
imx233_clkctrl_enable_auto_slow_monitor(AS_APBHDMA, true);
|
||||||
imx233_clkctrl_set_auto_slow_divisor(AS_DIV_8);
|
imx233_clkctrl_set_auto_slow_divisor(AS_DIV_8);
|
||||||
imx233_clkctrl_enable_auto_slow(true);
|
imx233_clkctrl_enable_auto_slow(true);
|
||||||
|
|
||||||
|
#if !defined(BOOTLOADER) &&(defined(SANSA_FUZEPLUS) || \
|
||||||
|
defined(CREATIVE_ZENXFI3) || defined(CREATIVE_ZENXFI2))
|
||||||
|
fmradio_i2c_init();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool imx233_us_elapsed(uint32_t ref, unsigned us_delay)
|
bool imx233_us_elapsed(uint32_t ref, unsigned us_delay)
|
||||||
|
|
Loading…
Reference in a new issue