get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2217989,
    "url": "http://patchwork.ozlabs.org/api/patches/2217989/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260331080117.2370092-4-ilias.apalodimas@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": "<20260331080117.2370092-4-ilias.apalodimas@linaro.org>",
    "list_archive_url": null,
    "date": "2026-03-31T08:01:13",
    "name": "[v2,3/4] fdtdec: Introduce fdtdec_setup_ram_size() to determine the memory size",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "9b1e0ca98a77f978748f902d6a4c9e4b0abbcca9",
    "submitter": {
        "id": 74147,
        "url": "http://patchwork.ozlabs.org/api/people/74147/?format=api",
        "name": "Ilias Apalodimas",
        "email": "ilias.apalodimas@linaro.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260331080117.2370092-4-ilias.apalodimas@linaro.org/mbox/",
    "series": [
        {
            "id": 498138,
            "url": "http://patchwork.ozlabs.org/api/series/498138/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=498138",
            "date": "2026-03-31T08:01:10",
            "name": "Relocate U-Boot in the last bank",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/498138/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2217989/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2217989/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=yr7fzUOv;\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=\"yr7fzUOv\";\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=ilias.apalodimas@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 4flLF02r0Tz1yGH\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 19:02:12 +1100 (AEDT)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id BD5D884099;\n\tTue, 31 Mar 2026 10:01:42 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id ADEA383F5B; Tue, 31 Mar 2026 10:01:40 +0200 (CEST)",
            "from mail-wm1-x334.google.com (mail-wm1-x334.google.com\n [IPv6:2a00:1450:4864:20::334])\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 805B184011\n for <u-boot@lists.denx.de>; Tue, 31 Mar 2026 10:01:37 +0200 (CEST)",
            "by mail-wm1-x334.google.com with SMTP id\n 5b1f17b1804b1-486fd3a577eso48850235e9.1\n for <u-boot@lists.denx.de>; Tue, 31 Mar 2026 01:01:37 -0700 (PDT)",
            "from hera ([94.131.143.12]) by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-4887c9250afsm10087065e9.36.2026.03.31.01.01.35\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 31 Mar 2026 01:01:36 -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=1774944097; x=1775548897; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=X8qH+4/Z9p5lPWD2pDoZhs23SmQ5PbVpQBMoyMvrbOQ=;\n b=yr7fzUOvYb6p186PGnbZKQmI38Vamh/nWHtXS8j73YeMtX9tkdzGTHNdOFrV3l8xTs\n cZhYKr6Ezx7kPDBr7GNv6IOZru3qxGzp6tKC/Mhe3j/uIfPSUM55tymSkq5BdxdpBwhn\n Haky+CNrxASUS4P+iR1lwwTC4YGslAI68yxlF+DHYUJZAmX90NKZJO5EHbvi/0xxqoQK\n V93gF8qLsS1ikU/TwnG3WzTyIuH4vHSACXs16iJZ7Sw1WtNVmVYk5HuJMIM1DW1CxekX\n Aq/RAq58iyd8llP92JKTc/laCU3apgMSeFOaVMhoW7y71G0SAFtSpxTbW9Ydclulb91K\n Dxjw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774944097; x=1775548897;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=X8qH+4/Z9p5lPWD2pDoZhs23SmQ5PbVpQBMoyMvrbOQ=;\n b=kDljxCFoLEE8UDezGICDzbkvK0Lm/P9pdn6xckXsyLzSkAwlbrAP0hadl66d/HbH0U\n 0gBlCqQer+Q/pSGmS9Y5LTEIof/U98Ur8gK/YRr5IqmpxtJxunyQXFQw/KHDYcdJhLxZ\n FNTY+T3q1TLWyZ/QSU0TMH1HNL0o3ZyM90ZygScvJUQxEoMXukM2i+ZHUdfD2V88Jr6k\n jCllrSQ8n4XIoKGyxU+hs/s2T7wekDRbddX5n7cCbHhWkpcTKU2a6NEP4Gr2wpGoxBIJ\n +2fuOLmeEOk2Ywl1sWefSC+DyrZ4ciF1zrtmNURruYSxp27r9w/K8UkeNBRDkoLcjwWX\n 7UeA==",
        "X-Forwarded-Encrypted": "i=1;\n AJvYcCXjQTq6YJsykIHlPboOwjFC96igjHDTssgdKVI1n21IKopDLEE/IUmLm9Mx0FkF0Ivf7TkCwUo=@lists.denx.de",
        "X-Gm-Message-State": "AOJu0YwP/7ZWVCq/Kcc4YeRRSBTATkYzhIed9Dyg2YKFD/ebV8V1ecRr\n A0hXFX/hfvKdJuxaZSUjdNMW8mllJ/aX4U0AlC5+1Baimiy9XrC1VOnE3KEO1GJsGKw=",
        "X-Gm-Gg": "ATEYQzzoMtCSNRT3gTZEetrGhZguMOyOMH+ektDh+9LtsFQKlDZy4RUvzvpvWalQrCj\n JXp0QRrAj6WuetN+euPXk9vANIbPf3nH8lsL5exhNKvULMnxxsn3QvoKJclB2DYGeQGE95n8Gx0\n KYLYHIHzbrY+svxDWbLqAtXtedM44Hz1IY+94hy7lRjbMYUf/RTK+cdF7pynkX0AWnzcvDK3tB7\n 7KeFfMMzTAVj/E8x/K1oXrrjKmy84PuFMiNBvbROGAkZsE1quuYt/mPGn86+gBXFs060CDbl4/t\n ZxDhXvI1eDFfk5eApg3qyPS9Y1iw6y+rNXrY5UXx49dUuo1amr5YKvFUERLjzgYwAuNfGcSIDHk\n NkctowqJjdg66CxOh3fUxTsw9odoueYvBDrrHLyn6Vml304ue888uRhdKUDsNmSAcNzLbDKseij\n jxBowUQeFF6zef4NBdnMAKG/6iAwpAUpIarz/66TLQCc/qPxkB1rSvZHMUJ3Jsn9naPV1hYOzEC\n MgAaT0VYNVveR06GF9p5aJgavGbi+UjMjHmFYyAejiomjbqzq6vNnMzwa0zqXh+1T5V8ElObmR8\n GLHGVjCgReCYGxHwcrfA8s9i2xCg4K5ThvA8XIBMG2qnjWZpTp6Fh+jqQyC4aDSrcYOwgPEMHGC\n k5BXtUwXy9QY7luuSb8SbQ//+bgmaw6l/AwojuiRH/GO6DN2eGf6l2JLE2q5sKRhEfSkaCC3UCj\n Bm1riwf4V3IUf5nVrtK034pl120Yj1rgrrvzMFB1F6sciU3xpZl1t7mDnVZy4k",
        "X-Received": "by 2002:a05:600c:3d87:b0:487:2092:b2e0 with SMTP id\n 5b1f17b1804b1-48727d5a246mr255110825e9.1.1774944096794;\n Tue, 31 Mar 2026 01:01:36 -0700 (PDT)",
        "From": "Ilias Apalodimas <ilias.apalodimas@linaro.org>",
        "To": "marek.vasut+renesas@mailbox.org,\n\ttrini@konsulko.com",
        "Cc": "Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n\tu-boot@lists.denx.de",
        "Subject": "[PATCH v2 3/4] fdtdec: Introduce fdtdec_setup_ram_size() to determine\n the memory size",
        "Date": "Tue, 31 Mar 2026 11:01:13 +0300",
        "Message-ID": "<20260331080117.2370092-4-ilias.apalodimas@linaro.org>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260331080117.2370092-1-ilias.apalodimas@linaro.org>",
        "References": "<20260331080117.2370092-1-ilias.apalodimas@linaro.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "We previously added a fdtdec_setup_mem_ram_top() to determine the\ntopmost address of the last DRAM bank. Similarly the overall memory\nsize must be calculated when U-Boot gets relocated to the actual end of\nall available DRAM.\n\nPre-patch:\nU-Boot 2026.04-rc5-00012-g5789f787c8a6-dirty (Mar 31 2026 - 09:13:34 +0300)\nDRAM:  4 GiB (total 8 GiB)\n\nPost-patch:\nU-Boot 2026.04-rc5-00012-g5789f787c8a6 (Mar 31 2026 - 09:12:59 +0300)\nDRAM:  8 GiB\n\nSigned-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>\n---\n include/fdtdec.h | 15 +++++++++++++++\n lib/fdtdec.c     | 18 ++++++++++++++++++\n 2 files changed, 33 insertions(+)",
    "diff": "diff --git a/include/fdtdec.h b/include/fdtdec.h\nindex 26e40c3cdb46..9bccd70bbdb6 100644\n--- a/include/fdtdec.h\n+++ b/include/fdtdec.h\n@@ -965,6 +965,21 @@ int fdtdec_setup_mem_ram_top(void);\n  * invalid\n  */\n int fdtdec_setup_memory_banksize(void);\n+/**\n+ * fdtdec_setup_ram_size() - decode and setup setup gd->ram_size to the sum of\n+ *\t\t\t     all banks\n+ *\n+ * Decode the /memory 'reg' property to determine the memory available in all\n+ * banks and populate the global data ram_size with it.\n+ *\n+ * This function should be called from a boards board_get_usable_ram_top().\n+ * This helper function allows for boards to query the device tree for the\n+ * overall memory described in as the sum of all memory banks.\n+ *\n+ * Return: 0 if OK, -EINVAL if the /memory node or reg property is missing or\n+ * invalid\n+ */\n+int fdtdec_setup_ram_size(void);\n \n /**\n  * fdtdec_set_ethernet_mac_address() - set MAC address for default interface\ndiff --git a/lib/fdtdec.c b/lib/fdtdec.c\nindex bdb26d8fb75b..715662d27a8c 100644\n--- a/lib/fdtdec.c\n+++ b/lib/fdtdec.c\n@@ -1142,6 +1142,24 @@ int fdtdec_setup_memory_banksize(void)\n \treturn fdtdec_setup_mem_for_each_bank(fdtdec_setup_memory_banksize_bankfn);\n }\n \n+static void fdtdec_setup_total_ram_fn(struct resource *res, int bank)\n+{\n+\tgd->ram_size += res->end - res->start + 1;\n+}\n+\n+int fdtdec_setup_ram_size(void)\n+{\n+\tint ret;\n+\tphys_addr_t old_size = gd->ram_size;\n+\n+\tgd->ram_size = 0;\n+\tret = fdtdec_setup_mem_for_each_bank(fdtdec_setup_total_ram_fn);\n+\tif (ret)\n+\t\tgd->ram_size = old_size;\n+\n+\treturn ret;\n+}\n+\n static void fdtdec_setup_mem_size_base_lowest_bankfn(struct resource *res, int bank)\n {\n \tunsigned long base = (unsigned long)res->start;\n",
    "prefixes": [
        "v2",
        "3/4"
    ]
}