public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Michal Suchánek" <msuchanek@suse.de>
To: Samuel Holland <samuel@sholland.org>
Cc: u-boot@lists.denx.de, Andre Przywara <osp@andrep.de>,
	Simon Glass <sjg@chromium.org>,
	Philipp Tomsich <philipp.tomsich@vrull.eu>,
	Kever Yang <kever.yang@rock-chips.com>,
	Jagan Teki <jagan@amarulasolutions.com>,
	Andre Przywara <andre.przywara@arm.com>,
	Andy Yan <andy.yan@rock-chips.com>,
	Michal Simek <michal.simek@amd.com>,
	Igor Opaniuk <igor.opaniuk@foundries.io>
Subject: Re: [PATCH 0/2] Command for entering mask rom USB download mode
Date: Mon, 4 Jul 2022 12:32:26 +0200	[thread overview]
Message-ID: <20220704103226.GJ17705@kitsune.suse.cz> (raw)
In-Reply-To: <87596dac-6072-b0fc-65bf-b3f342b551e0@sholland.org>

On Sun, Jul 03, 2022 at 06:26:22PM -0500, Samuel Holland wrote:
> Hi Michal,
> 
> On 7/3/22 2:20 PM, Michal Suchanek wrote:
> > 
> > Hello,
> > 
> > many ARM SoCs have a mask rom feature that provides interface for
> > downloading firmware over USB.
> > 
> > Downstream rockchip u-boot has 'brom' or 'rbrom' command for this
> > purpose, and downstream sunxi u-boot provides 'efex' command. p-boot has
> > code for entering FEL on A64 SoC.
> > 
> > With this patch I am able to activate the USB downloader on a rk3399 but
> > the rkflashtool fails to communicate with the device. On a H2+ I can get
> > into the FEL mode and get flash parameters. YMMV
> > 
> > I don't have any great idea how to structure this so that the command
> > does not need platform-specific code. Is there an example of a command
> > that has platform-specific implementations?
> 
> Generally you would do this by having the driver interact with some DM uclass.
> Platforms may or may not provide a driver implementing that uclass; the details
> are hidden behind the uclass's interface. All the command has to do is search
> for a DM device by uclass, and if one is found, call some operation on it.
> 
> In this case, UCLASS_REBOOT_MODE already exists. It sounds like what we need is
> the inverse of dm_reboot_mode_update() -- a function that takes a string and
> programs the device with the corresponding mode value.
> 
> To be generic, you could call this function from do_reset() if some positional
> argument is provided, allowing usage like "reset bootloader" or "reset fel".
> 
> Rockchip platforms already have syscon-reboot-mode hooked up in their
> devicetrees. The driver for this should be trivial.
> 
> Allwinner platforms would need to add a nvmem-reboot-mode node, and a bit more
> driver infrastructure. U-Boot does not have NVMEM uclass, so you would need to
> add one or reuse UCLASS_MISC.

Not sure I understand the DM enough but as firt step I can at least hook
it to the do_reset function.

Thanks

Michal

      reply	other threads:[~2022-07-04 10:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-03 19:20 [PATCH 0/2] Command for entering mask rom USB download mode Michal Suchanek
2022-07-03 19:20 ` [PATCH 1/2] cmd: boot: add brom cmd to reboot to brom dnl mode Michal Suchanek
2022-07-03 19:20 ` [PATCH 2/2] cmd: boot: add brom cmd to reboot to FEL mode Michal Suchanek
2022-07-03 22:23   ` Andre Przywara
2022-07-04  9:33     ` Michal Suchánek
2022-07-03 22:22 ` [PATCH 0/2] Command for entering mask rom USB download mode Andre Przywara
2022-07-04  9:42   ` Michal Suchánek
2022-07-03 23:26 ` Samuel Holland
2022-07-04 10:32   ` Michal Suchánek [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=20220704103226.GJ17705@kitsune.suse.cz \
    --to=msuchanek@suse.de \
    --cc=andre.przywara@arm.com \
    --cc=andy.yan@rock-chips.com \
    --cc=igor.opaniuk@foundries.io \
    --cc=jagan@amarulasolutions.com \
    --cc=kever.yang@rock-chips.com \
    --cc=michal.simek@amd.com \
    --cc=osp@andrep.de \
    --cc=philipp.tomsich@vrull.eu \
    --cc=samuel@sholland.org \
    --cc=sjg@chromium.org \
    --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