summaryrefslogtreecommitdiffstats
path: root/linux/drivers/net/ethernet
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/net/ethernet')
-rw-r--r--linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c14
-rw-r--r--linux/drivers/net/ethernet/freescale/fman/mac.c13
-rw-r--r--linux/drivers/net/ethernet/freescale/fman/mac.h2
3 files changed, 29 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 c2e9b378..3861420e 100644
--- a/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -3078,6 +3078,17 @@ dpaa_eth_priv_probe(struct platform_device *pdev, struct mac_device *mac_dev)
priv->mac_dev = mac_dev;
+#ifdef __rtems__
+ if (mac_dev->use_dedicated_portal) {
+ struct qman_portal *portal;
+
+ portal = qman_get_dedicated_portal(0);
+ BSD_ASSERT(portal != NULL);
+ mac_dev->portal = portal;
+ channel = qman_portal_get_channel(portal);
+ priv->channel = (u16)channel;
+ } else {
+#endif /* __rtems__ */
channel = dpaa_get_channel();
if (channel < 0) {
dev_err(dev, "dpaa_get_channel() failed\n");
@@ -3091,6 +3102,9 @@ dpaa_eth_priv_probe(struct platform_device *pdev, struct mac_device *mac_dev)
* and add this pool channel to each's dequeue mask.
*/
dpaa_eth_add_channel(priv->channel);
+#ifdef __rtems__
+ }
+#endif /* __rtems__ */
dpaa_fq_setup(priv, &dpaa_fq_cbs, priv->mac_dev->port[TX]);
diff --git a/linux/drivers/net/ethernet/freescale/fman/mac.c b/linux/drivers/net/ethernet/freescale/fman/mac.c
index b058b4ad..e34158e5 100644
--- a/linux/drivers/net/ethernet/freescale/fman/mac.c
+++ b/linux/drivers/net/ethernet/freescale/fman/mac.c
@@ -748,6 +748,16 @@ MODULE_DEVICE_TABLE(of, mac_match);
#ifndef __rtems__
static int mac_probe(struct platform_device *_of_dev)
#else /* __rtems__ */
+static bool
+use_dedicated_portal(const struct device_node *mac_node)
+{
+ const char *dp;
+ int len;
+
+ dp = of_get_property(mac_node, "libbsd,dedicated-portal", &len);
+ return (len > 0 && strcmp(dp, "enabled") == 0);
+}
+
static int mac_probe(device_t _dev, struct platform_device *_of_dev, struct fman *fman)
#endif /* __rtems__ */
{
@@ -1096,6 +1106,9 @@ static int mac_probe(device_t _dev, struct platform_device *_of_dev, struct fman
mac_dev->addr[0], mac_dev->addr[1], mac_dev->addr[2],
mac_dev->addr[3], mac_dev->addr[4], mac_dev->addr[5]);
+#ifdef __rtems__
+ mac_dev->use_dedicated_portal = use_dedicated_portal(mac_node);
+#endif /* __rtems__ */
priv->eth_dev = dpaa_eth_add_device(fman_id, mac_dev, mac_node);
if (IS_ERR(priv->eth_dev)) {
dev_err(dev, "failed to add Ethernet platform device for MAC %d\n",
diff --git a/linux/drivers/net/ethernet/freescale/fman/mac.h b/linux/drivers/net/ethernet/freescale/fman/mac.h
index 066072ab..ba1fcbca 100644
--- a/linux/drivers/net/ethernet/freescale/fman/mac.h
+++ b/linux/drivers/net/ethernet/freescale/fman/mac.h
@@ -85,6 +85,8 @@ struct mac_device {
struct phy_device *(*init_phy)(struct net_device *net_dev,
struct mac_device *mac_dev);
#else /* __rtems__ */
+ bool use_dedicated_portal;
+ struct qman_portal *portal;
void (*adjust_link)(struct mac_device *mac_dev, u16 speed);
#endif /* __rtems__ */
int (*init)(struct mac_device *mac_dev);