Changeset de5791b in rtems-libbsd for linux


Ignore:
Timestamp:
Jul 13, 2017, 6:31:46 AM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5283630d2c9d40deb0183696d278e02644fe4326, bc2ba9a9cdc7381c2a4f2ae6ee303be636f31368
Children:
24866e6
Parents:
e818128
git-author:
Sebastian Huber <sebastian.huber@…> (07/13/17 06:31:46)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/23/17 07:24:07)
Message:

dpaa: Add "libbsd,dedicated-portal" to QMan portals

By default, the network interfaces use a pool channel, see
dpaa_get_channel() in dpaa_eth_priv_probe(). To enable a dedicated QMan
software portal, use libbsd,dedicated-portal = "enabled";. This option
is useful for special purpose 10Gbit/s Ethernet processing.

/ {

soc: soc@ffe000000 {

fman0: fman@400000 {

enet7: ethernet@f2000 {

libbsd,dedicated-portal = "enabled";

};

};

};

};

Location:
linux
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c

    re818128 rde5791b  
    30793079        priv->mac_dev = mac_dev;
    30803080
     3081#ifdef __rtems__
     3082        if (mac_dev->use_dedicated_portal) {
     3083                struct qman_portal *portal;
     3084
     3085                portal = qman_get_dedicated_portal(0);
     3086                BSD_ASSERT(portal != NULL);
     3087                mac_dev->portal = portal;
     3088                channel = qman_portal_get_channel(portal);
     3089                priv->channel = (u16)channel;
     3090        } else {
     3091#endif /* __rtems__ */
    30813092        channel = dpaa_get_channel();
    30823093        if (channel < 0) {
     
    30923103         */
    30933104        dpaa_eth_add_channel(priv->channel);
     3105#ifdef __rtems__
     3106        }
     3107#endif /* __rtems__ */
    30943108
    30953109        dpaa_fq_setup(priv, &dpaa_fq_cbs, priv->mac_dev->port[TX]);
  • linux/drivers/net/ethernet/freescale/fman/mac.c

    re818128 rde5791b  
    749749static int mac_probe(struct platform_device *_of_dev)
    750750#else /* __rtems__ */
     751static bool
     752use_dedicated_portal(const struct device_node *mac_node)
     753{
     754        const char *dp;
     755        int len;
     756
     757        dp = of_get_property(mac_node, "libbsd,dedicated-portal", &len);
     758        return (len > 0 && strcmp(dp, "enabled") == 0);
     759}
     760
    751761static int mac_probe(device_t _dev, struct platform_device *_of_dev, struct fman *fman)
    752762#endif /* __rtems__ */
     
    10971107                 mac_dev->addr[3], mac_dev->addr[4], mac_dev->addr[5]);
    10981108
     1109#ifdef __rtems__
     1110        mac_dev->use_dedicated_portal = use_dedicated_portal(mac_node);
     1111#endif /* __rtems__ */
    10991112        priv->eth_dev = dpaa_eth_add_device(fman_id, mac_dev, mac_node);
    11001113        if (IS_ERR(priv->eth_dev)) {
  • linux/drivers/net/ethernet/freescale/fman/mac.h

    re818128 rde5791b  
    8686                                       struct mac_device *mac_dev);
    8787#else /* __rtems__ */
     88        bool use_dedicated_portal;
     89        struct qman_portal *portal;
    8890        void (*adjust_link)(struct mac_device *mac_dev, u16 speed);
    8991#endif /* __rtems__ */
  • linux/drivers/soc/fsl/qbman/qman.c

    re818128 rde5791b  
    12821282        return -EIO;
    12831283}
     1284#ifdef __rtems__
     1285int
     1286qman_portal_get_channel(const struct qman_portal *portal)
     1287{
     1288
     1289        if (portal == NULL) {
     1290                return (-1);
     1291        }
     1292
     1293        return (portal->config->channel);
     1294}
     1295
     1296int
     1297qman_portal_get_irq(const struct qman_portal *portal)
     1298{
     1299
     1300        if (portal == NULL) {
     1301                return (-1);
     1302        }
     1303
     1304        return (portal->config->irq);
     1305}
     1306
     1307struct qman_portal *
     1308qman_create_dedicated_portal(const struct qm_portal_config *c,
     1309    const struct qman_cgrs *cgrs)
     1310{
     1311        struct qman_portal *portal;
     1312        int err;
     1313
     1314        portal = kmalloc(sizeof(*portal), GFP_KERNEL);
     1315        if (portal == NULL)
     1316                return (NULL);
     1317
     1318        err = qman_create_portal(portal, c, cgrs);
     1319        if (err != 0) {
     1320                kfree(portal);
     1321                return (NULL);
     1322        }
     1323
     1324        return (portal);
     1325}
     1326#endif /* __rtems__ */
    12841327
    12851328struct qman_portal *qman_create_affine_portal(const struct qm_portal_config *c,
  • linux/drivers/soc/fsl/qbman/qman_portal.c

    re818128 rde5791b  
    386386static struct qm_portal_config qman_configs[MAX_QMAN_PORTALS];
    387387
     388static LIST_HEAD(qman_free_portals);
     389
     390struct qman_portal *
     391qman_get_dedicated_portal(int cpu)
     392{
     393        struct qm_portal_config *pcfg;
     394        struct qman_portal *p;
     395        u32 irq_sources;
     396
     397        if (list_empty(&qman_free_portals))
     398                return (NULL);
     399
     400        pcfg = list_first_entry(&qman_free_portals, struct qm_portal_config,
     401           node);
     402        pcfg->cpu = cpu;
     403        p = qman_create_dedicated_portal(pcfg, NULL);
     404        if (p == NULL)
     405                return (NULL);
     406
     407        list_del(&pcfg->node);
     408
     409        irq_sources = QM_PIRQ_EQCI | QM_PIRQ_EQRI | QM_PIRQ_MRI | QM_PIRQ_CSCI
     410            | QM_PIRQ_DQRI;
     411        qman_p_irqsource_add(p, irq_sources);
     412        return (p);
     413}
     414
    388415static bool
    389416is_dequeue_enabled(const struct device_node *dn)
     
    476503                } else {
    477504                        pcfg->cpu = -1;
     505                        list_add_tail(&pcfg->node, &qman_free_portals);
    478506                }
    479507
  • linux/drivers/soc/fsl/qbman/qman_priv.h

    re818128 rde5791b  
    166166        /* Allow these to be joined in lists */
    167167        struct list_head list;
     168#else /* __rtems__ */
     169        struct list_head node;
    168170#endif /* __rtems__ */
    169171        /* User-visible portal configuration settings */
     
    202204void qman_set_sdest(u16 channel, unsigned int cpu_idx);
    203205
     206#ifdef __rtems__
     207struct qman_portal *qman_create_dedicated_portal(
     208    const struct qm_portal_config *c, const struct qman_cgrs *cgrs);
     209#endif /* __rtems__ */
    204210struct qman_portal *qman_create_affine_portal(
    205211                        const struct qm_portal_config *config,
  • linux/include/soc/fsl/qman.h

    re818128 rde5791b  
    919919 */
    920920struct qman_portal *qman_get_affine_portal(int cpu);
     921#ifdef __rtems__
     922struct qman_portal *qman_get_dedicated_portal(int cpu);
     923
     924int qman_portal_get_channel(const struct qman_portal *portal);
     925
     926int qman_portal_get_irq(const struct qman_portal *portal);
     927#endif /* __rtems__ */
    921928
    922929/**
Note: See TracChangeset for help on using the changeset viewer.