From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [PATCH] RFC: tiny-dm: Proposal for using driver model in SPL
Date: Mon, 25 May 2020 16:57:14 -0400 [thread overview]
Message-ID: <20200525205714.GV12717@bill-the-cat> (raw)
In-Reply-To: <CAPnjgZ2Zw=CPZcHCWu7xb7aPwrHQDj3=RoR3t2k3zWEyY4NZTg@mail.gmail.com>
On Mon, May 25, 2020 at 02:34:20PM -0600, Simon Glass wrote:
> Hi Tom,
>
> On Mon, 25 May 2020 at 13:47, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Mon, May 25, 2020 at 09:35:44AM -0600, Simon Glass wrote:
> >
> > > This patch provides the documentation for a proposed enhancement to driver
> > > model to reduce overhead in SPL.
> > >
> > > The actual patches are not included here because they are based on some
> > > pending work by Walter Lozano which is not in final form.
> > >
> > > For now, the source tree is available at:
> > >
> > > https://gitlab.denx.de/u-boot/custodians/u-boot-dm/-/tree/dtoc-working
> > >
> > > Comments welcome!
> >
> > So here's my worry. It's not clear, aside from the device tree, how
> > much re-use of existing code we get with this. It feels like it might
> > be fairly minimal. And at that point, are we not perhaps making too
> > much work for ourselves compared with just excepting that there will
> > need to be a place for non-abstracted-framework drivers? What do we do
> > about TPL, when we get to the point of everything being converted to DM
> > and as-needed tiny-DM but there's still TPL drivers? The reason we have
> > SPL_FRAMEWORK as a symbol today is that we already had some
> > SoCs/architectures (primarily PowerPC) that had "SPL" but it was very
> > centric to the SoCs in question.
> >
> > The interface for example for mmc is:
> > int spl_mmc_load_image(struct spl_image_info *spl_image, struct
> > spl_boot_device *bootdev) and neither part of that is inherently DM. So
> > let it be MMC_TINY for the non-DM case and regular DM_MMC for the DM
> > case. I wonder if we could clean that up code a little if we let it be
> > separate.
> >
> > The interface for example for spi is:
> > int spl_spi_load_image(struct spl_image_info *spl_image,
> > struct spl_boot_device *bootdev) and well, the same thing. Or maybe we
> > can even push that up to the spi_flash_load() call.
> >
> > But my worry is that a different set of abstractions here are still
> > going to bring us in more overhead than writing drivers for the
> > functionality we need directly, and if we define what's allowed in this
> > limited case well, that might be good enough.
>
> Some boards (e.g. x86) Need to read multiple things from the SPI flash
> (such as FSP binaries), so I still think we will want a generic
> reading interface.
>
> You could be right, but my hunch is that there is value in having
> things more generic and the cost should be minimal. The value is that
> hopefully writing a few C functions in the SPI driver will be enough
> to enable tiny SPI on an SoC, reusing much of the code in the driver
> (only the reading bits!). We won't need as much special-case code and
> an entirely different way of configuring these devices for TPL/SPL.
>
> It has been interesting digging into the Zephyr model. It's drivers
> are very basic and thus small. But there is still value in using the
> device tree to assemble things.
>
> Anyway I'm not really sure at this point. It is just a hunch. I don't
> think we can know all this until we have a bit more information.
> Perhaps with a board with SPI, MMC and serial converted we would get a
> better picture?
I think it's absolutely the case that we'll have to convert something
and see how it looks, then convert something else and see if it still
looks good enough. At a high enough level there's not really too much
of a difference between what it sounds like you're proposing and what
I'm proposing. Possibly even in a progmatic way too. We have (I think
anyhow) fairly static board configurations in this case so we don't so
much need to "probe" for possible drivers be told what our device
hierarchy is and to initialize what we're going to use.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200525/4876b425/attachment.sig>
next prev parent reply other threads:[~2020-05-25 20:57 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-25 15:35 [PATCH] RFC: tiny-dm: Proposal for using driver model in SPL Simon Glass
2020-05-25 19:47 ` Tom Rini
2020-05-25 20:34 ` Simon Glass
2020-05-25 20:57 ` Tom Rini [this message]
2020-05-25 21:40 ` Simon Glass
2020-05-26 18:39 ` Walter Lozano
2020-06-01 20:55 ` Walter Lozano
2020-06-02 13:53 ` Tom Rini
2020-06-05 3:13 ` Simon Glass
2020-06-05 14:20 ` Tom Rini
2020-06-05 16:18 ` Walter Lozano
2020-06-05 16:32 ` Tom Rini
2020-06-05 19:29 ` Walter Lozano
2020-06-05 20:20 ` Walter Lozano
2020-06-05 3:11 ` Simon Glass
2020-06-05 3:22 ` Simon Glass
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=20200525205714.GV12717@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox