Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E359C11F65 for ; Wed, 30 Jun 2021 13:33:53 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 583DB613DB for ; Wed, 30 Jun 2021 13:33:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 583DB613DB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 26DB282BFA; Wed, 30 Jun 2021 15:33:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (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="m0UtF+Yi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7074E82C04; Wed, 30 Jun 2021 15:33:48 +0200 (CEST) Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) (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 29D5382BF5 for ; Wed, 30 Jun 2021 15:33:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf2d.google.com with SMTP id j14so1074428qvu.6 for ; Wed, 30 Jun 2021 06:33:39 -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:user-agent; bh=xBWBFXVKA8oZPF/M1LVOGjDVso+UBtQGsF42gufpXLc=; b=m0UtF+Yi1ZXSlVkaAFYnb50MI1p65GQ+jeGklg7b7LkfEEGfBfNCaAsfdvvnch/HzH 6qNWSgpQ6/RjI6wBl9QXciNdoBiU4iY9doyk2wdgEV582OFPYIjEpNSzI0kMPju7+LK4 aSUgX9KoWQi8ZWpwupeRYzN1V+6exIGxJAguQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xBWBFXVKA8oZPF/M1LVOGjDVso+UBtQGsF42gufpXLc=; b=Qkkmg7esi0cgN9BtoRGgqN2VlLrhNc2dJ2G3CVOcEXCD4fpNAEszuVyF/qbMhWS+1s DTTJNGnnMXf85f4Corrz1g/WiWv7OEcRyEok5wXuu3hukqXdSkaC1u+W2AvYGE+3BWrP 0MikJvQ7j56iI24BYAw2o04/r6/NKioATWbcK56JP4OLvv7LdnlyOfhq6HerkCZjLdo9 BA7ygXAOfIP8v+rmlwZs3oA1nUyZ8GwOdJMEb0Cai2OTT0E1oAKVF7TIGnHRQ8z9DzwF SsHX4zs6FaO21s/1IsuGwya42h+o23Z+E0DVmBgdKTXKEd3WXt+qEkABTMHhMLfi55GN vQtg== X-Gm-Message-State: AOAM531vL7rmInKImpS3O0cNV2LMo4L9ydysZIgaEalGC09IXUFN5i9/ v0OSoU7iUTg6JDZXmJGUIuGAlw== X-Google-Smtp-Source: ABdhPJy/lgHSqg+cKITrxhS54rkMjxcDW68ohk5OzbPpsdkVPYwbKLl5V0U7D/9ewQbguf3YdiXG3Q== X-Received: by 2002:a0c:ef8b:: with SMTP id w11mr36962239qvr.37.1625060017843; Wed, 30 Jun 2021 06:33:37 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-ed48-3ab5-19c4-9a46.res6.spectrum.com. [2603:6081:7b01:cbda:ed48:3ab5:19c4:9a46]) by smtp.gmail.com with ESMTPSA id s19sm4848173qks.77.2021.06.30.06.33.36 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Jun 2021 06:33:37 -0700 (PDT) Date: Wed, 30 Jun 2021 09:33:35 -0400 From: Tom Rini To: Ivaylo Dimitrov Cc: Pali =?iso-8859-1?Q?Roh=E1r?= , Marek Vasut , Merlijn Wajer , Simon Glass , Lokesh Vutla , U-Boot Mailing List , Pavel Machek Subject: Re: [PATCH 1/2] DM_USB: allow building without OF_CONTROL Message-ID: <20210630133335.GE9516@bill-the-cat> References: <20210625123847.GM9516@bill-the-cat> <20210625130752.uuh4imvgrab6dylq@pali> <20210625213744.GR9516@bill-the-cat> <20210625215151.ddapfie2feszjsc6@pali> <20210625215902.GS9516@bill-the-cat> <20210626145851.GT9516@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qctZDtlxNv9yOmBh" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean --qctZDtlxNv9yOmBh Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 30, 2021 at 10:30:20AM +0300, Ivaylo Dimitrov wrote: > Hi, >=20 > On 26.06.21 =D0=B3. 17:58 =D1=87., Tom Rini wrote: > > On Sat, Jun 26, 2021 at 12:59:21PM +0200, Merlijn Wajer wrote: > > > Hi Tom, Marek, > > >=20 > > > On 25/06/2021 23:59, Tom Rini wrote: > > > > On Fri, Jun 25, 2021 at 11:51:51PM +0200, Pali Roh=C3=A1r wrote: > > > > > On Friday 25 June 2021 17:37:44 Tom Rini wrote: > > > > > > One thing I want to say here as I think it maybe wasn't clear i= n Marek's > > > > > > suggestion. Why not have X-Loader boot SPL which loads U-Boot = =66rom extN > > > > > > on the eMMC? > > > > >=20 > > > > > Hello Tom! I have already answered this in my previous email. > > > >=20 > > > > I just re-read things and I don't see it. But perhaps I'm not being > > > > clear enough. Why can't you just have NOLO start SPL, not re-initi= alize > > > > things (which is a really common case now thanks to aarch64) and ju= st > > > > use that to load full U-Boot from a not size restricted place? > > > >=20 > > >=20 > > > I think there are a few problems. > > >=20 > > > 1. One is a practical one, from Pali's email: > > >=20 > > > > There is no easy access to eMMC until you start full U-Boot. So eve= n if all these problems are solved then "bootstrapping" or flashing U-Boot= into such location is not possible, plus there is no recovery. Plus this l= oose existing and working operating system, which is no-go. So this way is = basically undebugable and therefore perfectly hard to develop. > > >=20 > > > Not being able to access the eMMC to write u-boot until u-boot is > > > started does sound like it would make things a bit more tricky. > >=20 > > I don't understand this. Either way it's drivers/mmc/omap_hsmmc.c. > >=20 > > > 2. According to Pali, adding SPL support would not be a trivial task, > > > and might end up with a lot more "#ifdef"s in SPL than the one in > > > Ivaylo's patch. As I understand it, this hypothetical SPL would mostly > > > not do any hardware initialisation on the N900, so that might be where > > > instead hacks would need to be added to SPL. > > >=20 > > > Pali also wrote: > > >=20 > > > > U-Boot for N900 does not use SPL. There is no SPL code implemented. > > > > Nobody ever tried to implement it and neither tested. As you have > > > > correctly pointed instead of SPL is used vendor X-Loader binary, wh= ich > > > > is signed by RSA key. > > > And when I asked him today: > > >=20 > > > > 12:11 < Pali> in past (10 years ago?) I was investigating the way h= ow we can boot u-boot and the only reasable way was the current one, direct= ly load main u-boot by x-loader/nolo > > > > 12:12 < Pali> I have already spend some time with spl on n900 and a= t that time I have rejected this idea, because it did not work that > > > > 12:13 < Pali> spl is also doing hw initialization which cannot be c= alled on n900 as this code basically crash / freeze n900 > > > So perhaps it would make sense to get more clarity on that, since that > > > seems to be where the argument gets stuck. > >=20 > > This also doesn't make sense to me. CONFIG_SKIP_LOWLEVEL_INIT should > > let you skip whatever initialization doesn't need to be done. If > > there's some init that needs to be skipped but isn't, that's a bug. > >=20 > > > Also, I'd like to point what Ivaylo wrote earlier: > > >=20 > > > > > This sounds like a workaround though. Can you instead do the full= conversion of the board? I am sure the board removal patch can be postpone= d if there is plan to convert it. > > > >=20 > > > > Hard to say if migration to device-tree is even possible on N900 AT= M, enabling OF_CONTROL increases the size of the produced binary with some = 100k (.dtb not included), making the size of the binary way above our budge= t of ~256k. Sure, board config does not enable -mthumb, but omap3 in rx-51 = suffers from ARM errata 430973 and noone can guarantee we're not going to s= ee SIGILL faults if we enable it. Which it seems we are forced to do even w= ith DM_USB migration only. > > > >=20 > > > > Re workaround - I took examples of #ifdef's from the current u-boot= code (mmc, i2c, etc.) so workaround or not, it is no different to what the= other drivers are doing. > > >=20 > > > If the other drivers have the same logic, it seems a bit weird to me > > > that the change made in Ivaylo's patch would be rejected because of a > > > preference to port the board to DT. Unless maybe this was the first > > > driver to be migrated to support only DT and the patch is in effect a > > > reversal of some prior work? > >=20 > > Yes, part of the problem here is that DM_USB is the first case that N900 > > has hit as part of DM conversion that written with using OF_CONTROL in > > mind, only. And he's not interested in taking workarounds to provide > > the required information via another mechanism (while i2c for example, > > is). > >=20 > > But another one of the problems here is that N900 doesn't need USB host, > > only USB gadget, and you were disabling some of the host stuff that's > > being built but not used. A change to not include unused host mode code > > entirely would be another path, and you can address moving to > > DM_USB_GADGET (which doesn't have a deadline yet, but should be done...) > > and see if you have to re-visit the OF_CONTROL problem or not. >=20 > Removing usb-uclass.c and usb_hub.c from the build allows me to enable > DM_USB without OF_CONTROL. The resulting binary is 247312 bytes without > -mthumb and runs just fine on a real HW. So I guess this is what we were > aiming for. Please advice how to proceed - shall I introduce CONFIG_USB_H= OST > Kconfig option that is enabled by default and ifdef those files based on = it? Dropping OF_CONTROL is not a solution. You're just delaying the problem until you go to enable DM_USB_GADGET and then once again hitthe case of needing OF_CONTROL. I think part of the problem here is that while no, OF_CONTROL is not a hard requirement, it means that you instead need to implement an alternative to provide the same information, in a way that keeps you within the size constraints. As you've seen with USB, no one has yet come up with the case of both "we need USB in a very size constrained area" and "we cannot use OF_CONTROL". So can we please confirm at run time on the real hardware that there are thumb problems, and some clever solution will need to be created here (which will probably be introducing CONFIG_USB_HOST and migrating CONFIG_USB_DEVICE to Kconfig and then someone from the N900 community implementing DM_USB_GADGET without OF_CONTROL), or that no, thumb is OK at runtime after all and the Kconfig cleanup isn't as urgent but still would be good. --=20 Tom --qctZDtlxNv9yOmBh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmDccqsACgkQFHw5/5Y0 tywqFAwArUNG3mI+IeUIVbPZ1j3WjVI1QrisBr+ZddI2tkMY4P0E9RJbvLDqQ8IC 2TQk52UgRwagGcRN3mwXSmBft1dnIlDzhrHtKnSy7XjPWyZZmMPpuu+Bb/B1/HN9 a8VZHbNq4E29gO4bkicJ2tw9oYLCXgZdtPF6hA41Iad1mHlph0lkbnWRKWKGGEmH TnufYbZzUlJX9J5lKWJ7bTSlw/uwyEkCTBmuVFu2xOp1uaWuwT47JndcGSAZUEKx e86LoVZfhnJIsd3rVBSlIs9yUUGFJNqiE8P0BS/Xedi88YohugQSJ6mLI2RLvq89 2noQQIYcJwWwAf9wLpGdfzctz6pQv0NW5naFegUVYG9HS9x+GzzvW2A/9LHSIhN6 BR+hVxHB0Dw7se57EKh3ebJvNbZTKEDjt10S7u0CyXZu0ElGJLs7cxnLDExodCMq azrpLTxemFB/+msp1PeWPcukQL1BPA3tXfUinrMMhD9jgQqCw9eKWDOfZatyv4M5 Y/s/2fLt =0Yqg -----END PGP SIGNATURE----- --qctZDtlxNv9yOmBh--