Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2219527/?format=api
{ "id": 2219527, "url": "http://patchwork.ozlabs.org/api/patches/2219527/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260403090109.3564638-5-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": "<20260403090109.3564638-5-ilias.apalodimas@linaro.org>", "list_archive_url": null, "date": "2026-04-03T09:01:06", "name": "[v1,4/4] common: Add an optionto relocate on ram top", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "cce74dc247bc086e9cfe10241b6c106cdcca298b", "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/20260403090109.3564638-5-ilias.apalodimas@linaro.org/mbox/", "series": [ { "id": 498607, "url": "http://patchwork.ozlabs.org/api/series/498607/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=498607", "date": "2026-04-03T09:01:02", "name": "Relocate U-Boot in the last bank", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/498607/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2219527/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2219527/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=CCUQV72F;\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=\"CCUQV72F\";\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 4fnCQZ2sjgz1yCt\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 03 Apr 2026 20:01:58 +1100 (AEDT)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id E4E8084099;\n\tFri, 3 Apr 2026 11:01:32 +0200 (CEST)", "by phobos.denx.de (Postfix, from userid 109)\n id 2ADC2840D8; Fri, 3 Apr 2026 11:01:31 +0200 (CEST)", "from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com\n [IPv6:2a00:1450:4864:20::32d])\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 2B81A840B0\n for <u-boot@lists.denx.de>; Fri, 3 Apr 2026 11:01:29 +0200 (CEST)", "by mail-wm1-x32d.google.com with SMTP id\n 5b1f17b1804b1-482f454be5bso29851045e9.0\n for <u-boot@lists.denx.de>; Fri, 03 Apr 2026 02:01:29 -0700 (PDT)", "from hera ([94.131.143.12]) by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-4887e967badsm332528545e9.14.2026.04.03.02.01.27\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 03 Apr 2026 02:01: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=1775206889; x=1775811689; 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=MNpRiTRumzrfwtzL+vT/x9f1trxIcBJlD560q/MQccE=;\n b=CCUQV72FEvUi7xCQHSYCD/hok2tlIK4fmM8+X8Uc9Cuxs6ny06n8+VzbudP1PUkoSk\n HhoVoMxrIMfGWeN5xheQs9aCx1EeLZ+/WEziIiV6woI4e0Q9jKph1XcBzfDhTrHO1r3A\n fJniJ3AiqNGHa4kHCs2PuFKjOFezgcVUHytXnIdsIW1Kq262WuXGdWoaS88kVptADgYu\n mtonNTtQhW6uOGOA0Xiitipt0+PDVVS52WUV331IGc502FCD4xFgahelPC/TRIRBP0yn\n SYazBNEbXCf/0UcMWR1lh51LSIgiu//E0YQ6tsLwAlhSon3LjScwio6glRvFf9ExeD+5\n FMjg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775206889; x=1775811689;\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=MNpRiTRumzrfwtzL+vT/x9f1trxIcBJlD560q/MQccE=;\n b=nuK4wTuHPWzpEmDn7igVk7b4ly5ZB8PTqKrZkmFQA2W22gmR1mcFgRkEqBFuhUw4W5\n /uKIk2iqP2mLG9wBcIu/aTSw6T7EfoZJrhQiwOz2HAWskrlNc/gzEABiAyb11A1JuIiH\n qTvKY0QFTk+331PkF1RVQrCK+v06rGxvmJhZVVJ6gFfgE+2+L4H8LqdqiZejdqJ05lqx\n DmVYKPXckdG46HxKDXL1SzR60eFvH+B2uIiEd3WgqgEKvXsRWOwx15LV9ZJb5gAv1HMV\n X7574e1tcg/GXefDE0sEAEzaP8yfR5ebNoQF3mBWS/CFLednTreV6XAF5sUyXEihQMvw\n L7Mw==", "X-Forwarded-Encrypted": "i=1;\n AJvYcCVDwh78SwjUrloQb9jxWYxTwH7/AFRGgOaH8hGuLDqGy+tgBUsFVL9cLvqaqpXXku0o3EbJH9A=@lists.denx.de", "X-Gm-Message-State": "AOJu0YxTOUH+wfeGPBK4bF+EiigIlTjSJxzmcFU45XJfpVItJMm8m4BW\n PSjrogOkEDAyHN0AukmIekBrZyH42b4n1Lyoj2dyFVfuGznPdo9rVCo+BPdZk+T5JrU=", "X-Gm-Gg": "ATEYQzzhCX4ITtEiY6/qMdfCT88rMOLi1q60QXXirIJYczWbXgA28qGxndI/o6XTXs7\n 2apJrvvivCZBikUy5wuRgzO1TlGLNV/Vd76BFrw5dLMyA7t78LmJpZNA+9l7xhs07/YZaG9lFkN\n Xix9NGfi4imwMz3bgCyA9ZsoS4HBxMHMfNB91UPJo8JWclG+dXWILEL5gBzePFKbDKkxLB9wM1D\n 2dDuDn3PxAy99AoNtZ0e6SdM5C+IAQXWPdCDUhexCeXvmahLPCkQ10KYtV5u9gEM1RUHhZTZwLD\n 6D2PPN5LkzU+XtJ1Q/bFwizFoy5dfa58Qu5/z6QrJIzpyznAgFhYwilbSE9rXEWYyVK7xR205IB\n y1JK5eog/UHvQ5m/Ao+twQaS1ioGx/AvXn62AY+FUFe3kP7eIohWtShJmW+pOTtlcTGm7dC46Bt\n 79Jt8h5hGsGqj8Zpppku2zUoCeQGS3JYCOthrPp8VsQB3gVN1c8tXQVZmcxiIl6Qs7PmwP0S18o\n AMWdEpeM//nCYArg+fJvuHtjEoEhKMnA28y0jRzCS3Lh7jpyHTZzS/eGHn1HKoz6Qth2zdLQ8Ss\n s0pFWkn6n9yFcbooYoDICKcgpiQwrkT7fJjdyTJE/yPbj4fdizPmuukuLHPgwAY54xDH8En7HC5\n sF05F56TNxrDvTXTJEyuR/ivnWD412DeqJta7lhLJLRqp7PADnPJWu2E24TuJaSsX0au+vvFqKj\n 0+kgU3bLOg0rw7jcvmsHay16GbUBYBkONoWhgCc8u/sk7dC1vNx9XxQs1kBsDm", "X-Received": "by 2002:a05:600c:45cf:b0:477:9890:9ab8 with SMTP id\n 5b1f17b1804b1-4889945f8c3mr34261375e9.3.1775206888450;\n Fri, 03 Apr 2026 02:01:28 -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 v1 4/4] common: Add an optionto relocate on ram top", "Date": "Fri, 3 Apr 2026 12:01:06 +0300", "Message-ID": "<20260403090109.3564638-5-ilias.apalodimas@linaro.org>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260403090109.3564638-1-ilias.apalodimas@linaro.org>", "References": "<20260403090109.3564638-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\nIt's worth noting that there are cases where we must not relocate\nabove the 4GiB boundary (64bit hardware with 32bit only capable\nDMA). E.g This will break platforms, if the ethernet\ncontroller cannot DMA above 4 GiB, and once U-Boot does\nget relocated above 4 GiB, the packet buffer which is built\ninto the U-Boot binary is also relocated above 4 GiB.\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 | 8 ++++++++\n common/board_f.c | 17 ++++++++++++++++-\n 2 files changed, 24 insertions(+), 1 deletion(-)", "diff": "diff --git a/Kconfig b/Kconfig\nindex ce25ea24a60f..b25e7f25591d 100644\n--- a/Kconfig\n+++ b/Kconfig\n@@ -474,6 +474,14 @@ config SKIP_RELOCATE\n \t Skips relocation of U-Boot allowing for systems that have extremely\n \t limited RAM to run U-Boot.\n \n+config RELOC_ADDR_TOP\n+\tbool \"Relocate to the topmost memory address\"\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().\n+\n endif # EXPERT\n \n config PHYS_64BIT\ndiff --git a/common/board_f.c b/common/board_f.c\nindex dd5518b60db4..2eab344037c8 100644\n--- a/common/board_f.c\n+++ b/common/board_f.c\n@@ -339,6 +339,10 @@ static int setup_ram_base(void)\n \n static int setup_ram_config(void)\n {\n+#if CONFIG_IS_ENABLED(RELOC_ADDR_TOP)\n+\tint bank;\n+\tphys_size_t total_size = 0;\n+#endif\n \tdebug(\"Monitor len: %08x\\n\", gd->mon_len);\n #if CONFIG_VAL(SYS_MEM_TOP_HIDE)\n \t/*\n@@ -353,8 +357,19 @@ static int setup_ram_config(void)\n \t */\n \tgd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE;\n #endif\n+#if CONFIG_IS_ENABLED(RELOC_ADDR_TOP)\n+\tfor (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) {\n+\t\tif (gd->ram_top <= gd->bi_dram[bank].start)\n+\t\t\tgd->ram_top = gd->bi_dram[bank].start +\n+\t\t\t\t\tgd->bi_dram[bank].size;\n+\t\ttotal_size += gd->bi_dram[bank].size;\n+\t}\n+\n+\tgd->ram_size = total_size;\n+#else\n \tgd->ram_top = gd->ram_base + get_effective_memsize();\n \tgd->ram_top = board_get_usable_ram_top(gd->mon_len);\n+#endif\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@@ -971,6 +986,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@@ -999,7 +1015,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": [ "v1", "4/4" ] }