All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 00/32] spi: DM_SPI migration timeout, remainder(2)
Date: Wed, 28 Nov 2018 09:59:55 -0500	[thread overview]
Message-ID: <20181128145955.GN11247@bill-the-cat> (raw)
In-Reply-To: <3473a1b8-740d-dc9b-a9be-1563bc835ab3@denx.de>

On Wed, Nov 28, 2018 at 10:33:56AM +0100, Stefano Babic wrote:
> Hi Tom,
> 
> On 27/11/18 17:13, Tom Rini wrote:
> > On Tue, Nov 27, 2018 at 03:39:39PM +0100, Stefano Babic wrote:
> >> Hi Jagan,
> >>
> >> (CCing the world looks to me quite a terror attack, nevertheless):
> >>
> >> On 27/11/18 06:51, Jagan Teki wrote:
> >>> On Mon, Nov 26, 2018 at 12:48 PM Peng Fan <peng.fan@nxp.com> wrote:
> >>>>
> >>>> Hi Jagan,
> >>>>
> >>>> Just have a quick question here.
> >>>>
> >>>> After dropping non-DM code, for SPL use non-DM code should switch to SPL_DM and use SPL OF CONTROL?
> >>>
> >>
> >> I can understand the reasons to switch completely to DM code, but let's
> >> face some real facts:
> >>
> >> - dropping legacy code requires to use SPL_OF_CONTROL into SPL, and yes,
> >> footprint steadily increases. We are getting rid of place for MX6 Solo,
> >> and this is not an ancient processor we can forget.
> >> Size of SRAM is not something we can discuss - it is. Other features
> >> (secure boot, etc.) were pushed to SPL, and these features were
> >> requested by real projects. We cannot get rid of these feature just to
> >> make place for DM.
> > 
> > Just what is the limit on MX6 Solo, worst case?
> 
> Solo has 68KB OCRAM available - if I remember well, letting some space
> for early stack and some other thigs, there is still 49K available. This
> was big enough when SPL was ported to MX, now we are approaching the limit.

OK, so yes, we're both in the same ballpark wrt size constraints.

> This is worst when for some projects there is the need for some
> customization, like additional code to get device data or calibration
> for RAM. In some cases, it is becoming tricky.
> 
> Anyway, my concern is that the OCRAM is not so small, but nevertheless
> we have now reached the point where the SPL has grown so much to take
> all available size.

Right, and we'll need to take a look at what tricks we have available
and what we've already used.

> >  And what boot methods
> > do we have to support there too?
> 
> I can imagine that at least booting from storages (NAND, SPI, SD) and
> from SDP (usb gadget) should be supported in the same SPL. Maybe just a
> couple of storages at the same time (main boot device and "backup" to
> restore it).

Yeah, that's probably one of the things that'll need to be changed then
is moving from "look we can do anything" to more production "here's what
the design has for regular and recovery".  We had to do that for the
longest time, again on am33xx to put USB SPL stuff in its own build but
we're now finally looking at being able to perhaps pull that back in to
the kitchen-sink EVM builds.

And part of moving from "edit the config file" to "enable what you want
via Kconfig" makes me feel less bad / worried about not showcasing every
possible feature of a SoC in all builds since it becomes easier to
document and less potentially error-prone to change what's configured.

> >  The am335x with secure boot case is
> > small, but might not be as small as you have to worry about here.
> 
> It looks to me that size is quite comparable to AM335x.
> 
> > 
> >> - the benefits cannot be really understood by the manufacturers or
> >> owners of boards, because they can see a step in the past if they have
> >> to forget some features they are currently using.
> > 
> > Yes, we need to make sure that we don't just drop functionality for no
> > apparent reason.
> 
> Fully agree.
> 
> >  But we can't use that as a reason to maintain wholly
> > separate subsystems for some platforms either.
> 
> Right, but we have to find a solution.

Fully agree.

