diff options
-rw-r--r-- | drivers/soc/fsl/qbman/qman.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c index 1897144b9281..b10a5880a468 100644 --- a/drivers/soc/fsl/qbman/qman.c +++ b/drivers/soc/fsl/qbman/qman.c | |||
@@ -850,12 +850,24 @@ static inline void qm_mr_set_ithresh(struct qm_portal *portal, u8 ithresh) | |||
850 | 850 | ||
851 | static inline int qm_mc_init(struct qm_portal *portal) | 851 | static inline int qm_mc_init(struct qm_portal *portal) |
852 | { | 852 | { |
853 | u8 rr0, rr1; | ||
853 | struct qm_mc *mc = &portal->mc; | 854 | struct qm_mc *mc = &portal->mc; |
854 | 855 | ||
855 | mc->cr = portal->addr.ce + QM_CL_CR; | 856 | mc->cr = portal->addr.ce + QM_CL_CR; |
856 | mc->rr = portal->addr.ce + QM_CL_RR0; | 857 | mc->rr = portal->addr.ce + QM_CL_RR0; |
857 | mc->rridx = (mc->cr->_ncw_verb & QM_MCC_VERB_VBIT) | 858 | /* |
858 | ? 0 : 1; | 859 | * The expected valid bit polarity for the next CR command is 0 |
860 | * if RR1 contains a valid response, and is 1 if RR0 contains a | ||
861 | * valid response. If both RR contain all 0, this indicates either | ||
862 | * that no command has been executed since reset (in which case the | ||
863 | * expected valid bit polarity is 1) | ||
864 | */ | ||
865 | rr0 = mc->rr->verb; | ||
866 | rr1 = (mc->rr+1)->verb; | ||
867 | if ((rr0 == 0 && rr1 == 0) || rr0 != 0) | ||
868 | mc->rridx = 1; | ||
869 | else | ||
870 | mc->rridx = 0; | ||
859 | mc->vbit = mc->rridx ? QM_MCC_VERB_VBIT : 0; | 871 | mc->vbit = mc->rridx ? QM_MCC_VERB_VBIT : 0; |
860 | #ifdef CONFIG_FSL_DPAA_CHECKING | 872 | #ifdef CONFIG_FSL_DPAA_CHECKING |
861 | mc->state = qman_mc_idle; | 873 | mc->state = qman_mc_idle; |