Skip to content

Commit ea8ecea

Browse files
authored
Merge pull request hathach#1953 from tannewt/fix_cached_imx_reset
Flush the dcd data on reset
2 parents 7cf67b2 + d31aac4 commit ea8ecea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/portable/chipidea/ci_hs/dcd_ci_hs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848

4949
#define CI_HS_REG(_port) ((ci_hs_regs_t*) _ci_controller[_port].reg_base)
5050

51+
// Clean means to push any cached changes to RAM and invalidate "removes" the
52+
// entry from the cache.
5153
#if defined(__CORTEX_M) && __CORTEX_M == 7 && __DCACHE_PRESENT == 1
5254
#define CleanInvalidateDCache_by_Addr SCB_CleanInvalidateDCache_by_Addr
5355
#else
@@ -199,6 +201,8 @@ static void bus_reset(uint8_t rhport)
199201
_dcd_data.qhd[0][0].qtd_overlay.next = _dcd_data.qhd[0][1].qtd_overlay.next = QTD_NEXT_INVALID;
200202

201203
_dcd_data.qhd[0][0].int_on_setup = 1; // OUT only
204+
205+
CleanInvalidateDCache_by_Addr((uint32_t*) &_dcd_data, sizeof(dcd_data_t));
202206
}
203207

204208
void dcd_init(uint8_t rhport)

0 commit comments

Comments
 (0)