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 1F5F4C48BDF for ; Sun, 20 Jun 2021 15:54:40 +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 DF1D860724 for ; Sun, 20 Jun 2021 15:54:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF1D860724 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 857DE80563; Sun, 20 Jun 2021 17:54:36 +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="QFmOpon+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EFBE180488; Sun, 20 Jun 2021 17:54:34 +0200 (CEST) Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) (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 137D980488 for ; Sun, 20 Jun 2021 17:54:31 +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-xf35.google.com with SMTP id 5so6245458qvf.1 for ; Sun, 20 Jun 2021 08:54:31 -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=7eTQN1K6YNSelwp48lq25a7u3h9dyjYnIgfjdKZF/+w=; b=QFmOpon+5CYuN2otxFwARY8xz5Olp7u/R9Nl1C9R+QtZ5xT3Gh0RnA5VjvbTcAwB6a V6uI1XQpbtTrbCGAPOCUkOiMqMnxiJanHwUmNL0QH+qRy6YzdJ03pT7DtKNgo5+dMG7M 0SGhztBwEyTvpxMba5LDlYdfdLgKHIXeHUzS4= 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=7eTQN1K6YNSelwp48lq25a7u3h9dyjYnIgfjdKZF/+w=; b=ASx0iEE4HCrc2MRMp6LdCnjuxJBq4Gwk0YFfv3EXkU8WSvOdysRMEyRKFJ9d9JJwVC kn89to9tJN9zerwhcfCWeNQ8Ez1Sxp8+IyYHG+OVxjW4tSm4/lx7V3Jl38O59A+uXXqP xXaz73v1xaHxRe0ayS6USHzYmTLX7G+2Rig1Ual4u5QRYvLRE46tpfHASsyOl9UtSLfR FvvpRo5BtlnbCl6yUL0e8l3hXL2hVCMJ5S/bqHNReQzdfTCbISJ/nJCwJMPAZYijAcoK xX1PcXPNKyIAp0+CwzG4Xfhp+vRFzMo9hu1Ogiuauvx2i3kvE1a3qF8EuAay6jgyPTiQ vglQ== X-Gm-Message-State: AOAM533r5M1wuoAtbE3i/f5p56hBZjmhz+/umlBxmQzp/YdhEE03S42T VilsRrodO/KPK299KXUegKLxFg== X-Google-Smtp-Source: ABdhPJyzeXfxRvs89xhbeOiEEV0RJeNzgtRhPH0s6KgUD93iOnHgi4RdA2PWt5GHBKzLtd0O1ZY+/g== X-Received: by 2002:a0c:e84b:: with SMTP id l11mr15773709qvo.36.1624204469654; Sun, 20 Jun 2021 08:54:29 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-78ca-7b54-f591-7b8a.res6.spectrum.com. [2603:6081:7b01:cbda:78ca:7b54:f591:7b8a]) by smtp.gmail.com with ESMTPSA id r19sm8816772qtw.59.2021.06.20.08.54.27 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jun 2021 08:54:28 -0700 (PDT) Date: Sun, 20 Jun 2021 11:54:26 -0400 From: Tom Rini To: Marek Vasut Cc: Ivaylo Dimitrov , Pali =?iso-8859-1?Q?Roh=E1r?= , Lokesh Vutla , Simon Glass , Merlijn Wajer , u-boot@lists.denx.de, Pavel Machek Subject: Re: [PATCH 1/2] DM_USB: allow building without OF_CONTROL Message-ID: <20210620155426.GB9516@bill-the-cat> References: <20210618145724.2558-1-pali@kernel.org> <20210618163812.GR9516@bill-the-cat> <3c44a3cf-b9ad-1b31-d0a4-54c896222d78@gmail.com> <0a8a9dab-ee44-fab7-d712-d66cb121c170@gmail.com> <249e8e4f-b5f7-1f97-adbd-a83d75883ef4@denx.de> <338bfdad-15f6-fbff-6fde-d0411e585bf4@gmail.com> <20210619205129.GA9516@bill-the-cat> <7c4024e6-f58e-1f9a-d969-0d0b190c2484@denx.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="p9FzwDWMswlPtXz/" Content-Disposition: inline In-Reply-To: <7c4024e6-f58e-1f9a-d969-0d0b190c2484@denx.de> 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 --p9FzwDWMswlPtXz/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 20, 2021 at 05:52:03AM +0200, Marek Vasut wrote: > On 6/19/21 10:51 PM, Tom Rini wrote: >=20 > Hi, >=20 > > > > > > > > > > Currently DM_USB requires OF_CONTROL to be > > > > > > > > > > enabled, otherwise link errors > > > > > > > > > > occur. On the other hand OF_CONTROL requires > > > > > > > > > > board code to be migrated to > > > > > > > > > > DT, which is not always possible or required. > > > > > > > > > >=20 > > > > > > > > > > Fix that by conditionally compiling OF_CONTROL > > > > > > > > > > specific sections in USB > > > > > > > > > > related drivers code in the same way like it is > > > > > > > > > > done in the other drivers. > > > > > > > > > > Also, auto select OF_LIBFDT if DM_USB is > > > > > > > > > > selected but OF_CONTROL is not. > > > > > > > > > > Introduce a new Kconfig option OF_NODE used to > > > > > > > > > > compile of_node.c in case > > > > > > > > > > OF_CONTROL is not enabled. Fix deprecation > > > > > > > > > > warning condition as well. > > > > > > > >=20 > > > > > > > > So, what is the use case of this? Why not just enable > > > > > > > > DM_USB and OF_CONTROL ? > > > > > > >=20 > > > > > > > OF_CONTROL requires migration to device-tree. > > > > > >=20 > > > > > > That's where the supported platforms are heading anyway. Or is > > > > > > there some issue with switching the platform you use over to DT > > > > > > ? > > > > >=20 > > > > > OK, let me elaborate: It is about enabling DM_USB on N900 (Nokia > > > > > rx-51 board). For various reasons I am not going to discuss (1), > > > > > migration to DM was delayed to the point where we saw "[PATCH] ar= m: > > > > > Remove nokia_rx51 board" with a commit message "This board has not > > > > > been converted to CONFIG_DM_USB by the deadline. Remove it." post= ed. > > > > > The missing pieces were WDT (a patch is already merged in -next) = and > > > > > DM_USB. The board itself does not support host mode, but USB TTY = is > > > > > very useful for debugging purposes. The particular task I am after > > > > > is USB DM migration and the $subject patch allows this to be > > > > > achieved with relatively little effort (a couple of defconfig > > > > > changes), incomparable with the effort needed for migration to DT. > > > > > As we are already past the DM migration deadline I think it makes > > > > > sense to fulfil its requirements before undertaking such a big ta= sk > > > > > like migration to DT. > > > >=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 > > > > postponed if there is plan to convert it. > > >=20 > > > Hard to say if migration to device-tree is even possible on N900 ATM, > > > enabling OF_CONTROL increases the size of the produced binary with so= me 100k > > > (.dtb not included), making the size of the binary way above our budg= et 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 goin= g to > > > see SIGILL faults if we enable it. Which it seems we are forced to do= even > > > with DM_USB migration only. > >=20 > > Note that yes, it should be safe to enable thumb mode, but run time > > confirmation would be good. > >=20 > > > Re workaround - I took examples of #ifdef's from the current u-boot c= ode > > > (mmc, i2c, etc.) so workaround or not, it is no different to what the= other > > > drivers are doing. > > >=20 > > > I don't really understand where this requirement to convert to DTS co= mes > > > from - will boards that are not converted be removed at some point? W= hen is > > > that deadline if exists? If there is no such deadline, why shall we s= pend > > > who knows how many hours just because "you know, it sounds like a goo= d idea > > > to convert to DTS"? You understand this is not a trivial task and giv= en the > > > pace rx-51 patches were reviewed lately, it will easily take 2 years = to do > > > that conversion. > > >=20 > > > To sum it up - maybe I can do a full DTS migration, but I don't see a= point > > > in doing it ATM. The $subject patch allows rx-51 to be fully migrated= to DM > > > and does nothing different to what already is done all over the place. > >=20 > > So, there are deadlines for migration to device model. The argument > > being put forth by the Nokia RX51 folks is that to quote > > include/dm/platdata.h (and yes, they aren't using U_BOOT_DRVINFO in this > > case, but...): > > /** > > * NOTE: Avoid using these except in extreme circumstances, where devi= ce tree > > * is not feasible (e.g. serial driver in SPL where <8KB of SRAM is > > * available). U-Boot's driver model uses device tree for configuratio= n. > > * > > * When of-platdata is in use, U_BOOT_DRVINFO() cannot be used outside= of the > > * dt-plat.c file created by dtoc > > */ > > that's them, and it's not an SPL case but full U-Boot and a fixed size > > amount of the flash that they can use, no arguing. >=20 > As far as I understand, the RX51 has gigabytes of eMMC storage, so it can > use SPL just like any other OMAP3 board. U-Boot is being called by the old vendor X-Loader fork and needs to take up the existing flash spot. > > So we need to make > > changes in subsystems they use so that they can continue to work. > >=20 > > So, are the changes being proposed to the generic USB code, such that > > DM_USB can be enabled, and when DM_USB_GADGET gets a deadline (Note, > > that's not set yet, but that's not to say never, it's just not been set, > > so getting ahead of problems here would be appreciated) that can also be > > enabled, OK? >=20 > I am confused by this reply. I noticed a lot of boards were removed over > time because they were not converted to DM/DT, and to get rid of all the > ifdefs, but now it seems the direction has been completely reversed and we > should start adding back all the ifdefs to cater for boards which are not > converted instead of fixing the boards ? A lot of boards are being removed because no one wants to update and maintain them and they have likely not been run-time tested in years. Trying to clean up the code in those cases is best done by removing the platform, as no one using it. That is not the case here. If your only concern about the approach taken is some #ifdef's in the code, do you want to see them converted to use some wrapper macro like we do in a few other cases and __maybe_unused some functions as needed? --=20 Tom --p9FzwDWMswlPtXz/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmDPZK4ACgkQFHw5/5Y0 tywWlAv/cWBfHOHgzwRCQ7ZuylI8VotS0oeq6yPajRaWIKtyfuz9Tu4d77BqHTA5 8bx0q/LGC0Z7PEd6oWcSXqNZdEiQLKy7wb6zzyAWcqgaff98UlqCST9m0Dt4dJVr 2b4+Pj0xjc1JpiGVpvEEpuEVs5gpxlsBATHRdI1TDOBKhIznFI7RYt4BxjXJB6Dw arE7h0LRQxApwsrcBeQwiaA58P24J3mp1Vv+zutLP+pNCBjdoFmG9BclultVl/gS oLl88R56pddjNr5fw/ooZ0N5hX3mCI9COaAFmM655GkWzliN7RysOxocwNtY3c88 uSehOOn5hl8kx9UQfrWJXtXNh1EX43GITIzNhUyfdjEKahDWs/kOyaOT210cH8nj 34c9WjJCa1046opKLpDROC33CsjqC0ZyNV7Lr9ptb6icmzd6YY+zKCXNazfTPWMh Lgmw/JM8l2M3tG1pPyGL1EMHjw3tomk7tx4x3aAR3T3iojCBDqKUcqtMQVsij5Sr H8val3Bq =TlTp -----END PGP SIGNATURE----- --p9FzwDWMswlPtXz/--