aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudiu Manoil <claudiu.manoil@nxp.com>2016-11-16 09:40:24 -0500
committerScott Wood <oss@buserror.net>2016-11-23 02:23:46 -0500
commit7ff07da015c290cd2b0627c53267fbc1336cf055 (patch)
tree2c9fff1a6d50e7df73c72dffbdc7d97c13a9669c
parente5caf693ac6ac498ef05c7c1947024d5b678626f (diff)
soc/qman: Remove unused struct qm_mcc* layouts
1. qm_mcc_querywq layout not used for now, so drop it; 2. queryfq, queryfq_np and alterfq are used only for accesses to the 'fqid' field, so replace these with a generic 'fq' layout. As a consequence, 'querycgr' turns into 'cgr' following the same reasoning above and for consistent naming. Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com> Signed-off-by: Scott Wood <oss@buserror.net>
-rw-r--r--drivers/soc/fsl/qbman/qman.c58
-rw-r--r--drivers/soc/fsl/qbman/qman_priv.h6
2 files changed, 18 insertions, 46 deletions
diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c
index 4a1697eefcdf..0d2e3bcaaf9e 100644
--- a/drivers/soc/fsl/qbman/qman.c
+++ b/drivers/soc/fsl/qbman/qman.c
@@ -183,41 +183,22 @@ struct qm_mr {
183}; 183};
184 184
185/* MC (Management Command) command */ 185/* MC (Management Command) command */
186/* "Query FQ" */ 186/* "FQ" command layout */
187struct qm_mcc_queryfq { 187struct qm_mcc_fq {
188 u8 _ncw_verb; 188 u8 _ncw_verb;
189 u8 __reserved1[3]; 189 u8 __reserved1[3];
190 u32 fqid; /* 24-bit */ 190 u32 fqid; /* 24-bit */
191 u8 __reserved2[56]; 191 u8 __reserved2[56];
192} __packed; 192} __packed;
193/* "Alter FQ State Commands " */
194struct qm_mcc_alterfq {
195 u8 _ncw_verb;
196 u8 __reserved1[3];
197 u32 fqid; /* 24-bit */
198 u8 __reserved2;
199 u8 count; /* number of consecutive FQID */
200 u8 __reserved3[10];
201 u32 context_b; /* frame queue context b */
202 u8 __reserved4[40];
203} __packed;
204 193
205/* "Query CGR" */ 194/* "CGR" command layout */
206struct qm_mcc_querycgr { 195struct qm_mcc_cgr {
207 u8 _ncw_verb; 196 u8 _ncw_verb;
208 u8 __reserved1[30]; 197 u8 __reserved1[30];
209 u8 cgid; 198 u8 cgid;
210 u8 __reserved2[32]; 199 u8 __reserved2[32];
211}; 200};
212 201
213struct qm_mcc_querywq {
214 u8 _ncw_verb;
215 u8 __reserved;
216 /* select channel if verb != QUERYWQ_DEDICATED */
217 u16 channel_wq; /* ignores wq (3 lsbits): _res[0-2] */
218 u8 __reserved2[60];
219} __packed;
220
221#define QM_MCC_VERB_VBIT 0x80 202#define QM_MCC_VERB_VBIT 0x80
222#define QM_MCC_VERB_MASK 0x7f /* where the verb contains; */ 203#define QM_MCC_VERB_MASK 0x7f /* where the verb contains; */
223#define QM_MCC_VERB_INITFQ_PARKED 0x40 204#define QM_MCC_VERB_INITFQ_PARKED 0x40
@@ -243,12 +224,9 @@ union qm_mc_command {
243 u8 __reserved[63]; 224 u8 __reserved[63];
244 }; 225 };
245 struct qm_mcc_initfq initfq; 226 struct qm_mcc_initfq initfq;
246 struct qm_mcc_queryfq queryfq;
247 struct qm_mcc_alterfq alterfq;
248 struct qm_mcc_initcgr initcgr; 227 struct qm_mcc_initcgr initcgr;
249 struct qm_mcc_querycgr querycgr; 228 struct qm_mcc_fq fq;
250 struct qm_mcc_querywq querywq; 229 struct qm_mcc_cgr cgr;
251 struct qm_mcc_queryfq_np queryfq_np;
252}; 230};
253 231
254/* MC (Management Command) result */ 232/* MC (Management Command) result */
@@ -1777,7 +1755,7 @@ int qman_init_fq(struct qman_fq *fq, u32 flags, struct qm_mcc_initfq *opts)
1777 mcc = qm_mc_start(&p->p); 1755 mcc = qm_mc_start(&p->p);
1778 if (opts) 1756 if (opts)
1779 mcc->initfq = *opts; 1757 mcc->initfq = *opts;
1780 mcc->initfq.fqid = fq->fqid; 1758 mcc->fq.fqid = fq->fqid;
1781 mcc->initfq.count = 0; 1759 mcc->initfq.count = 0;
1782 /* 1760 /*
1783 * If the FQ does *not* have the TO_DCPORTAL flag, contextB is set as a 1761 * If the FQ does *not* have the TO_DCPORTAL flag, contextB is set as a
@@ -1873,7 +1851,7 @@ int qman_schedule_fq(struct qman_fq *fq)
1873 goto out; 1851 goto out;
1874 } 1852 }
1875 mcc = qm_mc_start(&p->p); 1853 mcc = qm_mc_start(&p->p);
1876 mcc->alterfq.fqid = fq->fqid; 1854 mcc->fq.fqid = fq->fqid;
1877 qm_mc_commit(&p->p, QM_MCC_VERB_ALTER_SCHED); 1855 qm_mc_commit(&p->p, QM_MCC_VERB_ALTER_SCHED);
1878 if (!qm_mc_result_timeout(&p->p, &mcr)) { 1856 if (!qm_mc_result_timeout(&p->p, &mcr)) {
1879 dev_err(p->config->dev, "ALTER_SCHED timeout\n"); 1857 dev_err(p->config->dev, "ALTER_SCHED timeout\n");
@@ -1916,7 +1894,7 @@ int qman_retire_fq(struct qman_fq *fq, u32 *flags)
1916 goto out; 1894 goto out;
1917 } 1895 }
1918 mcc = qm_mc_start(&p->p); 1896 mcc = qm_mc_start(&p->p);
1919 mcc->alterfq.fqid = fq->fqid; 1897 mcc->fq.fqid = fq->fqid;
1920 qm_mc_commit(&p->p, QM_MCC_VERB_ALTER_RETIRE); 1898 qm_mc_commit(&p->p, QM_MCC_VERB_ALTER_RETIRE);
1921 if (!qm_mc_result_timeout(&p->p, &mcr)) { 1899 if (!qm_mc_result_timeout(&p->p, &mcr)) {
1922 dev_crit(p->config->dev, "ALTER_RETIRE timeout\n"); 1900 dev_crit(p->config->dev, "ALTER_RETIRE timeout\n");
@@ -1995,7 +1973,7 @@ int qman_oos_fq(struct qman_fq *fq)
1995 goto out; 1973 goto out;
1996 } 1974 }
1997 mcc = qm_mc_start(&p->p); 1975 mcc = qm_mc_start(&p->p);
1998 mcc->alterfq.fqid = fq->fqid; 1976 mcc->fq.fqid = fq->fqid;
1999 qm_mc_commit(&p->p, QM_MCC_VERB_ALTER_OOS); 1977 qm_mc_commit(&p->p, QM_MCC_VERB_ALTER_OOS);
2000 if (!qm_mc_result_timeout(&p->p, &mcr)) { 1978 if (!qm_mc_result_timeout(&p->p, &mcr)) {
2001 ret = -ETIMEDOUT; 1979 ret = -ETIMEDOUT;
@@ -2021,7 +1999,7 @@ int qman_query_fq(struct qman_fq *fq, struct qm_fqd *fqd)
2021 int ret = 0; 1999 int ret = 0;
2022 2000
2023 mcc = qm_mc_start(&p->p); 2001 mcc = qm_mc_start(&p->p);
2024 mcc->queryfq.fqid = fq->fqid; 2002 mcc->fq.fqid = fq->fqid;
2025 qm_mc_commit(&p->p, QM_MCC_VERB_QUERYFQ); 2003 qm_mc_commit(&p->p, QM_MCC_VERB_QUERYFQ);
2026 if (!qm_mc_result_timeout(&p->p, &mcr)) { 2004 if (!qm_mc_result_timeout(&p->p, &mcr)) {
2027 ret = -ETIMEDOUT; 2005 ret = -ETIMEDOUT;
@@ -2047,7 +2025,7 @@ static int qman_query_fq_np(struct qman_fq *fq,
2047 int ret = 0; 2025 int ret = 0;
2048 2026
2049 mcc = qm_mc_start(&p->p); 2027 mcc = qm_mc_start(&p->p);
2050 mcc->queryfq.fqid = fq->fqid; 2028 mcc->fq.fqid = fq->fqid;
2051 qm_mc_commit(&p->p, QM_MCC_VERB_QUERYFQ_NP); 2029 qm_mc_commit(&p->p, QM_MCC_VERB_QUERYFQ_NP);
2052 if (!qm_mc_result_timeout(&p->p, &mcr)) { 2030 if (!qm_mc_result_timeout(&p->p, &mcr)) {
2053 ret = -ETIMEDOUT; 2031 ret = -ETIMEDOUT;
@@ -2075,7 +2053,7 @@ static int qman_query_cgr(struct qman_cgr *cgr,
2075 int ret = 0; 2053 int ret = 0;
2076 2054
2077 mcc = qm_mc_start(&p->p); 2055 mcc = qm_mc_start(&p->p);
2078 mcc->querycgr.cgid = cgr->cgrid; 2056 mcc->cgr.cgid = cgr->cgrid;
2079 qm_mc_commit(&p->p, QM_MCC_VERB_QUERYCGR); 2057 qm_mc_commit(&p->p, QM_MCC_VERB_QUERYCGR);
2080 if (!qm_mc_result_timeout(&p->p, &mcr)) { 2058 if (!qm_mc_result_timeout(&p->p, &mcr)) {
2081 ret = -ETIMEDOUT; 2059 ret = -ETIMEDOUT;
@@ -2526,7 +2504,7 @@ static int qman_shutdown_fq(u32 fqid)
2526 dev = p->config->dev; 2504 dev = p->config->dev;
2527 /* Determine the state of the FQID */ 2505 /* Determine the state of the FQID */
2528 mcc = qm_mc_start(&p->p); 2506 mcc = qm_mc_start(&p->p);
2529 mcc->queryfq_np.fqid = fqid; 2507 mcc->fq.fqid = fqid;
2530 qm_mc_commit(&p->p, QM_MCC_VERB_QUERYFQ_NP); 2508 qm_mc_commit(&p->p, QM_MCC_VERB_QUERYFQ_NP);
2531 if (!qm_mc_result_timeout(&p->p, &mcr)) { 2509 if (!qm_mc_result_timeout(&p->p, &mcr)) {
2532 dev_err(dev, "QUERYFQ_NP timeout\n"); 2510 dev_err(dev, "QUERYFQ_NP timeout\n");
@@ -2541,7 +2519,7 @@ static int qman_shutdown_fq(u32 fqid)
2541 2519
2542 /* Query which channel the FQ is using */ 2520 /* Query which channel the FQ is using */
2543 mcc = qm_mc_start(&p->p); 2521 mcc = qm_mc_start(&p->p);
2544 mcc->queryfq.fqid = fqid; 2522 mcc->fq.fqid = fqid;
2545 qm_mc_commit(&p->p, QM_MCC_VERB_QUERYFQ); 2523 qm_mc_commit(&p->p, QM_MCC_VERB_QUERYFQ);
2546 if (!qm_mc_result_timeout(&p->p, &mcr)) { 2524 if (!qm_mc_result_timeout(&p->p, &mcr)) {
2547 dev_err(dev, "QUERYFQ timeout\n"); 2525 dev_err(dev, "QUERYFQ timeout\n");
@@ -2561,7 +2539,7 @@ static int qman_shutdown_fq(u32 fqid)
2561 case QM_MCR_NP_STATE_PARKED: 2539 case QM_MCR_NP_STATE_PARKED:
2562 orl_empty = 0; 2540 orl_empty = 0;
2563 mcc = qm_mc_start(&p->p); 2541 mcc = qm_mc_start(&p->p);
2564 mcc->alterfq.fqid = fqid; 2542 mcc->fq.fqid = fqid;
2565 qm_mc_commit(&p->p, QM_MCC_VERB_ALTER_RETIRE); 2543 qm_mc_commit(&p->p, QM_MCC_VERB_ALTER_RETIRE);
2566 if (!qm_mc_result_timeout(&p->p, &mcr)) { 2544 if (!qm_mc_result_timeout(&p->p, &mcr)) {
2567 dev_err(dev, "QUERYFQ_NP timeout\n"); 2545 dev_err(dev, "QUERYFQ_NP timeout\n");
@@ -2656,7 +2634,7 @@ static int qman_shutdown_fq(u32 fqid)
2656 cpu_relax(); 2634 cpu_relax();
2657 } 2635 }
2658 mcc = qm_mc_start(&p->p); 2636 mcc = qm_mc_start(&p->p);
2659 mcc->alterfq.fqid = fqid; 2637 mcc->fq.fqid = fqid;
2660 qm_mc_commit(&p->p, QM_MCC_VERB_ALTER_OOS); 2638 qm_mc_commit(&p->p, QM_MCC_VERB_ALTER_OOS);
2661 if (!qm_mc_result_timeout(&p->p, &mcr)) { 2639 if (!qm_mc_result_timeout(&p->p, &mcr)) {
2662 ret = -ETIMEDOUT; 2640 ret = -ETIMEDOUT;
@@ -2676,7 +2654,7 @@ static int qman_shutdown_fq(u32 fqid)
2676 case QM_MCR_NP_STATE_RETIRED: 2654 case QM_MCR_NP_STATE_RETIRED:
2677 /* Send OOS Command */ 2655 /* Send OOS Command */
2678 mcc = qm_mc_start(&p->p); 2656 mcc = qm_mc_start(&p->p);
2679 mcc->alterfq.fqid = fqid; 2657 mcc->fq.fqid = fqid;
2680 qm_mc_commit(&p->p, QM_MCC_VERB_ALTER_OOS); 2658 qm_mc_commit(&p->p, QM_MCC_VERB_ALTER_OOS);
2681 if (!qm_mc_result_timeout(&p->p, &mcr)) { 2659 if (!qm_mc_result_timeout(&p->p, &mcr)) {
2682 ret = -ETIMEDOUT; 2660 ret = -ETIMEDOUT;
diff --git a/drivers/soc/fsl/qbman/qman_priv.h b/drivers/soc/fsl/qbman/qman_priv.h
index 59b4b463d884..5606d74c21d4 100644
--- a/drivers/soc/fsl/qbman/qman_priv.h
+++ b/drivers/soc/fsl/qbman/qman_priv.h
@@ -90,12 +90,6 @@ static inline u64 qm_mcr_querycgr_a_get64(const struct qm_mcr_querycgr *q)
90} 90}
91 91
92/* "Query FQ Non-Programmable Fields" */ 92/* "Query FQ Non-Programmable Fields" */
93struct qm_mcc_queryfq_np {
94 u8 _ncw_verb;
95 u8 __reserved1[3];
96 u32 fqid; /* 24-bit */
97 u8 __reserved2[56];
98} __packed;
99 93
100struct qm_mcr_queryfq_np { 94struct qm_mcr_queryfq_np {
101 u8 verb; 95 u8 verb;