Lines Matching refs:inst
140 for (int inst = 0; inst < NHW_NVMC_UICR_TOTAL_INST; inst++) { in nhw_nvmc_uicr_init() local
141 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_uicr_init()
142 this->NVMC_regs = &NRF_NVMC_regs[inst]; in nhw_nvmc_uicr_init()
143 NRF_NVMC_regs_p[inst] = &NRF_NVMC_regs[inst]; in nhw_nvmc_uicr_init()
145 NRF_NVMC_regs[inst].READY = 1; in nhw_nvmc_uicr_init()
146 NRF_NVMC_regs[inst].READYNEXT = 1; in nhw_nvmc_uicr_init()
147 NRF_NVMC_regs[inst].ERASEPAGEPARTIALCFG = 0x0000000A; in nhw_nvmc_uicr_init()
152 this->flash_start_addr = flash_start_addr[inst]; in nhw_nvmc_uicr_init()
153 this->flash_n_pages = flash_n_pages[inst]; in nhw_nvmc_uicr_init()
154 this->flash_page_size = flash_page_sizes[inst]; in nhw_nvmc_uicr_init()
157 nhw_nvm_init_storage(&this->flash_st, &nvmc_args.flash[inst], in nhw_nvmc_uicr_init()
160 this->uicr_size = uicr_size[inst]; in nhw_nvmc_uicr_init()
161 nhw_nvm_init_storage(&this->uicr_st, &nvmc_args.uicr[inst], in nhw_nvmc_uicr_init()
164 NRF_UICR_regs_p[inst] = (NRF_UICR_Type *)this->uicr_st.storage; in nhw_nvmc_uicr_init()
190 for (int inst = 0; inst < NHW_NVMC_UICR_TOTAL_INST; inst++) { in nhw_nvmc_uicr_clean_up() local
191 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_uicr_clean_up()
208 static void nhw_nvmc_complete_erase(uint inst) { in nhw_nvmc_complete_erase() argument
209 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_complete_erase()
222 static void nhw_nvmc_complete_erase_partial(uint inst){ in nhw_nvmc_complete_erase_partial() argument
223 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_complete_erase_partial()
225 nhw_nvmc_complete_erase(inst); in nhw_nvmc_complete_erase_partial()
232 static void nhw_nvmc_complete_erase_uicr(uint inst){ in nhw_nvmc_complete_erase_uicr() argument
233 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_complete_erase_uicr()
240 static void nhw_nvmc_complete_erase_all(uint inst){ in nhw_nvmc_complete_erase_all() argument
241 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_complete_erase_all()
242 nhw_nvmc_complete_erase_uicr(inst); in nhw_nvmc_complete_erase_all()
254 for (int inst = 0; inst < NHW_NVMC_UICR_TOTAL_INST; inst++) { in nhw_nvmc_timer_triggered() local
255 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_timer_triggered()
264 nhw_nvmc_complete_erase(inst); in nhw_nvmc_timer_triggered()
267 nhw_nvmc_complete_erase_partial(inst); in nhw_nvmc_timer_triggered()
270 nhw_nvmc_complete_erase_uicr(inst); in nhw_nvmc_timer_triggered()
273 nhw_nvmc_complete_erase_all(inst); in nhw_nvmc_timer_triggered()
283 NRF_NVMC_regs[inst].READY = 1; in nhw_nvmc_timer_triggered()
284 NRF_NVMC_regs[inst].READYNEXT = 1; in nhw_nvmc_timer_triggered()
293 bs_time_t nhw_nvmc_time_to_ready(uint inst) { in nhw_nvmc_time_to_ready() argument
294 if (NRF_NVMC_regs[inst].READY) { in nhw_nvmc_time_to_ready()
297 return hw_nvmc_st[inst].timer - nsi_hws_get_time(); in nhw_nvmc_time_to_ready()
321 __func__, x, i, hw_nvmc_st[inst].flash_op); \
349 void nhw_nvmc_erase_page(uint inst, uint32_t address){ in nhw_nvmc_erase_page() argument
350 ERASE_ENABLED_CHECK(inst, "ERASEPAGE"); in nhw_nvmc_erase_page()
351 BUSY_CHECK(inst, "ERASEPAGE"); in nhw_nvmc_erase_page()
352 CHECK_ERASE_ADDRESS(inst, address); in nhw_nvmc_erase_page()
354 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_erase_page()
357 NRF_NVMC_regs[inst].READY = 0; in nhw_nvmc_erase_page()
358 NRF_NVMC_regs[inst].READYNEXT = 0; in nhw_nvmc_erase_page()
366 void nhw_nvmc_regw_sideeffects_ERASEPAGE(uint inst) { in nhw_nvmc_regw_sideeffects_ERASEPAGE() argument
367 nhw_nvmc_erase_page(inst, NRF_NVMC_regs[inst].ERASEPAGE); in nhw_nvmc_regw_sideeffects_ERASEPAGE()
370 void nhw_nvmc_regw_sideeffects_ERASEPCR0(uint inst) { in nhw_nvmc_regw_sideeffects_ERASEPCR0() argument
371 nhw_nvmc_erase_page(inst, NRF_NVMC_regs[inst].ERASEPCR0); in nhw_nvmc_regw_sideeffects_ERASEPCR0()
374 void nhw_nvmc_regw_sideeffects_ERASEUICR(uint inst) { in nhw_nvmc_regw_sideeffects_ERASEUICR() argument
375 NRF_NVMC_regs[inst].ERASEUICR &= 1; in nhw_nvmc_regw_sideeffects_ERASEUICR()
377 if (NRF_NVMC_regs[inst].ERASEUICR) { in nhw_nvmc_regw_sideeffects_ERASEUICR()
378 NRF_NVMC_regs[inst].ERASEUICR = 0; in nhw_nvmc_regw_sideeffects_ERASEUICR()
379 ERASE_ENABLED_CHECK(inst, "ERASEUICR"); in nhw_nvmc_regw_sideeffects_ERASEUICR()
380 BUSY_CHECK(inst, "ERASEUICR"); in nhw_nvmc_regw_sideeffects_ERASEUICR()
381 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_regw_sideeffects_ERASEUICR()
384 NRF_NVMC_regs[inst].READY = 0; in nhw_nvmc_regw_sideeffects_ERASEUICR()
385 NRF_NVMC_regs[inst].READYNEXT = 0; in nhw_nvmc_regw_sideeffects_ERASEUICR()
392 void nhw_nvmc_regw_sideeffects_ERASEALL(uint inst) { in nhw_nvmc_regw_sideeffects_ERASEALL() argument
393 NRF_NVMC_regs[inst].ERASEALL &= 1; in nhw_nvmc_regw_sideeffects_ERASEALL()
395 if (NRF_NVMC_regs[inst].ERASEALL) { in nhw_nvmc_regw_sideeffects_ERASEALL()
396 NRF_NVMC_regs[inst].ERASEALL = 0; in nhw_nvmc_regw_sideeffects_ERASEALL()
397 ERASE_ENABLED_CHECK(inst, "ERASEALL"); in nhw_nvmc_regw_sideeffects_ERASEALL()
398 BUSY_CHECK(inst, "ERASEALL"); in nhw_nvmc_regw_sideeffects_ERASEALL()
399 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_regw_sideeffects_ERASEALL()
402 NRF_NVMC_regs[inst].READY = 0; in nhw_nvmc_regw_sideeffects_ERASEALL()
403 NRF_NVMC_regs[inst].READYNEXT = 0; in nhw_nvmc_regw_sideeffects_ERASEALL()
409 void nhw_nvmc_erase_page_partial(uint inst, uint32_t address) { in nhw_nvmc_erase_page_partial() argument
411 ERASEPARTIAL_ENABLED_CHECK(inst, "ERASEPARTIAL"); in nhw_nvmc_erase_page_partial()
413 ERASE_ENABLED_CHECK(inst, "ERASEPARTIAL"); in nhw_nvmc_erase_page_partial()
415 BUSY_CHECK(inst, "ERASEPARTIAL"); in nhw_nvmc_erase_page_partial()
416 CHECK_ERASE_ADDRESS(inst, address); in nhw_nvmc_erase_page_partial()
417 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_erase_page_partial()
422 NRF_NVMC_regs[inst].READY = 0; in nhw_nvmc_erase_page_partial()
423 NRF_NVMC_regs[inst].READYNEXT = 0; in nhw_nvmc_erase_page_partial()
425 …bs_time_t duration = NHW_NVMC_FLASH_PARTIAL_ERASE_FACTOR * NRF_NVMC_regs[inst].ERASEPAGEPARTIALCFG… in nhw_nvmc_erase_page_partial()
435 void nhw_nvmc_regw_sideeffects_ERASEPAGEPARTIAL(uint inst) { in nhw_nvmc_regw_sideeffects_ERASEPAGEPARTIAL() argument
436 nhw_nvmc_erase_page_partial(inst, NRF_NVMC_regs[inst].ERASEPAGEPARTIAL); in nhw_nvmc_regw_sideeffects_ERASEPAGEPARTIAL()
451 static void nhw_nvmc_address_location(uint32_t address, uint *inst, nvm_storage_state_t **storage, … in nhw_nvmc_address_location() argument
453 *inst = i; in nhw_nvmc_address_location()
487 uint inst; in nhw_nmvc_write_word() local
489 nhw_nvmc_address_location(address, &inst, &backend, &offset); in nhw_nmvc_write_word()
491 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nmvc_write_word()
493 BUSY_CHECK(inst, "write"); in nhw_nmvc_write_word()
497 if ((NRF_NVMC_regs[inst].CONFIG & NVMC_CONFIG_WEN_Msk) == NVMC_CONFIG_WEN_Een) { in nhw_nmvc_write_word()
499 nhw_nvmc_erase_page(inst, address); in nhw_nmvc_write_word()
503 if ((NRF_NVMC_regs[inst].CONFIG & NVMC_CONFIG_WEN_Msk) == NVMC_CONFIG_WEN_PEen) { in nhw_nmvc_write_word()
505 nhw_nvmc_erase_page_partial(inst, address); in nhw_nmvc_write_word()
512 if ((NRF_NVMC_regs[inst].CONFIG & NVMC_CONFIG_WEN_Msk) != NVMC_CONFIG_WEN_Wen) { in nhw_nmvc_write_word()
515 __func__, NRF_NVMC_regs[inst].CONFIG); in nhw_nmvc_write_word()
520 CHECK_PARTIAL_ERASE(inst, offset, "write"); in nhw_nmvc_write_word()
531 NRF_NVMC_regs[inst].READY = 0; in nhw_nmvc_write_word()
532 NRF_NVMC_regs[inst].READYNEXT = 0; in nhw_nmvc_write_word()
554 uint inst; in nhw_nmvc_read_word() local
556 nhw_nvmc_address_location(address, &inst, &backend, &offset); in nhw_nmvc_read_word()
558 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nmvc_read_word()
561 CHECK_PARTIAL_ERASE(inst, offset, "read"); in nhw_nmvc_read_word()
570 uint inst; in nhw_nmvc_read_halfword() local
572 nhw_nvmc_address_location(address, &inst, &backend, &offset); in nhw_nmvc_read_halfword()
574 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nmvc_read_halfword()
577 CHECK_PARTIAL_ERASE(inst, offset, "read"); in nhw_nmvc_read_halfword()
586 uint inst; in nhw_nmvc_read_byte() local
588 nhw_nvmc_address_location(address, &inst, &backend, &offset); in nhw_nmvc_read_byte()
590 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nmvc_read_byte()
593 CHECK_PARTIAL_ERASE(inst, offset, "read"); in nhw_nmvc_read_byte()
618 uint inst; in nhw_nmvc_read_buffer() local
620 nhw_nvmc_address_location(address, &inst, &backend, &offset); in nhw_nmvc_read_buffer()
622 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nmvc_read_buffer()
626 CHECK_PARTIAL_ERASE(inst, i, "read"); in nhw_nmvc_read_buffer()
637 void* nrfhw_nmvc_flash_get_base_address(uint inst){ in nrfhw_nmvc_flash_get_base_address() argument
638 return (void*)&hw_nvmc_st[inst].flash_st.storage; in nrfhw_nmvc_flash_get_base_address()