[PATCH v4 1/1] fastboot: introduce 'oem board' subcommand

Mattijs Korpershoek mkorpershoek at baylibre.com
Wed Apr 10 14:56:22 CEST 2024


Hi Alexey,

On mer., avril 10, 2024 at 12:43, Alexey Romanov <avromanov at salutedevices.com> wrote:

> Hi guys,
>
> On Wed, Apr 10, 2024 at 02:02:21PM +0200, Quentin Schulz wrote:
>> Hi Alexey,
>> 
>> On 4/10/24 12:58, Alexey Romanov wrote:
>> > Currently, fastboot protocol in U-Boot has no opportunity
>> > to execute vendor custom code with verifed boot. This patch
>> > introduce new fastboot subcommand fastboot oem board:<cmd>,
>> > which allow to run custom oem_board function.
>> > 
>> > Default implementation is __weak. Vendor must redefine it in
>> > board/ folder with his own logic.
>> > 
>> > For example, some vendors have their custom nand/emmc partition
>> > flashing or erasing. Here some typical command for such use cases:
>> > 
>> > - flashing:
>> > 
>> >    $ fastboot stage bootloader.img
>> >    $ fastboot oem board:write_bootloader
>> > 
>> > - erasing:
>> > 
>> >    $ fastboot oem board:erase_env
>> > 
>> > Signed-off-by: Alexey Romanov <avromanov at salutedevices.com>
>> > Reviewed-by: Mattijs Korpershoek <mkorpershoek at baylibre.com>
>> > ---
>> >   doc/android/fastboot.rst      | 18 ++++++++++++++++++
>> >   drivers/fastboot/Kconfig      |  7 +++++++
>> >   drivers/fastboot/fb_command.c | 30 ++++++++++++++++++++++++++++++
>> >   include/fastboot.h            |  1 +
>> >   4 files changed, 56 insertions(+)
>> > 
>> > diff --git a/doc/android/fastboot.rst b/doc/android/fastboot.rst
>> > index 1ad8a897c8..2a627f9890 100644
>> > --- a/doc/android/fastboot.rst
>> > +++ b/doc/android/fastboot.rst
>> > @@ -29,6 +29,7 @@ The following OEM commands are supported (if enabled):
>> >     with <arg> = boot_ack boot_partition
>> >   - ``oem bootbus``  - this executes ``mmc bootbus %x %s`` to configure eMMC
>> >   - ``oem run`` - this executes an arbitrary U-Boot command
>> > +- ``oem board`` - this executes a custom board function which is defined by the vendor
>> >   Support for both eMMC and NAND devices is included.
>> > @@ -245,6 +246,23 @@ including multiple commands (using e.g. ``;`` or ``&&``) and control structures
>> >   (``if``, ``while``, etc.). The exit code of ``fastboot`` will reflect the exit
>> >   code of the command you ran.
>> > +Running Custom Vendor Code
>> > +^^^^^^^^^^^^^^^^^^^^^^^^^^
>> > +
>> > +U-Boot allows you to execute custom fastboot logic, which can be defined
>> > +in board/ files. It can still be used for production devices with verified
>> > +boot, because the vendor define logic at compile time by implementing
>> 
>> I think it should be "defines" here?
>
> Yep. If there are no more comments, maybe Mattijs will correct this when
> he picks up a patch? So that I don't send a new series with typo fix :)

Yes, if there are no other review comments, I will fix this up locally
when picking this up.

>
>> 
>> Reviewed-by: Quentin Schulz <quentin.schulz at theobroma-systems.com>
>> 
>> Thanks,
>> Quentin
>
> -- 
> Thank you,
> Alexey


More information about the U-Boot mailing list