[{"id":3677256,"web_url":"http://patchwork.ozlabs.org/comment/3677256/","msgid":"<20260414151856.GL41863@bill-the-cat>","list_archive_url":null,"date":"2026-04-14T15:18:56","subject":"Re: [PATCH] common: spl: nand: improve u-boot offsets overriding","submitter":{"id":65875,"url":"http://patchwork.ozlabs.org/api/people/65875/","name":"Tom Rini","email":"trini@konsulko.com"},"content":"On Tue, Apr 14, 2026 at 04:03:21PM +0800, Weijie Gao wrote:\n\n> This patch introduces spl_nand_get_uboot_raw_page_redund() to wrap the\n> CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND macro, similar as what\n> spl_nand_get_uboot_raw_page() has already done.\n> Also, make it possible to use these functions without defining related\n> macros.\n> \n> This patch also replaces all references to CONFIG_SYS_NAND_U_BOOT_OFFS and\n> CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND with the return value of the two\n> functions mentioned above.\n> \n> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>\n> ---\n>  common/spl/spl_nand.c | 38 ++++++++++++++++++++++++++------------\n>  1 file changed, 26 insertions(+), 12 deletions(-)\n> \n> diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c\n> index f449b31f594..cce2e1a6df3 100644\n> --- a/common/spl/spl_nand.c\n> +++ b/common/spl/spl_nand.c\n> @@ -18,21 +18,34 @@\n>  \n>  uint32_t __weak spl_nand_get_uboot_raw_page(void)\n>  {\n> +#ifdef CONFIG_SYS_NAND_U_BOOT_OFFS\n>  \treturn CONFIG_SYS_NAND_U_BOOT_OFFS;\n> +#else\n> +\treturn 0;\n> +#endif\n> +}\n> +\n> +uint32_t __weak spl_nand_get_uboot_raw_page_redund(void)\n> +{\n> +#ifdef CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND\n> +\treturn CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND;\n> +#else\n> +\treturn 0;\n> +#endif\n>  }\n\nThis is closer, but not quite what I was thinking. We should be able to\nuse IF_ENABLED_INT to get either the real value of\nCONFIG_SYS_NAND_U_BOOT_OFFS_REDUND or 0, and then maybe (maybe not)\nclean up the rest of these changes a bit more. Thanks!","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=konsulko.com header.i=@konsulko.com header.a=rsa-sha256\n header.s=google header.b=W6DNtbec;\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=konsulko.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=konsulko.com header.i=@konsulko.com\n header.b=\"W6DNtbec\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=konsulko.com","phobos.denx.de;\n spf=pass smtp.mailfrom=trini@konsulko.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) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fw7Gn3GGsz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 01:19:13 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 85318841F2;\n\tTue, 14 Apr 2026 17:19:05 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 1E88C8421D; Tue, 14 Apr 2026 17:19:04 +0200 (CEST)","from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com\n [IPv6:2607:f8b0:4864:20::32e])\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 8EB5083015\n for <u-boot@lists.denx.de>; Tue, 14 Apr 2026 17:19:00 +0200 (CEST)","by mail-ot1-x32e.google.com with SMTP id\n 46e09a7af769-7dbce74e537so4475048a34.1\n for <u-boot@lists.denx.de>; Tue, 14 Apr 2026 08:19:00 -0700 (PDT)","from bill-the-cat (fixed-189-203-106-235.totalplay.net.\n [189.203.106.235]) by smtp.gmail.com with ESMTPSA id\n 46e09a7af769-7dc2696532bsm10846464a34.21.2026.04.14.08.18.58\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 14 Apr 2026 08:18:58 -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=konsulko.com; s=google; t=1776179939; x=1776784739; darn=lists.denx.de;\n h=in-reply-to:content-disposition:mime-version:references:message-id\n :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;\n bh=JHwA7wQCQiWABQVWWMXB1iuppdcPxBZxxFnGdHywpl4=;\n b=W6DNtbecmn8g7Sxyrw0Kklg1GOwf3LxoDeKnRGupuf5LjKEVbwuq4DMZbGUNx5R9Qm\n 2iLnLlw/LRvIm2NawVm0fgeT+ko5cTd2wQ/TjqgQEkIpAiJMhM+go7+qCVh/wtbhEVXk\n 8JwOHrdk/mwf3S56fe+jD0XzbY4vYWEbfEFCA=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776179939; x=1776784739;\n h=in-reply-to:content-disposition:mime-version:references:message-id\n :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=JHwA7wQCQiWABQVWWMXB1iuppdcPxBZxxFnGdHywpl4=;\n b=oVYdrU0vu3/VFYd0hQEAXD92cYn3UEhA6sm6kK8yAy1bgw2wwlRp4m8Ftwufymn+v/\n h6lOVETiXosAtMFNhMyHvxTc5HGdbMHzW5MlNufP4IDohKjBJ974cV1Mv089M+lfjACk\n R0dH365ailbbqM11K40DGHdCGIsXCVkxGDIOWYw0FlKLpXmnLHB21/ggpLZ8pQg6IxlW\n KCx5hyArq7zV9wzRvbA1iCOKVIh387HZr7/wmUkPwFvDEp080pAhLq3LQzCMeOH4Uhb2\n fHQGtkuhRHIgjbNTtHUsS+u6ibGDdyrEcJjtczfvFXRMIj/ClnZnmNda86a2oLqnUF+w\n s4iQ==","X-Gm-Message-State":"AOJu0Yx3lscRJktYe4upMyPFwvv1S1oq+0NM9sg3mN57T/DR5YZyOc2Q\n ocrpy+oDxVSCzEysz8Eb71EaBkdT4GLV++W5yM+toEhORGLhVyLaDp3iXfLyKBTl4tI=","X-Gm-Gg":"AeBDievzU5Ndncy6sitC3scgsrD9let/SKbhxIpXFRX291rk7pvO5GnqSHFKFlNNq9a\n 1DEzVNck55eie7RrOYQt02lGFPdEyXHdSSmPX5ifCauxDgnE6xKlT+9VlzPIJO3U28j3Kabhfgo\n ADbmbp/L+l96tri1uJo/i1uPJg1xdkB20qz6FVnQd4sz+0mtft0kZcONXN2RLUdfU2kUohONHad\n MDnAziYYJ7XPpSagCnQpKSNmLLw85eHCzB09YDikSCHBgYGE8JdJWJ5L6XoSdCAZ+g6YLH5WNJA\n m5evVBJ0sdwe13YQ1Mi12r1iHS6TGIRypffq/E5t/hZmK4KiAL+LOq5rnxW6JzFji20DlLtoNa0\n vImZ4tOS4pcY/W9hBIBvzVPM/49oXNqDNP/lPdC67suT1doz5VchasGmXUp5+tNEiEvGE4ordI+\n l7iXTdLjZT9MR4REM7swTtptD+qWEg3ZFopu3u0mjpqqPGSRizNeTcFWdd6OenBAgGDJXiM4mT6\n XPlUyRPoA2KMWT2XkiOO5aYiJuj1C5Du31jnFrEnV/Wtn1zuJk=","X-Received":"by 2002:a05:6830:2684:b0:7db:a832:b329 with SMTP id\n 46e09a7af769-7dc27f02d10mr9990731a34.21.1776179939103;\n Tue, 14 Apr 2026 08:18:59 -0700 (PDT)","Date":"Tue, 14 Apr 2026 09:18:56 -0600","From":"Tom Rini <trini@konsulko.com>","To":"Weijie Gao <weijie.gao@mediatek.com>","Cc":"u-boot@lists.denx.de,\n GSS_MTK_Uboot_upstream <GSS_MTK_Uboot_upstream@mediatek.com>","Subject":"Re: [PATCH] common: spl: nand: improve u-boot offsets overriding","Message-ID":"<20260414151856.GL41863@bill-the-cat>","References":"<20260414080321.39542-1-weijie.gao@mediatek.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha512;\n protocol=\"application/pgp-signature\"; boundary=\"hrxqCB6tsDIKhII5\"","Content-Disposition":"inline","In-Reply-To":"<20260414080321.39542-1-weijie.gao@mediatek.com>","X-Clacks-Overhead":"GNU Terry Pratchett","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"}}]