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.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 781A8C2B9F4 for ; Fri, 25 Jun 2021 16:16:19 +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 82D9361976 for ; Fri, 25 Jun 2021 16:16:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 82D9361976 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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 DEE2682BDF; Fri, 25 Jun 2021 18:16:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="jvDjAHoB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1797F82C01; Fri, 25 Jun 2021 18:16:14 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2648A82BDF for ; Fri, 25 Jun 2021 18:16:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id 477FD61976; Fri, 25 Jun 2021 16:16:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624637768; bh=ffu/wJwVRBfbf8pf7gk0cuHDGUW2H04QyF5nRf2G79E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jvDjAHoB+Qo5K0bCbhAwwEHlH8daoZ2QlUf5fmcUSBdcfUZXCKkL4vmeCQqm+tTy0 STpXZ3gc9JF0490JJ4ehhdN28IDvtkFmpSEsUri/THaAPUMgglJ0knJeElGdi7zEtR 8V4vjajMqMjYN22t2rtwM5h43DiG6XyV5DwKOt3jZq84cNLsuwumephGzehVQChUPw Icb6FOT1LCWc6g2T6B++FXvOTDUmotbYtyOb7PPOpg0mqn3zyNH0RkaK2hydj3ajLd uKR7lTkq3gEDLp6Q1dR10m3YClFFgpc+uRuAWwpHFK00jhZyF6+CRR3RbG8i8eDE/i bjGSb+zNw76FQ== Received: by pali.im (Postfix) id 1CEACA7D; Fri, 25 Jun 2021 18:16:06 +0200 (CEST) Date: Fri, 25 Jun 2021 18:16:05 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Simon Glass Cc: Tom Rini , Marek Vasut , Ivaylo Dimitrov , Lokesh Vutla , Merlijn Wajer , U-Boot Mailing List , Pavel Machek Subject: Re: [PATCH 1/2] DM_USB: allow building without OF_CONTROL Message-ID: <20210625161605.2kabnsfeoxgecapp@pali> References: <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> <20210620155426.GB9516@bill-the-cat> <19957b67-732a-f53d-4453-d37ce28a92a9@denx.de> <20210625123847.GM9516@bill-the-cat> <20210625130752.uuh4imvgrab6dylq@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 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 On Friday 25 June 2021 10:04:14 Simon Glass wrote: > Hi Pali, > > On Fri, 25 Jun 2021 at 07:07, Pali Rohár wrote: > > > > On Friday 25 June 2021 08:38:47 Tom Rini wrote: > > > On Sun, Jun 20, 2021 at 09:43:43PM +0200, Marek Vasut wrote: > > > > On 6/20/21 5:54 PM, Tom Rini wrote: > > > > > > > > [...] > > > > > > > > > > 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, why not place SPL in those 256 kiB and load U-Boot proper from the eMMC > > > > ? > > > > > > > > > > > So we need to make > > > > > > > changes in subsystems they use so that they can continue to work. > > > > > > > > > > > > > > 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? > > > > > > > > > > > > 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. > > > > > > > > Note that there have been boards which had to be switched to SPL to even > > > > permit converting them to DM/DT, and thus prevent removal. > > > > > > > > > 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? > > > > > > > > I think there is a better option which does not add any ifdefs at all _and_ > > > > is future-proof -- place SPL in those 256 kiB, load U-Boot from eMMC and > > > > then enable all the functionality you might need in U-Boot. That would free > > > > you from dealing with the size limitations basically indefinitely. > > > > > > So, at this point I'm waiting for either of: > > > - A response to Marek's questions about using SPL, from the Nokia NX51 > > > folks. > > > > Hello Tom! Here is my answer: > > > > > So, why not place SPL in those 256 kiB and load U-Boot proper from the eMMC ? > > > > 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. > > > > Add eMMC: On eMMC is stored existing operating system, which somehow > > also interacts with vendor X-Loader. There was no big investigation on > > this topic. Also direct booting from eMMC is not supported (unless you > > crack RSA, figure out how secure things work and generate compatible > > image) and neither from existing X-Loader (because vendor did not > > enabled it). 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 into 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 basically undebugable and therefore perfectly > > hard to develop. > > I don't want to inject myself in this discussion, although it does > sound like this platform should use SPL. Well, we are using TI/Nokia X-Loader, not SPL due to above reasons. Like it was for all other TI Omap3/4 boards in past (I guess now TI X-Loader is being replaced by U-Boot SPL part). > But I do wonder about the > 100KB growth you saw with DT/DM. That seems absolutely enormous to me! > Can you please point me to the git tree for this? I'd like to > investigate. Patches in this series were written by Ivo. I do not know exact details and numbers. But the fact is that it was required to enable thumb-2 mode (which has hw bugs on this cpu, see earlier emails; reason why it was disabled). If you want to investigate it, you can try compare u-boot from master/next and u-boot with applying these patches + disable thumb-2 mode. Note that we have already enabled LTO. > > - Simon > > > > > Not mentioning that implementing this means to implement all N900 code > > in U-Boot from scratch. And the last thing is testing... > > > > For me this idea looks like total perfectionism in corporate world when > > some software architect invent a new super-duper-über solution for > > everything which in reality is not possible to implement. > > > > PS: In past few people investigated topic on cracking RSA signature on > > Omap3 and nobody was able to find any "security issue" in it... > > > > > - A patch to rework things so that USB gadget support more cleanly > > > removes from the code paths non-gadget code, so there's no #if's being > > > added here. Or some similar clean-up. > > > > > > -- > > > Tom > > > >