New upstream version 18.11-rc1
[deb_dpdk.git] / drivers / bus / dpaa / dpaa_bus.c
index 16fabd1..203f60d 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <rte_dpaa_bus.h>
 #include <rte_dpaa_logs.h>
+#include <dpaax_iova_table.h>
 
 #include <fsl_usd.h>
 #include <fsl_qman.h>
@@ -46,7 +47,7 @@ int dpaa_logtype_mempool;
 int dpaa_logtype_pmd;
 int dpaa_logtype_eventdev;
 
-struct rte_dpaa_bus rte_dpaa_bus;
+static struct rte_dpaa_bus rte_dpaa_bus;
 struct netcfg_info *dpaa_netcfg;
 
 /* define a variable to hold the portal_key, once created.*/
@@ -165,6 +166,8 @@ dpaa_create_device_list(void)
                        goto cleanup;
                }
 
+               dev->device.bus = &rte_dpaa_bus.bus;
+
                cfg = &dpaa_netcfg->port_cfg[i];
                fman_intf = cfg->fman_if;
 
@@ -546,6 +549,9 @@ rte_dpaa_bus_probe(void)
                fclose(svr_file);
        }
 
+       /* And initialize the PA->VA translation table */
+       dpaax_iova_table_populate();
+
        /* For each registered driver, and device, call the driver->probe */
        TAILQ_FOREACH(dev, &rte_dpaa_bus.device_list, next) {
                TAILQ_FOREACH(drv, &rte_dpaa_bus.driver_list, next) {
@@ -553,6 +559,9 @@ rte_dpaa_bus_probe(void)
                        if (ret)
                                continue;
 
+                       if (rte_dev_is_probed(&dev->device))
+                               continue;
+
                        if (!drv->probe ||
                            (dev->device.devargs &&
                            dev->device.devargs->policy == RTE_DEV_BLACKLISTED))
@@ -563,8 +572,12 @@ rte_dpaa_bus_probe(void)
                            dev->device.devargs->policy ==
                            RTE_DEV_WHITELISTED)) {
                                ret = drv->probe(drv, dev);
-                               if (ret)
+                               if (ret) {
                                        DPAA_BUS_ERR("Unable to probe.\n");
+                               } else {
+                                       dev->driver = drv;
+                                       dev->device.driver = &drv->driver;
+                               }
                        }
                        break;
                }
@@ -611,7 +624,7 @@ rte_dpaa_get_iommu_class(void)
        return RTE_IOVA_PA;
 }
 
-struct rte_dpaa_bus rte_dpaa_bus = {
+static struct rte_dpaa_bus rte_dpaa_bus = {
        .bus = {
                .scan = rte_dpaa_bus_scan,
                .probe = rte_dpaa_bus_probe,