get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/26385/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 26385,
    "url": "http://patches.dpdk.org/api/patches/26385/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1499179471-19145-5-git-send-email-shreyansh.jain@nxp.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1499179471-19145-5-git-send-email-shreyansh.jain@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1499179471-19145-5-git-send-email-shreyansh.jain@nxp.com",
    "date": "2017-07-04T14:43:55",
    "name": "[dpdk-dev,v2,04/40] bus/dpaa: add OF parser for device scanning",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "7295847f30801c2403719e47d17c56f684cd1bdc",
    "submitter": {
        "id": 497,
        "url": "http://patches.dpdk.org/api/people/497/?format=api",
        "name": "Shreyansh Jain",
        "email": "shreyansh.jain@nxp.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1499179471-19145-5-git-send-email-shreyansh.jain@nxp.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/26385/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/26385/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id A2C9B58EC;\n\tTue,  4 Jul 2017 16:35:38 +0200 (CEST)",
            "from NAM02-SN1-obe.outbound.protection.outlook.com\n\t(mail-sn1nam02on0073.outbound.protection.outlook.com [104.47.36.73])\n\tby dpdk.org (Postfix) with ESMTP id 22DC27CB4\n\tfor <dev@dpdk.org>; Tue,  4 Jul 2017 16:35:37 +0200 (CEST)",
            "from CY1PR03CA0025.namprd03.prod.outlook.com (10.174.128.35) by\n\tBLUPR03MB471.namprd03.prod.outlook.com (10.141.78.145) with Microsoft\n\tSMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id\n\t15.1.1220.11; Tue, 4 Jul 2017 14:35:35 +0000",
            "from BN1BFFO11FD040.protection.gbl (2a01:111:f400:7c10::1:140) by\n\tCY1PR03CA0025.outlook.office365.com (2603:10b6:600::35) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id\n\t15.1.1220.11 via Frontend Transport; Tue, 4 Jul 2017 14:35:34 +0000",
            "from az84smr01.freescale.net (192.88.158.2) by\n\tBN1BFFO11FD040.mail.protection.outlook.com (10.58.144.103) with\n\tMicrosoft\n\tSMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id\n\t15.1.1199.9 via Frontend Transport; Tue, 4 Jul 2017 14:35:34 +0000",
            "from Tophie.ap.freescale.net ([10.232.14.39])\n\tby az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id\n\tv64EZM6m016426; Tue, 4 Jul 2017 07:35:31 -0700"
        ],
        "Authentication-Results": "spf=fail (sender IP is 192.88.158.2)\n\tsmtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed)\n\theader.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;",
        "Received-SPF": "Fail (protection.outlook.com: domain of nxp.com does not\n\tdesignate 192.88.158.2 as permitted sender)\n\treceiver=protection.outlook.com; \n\tclient-ip=192.88.158.2; helo=az84smr01.freescale.net;",
        "From": "Shreyansh Jain <shreyansh.jain@nxp.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ferruh.yigit@intel.com>, <hemant.agrawal@nxp.com>",
        "Date": "Tue, 4 Jul 2017 20:13:55 +0530",
        "Message-ID": "<1499179471-19145-5-git-send-email-shreyansh.jain@nxp.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1499179471-19145-1-git-send-email-shreyansh.jain@nxp.com>",
        "References": "<1497591668-3320-1-git-send-email-shreyansh.jain@nxp.com>\n\t<1499179471-19145-1-git-send-email-shreyansh.jain@nxp.com>",
        "X-EOPAttributedMessage": "0",
        "X-Matching-Connectors": "131436525345019186;\n\t(91ab9b29-cfa4-454e-5278-08d120cd25b8); ()",
        "X-Forefront-Antispam-Report": "CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI;\n\tSFV:NSPM;\n\tSFS:(10009020)(6009001)(336005)(39840400002)(39400400002)(39860400002)(39850400002)(39410400002)(39450400003)(39380400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(9170700003)(47776003)(36756003)(8936002)(50466002)(5003940100001)(189998001)(2906002)(5660300001)(50986999)(81166006)(33646002)(76176999)(8676002)(305945005)(48376002)(356003)(68736007)(626005)(53936002)(77096006)(104016004)(2950100002)(6666003)(6916009)(69596002)(106466001)(50226002)(8656002)(110136004)(38730400002)(105606002)(4326008)(86362001)(54906002)(85426001)(2351001)(498600001)(2004002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR03MB471; H:az84smr01.freescale.net;\n\tFPR:; \n\tSPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; ",
        "X-Microsoft-Exchange-Diagnostics": [
            "=?us-ascii?Q?1; BN1BFFO11FD040;\n\t1:0epie8NNsTdvhy6e3f0A2xZTBkArdQw2NY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kwWlZJi3ocaWHnUnbxn2Fh8WKlhEXAxT33FscJUZD+rKWXnG231vuVWe8LhFsQ1vzZcjnLwQnbwAueMcJKvN/XrTvdrQvAZ2mCDCjTlO6sBe9mGfkrVVtb+U0xmlQktmxnB8K30PIY3rtLzQMN2DxsvGbXJh5TAG9UUrZx37xbFKRjN4fPSgjNR8WZNkt6oaZ+zr5+bVU8ylqBE0o9dKlDdrZA+dKVxKIs5PqmKwP0hQRcVWvsuOyP7qi5YgkH5a4DkdtpvMghnAQu5TXl+YvkotRWiNQAh3UVIs4cokISnZQ/lZbmU1Ho0L2iYTUN6gGxdX2YjThoFG29XZ1Gs70OD9J4G5E6r8Z0JzsToFUgV6NbKsprHCpSi45GW+sROBcbNlOHHJtiElvW+SSTmSgJeEPSFi2mTi8FQPEbN5h07FnAy+pwrFtI0RZa5sE1XF+xWqnoV7HpOKs+ZNZ7Jd63zBPYU/IE+/xGySxY="
        ],
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-Correlation-Id": "3f3e76cd-6a8b-4eb4-9532-08d4c2e9ee2a",
        "X-Microsoft-Antispam": "UriScan:; BCL:0; PCL:0;\n\tRULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603031)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);\n\tSRVR:BLUPR03MB471; ",
        "X-MS-TrafficTypeDiagnostic": "BLUPR03MB471:",
        "X-Microsoft-Antispam-PRVS": "<BLUPR03MB47178D88394F5E3A52CBE0E90D70@BLUPR03MB471.namprd03.prod.outlook.com>",
        "X-Exchange-Antispam-Report-Test": "UriScan:(236129657087228)(185117386973197)(48057245064654)(148574349560750)(158140799945019);",
        "X-Exchange-Antispam-Report-CFA-Test": "BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(5005006)(13016025)(13018025)(8121501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123565025)(20161123561025)(20161123559100)(20161123563025)(20161123556025)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:BLUPR03MB471; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:BLUPR03MB471; ",
        "X-Forefront-PRVS": "0358535363",
        "SpamDiagnosticOutput": "1:99",
        "SpamDiagnosticMetadata": "NSPM",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "04 Jul 2017 14:35:34.2679\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-Id": "5afe0b00-7697-4969-b663-5eab37d5f47e",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;\n\tIp=[192.88.158.2]; \n\tHelo=[az84smr01.freescale.net]",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "BLUPR03MB471",
        "Subject": "[dpdk-dev] [PATCH v2 04/40] bus/dpaa: add OF parser for device\n\tscanning",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This layer is used by Bus driver's scan function. Devices are parsed\nusing OF parser and added to DPAA device list.\n\nSigned-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>\nSigned-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>\n---\n drivers/bus/dpaa/Makefile       |   7 +\n drivers/bus/dpaa/base/fman/of.c | 576 ++++++++++++++++++++++++++++++++++++++++\n drivers/bus/dpaa/include/of.h   | 191 +++++++++++++\n 3 files changed, 774 insertions(+)\n create mode 100644 drivers/bus/dpaa/base/fman/of.c\n create mode 100644 drivers/bus/dpaa/include/of.h",
    "diff": "diff --git a/drivers/bus/dpaa/Makefile b/drivers/bus/dpaa/Makefile\nindex f44f3c4..cc685d1 100644\n--- a/drivers/bus/dpaa/Makefile\n+++ b/drivers/bus/dpaa/Makefile\n@@ -45,7 +45,12 @@ CFLAGS += -O3\n CFLAGS += $(WERROR_FLAGS)\n endif\n \n+CFLAGS +=-Wno-pointer-arith\n+CFLAGS +=-Wno-cast-qual\n+CFLAGS += -D _GNU_SOURCE\n+\n CFLAGS += -I$(RTE_BUS_DPAA)/\n+CFLAGS += -I$(RTE_BUS_DPAA)/include\n CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal\n CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include\n \n@@ -59,5 +64,7 @@ LIBABIVER := 1\n SRCS-$(CONFIG_RTE_LIBRTE_DPAA_BUS) += \\\n \tdpaa_bus.c\n \n+SRCS-$(CONFIG_RTE_LIBRTE_DPAA_BUS) += \\\n+\tbase/fman/of.c \\\n \n include $(RTE_SDK)/mk/rte.lib.mk\ndiff --git a/drivers/bus/dpaa/base/fman/of.c b/drivers/bus/dpaa/base/fman/of.c\nnew file mode 100644\nindex 0000000..6cc3987\n--- /dev/null\n+++ b/drivers/bus/dpaa/base/fman/of.c\n@@ -0,0 +1,576 @@\n+/*-\n+ * This file is provided under a dual BSD/GPLv2 license. When using or\n+ * redistributing this file, you may do so under either license.\n+ *\n+ *   BSD LICENSE\n+ *\n+ * Copyright 2010-2016 Freescale Semiconductor Inc.\n+ * Copyright 2017 NXP.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in the\n+ * documentation and/or other materials provided with the distribution.\n+ * * Neither the name of the above-listed copyright holders nor the\n+ * names of any contributors may be used to endorse or promote products\n+ * derived from this software without specific prior written permission.\n+ *\n+ *   GPL LICENSE SUMMARY\n+ *\n+ * ALTERNATIVELY, this software may be distributed under the terms of the\n+ * GNU General Public License (\"GPL\") as published by the Free Software\n+ * Foundation, either version 2 of that License or (at your option) any\n+ * later version.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ * POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include <of.h>\n+#include <rte_dpaa_logs.h>\n+\n+static int alive;\n+static struct dt_dir root_dir;\n+static const char *base_dir;\n+static COMPAT_LIST_HEAD(linear);\n+\n+static int\n+of_open_dir(const char *relative_path, struct dirent ***d)\n+{\n+\tint ret;\n+\tchar full_path[PATH_MAX];\n+\n+\tsnprintf(full_path, PATH_MAX, \"%s/%s\", base_dir, relative_path);\n+\tret = scandir(full_path, d, 0, versionsort);\n+\tif (ret < 0)\n+\t\tDPAA_BUS_LOG(ERR, \"Failed to open directory %s\",\n+\t\t\t     full_path);\n+\treturn ret;\n+}\n+\n+static void\n+of_close_dir(struct dirent **d, int num)\n+{\n+\twhile (num--)\n+\t\tfree(d[num]);\n+\tfree(d);\n+}\n+\n+static int\n+of_open_file(const char *relative_path)\n+{\n+\tint ret;\n+\tchar full_path[PATH_MAX];\n+\n+\tsnprintf(full_path, PATH_MAX, \"%s/%s\", base_dir, relative_path);\n+\tret = open(full_path, O_RDONLY);\n+\tif (ret < 0)\n+\t\tDPAA_BUS_LOG(ERR, \"Failed to open directory %s\",\n+\t\t\t     full_path);\n+\treturn ret;\n+}\n+\n+static void\n+process_file(struct dirent *dent, struct dt_dir *parent)\n+{\n+\tint fd;\n+\tstruct dt_file *f = malloc(sizeof(*f));\n+\n+\tif (!f) {\n+\t\tDPAA_BUS_LOG(DEBUG, \"Unable to allocate memory for file node\");\n+\t\treturn;\n+\t}\n+\tf->node.is_file = 1;\n+\tsnprintf(f->node.node.name, NAME_MAX, \"%s\", dent->d_name);\n+\tsnprintf(f->node.node.full_name, PATH_MAX, \"%s/%s\",\n+\t\t parent->node.node.full_name, dent->d_name);\n+\tf->parent = parent;\n+\tfd = of_open_file(f->node.node.full_name);\n+\tif (fd < 0) {\n+\t\tDPAA_BUS_LOG(DEBUG, \"Unable to open file node\");\n+\t\tfree(f);\n+\t\treturn;\n+\t}\n+\tf->len = read(fd, f->buf, OF_FILE_BUF_MAX);\n+\tclose(fd);\n+\tif (f->len < 0) {\n+\t\tDPAA_BUS_LOG(DEBUG, \"Unable to read file node\");\n+\t\tfree(f);\n+\t\treturn;\n+\t}\n+\tlist_add_tail(&f->node.list, &parent->files);\n+}\n+\n+static const struct dt_dir *\n+node2dir(const struct device_node *n)\n+{\n+\tstruct dt_node *dn = container_of((struct device_node *)n,\n+\t\t\t\t\t  struct dt_node, node);\n+\tconst struct dt_dir *d = container_of(dn, struct dt_dir, node);\n+\n+\tassert(!dn->is_file);\n+\treturn d;\n+}\n+\n+/* process_dir() calls iterate_dir(), but the latter will also call the former\n+ * when recursing into sub-directories, so a predeclaration is needed.\n+ */\n+static int process_dir(const char *relative_path, struct dt_dir *dt);\n+\n+static int\n+iterate_dir(struct dirent **d, int num, struct dt_dir *dt)\n+{\n+\tint loop;\n+\t/* Iterate the directory contents */\n+\tfor (loop = 0; loop < num; loop++) {\n+\t\tstruct dt_dir *subdir;\n+\t\tint ret;\n+\t\t/* Ignore dot files of all types (especially \"..\") */\n+\t\tif (d[loop]->d_name[0] == '.')\n+\t\t\tcontinue;\n+\t\tswitch (d[loop]->d_type) {\n+\t\tcase DT_REG:\n+\t\t\tprocess_file(d[loop], dt);\n+\t\t\tbreak;\n+\t\tcase DT_DIR:\n+\t\t\tsubdir = malloc(sizeof(*subdir));\n+\t\t\tif (!subdir) {\n+\t\t\t\tperror(\"malloc\");\n+\t\t\t\treturn -ENOMEM;\n+\t\t\t}\n+\t\t\tsnprintf(subdir->node.node.name, NAME_MAX, \"%s\",\n+\t\t\t\t d[loop]->d_name);\n+\t\t\tsnprintf(subdir->node.node.full_name, PATH_MAX,\n+\t\t\t\t \"%s/%s\", dt->node.node.full_name,\n+\t\t\t\t d[loop]->d_name);\n+\t\t\tsubdir->parent = dt;\n+\t\t\tret = process_dir(subdir->node.node.full_name, subdir);\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n+\t\t\tlist_add_tail(&subdir->node.list, &dt->subdirs);\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tDPAA_BUS_LOG(DEBUG, \"Ignoring invalid dt entry %s/%s\",\n+\t\t\t\t     dt->node.node.full_name, d[loop]->d_name);\n+\t\t}\n+\t}\n+\treturn 0;\n+}\n+\n+static int\n+process_dir(const char *relative_path, struct dt_dir *dt)\n+{\n+\tstruct dirent **d;\n+\tint ret, num;\n+\n+\tdt->node.is_file = 0;\n+\tINIT_LIST_HEAD(&dt->subdirs);\n+\tINIT_LIST_HEAD(&dt->files);\n+\tret = of_open_dir(relative_path, &d);\n+\tif (ret < 0)\n+\t\treturn ret;\n+\tnum = ret;\n+\tret = iterate_dir(d, num, dt);\n+\tof_close_dir(d, num);\n+\treturn (ret < 0) ? ret : 0;\n+}\n+\n+static void\n+linear_dir(struct dt_dir *d)\n+{\n+\tstruct dt_file *f;\n+\tstruct dt_dir *dd;\n+\n+\td->compatible = NULL;\n+\td->status = NULL;\n+\td->lphandle = NULL;\n+\td->a_cells = NULL;\n+\td->s_cells = NULL;\n+\td->reg = NULL;\n+\tlist_for_each_entry(f, &d->files, node.list) {\n+\t\tif (!strcmp(f->node.node.name, \"compatible\")) {\n+\t\t\tif (d->compatible)\n+\t\t\t\tDPAA_BUS_LOG(DEBUG, \"Duplicate compatible in\"\n+\t\t\t\t\t     \" %s\", d->node.node.full_name);\n+\t\t\td->compatible = f;\n+\t\t} else if (!strcmp(f->node.node.name, \"status\")) {\n+\t\t\tif (d->status)\n+\t\t\t\tDPAA_BUS_LOG(DEBUG, \"Duplicate status in %s\",\n+\t\t\t\t\t     d->node.node.full_name);\n+\t\t\td->status = f;\n+\t\t} else if (!strcmp(f->node.node.name, \"linux,phandle\")) {\n+\t\t\tif (d->lphandle)\n+\t\t\t\tDPAA_BUS_LOG(DEBUG, \"Duplicate lphandle in %s\",\n+\t\t\t\t\t     d->node.node.full_name);\n+\t\t\td->lphandle = f;\n+\t\t} else if (!strcmp(f->node.node.name, \"#address-cells\")) {\n+\t\t\tif (d->a_cells)\n+\t\t\t\tDPAA_BUS_LOG(DEBUG, \"Duplicate a_cells in %s\",\n+\t\t\t\t\t     d->node.node.full_name);\n+\t\t\td->a_cells = f;\n+\t\t} else if (!strcmp(f->node.node.name, \"#size-cells\")) {\n+\t\t\tif (d->s_cells)\n+\t\t\t\tDPAA_BUS_LOG(DEBUG, \"Duplicate s_cells in %s\",\n+\t\t\t\t\t     d->node.node.full_name);\n+\t\t\td->s_cells = f;\n+\t\t} else if (!strcmp(f->node.node.name, \"reg\")) {\n+\t\t\tif (d->reg)\n+\t\t\t\tDPAA_BUS_LOG(DEBUG, \"Duplicate reg in %s\",\n+\t\t\t\t\t     d->node.node.full_name);\n+\t\t\td->reg = f;\n+\t\t}\n+\t}\n+\n+\tlist_for_each_entry(dd, &d->subdirs, node.list) {\n+\t\tlist_add_tail(&dd->linear, &linear);\n+\t\tlinear_dir(dd);\n+\t}\n+}\n+\n+int\n+of_init_path(const char *dt_path)\n+{\n+\tint ret;\n+\n+\tbase_dir = dt_path;\n+\n+\t/* This needs to be singleton initialization */\n+\tDPAA_BUS_WARN(alive, \"Double-init of device-tree driver!\");\n+\n+\t/* Prepare root node (the remaining fields are set in process_dir()) */\n+\troot_dir.node.node.name[0] = '\\0';\n+\troot_dir.node.node.full_name[0] = '\\0';\n+\tINIT_LIST_HEAD(&root_dir.node.list);\n+\troot_dir.parent = NULL;\n+\n+\t/* Kick things off... */\n+\tret = process_dir(\"\", &root_dir);\n+\tif (ret) {\n+\t\tDPAA_BUS_LOG(ERR, \"Unable to parse device tree\");\n+\t\treturn ret;\n+\t}\n+\n+\t/* Now make a flat, linear list of directories */\n+\tlinear_dir(&root_dir);\n+\talive = 1;\n+\treturn 0;\n+}\n+\n+static void\n+destroy_dir(struct dt_dir *d)\n+{\n+\tstruct dt_file *f, *tmpf;\n+\tstruct dt_dir *dd, *tmpd;\n+\n+\tlist_for_each_entry_safe(f, tmpf, &d->files, node.list) {\n+\t\tlist_del(&f->node.list);\n+\t\tfree(f);\n+\t}\n+\tlist_for_each_entry_safe(dd, tmpd, &d->subdirs, node.list) {\n+\t\tdestroy_dir(dd);\n+\t\tlist_del(&dd->node.list);\n+\t\tfree(dd);\n+\t}\n+}\n+\n+void\n+of_finish(void)\n+{\n+\tDPAA_BUS_WARN(!alive, \"Double-finish of device-tree driver!\");\n+\n+\tdestroy_dir(&root_dir);\n+\tINIT_LIST_HEAD(&linear);\n+\talive = 0;\n+}\n+\n+static const struct dt_dir *\n+next_linear(const struct dt_dir *f)\n+{\n+\tif (f->linear.next == &linear)\n+\t\treturn NULL;\n+\treturn list_entry(f->linear.next, struct dt_dir, linear);\n+}\n+\n+static int\n+check_compatible(const struct dt_file *f, const char *compatible)\n+{\n+\tconst char *c = (char *)f->buf;\n+\tunsigned int len, remains = f->len;\n+\n+\twhile (remains) {\n+\t\tlen = strlen(c);\n+\t\tif (!strcmp(c, compatible))\n+\t\t\treturn 1;\n+\n+\t\tif (remains < len + 1)\n+\t\t\tbreak;\n+\n+\t\tc += (len + 1);\n+\t\tremains -= (len + 1);\n+\t}\n+\treturn 0;\n+}\n+\n+const struct device_node *\n+of_find_compatible_node(const struct device_node *from,\n+\t\t\tconst char *type __always_unused,\n+\t\t\tconst char *compatible)\n+{\n+\tconst struct dt_dir *d;\n+\n+\tDPAA_BUS_WARN(!alive, \"Device-tree driver not initialised!\");\n+\n+\tif (list_empty(&linear))\n+\t\treturn NULL;\n+\tif (!from)\n+\t\td = list_entry(linear.next, struct dt_dir, linear);\n+\telse\n+\t\td = node2dir(from);\n+\tfor (d = next_linear(d); d && (!d->compatible ||\n+\t\t\t\t       !check_compatible(d->compatible,\n+\t\t\t\t       compatible));\n+\t\t\td = next_linear(d))\n+\t\t;\n+\tif (d)\n+\t\treturn &d->node.node;\n+\treturn NULL;\n+}\n+\n+const void *\n+of_get_property(const struct device_node *from, const char *name,\n+\t\tsize_t *lenp)\n+{\n+\tconst struct dt_dir *d;\n+\tconst struct dt_file *f;\n+\n+\tDPAA_BUS_WARN(!alive, \"Device-tree driver not initialised!\");\n+\n+\td = node2dir(from);\n+\tlist_for_each_entry(f, &d->files, node.list)\n+\t\tif (!strcmp(f->node.node.name, name)) {\n+\t\t\tif (lenp)\n+\t\t\t\t*lenp = f->len;\n+\t\t\treturn f->buf;\n+\t\t}\n+\treturn NULL;\n+}\n+\n+bool\n+of_device_is_available(const struct device_node *dev_node)\n+{\n+\tconst struct dt_dir *d;\n+\n+\tDPAA_BUS_WARN(!alive, \"Device-tree driver not initialised!\");\n+\td = node2dir(dev_node);\n+\tif (!d->status)\n+\t\treturn true;\n+\tif (!strcmp((char *)d->status->buf, \"okay\"))\n+\t\treturn true;\n+\tif (!strcmp((char *)d->status->buf, \"ok\"))\n+\t\treturn true;\n+\treturn false;\n+}\n+\n+const struct device_node *\n+of_find_node_by_phandle(phandle ph)\n+{\n+\tconst struct dt_dir *d;\n+\n+\tDPAA_BUS_WARN(!alive, \"Device-tree driver not initialised!\");\n+\tlist_for_each_entry(d, &linear, linear)\n+\t\tif (d->lphandle && (d->lphandle->len == 4) &&\n+\t\t    !memcmp(d->lphandle->buf, &ph, 4))\n+\t\t\treturn &d->node.node;\n+\treturn NULL;\n+}\n+\n+const struct device_node *\n+of_get_parent(const struct device_node *dev_node)\n+{\n+\tconst struct dt_dir *d;\n+\n+\tDPAA_BUS_WARN(!alive, \"Device-tree driver not initialised!\");\n+\n+\tif (!dev_node)\n+\t\treturn NULL;\n+\td = node2dir(dev_node);\n+\tif (!d->parent)\n+\t\treturn NULL;\n+\treturn &d->parent->node.node;\n+}\n+\n+const struct device_node *\n+of_get_next_child(const struct device_node *dev_node,\n+\t\t  const struct device_node *prev)\n+{\n+\tconst struct dt_dir *p, *c;\n+\n+\tDPAA_BUS_WARN(!alive, \"Device-tree driver not initialised!\");\n+\n+\tif (!dev_node)\n+\t\treturn NULL;\n+\tp = node2dir(dev_node);\n+\tif (prev) {\n+\t\tc = node2dir(prev);\n+\t\tDPAA_BUS_WARN((c->parent != p), \"Parent/child mismatch\");\n+\t\tif (c->parent != p)\n+\t\t\treturn NULL;\n+\t\tif (c->node.list.next == &p->subdirs)\n+\t\t\t/* prev was the last child */\n+\t\t\treturn NULL;\n+\t\tc = list_entry(c->node.list.next, struct dt_dir, node.list);\n+\t\treturn &c->node.node;\n+\t}\n+\t/* Return first child */\n+\tif (list_empty(&p->subdirs))\n+\t\treturn NULL;\n+\tc = list_entry(p->subdirs.next, struct dt_dir, node.list);\n+\treturn &c->node.node;\n+}\n+\n+uint32_t\n+of_n_addr_cells(const struct device_node *dev_node)\n+{\n+\tconst struct dt_dir *d;\n+\n+\tDPAA_BUS_WARN(!alive, \"Device-tree driver not initialised\");\n+\tif (!dev_node)\n+\t\treturn OF_DEFAULT_NA;\n+\td = node2dir(dev_node);\n+\twhile ((d = d->parent))\n+\t\tif (d->a_cells) {\n+\t\t\tunsigned char *buf =\n+\t\t\t\t(unsigned char *)&d->a_cells->buf[0];\n+\t\t\tassert(d->a_cells->len == 4);\n+\t\t\treturn ((uint32_t)buf[0] << 24) |\n+\t\t\t\t((uint32_t)buf[1] << 16) |\n+\t\t\t\t((uint32_t)buf[2] << 8) |\n+\t\t\t\t(uint32_t)buf[3];\n+\t\t}\n+\treturn OF_DEFAULT_NA;\n+}\n+\n+uint32_t\n+of_n_size_cells(const struct device_node *dev_node)\n+{\n+\tconst struct dt_dir *d;\n+\n+\tDPAA_BUS_WARN(!alive, \"Device-tree driver not initialised!\");\n+\tif (!dev_node)\n+\t\treturn OF_DEFAULT_NA;\n+\td = node2dir(dev_node);\n+\twhile ((d = d->parent))\n+\t\tif (d->s_cells) {\n+\t\t\tunsigned char *buf =\n+\t\t\t\t(unsigned char *)&d->s_cells->buf[0];\n+\t\t\tassert(d->s_cells->len == 4);\n+\t\t\treturn ((uint32_t)buf[0] << 24) |\n+\t\t\t\t((uint32_t)buf[1] << 16) |\n+\t\t\t\t((uint32_t)buf[2] << 8) |\n+\t\t\t\t(uint32_t)buf[3];\n+\t\t}\n+\treturn OF_DEFAULT_NS;\n+}\n+\n+const uint32_t *\n+of_get_address(const struct device_node *dev_node, size_t idx,\n+\t       uint64_t *size, uint32_t *flags __rte_unused)\n+{\n+\tconst struct dt_dir *d;\n+\tconst unsigned char *buf;\n+\tuint32_t na = of_n_addr_cells(dev_node);\n+\tuint32_t ns = of_n_size_cells(dev_node);\n+\n+\tif (!dev_node)\n+\t\td = &root_dir;\n+\telse\n+\t\td = node2dir(dev_node);\n+\tif (!d->reg)\n+\t\treturn NULL;\n+\tassert(d->reg->len % ((na + ns) * 4) == 0);\n+\tassert(d->reg->len / ((na + ns) * 4) > (unsigned int) idx);\n+\tbuf = (const unsigned char *)&d->reg->buf[0];\n+\tbuf += (na + ns) * idx * 4;\n+\tif (size)\n+\t\tfor (*size = 0; ns > 0; ns--, na++)\n+\t\t\t*size = (*size << 32) +\n+\t\t\t\t(((uint32_t)buf[4 * na] << 24) |\n+\t\t\t\t((uint32_t)buf[4 * na + 1] << 16) |\n+\t\t\t\t((uint32_t)buf[4 * na + 2] << 8) |\n+\t\t\t\t(uint32_t)buf[4 * na + 3]);\n+\treturn (const uint32_t *)buf;\n+}\n+\n+uint64_t\n+of_translate_address(const struct device_node *dev_node,\n+\t\t     const uint32_t *addr)\n+{\n+\tuint64_t phys_addr, tmp_addr;\n+\tconst struct device_node *parent;\n+\tconst uint32_t *ranges;\n+\tsize_t rlen;\n+\tuint32_t na, pna;\n+\n+\tDPAA_BUS_WARN(!alive, \"Device-tree driver not initialised!\");\n+\tassert(dev_node != NULL);\n+\n+\tna = of_n_addr_cells(dev_node);\n+\tphys_addr = of_read_number(addr, na);\n+\n+\tdev_node = of_get_parent(dev_node);\n+\tif (!dev_node)\n+\t\treturn 0;\n+\telse if (node2dir(dev_node) == &root_dir)\n+\t\treturn phys_addr;\n+\n+\tdo {\n+\t\tpna = of_n_addr_cells(dev_node);\n+\t\tparent = of_get_parent(dev_node);\n+\t\tif (!parent)\n+\t\t\treturn 0;\n+\n+\t\tranges = of_get_property(dev_node, \"ranges\", &rlen);\n+\t\t/* \"ranges\" property is missing. Translation breaks */\n+\t\tif (!ranges)\n+\t\t\treturn 0;\n+\t\t/* \"ranges\" property is empty. Do 1:1 translation */\n+\t\telse if (rlen == 0)\n+\t\t\tcontinue;\n+\t\telse\n+\t\t\ttmp_addr = of_read_number(ranges + na, pna);\n+\n+\t\tna = pna;\n+\t\tdev_node = parent;\n+\t\tphys_addr += tmp_addr;\n+\t} while (node2dir(parent) != &root_dir);\n+\n+\treturn phys_addr;\n+}\n+\n+bool\n+of_device_is_compatible(const struct device_node *dev_node,\n+\t\t\tconst char *compatible)\n+{\n+\tconst struct dt_dir *d;\n+\n+\tDPAA_BUS_WARN(!alive, \"Device-tree driver not initialised!\");\n+\tif (!dev_node)\n+\t\td = &root_dir;\n+\telse\n+\t\td = node2dir(dev_node);\n+\tif (d->compatible && check_compatible(d->compatible, compatible))\n+\t\treturn true;\n+\treturn false;\n+}\ndiff --git a/drivers/bus/dpaa/include/of.h b/drivers/bus/dpaa/include/of.h\nnew file mode 100644\nindex 0000000..e422a53\n--- /dev/null\n+++ b/drivers/bus/dpaa/include/of.h\n@@ -0,0 +1,191 @@\n+/*-\n+ * This file is provided under a dual BSD/GPLv2 license. When using or\n+ * redistributing this file, you may do so under either license.\n+ *\n+ *   BSD LICENSE\n+ *\n+ * Copyright 2010-2016 Freescale Semiconductor, Inc.\n+ * Copyright 2017 NXP.\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in the\n+ * documentation and/or other materials provided with the distribution.\n+ * * Neither the name of the above-listed copyright holders nor the\n+ * names of any contributors may be used to endorse or promote products\n+ * derived from this software without specific prior written permission.\n+ *\n+ *   GPL LICENSE SUMMARY\n+ *\n+ * ALTERNATIVELY, this software may be distributed under the terms of the\n+ * GNU General Public License (\"GPL\") as published by the Free Software\n+ * Foundation, either version 2 of that License or (at your option) any\n+ * later version.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ * POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#ifndef __OF_H\n+#define\t__OF_H\n+\n+#include <compat.h>\n+\n+#ifndef OF_INIT_DEFAULT_PATH\n+#define OF_INIT_DEFAULT_PATH \"/proc/device-tree\"\n+#endif\n+\n+#define OF_DEFAULT_NA 1\n+#define OF_DEFAULT_NS 1\n+\n+#define OF_FILE_BUF_MAX 256\n+\n+/**\n+ * Layout of Device Tree:\n+ * dt_dir\n+ *  |- dt_dir\n+ *  |   |- dt_dir\n+ *  |   |  |- dt_dir\n+ *  |   |  |  |- dt_file\n+ *  |   |  |  ``- dt_file\n+ *  |   |  ``- dt_file\n+ *  |   `-dt_file`\n+ *  ``- dt_file\n+ *\n+ *  +------------------+\n+ *  |dt_dir            |\n+ *  |+----------------+|\n+ *  ||dt_node         ||\n+ *  ||+--------------+||\n+ *  |||device_node   |||\n+ *  ||+--------------+||\n+ *  || list_dt_nodes  ||\n+ *  |+----------------+|\n+ *  | list of subdir   |\n+ *  | list of files    |\n+ *  +------------------+\n+ */\n+\n+/**\n+ * Device description on of a device node in device tree.\n+ */\n+struct device_node {\n+\tchar name[NAME_MAX];\n+\tchar full_name[PATH_MAX];\n+};\n+\n+/**\n+ * List of device nodes available in a device tree layout\n+ */\n+struct dt_node {\n+\tstruct device_node node; /**< Property of node */\n+\tint is_file; /**< FALSE==dir, TRUE==file */\n+\tstruct list_head list; /**< Nodes within a parent subdir */\n+};\n+\n+/**\n+ * Types we use to represent directories and files\n+ */\n+struct dt_file;\n+struct dt_dir {\n+\tstruct dt_node node;\n+\tstruct list_head subdirs;\n+\tstruct list_head files;\n+\tstruct list_head linear;\n+\tstruct dt_dir *parent;\n+\tstruct dt_file *compatible;\n+\tstruct dt_file *status;\n+\tstruct dt_file *lphandle;\n+\tstruct dt_file *a_cells;\n+\tstruct dt_file *s_cells;\n+\tstruct dt_file *reg;\n+};\n+\n+struct dt_file {\n+\tstruct dt_node node;\n+\tstruct dt_dir *parent;\n+\tssize_t len;\n+\tuint64_t buf[OF_FILE_BUF_MAX >> 3]; /** ASDF: Why? */\n+};\n+\n+const struct device_node *of_find_compatible_node(\n+\t\t\t\t\tconst struct device_node *from,\n+\t\t\t\t\tconst char *type __always_unused,\n+\t\t\t\t\tconst char *compatible)\n+\t__attribute__((nonnull(3)));\n+\n+#define for_each_compatible_node(dev_node, type, compatible) \\\n+\tfor (dev_node = of_find_compatible_node(NULL, type, compatible); \\\n+\t\tdev_node != NULL; \\\n+\t\tdev_node = of_find_compatible_node(dev_node, type, compatible))\n+\n+const void *of_get_property(const struct device_node *from, const char *name,\n+\t\t\t    size_t *lenp) __attribute__((nonnull(2)));\n+bool of_device_is_available(const struct device_node *dev_node);\n+\n+const struct device_node *of_find_node_by_phandle(phandle ph);\n+\n+const struct device_node *of_get_parent(const struct device_node *dev_node);\n+\n+const struct device_node *of_get_next_child(const struct device_node *dev_node,\n+\t\t\t\t\t    const struct device_node *prev);\n+\n+#define for_each_child_node(parent, child) \\\n+\tfor (child = of_get_next_child(parent, NULL); child != NULL; \\\n+\t\t\tchild = of_get_next_child(parent, child))\n+\n+uint32_t of_n_addr_cells(const struct device_node *dev_node);\n+uint32_t of_n_size_cells(const struct device_node *dev_node);\n+\n+const uint32_t *of_get_address(const struct device_node *dev_node, size_t idx,\n+\t\t\t       uint64_t *size, uint32_t *flags);\n+\n+uint64_t of_translate_address(const struct device_node *dev_node,\n+\t\t\t      const u32 *addr) __attribute__((nonnull));\n+\n+bool of_device_is_compatible(const struct device_node *dev_node,\n+\t\t\t     const char *compatible);\n+\n+/* of_init() must be called prior to initialisation or use of any driver\n+ * subsystem that is device-tree-dependent. Eg. Qman/Bman, config layers, etc.\n+ * The path should usually be \"/proc/device-tree\".\n+ */\n+int of_init_path(const char *dt_path);\n+\n+/* of_finish() allows a controlled tear-down of the device-tree layer, eg. if a\n+ * full reload is desired without a process exit.\n+ */\n+void of_finish(void);\n+\n+/* Use of this wrapper is recommended. */\n+static inline int of_init(void)\n+{\n+\treturn of_init_path(OF_INIT_DEFAULT_PATH);\n+}\n+\n+/* Read a numeric property according to its size and return it as a 64-bit\n+ * value.\n+ */\n+static inline uint64_t of_read_number(const __be32 *cell, int size)\n+{\n+\tuint64_t r = 0;\n+\n+\twhile (size--)\n+\t\tr = (r << 32) | be32toh(*(cell++));\n+\treturn r;\n+}\n+\n+#endif\t/*  __OF_H */\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "04/40"
    ]
}