Changeset e818128 in rtems-libbsd


Ignore:
Timestamp:
Jun 23, 2017, 9:39:26 AM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
eeb3fd5d9b07ac9a2e280cff60a1b762bd273a8d, 1e989998de954bef51e6c19cc3d64d39f32100aa
Children:
de5791b
Parents:
3cfc31c
git-author:
Sebastian Huber <sebastian.huber@…> (06/23/17 09:39:26)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/23/17 07:24:07)
Message:

dpaa: Add "libbsd,dequeue" to QMan portals

The dequeue support for processor affine QMan portals may be explicitly
disabled. The dequeue support is responsible for receiving frames and
completion of frame transmission, e.g. buffer recycling. Without at
least one enabled dequeue support, there will be no networking.

/ {

qman-portals@ff6000000 {

qman-portal@0 {

libbsd,dequeue = "disabled";

};

};

};

File:
1 edited

Legend:

Unmodified
Added
Removed
  • linux/drivers/soc/fsl/qbman/qman_portal.c

    r3cfc31c re818128  
    382382#include <linux/of_irq.h>
    383383
    384 static struct qm_portal_config qman_configs[NR_CPUS];
     384#define MAX_QMAN_PORTALS 50
     385
     386static struct qm_portal_config qman_configs[MAX_QMAN_PORTALS];
     387
     388static bool
     389is_dequeue_enabled(const struct device_node *dn)
     390{
     391        const char *dequeue;
     392        int len;
     393
     394        dequeue = of_get_property(dn, "libbsd,dequeue", &len);
     395        return (len <= 0 || strcmp(dequeue, "disabled") != 0);
     396}
    385397
    386398void
     
    391403        const char *name;
    392404        int cpu_count = (int)rtems_get_processor_count();
    393         int cpu;
     405        int i;
    394406        int ret;
    395407        int node;
     
    415427            sizeof(qoriq_qman_portal[1]));
    416428
    417         for (cpu = 0; cpu < cpu_count; ++cpu) {
    418                 struct qm_portal_config *pcfg = &qman_configs[cpu];
     429        for (i = 0; node >= 0 && i < MAX_QMAN_PORTALS; ++i) {
     430                struct qm_portal_config *pcfg = &qman_configs[i];
    419431                struct qman_portal *portal;
    420432                struct resource res;
    421433                u32 val;
    422 
    423                 if (node < 0)
    424                         panic("qman: missing portal in FDT");
    425434
    426435                ret = of_address_to_resource(&dn, 0, &res);
     
    453462                        panic("qman: no portal interrupt");
    454463
    455                 pcfg->cpu = cpu;
    456                 pcfg->pools = qm_get_pools_sdqcr();
    457 
    458                 portal = init_pcfg(pcfg);
    459                 if (portal == NULL)
    460                         panic("qman: cannot create portal");
    461 
    462                 qman_portal_update_sdest(pcfg, cpu);
     464                if (val < cpu_count) {
     465                        pcfg->cpu = val;
     466
     467                        if (is_dequeue_enabled(&dn)) {
     468                                pcfg->pools = qm_get_pools_sdqcr();
     469                        }
     470
     471                        portal = init_pcfg(pcfg);
     472                        if (portal == NULL)
     473                                panic("qman: cannot create portal");
     474
     475                        qman_portal_update_sdest(pcfg, val);
     476                } else {
     477                        pcfg->cpu = -1;
     478                }
    463479
    464480                node = fdt_next_subnode(fdt, node);
     
    466482        }
    467483
     484        if (i < cpu_count)
     485                panic("qman: not enough portals in FDT");
     486
    468487        /* all assigned portals are initialized now */
    469488        qman_init_cgr_all();
Note: See TracChangeset for help on using the changeset viewer.