summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-01-09 11:45:31 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-01-23 14:55:12 +0100
commit34b7ccccdef3e4c8a087e6b8014ec97caf40674e (patch)
tree35050fc924b66a1c7e6e4b5aab11893517ae2cbe
parentbdf9931603967ee174f342c363d61c3d7704529b (diff)
downloadrtems-libbsd-34b7ccccdef3e4c8a087e6b8014ec97caf40674e.tar.bz2
dpaa: Support FQ_TYPE_RX_PCD
Update #3277.
-rw-r--r--linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c22
-rw-r--r--linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h3
2 files changed, 25 insertions, 0 deletions
diff --git a/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index 6e12c42e..ad06f412 100644
--- a/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -693,6 +693,11 @@ static inline void dpaa_assign_wq(struct dpaa_fq *fq, int idx)
DPAA_ETH_TXQ_NUM);
}
break;
+#ifdef __rtems__
+ case FQ_TYPE_RX_PCD:
+ fq->wq = 5;
+ break;
+#endif /* __rtems__ */
default:
WARN(1, "Invalid FQ type %d for FQID %d!\n",
fq->fq_type, fq->fqid);
@@ -924,6 +929,8 @@ static void dpaa_fq_setup(struct dpaa_priv *priv,
u16 portals[NR_CPUS];
#else /* __rtems__ */
int egress_cnt = 0, conf_cnt = 0;
+ struct qman_portal *p;
+ int cpu;
#endif /* __rtems__ */
struct dpaa_fq *fq;
@@ -933,6 +940,8 @@ static void dpaa_fq_setup(struct dpaa_priv *priv,
if (num_portals == 0)
dev_err(priv->net_dev->dev.parent,
"No Qman software (affine) channels found");
+#else /* __rtems__ */
+ cpu = 0;
#endif /* __rtems__ */
/* Initialize each FQ in the list */
@@ -944,6 +953,16 @@ static void dpaa_fq_setup(struct dpaa_priv *priv,
case FQ_TYPE_RX_ERROR:
dpaa_setup_ingress(priv, fq, &fq_cbs->rx_errq);
break;
+#ifdef __rtems__
+ case FQ_TYPE_RX_PCD:
+ /* For MACless we can't have dynamic Rx queues */
+ BUG_ON(priv->mac_dev != NULL || fq->fqid == 0);
+ dpaa_setup_ingress(priv, fq, &fq_cbs->rx_defq);
+ p = qman_get_affine_portal(cpu);
+ fq->channel = qman_portal_get_channel(p);
+ cpu = (cpu + 1) % (int)rtems_get_processor_count();
+ break;
+#endif /* __rtems__ */
case FQ_TYPE_TX:
dpaa_setup_egress(priv, fq, tx_port,
&fq_cbs->egress_ern);
@@ -1109,6 +1128,9 @@ static int dpaa_fq_init(struct dpaa_fq *dpaa_fq, bool td_enable)
/* Put all the ingress queues in our "ingress CGR". */
if (priv->use_ingress_cgr &&
(dpaa_fq->fq_type == FQ_TYPE_RX_DEFAULT ||
+#ifdef __rtems__
+ dpaa_fq->fq_type == FQ_TYPE_RX_PCD ||
+#endif /* __rtems__ */
dpaa_fq->fq_type == FQ_TYPE_RX_ERROR)) {
initfq.we_mask |= cpu_to_be16(QM_INITFQ_WE_CGID);
initfq.fqd.fq_ctrl |= cpu_to_be16(QM_FQCTRL_CGE);
diff --git a/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h b/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h
index 734d7684..d5f6974b 100644
--- a/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h
+++ b/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h
@@ -56,6 +56,9 @@
enum dpaa_fq_type {
FQ_TYPE_RX_DEFAULT = 1, /* Rx Default FQs */
FQ_TYPE_RX_ERROR, /* Rx Error FQs */
+#ifdef __rtems__
+ FQ_TYPE_RX_PCD, /* User-defined PCDs */
+#endif /* __rtems__ */
FQ_TYPE_TX, /* "Real" Tx FQs */
FQ_TYPE_TX_CONFIRM, /* Tx default Conf FQ (actually an Rx FQ) */
FQ_TYPE_TX_CONF_MQ, /* Tx conf FQs (one for each Tx FQ) */