Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+18 -5
+5 -1
firmware/target/arm/imx233/power-imx233.c
··· 81 81 } 82 82 } 83 83 84 - void power_init(void) 84 + void imx233_power_init(void) 85 85 { 86 86 /* setup vbusvalid parameters: set threshold to 4v and power up comparators */ 87 87 __REG_CLR(HW_POWER_5VCTRL) = HW_POWER_5VCTRL__VBUSVALID_TRSH_BM; ··· 108 108 __REG_SET(HW_POWER_LOOPCTRL) = HW_POWER_LOOPCTRL__TOGGLE_DIF | 109 109 HW_POWER_LOOPCTRL__EN_CM_HYST; 110 110 __FIELD_SET(HW_POWER_LOOPCTRL, EN_RCSCALE, HW_POWER_LOOPCTRL__EN_RCSCALE__2X); 111 + } 112 + 113 + void power_init(void) 114 + { 111 115 } 112 116 113 117 void power_off(void)
+2
firmware/target/arm/imx233/power-imx233.h
··· 177 177 #define HW_POWER_RESET__UNLOCK 0x3E770000 178 178 #define HW_POWER_RESET__PWD 0x1 179 179 180 + void imx233_power_init(void); 181 + 180 182 void imx233_power_set_charge_current(unsigned current); /* in mA */ 181 183 void imx233_power_set_stop_current(unsigned current); /* in mA */ 182 184 void imx233_power_enable_batadj(bool enable);
+11 -4
firmware/target/arm/imx233/system-imx233.c
··· 101 101 102 102 void system_init(void) 103 103 { 104 + /* NOTE: don't use anything here that might require tick task ! 105 + * It is initialized by kernel_init *after* system_init(). 106 + * The main() will naturally set cpu speed to normal after kernel_init() 107 + * so don't bother if the cpu is running at 24MHz here. */ 104 108 imx233_clkctrl_enable_clock(CLK_PLL, true); 105 109 imx233_rtc_init(); 106 110 imx233_icoll_init(); ··· 111 115 imx233_dcp_init(); 112 116 imx233_pwm_init(); 113 117 imx233_lradc_init(); 118 + imx233_power_init(); 114 119 imx233_i2c_init(); 115 - #if !defined(BOOTLOADER) &&(defined(SANSA_FUZEPLUS) || \ 116 - defined(CREATIVE_ZENXFI3) || defined(CREATIVE_ZENXFI2)) 117 - fmradio_i2c_init(); 118 - #endif 120 + 119 121 imx233_clkctrl_enable_auto_slow_monitor(AS_CPU_INSTR, true); 120 122 imx233_clkctrl_enable_auto_slow_monitor(AS_CPU_DATA, true); 121 123 imx233_clkctrl_enable_auto_slow_monitor(AS_TRAFFIC, true); ··· 124 126 imx233_clkctrl_enable_auto_slow_monitor(AS_APBHDMA, true); 125 127 imx233_clkctrl_set_auto_slow_divisor(AS_DIV_8); 126 128 imx233_clkctrl_enable_auto_slow(true); 129 + 130 + #if !defined(BOOTLOADER) &&(defined(SANSA_FUZEPLUS) || \ 131 + defined(CREATIVE_ZENXFI3) || defined(CREATIVE_ZENXFI2)) 132 + fmradio_i2c_init(); 133 + #endif 127 134 } 128 135 129 136 bool imx233_us_elapsed(uint32_t ref, unsigned us_delay)