@@ -17,8 +17,6 @@ LOG_MODULE_DECLARE(clock_control_nrf2, CONFIG_CLOCK_CONTROL_LOG_LEVEL);
1717BUILD_ASSERT (DT_NUM_INST_STATUS_OKAY (DT_DRV_COMPAT ) == 1 ,
1818 "multiple instances not supported" );
1919
20- #include <hal/nrf_hsfll.h>
21-
2220#ifdef CONFIG_NRFS_HAS_DVFS_SERVICE
2321#include <ld_dvfs_handler.h>
2422
@@ -49,17 +47,7 @@ struct hsfll_dev_data {
4947 NRF2_STRUCT_CLOCK_CONFIG (hsfll , ARRAY_SIZE (clock_options )) clk_cfg ;
5048 struct k_timer timer ;
5149};
52- #endif /* CONFIG_NRFS_HAS_DVFS_SERVICE */
53-
54- struct hsfll_dev_config {
55- NRF_HSFLL_Type * hsfll ;
56- uint32_t trim_vsup ;
57- uint32_t trim_coarse ;
58- uint32_t trim_fine ;
59- uint8_t multiplier ;
60- };
6150
62- #ifdef CONFIG_NRFS_HAS_DVFS_SERVICE
6351static void freq_setting_applied_cb (enum dvfs_frequency_setting new_setting )
6452{
6553 ARG_UNUSED (new_setting );
@@ -205,30 +193,6 @@ static int api_get_rate_hsfll(const struct device *dev,
205193
206194static int hsfll_init (const struct device * dev )
207195{
208- const struct hsfll_dev_config * dev_config = dev -> config ;
209- nrf_hsfll_trim_t trim = {
210- .vsup = sys_read32 (dev_config -> trim_vsup ),
211- .coarse = sys_read32 (dev_config -> trim_coarse ),
212- .fine = sys_read32 (dev_config -> trim_fine ),
213- };
214-
215- LOG_DBG ("Trim: HSFLL VSUP: 0x%.8x" , trim .vsup );
216- LOG_DBG ("Trim: HSFLL COARSE: 0x%.8x" , trim .coarse );
217- LOG_DBG ("Trim: HSFLL FINE: 0x%.8x" , trim .fine );
218-
219- nrf_hsfll_clkctrl_mult_set (dev_config -> hsfll , dev_config -> multiplier );
220- nrf_hsfll_trim_set (dev_config -> hsfll , & trim );
221-
222- nrf_hsfll_task_trigger (dev_config -> hsfll , NRF_HSFLL_TASK_FREQ_CHANGE );
223- /* HSFLL task frequency change needs to be triggered twice to take effect.
224- * Refer to HMPAN-23.
225- */
226- nrf_hsfll_task_trigger (dev_config -> hsfll , NRF_HSFLL_TASK_FREQ_CHANGE );
227-
228- LOG_DBG ("NRF_HSFLL->TRIM.VSUP = %d" , dev_config -> hsfll -> TRIM .VSUP );
229- LOG_DBG ("NRF_HSFLL->TRIM.COARSE = %d" , dev_config -> hsfll -> TRIM .COARSE );
230- LOG_DBG ("NRF_HSFLL->TRIM.FINE = %d" , dev_config -> hsfll -> TRIM .FINE );
231-
232196#ifdef CONFIG_NRFS_HAS_DVFS_SERVICE
233197 struct hsfll_dev_data * dev_data = dev -> data ;
234198 int rc ;
@@ -260,30 +224,14 @@ static struct nrf_clock_control_driver_api hsfll_drv_api = {
260224 .cancel_or_release = api_cancel_or_release_hsfll ,
261225};
262226
263- #define HSFLL_MUTLIPLIER (n ) \
264- DT_PROP(DT_DRV_INST(n), clock_frequency) / \
265- DT_PROP(DT_CLOCKS_CTLR(DT_DRV_INST(n)), clock_frequency)
266-
267- #define FICR_ADDR_GET (n , name ) \
268- DT_REG_ADDR(DT_PHANDLE_BY_NAME(DT_DRV_INST(n), nordic_ficrs, name)) + \
269- DT_PHA_BY_NAME(DT_DRV_INST(n), nordic_ficrs, name, offset)
270-
271227#ifdef CONFIG_NRFS_HAS_DVFS_SERVICE
272228static struct hsfll_dev_data hsfll_data ;
273229#endif
274230
275- static const struct hsfll_dev_config hsfll_config = {
276- .hsfll = (NRF_HSFLL_Type * )DT_INST_REG_ADDR (0 ),
277- .multiplier = HSFLL_MUTLIPLIER (0 ),
278- .trim_vsup = FICR_ADDR_GET (0 , vsup ),
279- .trim_coarse = FICR_ADDR_GET (0 , coarse ),
280- .trim_fine = FICR_ADDR_GET (0 , fine ),
281- };
282-
283231DEVICE_DT_INST_DEFINE (0 , hsfll_init , NULL ,
284232 COND_CODE_1 (CONFIG_NRFS_HAS_DVFS_SERVICE ,
285233 (& hsfll_data ),
286234 (NULL )),
287- & hsfll_config ,
235+ NULL ,
288236 PRE_KERNEL_1 , CONFIG_CLOCK_CONTROL_INIT_PRIORITY ,
289237 & hsfll_drv_api );
0 commit comments