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 8F7A8C49EA5 for ; Sat, 26 Jun 2021 14:59:05 +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 714E661C3A for ; Sat, 26 Jun 2021 14:59:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 714E661C3A 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 94D8782C26; Sat, 26 Jun 2021 16:59:01 +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="D/hhLaJC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 65B6682C26; Sat, 26 Jun 2021 16:58:59 +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 15AB182C24 for ; Sat, 26 Jun 2021 16:58:56 +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-qk1-x72f.google.com with SMTP id g4so22481506qkl.1 for ; Sat, 26 Jun 2021 07:58:56 -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=KiA8Imk3PYyYdhDEmEEBPPWbbSffC0sCvDlmJvA6jRY=; b=D/hhLaJCKlxMl8W8CTNquCdinNqkcwviYWIff3m+p8FO4kJHWL9ITvRmcrLmIjIZSY 7TqSevXVWoIcAVc8S/qN2fZeDb8oxmUY1/F4cOnrDGb9PtpQwgjc8bq7TO0u9ILVgUN4 gCYcXb37sujLw3VtpY0kTiscOZcLBkIPkC6R8= 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=KiA8Imk3PYyYdhDEmEEBPPWbbSffC0sCvDlmJvA6jRY=; b=NrTtWH6eLOPtQ5VA7CAvQYri6CH4N6gPr8bORhKksyUwqMSesWRvwRhP1PTJqqBMMi xpj5jXDPUH6A89v/DgSgespTqvLS+Umys2rFsOmszgZAzoBTT74MvUx2GwVwSgOx+QBu UvfQRz0ja7iBtTz1sEQtui/dspAncxMAfNhrjZ7Ptg96bdgty1vmCzhy1umkUE27JfXv /wFYCy1yWReBzpX6Hn9+2Lc6mbxi4A0rq26OFHJIYeQi8VsB0h+EvN9PkwzGfbZVva1I v1/WGNRsnxYN3IAHKRXUazSY5gS8BW4FJxDp+BESVZDJS5sJyce6+dHwJ0/ogmuWGBzI WZxg== X-Gm-Message-State: AOAM530MbMuCiFBMqE4XawPgnm1otIjnFxFuOzb3CyeWXrUPBJeuYk8s LwGAvjD4qbrSjMK8BdkY/RXuFA== X-Google-Smtp-Source: ABdhPJzILL5tjx/LHYjk4KKFfp9Bqk5tJMyEW/T8icW1ufu5P00Wwakxl2UEEoAv7s0hlDEonmxARQ== X-Received: by 2002:a37:674a:: with SMTP id b71mr16758693qkc.459.1624719534704; Sat, 26 Jun 2021 07:58:54 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-f179-e48a-140b-4791.res6.spectrum.com. [2603:6081:7b01:cbda:f179:e48a:140b:4791]) by smtp.gmail.com with ESMTPSA id p6sm7458334qkp.80.2021.06.26.07.58.53 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 26 Jun 2021 07:58:53 -0700 (PDT) Date: Sat, 26 Jun 2021 10:58:51 -0400 From: Tom Rini To: Merlijn Wajer Cc: Pali =?iso-8859-1?Q?Roh=E1r?= , Ivaylo Dimitrov , Simon Glass , Marek Vasut , Lokesh Vutla , U-Boot Mailing List , Pavel Machek Subject: Re: [PATCH 1/2] DM_USB: allow building without OF_CONTROL Message-ID: <20210626145851.GT9516@bill-the-cat> References: <20210620155426.GB9516@bill-the-cat> <19957b67-732a-f53d-4453-d37ce28a92a9@denx.de> <20210625123847.GM9516@bill-the-cat> <20210625130752.uuh4imvgrab6dylq@pali> <20210625213744.GR9516@bill-the-cat> <20210625215151.ddapfie2feszjsc6@pali> <20210625215902.GS9516@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="h4Ukh3fAMk6euAe7" 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 --h4Ukh3fAMk6euAe7 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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=E1r 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 in Mare= k's > >>> suggestion. Why not have X-Loader boot SPL which loads U-Boot from e= xtN > >>> on the eMMC? > >> > >> 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-initialize > > things (which is a really common case now thanks to aarch64) and just > > 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 even if= all these problems are solved then "bootstrapping" or flashing U-Boot int= o such location is not possible, plus there is no recovery. Plus this loose= existing and working operating system, which is no-go. So this way is basi= cally 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. I don't understand this. Either way it's drivers/mmc/omap_hsmmc.c. > 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, which > > 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 how w= e can boot u-boot and the only reasable way was the current one, directly l= oad main u-boot by x-loader/nolo > > 12:12 < Pali> I have already spend some time with spl on n900 and at th= at time I have rejected this idea, because it did not work that > > 12:13 < Pali> spl is also doing hw initialization which cannot be calle= d 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. 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. > Also, I'd like to point what Ivaylo wrote earlier: >=20 > >> This sounds like a workaround though. Can you instead do the full conv= ersion of the board? I am sure the board removal patch can be postponed if = there is plan to convert it. > >=20 > > Hard to say if migration to device-tree is even possible on N900 ATM, e= nabling OF_CONTROL increases the size of the produced binary with some 100k= (.dtb not included), making the size of the binary way above our budget of= ~256k. Sure, board config does not enable -mthumb, but omap3 in rx-51 suff= ers from ARM errata 430973 and noone can guarantee we're not going to see S= IGILL faults if we enable it. Which it seems we are forced to do even with = DM_USB migration only. > >=20 > > Re workaround - I took examples of #ifdef's from the current u-boot cod= e (mmc, i2c, etc.) so workaround or not, it is no different to what the oth= er 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? 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). 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. > Of course, in the long run all boards should follow u-boot technological > preferences, but it feels a bit off that this patch would be treated > differently if the existing drivers already use the same logic, and as > far as I can see there is no deadline currently to convert boards to DT, > just for converting them to DM. The deadline in question here is USB. It's going on 2 years past due and 3 years since the warning was added. So that we're talking just now about the problem, since I started off by just removing the platform, isn't great. And it's not being treated differently, there's no U_BOOT_DRVINFOS option for USB, which is where those other #ifdef's are related to, I believe. --=20 Tom --h4Ukh3fAMk6euAe7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmDXQKQACgkQFHw5/5Y0 tywNfQv/SbeTq5RI2KpVDfmTB3qwAByHVZGJn8t4k93VQkAi2oYvH6KvwwwrDSuj +C1utSrtt6mg0R49MUI2OVb59XVDgY1Xr/IxvJFzxiT5Jpc+IuoTWo82WmK8y31l jlBmb2ILuEBMbZZVEY9ijkgA082LCaZs0v5BGwF70tRbuIojwtcJHMRfvqEbgE/S 31JAJJZ8sRmlIeMfJW3uNCin5IKQ2SQdUx9NS/YTIHsyPHa3SDBMdbn/qqyBZlhg ctiDUkztjNd7hPhBTFIlUYEooBPc4g/1+W5UxuuwHxxy/9nZrgGtxQiNFTnLyz9z BJzKxwFrLj6aFwBm2m1YAXMmw164BYwrA1X5Q/2k6dPnrLcFKUDVSxNKWeUmg/Wh ZpyRdvVJK8ZIQpDQOtji+L3sFYb6oMNQhvWLqd5LpCHHH3YmCLaYZdie+32pRePB l5DuIOs/TbJnFbK7x3NQ1kHv/VDqMJuQ+M2EhbKCKsAm6DBYic0HmlGWrYQihlAu t2uyTaPp =6yS9 -----END PGP SIGNATURE----- --h4Ukh3fAMk6euAe7--