Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1444199/?format=api
{ "id": 1444199, "url": "http://patchwork.ozlabs.org/api/patches/1444199/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/1614244979-48216-4-git-send-email-bmeng.cn@gmail.com/", "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": "<1614244979-48216-4-git-send-email-bmeng.cn@gmail.com>", "list_archive_url": null, "date": "2021-02-25T09:22:24", "name": "[v3,03/38] common: fdt_support: Support special case of PCI address in fdt_read_prop()", "commit_ref": "a932aa3c692606d6ada803de966b1aee09257993", "pull_url": null, "state": "accepted", "archived": false, "hash": "b91d5e5b7fce991874aecab959a8de106cb860cc", "submitter": { "id": 64981, "url": "http://patchwork.ozlabs.org/api/people/64981/?format=api", "name": "Bin Meng", "email": "bmeng.cn@gmail.com" }, "delegate": { "id": 87636, "url": "http://patchwork.ozlabs.org/api/users/87636/?format=api", "username": "priyankajain", "first_name": "Priyanka", "last_name": "Jain", "email": "priyanka.jain@nxp.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/1614244979-48216-4-git-send-email-bmeng.cn@gmail.com/mbox/", "series": [ { "id": 230985, "url": "http://patchwork.ozlabs.org/api/series/230985/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=230985", "date": "2021-02-25T09:22:22", "name": "ppc: qemu: Convert qemu-ppce500 to driver model and enable additional driver support", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/230985/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1444199/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1444199/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": [ "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=<UNKNOWN>)", "ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20161025 header.b=tfUobTJ1;\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "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=gmail.com header.i=@gmail.com header.b=\"tfUobTJ1\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "phobos.denx.de;\n spf=pass smtp.mailfrom=bmeng.cn@gmail.com" ], "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 server-signature RSA-PSS (4096 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 4DmS6H2h2Tz9sVR\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 25 Feb 2021 20:24:23 +1100 (AEDT)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id D9081806C3;\n\tThu, 25 Feb 2021 10:24:19 +0100 (CET)", "by phobos.denx.de (Postfix, from userid 109)\n id 72C8E80F00; Thu, 25 Feb 2021 10:23:46 +0100 (CET)", "from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com\n [IPv6:2a00:1450:4864:20::52b])\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 0696D80CE8\n for <u-boot@lists.denx.de>; Thu, 25 Feb 2021 10:23:40 +0100 (CET)", "by mail-ed1-x52b.google.com with SMTP id l12so5923961edt.3\n for <u-boot@lists.denx.de>; Thu, 25 Feb 2021 01:23:40 -0800 (PST)", "from pek-vx-bsp2.wrs.com\n (ec2-44-242-66-180.us-west-2.compute.amazonaws.com. [44.242.66.180])\n by smtp.gmail.com with ESMTPSA id k22sm2987368edv.33.2021.02.25.01.23.36\n (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);\n Thu, 25 Feb 2021 01:23:39 -0800 (PST)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham\n autolearn_force=no version=3.4.2", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n h=from:to:cc:subject:date:message-id:in-reply-to:references;\n bh=5CDejsp1CnMt+tRFi1ts3B9VBWJbLPadCjOaBrDesGQ=;\n b=tfUobTJ1KSiNTIw+JJbC6VXwvKJkhutlCpwbAD5+03MdTuhBekHX5uC+SWyeDPHb3A\n fJtz/oSNVV0+IIeWhiQLfy+t+CXzwWgSkUluFY/qBiT4JI/mOSivh6oB3LaJKZw8BcJU\n dYsxKM/gm/h7W5BAyduPAYmGnCBxmRSfYeHxo9apw2vD013SOPmZks8McxaYyqdJ53wf\n mc5UTq7y0g0AvkK9yFIRwpX9yZbMSzfW0XSjl2Ac/bnHqc+DcNfkzx770glOK75/WOkH\n MTC4EUcMzYPdR9tdEAhoOODJNOJBUrgZErXsYugDZAh3qPTJPOXEkSaL6/Mp6bmr5UIX\n oQcQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references;\n bh=5CDejsp1CnMt+tRFi1ts3B9VBWJbLPadCjOaBrDesGQ=;\n b=Kxdv4VS1acGXLpPXwCXfivRlm49JL7eIlEQpPepYTd6pPOaLQqOQDZB/JP6fJtf5+a\n mDkzQuU4rxOR33Fh/a8dgCUDI7sGz2wfBAJ/l3lnIWJeqSBh7L2Ih785ASY8y1umgZN0\n jNc/hr8GJ8eZ8NnY5x8GGUuEGHGrFNZ6X+obevJDcANby8vPNrLn14EZGG4DIGmylnUL\n pjKos0FyK8FwdWHMdjwb1m3IcBM0hJhC9VwY9UbtgOIK9ThGhUK0EDEc91VoLNzH2O7Z\n bMeiWwVih9fyxGIA+SQl/OMobAk41ASVxGcTLzQcH0hlvSf+McdtfXo4IjvUz/6LgF74\n w2Iw==", "X-Gm-Message-State": "AOAM530wrVlo7TyTRxvBJ8ziYf6emPcrVjGaDqog8QIFxZl+JrRrCoiY\n SacD+mCUX2FxSrzd2Qrepe0=", "X-Google-Smtp-Source": "\n ABdhPJyGypTjQN/n/szkB3R+BOJ1lgLTSOkzYtXhzqGNv5Dj0ij4LYmS5Y4ryf6ileY/414t4G11OA==", "X-Received": "by 2002:a05:6402:1155:: with SMTP id\n g21mr1902413edw.279.1614245019694;\n Thu, 25 Feb 2021 01:23:39 -0800 (PST)", "From": "Bin Meng <bmeng.cn@gmail.com>", "To": "Simon Glass <sjg@chromium.org>, Alexander Graf <agraf@csgraf.de>,\n Priyanka Jain <priyanka.jain@nxp.com>", "Cc": "U-Boot Mailing List <u-boot@lists.denx.de>, Tom Rini <trini@konsulko.com>", "Subject": "[PATCH v3 03/38] common: fdt_support: Support special case of PCI\n address in fdt_read_prop()", "Date": "Thu, 25 Feb 2021 17:22:24 +0800", "Message-Id": "<1614244979-48216-4-git-send-email-bmeng.cn@gmail.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1614244979-48216-1-git-send-email-bmeng.cn@gmail.com>", "References": "<1614244979-48216-1-git-send-email-bmeng.cn@gmail.com>", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.34", "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.102.4 at phobos.denx.de", "X-Virus-Status": "Clean" }, "content": "At present fdt_read_prop() can only handle 1 or 2 cells. It is\ncalled by fdt_read_range() which may be used to read PCI address\nfrom <ranges> for a PCI bus node where the number of PCI address\ncell is 3. The <ranges> property is an array of:\n\n { <child address> <parent address> <size in child address space> }\n\nWhen trying to read <child address> from a PCI bus node using\nfdt_read_prop(), as the codes below:\n\n /* Read <child address> */\n if (child_addr) {\n r = fdt_read_prop(ranges, ranges_len, cell, child_addr,\n acells);\n if (r)\n return r;\n }\n\nit will fail, because the PCI child address is made up of 3 cells\nbut fdt_read_prop() cannot handle it. We advance the cell offset\nby 1 so that the <child address> can be correctly read.\n\nThis adds the special handling of such case.\n\nSigned-off-by: Bin Meng <bmeng.cn@gmail.com>\nReviewed-by: Simon Glass <sjg@chromium.org>\nReviewed-by: Priyanka Jain <priyanka.jain@nxp.com>\n\n---\n\n(no changes since v2)\n\nChanges in v2:\n- add more details in the commit message, and put some comments\n in the codes to explain why\n\n common/fdt_support.c | 20 +++++++++++++++++---\n 1 file changed, 17 insertions(+), 3 deletions(-)", "diff": "diff --git a/common/fdt_support.c b/common/fdt_support.c\nindex 08d540b..e624bbd 100644\n--- a/common/fdt_support.c\n+++ b/common/fdt_support.c\n@@ -1668,22 +1668,36 @@ u64 fdt_get_base_address(const void *fdt, int node)\n }\n \n /*\n- * Read a property of size <prop_len>. Currently only supports 1 or 2 cells.\n+ * Read a property of size <prop_len>. Currently only supports 1 or 2 cells,\n+ * or 3 cells specially for a PCI address.\n */\n static int fdt_read_prop(const fdt32_t *prop, int prop_len, int cell_off,\n \t\t\t uint64_t *val, int cells)\n {\n-\tconst fdt32_t *prop32 = &prop[cell_off];\n-\tconst unaligned_fdt64_t *prop64 = (const fdt64_t *)&prop[cell_off];\n+\tconst fdt32_t *prop32;\n+\tconst unaligned_fdt64_t *prop64;\n \n \tif ((cell_off + cells) > prop_len)\n \t\treturn -FDT_ERR_NOSPACE;\n \n+\tprop32 = &prop[cell_off];\n+\n+\t/*\n+\t * Special handling for PCI address in PCI bus <ranges>\n+\t *\n+\t * PCI child address is made up of 3 cells. Advance the cell offset\n+\t * by 1 so that the PCI child address can be correctly read.\n+\t */\n+\tif (cells == 3)\n+\t\tcell_off += 1;\n+\tprop64 = (const fdt64_t *)&prop[cell_off];\n+\n \tswitch (cells) {\n \tcase 1:\n \t\t*val = fdt32_to_cpu(*prop32);\n \t\tbreak;\n \tcase 2:\n+\tcase 3:\n \t\t*val = fdt64_to_cpu(*prop64);\n \t\tbreak;\n \tdefault:\n", "prefixes": [ "v3", "03/38" ] }