diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2009-09-17 13:28:13 -0700 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2009-09-17 14:22:15 -0700 |
commit | 6c3e7f5dcb9c7319a5541993c0516594dfffb916 (patch) | |
tree | 6c88f3f2bbaa63df4239d3698f2d1a366262c5a8 | |
parent | ee079dc33311654335201357a52b6741e86be9b6 (diff) | |
download | ti-6c3e7f5dcb9c7319a5541993c0516594dfffb916.tar.gz |
Fix problem in waking up path
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r-- | wilink_6_1/Txn/SdioBusDrv.c | 13 | ||||
-rw-r--r-- | wilink_6_1/platforms/hw/linux/SdioAdapter.c | 4 |
2 files changed, 16 insertions, 1 deletions
diff --git a/wilink_6_1/Txn/SdioBusDrv.c b/wilink_6_1/Txn/SdioBusDrv.c index 9264e7e..87da8f5 100644 --- a/wilink_6_1/Txn/SdioBusDrv.c +++ b/wilink_6_1/Txn/SdioBusDrv.c @@ -470,6 +470,19 @@ static void busDrv_SendTxnParts (TBusDrvObj *pBusDrv) pTxnPart->uLength, TXN_PARAM_GET_DIRECTION(pTxn), pTxnPart->bMore); + + /* If first write failed try once again (may happen once upon chip wakeup) */ + if (eStatus == TXN_STATUS_ERROR) + { + /* Overwrite the function id with function 0 - for ELP register !!!! */ + eStatus = sdioAdapt_TransactBytes (TXN_FUNC_ID_CTRL, + pTxnPart->uHwAddr, + pTxnPart->pHostAddr, + pTxnPart->uLength, + TXN_PARAM_GET_DIRECTION(pTxn), + pTxnPart->bMore); + TRACE0(pBusDrv->hReport, REPORT_SEVERITY_WARNING, "busDrv_SendTxnParts: SDIO Single-Step transaction failed once so try again"); + } } else { diff --git a/wilink_6_1/platforms/hw/linux/SdioAdapter.c b/wilink_6_1/platforms/hw/linux/SdioAdapter.c index ad70654..3acd447 100644 --- a/wilink_6_1/platforms/hw/linux/SdioAdapter.c +++ b/wilink_6_1/platforms/hw/linux/SdioAdapter.c @@ -501,9 +501,10 @@ ETxnStatus sdioAdapt_TransactBytes (unsigned int uFuncId, unsigned int bDirection, unsigned int bMore) { + static unsigned int lastMore = 0; int iStatus; - if (bMore == 1) + if ((bMore == 1) || (lastMore == bMore)) { sdioDrv_clk_enable(); } @@ -522,6 +523,7 @@ ETxnStatus sdioAdapt_TransactBytes (unsigned int uFuncId, { sdioDrv_clk_disable(); } + lastMore = bMore; /* If failed return ERROR, if succeeded return COMPLETE */ if (iStatus) |