> >> - TPL adds an additional step and this increases the boottime - another
> >> *real* and *important* feature for most projects.
> > 
> > I _really_ want to see this measured so we know what time is being added
> > so we can think about what to do about it, too.  Yes, adding a few
> > kilobytes is a few cycles, and a few is more than zero, and there are
> > use cases that have demands screaming for less cycles to be used, not
> > more (aside, when this is coupled with "But we're moving to aarch64" and
> > that requires more firmware layers makes me shake my head internally a
> > little).  But by that same token, part of the notion behind
> > TPL->SPL->U-Boot or Linux is that some functionality is moved from SPL
> > to TPL.
> 
> I have no measures - this can be done after moving one of these i.MX6 to

OK, so lets not worry too much about that part then until it's something
we can see is a real concern.

> a TPL based bootloader. I am just thinking about when we introduced SPL
> some years ago. One goal was to have a "simpler" loader that provides
> the first initialization (just RAM and console), letting u-boot to do
> the rest. This sounds weird now - these are the requirement we ask for
> TPL. So TPL looks to me an early SPL - can we just have a simpler SPL,
> that just does the simple initialization ? TPL was initially thought for
> SOCs having a very small RAM on board, and then they can boot from a
> single storage only. This is also not the requirement for more complex
> SOC, and even with TPL, a i.MX should boot from SPI, NAND / SD. And to
> maintain the trust of chain, TPL should able to load just signed images,
> too (it is another step and add complexity).

I suppose part of the problem is that we had "SPL" for dealing with NAND
booting, where we couldn't do what we used to do, and then we had "SPL"
for "lets allow ourselves to do a bunch of neat things".  Moving forward
it's more "TPL" is "we need one-off (or near enough) code to get
ourselves started" and "SPL" for "We need to handle a bunch of neat
things very early".

> For aarch64, I agree with you and there is nothing we can do against it.
> More layers were also introduced due to increased requirements for
> security.On the other side, these SOCs could be faster during boot due
> to better CPU.
> 
> What about the drivers we need in TPL ? They cannot be a DM driver, so
> we still need some legacy drivers for storage. We should still have both
> type of drivers (DM and not DM), and dropping current legacy drivers
> from SPL does not help.

So yes, TPL is where we're going to have to, and will live with one-off
SoC-centric and lack of framework drivers to Just Work.

> >>> Here are the options, that we dealt based on the size constraints
> >>> 1) try to use DM_SPL with SPL OF_CONTROL
> >>
> >> There is no enough place for most SOCs, even quite recent. This is not
> >> due just to the size of SRAM, but also by some restriction on the usage
> >> of the SRAM itself by the internal BootROM.
> > 
> > This is debatable, frankly.  But yes, we do have modern platforms with a
> > still small usable by first non-ROM-application amount of memory.  So we
> > must have a solution.
> 
> Fully agree.
> 
> > 
> >>> 2) try PLATDATA
> >>
> >> This is even not footprint friendly.
> > 
> > Why?  This is in fact our current method for "we need something more
> > footprint friendly to feed enough info in to get to the next
> > application".
> 
> I think I need some measure - if size remains small enough, it could be
> a suitable way.

Please, yes.

> >>> 3) try TPL for truly small size
> >>
> >> See above. There is an additional layer without evident advantages for
> >> manufacturers and / or customers.
> > 
> > "You need this in order to boot now".  Just like moving from say DCD
> > files to SPL required convincing manufacturers and customers that it was
> > a win even if you could do everything with DCD scripts and plugins, this
> > too requires explanation.
> 
> I agree - but let's me say that the advantages in that case were very
> clear (no fixed RAM setup bound to the HW, run time detection, single
> binary for multiple variants in case of i.MX6,..) and most important,
> these advantages meant for manufacturers less costs. Less cost because
> it is easier to relace a chip that reached EOL, or because they do not
> have different part number for each bootloader (they have just one), or...
> 
> The same should happens now to convince again manufacturers and customers.
> 
> > 
> > But also, I keep saying, and it feels like I keep not being heard, we
> > aren't declaring the death of non-DM for SPL for all platforms just yet.
> 
> Nice to listen this - I was already scared from this thread and last
> "CONFIG_BLK" :-)
> 
> > There's likely a few more technical challenges to sort out, and some
> > explanation of why the world isn't static required before we can do
> > that.

