{"id":2000263,"url":"http://patchwork.ozlabs.org/api/patches/2000263/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/dba4d8f0e194354cc11cfdf39212fef61fac89f5.1729577070.git.jan.kiszka@siemens.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/projects/18/?format=json","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":"<dba4d8f0e194354cc11cfdf39212fef61fac89f5.1729577070.git.jan.kiszka@siemens.com>","list_archive_url":null,"date":"2024-10-22T06:04:22","name":"[v2,05/13] board: siemens: iot2050: Generalize the fdt fixup","commit_ref":"bb89e03dd42a8a8a0131dcfbbaabe2385c0b4669","pull_url":null,"state":"accepted","archived":false,"hash":"2995da0a846998325cc2fc22ec0c71100af2ce59","submitter":{"id":710,"url":"http://patchwork.ozlabs.org/api/people/710/?format=json","name":"Jan Kiszka","email":"jan.kiszka@siemens.com"},"delegate":{"id":3651,"url":"http://patchwork.ozlabs.org/api/users/3651/?format=json","username":"trini","first_name":"Tom","last_name":"Rini","email":"trini@ti.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/dba4d8f0e194354cc11cfdf39212fef61fac89f5.1729577070.git.jan.kiszka@siemens.com/mbox/","series":[{"id":429111,"url":"http://patchwork.ozlabs.org/api/series/429111/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=429111","date":"2024-10-22T06:04:17","name":"boards: siemens: iot2050: SM variant, sysinfo support, fixes & cleanups","version":2,"mbox":"http://patchwork.ozlabs.org/series/429111/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2000263/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2000263/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 secure) header.d=siemens.com header.i=jan.kiszka@siemens.com\n header.a=rsa-sha256 header.s=fm1 header.b=ThXvFVv/;\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=reject dis=none) header.from=siemens.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 secure) header.d=siemens.com header.i=jan.kiszka@siemens.com\n header.b=\"ThXvFVv/\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=siemens.com","phobos.denx.de;\n spf=pass smtp.mailfrom=jan.kiszka@siemens.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 4XXhVr0FFJz1xtp\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 22 Oct 2024 17:05:40 +1100 (AEDT)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 819428905F;\n\tTue, 22 Oct 2024 08:04:42 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id CE9C288F28; Tue, 22 Oct 2024 08:04:37 +0200 (CEST)","from mta-64-226.siemens.flowmailer.net\n (mta-64-226.siemens.flowmailer.net [185.136.64.226])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 15CF088F66\n for <u-boot@lists.denx.de>; Tue, 22 Oct 2024 08:04:33 +0200 (CEST)","by mta-64-226.siemens.flowmailer.net with ESMTPSA id\n 202410220604326caac37a2e5faf40e9 for <u-boot@lists.denx.de>;\n Tue, 22 Oct 2024 08:04:32 +0200"],"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,DKIMWL_WL_MED,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,\n SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1;\n d=siemens.com; i=jan.kiszka@siemens.com;\n h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To;\n bh=b8CWqpHNIJYEj9JLsGa35ZfQxwxSA8aisUiLuWwjW+A=;\n b=ThXvFVv/LacbN0YMYNUo9Pg8jzEVD+mJQwvq9P67CAjTL/tAt3p+nRa+jIC7Au48QEUCrl\n skO95Nx9oiHsybWBpz0ctoUHTjGR3YiWC35NFrTQ/wDCZmYEA2j2hJS82lXcX5fSoUjqW+7h\n 3L4ZuCDoel/8iMbJqbCOAabuBCdGm8Jsbej7Praj6DnBto5AU8JnTkp1+k2al40l7JbPcp8v\n LlkWCaHLOKEGaXFP6OTtnSeB4nz2VQMy/2ocysfgj2HyUkxafZ+weO53wJ12PiJTrP1HVA9b\n wkoVyyaznPp2CR66Z+IwkZK7pY8BS6OQCo/to7fMAvK7o3zs3dAi/Hlg==;","From":"Jan Kiszka <jan.kiszka@siemens.com>","To":"U-Boot Mailing List <u-boot@lists.denx.de>","Cc":"Bryan Brattlof <bb@ti.com>,\n\tNishanth Menon <nm@ti.com>","Subject":"[PATCH v2 05/13] board: siemens: iot2050: Generalize the fdt fixup","Date":"Tue, 22 Oct 2024 08:04:22 +0200","Message-ID":"\n <dba4d8f0e194354cc11cfdf39212fef61fac89f5.1729577070.git.jan.kiszka@siemens.com>","In-Reply-To":"<cover.1729577070.git.jan.kiszka@siemens.com>","References":"<cover.1729577070.git.jan.kiszka@siemens.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Flowmailer-Platform":"Siemens","Feedback-ID":"519:519-294854:519-21489:flowmailer","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":"From: Baocheng Su <baocheng.su@siemens.com>\n\nThe fdt fixup logic actually also applies to other possible variants who\nalso have device tree overlays. So generalize this part by extracting\nit from the m.2 specific function and make it a standalone one.\n\nSince now we only have M.2 variant consuming the overlay, it may not\nhave immediate effect for other variant, however this makes the future\nvariant more easier to apply fdt fixups.\n\nSigned-off-by: Baocheng Su <baocheng.su@siemens.com>\nSigned-off-by: Jan Kiszka <jan.kiszka@siemens.com>\n---\n board/siemens/iot2050/board.c | 32 +++++++++++++++++++-------------\n 1 file changed, 19 insertions(+), 13 deletions(-)","diff":"diff --git a/board/siemens/iot2050/board.c b/board/siemens/iot2050/board.c\nindex 16082ae2afe..fad6bc04735 100644\n--- a/board/siemens/iot2050/board.c\n+++ b/board/siemens/iot2050/board.c\n@@ -245,23 +245,14 @@ void set_board_info_env(void)\n \tenv_save();\n }\n \n-static void m2_overlay_prepare(void)\n+static void do_overlay_prepare(const char *overlay_path)\n {\n #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)\n-\tconst char *overlay_path;\n \tvoid *overlay;\n \tu64 loadaddr;\n \tofnode node;\n \tint ret;\n \n-\tif (connector_mode == BKEY_PCIEX2)\n-\t\treturn;\n-\n-\tif (connector_mode == BKEY_PCIE_EKEY_PCIE)\n-\t\toverlay_path = \"/fit-images/bkey-ekey-pcie-overlay\";\n-\telse\n-\t\toverlay_path = \"/fit-images/bkey-usb3-overlay\";\n-\n \tnode = ofnode_path(overlay_path);\n \tif (!ofnode_valid(node))\n \t\tgoto fit_error;\n@@ -288,6 +279,21 @@ fit_error:\n #endif\n }\n \n+static void m2_overlay_prepare(void)\n+{\n+\tconst char *overlay_path;\n+\n+\tif (connector_mode == BKEY_PCIEX2)\n+\t\treturn;\n+\n+\tif (connector_mode == BKEY_PCIE_EKEY_PCIE)\n+\t\toverlay_path = \"/fit-images/bkey-ekey-pcie-overlay\";\n+\telse\n+\t\toverlay_path = \"/fit-images/bkey-usb3-overlay\";\n+\n+\tdo_overlay_prepare(overlay_path);\n+}\n+\n static void m2_connector_setup(void)\n {\n \tulong m2_manual_config = env_get_ulong(\"m2_manual_config\", 10,\n@@ -466,7 +472,7 @@ int board_late_init(void)\n }\n \n #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)\n-static void m2_fdt_fixup(void *blob)\n+static void variants_fdt_fixup(void *blob)\n {\n \tvoid *overlay_copy = NULL;\n \tvoid *fdt_copy = NULL;\n@@ -506,14 +512,14 @@ cleanup:\n \treturn;\n \n fixup_error:\n-\tpr_err(\"Could not apply M.2 device tree overlay\\n\");\n+\tpr_err(\"Could not apply device tree overlay\\n\");\n \tgoto cleanup;\n }\n \n int ft_board_setup(void *blob, struct bd_info *bd)\n {\n \tif (board_is_m2())\n-\t\tm2_fdt_fixup(blob);\n+\t\tvariants_fdt_fixup(blob);\n \n \treturn 0;\n }\n","prefixes":["v2","05/13"]}