linux-sunxi.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: Andre Przywara <andre.przywara@arm.com>
Cc: Jagan Teki <jagan@amarulasolutions.com>,
	U-Boot Mailing List <u-boot@lists.denx.de>,
	 linux-sunxi@lists.linux.dev,
	Patrick Delaunay <patrick.delaunay@foss.st.com>,
	 Sean Anderson <sean.anderson@seco.com>,
	Heiko Schocher <hs@denx.de>,
	 Kever Yang <kever.yang@rock-chips.com>,
	Philipp Tomsich <philipp.tomsich@vrull.eu>
Subject: Re: [RFC PATCH 1/3] fastboot: Allow runtime determination of MMC device
Date: Thu, 27 May 2021 07:44:17 -0600	[thread overview]
Message-ID: <CAPnjgZ2gd2Lj0CXR-k_oPrRus19WWV1dMBnysCU1a_zgPPKeRg@mail.gmail.com> (raw)
In-Reply-To: <20210524003650.24469-2-andre.przywara@arm.com>

Hi Andre,

On Sun, 23 May 2021 at 18:37, Andre Przywara <andre.przywara@arm.com> wrote:
>
> At the moment the fastboot code relies on the Kconfig variable
> CONFIG_FASTBOOT_FLASH_MMC_DEV to point to the MMC device to use for the
> flash command. This value needs to be the *U-Boot device number*, which
> recently got more dynamic, and depends on other MMC nodes in the
> devicetree, but also on mmc aliases defined. This leads to situations
> where it's hard to fix this number at compile time, because a WiFi
> device might enumerate before the wanted eMMC device, for instance.
>
> To avoid this fragile situation, allow this value to be determined at
> runtime. This decision is probably platform specific, so introduce a
> weak function that returns the needed number, and use that everywhere
> instead of the Kconfig variable.
>
> For now the default implementation just returns this very Kconfig
> variable, but this can be overwritten by platforms later.
>
> No functional change at this point.
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  drivers/fastboot/fb_command.c |  6 +++---
>  drivers/fastboot/fb_common.c  |  3 ++-
>  drivers/fastboot/fb_mmc.c     | 12 ++++++++----
>  include/fastboot.h            |  7 +++++++
>  4 files changed, 20 insertions(+), 8 deletions(-)

I wonder if this would be better done using a sysinfo driver? Then it
could be hard-coded, picked up from the DT, probed at runtime, etc.,
just as with a weak function.

Regards,
Simon

  reply	other threads:[~2021-05-27 13:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-24  0:36 [RFC PATCH 0/3] fastboot: sunxi: Determine MMC device at runtime Andre Przywara
2021-05-24  0:36 ` [RFC PATCH 1/3] fastboot: Allow runtime determination of MMC device Andre Przywara
2021-05-27 13:44   ` Simon Glass [this message]
2021-05-24  0:36 ` [RFC PATCH 2/3] sunxi: Implement fastboot_get_mmc_device() Andre Przywara
2021-05-24 14:33   ` Sean Anderson
2021-05-24 14:57     ` Andre Przywara
2021-05-24  0:36 ` [RFC PATCH 3/3] sunxi: Drop sunxi FASTBOOT_FLASH_MMC_DEV defaults Andre Przywara
2021-05-24 14:37 ` [RFC PATCH 0/3] fastboot: sunxi: Determine MMC device at runtime Sean Anderson
2021-05-24 15:15   ` Andre Przywara
2021-05-24 15:33     ` Sean Anderson
2021-05-24 15:28   ` Maxime Ripard
2021-05-24 15:43     ` Sean Anderson
2021-06-07 15:14       ` Maxime Ripard
2021-06-07 15:21         ` Sean Anderson

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=CAPnjgZ2gd2Lj0CXR-k_oPrRus19WWV1dMBnysCU1a_zgPPKeRg@mail.gmail.com \
    --to=sjg@chromium.org \
    --cc=andre.przywara@arm.com \
    --cc=hs@denx.de \
    --cc=jagan@amarulasolutions.com \
    --cc=kever.yang@rock-chips.com \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=patrick.delaunay@foss.st.com \
    --cc=philipp.tomsich@vrull.eu \
    --cc=sean.anderson@seco.com \
    --cc=u-boot@lists.denx.de \
    --subject='Re: [RFC PATCH 1/3] fastboot: Allow runtime determination of MMC device' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).