From patchwork Mon Aug 26 13:02:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gagandeep Singh X-Patchwork-Id: 172169 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp4335447ily; Mon, 26 Aug 2019 06:17:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDJmM9kCat0YrpXUdL3fqUAVLfhwHheQ/vgx213d2Joj5qdzPngIlYfgkeNnFDQPAKNPQw X-Received: by 2002:a17:906:c344:: with SMTP id ci4mr16501773ejb.219.1566825424125; Mon, 26 Aug 2019 06:17:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566825424; cv=none; d=google.com; s=arc-20160816; b=U+g0B0VK8mFII6NoWirWZss818W8DodVNphyOjQ/TsIZDVHred47DBFKvt2rKXhkVz cE2UqzCTq/8lq5SZz4aoZMRJ6EGXDDyqrLRCINKK7/J7P0I1J1APG0SHQvruBuKQ2cn5 lUo3tfqhJCVJESRtNCPlxPt5OuMa054VFjDonWUo+0QxmDtuOP/WreGaWarOiz/OXdmo jVGwaE6K+EBXpWsqo/G++Cj3G2hsS0erUZZfu1aRwpZJP7UZwqchdoHPJIv7Yk/qFOvB 4ym6IOrHs5kJ4lDOxYp+ALC8QrdFZFXpshUKnD/UerzAT7PC/h+ivPmyg1RcvB+ESl1M zrYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=+/VuyYEGSNVKsoVlO3dfwebl7/kUFbBk7HpcIdbbt7Y=; b=mRN8MFuPJoLPam5SjFnc/1EWPRuB4srNWfeiQhYqygyyzjFdroVT9uwtC0vIuX2XJR 83zn5TIvyl2yAQW457QZmTbUB4+Vu7JhC0K6U8sJFTKG6r29kP5UAtfAAurjRxjkQI4X mFM0EqgOFyEIV3gFu2KbYOBq6Xmo41+lzroQjkwMahXXLGtE8O3+UDy70H1NxMtbrgr/ /1VFzgLsFSZys0bf7l9V1t8QIaFHN0QNxmFfzcXuR8Yqca3JFDKPRK0bkbaoJn9l9oVR QdMM7bsyCTwWuTPxAI98jIflG0DykiTiwUvSsHqURniPJ8HdOXk7hCM5vyrUAiHtoKT6 yzDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id k30si6853823edb.273.2019.08.26.06.17.03; Mon, 26 Aug 2019 06:17:04 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A78E81C19F; Mon, 26 Aug 2019 15:16:57 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 50E951C12A for ; Mon, 26 Aug 2019 15:16:54 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E5A82200234; Mon, 26 Aug 2019 15:16:53 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 3E09B20000C; Mon, 26 Aug 2019 15:16:51 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 294CD402E3; Mon, 26 Aug 2019 21:16:47 +0800 (SGT) From: Gagandeep Singh To: dev@dpdk.org, ferruh.yigit@intel.com Cc: thomas@monjalon.net, Hemant Agrawal Date: Mon, 26 Aug 2019 18:32:34 +0530 Message-Id: <20190826130246.30485-2-g.singh@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190826130246.30485-1-g.singh@nxp.com> References: <20190826130246.30485-1-g.singh@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v1 01/13] common/dpaax: moving OF lib code from dpaa bus X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Hemant Agrawal 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/qbman/dpaa_sys.h | 1 + drivers/bus/dpaa/dpaa_bus.c | 2 +- drivers/bus/dpaa/include/compat.h | 1 - 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_dpaa_bus.h | 2 +- drivers/bus/fslmc/Makefile | 1 + drivers/common/dpaax/Makefile | 10 +-- .../dpaa/include => common/dpaax}/dpaa_list.h | 0 drivers/common/dpaax/dpaax_logs.h | 10 +++ drivers/common/dpaax/meson.build | 5 +- .../{bus/dpaa/base/fman => common/dpaax}/of.c | 61 ++++++++++--------- .../{bus/dpaa/include => common/dpaax}/of.h | 27 ++++++-- .../common/dpaax/rte_common_dpaax_version.map | 18 ++++++ drivers/crypto/caam_jr/Makefile | 2 + drivers/crypto/dpaa2_sec/Makefile | 2 +- drivers/crypto/dpaa_sec/Makefile | 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/dpaa2/Makefile | 1 + drivers/raw/dpaa2_cmdif/Makefile | 1 + drivers/raw/dpaa2_qdma/Makefile | 1 + 27 files changed, 110 insertions(+), 46 deletions(-) rename drivers/{bus/dpaa/include => common/dpaax}/dpaa_list.h (100%) rename drivers/{bus/dpaa/base/fman => common/dpaax}/of.c (88%) rename drivers/{bus/dpaa/include => common/dpaax}/of.h (86%) -- 2.17.1 diff --git a/drivers/bus/dpaa/Makefile b/drivers/bus/dpaa/Makefile index dfc2717a4..454ac12bf 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/qbman/dpaa_sys.h b/drivers/bus/dpaa/base/qbman/dpaa_sys.h index 034991ba1..e86a480b7 100644 --- a/drivers/bus/dpaa/base/qbman/dpaa_sys.h +++ b/drivers/bus/dpaa/base/qbman/dpaa_sys.h @@ -8,6 +8,7 @@ #ifndef __DPAA_SYS_H #define __DPAA_SYS_H +#include #include /* For 2-element tables related to cache-inhibited and cache-enabled mappings */ diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index 07cc5c667..8770c3a11 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/compat.h b/drivers/bus/dpaa/include/compat.h index 277ce6369..fcc5b2e74 100644 --- a/drivers/bus/dpaa/include/compat.h +++ b/drivers/bus/dpaa/include/compat.h @@ -390,7 +390,6 @@ 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/fman.h b/drivers/bus/dpaa/include/fman.h index d6eebc877..c02d32d22 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 ec1ab7cee..c18747256 100644 --- a/drivers/bus/dpaa/include/fsl_usd.h +++ b/drivers/bus/dpaa/include/fsl_usd.h @@ -9,6 +9,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 19daaa5b5..55338cfa7 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_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h index 554a56f2e..19e30069d 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 218d9bd28..16f0a2ca4 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 94d2cf0ce..f725d93d4 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 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/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/common/dpaax/dpaax_logs.h b/drivers/common/dpaax/dpaax_logs.h index bf1b27cc1..180476f67 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 a315e7786..795cc84b9 100644 --- a/drivers/common/dpaax/meson.build +++ b/drivers/common/dpaax/meson.build @@ -8,6 +8,9 @@ if not is_linux reason = 'only supported on linux' endif -sources = files('dpaax_iova_table.c') +sources = files('dpaax_iova_table.c', 'of.c') cflags += ['-D_GNU_SOURCE'] +if cc.has_argument('-Wno-cast-qual') + cflags += '-Wno-cast-qual' +endif diff --git a/drivers/bus/dpaa/base/fman/of.c b/drivers/common/dpaax/of.c similarity index 88% rename from drivers/bus/dpaa/base/fman/of.c rename to drivers/common/dpaax/of.c index 1e97be54e..b713bfd54 100644 --- a/drivers/bus/dpaa/base/fman/of.c +++ b/drivers/common/dpaax/of.c @@ -6,8 +6,9 @@ */ #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/of.h similarity index 86% rename from drivers/bus/dpaa/include/of.h rename to drivers/common/dpaax/of.h index 7ea7608fc..e9761ce0e 100644 --- a/drivers/bus/dpaa/include/of.h +++ b/drivers/common/dpaax/of.h @@ -8,7 +8,24 @@ #ifndef __OF_H #define __OF_H -#include +#include +#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 +106,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 +119,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 +139,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 +164,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/rte_common_dpaax_version.map b/drivers/common/dpaax/rte_common_dpaax_version.map index 8131c9e30..a7699ae4d 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 cecfbbdc8..6eee8379f 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/crypto/caam_jr #sharing the hw flib headers from dpaa2_sec pmd CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/ @@ -37,6 +38,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_CAAM_JR) += caam_jr_uio.c LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_cryptodev +LDLIBS += -lrte_common_dpaax LDLIBS += -lrte_bus_dpaa LDLIBS += -lrte_bus_vdev diff --git a/drivers/crypto/dpaa2_sec/Makefile b/drivers/crypto/dpaa2_sec/Makefile index 9c6657e52..039901bec 100644 --- a/drivers/crypto/dpaa2_sec/Makefile +++ b/drivers/crypto/dpaa2_sec/Makefile @@ -19,7 +19,7 @@ ifeq ($(shell test $(GCC_VERSION) -gt 70 && echo 1), 1) CFLAGS += -Wno-implicit-fallthrough endif endif - +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/ CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/mc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/ diff --git a/drivers/crypto/dpaa_sec/Makefile b/drivers/crypto/dpaa_sec/Makefile index 1d8b7bec1..8d1706597 100644 --- a/drivers/crypto/dpaa_sec/Makefile +++ b/drivers/crypto/dpaa_sec/Makefile @@ -16,6 +16,7 @@ CFLAGS += $(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/crypto/dpaa_sec/ #sharing the hw flib headers from dpaa2_sec pmd CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/ diff --git a/drivers/event/dpaa/Makefile b/drivers/event/dpaa/Makefile index cf9626495..a9f8648e7 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 EXPORT_MAP := rte_pmd_dpaa_event_version.map diff --git a/drivers/event/dpaa2/Makefile b/drivers/event/dpaa2/Makefile index 470157f25..647a8372d 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_bus_fslmc -lrte_mempool_dpaa2 -lrte_pmd_dpaa2 LDLIBS += -lrte_bus_vdev diff --git a/drivers/mempool/dpaa/Makefile b/drivers/mempool/dpaa/Makefile index ead5029fd..534e00733 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 c1df78a80..bdb941025 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 4fb16bd9d..395e4d900 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/dpaa2/Makefile b/drivers/net/dpaa2/Makefile index c7262ffd5..b8387706c 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 2b4150c2d..a7c980247 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 0009fd4c6..057b2a81a 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