bus/fslmc: remove workaround for smmu mapping
[dpdk.git] / drivers / bus / fslmc / fslmc_vfio.c
index c431662..45e5927 100644 (file)
@@ -2,7 +2,7 @@
  *   BSD LICENSE
  *
  *   Copyright (c) 2015-2016 Freescale Semiconductor, Inc. All rights reserved.
- *   Copyright (c) 2016 NXP. All rights reserved.
+ *   Copyright 2016 NXP.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -40,7 +40,6 @@
 #include <errno.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
-#include <sys/types.h>
 #include <sys/mman.h>
 #include <sys/vfs.h>
 #include <libgen.h>
@@ -55,7 +54,6 @@
 #include <rte_cycles.h>
 #include <rte_kvargs.h>
 #include <rte_dev.h>
-#include <rte_ethdev.h>
 #include <rte_bus.h>
 
 #include "rte_fslmc.h"
@@ -188,29 +186,6 @@ static int vfio_map_irq_region(struct fslmc_vfio_group *group)
        return -errno;
 }
 
-int vfio_dmamap_mem_region(uint64_t vaddr,
-                          uint64_t iova,
-                          uint64_t size)
-{
-       struct fslmc_vfio_group *group;
-       struct vfio_iommu_type1_dma_map dma_map = {
-               .argsz = sizeof(dma_map),
-               .flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE,
-       };
-
-       dma_map.vaddr = vaddr;
-       dma_map.size = size;
-       dma_map.iova = iova;
-
-       /* SET DMA MAP for IOMMU */
-       group = &vfio_groups[0];
-       if (ioctl(group->container->fd, VFIO_IOMMU_MAP_DMA, &dma_map)) {
-               FSLMC_VFIO_LOG(ERR, "VFIO_IOMMU_MAP_DMA (errno = %d)", errno);
-               return -1;
-       }
-       return 0;
-}
-
 int rte_fslmc_vfio_dmamap(void)
 {
        int ret;
@@ -551,10 +526,11 @@ int fslmc_vfio_process_group(void)
                        dev->dev_type = (strcmp(object_type, "dpseci")) ?
                                DPAA2_MC_DPNI_DEVID : DPAA2_MC_DPSECI_DEVID;
 
-                       FSLMC_VFIO_LOG(DEBUG, "DPAA2: Added [%s-%d]",
-                                     object_type, object_id);
+                       sprintf(dev->name, "%s.%d", object_type, object_id);
+                       dev->device.name = dev->name;
 
                        fslmc_bus_add_device(dev);
+                       FSLMC_VFIO_LOG(DEBUG, "DPAA2: Added %s", dev->name);
                } else {
                        /* Parse all other objects */
                        struct rte_dpaa2_object *object;