Lines Matching refs:this
141 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_uicr_init() local
142 this->NVMC_regs = &NRF_NVMC_regs[inst]; in nhw_nvmc_uicr_init()
149 this->flash_op = flash_idle; in nhw_nvmc_uicr_init()
150 this->timer = TIME_NEVER; 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()
155 this->flash_size = this->flash_n_pages * this->flash_page_size; in nhw_nvmc_uicr_init()
157 nhw_nvm_init_storage(&this->flash_st, &nvmc_args.flash[inst], in nhw_nvmc_uicr_init()
158 this->flash_size, "flash"); 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()
162 this->uicr_size, "UICR"); in nhw_nvmc_uicr_init()
164 NRF_UICR_regs_p[inst] = (NRF_UICR_Type *)this->uicr_st.storage; in nhw_nvmc_uicr_init()
166 this->time_under_erase = (bs_time_t *)bs_calloc(this->flash_n_pages, sizeof(bs_time_t)); in nhw_nvmc_uicr_init()
167 this->page_erased = (bool *)bs_malloc(this->flash_n_pages * sizeof(bool)); in nhw_nvmc_uicr_init()
168 memset(this->page_erased, true, this->flash_n_pages * sizeof(bool)); in nhw_nvmc_uicr_init()
171 for (int i = 0; i < this->flash_size; i+=4) { in nhw_nvmc_uicr_init()
172 if (*(uint32_t*)(this->flash_st.storage + i) != 0) { in nhw_nvmc_uicr_init()
173 int page_size = this->flash_page_size; in nhw_nvmc_uicr_init()
174 this->page_erased[i/page_size] = false; in nhw_nvmc_uicr_init()
191 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_uicr_clean_up() local
192 nhw_nvm_clear_storage(&this->flash_st); in nhw_nvmc_uicr_clean_up()
193 nhw_nvm_clear_storage(&this->uicr_st); in nhw_nvmc_uicr_clean_up()
195 free(this->time_under_erase); in nhw_nvmc_uicr_clean_up()
196 this->time_under_erase = NULL; in nhw_nvmc_uicr_clean_up()
198 free(this->page_erased); in nhw_nvmc_uicr_clean_up()
199 this->page_erased = NULL; in nhw_nvmc_uicr_clean_up()
209 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_complete_erase() local
210 uint erase_page = this->erase_page; in nhw_nvmc_complete_erase()
211 uint base_address = erase_page*this->flash_page_size; in nhw_nvmc_complete_erase()
213 memset(&this->flash_st.storage[base_address], 0xFF, this->flash_page_size); in nhw_nvmc_complete_erase()
215 this->time_under_erase[erase_page] = 0; in nhw_nvmc_complete_erase()
216 this->page_erased[erase_page] = true; in nhw_nvmc_complete_erase()
223 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_complete_erase_partial() local
224 if (this->time_under_erase[this->erase_page] >= NHW_NVMC_FLASH_T_ERASEPAGE) { in nhw_nvmc_complete_erase_partial()
233 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_complete_erase_uicr() local
234 (void)memset(this->uicr_st.storage, 0xFF, this->uicr_st.size); in nhw_nvmc_complete_erase_uicr()
241 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_complete_erase_all() local
243 (void)memset(this->flash_st.storage, 0xFF, this->flash_st.size); in nhw_nvmc_complete_erase_all()
245 memset(this->time_under_erase, 0, this->flash_n_pages*sizeof(bs_time_t)); in nhw_nvmc_complete_erase_all()
246 memset(this->page_erased, true, this->flash_n_pages*sizeof(bool)); in nhw_nvmc_complete_erase_all()
255 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_timer_triggered() local
256 if (this->timer != Timer_NVMC) { in nhw_nvmc_timer_triggered()
259 switch (this->flash_op) { in nhw_nvmc_timer_triggered()
277 "operation (%i)\n", __func__, this->flash_op); in nhw_nvmc_timer_triggered()
281 this->flash_op = flash_idle; in nhw_nvmc_timer_triggered()
285 this->timer = TIME_NEVER; in nhw_nvmc_timer_triggered()
354 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_erase_page() local
356 this->flash_op = flash_erase; in nhw_nvmc_erase_page()
359 this->erase_page = (address - this->flash_start_addr) / this->flash_page_size; in nhw_nvmc_erase_page()
360 this->timer = nsi_hws_get_time() + NHW_NVMC_FLASH_T_ERASEPAGE; in nhw_nvmc_erase_page()
381 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_regw_sideeffects_ERASEUICR() local
383 this->flash_op = flash_erase_uicr; in nhw_nvmc_regw_sideeffects_ERASEUICR()
386 this->timer = nsi_hws_get_time() + NHW_NVMC_FLASH_T_ERASEPAGE; in nhw_nvmc_regw_sideeffects_ERASEUICR()
399 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_regw_sideeffects_ERASEALL() local
401 this->flash_op = flash_erase_all; in nhw_nvmc_regw_sideeffects_ERASEALL()
404 this->timer = nsi_hws_get_time() + NHW_NVMC_FLASH_T_ERASEALL; in nhw_nvmc_regw_sideeffects_ERASEALL()
417 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nvmc_erase_page_partial() local
419 this->erase_page = (address - this->flash_start_addr)/this->flash_page_size; in nhw_nvmc_erase_page_partial()
421 this->flash_op = flash_erase_partial; in nhw_nvmc_erase_page_partial()
427 if (this->page_erased[this->erase_page] == false) { in nhw_nvmc_erase_page_partial()
428 this->time_under_erase[this->erase_page] += duration; in nhw_nvmc_erase_page_partial()
430 this->timer = nsi_hws_get_time() + duration; in nhw_nvmc_erase_page_partial()
491 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nmvc_write_word() local
496 if (backend == &this->flash_st) { in nhw_nmvc_write_word()
498 if ((value == 0xFFFFFFFF) && (offset % this->flash_page_size == 0)) { in nhw_nmvc_write_word()
504 if ((value == 0xFFFFFFFF) && (offset % this->flash_page_size == 0)) { in nhw_nmvc_write_word()
519 if (backend == &this->flash_st) { in nhw_nmvc_write_word()
521 this->page_erased[offset/this->flash_page_size] = false; in nhw_nmvc_write_word()
530 this->flash_op = flash_write; in nhw_nmvc_write_word()
534 this->timer = nsi_hws_get_time() + NHW_NVMC_FLASH_T_WRITE; in nhw_nmvc_write_word()
558 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nmvc_read_word() local
560 if (backend == &this->flash_st) { in nhw_nmvc_read_word()
574 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nmvc_read_halfword() local
576 if (backend == &this->flash_st) { in nhw_nmvc_read_halfword()
590 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nmvc_read_byte() local
592 if (backend == &this->flash_st) { in nhw_nmvc_read_byte()
622 struct hw_nvmc_st_t *this = &hw_nvmc_st[inst]; in nhw_nmvc_read_buffer() local
624 if ((backend == &this->flash_st) && (nvmc_args.flash_erase_warnings)) { in nhw_nmvc_read_buffer()
625 for (uint32_t i = offset; i < offset + size ; i+= this->flash_page_size) { in nhw_nmvc_read_buffer()