@@ -117,22 +117,15 @@ nrfx_err_t nrfx_qspi2_init(const nrfx_qspi2_t * p_qspi, const nrfx_qspi2_cfg_t *
117117 p_cb -> transfer_in_progress = false;
118118 p_cb -> prepared_pending = false;
119119
120- //Formatting default values
121120 //Formatting default values
122121 p_cb -> conf .format .pixels = 0 ;
123122 p_cb -> conf .format .dfs = 7 ;
124123 p_cb -> conf .ctrlr0 .dfs = 7 ;
125- p_cb -> conf .format .bpp = 0 ;
124+ p_cb -> conf .format .bpp = 8 ;
126125 p_cb -> conf .format .padding = 0 ;
127126 p_cb -> conf .format .bitorder = 0 ;
128127 p_cb -> conf .format .cilen = 0 ;
129128
130- nrf_qspi2_format_dfs (p_qspi -> p_reg , (uint8_t )(p_cb -> conf .format .dfs - 1U ));
131- nrf_qspi2_core_dr_x (p_qspi -> p_reg , (uint32_t )(32 - p_cb -> conf .format .dfs ), 22 ); //Hijacking DR[22] as red_dfs
132- nrf_qspi2_format_bpp (p_qspi -> p_reg , (uint8_t )(p_cb -> conf .format .bpp ));
133- nrf_qspi2_format_bitorder (p_qspi -> p_reg , (int )p_cb -> conf .format .bitorder ,
134- (int )p_cb -> conf .format .bitorder );
135-
136129 // Set all pins to unused.
137130 for (int i = 0 ; i < 6 ; i ++ )
138131 {
@@ -241,6 +234,12 @@ nrfx_err_t nrfx_qspi2_init(const nrfx_qspi2_t * p_qspi, const nrfx_qspi2_cfg_t *
241234 }
242235 }
243236
237+ nrf_qspi2_format_dfs (p_qspi -> p_reg , (uint8_t )(p_cb -> conf .format .dfs ));
238+ nrf_qspi2_core_dr_x (p_qspi -> p_reg , (uint32_t )(32 - p_cb -> conf .format .padding ), 22 ); //Hijacking DR[22] as red_dfs
239+ nrf_qspi2_format_bpp (p_qspi -> p_reg , (uint8_t )(p_cb -> conf .format .bpp ));
240+ nrf_qspi2_format_bitorder (p_qspi -> p_reg , (int )p_cb -> conf .format .bitorder ,
241+ (int )p_cb -> conf .format .bitorder );
242+
244243 NRFX_IRQ_PRIORITY_SET (SP_VPR_IRQn , 1 );
245244 NRFX_IRQ_ENABLE (SP_VPR_IRQn );
246245
@@ -298,6 +297,19 @@ void nrfx_qspi2_uninit(const nrfx_qspi2_t * p_qspi)
298297
299298 // Stop VPR.
300299 nrf_vpr_cpurun_set (NRF_VPR , false);
300+ #if defined(NRF54H20_XXAA )
301+ // Reset VPR.
302+ nrf_vpr_debugif_dmcontrol_mask_set (NRF_VPR ,
303+ (VPR_DEBUGIF_DMCONTROL_NDMRESET_Active
304+ << VPR_DEBUGIF_DMCONTROL_NDMRESET_Pos |
305+ VPR_DEBUGIF_DMCONTROL_DMACTIVE_Enabled
306+ << VPR_DEBUGIF_DMCONTROL_DMACTIVE_Pos ));
307+ nrf_vpr_debugif_dmcontrol_mask_set (NRF_VPR ,
308+ (VPR_DEBUGIF_DMCONTROL_NDMRESET_Inactive
309+ << VPR_DEBUGIF_DMCONTROL_NDMRESET_Pos |
310+ VPR_DEBUGIF_DMCONTROL_DMACTIVE_Disabled
311+ << VPR_DEBUGIF_DMCONTROL_DMACTIVE_Pos ));
312+ #endif
301313
302314 p_cb -> state = NRFX_DRV_STATE_UNINITIALIZED ;
303315}
@@ -432,6 +444,10 @@ nrfx_err_t nrfx_qspi2_dev_data_fmt_set(const nrfx_qspi2_t * p_qspi,
432444 {
433445 return NRFX_ERROR_INVALID_PARAM ;
434446 }
447+ if (p_data_fmt -> data_bit_reorder_unit != p_data_fmt -> data_swap_unit )
448+ {
449+ return NRFX_ERROR_INVALID_PARAM ;
450+ }
435451 if (p_data_fmt -> data_padding != 0 )
436452 {
437453 if (p_data_fmt -> data_container + p_data_fmt -> data_padding != 32 )
@@ -630,7 +646,7 @@ nrfx_err_t nrfx_qspi2_xfer(const nrfx_qspi2_t * p_qspi,
630646{
631647 if (flags == NRFX_QSPI2_FLAG_HOLD_XFER )
632648 {
633- return nrfx_qspi2_xfer_prepare ( p_qspi , p_xfer , xfer_count ) ;
649+ return NRFX_ERROR_NOT_SUPPORTED ;
634650 }
635651
636652 qspi2_control_block_t * p_cb = & m_cb [p_qspi -> drv_inst_idx ];
@@ -646,7 +662,6 @@ nrfx_err_t nrfx_qspi2_xfer(const nrfx_qspi2_t * p_qspi,
646662
647663 if (retval == NRFX_SUCCESS )
648664 {
649-
650665 nrf_qspi2_core_enable (p_qspi -> p_reg );
651666 __ASB (p_qspi -> p_reg );
652667
0 commit comments