public inbox for rulkc@linuxtesting.org
 help / color / mirror / Atom feed
From: slava at dubeyko.com (Viacheslav Dubeyko)
Subject: [rulkc] [PATCH v1 00/11] Amlogic: ADNL and Optimus protocols support
Date: Wed, 30 Jul 2025 18:07:03 -0700	[thread overview]
Message-ID: <67e62ca6ca540483c7acb1c5a48c1eded44bbd17.camel@dubeyko.com> (raw)
In-Reply-To: <20250729182910.16127-1-avkrasnov@salutedevices.com>

On Tue, 2025-07-29 at 21:28 +0300, Arseniy Krasnov wrote:
> This patchset adds support of two Amlogic firmware burning protocols:
> ADNL and Optimus. Each protocol is supported on the following SoC:
> 

I think that description is missing some important information. It is
not clear why these two protocols implementation should be added in the
kernel. Do they faster than another one? Is it possible to share some
benchmarking results, then? Do they essential for supporting some
hardware? Do they provide some really fancy new features?

And, also, why two protocols implementation have been sent in one
patchset?

Thanks,
Slava.

> axg, g12a, g12b, sm1 - Optimus.
> a1, s4, a5, c1, c2, c3, sc2, t3, t7, p1 - ADNL.
> 
> Both work in fastboot manner, but significant feature is that they
> are
> supported by current Amlogic BootROMs. As transport both use USB:
> device is switched to gadget mode and then it can communicate with
> PC.
> On PC side protocols are supported by:
> 
> 1) https://github.com/superna9999/pyamlboot (with some limitation)
> 
>    For example:
>    pyamlboot/./ubt.py --img <image> --wipe all --reset
> 
>    Note, image has special format, specific for Amlogic.
> 
> 2) Proprietary vendor tools.
> 
> As protocols are supported by BootROM, it allows to "resurrect"
> devices
> when boot image (BL2, Uboot) missed/invalid. Typical flow for such
> cases
> is (both protocols):
> 
>       DEVICE                       PC
> 
>                           *-------------------*
>                           |                   |
>                           | Runs update tool, |
>                           | waits for device  |
>                           |    on USB bus.    |
>                           |                   |
>                           *-------------------*
>                                     |
> *---------------------*             |
> >      Power on       |<-----<------/
> *---------------------*
>           |
>           |
> *---------------------*
> >                     |
> > Boot ROM switches   |
> > device to USB gadget|>----->------\
> > mode and waits for  |             |
> > commands.           |             |
> >                     |             |
> *---------------------*             |
>                                     |
>                           *-------------------*
>                           | Detects device on |
>                           |     USB bus.      |
>                           *-------------------*
>                                     |
>                                     |
>                           *-------------------*
>                           |  Sends BL2 image  |
>                           |     over USB.     |
>                           *-------------------*
>                                     |
> *---------------------*             |
> >     Boot ROM runs   |<-----<------/
> >       BL2 image.    |
> *---------------------*
>           |
>           |
> *---------------------*
> >    BL2 waits for    |>----->------\
> >  Uboot image (FIP). |             |
> *---------------------*             |
>                                     |
>                           *-------------------*
>                           | Sends Uboot image |
>                           |     over USB.     |
>                           *-------------------*
>                                     |
> *---------------------*             |
> >  BL2 runs received  |<-----<------/
> >     Uboot image.    |
> *---------------------*
>            |
>            |
> *---------------------*
> >   Uboot waits for   |>----->------\
> >      commands.      |             |
> *---------------------*             |
>                                     |
>                           *-------------------*
>                           | Sends commands to |
>                           |    over USB.      |
>                           *-------------------*
>                                     |
> *---------------------*             |
> > Uboot processes     |             |
> > commands: erases,   |             |
> > writes NAND, checks |<-----<------/
> > CRC of written data |
> > etc.                |
> *---------------------*
>            |
>            |
> *---------------------*
> > Uboot does reboot   |
> *---------------------*
> 
> There is also another mode to operate both protocols when  we run not
> from BootROM, but from Uboot shell. To do that, we enter protocol
> specific command in shell ("adnl" or "optimus"). In this case Uboot
> switches device to gadget mode, write some value to special register
> and does reboot. Then BootROM checks above mentioned register and
> then
> switches device to gadget mode. After that flow from above is
> executed.
> This mode has same purposes as image update by 'fastboot'.
> 
> Limitations:
> 1) Only limited set of each protocol commands are supported -
>    it is enough to update image. But, for example 'secureboot'
>    feature is not implemented.
> 2) ADNL was tested on A1 SoC only.
> 3) Optimus was tested on AXG SoC only.
> 
> For more details of each protocol pls see the following:
> ADNL - drivers/usb/gadget/amlogic/adnl/f_adnl.c
> Optimus - drivers/usb/gadget/amlogic/optimus/f_optimus.c.
> 
> Arseniy Krasnov (8):
>   arch: arm: meson: use 'meson_sm_call()' in 'meson_sm_pwrdm_set()'
>   usb: gadget: fastboot: make part of USB fastboot code shared
>   usb: gadget: amlogic: common code for Amlogic flashing commands
>   mtd: rawnand: meson: move some defines to dedicated header
>   arch: arm: meson: bootloader write support
>   arm: meson: a1: add A1_SYSCTRL_SEC_STICKY_REG2
>   usb: gadget: amlogic: implement ADNL protocol
>   arm: meson: a1: ADNL protocol support
> 
> Vladimir Mitrofanov (3):
>   arch: arm: meson: sm: add commands to reboot device in different
> modes
>   usb: gadget: amlogic: implement Optimus protocol
>   arch: arm: axg: Optimus protocol support
> 
>  arch/arm/include/asm/arch-meson/a1.h          |  19 +
>  arch/arm/include/asm/arch-meson/axg.h         |  12 +
>  arch/arm/include/asm/arch-meson/nand.h        |  34 +
>  arch/arm/include/asm/arch-meson/rawnand.h     |  38 +
>  arch/arm/include/asm/arch-meson/sm.h          |  98 +-
>  arch/arm/include/asm/arch-meson/spinand.h     |  43 +
>  arch/arm/mach-meson/Kconfig                   |  31 +
>  arch/arm/mach-meson/Makefile                  |   4 +-
>  arch/arm/mach-meson/board-a1.c                |  32 +-
>  arch/arm/mach-meson/board-axg.c               |  12 +
>  arch/arm/mach-meson/board-common.c            |  32 +
>  arch/arm/mach-meson/rawnand.c                 | 291 ++++++
>  arch/arm/mach-meson/sm.c                      |  43 +-
>  arch/arm/mach-meson/spinand.c                 | 158 ++++
>  cmd/Kconfig                                   |  14 +
>  cmd/meson/Makefile                            |   2 +
>  cmd/meson/adnl.c                              |  27 +
>  cmd/meson/gadget.c                            | 183 ++++
>  cmd/meson/gadget.h                            |  28 +
>  cmd/meson/optimus.c                           |  21 +
>  drivers/mtd/nand/raw/meson_nand.c             |  13 +-
>  drivers/sm/meson-sm.c                         |   3 +
>  drivers/usb/gadget/Kconfig                    |   2 +
>  drivers/usb/gadget/Makefile                   |   4 +-
>  drivers/usb/gadget/amlogic/Kconfig            |  12 +
>  drivers/usb/gadget/amlogic/adnl/Kconfig       |  29 +
>  drivers/usb/gadget/amlogic/adnl/Makefile      |   4 +
>  drivers/usb/gadget/amlogic/adnl/adnl.h        | 124 +++
>  .../gadget/amlogic/adnl/adnl_buff_manager.c   | 316 +++++++
>  drivers/usb/gadget/amlogic/adnl/adnl_media.c  | 235 +++++
>  .../usb/gadget/amlogic/adnl/adnl_storage.c    | 140 +++
>  drivers/usb/gadget/amlogic/adnl/f_adnl.c      | 835
> ++++++++++++++++++
>  drivers/usb/gadget/amlogic/optimus/Kconfig    |  12 +
>  drivers/usb/gadget/amlogic/optimus/Makefile   |   7 +
>  .../usb/gadget/amlogic/optimus/f_optimus.c    | 687 ++++++++++++++
>  .../gadget/amlogic/optimus/optimus_download.c | 188 ++++
>  .../gadget/amlogic/optimus/optimus_download.h |  86 ++
>  drivers/usb/gadget/f_fastboot.c               | 295 +------
>  drivers/usb/gadget/f_fastboot_common.c        | 320 +++++++
>  drivers/usb/gadget/f_fastboot_common.h        |  71 ++
>  include/meson/sm.h                            |   3 +
>  41 files changed, 4202 insertions(+), 306 deletions(-)
>  create mode 100644 arch/arm/include/asm/arch-meson/nand.h
>  create mode 100644 arch/arm/include/asm/arch-meson/rawnand.h
>  create mode 100644 arch/arm/include/asm/arch-meson/spinand.h
>  create mode 100644 arch/arm/mach-meson/rawnand.c
>  create mode 100644 arch/arm/mach-meson/spinand.c
>  create mode 100644 cmd/meson/adnl.c
>  create mode 100644 cmd/meson/gadget.c
>  create mode 100644 cmd/meson/gadget.h
>  create mode 100644 cmd/meson/optimus.c
>  create mode 100644 drivers/usb/gadget/amlogic/Kconfig
>  create mode 100644 drivers/usb/gadget/amlogic/adnl/Kconfig
>  create mode 100644 drivers/usb/gadget/amlogic/adnl/Makefile
>  create mode 100644 drivers/usb/gadget/amlogic/adnl/adnl.h
>  create mode 100644
> drivers/usb/gadget/amlogic/adnl/adnl_buff_manager.c
>  create mode 100644 drivers/usb/gadget/amlogic/adnl/adnl_media.c
>  create mode 100644 drivers/usb/gadget/amlogic/adnl/adnl_storage.c
>  create mode 100644 drivers/usb/gadget/amlogic/adnl/f_adnl.c
>  create mode 100644 drivers/usb/gadget/amlogic/optimus/Kconfig
>  create mode 100644 drivers/usb/gadget/amlogic/optimus/Makefile
>  create mode 100644 drivers/usb/gadget/amlogic/optimus/f_optimus.c
>  create mode 100644
> drivers/usb/gadget/amlogic/optimus/optimus_download.c
>  create mode 100644
> drivers/usb/gadget/amlogic/optimus/optimus_download.h
>  create mode 100644 drivers/usb/gadget/f_fastboot_common.c
>  create mode 100644 drivers/usb/gadget/f_fastboot_common.h

      parent reply	other threads:[~2025-07-31  1:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-29 18:28 avkrasnov
2025-07-29 18:29 ` [rulkc] [PATCH v1 01/11] arch: arm: meson: sm: add commands to reboot device in different modes avkrasnov
2025-07-29 18:29 ` [rulkc] [PATCH v1 02/11] arch: arm: meson: use 'meson_sm_call()' in 'meson_sm_pwrdm_set()' avkrasnov
2025-07-29 18:29 ` [rulkc] [PATCH v1 03/11] usb: gadget: fastboot: make part of USB fastboot code shared avkrasnov
2025-07-29 18:29 ` [rulkc] [PATCH v1 04/11] usb: gadget: amlogic: common code for Amlogic flashing commands avkrasnov
2025-07-29 18:29 ` [rulkc] [PATCH v1 05/11] mtd: rawnand: meson: move some defines to dedicated header avkrasnov
2025-07-29 18:29 ` [rulkc] [PATCH v1 06/11] arch: arm: meson: bootloader write support avkrasnov
2025-07-29 18:29 ` [rulkc] [PATCH v1 07/11] arm: meson: a1: add A1_SYSCTRL_SEC_STICKY_REG2 avkrasnov
2025-07-29 18:29 ` [rulkc] [PATCH v1 08/11] usb: gadget: amlogic: implement ADNL protocol avkrasnov
2025-07-29 18:29 ` [rulkc] [PATCH v1 09/11] arm: meson: a1: ADNL protocol support avkrasnov
2025-07-29 18:29 ` [rulkc] [PATCH v1 10/11] usb: gadget: amlogic: implement Optimus protocol avkrasnov
2025-07-29 18:29 ` [rulkc] [PATCH v1 11/11] arch: arm: axg: Optimus protocol support avkrasnov
2025-07-31  1:07 ` slava [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=67e62ca6ca540483c7acb1c5a48c1eded44bbd17.camel@dubeyko.com \
    --to=rulkc@linuxtesting.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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

all inboxes | Powered by JetHome®