So, I think we're largely in agreement here.  What I'd really like to
see happen next is get enough of what's remaining and not DM'ified on
the full U-Boot side of things (where the why is because that's what
drivers look like now) so that we can enable them for SPL too and see
where we really do hit a problem.  I'm sure we will, and the situations
like at91 where we have single-digit kilobytes to work with are going to
be hard.  But for i.MX, we're in the same ballpark as other platforms
that have been converted.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181128/87c75971/attachment.sig>

      reply	other threads:[~2018-11-28 14:59 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-25 17:28 [U-Boot] [PATCH v2 00/32] spi: DM_SPI migration timeout, remainder(2) Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 01/32] spi: davinci: Full dm conversion Jagan Teki
2018-11-26 13:32   ` Adam Ford
2018-11-26 18:19     ` Jagan Teki
2018-11-26 19:12       ` Adam Ford
2018-11-25 17:28 ` [U-Boot] [PATCH v2 02/32] spi: kirkwood: " Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 03/32] spi: ti_qspi: " Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 04/32] spi: mpc8xxx: Use short type names Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 05/32] spi: mpc8xxx: Fix comments Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 06/32] spi: mpc8xxx: Rename camel-case variables Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 07/32] spi: mpc8xxx: Fix space after cast Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 08/32] spi: mpc8xxx: Fix function names in strings Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 09/32] spi: mpc8xxx: Replace defines with enums Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 10/32] spi: mpc8xxx: Use IO accessors Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 11/32] spi: mpc8xxx: Simplify if Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 12/32] spi: mpc8xxx: Get rid of is_read Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 13/32] spi: mpc8xxx: Simplify logic a bit Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 14/32] spi: mpc8xxx: Reduce scope of loop variables Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 15/32] spi: mpc8xxx: Make code more readable Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 16/32] spi: mpc8xxx: Rename variable Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 17/32] spi: mpc8xxx: Document LEN setting better Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 18/32] spi: mpc8xxx: Re-order transfer setup Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 19/32] spi: mpc8xxx: Fix if check Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 20/32] spi: mpc8xxx: Use get_timer Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 21/32] spi: mpc8xxx: Convert to DM Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 22/32] spi: Zap cf_spi driver-related code Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 23/32] spi: Zap lpc32xx_ssp " Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 24/32] spi: Zap mxs_spi " Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 25/32] spi: Zap sh_spi " Jagan Teki
2018-11-25 18:06   ` Marek Vasut
2018-11-27  6:05     ` Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 26/32] spi: Zap soft_spi_legacy " Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 27/32] spi: mxc: Drop non-dm code Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 28/32] spi: omap3: " Jagan Teki
2018-11-26 19:36   ` Adam Ford
2018-11-25 17:28 ` [U-Boot] [PATCH v2 29/32] spi: atmel: " Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 30/32] spi: Zap fsl_espi driver-related code Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 31/32] spi: fsl_dspi: Drop non-dm code Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 32/32] dm: MIGRATION: spi: Update SPI driver status Jagan Teki
2018-12-11  1:03   ` Simon Glass
2018-11-26  7:18 ` [U-Boot] [PATCH v2 00/32] spi: DM_SPI migration timeout, remainder(2) Peng Fan
2018-11-27  5:51   ` Jagan Teki
2018-11-27 12:10     ` Marek Vasut
2018-11-28  4:24       ` Heiko Schocher
2018-11-28  4:36         ` Tom Rini
2018-11-27 14:39     ` Stefano Babic
2018-11-27 16:13       ` Tom Rini
2018-11-28  9:33         ` Stefano Babic
2018-11-28 14:59           ` Tom Rini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181128145955.GN11247@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.