From 8c83f28cc8a4dc7ee0fab676051dd483695d4140 Mon Sep 17 00:00:00 2001 From: Hemant Agrawal Date: Thu, 10 Oct 2019 12:02:21 +0530 Subject: [PATCH] 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 --- drivers/bus/dpaa/Makefile | 2 +- drivers/bus/dpaa/base/fman/fman.c | 2 +- drivers/bus/dpaa/base/fman/netcfg_layer.c | 2 +- drivers/bus/dpaa/base/qbman/dpaa_sys.h | 3 +- drivers/bus/dpaa/base/qbman/qman.c | 2 + drivers/bus/dpaa/dpaa_bus.c | 2 +- drivers/bus/dpaa/include/fman.h | 1 + drivers/bus/dpaa/include/fsl_usd.h | 1 + drivers/bus/dpaa/meson.build | 1 - drivers/bus/dpaa/rte_bus_dpaa_version.map | 3 - drivers/bus/dpaa/rte_dpaa_bus.h | 2 +- drivers/bus/fslmc/Makefile | 1 + drivers/common/dpaax/Makefile | 10 +-- .../dpaa/include => common/dpaax}/compat.h | 3 - .../dpaa/include => common/dpaax}/dpaa_list.h | 0 .../base/fman/of.c => common/dpaax/dpaa_of.c} | 63 ++++++++++--------- .../include/of.h => common/dpaax/dpaa_of.h} | 25 ++++++-- drivers/common/dpaax/dpaax_logs.h | 10 +++ drivers/common/dpaax/meson.build | 8 ++- .../common/dpaax/rte_common_dpaax_version.map | 18 ++++++ drivers/crypto/caam_jr/Makefile | 1 + drivers/crypto/caam_jr/caam_jr.c | 4 +- drivers/crypto/caam_jr/meson.build | 1 + drivers/crypto/dpaa2_sec/Makefile | 1 + drivers/crypto/dpaa_sec/Makefile | 1 + drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +- drivers/crypto/dpaa_sec/meson.build | 1 + drivers/event/dpaa/Makefile | 1 + drivers/event/dpaa2/Makefile | 1 + drivers/mempool/dpaa/Makefile | 1 + drivers/mempool/dpaa2/Makefile | 1 + drivers/net/dpaa/Makefile | 1 + drivers/net/dpaa/dpaa_ethdev.h | 2 +- drivers/net/dpaa/dpaa_rxtx.c | 2 +- drivers/net/dpaa2/Makefile | 1 + drivers/raw/dpaa2_cmdif/Makefile | 1 + drivers/raw/dpaa2_qdma/Makefile | 1 + 37 files changed, 123 insertions(+), 59 deletions(-) rename drivers/{bus/dpaa/include => common/dpaax}/compat.h (99%) rename drivers/{bus/dpaa/include => common/dpaax}/dpaa_list.h (100%) rename drivers/{bus/dpaa/base/fman/of.c => common/dpaax/dpaa_of.c} (88%) rename drivers/{bus/dpaa/include/of.h => common/dpaax/dpaa_of.h} (87%) diff --git a/drivers/bus/dpaa/Makefile b/drivers/bus/dpaa/Makefile index dfc2717a4e..454ac12bf3 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 8fa9b8caef..462efd2d4b 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 -#include +#include #include #include #include diff --git a/drivers/bus/dpaa/base/fman/netcfg_layer.c b/drivers/bus/dpaa/base/fman/netcfg_layer.c index bf8c77265f..6affd2e922 100644 --- a/drivers/bus/dpaa/base/fman/netcfg_layer.c +++ b/drivers/bus/dpaa/base/fman/netcfg_layer.c @@ -5,7 +5,7 @@ * */ #include -#include +#include #include #include #include diff --git a/drivers/bus/dpaa/base/qbman/dpaa_sys.h b/drivers/bus/dpaa/base/qbman/dpaa_sys.h index 034991ba1b..9377738dfa 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 +#include +#include /* 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 770e43f177..b53eb9e5ee 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -11,6 +11,8 @@ #include #include +#include + /* 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 1d8a294b1b..d028ef3bef 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -39,7 +40,6 @@ #include #include #include -#include #include int dpaa_logtype_bus; diff --git a/drivers/bus/dpaa/include/fman.h b/drivers/bus/dpaa/include/fman.h index d6eebc877a..c02d32d22f 100644 --- a/drivers/bus/dpaa/include/fman.h +++ b/drivers/bus/dpaa/include/fman.h @@ -15,6 +15,7 @@ #include #include +#include #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 3c26d6ccb3..263d9bb976 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 +#include #include #ifdef __cplusplus diff --git a/drivers/bus/dpaa/meson.build b/drivers/bus/dpaa/meson.build index c9c3b2415e..0e561c2608 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 a221522c23..97f4f622db 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 9601aebddd..c2b2375343 100644 --- a/drivers/bus/dpaa/rte_dpaa_bus.h +++ b/drivers/bus/dpaa/rte_dpaa_bus.h @@ -10,10 +10,10 @@ #include #include +#include #include #include #include -#include #include #define DPAA_MEMPOOL_OPS_NAME "dpaa" diff --git a/drivers/bus/fslmc/Makefile b/drivers/bus/fslmc/Makefile index 218d9bd28e..16f0a2ca4a 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 94d2cf0ce7..a0a1de0283 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 similarity index 99% rename from drivers/bus/dpaa/include/compat.h rename to drivers/common/dpaax/compat.h index 277ce63696..12c9d99179 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 -#include - #endif /* __COMPAT_H */ diff --git a/drivers/bus/dpaa/include/dpaa_list.h b/drivers/common/dpaax/dpaa_list.h similarity index 100% rename from drivers/bus/dpaa/include/dpaa_list.h rename to drivers/common/dpaax/dpaa_list.h diff --git a/drivers/bus/dpaa/base/fman/of.c b/drivers/common/dpaax/dpaa_of.c similarity index 88% rename from drivers/bus/dpaa/base/fman/of.c rename to drivers/common/dpaax/dpaa_of.c index 1e97be54e9..bb2c8fc66b 100644 --- a/drivers/bus/dpaa/base/fman/of.c +++ b/drivers/common/dpaax/dpaa_of.c @@ -5,9 +5,10 @@ * */ -#include +#include +#include #include -#include +#include 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 similarity index 87% rename from drivers/bus/dpaa/include/of.h rename to drivers/common/dpaax/dpaa_of.h index 7ea7608fca..960b421766 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #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 bf1b27cc11..180476f675 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 a315e7786b..d41bb50732 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 8131c9e305..a7699ae4dd 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 c232a20ba3..fa35b79b85 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 2fe18187a5..d1da9a64c8 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 #include -#include +#include #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 825fefd75f..50132aebef 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 1f288116ee..ba30a955a9 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 abbcc86662..9acccaac4f 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 632ce9fdc3..6c186338ff 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -29,7 +29,7 @@ #include #include -#include +#include /* RTA header files */ #include diff --git a/drivers/crypto/dpaa_sec/meson.build b/drivers/crypto/dpaa_sec/meson.build index 8744a05f05..9f17d3a43e 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 1856fa4682..befb21b1b6 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 c4019d6883..a29284f046 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 ead5029fd8..534e00733c 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 c1df78a805..bdb9410252 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 4fb16bd9d6..395e4d900f 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 f63a5f164e..182becac18 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #define MAX_DPAA_CORES 4 diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 2de1a1a7e1..bbe6150991 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #define DPAA_MBUF_TO_CONTIG_FD(_mbuf, _fd, _bpid) \ diff --git a/drivers/net/dpaa2/Makefile b/drivers/net/dpaa2/Makefile index 7924871c8c..e5a2d3fdee 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 2b4150c2d4..a7c9802476 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 0009fd4c67..057b2a81a2 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 -- 2.20.1