get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2218595,
    "url": "http://patchwork.ozlabs.org/api/patches/2218595/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260401-casey-ccf-compat-v2-4-414d5b7f040b@linaro.org/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api",
        "name": "U-Boot",
        "link_name": "uboot",
        "list_id": "u-boot.lists.denx.de",
        "list_email": "u-boot@lists.denx.de",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260401-casey-ccf-compat-v2-4-414d5b7f040b@linaro.org>",
    "list_archive_url": null,
    "date": "2026-04-01T14:15:20",
    "name": "[v2,04/11] ofnode: add read_u64_array and count_elems_of_size",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "389c6ffaf05c9c1fd235eac63f370d0ea52727a4",
    "submitter": {
        "id": 90679,
        "url": "http://patchwork.ozlabs.org/api/people/90679/?format=api",
        "name": "Casey Connolly",
        "email": "casey.connolly@linaro.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260401-casey-ccf-compat-v2-4-414d5b7f040b@linaro.org/mbox/",
    "series": [
        {
            "id": 498341,
            "url": "http://patchwork.ozlabs.org/api/series/498341/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=498341",
            "date": "2026-04-01T14:15:17",
            "name": "Linux compat improvements and CCF prep",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/498341/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2218595/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2218595/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=wVqYASCT;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)",
            "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linaro.org",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de",
            "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.b=\"wVqYASCT\";\n\tdkim-atps=neutral",
            "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linaro.org",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=casey.connolly@linaro.org"
        ],
        "Received": [
            "from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fm6V30P4qz1yCp\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 02 Apr 2026 01:16:11 +1100 (AEDT)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 64368840ED;\n\tWed,  1 Apr 2026 16:15:33 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 1E36F840D8; Wed,  1 Apr 2026 16:15:32 +0200 (CEST)",
            "from mail-wm1-x332.google.com (mail-wm1-x332.google.com\n [IPv6:2a00:1450:4864:20::332])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id D63D683CE3\n for <u-boot@lists.denx.de>; Wed,  1 Apr 2026 16:15:29 +0200 (CEST)",
            "by mail-wm1-x332.google.com with SMTP id\n 5b1f17b1804b1-486fb14227cso92209145e9.3\n for <u-boot@lists.denx.de>; Wed, 01 Apr 2026 07:15:29 -0700 (PDT)",
            "from lion.localdomain (p4fc3dd86.dip0.t-ipconnect.de.\n [79.195.221.134]) by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-4887c8bcaf8sm43224135e9.27.2026.04.01.07.15.27\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 01 Apr 2026 07:15:28 -0700 (PDT)"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1775052929; x=1775657729; darn=lists.denx.de;\n h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n :mime-version:subject:date:from:from:to:cc:subject:date:message-id\n :reply-to; bh=ygNuSeQGX7Q2b/F+EBUD44n+zE24EFeQxx8wjWtK2jE=;\n b=wVqYASCTv5IrDAe6uA7iA8RTCtGD42hJldrAQDa/iXgEKN6sfoKjw9kd0fzhM5aFQa\n spjsSym0G91HzVeTGrzKdLIsjerb6R2OsLqkc604ddojRfx/VssOlGIpsS0J7uD31E8y\n aqKT/mb+A9gBwaI1O7v0nAgNpH6Hbk63lMpW37al7HVaIr3QIuok1cJUplHiXgeXMbzf\n Hc2d/0q8WqyswJRUFsOLVCAGkPNG4xgbJkI/cls2Sh4W4dU9rxGoVGHWVI6nTx9XU2ou\n iuK7r+2IjRw3JHVptFWIli/p4KzOMgOvtdWaAUzZZLsn92cIdt40VcZ2dHdxX2d9zwHI\n OegA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775052929; x=1775657729;\n h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to\n :cc:subject:date:message-id:reply-to;\n bh=ygNuSeQGX7Q2b/F+EBUD44n+zE24EFeQxx8wjWtK2jE=;\n b=Xtc8sx80GDuFePIz+GxY4Y2YfHzbvudEdtll4Vu9Ap6zEdO9URJvBchvhHoD6Kro78\n VktF78J1p19kVaoD4lB0WJWEQFBZh4UwguDP77aR6Jzgp1fGTiJdCVinSeuuSqsIKL0T\n nqpS/j1oVOviiztpfWuP9Mu8NCRa8hTcGE5XZtrZZGOWFSO2k1RJwUDcKdvUsBJrqvWu\n a9KZPMcVvUUk+AaUMR7w9ALjwjnEYHxSb6bjRwb0PKwgyNUNHg9A2Ryhkmk3pYSKltH+\n Ic3awvn0DIXSMoQeuZ2f0zSqiiVOOG/yxgQjqh3Hy+qtHOuKMtx0vX7C+ffl/yPd5dMJ\n uPCg==",
        "X-Gm-Message-State": "AOJu0YzXboqmUo+28v12AuP9hrb/o1vxjZmO1FaaMqT+fGnmjUHiVsS1\n OvPtYxhqCv1zrFHQuxsB/Wxjn4TiXvsOiFh3M0K68qDjFQgE7s3aiPMubxQDlSDL35Y=",
        "X-Gm-Gg": "ATEYQzxAcxuEE7Egzx/UVhKMGDwKnFB0TG6QF6ksnnjU5buzuRXwcvPN15SMw7gF/ni\n n5leZgHcim2THkKVNYPrC2gR3nsaWQZtjKpUyG3gXYmKJfXyuiuECsP3vHEb8FzU6NaNtnWSvTC\n nYh/9vBT8iZexP1xDDe+cez3V0mevENCQt5NmgUa3lHzb2mlT646N27q9iByPzJ4FZy9lbqyihV\n yVMlQdSap9Cfub/LY3dso6v/OBNPveTt7i6gVk24h6S5x1TwOXz+zcjUzI8r+jCDu/QctNIh3gk\n npLYmOrvwRHru1gqllvQBsPjcN/Ab+nhz3QA7f1Gx7dtRiYv1fbCUjsTVBR5qJG5FsaybvxZNFw\n VR550YSSpSX8THp9MPjLPYdPsVUj3W+olUbWz7e7hc6x2y/jv/QLpS3GRcdqxxi+pwhuLvRE+jm\n DSK2q3pEoVr9t56QiWG0WMKK4Ii9NPTor6Fqb2H+NHeJpETKy+ggzSsmg1AuajhJ38DC3J",
        "X-Received": "by 2002:a05:600c:a406:b0:485:40fd:8390 with SMTP id\n 5b1f17b1804b1-488835ccc61mr50601585e9.26.1775052929182;\n Wed, 01 Apr 2026 07:15:29 -0700 (PDT)",
        "From": "Casey Connolly <casey.connolly@linaro.org>",
        "Date": "Wed, 01 Apr 2026 16:15:20 +0200",
        "Subject": "[PATCH v2 04/11] ofnode: add read_u64_array and\n count_elems_of_size",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "Message-Id": "<20260401-casey-ccf-compat-v2-4-414d5b7f040b@linaro.org>",
        "References": "<20260401-casey-ccf-compat-v2-0-414d5b7f040b@linaro.org>",
        "In-Reply-To": "<20260401-casey-ccf-compat-v2-0-414d5b7f040b@linaro.org>",
        "To": "u-boot@lists.denx.de",
        "Cc": "Tom Rini <trini@konsulko.com>,\n Casey Connolly <casey.connolly@linaro.org>,\n Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n Simon Glass <sjg@chromium.org>,\n Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,\n Romain Gantois <romain.gantois@bootlin.com>,\n Andrew Goodbody <andrew.goodbody@linaro.org>,\n Patrice Chotard <patrice.chotard@foss.st.com>,\n Raymond Mao <raymondmaoca@gmail.com>, Peng Fan <peng.fan@nxp.com>",
        "X-Mailer": "b4 0.15-dev-47773",
        "X-Developer-Signature": "v=1; a=openpgp-sha256; l=11186;\n i=casey.connolly@linaro.org; h=from:subject:message-id;\n bh=4U4486dk/kYnPVEPw0EBh1G48lAL739YPPX7748xid0=;\n b=owGbwMvMwCFYaeA6f6eBkTjjabUkhsyzGpX/zrJ/OBCzZe2KNMW6+TMqg6oV7Itt59wKTpQ6v\n +ro8iTZjlIWBkEOBlkxRRbxE8ssm9ZettfYvuACzBxWJpAhDFycAjARwTeMDAskhTwZt7c8ubBo\n UoyTpvy1rOvl+Ycmh/h0HfzOevn4HgdGhiWzzS6YWTw4tkXZdV5ua/uLK+FdmhXBKxrqNwgr5KZ\n kHQEA",
        "X-Developer-Key": "i=casey.connolly@linaro.org; a=openpgp;\n fpr=83B24DA7FE145076BC38BB250CD904EB673A7C47",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.39",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>",
        "List-Post": "<mailto:u-boot@lists.denx.de>",
        "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>",
        "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>",
        "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de",
        "X-Virus-Status": "Clean"
    },
    "content": "These are similar to their Linux counterparts, adding helpers\nfor reading arrays of 64-bit values with of_access and fdtdec\nimplementations.\n\nSigned-off-by: Casey Connolly <casey.connolly@linaro.org>\n---\n drivers/core/of_access.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++\n drivers/core/ofnode.c    | 48 ++++++++++++++++++++++++++++++++++++++++++++\n include/dm/of_access.h   | 20 +++++++++++++++++++\n include/dm/ofnode.h      | 50 ++++++++++++++++++++++++++++++++++++++++++++++\n include/fdtdec.h         | 16 +++++++++++++++\n lib/fdtdec.c             | 18 +++++++++++++++++\n 6 files changed, 204 insertions(+)",
    "diff": "diff --git a/drivers/core/of_access.c b/drivers/core/of_access.c\nindex b11e36202c15..969492aae37c 100644\n--- a/drivers/core/of_access.c\n+++ b/drivers/core/of_access.c\n@@ -597,8 +597,27 @@ int of_read_u64(const struct device_node *np, const char *propname, u64 *outp)\n {\n \treturn of_read_u64_index(np, propname, 0, outp);\n }\n \n+int of_read_u64_array(const struct device_node *np, const char *propname,\n+\t\t      u64 *out_values, size_t sz)\n+{\n+\tconst __be64 *val;\n+\n+\tlog_debug(\"%s: %s: \", __func__, propname);\n+\tval = of_find_property_value_of_size(np, propname,\n+\t\t\t\t\t     sz * sizeof(*out_values));\n+\n+\tif (IS_ERR(val))\n+\t\treturn PTR_ERR(val);\n+\n+\tlog_debug(\"size %zd\\n\", sz);\n+\twhile (sz--)\n+\t\t*out_values++ = be64_to_cpup(val++);\n+\n+\treturn 0;\n+}\n+\n int of_property_match_string(const struct device_node *np, const char *propname,\n \t\t\t     const char *string)\n {\n \tint len = 0;\n@@ -844,8 +863,41 @@ int of_count_phandle_with_args(const struct device_node *np,\n \treturn of_root_count_phandle_with_args(NULL, np, list_name, cells_name,\n \t\t\t\t\t       cell_count);\n }\n \n+/**\n+ * of_property_count_elems_of_size - Count the number of elements in a property\n+ *\n+ * @np:\t\tdevice node from which the property value is to be read.\n+ * @propname:\tname of the property to be searched.\n+ * @elem_size:\tsize of the individual element\n+ *\n+ * Search for a property in a device node and count the number of elements of\n+ * size elem_size in it.\n+ *\n+ * Return: The number of elements on sucess, -EINVAL if the property does not\n+ * exist or its length does not match a multiple of elem_size and -ENODATA if\n+ * the property does not have a value.\n+ */\n+int of_property_count_elems_of_size(const struct device_node *np,\n+\t\t\t\tconst char *propname, int elem_size)\n+{\n+\tconst struct property *prop = of_find_property(np, propname, NULL);\n+\n+\tif (!prop)\n+\t\treturn -EINVAL;\n+\tif (!prop->value)\n+\t\treturn -ENODATA;\n+\n+\tif (prop->length % elem_size != 0) {\n+\t\tpr_err(\"size of %s in node %pOF is not a multiple of %d\\n\",\n+\t\t       propname, np, elem_size);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn prop->length / elem_size;\n+}\n+\n static void of_alias_add(struct alias_prop *ap, struct device_node *np,\n \t\t\t int id, const char *stem, int stem_len)\n {\n \tap->np = np;\ndiff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c\nindex 3a36b6fdd031..d605c0f7b7c7 100644\n--- a/drivers/core/ofnode.c\n+++ b/drivers/core/ofnode.c\n@@ -663,8 +663,56 @@ int ofnode_read_u32_array(ofnode node, const char *propname,\n \t\treturn ret;\n \t}\n }\n \n+int ofnode_read_u64_array(ofnode node, const char *propname,\n+\t\t\t  u64 *out_values, size_t sz)\n+{\n+\tassert(ofnode_valid(node));\n+\tlog_debug(\"%s: %s: \", __func__, propname);\n+\n+\tif (ofnode_is_np(node)) {\n+\t\treturn of_read_u64_array(ofnode_to_np(node), propname,\n+\t\t\t\t\t out_values, sz);\n+\t} else {\n+\t\tint ret;\n+\n+\t\tret = fdtdec_get_long_array(ofnode_to_fdt(node),\n+\t\t\t\t\t   ofnode_to_offset(node), propname,\n+\t\t\t\t\t   out_values, sz);\n+\n+\t\t/* get the error right, but space is more important in SPL */\n+\t\tif (!IS_ENABLED(CONFIG_XPL_BUILD)) {\n+\t\t\tif (ret == -FDT_ERR_NOTFOUND)\n+\t\t\t\treturn -EINVAL;\n+\t\t\telse if (ret == -FDT_ERR_BADLAYOUT)\n+\t\t\t\treturn -EOVERFLOW;\n+\t\t}\n+\t\treturn ret;\n+\t}\n+}\n+\n+int ofnode_count_elems_of_size(ofnode node, const char *propname, int elem_size)\n+{\n+\tconst char *prop;\n+\tint len;\n+\tassert(ofnode_valid(node));\n+\n+\tif (ofnode_is_np(node)) {\n+\t\treturn of_property_count_elems_of_size(node.np, propname, elem_size);\n+\t} else {\n+\t\tprop = fdt_getprop(ofnode_to_fdt(node), ofnode_to_offset(node), propname, &len);\n+\t\tif (!prop)\n+\t\t\treturn -ENOENT;\n+\t\tif (len % elem_size != 0) {\n+\t\t\tlog_debug(\"size of %s in node %pOF is not a multiple of %d\\n\",\n+\t\t\t       propname, &node, elem_size);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t\treturn len / elem_size;\n+\t}\n+}\n+\n #if !CONFIG_IS_ENABLED(DM_INLINE_OFNODE)\n bool ofnode_is_enabled(ofnode node)\n {\n \tif (ofnode_is_np(node)) {\ndiff --git a/include/dm/of_access.h b/include/dm/of_access.h\nindex 44143a5a3917..fe0de73d7e25 100644\n--- a/include/dm/of_access.h\n+++ b/include/dm/of_access.h\n@@ -384,8 +384,25 @@ int of_read_u64(const struct device_node *np, const char *propname, u64 *outp);\n  */\n int of_read_u32_array(const struct device_node *np, const char *propname,\n \t\t      u32 *out_values, size_t sz);\n \n+/**\n+ * of_read_u64_array() - Find and read an array of 64 bit integers\n+ *\n+ * Search for a property in a device node and read 64-bit value(s) from\n+ * it.\n+ *\n+ * @np:\t\tdevice node from which the property value is to be read.\n+ * @propname:\tname of the property to be searched.\n+ * @out_values:\tpointer to return value, modified only if return value is 0.\n+ * @sz:\t\tnumber of array elements to read\n+ * Return:\n+ *   0 on success, -EINVAL if the property does not exist, or -EOVERFLOW if\n+ *   longer than sz.\n+ */\n+int of_read_u64_array(const struct device_node *np, const char *propname,\n+\t\t      u64 *out_values, size_t sz);\n+\n /**\n  * of_property_match_string() - Find string in a list and return index\n  *\n  * This function searches a string list property and returns the index\n@@ -615,8 +632,11 @@ int of_parse_phandle_with_args(const struct device_node *np,\n int of_count_phandle_with_args(const struct device_node *np,\n \t\t\t       const char *list_name, const char *cells_name,\n \t\t\t       int cells_count);\n \n+int of_property_count_elems_of_size(const struct device_node *np,\n+\t\t\t\tconst char *propname, int elem_size);\n+\n /**\n  * of_alias_scan() - Scan all properties of the 'aliases' node\n  *\n  * The function scans all the properties of the 'aliases' node and populates\ndiff --git a/include/dm/ofnode.h b/include/dm/ofnode.h\nindex 120393426dbf..c905e86b2835 100644\n--- a/include/dm/ofnode.h\n+++ b/include/dm/ofnode.h\n@@ -374,8 +374,15 @@ static inline oftree oftree_from_np(struct device_node *root)\n \n \treturn tree;\n }\n \n+/* Dummy put for Linux compat */\n+static inline void ofnode_put(ofnode node)\n+{\n+\tif (ofnode_is_np(node))\n+\t\tof_node_put(node.np);\n+}\n+\n /**\n  * oftree_dispose() - Dispose of an oftree\n  *\n  * This can be used to dispose of a tree that has been created (other than\n@@ -587,8 +594,27 @@ const char *ofnode_read_string(ofnode node, const char *propname);\n  */\n int ofnode_read_u32_array(ofnode node, const char *propname,\n \t\t\t  u32 *out_values, size_t sz);\n \n+/**\n+ * ofnode_read_u64_array() - Find and read an array of 64 bit integers\n+ *\n+ * @node:\tvalid node reference to read property from\n+ * @propname:\tname of the property to read\n+ * @out_values:\tpointer to return value, modified only if return value is 0\n+ * @sz:\t\tnumber of array elements to read\n+ * Return: 0 on success, -EINVAL if the property does not exist,\n+ * -ENODATA if property does not have a value, and -EOVERFLOW if the\n+ * property data isn't large enough\n+ *\n+ * Search for a property in a device node and read 64-bit value(s) from\n+ * it.\n+ *\n+ * The out_values is modified only if a valid u64 value can be decoded.\n+ */\n+int ofnode_read_u64_array(ofnode node, const char *propname,\n+\t\t\t  u64 *out_values, size_t sz);\n+\n /**\n  * ofnode_read_bool() - read a boolean value from a property\n  *\n  * @node:\tvalid node reference to read property from\n@@ -651,8 +677,32 @@ static inline ofnode ofnode_next_subnode(ofnode node)\n \treturn offset_to_ofnode(\n \t\tfdt_next_subnode(gd->fdt_blob, ofnode_to_offset(node)));\n }\n #else\n+\n+/**\n+ * ofnode_count_elems_of_size() - count the number of elements of size @elem_size\n+ * in the property @propname.\n+ *\n+ * @node: ofnode to check\n+ * @propname: the name of the property to count\n+ * @elem_size: the size of each element\n+ *\n+ * Returns: the number of elements or -EINVAL if the property size is not a\n+ * multiple of elem_size.\n+ */\n+int ofnode_count_elems_of_size(ofnode node, const char *propname, int elem_size);\n+\n+static inline int ofnode_count_u32_elems(ofnode node, const char *propname)\n+{\n+\treturn ofnode_count_elems_of_size(node, propname, 4);\n+}\n+\n+static inline int ofnode_count_u64_elems(ofnode node, const char *propname)\n+{\n+\treturn ofnode_count_elems_of_size(node, propname, 8);\n+}\n+\n /**\n  * ofnode_is_enabled() - Checks whether a node is enabled.\n  * This looks for a 'status' property. If this exists, then returns true if\n  * the status is 'okay' and false otherwise. If there is no status property,\ndiff --git a/include/fdtdec.h b/include/fdtdec.h\nindex d9fcd037ed26..3d199e56b031 100644\n--- a/include/fdtdec.h\n+++ b/include/fdtdec.h\n@@ -699,8 +699,24 @@ int fdtdec_lookup_phandle(const void *blob, int node, const char *prop_name);\n  */\n int fdtdec_get_int_array(const void *blob, int node, const char *prop_name,\n \t\tu32 *array, int count);\n \n+/**\n+ * Look up a property in a node and return its contents in a u64\n+ * array of given length. The property must have at least enough data for\n+ * the array (8*count bytes). It may have more, but this will be ignored.\n+ *\n+ * @param blob\t\tFDT blob\n+ * @param node\t\tnode to examine\n+ * @param prop_name\tname of property to find\n+ * @param array\t\tarray to fill with data\n+ * @param count\t\tnumber of array elements\n+ * Return: 0 if ok, or -FDT_ERR_NOTFOUND if the property is not found,\n+ *\t\tor -FDT_ERR_BADLAYOUT if not enough data\n+ */\n+int fdtdec_get_long_array(const void *blob, int node, const char *prop_name,\n+\t\tu64 *array, int count);\n+\n /**\n  * Look up a property in a node and return its contents in an integer\n  * array of given length. The property must exist but may have less data that\n  * expected (4*count bytes). It may have more, but this will be ignored.\ndiff --git a/lib/fdtdec.c b/lib/fdtdec.c\nindex c38738b48c79..e23e53f58f24 100644\n--- a/lib/fdtdec.c\n+++ b/lib/fdtdec.c\n@@ -713,8 +713,26 @@ int fdtdec_get_int_array(const void *blob, int node, const char *prop_name,\n \t}\n \treturn err;\n }\n \n+int fdtdec_get_long_array(const void *blob, int node, const char *prop_name,\n+\t\t\t u64 *array, int count)\n+{\n+\tconst u64 *cell;\n+\tint err = 0;\n+\n+\tdebug(\"%s: %s\\n\", __func__, prop_name);\n+\tcell = get_prop_check_min_len(blob, node, prop_name,\n+\t\t\t\t      sizeof(u64) * count, &err);\n+\tif (!err) {\n+\t\tint i;\n+\n+\t\tfor (i = 0; i < count; i++)\n+\t\t\tarray[i] = fdt64_to_cpu(cell[i]);\n+\t}\n+\treturn err;\n+}\n+\n int fdtdec_get_int_array_count(const void *blob, int node,\n \t\t\t       const char *prop_name, u32 *array, int count)\n {\n \tconst u32 *cell;\n",
    "prefixes": [
        "v2",
        "04/11"
    ]
}