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 2D7A7C43334 for ; Fri, 10 Jun 2022 15:02:00 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 40CC1843D0; Fri, 10 Jun 2022 17:01:57 +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="CpWIa+2r"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 641CC843D6; Fri, 10 Jun 2022 17:01:55 +0200 (CEST) Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) (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 23004842BF for ; Fri, 10 Jun 2022 17:01:52 +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-qk1-x72f.google.com with SMTP id o73so15100640qke.7 for ; Fri, 10 Jun 2022 08:01:52 -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=q7ozEXL0rm0j3x+coGPe0Eex9IXqxTr3VjtRXshDGtk=; b=CpWIa+2rbl0BiA8fFO8wLcB7uMO6FbAd+eVK1ZQ0frkQa+RtR7MFpdRjAKKMyfjILM +tV9wCJ2rcRGkPXovLZwKaXvu0tMeSG1gPBgfDFQqP9/y2ZUGbrtWcjoZlHmUSjKP4VE VjDjrGy06+pf3ULFSS/k1BFAyWdzEsSN6Y5is= 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=q7ozEXL0rm0j3x+coGPe0Eex9IXqxTr3VjtRXshDGtk=; b=IIFHGw24l4+cQxhbMP7IGaZ3jhleLgSjYrkwGcpL66p24z6/iWDzdjCVv+qVwmk2U7 RW4CKi1OE49GdeZv4nlbeI7W15waRjqneO3DT6JKW6P73c+oQqEcKkCIBid/dr5GxGzC PsSeB6tEh4G97SCdW9nukJhXNHRHwPWWOm//F91L1XoQGo4U/sKT+P+SDzQG76NS3YFE pqX4EEDNrELlTb2tOygjoFuOZ1Z85eibyH24QqjhB0LzzW4/qvAj8YQg/rtdp2m9zMyJ p79AS+hwUtwIK1aHXnfj78drXa82QUa3O3pp0hSzmg3B1EUZ+alAOrA7wiTc3j7l0AEh Ba8g== X-Gm-Message-State: AOAM533mzgF6Zc5jpHT29yZywAH34xP2gkOsZnPlByIEUMCzQjSBThan VefDF7z1kgIgMYsD404LTpA0BA== X-Google-Smtp-Source: ABdhPJxZqpuiM0QDt4TLq5mDCf8p51HROT9M1tAo1HoIKUwst3RRw9NsFi/DkZ6h1cNPJLgt3FOQLA== X-Received: by 2002:a05:620a:458c:b0:6a5:b92e:7406 with SMTP id bp12-20020a05620a458c00b006a5b92e7406mr29821215qkb.387.1654873310418; Fri, 10 Jun 2022 08:01:50 -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 bp15-20020a05620a458f00b006a7061bab8csm6904899qkb.12.2022.06.10.08.01.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 08:01:49 -0700 (PDT) Date: Fri, 10 Jun 2022 11:01:47 -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: <20220610150147.GN2484912@bill-the-cat> References: <20220610121610.GM2484912@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WdPYQQQ4lIWZ4ZWi" 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 --WdPYQQQ4lIWZ4ZWi Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 parent device= s 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 *parent, bo= ol pre_reloc_only) > > > int ret; > > > =20 > > > ret =3D bind_drivers_pass(parent, pre_reloc_only); > > > + 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 t= his: > > > --- 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, size_t siz= e) > > > 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 YMODEM se= rial > > > * 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 *parent, bo= ol pre_reloc_only) > > > int ret; > > > =20 > > > ret =3D bind_drivers_pass(parent, pre_reloc_only); > > > - 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 according 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. But > > it's likely something related to the space constraints of the HS 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 p= re_reloc_only) > int result =3D 0; > int pass; > =20 > + debug_uart_init(); > + > /* > * 10 passes is 10 levels deep in the devicetree, which is plenty= =2E If > * OF_PLATDATA_PARENT is not enabled, then bind_drivers_pass() wi= ll > 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 available. > @@ -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 internal UART > circuitry. The baud rate is derived from this by dividing the i= nput > @@ -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 or some o= ther > @@ -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 UART is rea= dy > for use. You will see a message like " " as soon as >=20 > I got: > - > > alloc space exhausted Looks like you need to increase SPL_SYS_MALLOC_F_LEN --=20 Tom --WdPYQQQ4lIWZ4ZWi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmKjXNcACgkQFHw5/5Y0 tyyhLAv/bzDqHe1Lb9dPDze+Fe3Iuqred5YJXc+iNx1Xgzv0hcVy0LE5UezK2rvB z6XLqiOUJNYN5MvWuKCi9Uo1bRF2E2+TLBGDtnPyna8N+ZqwJ4WpX6ti+wf5O9Uk 4TPEp+6BSlqc5nL1snh9GFwxhyK9Sv4YPM8tD/oq6wIKnI0JjrB3lyvc5BXaoyB3 hpoJOaFS3S7vzycYmssxM0mI9JGgOZecQn31IKlH/LcaPKfcuQNcy6ly9f1XGuft kgU0bd2ZRnlrCnW+LkUbHY5L/LQm+BhFJISw56NwL20t3+ng5NNuMpBqfZapbRrO L6fxatqUI1067b0N4M1SaPC90nhGJi2znQd6XveQWDMihQHSWOu7x6sJ0me5xTZ/ WvFIYCvFs08i2+LByZn0IdxfubTxOo4hhCdtY0w2nHo+Ym9rVyUtHC+z+NursXY6 QUSSgTFftt73YjZtUlYrgzF1C62qmigTDjuWgEjIrMD+9SIx6FwjFfaA4rTVXQXB ja8pfu5S =cRGi -----END PGP SIGNATURE----- --WdPYQQQ4lIWZ4ZWi--