From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F86DC433EF for ; Mon, 13 Jun 2022 14:20:43 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 27CDA84467; Mon, 13 Jun 2022 16:20:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="Qi+p5qQ6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 976F284435; Mon, 13 Jun 2022 16:20:39 +0200 (CEST) Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5B66A84467 for ; Mon, 13 Jun 2022 16:20:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x82f.google.com with SMTP id k4so3959397qth.8 for ; Mon, 13 Jun 2022 07:20:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=uRKJJovCUrdFaPa2hH5IDOIpGpSytNYaAail7HjL1Ls=; b=Qi+p5qQ67I+UnBfEQRFNb+AMhCDufAq6QrZfVeLQ1Q5jCkLP4Hnsd2N4urB9EVZZRh RNfxuiwHVAPQkd7otezy4gT8vMA+KxWQqTeeQKt97uD8dZuFMxqdM2IY5i7Pd/o3s9VT +ma3kvtiEVLDXCQdk1NY2yjPHLA6mnYSNRaJk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=uRKJJovCUrdFaPa2hH5IDOIpGpSytNYaAail7HjL1Ls=; b=u5DwKPRIGdngJz1t/czMtspUrpKiCweDfC68BvvTN1rBvJ18qQaOxAs7rFuTx1OEN7 8MXb+ndWdHQG7KXQ13xwswnKrdXnhB7sJzaHhlYcAsG9oLFZb3DgcjUvttrex1s7FoDF sM9Z3NiEydoBTTArjxs2J09X5HSYIrE++g6uE6y6L0Z3rc+M4iN5mF8iknfH/Okm5wd1 3ZqOEWvSxwvUB+nfqVCe7Vb9038XlKk3l9+xeOoTxRsLkKiTmriWk9hcnVxlmUxRoTMZ 4vJSq8eRxROmGOdrvrZZykOaVJE9K3GWyp1EiZE3x+t+GMuiFImCBDuxKq07Qx0IZKHC QBpA== X-Gm-Message-State: AOAM530C0vQuqzE0G5NO/9+Vst4zcZCYl3doPsM7C6dNU7Ufa1l94q9P 2MyPFrAkEuA/RIBkQCOnW46z2g== X-Google-Smtp-Source: ABdhPJzijN30Rrj2CRFBnvkZcoHNU83HKb3/oPqzLYwHPzJF9KBNd6lYMP9qwNK9CtSurhqI7N7hxg== X-Received: by 2002:ac8:5f4f:0:b0:2f3:d763:4be6 with SMTP id y15-20020ac85f4f000000b002f3d7634be6mr47477599qta.406.1655130034850; Mon, 13 Jun 2022 07:20:34 -0700 (PDT) Received: from bill-the-cat (cpe-65-184-195-139.ec.res.rr.com. [65.184.195.139]) by smtp.gmail.com with ESMTPSA id k15-20020a05620a138f00b006a73654c19bsm6572221qki.23.2022.06.13.07.20.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 07:20:32 -0700 (PDT) Date: Mon, 13 Jun 2022 10:20:30 -0400 From: Tom Rini To: LABBE Corentin Cc: yogeshs@ti.com, lokeshvutla@ti.com, sjg@chromium.org, u-boot@lists.denx.de Subject: Re: Boot regression on am335x-hs-evm Message-ID: <20220613142030.GJ2484912@bill-the-cat> References: <20220610121610.GM2484912@bill-the-cat> <20220610150147.GN2484912@bill-the-cat> <20220610154834.GO2484912@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="AW8RmF6KeXgMzg/h" Content-Disposition: inline In-Reply-To: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean --AW8RmF6KeXgMzg/h Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 13, 2022 at 02:51:03PM +0200, LABBE Corentin wrote: > Le Fri, Jun 10, 2022 at 11:48:34AM -0400, Tom Rini a =E9crit : > > On Fri, Jun 10, 2022 at 05:45:04PM +0200, LABBE Corentin wrote: > > > Le Fri, Jun 10, 2022 at 11:01:47AM -0400, Tom Rini a =E9crit : > > > > On Fri, Jun 10, 2022 at 04:51:12PM +0200, LABBE Corentin wrote: > > > > > Le Fri, Jun 10, 2022 at 08:16:10AM -0400, Tom Rini a =E9crit : > > > > > > On Fri, Jun 10, 2022 at 11:59:23AM +0200, LABBE Corentin wrote: > > > > > > > Hello > > > > > > >=20 > > > > > > > I hit a boot regression on am335x-hs-evm. > > > > > > > On current uboot, the board does not boot at all. > > > > > > > This board uses both MLO and u-boot.img and only MLO was the = problem. > > > > > > >=20 > > > > > > > After a bisect, I found that e41651fffda7 ("dm: Support paren= t devices with of-platdata") was the problem. > > > > > > > Reverting this patch lead to a success boot. > > > > > > >=20 > > > > > > > I cutdown the revert to a minimal fix: > > > > > > > --- a/drivers/core/lists.c > > > > > > > +++ b/drivers/core/lists.c > > > > > > > @@ -120,6 +120,7 @@ int lists_bind_drivers(struct udevice *pa= rent, bool pre_reloc_only) > > > > > > > int ret; > > > > > > > =20 > > > > > > > ret =3D bind_drivers_pass(parent, pre_reloc_o= nly); > > > > > > > + return ret; > > > > > > > if (!ret) > > > > > > > break; > > > > > > > if (ret !=3D -EAGAIN && !result) > > > > > > >=20 > > > > > > > I cannot debug further since printf() is not working at this = stage. > > > > > > >=20 > > > > > > > Since I wanted to know which error was badly handled, I tried= to do this: > > > > > > > --- a/arch/arm/mach-omap2/sec-common.c > > > > > > > +++ b/arch/arm/mach-omap2/sec-common.c > > > > > > > @@ -111,6 +111,8 @@ static u32 find_sig_start(char *image, si= ze_t size) > > > > > > > return 0; > > > > > > > } > > > > > > > =20 > > > > > > > +extern int errorcount; > > > > > > > + > > > > > > > int secure_boot_verify_image(void **image, size_t *size) > > > > > > > { > > > > > > > int result =3D 1; > > > > > > > @@ -178,6 +180,7 @@ auth_exit: > > > > > > > * via YMODEM. This is done to avoid disturbing the Y= MODEM serial > > > > > > > * protocol transactions. > > > > > > > */ > > > > > > > + printf("ERRORCOUNT %d\n", errorcount); > > > > > > > if (!(IS_ENABLED(CONFIG_SPL_BUILD) && > > > > > > > IS_ENABLED(CONFIG_SPL_YMODEM_SUPPORT) && > > > > > > > spl_boot_device() =3D=3D BOOT_DEVICE_UART)) > > > > > > > --- a/drivers/core/lists.c > > > > > > > +++ b/drivers/core/lists.c > > > > > > > @@ -20,6 +20,10 @@ > > > > > > > #include > > > > > > > #include > > > > > > > =20 > > > > > > > +static int _errorcount; > > > > > > > +int errorlist[1024]; > > > > > > > +int errorcount; > > > > > > > + > > > > > > > struct driver *lists_driver_lookup_name(const char *name) > > > > > > > { > > > > > > > struct driver *drv =3D > > > > > > > @@ -120,8 +124,9 @@ int lists_bind_drivers(struct udevice *pa= rent, bool pre_reloc_only) > > > > > > > int ret; > > > > > > > =20 > > > > > > > ret =3D bind_drivers_pass(parent, pre_reloc_o= nly); > > > > > > > - if (!ret) > > > > > > > - break; > > > > > > > + errorlist[_errorcount] =3D ret; > > > > > > > + _errorcount++; > > > > > > > + errorcount =3D _errorcount; > > > > > > > if (ret !=3D -EAGAIN && !result) > > > > > > > result =3D ret; > > > > > > > } > > > > > > >=20 > > > > > > > But errorcount is always 0 which is puzzling me since accordi= ng to my think, lists_bind_drivers() is ran before secure_boot_verify_image= (). > > > > > > >=20 > > > > > > > Any idea on how to debug further ? > > > > > >=20 > > > > > > You should be able to enable DEBUG_UART and get output that way= =2E But > > > > > > it's likely something related to the space constraints of the H= S chip > > > > > > rather than GP. > > > > > >=20 > > > > >=20 > > > > > Hello > > > > >=20 > > > > > Thanks for your suggestion, I successfully got futher with: > > > > > diff --git a/drivers/core/lists.c b/drivers/core/lists.c > > > > > index b23ee3030e..415ba814f1 100644 > > > > > --- a/drivers/core/lists.c > > > > > +++ b/drivers/core/lists.c > > > > > @@ -111,6 +111,8 @@ int lists_bind_drivers(struct udevice *parent= , bool pre_reloc_only) > > > > > int result =3D 0; > > > > > int pass; > > > > > =20 > > > > > + debug_uart_init(); > > > > > + > > > > > /* > > > > > * 10 passes is 10 levels deep in the devicetree, which i= s plenty. If > > > > > * OF_PLATDATA_PARENT is not enabled, then bind_drivers_p= ass() will > > > > > diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig > > > > > index b4805a2e4e..7ab059b4ea 100644 > > > > > --- a/drivers/serial/Kconfig > > > > > +++ b/drivers/serial/Kconfig > > > > > @@ -158,6 +158,7 @@ config TPL_DM_SERIAL > > > > > =20 > > > > > config DEBUG_UART > > > > > bool "Enable an early debug UART for debugging" > > > > > + default y > > > > > help > > > > > The debug UART is intended for use very early in U-Boot= to debug > > > > > problems when an ICE or other debug mechanism is not av= ailable. > > > > > @@ -185,7 +186,7 @@ config DEBUG_UART > > > > > choice > > > > > prompt "Select which UART will provide the debug UART" > > > > > depends on DEBUG_UART > > > > > - default DEBUG_UART_NS16550 > > > > > + default DEBUG_UART_OMAP > > > > > =20 > > > > > config DEBUG_UART_ALTERA_JTAGUART > > > > > bool "Altera JTAG UART" > > > > > @@ -406,7 +407,7 @@ endchoice > > > > > config DEBUG_UART_BASE > > > > > hex "Base address of UART" > > > > > depends on DEBUG_UART > > > > > - default 0 if DEBUG_UART_SANDBOX > > > > > + default 0x44e09000 > > > > > help > > > > > This is the base address of your UART for memory-mapped= UARTs. > > > > > =20 > > > > > @@ -416,7 +417,7 @@ config DEBUG_UART_BASE > > > > > config DEBUG_UART_CLOCK > > > > > int "UART input clock" > > > > > depends on DEBUG_UART > > > > > - default 0 if DEBUG_UART_SANDBOX > > > > > + default 48000000 > > > > > help > > > > > The UART input clock determines the speed of the intern= al UART > > > > > circuitry. The baud rate is derived from this by dividi= ng the input > > > > > @@ -428,7 +429,7 @@ config DEBUG_UART_CLOCK > > > > > config DEBUG_UART_SHIFT > > > > > int "UART register shift" > > > > > depends on DEBUG_UART > > > > > - default 0 if DEBUG_UART > > > > > + default 2 > > > > > help > > > > > Some UARTs (notably ns16550) support different register= layouts > > > > > where the registers are spaced either as bytes, words o= r some other > > > > > @@ -449,6 +450,7 @@ config DEBUG_UART_BOARD_INIT > > > > > config DEBUG_UART_ANNOUNCE > > > > > bool "Show a message when the debug UART starts up" > > > > > depends on DEBUG_UART > > > > > + default y > > > > > help > > > > > Enable this option to show a message when the debug UAR= T is ready > > > > > for use. You will see a message like " " as= soon as > > > > >=20 > > > > > I got: > > > > > - > > > > > > > > > > alloc space exhausted > > > >=20 > > > > Looks like you need to increase SPL_SYS_MALLOC_F_LEN > > >=20 > > > Thanks > > > I have increased it by step of 0x1000, the number of "alloc space exh= austed" was reducing, but now I have none of them (with 0x6000 or 0x7000) b= ut still no boot. > >=20 > > Given the reduced resources of the HS parts, you might need to double > > check that everything you're doing will fit in the available space and > > perhaps temporarily disable some other features, to ensure things are > > small enough. You should also be able to get more info out of > > DEBUG_UART, as that's working. > >=20 >=20 > For a successfull boot, both SPL_SYS_MALLOC_F_LEN should be increased and= the number of lists_bind_drivers() pass need to be reduced. >=20 > I have added some debug and it seems that my problem is eth_cpsw fault. > bind_drivers_pass eth_cpsw ret=3D-2 > bind_drivers_pass omap_hsmmc ret=3D0 > bind_drivers_pass omap_hsmmc ret=3D0 > bind_drivers_pass gpio_omap ret=3D0 > bind_drivers_pass gpio_omap ret=3D0 > bind_drivers_pass gpio_omap ret=3D0 > bind_drivers_pass gpio_omap ret=3D0 > bind_drivers_pass i2c_omap ret=3D0 > bind_drivers_pass i2c_omap ret=3D0 > bind_drivers_pass i2c_omap ret=3D0 > bind_drivers_pass ns16550_serial ret=3D0 > bind_drivers_pass ns16550_serial ret=3D0 > bind_drivers_pass ns16550_serial ret=3D0 > bind_drivers_pass ns16550_serial ret=3D0 > bind_drivers_pass ns16550_serial ret=3D0 > bind_drivers_pass ns16550_serial ret=3D0 > lists_bind_drivers ret=3D-2 >=20 > While my first idea was to reduce the number of pass via a CONFIG, finall= y just removing eth_cpsw from SPL did the trick. > diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c > index 4dc04817dc..5e664d7bbd 100644 > --- a/board/ti/am335x/board.c > +++ b/board/ti/am335x/board.c > @@ -945,11 +945,13 @@ struct eth_pdata cpsw_pdata =3D { > .priv_pdata =3D &am335_eth_data, > }; > =20 > +#ifndef CONFIG_SPL_BUILD > U_BOOT_DEVICE(am335x_eth) =3D { > .name =3D "eth_cpsw", > .platdata =3D &cpsw_pdata, > }; > #endif > +#endif > =20 > #ifdef CONFIG_SPL_LOAD_FIT > int board_fit_config_name_match(const char *name) >=20 > What do you thinkg about it ? > Does it is ok do to that ? Since SPL does not need ethernet anyway. You can make the whole section there depend on: CONFIG_IS_ENABLED(NET) && !CONFIG_IS_ENABLED(OF_CONTROL) to remove that part from SPL. I think that's reasonably clean. --=20 Tom --AW8RmF6KeXgMzg/h Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmKnR6oACgkQFHw5/5Y0 tyw7Awv/Rc2YCDaMb5QBzmGpO3SumPVpT+Q048tQQvUij1Bl4swPiL6XGTUCnX/0 vcrPKxTYvOfli2FF/n0uubhCgbN5wH+ClA7l7gsdqbzIqcLpn/j+lM2opwaoBn+4 +rGh6jocVxrJuOp647buQlm1W0rSctW7N6rICqQ37WLzYLHljVpkAhm21mclX3Hg tDmkIeGdsZmaRTJeZCtHpgZ/3urMqvgmCUFN+9jUpK3z9dS5z189ddm4ouIfenNc FjWfzFEeWIhLH4m+/a8GQiliaGlybFCKwVs/LnfaQkfilwFDyuI+XaIU2hrQ1Zqu gXWnCPffERsQF1DQWzoXCiK4SefdR2tiKEetA1X8GsVAsk0euaaQ/Cr1nkZiplpF wnPnhUMwrXhEslz39pSxZZ0dEXDEBuG1RGXBKrkXYAoDvDvKkHfdCipTrYKO9Rhm K6EOsuuWpLOgN6lUca7Qg/mI8mELNjjtKti9muEWrFfYIX9FFeRFjEhsC6URPeTO ipbLU5IY =AUIl -----END PGP SIGNATURE----- --AW8RmF6KeXgMzg/h--