[PATCH 2/2] cmd: introduce 'write' command

Simon Glass sjg at chromium.org
Tue Feb 21 20:41:56 CET 2023


Hi Rasmus,

On Fri, 17 Feb 2023 at 17:59, Rasmus Villemoes
<rasmus.villemoes at prevas.dk> wrote:
>
> It's almost no extra code to hook up a buddy to the 'read' command. In
> fact, since the command is passed its own 'struct cmd_tbl', we can use
> the exact same callback, and let it figure out for itself whether it
> was invoked as "read" or "write".
>
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes at prevas.dk>
> ---
>  cmd/Kconfig  |  5 +++++
>  cmd/Makefile |  1 +
>  cmd/read.c   | 29 ++++++++++++++++++++++-------
>  3 files changed, 28 insertions(+), 7 deletions(-)

Great, but please do add a little more code :-)

- doc/usage/cmd
- test/cmd/write.c

For the test you can use sandbox's mmc0 - see dm_test_mmc_blk() for an
example of a test that does that. For checking the command response,
the acpi.c test is an example, although I suppose there is actually no
output.

Regards,
Simon


More information about the U-Boot mailing list