[{"id":3669287,"web_url":"http://patchwork.ozlabs.org/comment/3669287/","msgid":"<fb6ee141-3369-45e6-8320-e91f67ec6b1e@kwiboo.se>","list_archive_url":null,"date":"2026-03-25T19:31:25","subject":"Re: [PATCH] arm: rockchip: Guard call of board_early_init_f in SPL","submitter":{"id":71439,"url":"http://patchwork.ozlabs.org/api/people/71439/","name":"Jonas Karlman","email":"jonas@kwiboo.se"},"content":"Hi Tom,\n\nOn 3/25/2026 8:00 PM, Tom Rini wrote:\n> Today, no platforms call board_early_init_f, and rockchip provides a\n> weak default function. Change this to not providing a weak function and\n> only call board_early_init_f if CONFIG_BOARD_EARLY_INIT_F is enabled.\n> This will allow any potential future needs to be taken care of, and make\n> future consolidation easier.\n> \n> Signed-off-by: Tom Rini <trini@konsulko.com>\n> ---\n> Cc: Philipp Tomsich <philipp.tomsich@vrull.eu>\n> Cc: Kever Yang <kever.yang@rock-chips.com>\n> ---\n>  arch/arm/mach-rockchip/spl.c | 8 ++------\n>  1 file changed, 2 insertions(+), 6 deletions(-)\n> \n> diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c\n> index e989c148079a..8026cc0abb8d 100644\n> --- a/arch/arm/mach-rockchip/spl.c\n> +++ b/arch/arm/mach-rockchip/spl.c\n> @@ -97,11 +97,6 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)\n>  \treturn MMCSD_MODE_RAW;\n>  }\n>  \n> -__weak int board_early_init_f(void)\n> -{\n> -\treturn 0;\n> -}\n> -\n>  __weak int arch_cpu_init(void)\n>  {\n>  \treturn 0;\n> @@ -111,7 +106,8 @@ void board_init_f(ulong dummy)\n>  {\n>  \tint ret;\n>  \n> -\tboard_early_init_f();\n> +\tif (IS_ENABLED(CONFIG_BOARD_EARLY_INIT_F))\n\nThis patch seem to introduce a change in behavior for chromebook bob and\nkevin, they do not seem to enable BOARD_EARLY_INIT_F, yet they have a\nboard_early_init_f() in board/google/gru/gru.c no longer being called\nafter this change.\n\nI do not have a chromebook_bob/kevin so I cannot help verify if this\nchange break anything, hopefully Simon can help test/verify.\n\nRegards,\nJonas\n\n> +\t\tboard_early_init_f();\n>  \n>  \tret = spl_early_init();\n>  \tif (ret) {","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=kwiboo.se header.i=@kwiboo.se header.a=rsa-sha256\n header.s=fe-e1b5cab7be header.b=Wkhw+qYZ;\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=quarantine dis=none) header.from=kwiboo.se","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=kwiboo.se header.i=@kwiboo.se header.b=\"Wkhw+qYZ\";\n\tdkim-atps=neutral","phobos.denx.de; dmarc=pass (p=quarantine dis=none)\n header.from=kwiboo.se","phobos.denx.de; spf=pass\n smtp.mailfrom=SRS0=e7f4=B2=kwiboo.se=jonas@fe-bounces.kwiboo.se"],"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 4fgxqG5971z1xy3\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 06:31:38 +1100 (AEDT)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id D147283DA6;\n\tWed, 25 Mar 2026 20:31:34 +0100 (CET)","by phobos.denx.de (Postfix, from userid 109)\n id B26EA83DA7; Wed, 25 Mar 2026 20:31:33 +0100 (CET)","from smtp.forwardemail.net (smtp.forwardemail.net [121.127.44.66])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 37D3083A41\n for <u-boot@lists.denx.de>; Wed, 25 Mar 2026 20:31:31 +0100 (CET)"],"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 RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED,\n SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se;\n h=Content-Transfer-Encoding: Content-Type: In-Reply-To: From: References:\n Cc: To: Subject: MIME-Version: Date: Message-ID; q=dns/txt;\n s=fe-e1b5cab7be; t=1774467090;\n bh=E6M1ZUYUdT/ko/elH6apWiIa6YqqVJ40EKdZsn3jGQQ=;\n b=Wkhw+qYZCTv72t3d7mcuTiO4jTn9NWnJkRVAzM9r3vHlJhTCqlnskm93B6a/dmxw4EQhCw1T7\n 1LAEVe9I4Vv1Mm3UfJF016ENGBv1o+FuYG024tNiaxIcxarWV2AkPE66aotKr7G1W+G9M8rJGAX\n nB2Rf18z0XmZLULQiBETCnN1e6irLG1dUABSMJXr0qGQxIMf/A6G14Xud8NtW3WPSsChenj5H8u\n 5MUNlSsWAYrTW3kuqhzkx1PCNTAbNNFS2r/XdhficeUEiqYe4Sol5C+kB/WyV2lqm31LX36nkfI\n L4iI16iPWscdh2VlWbgNi1NriPRfJIecyDESIw4Ec32g==","X-Forward-Email-ID":"69c43810a686125d1eb84997","X-Forward-Email-Sender":"rfc822; jonas@kwiboo.se, smtp.forwardemail.net,\n 121.127.44.66","X-Forward-Email-Version":"2.6.55","X-Forward-Email-Website":"https://forwardemail.net","X-Complaints-To":"abuse@forwardemail.net","X-Report-Abuse":"abuse@forwardemail.net","X-Report-Abuse-To":"abuse@forwardemail.net","Message-ID":"<fb6ee141-3369-45e6-8320-e91f67ec6b1e@kwiboo.se>","Date":"Wed, 25 Mar 2026 20:31:25 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH] arm: rockchip: Guard call of board_early_init_f in SPL","To":"Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>","Cc":"u-boot@lists.denx.de, Philipp Tomsich <philipp.tomsich@vrull.eu>,\n Kever Yang <kever.yang@rock-chips.com>","References":"<20260325190025.3428560-1-trini@konsulko.com>","Content-Language":"en-US","From":"Jonas Karlman <jonas@kwiboo.se>","In-Reply-To":"<20260325190025.3428560-1-trini@konsulko.com>","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"7bit","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"}},{"id":3669297,"web_url":"http://patchwork.ozlabs.org/comment/3669297/","msgid":"<CAFLszTiF4RDyo8+4RZhsNViSNquU3Ouq2fNr5NjG7PvK+2zrtg@mail.gmail.com>","list_archive_url":null,"date":"2026-03-25T19:42:28","subject":"Re: [PATCH] arm: rockchip: Guard call of board_early_init_f in SPL","submitter":{"id":6170,"url":"http://patchwork.ozlabs.org/api/people/6170/","name":"Simon Glass","email":"sjg@chromium.org"},"content":"Hi Jonas,\n\nOn Wed, 25 Mar 2026 at 13:31, Jonas Karlman <jonas@kwiboo.se> wrote:\n>\n> Hi Tom,\n>\n> On 3/25/2026 8:00 PM, Tom Rini wrote:\n> > Today, no platforms call board_early_init_f, and rockchip provides a\n> > weak default function. Change this to not providing a weak function and\n> > only call board_early_init_f if CONFIG_BOARD_EARLY_INIT_F is enabled.\n> > This will allow any potential future needs to be taken care of, and make\n> > future consolidation easier.\n> >\n> > Signed-off-by: Tom Rini <trini@konsulko.com>\n> > ---\n> > Cc: Philipp Tomsich <philipp.tomsich@vrull.eu>\n> > Cc: Kever Yang <kever.yang@rock-chips.com>\n> > ---\n> >  arch/arm/mach-rockchip/spl.c | 8 ++------\n> >  1 file changed, 2 insertions(+), 6 deletions(-)\n> >\n> > diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c\n> > index e989c148079a..8026cc0abb8d 100644\n> > --- a/arch/arm/mach-rockchip/spl.c\n> > +++ b/arch/arm/mach-rockchip/spl.c\n> > @@ -97,11 +97,6 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)\n> >       return MMCSD_MODE_RAW;\n> >  }\n> >\n> > -__weak int board_early_init_f(void)\n> > -{\n> > -     return 0;\n> > -}\n> > -\n> >  __weak int arch_cpu_init(void)\n> >  {\n> >       return 0;\n> > @@ -111,7 +106,8 @@ void board_init_f(ulong dummy)\n> >  {\n> >       int ret;\n> >\n> > -     board_early_init_f();\n> > +     if (IS_ENABLED(CONFIG_BOARD_EARLY_INIT_F))\n>\n> This patch seem to introduce a change in behavior for chromebook bob and\n> kevin, they do not seem to enable BOARD_EARLY_INIT_F, yet they have a\n> board_early_init_f() in board/google/gru/gru.c no longer being called\n> after this change.\n>\n> I do not have a chromebook_bob/kevin so I cannot help verify if this\n> change break anything, hopefully Simon can help test/verify.\n\nKevin spews some junk to the console with or without this patch.\n\nNo change observed on bob or kevin. BTW both are in the lab so you\nshould be able to test if you push to your tree.\n\nTested-by: Simon Glass <sjg@chromium.org>  # chromebook_kevin\nTested-by: Simon Glass <sjg@chromium.org>  # chromebook_bob\n\n>\n> > +             board_early_init_f();\n> >\n> >       ret = spl_early_init();\n> >       if (ret) {\n>\n\nRegards,\nSimon","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=chromium.org header.i=@chromium.org header.a=rsa-sha256\n header.s=google header.b=dbzqxqy8;\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=chromium.org","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=chromium.org header.i=@chromium.org\n header.b=\"dbzqxqy8\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org","phobos.denx.de;\n spf=pass smtp.mailfrom=sjg@chromium.org"],"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)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fgy4F1vFgz1y1x\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 06:42:53 +1100 (AEDT)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id BC97D83DA6;\n\tWed, 25 Mar 2026 20:42:44 +0100 (CET)","by phobos.denx.de (Postfix, from userid 109)\n id BDCB283A91; Wed, 25 Mar 2026 20:42:42 +0100 (CET)","from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com\n [IPv6:2a00:1450:4864:20::52c])\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 B12E183A91\n for <u-boot@lists.denx.de>; Wed, 25 Mar 2026 20:42:40 +0100 (CET)","by mail-ed1-x52c.google.com with SMTP id\n 4fb4d7f45d1cf-661b16ac011so287345a12.2\n for <u-boot@lists.denx.de>; Wed, 25 Mar 2026 12:42:40 -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,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2","ARC-Seal":"i=1; a=rsa-sha256; t=1774467760; cv=none;\n d=google.com; s=arc-20240605;\n b=VUoClnhAP55ozCY5E2UjFphaQTMg0dAY1ylpIpmCoa6R0ub1e4TA81l+OXNfKTVrVK\n 6tdICaElSQg+8XEpfzos0TUTUuYSbhlTPq2HhY9qI7c9JhpyuEHx1MN3QcuD4hNWYXJa\n z/G3sI8pE0RfiM9LXh2lnC96u1N9GKuepXiLz/06rreW98fh8FxY38zYOHk3LDBLgzu/\n QuPrUmQmmK0Y+78Tl3e2ZikQgatu6gb/r+bqtHVFbYxUCPUiHlWLrSkO6racJQptue75\n UpuraGo5+oYR6Hagc0a9nw+FXf6e/927O84lpPtukevtcTKEDeN7ElMq+U4VuIjoJkmG\n OVhQ==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=5KdlOta9gDf3G5L7GzqGhhU+oGp5xOQdettJOiUCQM4=;\n fh=mBbzgUwAC/cvA9PajMg/FGw60vI/H1uvB8EZSssaSW4=;\n b=cj0jG5MFNi4eru8EiGXBgBH5K1xV+W4EHkqUED5IY6Oj828pDs8iaLDvX6csAevsSz\n IodqUW2CveyHkhB/kykj2pPrrEFDPXAvXlK61EadJJyPsYm+lFYliCadAPir1V3BFN5W\n h5T96prG21cV55u91OUDKxn9RUwrTfJ4cLZlmud+DNcGHQuPdzT6djsQfW39SKqKAfIC\n vO2xS30ECuj8VGzRw8+5O6KK44d4/+W2j4DuzFgrTu0XGmx9Q2SxwHbwDMlXN2GVzRWn\n 0dkE1wpAHuCNDPHp7/XMhGkvHKaXsZYpVMaVy97cMiTT01h0NOidFID7byNiMHinryCK\n LE3A==; darn=lists.denx.de","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=chromium.org; s=google; t=1774467760; x=1775072560; darn=lists.denx.de;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=5KdlOta9gDf3G5L7GzqGhhU+oGp5xOQdettJOiUCQM4=;\n b=dbzqxqy8HEips3UP3Y7rCc4sF4J4hcDccjYNKSoEzzmLHv78IVjdUM9fGfoEa29EhY\n fFH0wJdz1k7WaOn+1RiAZlVCKRp/B0TL5kTxkhtlMiU5uDzWIhQWLt2L/XeH55lm8zqw\n CmYtFNTE4vZogYjvtyhfhjCq5pgiOyA8UgnRg=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774467760; x=1775072560;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=5KdlOta9gDf3G5L7GzqGhhU+oGp5xOQdettJOiUCQM4=;\n b=HbBif6/TuC0WeQMnLa29RGjHievTvCVqGt66QdylPV7pghvqjLxSiaqXq6Alu0KBY/\n hFEJ//vwawOiIktIfnLi7RYNTk1oFB0iAj3LqcT4RDqksWO5Ei1/AK+xD71JjOjpXSSQ\n jl7b7SO4VMx2hoRSMIl09ajw15ealTTQHC5Id0fBWtuEPb0V+1weZJhYOliz1cmSc2Bv\n +x6QyV5mmIqJOJ4ca93IdnAf+8+10B6hCLuuQoHVEoj4T/xqomcsnCXyV2Lw6NAyeolX\n cUEJGWetEFdlmWhFEWwf7lasmWkLX98grZLpnJXf1Lu+pOuZp9UveDkEqLJW5tccIEb4\n iPUA==","X-Forwarded-Encrypted":"i=1;\n AJvYcCVQTa416A02TJwz5o/ktpMNSXrtjVTxV6pvifIFGGvNOBMAPa/I7uU1Tqph/IE16NjdIbHxHZs=@lists.denx.de","X-Gm-Message-State":"AOJu0YwGblG16KrBr6ARaeeCiPz2TrmG5zH8O5JboavofXqRcQMrxCv5\n wF4ItypkFcZC66ie9D1NYTewkVSASsnCnu9bdWrm7KpG3DV1e1lUcSifvb7QyyEU7JO0I6/aevQ\n /0L0XBPquTx7xZQOD0qlRnG9Y9w+Niq2jnKAiPK2xfr4FW4FIUhH2mBcD","X-Gm-Gg":"ATEYQzyaAEIGdBv+GJ2NtJHD3h5BObcfKNlUFgqx5dR9XaNv1MKidKvt+qSlQH5eDUL\n Xjc3E9NPpJ2WKda5U9m19msZy/RgqXQeS9MRMjUMxEFkLovU0bVBxBPBpEgYEjf99gSkd3IYFcQ\n 5VT5XeFWo5nubOaJcJKhVhS9IAzwb3AFv+GkJ7Lfz1wnndhxdAGUiNB4Xkl3DzBAV3IRj+j0rFH\n CZtMb8A2rebVYZH2tipcOYlEn0wcXPksWII3D5sM7KCf4nBMaxjDONlcX2kiGaOZDNt+PZjOo2R\n iuNdCMc=","X-Received":"by 2002:a17:907:9997:b0:b98:32c1:249d with SMTP id\n a640c23a62f3a-b9a3f17037fmr373690066b.5.1774467760138; Wed, 25 Mar 2026\n 12:42:40 -0700 (PDT)","MIME-Version":"1.0","References":"<20260325190025.3428560-1-trini@konsulko.com>\n <fb6ee141-3369-45e6-8320-e91f67ec6b1e@kwiboo.se>","In-Reply-To":"<fb6ee141-3369-45e6-8320-e91f67ec6b1e@kwiboo.se>","From":"Simon Glass <sjg@chromium.org>","Date":"Wed, 25 Mar 2026 13:42:28 -0600","X-Gm-Features":"AQROBzBoi9JsxD6LYmGvM1jQY6bNUVelxxJ_5TdRCWHxCEPCnQ0fOJP4WMCWMOs","Message-ID":"\n <CAFLszTiF4RDyo8+4RZhsNViSNquU3Ouq2fNr5NjG7PvK+2zrtg@mail.gmail.com>","Subject":"Re: [PATCH] arm: rockchip: Guard call of board_early_init_f in SPL","To":"Jonas Karlman <jonas@kwiboo.se>","Cc":"Tom Rini <trini@konsulko.com>, u-boot@lists.denx.de,\n Philipp Tomsich <philipp.tomsich@vrull.eu>,\n Kever Yang <kever.yang@rock-chips.com>","Content-Type":"text/plain; charset=\"UTF-8\"","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"}},{"id":3669299,"web_url":"http://patchwork.ozlabs.org/comment/3669299/","msgid":"<20260325195129.GX502704@bill-the-cat>","list_archive_url":null,"date":"2026-03-25T19:51:29","subject":"Re: [PATCH] arm: rockchip: Guard call of board_early_init_f in SPL","submitter":{"id":65875,"url":"http://patchwork.ozlabs.org/api/people/65875/","name":"Tom Rini","email":"trini@konsulko.com"},"content":"On Wed, Mar 25, 2026 at 01:42:28PM -0600, Simon Glass wrote:\n> Hi Jonas,\n> \n> On Wed, 25 Mar 2026 at 13:31, Jonas Karlman <jonas@kwiboo.se> wrote:\n> >\n> > Hi Tom,\n> >\n> > On 3/25/2026 8:00 PM, Tom Rini wrote:\n> > > Today, no platforms call board_early_init_f, and rockchip provides a\n> > > weak default function. Change this to not providing a weak function and\n> > > only call board_early_init_f if CONFIG_BOARD_EARLY_INIT_F is enabled.\n> > > This will allow any potential future needs to be taken care of, and make\n> > > future consolidation easier.\n> > >\n> > > Signed-off-by: Tom Rini <trini@konsulko.com>\n> > > ---\n> > > Cc: Philipp Tomsich <philipp.tomsich@vrull.eu>\n> > > Cc: Kever Yang <kever.yang@rock-chips.com>\n> > > ---\n> > >  arch/arm/mach-rockchip/spl.c | 8 ++------\n> > >  1 file changed, 2 insertions(+), 6 deletions(-)\n> > >\n> > > diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c\n> > > index e989c148079a..8026cc0abb8d 100644\n> > > --- a/arch/arm/mach-rockchip/spl.c\n> > > +++ b/arch/arm/mach-rockchip/spl.c\n> > > @@ -97,11 +97,6 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)\n> > >       return MMCSD_MODE_RAW;\n> > >  }\n> > >\n> > > -__weak int board_early_init_f(void)\n> > > -{\n> > > -     return 0;\n> > > -}\n> > > -\n> > >  __weak int arch_cpu_init(void)\n> > >  {\n> > >       return 0;\n> > > @@ -111,7 +106,8 @@ void board_init_f(ulong dummy)\n> > >  {\n> > >       int ret;\n> > >\n> > > -     board_early_init_f();\n> > > +     if (IS_ENABLED(CONFIG_BOARD_EARLY_INIT_F))\n> >\n> > This patch seem to introduce a change in behavior for chromebook bob and\n> > kevin, they do not seem to enable BOARD_EARLY_INIT_F, yet they have a\n> > board_early_init_f() in board/google/gru/gru.c no longer being called\n> > after this change.\n\nI wouldn't call it a behavior change, since it's not called now, and\nthis is the output from building before/after, checking for size\ndiffernces (and how I spotted odd cases as part of this overall work):\n\n            chromebook_bob : spl/u-boot-spl:all -8 spl/u-boot-spl:text -8\n               spl-u-boot-spl: add: 0/-1, grow: 0/-1 bytes: 0/-12 (-12)\n                 function                                   old     new   delta\n                 board_init_f                               148     144      -4\n                 board_early_init_f                           8       -      -8\n            chromebook_kevin: spl/u-boot-spl:all -8 spl/u-boot-spl:text -8\n               spl-u-boot-spl: add: 0/-1, grow: 0/-1 bytes: 0/-12 (-12)\n                 function                                   old     new   delta\n                 board_init_f                               148     144      -4\n                 board_early_init_f                           8       -      -8\n\n\n> > I do not have a chromebook_bob/kevin so I cannot help verify if this\n> > change break anything, hopefully Simon can help test/verify.\n> \n> Kevin spews some junk to the console with or without this patch.\n> \n> No change observed on bob or kevin. BTW both are in the lab so you\n> should be able to test if you push to your tree.\n> \n> Tested-by: Simon Glass <sjg@chromium.org>  # chromebook_kevin\n> Tested-by: Simon Glass <sjg@chromium.org>  # chromebook_bob\n\nPerhaps the problem is those platforms should be enabling, but lost.\nI'll take a look, but would be unrelated to this (since if enabling\nBOARD_EARLY_INIT_F it would then call it).","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=qni1LLfA;\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=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=\"qni1LLfA\";\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 [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 4fgyGN2dkhz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 06:51:40 +1100 (AEDT)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 14C4683DA6;\n\tWed, 25 Mar 2026 20:51:37 +0100 (CET)","by phobos.denx.de (Postfix, from userid 109)\n id 65E8B83DA7; Wed, 25 Mar 2026 20:51:36 +0100 (CET)","from mail-oo1-xc2a.google.com (mail-oo1-xc2a.google.com\n [IPv6:2607:f8b0:4864:20::c2a])\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 2883E83A91\n for <u-boot@lists.denx.de>; Wed, 25 Mar 2026 20:51:34 +0100 (CET)","by mail-oo1-xc2a.google.com with SMTP id\n 006d021491bc7-67934c83063so149808eaf.0\n for <u-boot@lists.denx.de>; Wed, 25 Mar 2026 12:51:34 -0700 (PDT)","from bill-the-cat (fixed-189-203-97-235.totalplay.net.\n [189.203.97.235]) by smtp.gmail.com with ESMTPSA id\n 006d021491bc7-67e0aaf8185sm546769eaf.11.2026.03.25.12.51.31\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 25 Mar 2026 12:51:32 -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=1774468293; x=1775073093; 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=nuZkAFVgBUOBLDY4NsN1HMcknaC5TrhnOrJHRn7q2ic=;\n b=qni1LLfAEGfDh9pUAKI/49A3i7dWQMsdaVoZau+BDQWLNqIJIlpGFdWqUcrVIULAnG\n 3NIh3FJ/8TDqi+IZt/UKJoD3umFvIHBPQUailhNvniIl6tMGioZ1shU6G3fPFnxei5Fb\n o68UDkyW4fq6QbTJ2yC/hKVIOvmF5krwdovvs=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774468293; x=1775073093;\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=nuZkAFVgBUOBLDY4NsN1HMcknaC5TrhnOrJHRn7q2ic=;\n b=tLonFkbYQSY9bnpOHHjMzX6Ci1XyTCR0kBzvny1DgayUJpgqDFB8BnFUZG4nMyStfc\n MXV0MSYibvvXdxszqoQ5sQ9GoyBThflkWDqI1xeM4uAY0BQXGUBPAFud+sV4deMvU7G4\n N0ThZDWq/XdubYXLVnLb1gGxokdvZJLxRqB7lzPm5XL/r4aXADRnZ/3qRAdRO2zhT4Iz\n c1LxmkEE2L8Ol8nhTSe29hbdf1LqLMDb0il2EsFHYmwvBTRkgMRmaIEN1t+PFMAXgo0u\n kZeImvpqnqtXs1g2yS3uT8jyzookZ4a3vOLJaXXK4bKGzG0K+ZAuSWQZ88BnYye0OKzQ\n 6jeA==","X-Gm-Message-State":"AOJu0YxnSqQ5EhySeeVboFhHKb/ARRczpM5X5jMyBXXx9UBS03bWAAfM\n xzRtLO1fzNHDFasLMhcUUDrPecfcJSJtHabAbyfhHlv8wVgCxoG4oyfg70snWnbXMZ4=","X-Gm-Gg":"ATEYQzziPPhvVzVCBDynJV7dsRYfP+mo19D7knMITHjk7bu/5z08J7zhjwAuhM337Tw\n b7BwpvioIb5vc5GNpF+B8+ypquhrBNa2IiAE8oUuQsVmybiENcYsV0MzlO3d+mAs+qemNbxoN4Z\n P7DdrbT+L+pYxE5wkSisHtMR7wRKR4XpD4ZqPYniFF+X36oKSWgJSjnxCQ9gBKXColo1fGekqTl\n RRVoDu7c/5K3Mh9kenw6MLS/o9t+YkoD8pWEsn8hE3bvGXbD4Orkz5WDRuyLE2TpNS3V4bld+86\n dnilfGQmH/BmPdFQME/AvAMBqk9LipXDDWuR28c+cODmogEiyLpPOWDY59LsMxS06zJo57C9vFr\n TwkNjXt+0ZaY+unRLt3c6mLh0u+xeGfVX/tNJCowEGW5uUPLwcCkVw0aYmyW9qG9QL5iJzvaR04\n BN2OuofZjv9Tez3x6/3SQ8cbRgVm5i8MTcktr8aDDA5uJHSuF0f+YZ5ZGISwT/V6ynfPLUlc99t\n cVrNmunGs/G4AuAtGXxD1PSzVzgAk9gjtnqrZHM14h34FK5vzwN7af6sNQ=","X-Received":"by 2002:a05:6820:d0e:b0:67b:d547:26e1 with SMTP id\n 006d021491bc7-67dff51becfmr2445742eaf.43.1774468292807;\n Wed, 25 Mar 2026 12:51:32 -0700 (PDT)","Date":"Wed, 25 Mar 2026 13:51:29 -0600","From":"Tom Rini <trini@konsulko.com>","To":"Simon Glass <sjg@chromium.org>, Jonas Karlman <jonas@kwiboo.se>","Cc":"u-boot@lists.denx.de, Philipp Tomsich <philipp.tomsich@vrull.eu>,\n Kever Yang <kever.yang@rock-chips.com>","Subject":"Re: [PATCH] arm: rockchip: Guard call of board_early_init_f in SPL","Message-ID":"<20260325195129.GX502704@bill-the-cat>","References":"<20260325190025.3428560-1-trini@konsulko.com>\n <fb6ee141-3369-45e6-8320-e91f67ec6b1e@kwiboo.se>\n <CAFLszTiF4RDyo8+4RZhsNViSNquU3Ouq2fNr5NjG7PvK+2zrtg@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha512;\n protocol=\"application/pgp-signature\"; boundary=\"NX7njlrbuT/Z+snT\"","Content-Disposition":"inline","In-Reply-To":"\n <CAFLszTiF4RDyo8+4RZhsNViSNquU3Ouq2fNr5NjG7PvK+2zrtg@mail.gmail.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"}},{"id":3669310,"web_url":"http://patchwork.ozlabs.org/comment/3669310/","msgid":"<c67bddd4-3827-4e72-a08e-99691cea2165@kwiboo.se>","list_archive_url":null,"date":"2026-03-25T20:12:31","subject":"Re: [PATCH] arm: rockchip: Guard call of board_early_init_f in SPL","submitter":{"id":71439,"url":"http://patchwork.ozlabs.org/api/people/71439/","name":"Jonas Karlman","email":"jonas@kwiboo.se"},"content":"On 3/25/2026 8:51 PM, Tom Rini wrote:\n> On Wed, Mar 25, 2026 at 01:42:28PM -0600, Simon Glass wrote:\n>> Hi Jonas,\n>>\n>> On Wed, 25 Mar 2026 at 13:31, Jonas Karlman <jonas@kwiboo.se> wrote:\n>>>\n>>> Hi Tom,\n>>>\n>>> On 3/25/2026 8:00 PM, Tom Rini wrote:\n>>>> Today, no platforms call board_early_init_f, and rockchip provides a\n>>>> weak default function. Change this to not providing a weak function and\n>>>> only call board_early_init_f if CONFIG_BOARD_EARLY_INIT_F is enabled.\n>>>> This will allow any potential future needs to be taken care of, and make\n>>>> future consolidation easier.\n>>>>\n>>>> Signed-off-by: Tom Rini <trini@konsulko.com>\n>>>> ---\n>>>> Cc: Philipp Tomsich <philipp.tomsich@vrull.eu>\n>>>> Cc: Kever Yang <kever.yang@rock-chips.com>\n>>>> ---\n>>>>  arch/arm/mach-rockchip/spl.c | 8 ++------\n>>>>  1 file changed, 2 insertions(+), 6 deletions(-)\n>>>>\n>>>> diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c\n>>>> index e989c148079a..8026cc0abb8d 100644\n>>>> --- a/arch/arm/mach-rockchip/spl.c\n>>>> +++ b/arch/arm/mach-rockchip/spl.c\n>>>> @@ -97,11 +97,6 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)\n>>>>       return MMCSD_MODE_RAW;\n>>>>  }\n>>>>\n>>>> -__weak int board_early_init_f(void)\n>>>> -{\n>>>> -     return 0;\n>>>> -}\n>>>> -\n>>>>  __weak int arch_cpu_init(void)\n>>>>  {\n>>>>       return 0;\n>>>> @@ -111,7 +106,8 @@ void board_init_f(ulong dummy)\n>>>>  {\n>>>>       int ret;\n>>>>\n>>>> -     board_early_init_f();\n>>>> +     if (IS_ENABLED(CONFIG_BOARD_EARLY_INIT_F))\n>>>\n>>> This patch seem to introduce a change in behavior for chromebook bob and\n>>> kevin, they do not seem to enable BOARD_EARLY_INIT_F, yet they have a\n>>> board_early_init_f() in board/google/gru/gru.c no longer being called\n>>> after this change.\n> \n> I wouldn't call it a behavior change, since it's not called now, and\n\nYou mean the function is currently being optimized out? Why would it not\nbe called before the change introduced in this patch?\n\nThe code in board/google/gru/gru.c is silly and probably gets optimized\nout anyway, but the comment there suggest something was done to try and\nmake so it was not.\n\n> this is the output from building before/after, checking for size\n> differnces (and how I spotted odd cases as part of this overall work):\n> \n>             chromebook_bob : spl/u-boot-spl:all -8 spl/u-boot-spl:text -8\n>                spl-u-boot-spl: add: 0/-1, grow: 0/-1 bytes: 0/-12 (-12)\n>                  function                                   old     new   delta\n>                  board_init_f                               148     144      -4\n>                  board_early_init_f                           8       -      -8\n>             chromebook_kevin: spl/u-boot-spl:all -8 spl/u-boot-spl:text -8\n>                spl-u-boot-spl: add: 0/-1, grow: 0/-1 bytes: 0/-12 (-12)\n>                  function                                   old     new   delta\n>                  board_init_f                               148     144      -4\n>                  board_early_init_f                           8       -      -8\n> \n> \n>>> I do not have a chromebook_bob/kevin so I cannot help verify if this\n>>> change break anything, hopefully Simon can help test/verify.\n>>\n>> Kevin spews some junk to the console with or without this patch.\n>>\n>> No change observed on bob or kevin. BTW both are in the lab so you\n>> should be able to test if you push to your tree.\n>>\n>> Tested-by: Simon Glass <sjg@chromium.org>  # chromebook_kevin\n>> Tested-by: Simon Glass <sjg@chromium.org>  # chromebook_bob\n> \n> Perhaps the problem is those platforms should be enabling, but lost.\n> I'll take a look, but would be unrelated to this (since if enabling\n> BOARD_EARLY_INIT_F it would then call it).\n\nboard_early_init_f() in gru.c is wrapped around CONFIG_XPL_BUILD so\nshould only be included in SPL and was called from rockchip spl.c\nboard_init_f() prior to this patch.\n\nBased on Simons comment I guess the board_early_init_f() in gru.c\nprobably could and should be fully removed, as it currently does not\nseem to provide the suggested delay.\n\nRegards,\nJonas","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=kwiboo.se header.i=@kwiboo.se header.a=rsa-sha256\n header.s=fe-e1b5cab7be header.b=Ks8ckR/p;\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=kwiboo.se","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=kwiboo.se header.i=@kwiboo.se header.b=\"Ks8ckR/p\";\n\tdkim-atps=neutral","phobos.denx.de; dmarc=pass (p=quarantine dis=none)\n header.from=kwiboo.se","phobos.denx.de; spf=pass\n smtp.mailfrom=SRS0=e7f4=B2=kwiboo.se=jonas@fe-bounces.kwiboo.se"],"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 4fgykg4nXjz1y1x\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 07:12:43 +1100 (AEDT)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id D7F3183CD3;\n\tWed, 25 Mar 2026 21:12:39 +0100 (CET)","by phobos.denx.de (Postfix, from userid 109)\n id 1E98D83DA6; Wed, 25 Mar 2026 21:12:38 +0100 (CET)","from smtp.forwardemail.net (smtp.forwardemail.net [121.127.44.66])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 82D8E83A91\n for <u-boot@lists.denx.de>; Wed, 25 Mar 2026 21:12:35 +0100 (CET)"],"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 RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED,\n SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se;\n h=Content-Transfer-Encoding: Content-Type: In-Reply-To: From: References:\n Cc: To: Subject: MIME-Version: Date: Message-ID; q=dns/txt;\n s=fe-e1b5cab7be; t=1774469554;\n bh=zHHwz/+3M7NfTahxD6ru0zt1ES7K64xNpVDwnEHLHg8=;\n b=Ks8ckR/pfbcpFhhkYVthqkl+8DKZHMuRWlxE0CNthxvgv3ZmF9TP4FEw/XN14UFvgHzan73DZ\n IqcMDyX8P7c04TDsfPsyQnpTMDBvpb3Ybvo4IDDo7FesdKIl+FciDXyHDDPi+anX0gT9Vrn8v7O\n 8iMra4emvuQaEnHdE51LUSQm4jd4vGUT7P2IHiOkCb9BUNjBf4FFavCE3iHtIn4uZz+JAwj2OIy\n ppycF+u0t6ixKsh3K+/50SshGA2V8y0vyNlXAqpbT7IjtW0pn3nWvTMK5it+qsOt5ARJanW9yH9\n pxfsDoOygm5CjbBG6QiKH4dPJkl4WYYUHFwcUIfuAKcA==","X-Forward-Email-ID":"69c441b167e6eae9db0904fd","X-Forward-Email-Sender":"rfc822; jonas@kwiboo.se, smtp.forwardemail.net,\n 121.127.44.66","X-Forward-Email-Version":"2.6.55","X-Forward-Email-Website":"https://forwardemail.net","X-Complaints-To":"abuse@forwardemail.net","X-Report-Abuse":"abuse@forwardemail.net","X-Report-Abuse-To":"abuse@forwardemail.net","Message-ID":"<c67bddd4-3827-4e72-a08e-99691cea2165@kwiboo.se>","Date":"Wed, 25 Mar 2026 21:12:31 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH] arm: rockchip: Guard call of board_early_init_f in SPL","To":"Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>","Cc":"u-boot@lists.denx.de, Philipp Tomsich <philipp.tomsich@vrull.eu>,\n Kever Yang <kever.yang@rock-chips.com>","References":"<20260325190025.3428560-1-trini@konsulko.com>\n <fb6ee141-3369-45e6-8320-e91f67ec6b1e@kwiboo.se>\n <CAFLszTiF4RDyo8+4RZhsNViSNquU3Ouq2fNr5NjG7PvK+2zrtg@mail.gmail.com>\n <20260325195129.GX502704@bill-the-cat>","Content-Language":"en-US","From":"Jonas Karlman <jonas@kwiboo.se>","In-Reply-To":"<20260325195129.GX502704@bill-the-cat>","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"7bit","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"}},{"id":3669325,"web_url":"http://patchwork.ozlabs.org/comment/3669325/","msgid":"<20260325203732.GZ502704@bill-the-cat>","list_archive_url":null,"date":"2026-03-25T20:37:32","subject":"Re: [PATCH] arm: rockchip: Guard call of board_early_init_f in SPL","submitter":{"id":65875,"url":"http://patchwork.ozlabs.org/api/people/65875/","name":"Tom Rini","email":"trini@konsulko.com"},"content":"On Wed, Mar 25, 2026 at 09:12:31PM +0100, Jonas Karlman wrote:\n> On 3/25/2026 8:51 PM, Tom Rini wrote:\n> > On Wed, Mar 25, 2026 at 01:42:28PM -0600, Simon Glass wrote:\n> >> Hi Jonas,\n> >>\n> >> On Wed, 25 Mar 2026 at 13:31, Jonas Karlman <jonas@kwiboo.se> wrote:\n> >>>\n> >>> Hi Tom,\n> >>>\n> >>> On 3/25/2026 8:00 PM, Tom Rini wrote:\n> >>>> Today, no platforms call board_early_init_f, and rockchip provides a\n> >>>> weak default function. Change this to not providing a weak function and\n> >>>> only call board_early_init_f if CONFIG_BOARD_EARLY_INIT_F is enabled.\n> >>>> This will allow any potential future needs to be taken care of, and make\n> >>>> future consolidation easier.\n> >>>>\n> >>>> Signed-off-by: Tom Rini <trini@konsulko.com>\n> >>>> ---\n> >>>> Cc: Philipp Tomsich <philipp.tomsich@vrull.eu>\n> >>>> Cc: Kever Yang <kever.yang@rock-chips.com>\n> >>>> ---\n> >>>>  arch/arm/mach-rockchip/spl.c | 8 ++------\n> >>>>  1 file changed, 2 insertions(+), 6 deletions(-)\n> >>>>\n> >>>> diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c\n> >>>> index e989c148079a..8026cc0abb8d 100644\n> >>>> --- a/arch/arm/mach-rockchip/spl.c\n> >>>> +++ b/arch/arm/mach-rockchip/spl.c\n> >>>> @@ -97,11 +97,6 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)\n> >>>>       return MMCSD_MODE_RAW;\n> >>>>  }\n> >>>>\n> >>>> -__weak int board_early_init_f(void)\n> >>>> -{\n> >>>> -     return 0;\n> >>>> -}\n> >>>> -\n> >>>>  __weak int arch_cpu_init(void)\n> >>>>  {\n> >>>>       return 0;\n> >>>> @@ -111,7 +106,8 @@ void board_init_f(ulong dummy)\n> >>>>  {\n> >>>>       int ret;\n> >>>>\n> >>>> -     board_early_init_f();\n> >>>> +     if (IS_ENABLED(CONFIG_BOARD_EARLY_INIT_F))\n> >>>\n> >>> This patch seem to introduce a change in behavior for chromebook bob and\n> >>> kevin, they do not seem to enable BOARD_EARLY_INIT_F, yet they have a\n> >>> board_early_init_f() in board/google/gru/gru.c no longer being called\n> >>> after this change.\n> > \n> > I wouldn't call it a behavior change, since it's not called now, and\n> \n> You mean the function is currently being optimized out? Why would it not\n> be called before the change introduced in this patch?\n> \n> The code in board/google/gru/gru.c is silly and probably gets optimized\n> out anyway, but the comment there suggest something was done to try and\n> make so it was not.\n\nYou're right, sorry. Since the size change is the exact same as every\nplatform that was calling the weak function, it seemed like it must have\nnot been using that gru.c version at all. But building on top of this\npatch and enabling BOARD_EARLY_INIT_F for bob/kevin (and some quick\nrework so that full U-Boot links), and there's no size change to SPL.\n\n> > this is the output from building before/after, checking for size\n> > differnces (and how I spotted odd cases as part of this overall work):\n> > \n> >             chromebook_bob : spl/u-boot-spl:all -8 spl/u-boot-spl:text -8\n> >                spl-u-boot-spl: add: 0/-1, grow: 0/-1 bytes: 0/-12 (-12)\n> >                  function                                   old     new   delta\n> >                  board_init_f                               148     144      -4\n> >                  board_early_init_f                           8       -      -8\n> >             chromebook_kevin: spl/u-boot-spl:all -8 spl/u-boot-spl:text -8\n> >                spl-u-boot-spl: add: 0/-1, grow: 0/-1 bytes: 0/-12 (-12)\n> >                  function                                   old     new   delta\n> >                  board_init_f                               148     144      -4\n> >                  board_early_init_f                           8       -      -8\n> > \n> > \n> >>> I do not have a chromebook_bob/kevin so I cannot help verify if this\n> >>> change break anything, hopefully Simon can help test/verify.\n> >>\n> >> Kevin spews some junk to the console with or without this patch.\n> >>\n> >> No change observed on bob or kevin. BTW both are in the lab so you\n> >> should be able to test if you push to your tree.\n> >>\n> >> Tested-by: Simon Glass <sjg@chromium.org>  # chromebook_kevin\n> >> Tested-by: Simon Glass <sjg@chromium.org>  # chromebook_bob\n> > \n> > Perhaps the problem is those platforms should be enabling, but lost.\n> > I'll take a look, but would be unrelated to this (since if enabling\n> > BOARD_EARLY_INIT_F it would then call it).\n> \n> board_early_init_f() in gru.c is wrapped around CONFIG_XPL_BUILD so\n> should only be included in SPL and was called from rockchip spl.c\n> board_init_f() prior to this patch.\n> \n> Based on Simons comment I guess the board_early_init_f() in gru.c\n> probably could and should be fully removed, as it currently does not\n> seem to provide the suggested delay.\n\nYes, both currently go green in GitLab when we run CI on them, with or\nwithout this patch, so there's no change in the end.","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=QcAv8RHj;\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=\"QcAv8RHj\";\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)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fgzHV74MXz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 07:37:42 +1100 (AEDT)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id DCA1D83CD3;\n\tWed, 25 Mar 2026 21:37:39 +0100 (CET)","by phobos.denx.de (Postfix, from userid 109)\n id B15BF83DA6; Wed, 25 Mar 2026 21:37:38 +0100 (CET)","from mail-ot1-x331.google.com (mail-ot1-x331.google.com\n [IPv6:2607:f8b0:4864:20::331])\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 551A183A91\n for <u-boot@lists.denx.de>; Wed, 25 Mar 2026 21:37:36 +0100 (CET)","by mail-ot1-x331.google.com with SMTP id\n 46e09a7af769-7d1872504cbso192350a34.0\n for <u-boot@lists.denx.de>; Wed, 25 Mar 2026 13:37:36 -0700 (PDT)","from bill-the-cat (fixed-189-203-97-235.totalplay.net.\n [189.203.97.235]) by smtp.gmail.com with ESMTPSA id\n 46e09a7af769-7d9e71f6815sm615036a34.15.2026.03.25.13.37.33\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 25 Mar 2026 13:37:34 -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=1774471055; x=1775075855; 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=Pnv+FZJuQ29CFAH/NRinJ0rHB+OiynEd3sD1rY8sJjg=;\n b=QcAv8RHjRZrzVbGwFv6bKTcbBGVlAOAffmi3aJuUwbMTgtHbtmj/7+lQa/5sImsNpa\n UR13mOGs2W2Puj4ebygcdZfVgVRNcOnnXNcFxZGPDqqIVt41Z1nU2rgtuoBsN/smmApK\n PFLLzlFBX73b+QmCvpbsfoajqOkYqBUbVYcqo=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774471055; x=1775075855;\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=Pnv+FZJuQ29CFAH/NRinJ0rHB+OiynEd3sD1rY8sJjg=;\n b=NALD9/FjaLiAQxqoNPcFNO7rjRD9Lqj3jTw2BU80Ce2hTtndhl51HKzSM4UHPIdCc2\n EqdWM2/1ZKRuV75aD7KsFoHnRfg/g5BEldl/rt9MDnZqhCCs0MJyZQW3G38+jHXKF26E\n Ex4AVEzqdIEyd91UyOSbDLGQwWORQukVU18xGXVX1zy1XuxRevPNt82d8w5IwdAJvApq\n Gm8i57i4SCK/Qx9BLl0oDywTpVS2gj/pE9nvDTKEjnJdfe6sSYU+g5TGY7NSN9shvwG0\n gCA3vXdsOLERghoFLzigis+PNYcs+lAq+cRi+30MhIa6cdeg2oL+feEm9XjgMtfi0eQ2\n rILg==","X-Forwarded-Encrypted":"i=1;\n AJvYcCVk/kA9xu209ZKEOGLkabSt5V36SNDnj9PV5NynxAt1GgiAD5a88iENM2YzgKqg2fOH9IGlnCs=@lists.denx.de","X-Gm-Message-State":"AOJu0YwwPL9S5ir05nFUohOMJWoaG660iLZeCOEax2X2BRmMpSSjPQgX\n DFmjpWtRVuw+hrRYL7oksLFBVJtsMLX9M6l5kEs9Bq6lQRfhIYs4oDTRwKy6mvQs4YcuwgORRrf\n KGePLWPg=","X-Gm-Gg":"ATEYQzyIvJuxPq2Th4U3DYh7nVcdZdnwkPWgmVPmAVEs/lTKC1w/l+RaX5/WPCDh2LS\n t5WHfWQCtoAibp9yE+gyNP6Y2Ifd8k5CiuT9zn4YHdHE/9KdUaz3UYHFUoTL9WJJKY5ckEE2X1i\n tBthf0yDDeS1keTREl4Quh7lEXlft8gUdAKkmq0MOUZuOPOrtghhXTa0k9aL8WUWQvhIkQLkMP4\n 3SN8/orXsQ4aZ6G8cVJwgqLNKCBJvYQxbUWPfd735513pKYNUFT1haekGNIHamybqFzevpQ3BnJ\n etWEz4hnsfNLkyvjlbY5R4MV5JkmwDHAAYYNDcou0pXySPSCXmg1Vmt6+XNYM15DMduFStxEL92\n uxl17YVw9g/ulaLGoATbEAvbQwohkXXTp2pT23Ph1/0WsfKopk+GEWu47KONSa5qTSMQ6o0whEN\n QAVEGIJtt6KJYnaElGKsSEWvbqtDBNeSl7LkvDdcAIGWUaPkhHhAFhBZBfW5TbDcz1UHRbdoVkJ\n h8quPi6Jv0z705+jJ2FzTRVrpuGXjT7gebRyy+h/NtX5sk2AIIQtDu+HBQ=","X-Received":"by 2002:a05:6830:4411:b0:7d7:c79a:cb69 with SMTP id\n 46e09a7af769-7d9c6cbe0cdmr4997115a34.18.1774471054947;\n Wed, 25 Mar 2026 13:37:34 -0700 (PDT)","Date":"Wed, 25 Mar 2026 14:37:32 -0600","From":"Tom Rini <trini@konsulko.com>","To":"Jonas Karlman <jonas@kwiboo.se>","Cc":"Simon Glass <sjg@chromium.org>, u-boot@lists.denx.de,\n Philipp Tomsich <philipp.tomsich@vrull.eu>,\n Kever Yang <kever.yang@rock-chips.com>","Subject":"Re: [PATCH] arm: rockchip: Guard call of board_early_init_f in SPL","Message-ID":"<20260325203732.GZ502704@bill-the-cat>","References":"<20260325190025.3428560-1-trini@konsulko.com>\n <fb6ee141-3369-45e6-8320-e91f67ec6b1e@kwiboo.se>\n <CAFLszTiF4RDyo8+4RZhsNViSNquU3Ouq2fNr5NjG7PvK+2zrtg@mail.gmail.com>\n <20260325195129.GX502704@bill-the-cat>\n <c67bddd4-3827-4e72-a08e-99691cea2165@kwiboo.se>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha512;\n protocol=\"application/pgp-signature\"; boundary=\"8oRmmfjF+DUYnAlH\"","Content-Disposition":"inline","In-Reply-To":"<c67bddd4-3827-4e72-a08e-99691cea2165@kwiboo.se>","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"}}]