diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-11-20 15:24:14 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-11-20 15:24:14 -0600 |
commit | 79b4a47cf536fab6301072776ad9112289235a80 (patch) | |
tree | 6071ccfce88eb7463407169eff941c040a540d8c /nuttx/arch/arm/src/lpc31xx/lpc31_ehci.c | |
parent | 55025205747cb19541ad5a841a67206dd590330a (diff) | |
download | nuttx-79b4a47cf536fab6301072776ad9112289235a80.tar.gz nuttx-79b4a47cf536fab6301072776ad9112289235a80.tar.bz2 nuttx-79b4a47cf536fab6301072776ad9112289235a80.zip |
ARM9: More cache control functions
Diffstat (limited to 'nuttx/arch/arm/src/lpc31xx/lpc31_ehci.c')
-rwxr-xr-x | nuttx/arch/arm/src/lpc31xx/lpc31_ehci.c | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/nuttx/arch/arm/src/lpc31xx/lpc31_ehci.c b/nuttx/arch/arm/src/lpc31xx/lpc31_ehci.c index 224512935..3f7dc0cb1 100755 --- a/nuttx/arch/arm/src/lpc31xx/lpc31_ehci.c +++ b/nuttx/arch/arm/src/lpc31xx/lpc31_ehci.c @@ -56,6 +56,7 @@ #include <nuttx/usb/usbhost_trace.h> #include "up_arch.h" +#include "cache.h" #include "lpc31_internal.h" #include "lpc31_cgudrvr.h" @@ -1311,7 +1312,7 @@ static int lpc31_qtd_invalidate(struct lpc31_qtd_s *qtd, uint32_t **bp, void *ar * memory over the specified address range. */ - up_invalidate_dcache((uintptr_t)&qtd->hw, + cp15_invalidate_dcache((uintptr_t)&qtd->hw, (uintptr_t)&qtd->hw + sizeof(struct ehci_qtd_s)); return OK; } @@ -1330,7 +1331,7 @@ static int lpc31_qh_invalidate(struct lpc31_qh_s *qh) { /* Invalidate the QH first so that we reload the qTD list head */ - up_invalidate_dcache((uintptr_t)&qh->hw, + cp15_invalidate_dcache((uintptr_t)&qh->hw, (uintptr_t)&qh->hw + sizeof(struct ehci_qh_s)); /* Then invalidate all of the qTD entries in the queue */ @@ -1355,9 +1356,9 @@ static int lpc31_qtd_flush(struct lpc31_qtd_s *qtd, uint32_t **bp, void *arg) * to force re-loading of the data from memory when next accessed. */ - up_flush_dcache((uintptr_t)&qtd->hw, - (uintptr_t)&qtd->hw + sizeof(struct ehci_qtd_s)); - up_invalidate_dcache((uintptr_t)&qtd->hw, + cp15_flush_idcache((uintptr_t)&qtd->hw, + (uintptr_t)&qtd->hw + sizeof(struct ehci_qtd_s)); + cp15_invalidate_dcache((uintptr_t)&qtd->hw, (uintptr_t)&qtd->hw + sizeof(struct ehci_qtd_s)); return OK; @@ -1378,9 +1379,9 @@ static int lpc31_qh_flush(struct lpc31_qh_s *qh) * reloaded from D-Cache. */ - up_flush_dcache((uintptr_t)&qh->hw, - (uintptr_t)&qh->hw + sizeof(struct ehci_qh_s)); - up_invalidate_dcache((uintptr_t)&qh->hw, + cp15_flush_idcache((uintptr_t)&qh->hw, + (uintptr_t)&qh->hw + sizeof(struct ehci_qh_s)); + cp15_invalidate_dcache((uintptr_t)&qh->hw, (uintptr_t)&qh->hw + sizeof(struct ehci_qh_s)); /* Then flush all of the qTD entries in the queue */ @@ -1590,8 +1591,8 @@ static void lpc31_qh_enqueue(struct lpc31_qh_s *qhead, struct lpc31_qh_s *qh) physaddr = (uintptr_t)lpc31_physramaddr((uintptr_t)qh); qhead->hw.hlp = lpc31_swap32(physaddr | QH_HLP_TYP_QH); - up_flush_dcache((uintptr_t)&qhead->hw, - (uintptr_t)&qhead->hw + sizeof(struct ehci_qh_s)); + cp15_flush_idcache((uintptr_t)&qhead->hw, + (uintptr_t)&qhead->hw + sizeof(struct ehci_qh_s)); } /******************************************************************************* @@ -1727,8 +1728,8 @@ static int lpc31_qtd_addbpl(struct lpc31_qtd_s *qtd, const void *buffer, size_t * will be accessed for an OUT DMA. */ - up_flush_dcache((uintptr_t)buffer, (uintptr_t)buffer + buflen); - up_invalidate_dcache((uintptr_t)buffer, (uintptr_t)buffer + buflen); + cp15_flush_idcache((uintptr_t)buffer, (uintptr_t)buffer + buflen); + cp15_invalidate_dcache((uintptr_t)buffer, (uintptr_t)buffer + buflen); /* Loop, adding the aligned physical addresses of the buffer to the buffer page * list. Only the first entry need not be aligned (because only the first @@ -2275,7 +2276,7 @@ static ssize_t lpc31_async_transfer(struct lpc31_rhport_s *rhport, * invalid in this memory region. */ - up_invalidate_dcache((uintptr_t)buffer, (uintptr_t)buffer + buflen); + cp15_invalidate_dcache((uintptr_t)buffer, (uintptr_t)buffer + buflen); } #endif @@ -2510,7 +2511,7 @@ static int lpc31_qtd_ioccheck(struct lpc31_qtd_s *qtd, uint32_t **bp, void *arg) /* Make sure we reload the QH from memory */ - up_invalidate_dcache((uintptr_t)&qtd->hw, + cp15_invalidate_dcache((uintptr_t)&qtd->hw, (uintptr_t)&qtd->hw + sizeof(struct ehci_qtd_s)); lpc31_qtd_print(qtd); @@ -2561,7 +2562,7 @@ static int lpc31_qh_ioccheck(struct lpc31_qh_s *qh, uint32_t **bp, void *arg) /* Make sure we reload the QH from memory */ - up_invalidate_dcache((uintptr_t)&qh->hw, + cp15_invalidate_dcache((uintptr_t)&qh->hw, (uintptr_t)&qh->hw + sizeof(struct ehci_qh_s)); lpc31_qh_print(qh); @@ -2615,7 +2616,7 @@ static int lpc31_qh_ioccheck(struct lpc31_qh_s *qh, uint32_t **bp, void *arg) */ **bp = qh->hw.hlp; - up_flush_dcache((uintptr_t)*bp, (uintptr_t)*bp + sizeof(uint32_t)); + cp15_flush_idcache((uintptr_t)*bp, (uintptr_t)*bp + sizeof(uint32_t)); /* Check for errors, update the data toggle */ @@ -2715,7 +2716,7 @@ static inline void lpc31_ioc_bottomhalf(void) /* Check the Asynchronous Queue */ /* Make sure that the head of the asynchronous queue is invalidated */ - up_invalidate_dcache((uintptr_t)&g_asynchead.hw, + cp15_invalidate_dcache((uintptr_t)&g_asynchead.hw, (uintptr_t)&g_asynchead.hw + sizeof(struct ehci_qh_s)); /* Set the back pointer to the forward qTD pointer of the asynchronous @@ -2741,7 +2742,7 @@ static inline void lpc31_ioc_bottomhalf(void) /* Check the Interrupt Queue */ /* Make sure that the head of the interrupt queue is invalidated */ - up_invalidate_dcache((uintptr_t)&g_intrhead.hw, + cp15_invalidate_dcache((uintptr_t)&g_intrhead.hw, (uintptr_t)&g_intrhead.hw + sizeof(struct ehci_qh_s)); /* Set the back pointer to the forward qTD pointer of the asynchronous @@ -4393,8 +4394,8 @@ FAR struct usbhost_connection_s *lpc31_ehci_initialize(int controller) g_asynchead.hw.overlay.token = lpc31_swap32(QH_TOKEN_HALTED); g_asynchead.fqp = lpc31_swap32(QTD_NQP_T); - up_flush_dcache((uintptr_t)&g_asynchead.hw, - (uintptr_t)&g_asynchead.hw + sizeof(struct ehci_qh_s)); + cp15_flush_idcache((uintptr_t)&g_asynchead.hw, + (uintptr_t)&g_asynchead.hw + sizeof(struct ehci_qh_s)); /* Set the Current Asynchronous List Address. */ @@ -4424,10 +4425,10 @@ FAR struct usbhost_connection_s *lpc31_ehci_initialize(int controller) /* Set the Periodic Frame List Base Address. */ - up_flush_dcache((uintptr_t)&g_intrhead.hw, - (uintptr_t)&g_intrhead.hw + sizeof(struct ehci_qh_s)); - up_flush_dcache((uintptr_t)g_framelist, - (uintptr_t)g_framelist + FRAME_LIST_SIZE * sizeof(uint32_t)); + cp15_flush_idcache((uintptr_t)&g_intrhead.hw, + (uintptr_t)&g_intrhead.hw + sizeof(struct ehci_qh_s)); + cp15_flush_idcache((uintptr_t)g_framelist, + (uintptr_t)g_framelist + FRAME_LIST_SIZE * sizeof(uint32_t)); physaddr = lpc31_physramaddr((uintptr_t)g_framelist); lpc31_putreg(lpc31_swap32(physaddr), &HCOR->periodiclistbase); |