From: Tom Rini <trini@konsulko.com>
To: Weijie Gao <weijie.gao@mediatek.com>
Cc: u-boot@lists.denx.de,
GSS_MTK_Uboot_upstream <GSS_MTK_Uboot_upstream@mediatek.com>
Subject: Re: [PATCH] common: spl: nand: improve u-boot offsets overriding
Date: Tue, 14 Apr 2026 09:18:56 -0600 [thread overview]
Message-ID: <20260414151856.GL41863@bill-the-cat> (raw)
In-Reply-To: <20260414080321.39542-1-weijie.gao@mediatek.com>
[-- Attachment #1: Type: text/plain, Size: 1558 bytes --]
On Tue, Apr 14, 2026 at 04:03:21PM +0800, Weijie Gao wrote:
> This patch introduces spl_nand_get_uboot_raw_page_redund() to wrap the
> CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND macro, similar as what
> spl_nand_get_uboot_raw_page() has already done.
> Also, make it possible to use these functions without defining related
> macros.
>
> This patch also replaces all references to CONFIG_SYS_NAND_U_BOOT_OFFS and
> CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND with the return value of the two
> functions mentioned above.
>
> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
> ---
> common/spl/spl_nand.c | 38 ++++++++++++++++++++++++++------------
> 1 file changed, 26 insertions(+), 12 deletions(-)
>
> diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
> index f449b31f594..cce2e1a6df3 100644
> --- a/common/spl/spl_nand.c
> +++ b/common/spl/spl_nand.c
> @@ -18,21 +18,34 @@
>
> uint32_t __weak spl_nand_get_uboot_raw_page(void)
> {
> +#ifdef CONFIG_SYS_NAND_U_BOOT_OFFS
> return CONFIG_SYS_NAND_U_BOOT_OFFS;
> +#else
> + return 0;
> +#endif
> +}
> +
> +uint32_t __weak spl_nand_get_uboot_raw_page_redund(void)
> +{
> +#ifdef CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND
> + return CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND;
> +#else
> + return 0;
> +#endif
> }
This is closer, but not quite what I was thinking. We should be able to
use IF_ENABLED_INT to get either the real value of
CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND or 0, and then maybe (maybe not)
clean up the rest of these changes a bit more. Thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2026-04-14 15:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-14 8:03 [PATCH] common: spl: nand: improve u-boot offsets overriding Weijie Gao
2026-04-14 15:18 ` Tom Rini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260414151856.GL41863@bill-the-cat \
--to=trini@konsulko.com \
--cc=GSS_MTK_Uboot_upstream@mediatek.com \
--cc=u-boot@lists.denx.de \
--cc=weijie.gao@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox