summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHemant Agrawal <hemant.agrawal@nxp.com>2019-10-10 12:02:21 +0530
committerFerruh Yigit <ferruh.yigit@intel.com>2019-10-23 16:43:08 +0200
commit8c83f28cc8a4dc7ee0fab676051dd483695d4140 (patch)
tree102263db3d08275cd1b7b894f0cb989ec7afc2f2
parentd070c3413164e3f8f7fa4c4325d7df50a8275f39 (diff)
downloaddpdk-8c83f28cc8a4dc7ee0fab676051dd483695d4140.zip
dpdk-8c83f28cc8a4dc7ee0fab676051dd483695d4140.tar.gz
dpdk-8c83f28cc8a4dc7ee0fab676051dd483695d4140.tar.xz
common/dpaax: move OF library from DPAA bus
This code is being shared by more than 1 type of driver. Common is most appropriate place for it. Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
-rw-r--r--drivers/bus/dpaa/Makefile2
-rw-r--r--drivers/bus/dpaa/base/fman/fman.c2
-rw-r--r--drivers/bus/dpaa/base/fman/netcfg_layer.c2
-rw-r--r--drivers/bus/dpaa/base/qbman/dpaa_sys.h3
-rw-r--r--drivers/bus/dpaa/base/qbman/qman.c2
-rw-r--r--drivers/bus/dpaa/dpaa_bus.c2
-rw-r--r--drivers/bus/dpaa/include/fman.h1
-rw-r--r--drivers/bus/dpaa/include/fsl_usd.h1
-rw-r--r--drivers/bus/dpaa/meson.build1
-rw-r--r--drivers/bus/dpaa/rte_bus_dpaa_version.map3
-rw-r--r--drivers/bus/dpaa/rte_dpaa_bus.h2
-rw-r--r--drivers/bus/fslmc/Makefile1
-rw-r--r--drivers/common/dpaax/Makefile10
-rw-r--r--drivers/common/dpaax/compat.h (renamed from drivers/bus/dpaa/include/compat.h)3
-rw-r--r--drivers/common/dpaax/dpaa_list.h (renamed from drivers/bus/dpaa/include/dpaa_list.h)0
-rw-r--r--drivers/common/dpaax/dpaa_of.c (renamed from drivers/bus/dpaa/base/fman/of.c)63
-rw-r--r--drivers/common/dpaax/dpaa_of.h (renamed from drivers/bus/dpaa/include/of.h)25
-rw-r--r--drivers/common/dpaax/dpaax_logs.h10
-rw-r--r--drivers/common/dpaax/meson.build8
-rw-r--r--drivers/common/dpaax/rte_common_dpaax_version.map18
-rw-r--r--drivers/crypto/caam_jr/Makefile1
-rw-r--r--drivers/crypto/caam_jr/caam_jr.c4
-rw-r--r--drivers/crypto/caam_jr/meson.build1
-rw-r--r--drivers/crypto/dpaa2_sec/Makefile1
-rw-r--r--drivers/crypto/dpaa_sec/Makefile1
-rw-r--r--drivers/crypto/dpaa_sec/dpaa_sec.c2
-rw-r--r--drivers/crypto/dpaa_sec/meson.build1
-rw-r--r--drivers/event/dpaa/Makefile1
-rw-r--r--drivers/event/dpaa2/Makefile1
-rw-r--r--drivers/mempool/dpaa/Makefile1
-rw-r--r--drivers/mempool/dpaa2/Makefile1
-rw-r--r--drivers/net/dpaa/Makefile1
-rw-r--r--drivers/net/dpaa/dpaa_ethdev.h2
-rw-r--r--drivers/net/dpaa/dpaa_rxtx.c2
-rw-r--r--drivers/net/dpaa2/Makefile1
-rw-r--r--drivers/raw/dpaa2_cmdif/Makefile1
-rw-r--r--drivers/raw/dpaa2_qdma/Makefile1
37 files changed, 123 insertions, 59 deletions
diff --git a/drivers/bus/dpaa/Makefile b/drivers/bus/dpaa/Makefile
index dfc2717..454ac12 100644
--- a/drivers/bus/dpaa/Makefile
+++ b/drivers/bus/dpaa/Makefile
@@ -17,6 +17,7 @@ CFLAGS += -Wno-cast-qual
CFLAGS += -I$(RTE_BUS_DPAA)/
CFLAGS += -I$(RTE_BUS_DPAA)/include
CFLAGS += -I$(RTE_BUS_DPAA)/base/qbman
+CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax
CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include
# versioning export map
@@ -32,7 +33,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_DPAA_BUS) += \
SRCS-$(CONFIG_RTE_LIBRTE_DPAA_BUS) += \
base/fman/fman.c \
base/fman/fman_hw.c \
- base/fman/of.c \
base/fman/netcfg_layer.c \
base/qbman/process.c \
base/qbman/bman.c \
diff --git a/drivers/bus/dpaa/base/fman/fman.c b/drivers/bus/dpaa/base/fman/fman.c
index 8fa9b8c..462efd2 100644
--- a/drivers/bus/dpaa/base/fman/fman.c
+++ b/drivers/bus/dpaa/base/fman/fman.c
@@ -11,7 +11,7 @@
/* This header declares the driver interface we implement */
#include <fman.h>
-#include <of.h>
+#include <dpaa_of.h>
#include <rte_malloc.h>
#include <rte_dpaa_logs.h>
#include <rte_string_fns.h>
diff --git a/drivers/bus/dpaa/base/fman/netcfg_layer.c b/drivers/bus/dpaa/base/fman/netcfg_layer.c
index bf8c772..6affd2e 100644
--- a/drivers/bus/dpaa/base/fman/netcfg_layer.c
+++ b/drivers/bus/dpaa/base/fman/netcfg_layer.c
@@ -5,7 +5,7 @@
*
*/
#include <inttypes.h>
-#include <of.h>
+#include <dpaa_of.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <error.h>
diff --git a/drivers/bus/dpaa/base/qbman/dpaa_sys.h b/drivers/bus/dpaa/base/qbman/dpaa_sys.h
index 034991b..9377738 100644
--- a/drivers/bus/dpaa/base/qbman/dpaa_sys.h
+++ b/drivers/bus/dpaa/base/qbman/dpaa_sys.h
@@ -8,7 +8,8 @@
#ifndef __DPAA_SYS_H
#define __DPAA_SYS_H
-#include <of.h>
+#include <compat.h>
+#include <dpaa_of.h>
/* For 2-element tables related to cache-inhibited and cache-enabled mappings */
#define DPAA_PORTAL_CE 0
diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c
index 770e43f..b53eb9e 100644
--- a/drivers/bus/dpaa/base/qbman/qman.c
+++ b/drivers/bus/dpaa/base/qbman/qman.c
@@ -11,6 +11,8 @@
#include <rte_eventdev.h>
#include <rte_byteorder.h>
+#include <dpaa_bits.h>
+
/* Compilation constants */
#define DQRR_MAXFILL 15
#define EQCR_ITHRESH 4 /* if EQCR congests, interrupt threshold */
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 1d8a294..d028ef3 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -32,6 +32,7 @@
#include <rte_bus.h>
#include <rte_mbuf_pool_ops.h>
+#include <dpaa_of.h>
#include <rte_dpaa_bus.h>
#include <rte_dpaa_logs.h>
#include <dpaax_iova_table.h>
@@ -39,7 +40,6 @@
#include <fsl_usd.h>
#include <fsl_qman.h>
#include <fsl_bman.h>
-#include <of.h>
#include <netcfg.h>
int dpaa_logtype_bus;
diff --git a/drivers/bus/dpaa/include/fman.h b/drivers/bus/dpaa/include/fman.h
index d6eebc8..c02d32d 100644
--- a/drivers/bus/dpaa/include/fman.h
+++ b/drivers/bus/dpaa/include/fman.h
@@ -15,6 +15,7 @@
#include <rte_ether.h>
#include <compat.h>
+#include <dpaa_list.h>
#ifndef FMAN_DEVICE_PATH
#define FMAN_DEVICE_PATH "/dev/mem"
diff --git a/drivers/bus/dpaa/include/fsl_usd.h b/drivers/bus/dpaa/include/fsl_usd.h
index 3c26d6c..263d9bb 100644
--- a/drivers/bus/dpaa/include/fsl_usd.h
+++ b/drivers/bus/dpaa/include/fsl_usd.h
@@ -10,6 +10,7 @@
#define __FSL_USD_H
#include <compat.h>
+#include <dpaa_list.h>
#include <fsl_qman.h>
#ifdef __cplusplus
diff --git a/drivers/bus/dpaa/meson.build b/drivers/bus/dpaa/meson.build
index c9c3b24..0e561c2 100644
--- a/drivers/bus/dpaa/meson.build
+++ b/drivers/bus/dpaa/meson.build
@@ -12,7 +12,6 @@ deps += ['common_dpaax', 'eventdev']
sources = files('base/fman/fman.c',
'base/fman/fman_hw.c',
'base/fman/netcfg_layer.c',
- 'base/fman/of.c',
'base/qbman/bman.c',
'base/qbman/bman_driver.c',
'base/qbman/dpaa_alloc.c',
diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map
index a221522..97f4f62 100644
--- a/drivers/bus/dpaa/rte_bus_dpaa_version.map
+++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map
@@ -40,8 +40,6 @@ DPDK_17.11 {
fman_ip_rev;
netcfg_acquire;
netcfg_release;
- of_find_compatible_node;
- of_get_property;
qm_channel_caam;
qman_create_fq;
qman_dequeue;
@@ -97,7 +95,6 @@ DPDK_18.08 {
fman_if_get_sg_enable;
fman_if_set_sg;
- of_get_mac_address;
} DPDK_18.02;
diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h
index 9601aeb..c2b2375 100644
--- a/drivers/bus/dpaa/rte_dpaa_bus.h
+++ b/drivers/bus/dpaa/rte_dpaa_bus.h
@@ -10,10 +10,10 @@
#include <rte_mempool.h>
#include <dpaax_iova_table.h>
+#include <dpaa_of.h>
#include <fsl_usd.h>
#include <fsl_qman.h>
#include <fsl_bman.h>
-#include <of.h>
#include <netcfg.h>
#define DPAA_MEMPOOL_OPS_NAME "dpaa"
diff --git a/drivers/bus/fslmc/Makefile b/drivers/bus/fslmc/Makefile
index 218d9bd..16f0a2c 100644
--- a/drivers/bus/fslmc/Makefile
+++ b/drivers/bus/fslmc/Makefile
@@ -16,6 +16,7 @@ CFLAGS += $(WERROR_FLAGS)
CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc
CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/mc
CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include
+CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax
CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
LDLIBS += -lrte_ethdev
diff --git a/drivers/common/dpaax/Makefile b/drivers/common/dpaax/Makefile
index 94d2cf0..a0a1de0 100644
--- a/drivers/common/dpaax/Makefile
+++ b/drivers/common/dpaax/Makefile
@@ -12,6 +12,10 @@ LIB = librte_common_dpaax.a
CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -Wno-pointer-arith
+CFLAGS += -Wno-cast-qual
+
+CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax
# versioning export map
EXPORT_MAP := rte_common_dpaax_version.map
@@ -22,10 +26,8 @@ LIBABIVER := 1
#
# all source are stored in SRCS-y
#
-SRCS-y += dpaax_iova_table.c
+SRCS-y += dpaax_iova_table.c dpaa_of.c
LDLIBS += -lrte_eal
-SYMLINK-y-include += dpaax_iova_table.h
-
-include $(RTE_SDK)/mk/rte.lib.mk \ No newline at end of file
+include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/bus/dpaa/include/compat.h b/drivers/common/dpaax/compat.h
index 277ce63..12c9d99 100644
--- a/drivers/bus/dpaa/include/compat.h
+++ b/drivers/common/dpaax/compat.h
@@ -390,7 +390,4 @@ static inline unsigned long get_zeroed_page(gfp_t __foo __rte_unused)
#define atomic_dec_return(v) rte_atomic32_sub_return(v, 1)
#define atomic_sub_and_test(i, v) (rte_atomic32_sub_return(v, i) == 0)
-#include <dpaa_list.h>
-#include <dpaa_bits.h>
-
#endif /* __COMPAT_H */
diff --git a/drivers/bus/dpaa/include/dpaa_list.h b/drivers/common/dpaax/dpaa_list.h
index e945759..e945759 100644
--- a/drivers/bus/dpaa/include/dpaa_list.h
+++ b/drivers/common/dpaax/dpaa_list.h
diff --git a/drivers/bus/dpaa/base/fman/of.c b/drivers/common/dpaax/dpaa_of.c
index 1e97be5..bb2c8fc 100644
--- a/drivers/bus/dpaa/base/fman/of.c
+++ b/drivers/common/dpaax/dpaa_of.c
@@ -5,9 +5,10 @@
*
*/
-#include <of.h>
+#include <dpaa_of.h>
+#include <assert.h>
#include <rte_string_fns.h>
-#include <rte_dpaa_logs.h>
+#include <dpaax_logs.h>
static int alive;
static struct dt_dir root_dir;
@@ -23,7 +24,7 @@ of_open_dir(const char *relative_path, struct dirent ***d)
snprintf(full_path, PATH_MAX, "%s/%s", base_dir, relative_path);
ret = scandir(full_path, d, 0, versionsort);
if (ret < 0)
- DPAA_BUS_LOG(ERR, "Failed to open directory %s",
+ DPAAX_LOG(ERR, "Failed to open directory %s",
full_path);
return ret;
}
@@ -45,7 +46,7 @@ of_open_file(const char *relative_path)
snprintf(full_path, PATH_MAX, "%s/%s", base_dir, relative_path);
ret = open(full_path, O_RDONLY);
if (ret < 0)
- DPAA_BUS_LOG(ERR, "Failed to open directory %s",
+ DPAAX_LOG(ERR, "Failed to open directory %s",
full_path);
return ret;
}
@@ -57,7 +58,7 @@ process_file(struct dirent *dent, struct dt_dir *parent)
struct dt_file *f = malloc(sizeof(*f));
if (!f) {
- DPAA_BUS_LOG(DEBUG, "Unable to allocate memory for file node");
+ DPAAX_LOG(DEBUG, "Unable to allocate memory for file node");
return;
}
f->node.is_file = 1;
@@ -67,14 +68,14 @@ process_file(struct dirent *dent, struct dt_dir *parent)
f->parent = parent;
fd = of_open_file(f->node.node.full_name);
if (fd < 0) {
- DPAA_BUS_LOG(DEBUG, "Unable to open file node");
+ DPAAX_LOG(DEBUG, "Unable to open file node");
free(f);
return;
}
f->len = read(fd, f->buf, OF_FILE_BUF_MAX);
close(fd);
if (f->len < 0) {
- DPAA_BUS_LOG(DEBUG, "Unable to read file node");
+ DPAAX_LOG(DEBUG, "Unable to read file node");
free(f);
return;
}
@@ -130,7 +131,7 @@ iterate_dir(struct dirent **d, int num, struct dt_dir *dt)
list_add_tail(&subdir->node.list, &dt->subdirs);
break;
default:
- DPAA_BUS_LOG(DEBUG, "Ignoring invalid dt entry %s/%s",
+ DPAAX_LOG(DEBUG, "Ignoring invalid dt entry %s/%s",
dt->node.node.full_name, d[loop]->d_name);
}
}
@@ -170,37 +171,37 @@ linear_dir(struct dt_dir *d)
list_for_each_entry(f, &d->files, node.list) {
if (!strcmp(f->node.node.name, "compatible")) {
if (d->compatible)
- DPAA_BUS_LOG(DEBUG, "Duplicate compatible in"
+ DPAAX_LOG(DEBUG, "Duplicate compatible in"
" %s", d->node.node.full_name);
d->compatible = f;
} else if (!strcmp(f->node.node.name, "status")) {
if (d->status)
- DPAA_BUS_LOG(DEBUG, "Duplicate status in %s",
+ DPAAX_LOG(DEBUG, "Duplicate status in %s",
d->node.node.full_name);
d->status = f;
} else if (!strcmp(f->node.node.name, "linux,phandle")) {
if (d->lphandle)
- DPAA_BUS_LOG(DEBUG, "Duplicate lphandle in %s",
+ DPAAX_LOG(DEBUG, "Duplicate lphandle in %s",
d->node.node.full_name);
d->lphandle = f;
} else if (!strcmp(f->node.node.name, "phandle")) {
if (d->lphandle)
- DPAA_BUS_LOG(DEBUG, "Duplicate lphandle in %s",
+ DPAAX_LOG(DEBUG, "Duplicate lphandle in %s",
d->node.node.full_name);
d->lphandle = f;
} else if (!strcmp(f->node.node.name, "#address-cells")) {
if (d->a_cells)
- DPAA_BUS_LOG(DEBUG, "Duplicate a_cells in %s",
+ DPAAX_LOG(DEBUG, "Duplicate a_cells in %s",
d->node.node.full_name);
d->a_cells = f;
} else if (!strcmp(f->node.node.name, "#size-cells")) {
if (d->s_cells)
- DPAA_BUS_LOG(DEBUG, "Duplicate s_cells in %s",
+ DPAAX_LOG(DEBUG, "Duplicate s_cells in %s",
d->node.node.full_name);
d->s_cells = f;
} else if (!strcmp(f->node.node.name, "reg")) {
if (d->reg)
- DPAA_BUS_LOG(DEBUG, "Duplicate reg in %s",
+ DPAAX_LOG(DEBUG, "Duplicate reg in %s",
d->node.node.full_name);
d->reg = f;
}
@@ -220,7 +221,7 @@ of_init_path(const char *dt_path)
base_dir = dt_path;
/* This needs to be singleton initialization */
- DPAA_BUS_HWWARN(alive, "Double-init of device-tree driver!");
+ DPAAX_HWWARN(alive, "Double-init of device-tree driver!");
/* Prepare root node (the remaining fields are set in process_dir()) */
root_dir.node.node.name[0] = '\0';
@@ -231,7 +232,7 @@ of_init_path(const char *dt_path)
/* Kick things off... */
ret = process_dir("", &root_dir);
if (ret) {
- DPAA_BUS_LOG(ERR, "Unable to parse device tree");
+ DPAAX_LOG(ERR, "Unable to parse device tree");
return ret;
}
@@ -261,7 +262,7 @@ destroy_dir(struct dt_dir *d)
void
of_finish(void)
{
- DPAA_BUS_HWWARN(!alive, "Double-finish of device-tree driver!");
+ DPAAX_HWWARN(!alive, "Double-finish of device-tree driver!");
destroy_dir(&root_dir);
INIT_LIST_HEAD(&linear);
@@ -298,12 +299,12 @@ check_compatible(const struct dt_file *f, const char *compatible)
const struct device_node *
of_find_compatible_node(const struct device_node *from,
- const char *type __always_unused,
+ const char *type __rte_unused,
const char *compatible)
{
const struct dt_dir *d;
- DPAA_BUS_HWWARN(!alive, "Device-tree driver not initialised!");
+ DPAAX_HWWARN(!alive, "Device-tree driver not initialised!");
if (list_empty(&linear))
return NULL;
@@ -328,7 +329,7 @@ of_get_property(const struct device_node *from, const char *name,
const struct dt_dir *d;
const struct dt_file *f;
- DPAA_BUS_HWWARN(!alive, "Device-tree driver not initialised!");
+ DPAAX_HWWARN(!alive, "Device-tree driver not initialised!");
d = node2dir(from);
list_for_each_entry(f, &d->files, node.list)
@@ -345,7 +346,7 @@ of_device_is_available(const struct device_node *dev_node)
{
const struct dt_dir *d;
- DPAA_BUS_HWWARN(!alive, "Device-tree driver not initialised!");
+ DPAAX_HWWARN(!alive, "Device-tree driver not initialised!");
d = node2dir(dev_node);
if (!d->status)
return true;
@@ -357,11 +358,11 @@ of_device_is_available(const struct device_node *dev_node)
}
const struct device_node *
-of_find_node_by_phandle(phandle ph)
+of_find_node_by_phandle(uint64_t ph)
{
const struct dt_dir *d;
- DPAA_BUS_HWWARN(!alive, "Device-tree driver not initialised!");
+ DPAAX_HWWARN(!alive, "Device-tree driver not initialised!");
list_for_each_entry(d, &linear, linear)
if (d->lphandle && (d->lphandle->len == 4) &&
!memcmp(d->lphandle->buf, &ph, 4))
@@ -374,7 +375,7 @@ of_get_parent(const struct device_node *dev_node)
{
const struct dt_dir *d;
- DPAA_BUS_HWWARN(!alive, "Device-tree driver not initialised!");
+ DPAAX_HWWARN(!alive, "Device-tree driver not initialised!");
if (!dev_node)
return NULL;
@@ -390,14 +391,14 @@ of_get_next_child(const struct device_node *dev_node,
{
const struct dt_dir *p, *c;
- DPAA_BUS_HWWARN(!alive, "Device-tree driver not initialised!");
+ DPAAX_HWWARN(!alive, "Device-tree driver not initialised!");
if (!dev_node)
return NULL;
p = node2dir(dev_node);
if (prev) {
c = node2dir(prev);
- DPAA_BUS_HWWARN((c->parent != p), "Parent/child mismatch");
+ DPAAX_HWWARN((c->parent != p), "Parent/child mismatch");
if (c->parent != p)
return NULL;
if (c->node.list.next == &p->subdirs)
@@ -418,7 +419,7 @@ of_n_addr_cells(const struct device_node *dev_node)
{
const struct dt_dir *d;
- DPAA_BUS_HWWARN(!alive, "Device-tree driver not initialised");
+ DPAAX_HWWARN(!alive, "Device-tree driver not initialised");
if (!dev_node)
return OF_DEFAULT_NA;
d = node2dir(dev_node);
@@ -440,7 +441,7 @@ of_n_size_cells(const struct device_node *dev_node)
{
const struct dt_dir *d;
- DPAA_BUS_HWWARN(!alive, "Device-tree driver not initialised!");
+ DPAAX_HWWARN(!alive, "Device-tree driver not initialised!");
if (!dev_node)
return OF_DEFAULT_NA;
d = node2dir(dev_node);
@@ -496,7 +497,7 @@ of_translate_address(const struct device_node *dev_node,
size_t rlen;
uint32_t na, pna;
- DPAA_BUS_HWWARN(!alive, "Device-tree driver not initialised!");
+ DPAAX_HWWARN(!alive, "Device-tree driver not initialised!");
assert(dev_node != NULL);
na = of_n_addr_cells(dev_node);
@@ -538,7 +539,7 @@ of_device_is_compatible(const struct device_node *dev_node,
{
const struct dt_dir *d;
- DPAA_BUS_HWWARN(!alive, "Device-tree driver not initialised!");
+ DPAAX_HWWARN(!alive, "Device-tree driver not initialised!");
if (!dev_node)
d = &root_dir;
else
diff --git a/drivers/bus/dpaa/include/of.h b/drivers/common/dpaax/dpaa_of.h
index 7ea7608..960b421 100644
--- a/drivers/bus/dpaa/include/of.h
+++ b/drivers/common/dpaax/dpaa_of.h
@@ -8,7 +8,22 @@
#ifndef __OF_H
#define __OF_H
-#include <compat.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <inttypes.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <glob.h>
+#include <errno.h>
+#include <ctype.h>
+#include <limits.h>
+#include <rte_common.h>
+#include <dpaa_list.h>
#ifndef OF_INIT_DEFAULT_PATH
#define OF_INIT_DEFAULT_PATH "/proc/device-tree"
@@ -89,7 +104,7 @@ struct dt_file {
const struct device_node *of_find_compatible_node(
const struct device_node *from,
- const char *type __always_unused,
+ const char *type __rte_unused,
const char *compatible)
__attribute__((nonnull(3)));
@@ -102,7 +117,7 @@ const void *of_get_property(const struct device_node *from, const char *name,
size_t *lenp) __attribute__((nonnull(2)));
bool of_device_is_available(const struct device_node *dev_node);
-const struct device_node *of_find_node_by_phandle(phandle ph);
+const struct device_node *of_find_node_by_phandle(uint64_t ph);
const struct device_node *of_get_parent(const struct device_node *dev_node);
@@ -122,7 +137,7 @@ const uint32_t *of_get_address(const struct device_node *dev_node, size_t idx,
uint64_t *size, uint32_t *flags);
uint64_t of_translate_address(const struct device_node *dev_node,
- const u32 *addr) __attribute__((nonnull));
+ const uint32_t *addr) __attribute__((nonnull));
bool of_device_is_compatible(const struct device_node *dev_node,
const char *compatible);
@@ -147,7 +162,7 @@ static inline int of_init(void)
/* Read a numeric property according to its size and return it as a 64-bit
* value.
*/
-static inline uint64_t of_read_number(const __be32 *cell, int size)
+static inline uint64_t of_read_number(const uint32_t *cell, int size)
{
uint64_t r = 0;
diff --git a/drivers/common/dpaax/dpaax_logs.h b/drivers/common/dpaax/dpaax_logs.h
index bf1b27c..180476f 100644
--- a/drivers/common/dpaax/dpaax_logs.h
+++ b/drivers/common/dpaax/dpaax_logs.h
@@ -9,6 +9,16 @@
extern int dpaax_logger;
+#ifdef RTE_LIBRTE_DPAAX_DEBUG
+#define DPAAX_HWWARN(cond, fmt, args...) \
+ do {\
+ if (cond) \
+ DPAAX_LOG(DEBUG, "WARN: " fmt, ##args); \
+ } while (0)
+#else
+#define DPAAX_HWWARN(cond, fmt, args...) do { } while (0)
+#endif
+
#define DPAAX_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, dpaax_logger, "dpaax: " fmt "\n", \
##args)
diff --git a/drivers/common/dpaax/meson.build b/drivers/common/dpaax/meson.build
index a315e77..d41bb50 100644
--- a/drivers/common/dpaax/meson.build
+++ b/drivers/common/dpaax/meson.build
@@ -8,6 +8,12 @@ if not is_linux
reason = 'only supported on linux'
endif
-sources = files('dpaax_iova_table.c')
+sources = files('dpaax_iova_table.c', 'dpaa_of.c')
cflags += ['-D_GNU_SOURCE']
+if cc.has_argument('-Wno-cast-qual')
+ cflags += '-Wno-cast-qual'
+endif
+if cc.has_argument('-Wno-pointer-arith')
+ cflags += '-Wno-pointer-arith'
+endif
diff --git a/drivers/common/dpaax/rte_common_dpaax_version.map b/drivers/common/dpaax/rte_common_dpaax_version.map
index 8131c9e..a7699ae 100644
--- a/drivers/common/dpaax/rte_common_dpaax_version.map
+++ b/drivers/common/dpaax/rte_common_dpaax_version.map
@@ -9,3 +9,21 @@ DPDK_18.11 {
local: *;
};
+
+DPDK_19.11 {
+ global:
+ of_device_is_available;
+ of_device_is_compatible;
+ of_find_compatible_node;
+ of_find_node_by_phandle;
+ of_get_address;
+ of_get_mac_address;
+ of_get_parent;
+ of_get_property;
+ of_init_path;
+ of_n_addr_cells;
+ of_translate_address;
+ of_get_next_child;
+
+ local: *;
+} DPDK_18.11;
diff --git a/drivers/crypto/caam_jr/Makefile b/drivers/crypto/caam_jr/Makefile
index c232a20..fa35b79 100644
--- a/drivers/crypto/caam_jr/Makefile
+++ b/drivers/crypto/caam_jr/Makefile
@@ -17,6 +17,7 @@ CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include
+CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax
CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax/caamflib/
CFLAGS += -I$(RTE_SDK)/drivers/crypto/caam_jr
CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include
diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c
index 2fe1818..d1da9a6 100644
--- a/drivers/crypto/caam_jr/caam_jr.c
+++ b/drivers/crypto/caam_jr/caam_jr.c
@@ -27,9 +27,9 @@
/* RTA header files */
#include <desc/common.h>
#include <desc/algo.h>
-#include <of.h>
+#include <dpaa_of.h>
#ifdef RTE_LIBRTE_PMD_CAAM_JR_DEBUG
-#define CAAM_JR_DBG 1
+#define CAAM_JR_DBG 1
#else
#define CAAM_JR_DBG 0
#endif
diff --git a/drivers/crypto/caam_jr/meson.build b/drivers/crypto/caam_jr/meson.build
index 825fefd..50132ae 100644
--- a/drivers/crypto/caam_jr/meson.build
+++ b/drivers/crypto/caam_jr/meson.build
@@ -15,4 +15,5 @@ sources = files('caam_jr_capabilities.c',
allow_experimental_apis = true
includes += include_directories('../../bus/dpaa/include/')
+includes += include_directories('../../common/dpaax/')
includes += include_directories('../../common/dpaax/caamflib/')
diff --git a/drivers/crypto/dpaa2_sec/Makefile b/drivers/crypto/dpaa2_sec/Makefile
index 1f28811..ba30a95 100644
--- a/drivers/crypto/dpaa2_sec/Makefile
+++ b/drivers/crypto/dpaa2_sec/Makefile
@@ -20,6 +20,7 @@ CFLAGS += -Wno-implicit-fallthrough
endif
endif
+CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax
CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax/caamflib
CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/
CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/mc
diff --git a/drivers/crypto/dpaa_sec/Makefile b/drivers/crypto/dpaa_sec/Makefile
index abbcc86..9acccaa 100644
--- a/drivers/crypto/dpaa_sec/Makefile
+++ b/drivers/crypto/dpaa_sec/Makefile
@@ -17,6 +17,7 @@ CFLAGS += $(WERROR_FLAGS)
CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa
CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include
CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/base/qbman
+CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax
CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa_sec/
CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax/caamflib/
CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 632ce9f..6c18633 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -29,7 +29,7 @@
#include <fsl_usd.h>
#include <fsl_qman.h>
-#include <of.h>
+#include <dpaa_of.h>
/* RTA header files */
#include <desc/common.h>
diff --git a/drivers/crypto/dpaa_sec/meson.build b/drivers/crypto/dpaa_sec/meson.build
index 8744a05..9f17d3a 100644
--- a/drivers/crypto/dpaa_sec/meson.build
+++ b/drivers/crypto/dpaa_sec/meson.build
@@ -12,4 +12,5 @@ sources = files('dpaa_sec.c')
allow_experimental_apis = true
includes += include_directories('../../bus/dpaa/include')
+includes += include_directories('../../common/dpaax')
includes += include_directories('../../common/dpaax/caamflib/')
diff --git a/drivers/event/dpaa/Makefile b/drivers/event/dpaa/Makefile
index 1856fa4..befb21b 100644
--- a/drivers/event/dpaa/Makefile
+++ b/drivers/event/dpaa/Makefile
@@ -19,6 +19,7 @@ CFLAGS += -I$(RTE_SDK_DPAA)/include
CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa
CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/
CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa
+CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax
CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include
LDLIBS += -lrte_pmd_dpaa_sec
diff --git a/drivers/event/dpaa2/Makefile b/drivers/event/dpaa2/Makefile
index c4019d6..a29284f 100644
--- a/drivers/event/dpaa2/Makefile
+++ b/drivers/event/dpaa2/Makefile
@@ -17,6 +17,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/mc
CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/portal
CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa2
CFLAGS += -I$(RTE_SDK)/drivers/event/dpaa2
+CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax
LDLIBS += -lrte_eal -lrte_eventdev
LDLIBS += -lrte_common_dpaax
LDLIBS += -lrte_bus_fslmc -lrte_mempool_dpaa2 -lrte_pmd_dpaa2
diff --git a/drivers/mempool/dpaa/Makefile b/drivers/mempool/dpaa/Makefile
index ead5029..534e007 100644
--- a/drivers/mempool/dpaa/Makefile
+++ b/drivers/mempool/dpaa/Makefile
@@ -12,6 +12,7 @@ CFLAGS := -I$(SRCDIR) $(CFLAGS)
CFLAGS += -O3 $(WERROR_FLAGS)
CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa
CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/
+CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax
CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa
CFLAGS += -I$(RTE_SDK)/lib/librte_mempool
diff --git a/drivers/mempool/dpaa2/Makefile b/drivers/mempool/dpaa2/Makefile
index c1df78a..bdb9410 100644
--- a/drivers/mempool/dpaa2/Makefile
+++ b/drivers/mempool/dpaa2/Makefile
@@ -12,6 +12,7 @@ LIB = librte_mempool_dpaa2.a
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc
+CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax
CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include
# versioning export map
diff --git a/drivers/net/dpaa/Makefile b/drivers/net/dpaa/Makefile
index 4fb16bd..395e4d9 100644
--- a/drivers/net/dpaa/Makefile
+++ b/drivers/net/dpaa/Makefile
@@ -19,6 +19,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa
CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/
CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/base/qbman
CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa
+CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax
CFLAGS += -I$(RTE_SDK)/drivers/event/dpaa
CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include
diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index f63a5f1..182beca 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -15,7 +15,7 @@
#include <fsl_usd.h>
#include <fsl_qman.h>
#include <fsl_bman.h>
-#include <of.h>
+#include <dpaa_of.h>
#include <netcfg.h>
#define MAX_DPAA_CORES 4
diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c
index 2de1a1a..bbe6150 100644
--- a/drivers/net/dpaa/dpaa_rxtx.c
+++ b/drivers/net/dpaa/dpaa_rxtx.c
@@ -44,7 +44,7 @@
#include <fsl_usd.h>
#include <fsl_qman.h>
#include <fsl_bman.h>
-#include <of.h>
+#include <dpaa_of.h>
#include <netcfg.h>
#define DPAA_MBUF_TO_CONTIG_FD(_mbuf, _fd, _bpid) \
diff --git a/drivers/net/dpaa2/Makefile b/drivers/net/dpaa2/Makefile
index 7924871..e5a2d3f 100644
--- a/drivers/net/dpaa2/Makefile
+++ b/drivers/net/dpaa2/Makefile
@@ -12,6 +12,7 @@ LIB = librte_pmd_dpaa2.a
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax
CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2
CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2/mc
CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc
diff --git a/drivers/raw/dpaa2_cmdif/Makefile b/drivers/raw/dpaa2_cmdif/Makefile
index 2b4150c..a7c9802 100644
--- a/drivers/raw/dpaa2_cmdif/Makefile
+++ b/drivers/raw/dpaa2_cmdif/Makefile
@@ -14,6 +14,7 @@ CFLAGS += $(WERROR_FLAGS)
CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc
CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include
+CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax
LDLIBS += -lrte_bus_fslmc
LDLIBS += -lrte_bus_vdev
diff --git a/drivers/raw/dpaa2_qdma/Makefile b/drivers/raw/dpaa2_qdma/Makefile
index 0009fd4..057b2a8 100644
--- a/drivers/raw/dpaa2_qdma/Makefile
+++ b/drivers/raw/dpaa2_qdma/Makefile
@@ -14,6 +14,7 @@ CFLAGS += $(WERROR_FLAGS)
CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc
CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include
+CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax
LDLIBS += -lrte_bus_fslmc
LDLIBS += -lrte_eal