get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2228754,
    "url": "http://patchwork.ozlabs.org/api/patches/2228754/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260427100832.581887-7-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": "<20260427100832.581887-7-ilias.apalodimas@linaro.org>",
    "list_archive_url": null,
    "date": "2026-04-27T10:08:27",
    "name": "[v3,6/6] common: Add an option to relocate on ram top",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "f01799e465c4bffb7d47558d317f6d694050ea29",
    "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/20260427100832.581887-7-ilias.apalodimas@linaro.org/mbox/",
    "series": [
        {
            "id": 501617,
            "url": "http://patchwork.ozlabs.org/api/series/501617/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=501617",
            "date": "2026-04-27T10:08:21",
            "name": "Relocate U-Boot in the last bank",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/501617/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2228754/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2228754/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=WYO7LwWf;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; 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=\"WYO7LwWf\";\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\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\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 4g3znk3cTlz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 20:09:46 +1000 (AEST)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id A7A6384307;\n\tMon, 27 Apr 2026 12:09:21 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 5F441841D7; Mon, 27 Apr 2026 12:09:01 +0200 (CEST)",
            "from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com\n [IPv6:2a00:1450:4864:20::22c])\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 09668839D9\n for <u-boot@lists.denx.de>; Mon, 27 Apr 2026 12:08:59 +0200 (CEST)",
            "by mail-lj1-x22c.google.com with SMTP id\n 38308e7fff4ca-38ddd8d3b7fso76311431fa.3\n for <u-boot@lists.denx.de>; Mon, 27 Apr 2026 03:08:59 -0700 (PDT)",
            "from hera ([94.131.143.12]) by smtp.gmail.com with ESMTPSA id\n 38308e7fff4ca-38ecb6f0b88sm68554791fa.27.2026.04.27.03.08.56\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 27 Apr 2026 03:08:57 -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=1777284538; x=1777889338; 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=IBh4vrw9rwot667Wy6pXs4MP3GKFRJdIycISONOrycI=;\n b=WYO7LwWfJhp9+VEc1rmyhakHPaWDuv0f8OQUeQVRwQQYP2cfcOdHEbpLM1RgIra6Nx\n 2d4Y0/BdjFGjkfcz1bpH4YapxG+bKHiOHCEXK23m60yPkZ2zDbN3j2L+CAON4jzqep5D\n UWwHqcHzHPoBuyxMki/91nwo8Od2wU17nQlnH0ztLrPtbosc0eNpY7FLnTeIFyF9n7hK\n ArIW9Cnqa5XzhJ8qjUy5do5ryndEa7GBVbSoL2+E4URVLlYeshBSO4JyqWLnEGVS0jMW\n KoMw7yTl7Xip9DHOr+KKU9MYp3rIXz+EzNulJmyDEzJ9iVawOv50/NDtP53kozGHbmqa\n UUiQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777284538; x=1777889338;\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=IBh4vrw9rwot667Wy6pXs4MP3GKFRJdIycISONOrycI=;\n b=gFfiP2rJihsOOVoLlKM2YfGF6dTcyKsrFylWBNZv9/+WRwjnJRG7RwDRtc6eXK+WCz\n /xtr1nS3TyGNL5dv5L7LsSyycTomTD0MttkKsUvcWH0XTmNXb3C4XhEFwWXigPHgJOaY\n yI+Weg9hFz5V1DYzg9CEdBqSouQKpLCC6MUsrvtxqiM2OyI0v9hVWZYMORHTw2bjb2vE\n LetzAxik12E4RyHVPupuZyp44oSmXyfE5kN+XZzhNGGl9rQ2y8SA4rzE8vmkRSeEtfSh\n BXUo4QxKMGch8thl6GEuup9mtq1pMKBsv1WeGKipmDs1qRTONnUFRxOdLZBxZo1qm5y4\n KrrA==",
        "X-Forwarded-Encrypted": "i=1;\n AFNElJ+oyYc3G9u0Oaz16Ykf8FlEt0t0Wj3UzfLzxqiPz+vJ3g9IY0iETUl9Tf3f3eSiblA4i6aQMiI=@lists.denx.de",
        "X-Gm-Message-State": "AOJu0Yw24+ZKJIsGIa6eCfJhMoFpSxIIWd/+YWgeNEUcHy4hehoa+cki\n +irzK0/mbxBDNPoOjhaAR+sM4WAZiYFJTzp9UMlPZbEpff/7uZaThc5T6KzPKJiDkZA=",
        "X-Gm-Gg": "AeBDiesyVY2LbajUESAEvuqWoSZhV51Z0OgVzRTvF/oi7AYappCGjZRhT0LWkhIjvow\n GBBEzRlveX+faDUbJn/F2Du1Ih0l5mmOX1zRVqHq65ZXvgLao7I+jOiKUIkW4Teg5AQZ81jUlTp\n SuccBM9cEMepXjc/FwieRKpI5wS2t43Y1Q4kn4mTZHOhA3yYBUBSE+e+iNYInhSEIpHx2aXYI5h\n uL5UrEi5AbbO1gbmEhjC+Y5M3QF1YgCADbGwRxYA/wcZeQGHtwqvyBLM1NKHF2yR0eEsCXwbU9T\n ENXAwOUyLXWbz5nAtb6Vt9iXTGaEA3TQtivr1pK+klPeCk5XKGP/BxstMRzn6D+n9b6llRK6mtP\n ByOiBjz1grL8pkpt0ThCCVEnhsrYv3P3xVQ+XpnArWB7J3QmxqY7/CmsezXHXjCsL3Vz1cdGp9E\n 79ntWMffThClBWDpALn2HBITlpWnZXratQa9SbcnCn5bTuvi5AvU9jnN8X9rqs4ztZF2OTeuBOl\n bRE8Gk7Cz1W7BOjOorr2Ci6YyLXzAfECccwjzIADw60Ne6JOETJIr6hXtT30oLdXKdJC6Pc+hIf\n Vcpot/8WfhzijaiZ161Z0NdEBw2m9Z8l/6ZPKWwhPzEk4Qc3/tgWPyzeEUyKGl+7+zk++3ruaYw\n cfvksvEGHUl7R3yDhKnJMuOrSa8bpCOgkBC9i6Vf0tzjWEVTh5P2fgKP/2af8kA86XRIrsxLPaP\n 1I3pGKkptBSAuMOEyJFSl65WjPXY+bEPypo2GZCM3vJ4JX3OjTCE7p8D91xQ7OFf3EcBy/CCAC0\n wjUnjCyOg6e277MMY8r6hoybAyrSaIssgyZ5M3m9JymdwY=",
        "X-Received": "by 2002:a05:651c:418c:b0:38d:e977:554a with SMTP id\n 38308e7fff4ca-38ec7b09541mr111520901fa.24.1777284538222;\n Mon, 27 Apr 2026 03:08:58 -0700 (PDT)",
        "From": "Ilias Apalodimas <ilias.apalodimas@linaro.org>",
        "To": "trini@konsulko.com",
        "Cc": "marek.vasut+renesas@mailbox.org, jonas@kwiboo.se, anshuld@ti.com,\n sjg@chromium.org, Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n u-boot@lists.denx.de",
        "Subject": "[PATCH v3 6/6] common: Add an option to relocate on ram top",
        "Date": "Mon, 27 Apr 2026 13:08:27 +0300",
        "Message-ID": "<20260427100832.581887-7-ilias.apalodimas@linaro.org>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260427100832.581887-1-ilias.apalodimas@linaro.org>",
        "References": "<20260427100832.581887-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": "Right now we only relocate u-boot to the top of the first\nmemory bank unless the board specific code overwrites it.\nThis is problematic when loading big binaries as it\nfragments the contiguous memory space for no apparent reason.\n\nOn certain platforms, it is currently not possible to relocate U-Boot\nabove the 32bit boundary, due to various dependencies on content located\nbelow the 32bit boundary. One such example is ethernet, where the packet\nbuffer built into U-Boot binary is placed below the 32bit boundary and\nallows loading of data via ethernet even above 32bit boundary due to\nmemory copy from the packet buffer to the destination location.\n\nA previous patch moves the bi_dram[] info from bd to gd and make\nthe memory bank information available early. So move the\ndram_init_banksize() INITCALL before the relocation address calculation\nand use it to derive the address.\n\nAlso add a Kconfig option and allow the common code to relocate U-Boot\nto the top of the last discovered bank.\n\nSigned-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>\n---\n Kconfig          | 12 ++++++++++++\n common/board_f.c | 32 ++++++++++++++++++++++++++------\n 2 files changed, 38 insertions(+), 6 deletions(-)\n\n--\n2.53.0",
    "diff": "diff --git a/Kconfig b/Kconfig\nindex d1a042a11658..522eedf726ef 100644\n--- a/Kconfig\n+++ b/Kconfig\n@@ -503,6 +503,18 @@ config SKIP_RELOCATE_CODE_DATA_OFFSET\n \t  Offset of the read-write memory which contains data, from read-only\n \t  memory which contains executable text.\n\n+config RELOC_ADDR_TOP\n+\tbool \"Relocate to the topmost memory address\"\n+\tdepends on EXPERT\n+\thelp\n+\t  When U-Boot relocates, it chooses the end of the first memory bank.\n+\t  Enable this if you have multiple banks and want U-Boot to relocate\n+\t  to the topmost memory address. This will use the information of the\n+\t  board memory banks configured with dram_init_banksize() to calculate\n+\t  the relocation address.\n+\t  Use this if you are certain all of the devices can access memory\n+\t  above the 32bit boundary.\n+\n endif # EXPERT\n\n config PHYS_64BIT\ndiff --git a/common/board_f.c b/common/board_f.c\nindex f58061026f8f..c88f4d2f97a5 100644\n--- a/common/board_f.c\n+++ b/common/board_f.c\n@@ -31,6 +31,7 @@\n #include <log.h>\n #include <malloc.h>\n #include <mapmem.h>\n+#include <memtop.h>\n #include <os.h>\n #include <post.h>\n #include <relocate.h>\n@@ -339,7 +340,28 @@ static int setup_ram_base(void)\n static int setup_ram_config(void)\n {\n \tdebug(\"Monitor len: %08x\\n\", gd->mon_len);\n-#if CONFIG_VAL(SYS_MEM_TOP_HIDE)\n+\n+\tif (CONFIG_IS_ENABLED(RELOC_ADDR_TOP)) {\n+\t\tint bank;\n+\t\tphys_size_t total_size = 0;\n+\t\tphys_addr_t top;\n+\n+\t\tfor (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) {\n+\t\t\tif (gd->ram_top <= gd->dram[bank].start)\n+\t\t\t\tgd->ram_top = gd->dram[bank].start +\n+\t\t\t\t\t\tgd->dram[bank].size;\n+\t\t\ttotal_size += gd->dram[bank].size;\n+\t\t}\n+\t\tgd->ram_size = total_size;\n+\n+\t\ttop = get_mem_top(gd->ram_base, gd->ram_size, 0, (void *)gd->fdt_blob);\n+\t\tif (top)\n+\t\t\tgd->ram_top = top;\n+\n+\t} else {\n+\t\tgd->ram_top = gd->ram_base + get_effective_memsize();\n+\t\tgd->ram_top = board_get_usable_ram_top(gd->mon_len);\n+\t}\n \t/*\n \t * Subtract specified amount of memory to hide so that it won't\n \t * get \"touched\" at all by U-Boot. By fixing up gd->ram_size\n@@ -350,10 +372,8 @@ static int setup_ram_config(void)\n \t * memory size from the SDRAM controller setup will have to\n \t * get fixed.\n \t */\n-\tgd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE;\n-#endif\n-\tgd->ram_top = gd->ram_base + get_effective_memsize();\n-\tgd->ram_top = board_get_usable_ram_top(gd->mon_len);\n+\tif (CONFIG_IS_ENABLED(SYS_MEM_TOP_HIDE))\n+\t\tgd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE;\n\n \tdebug(\"Ram top: %08llx\\n\", (unsigned long long)gd->ram_top);\n \tdebug(\"Ram size: %08llx\\n\", (unsigned long long)gd->ram_size);\n@@ -979,6 +999,7 @@ static void initcall_run_f(void)\n \t *  - board info struct\n \t */\n \tINITCALL(setup_ram_base);\n+\tINITCALL(dram_init_banksize);\n \tINITCALL(setup_ram_config);\n \tINITCALL(setup_dest_addr);\n #if CONFIG_IS_ENABLED(OF_BOARD_FIXUP) && \\\n@@ -1007,7 +1028,6 @@ static void initcall_run_f(void)\n \tINITCALL(reserve_bloblist);\n \tINITCALL(reserve_arch);\n \tINITCALL(reserve_stacks);\n-\tINITCALL(dram_init_banksize);\n \tINITCALL(show_dram_config);\n \tWATCHDOG_RESET();\n \tINITCALL(setup_bdinfo);\n",
    "prefixes": [
        "v3",
        "6/6"
    ]
}