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 CF5F1C433EF for ; Fri, 10 Jun 2022 15:48:47 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1D128843F4; Fri, 10 Jun 2022 17:48:45 +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="PxyeYLDh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6032F843FB; Fri, 10 Jun 2022 17:48:42 +0200 (CEST) Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) (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 EE81B84280 for ; Fri, 10 Jun 2022 17:48:38 +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-x836.google.com with SMTP id x7so19621222qta.6 for ; Fri, 10 Jun 2022 08:48:38 -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=09GagbXiDGTf7S3zfKU8wfEhaiZ9KEu2h8mOVqP3Mmg=; b=PxyeYLDh4B7375vmHzL6f5RBaJe4STLtK5KsG1TVSnFLSGBX0D3Wv0e3vPLe2G6AUv iqNcby2RF+aAhD4dePrN5VglMdmdfvDf7GvMipw0n/UoPBiTIn90I4HxBwPElfz/JhN7 Kx+666fV84pDpSThf6H1tHu36oLPT9CIyQ+t8= 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=09GagbXiDGTf7S3zfKU8wfEhaiZ9KEu2h8mOVqP3Mmg=; b=OaNRkLjaP581P9m7IGg4C4qKG+uLXw3PkOPktwtcanAnq6KaDTg1p0W/6VQsD97D2T alA0J9F6DGaUbUse9U+SvHu3bCaJAUbm9YGeBaj8N4Y2TEJochqclXnwsCerLVihUA4C Nd37ifwVToc2K/VL4iBeG37P9uKM9l8FIJ+mvwd1P242NsmzK8b+9Go/xb4e+Sq9N6Rc kWpIzGCrZMo9d2EBwzdJnJDogyzMdqgdzjwgP2Db7DEywV99CBZxxpxXb9AYEU7it5Ht HvUJiaxhuV6G0AleMT6t8WUkE1u/VnPtLUtGoo6iM3bBfvyFHru52LY0JhIXUfM5cZ+A eNjg== X-Gm-Message-State: AOAM532IuVcdA05TnpoSRW08Gy/wi0QZ0qRQEGCPTpdmWzBAlq5P38My 4C4ki7pV/aTgNaJTiu1b53bXq4Pkpj3uqA== X-Google-Smtp-Source: ABdhPJxDFdCfTkmVA5p/Ke/Gok8KmDbtiPAY51MQfdTCso489LJcDNNL51+tQAM/Ajy3RbZoS+Mc4Q== X-Received: by 2002:ac8:5713:0:b0:2f3:d872:2fa8 with SMTP id 19-20020ac85713000000b002f3d8722fa8mr35912269qtw.49.1654876117625; Fri, 10 Jun 2022 08:48:37 -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 x16-20020a05622a001000b002f39b99f69csm10945217qtw.54.2022.06.10.08.48.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 08:48:36 -0700 (PDT) Date: Fri, 10 Jun 2022 11:48:34 -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: <20220610154834.GO2484912@bill-the-cat> References: <20220610121610.GM2484912@bill-the-cat> <20220610150147.GN2484912@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GwwLvQJ0l3HSwfoE" 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 --GwwLvQJ0l3HSwfoE Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 prob= lem. > > > > >=20 > > > > > After a bisect, I found that e41651fffda7 ("dm: Support parent de= vices 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= , bool 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 stag= e. > > > > >=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, size_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 YMODE= M 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 *parent= , bool 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 t= o 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. B= ut > > > > it's likely something related to the space constraints of the HS ch= ip > > > > 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, bo= ol pre_reloc_only) > > > int result =3D 0; > > > int pass; > > > =20 > > > + debug_uart_init(); > > > + > > > /* > > > * 10 passes is 10 levels deep in the devicetree, which is pl= enty. If > > > * OF_PLATDATA_PARENT is not enabled, then bind_drivers_pass(= ) 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 availa= ble. > > > @@ -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 UAR= Ts. > > > =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 U= ART > > > circuitry. The baud rate is derived from this by dividing t= he 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 lay= outs > > > where the registers are spaced either as bytes, words or so= me 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 UART is= ready > > > for use. You will see a message like " " as soo= n 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 exhaust= ed" was reducing, but now I have none of them (with 0x6000 or 0x7000) but s= till no boot. 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 Tom --GwwLvQJ0l3HSwfoE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmKjZ88ACgkQFHw5/5Y0 tyw0Vwv/XUft1i4NPmRLYkG1yIbf9l+3XtKDBRM0NVICQCQzYpcQ1E/SRG93jTu8 aihLQeBN/ZEneO3dYXB9zAHjgL+TouOBZDAr0/jvnocFZWMpw1TYviLvz0QRaml/ AxwGDhzToYBMqlV5K7CHN0/TYD9M3GIsNAk6GjmuJO0tNAHY9HAWj0iMRJFJKLv9 r0dQ8iRFhbUDn7cV8SmrO1x7bc64QDKg63oM2DVaDd+4xTSdGKblnqQD8KGekVWZ 3ojAzbq2FzZAOIfbiIv1fKVYFZ4K/Fo0cBZS5TwLrDVwCM7hFDBZZA0cnYeOXui5 DWHnpHd8hMZ86hvShw1dpzxCK1mOUrGXXohBFkygxn+0wt1BiXMwZW8TzSjIbNLD 2mj+1EG4GrhzE2yjq88vbew3wjc7D33qlz01butaWuTif/9VErWIDIACzX5dQc0y vZi0aUMLMAiKnV+PdXizkbakheHQNsDBXKSkoax1ZQk0w0J84TjPiYbMTjGsGYBz sUqLLgmo =8qWj -----END PGP SIGNATURE----- --GwwLvQJ0l3HSwfoE--