Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2148247/?format=api
{ "id": 2148247, "url": "http://patchwork.ozlabs.org/api/patches/2148247/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20251010134424.3835757-6-anshuld@ti.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": "<20251010134424.3835757-6-anshuld@ti.com>", "list_archive_url": null, "date": "2025-10-10T13:44:11", "name": "[v10,05/11] arm: armv8: mmu: add mem_map_from_dram_banks", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "91d4859534e32a36328bb938c3b6bbfe6bd91890", "submitter": { "id": 90324, "url": "http://patchwork.ozlabs.org/api/people/90324/?format=api", "name": "Anshul Dalal", "email": "anshuld@ti.com" }, "delegate": { "id": 3651, "url": "http://patchwork.ozlabs.org/api/users/3651/?format=api", "username": "trini", "first_name": "Tom", "last_name": "Rini", "email": "trini@ti.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20251010134424.3835757-6-anshuld@ti.com/mbox/", "series": [ { "id": 477111, "url": "http://patchwork.ozlabs.org/api/series/477111/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=477111", "date": "2025-10-10T13:44:06", "name": "Add support for dynamic MMU configuration", "version": 10, "mbox": "http://patchwork.ozlabs.org/series/477111/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2148247/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2148247/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 (1024-bit key;\n unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256\n header.s=ti-com-17Q1 header.b=NMRpko6s;\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=quarantine dis=none) header.from=ti.com", "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de", "phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=ti.com header.i=@ti.com header.b=\"NMRpko6s\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=quarantine dis=none) header.from=ti.com", "phobos.denx.de; spf=pass smtp.mailfrom=anshuld@ti.com" ], "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 server-signature ECDSA (secp384r1))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4cjp0c4ByBz1yGy\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 11 Oct 2025 00:45:36 +1100 (AEDT)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 1C9A6844C8;\n\tFri, 10 Oct 2025 15:44:52 +0200 (CEST)", "by phobos.denx.de (Postfix, from userid 109)\n id 5A1B584476; Fri, 10 Oct 2025 15:44:50 +0200 (CEST)", "from fllvem-ot03.ext.ti.com (fllvem-ot03.ext.ti.com [198.47.19.245])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n bits)) (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id B26D2843F5\n for <u-boot@lists.denx.de>; Fri, 10 Oct 2025 15:44:47 +0200 (CEST)", "from lelvem-sh02.itg.ti.com ([10.180.78.226])\n by fllvem-ot03.ext.ti.com (8.15.2/8.15.2) with ESMTP id 59ADifri256433;\n Fri, 10 Oct 2025 08:44:41 -0500", "from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25])\n by lelvem-sh02.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 59ADifLG1713775\n (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=FAIL);\n Fri, 10 Oct 2025 08:44:41 -0500", "from DFLE214.ent.ti.com (10.64.6.72) by DFLE104.ent.ti.com\n (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55; Fri, 10\n Oct 2025 08:44:40 -0500", "from lelvem-mr06.itg.ti.com (10.180.75.8) by DFLE214.ent.ti.com\n (10.64.6.72) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend\n Transport; Fri, 10 Oct 2025 08:44:40 -0500", "from localhost (dhcp-172-24-233-105.dhcp.ti.com [172.24.233.105])\n by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 59ADidIi1722088;\n Fri, 10 Oct 2025 08:44:40 -0500" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,\n RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com;\n s=ti-com-17Q1; t=1760103881;\n bh=6mLI9nIdSMY/xnlneSbIRQ0ivx+LpNO3CrLL7uvtgYg=;\n h=From:To:CC:Subject:Date:In-Reply-To:References;\n b=NMRpko6srcBjGnaMm7N5Ivs0YDRI3nnPvkMVWgOmSjq1LfgyD2cfFIpOHSOBUgZkv\n RGBM0ekHBqv/RXcahqvGh5PtPIixMnmddf7UqW9hamVdmgX9xo2vefy5ndLByDwRSE\n WI4YwEeFX5ytNOG6hoJ3DH7FzUnFtetF8L9+pclU=", "From": "Anshul Dalal <anshuld@ti.com>", "To": "<u-boot@lists.denx.de>", "CC": "Anshul Dalal <anshuld@ti.com>, <d-gole@ti.com>, <b-padhi@ti.com>,\n <vigneshr@ti.com>, <trini@konsulko.com>, <nm@ti.com>,\n <robertcnelson@gmail.com>, <w.egorov@phytec.de>,\n <francesco.dolcini@toradex.com>, <ggiordano@phytec.com>,\n <m-chawdhry@ti.com>, <afd@ti.com>, <bb@ti.com>, <u-kumar1@ti.com>,\n <devarsht@ti.com>, <ilias.apalodimas@linaro.org>, <xypron.glpk@gmx.de>", "Subject": "[PATCH v10 05/11] arm: armv8: mmu: add mem_map_from_dram_banks", "Date": "Fri, 10 Oct 2025 19:14:11 +0530", "Message-ID": "<20251010134424.3835757-6-anshuld@ti.com>", "X-Mailer": "git-send-email 2.51.0", "In-Reply-To": "<20251010134424.3835757-1-anshuld@ti.com>", "References": "<20251010134424.3835757-1-anshuld@ti.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-C2ProcessedOrg": "333ef613-75bf-4e12-a4b1-8e3623f5dcea", "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": "For armv8, U-Boot uses a static map defined as 'mem_map' for configuring\nthe MMU as part of mmu_setup.\n\nBut since the exact configuration of memory banks might not be known at\nbuild time, many platforms such as imx9, versal2 etc. utilize\ngd->bd->bi_dram to configure the static map at runtime.\n\nTherefore this patch adds a new API mem_map_from_dram_banks that\nmodifies the static map in a similar way. Allowing the caller to map all\ndram banks by just passing the index to last entry in their mem_map and\nit's length.\n\nReviewed-by: Dhruva Gole <d-gole@ti.com>\nSigned-off-by: Anshul Dalal <anshuld@ti.com>\nTested-by: Wadim Egorov <w.egorov@phytec.de>\n---\n arch/arm/cpu/armv8/cache_v8.c | 28 ++++++++++++++++++++++++++++\n arch/arm/include/asm/armv8/mmu.h | 11 +++++++++++\n 2 files changed, 39 insertions(+)", "diff": "diff --git a/arch/arm/cpu/armv8/cache_v8.c b/arch/arm/cpu/armv8/cache_v8.c\nindex 74c78cb2fb0..9b3c37dae82 100644\n--- a/arch/arm/cpu/armv8/cache_v8.c\n+++ b/arch/arm/cpu/armv8/cache_v8.c\n@@ -58,6 +58,34 @@ static int get_effective_el(void)\n \treturn el;\n }\n \n+int mem_map_from_dram_banks(unsigned int index, unsigned int len, u64 attrs)\n+{\n+\tunsigned int i;\n+\tint ret = fdtdec_setup_memory_banksize();\n+\n+\tif (ret) {\n+\t\tlog_err(\"%s: Failed to setup dram banks\\n\", __func__);\n+\t\treturn ret;\n+\t}\n+\n+\tif (index + CONFIG_NR_DRAM_BANKS >= len) {\n+\t\tlog_err(\"%s: Provided mem_map array has insufficient size for DRAM entries\\n\",\n+\t\t\t__func__);\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\tfor (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {\n+\t\tmem_map[index].virt = gd->bd->bi_dram[i].start;\n+\t\tmem_map[index].phys = gd->bd->bi_dram[i].start;\n+\t\tmem_map[index].size = gd->bd->bi_dram[i].size;\n+\t\tmem_map[index].attrs = attrs;\n+\t\tindex++;\n+\t}\n+\n+\tmemset(&mem_map[index], 0, sizeof(mem_map[index]));\n+\n+\treturn 0;\n+}\n u64 get_tcr(u64 *pips, u64 *pva_bits)\n {\n \tint el = get_effective_el();\ndiff --git a/arch/arm/include/asm/armv8/mmu.h b/arch/arm/include/asm/armv8/mmu.h\nindex 3807c702fb6..6e7a3366844 100644\n--- a/arch/arm/include/asm/armv8/mmu.h\n+++ b/arch/arm/include/asm/armv8/mmu.h\n@@ -194,8 +194,19 @@ struct mm_region {\n \tu64 attrs;\n };\n \n+/* Used as the memory map for MMU configuration by mmu_setup */\n extern struct mm_region *mem_map;\n void setup_pgtables(void);\n+\n+/**\n+ * mem_map_from_dram_banks() - Populate mem_map with entries corresponding to\n+ * dram banks as per the gd. This should be called prior to mmu_setup.\n+ *\n+ * @index: The entry in mem_map to start the over-write\n+ * @len: The size of mem_map\n+ */\n+int mem_map_from_dram_banks(unsigned int index, unsigned int len, u64 attrs);\n+\n u64 get_tcr(u64 *pips, u64 *pva_bits);\n \n /**\n", "prefixes": [ "v10", "05/11" ] }