diff options
author | Neil Armstrong <narmstrong@baylibre.com> | 2018-07-27 15:10:00 +0300 |
---|---|---|
committer | Neil Armstrong <narmstrong@baylibre.com> | 2018-11-26 16:40:52 +0300 |
commit | d96a782d09dbdc4a28ece3d18dc17a572e39d4f2 (patch) | |
tree | a703759f1ed5f4bde82bceb9ec377a5e31f20ac7 /include/configs/meson64.h | |
parent | b890acc7432e2ca7b21a44cc70a87aca51b0aedd (diff) | |
download | u-boot-d96a782d09dbdc4a28ece3d18dc17a572e39d4f2.tar.xz |
ARM: meson: Add boot device discovery
The Amlogic Meson SoCs ROM supports a boot over USB with a custom protocol.
When no other boot medium are available (or by forcing the USB mode), the
ROM sets the primary USB port as device mode and waits for a Host to
enumerate.
When enumerated, a custom protocol described at [1] permits writing to
memory and execute some specific FIP init code to run the loaded
Arm Trusted Firmware BL2 and BL3 stages before running the BL33 stage.
In this mode, we can load different binaries that can be used by U-boot
like a script image file.
This adds support for a custom USB boot stage only available when the
boot mode is USB and the script file at a pre-defined address is valid.
This support was heavily copied from the Sunxi Allwinner FEL U-Boot support.
The tool pyamlboot described at [2], permits using this boot mode on boards
exposing the first USB port, either as OTG or Host port.
[1] https://github.com/superna9999/pyamlboot/blob/master/PROTOCOL.md
[2] https://github.com/superna9999/pyamlboot/blob/master/README.md
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Diffstat (limited to 'include/configs/meson64.h')
-rw-r--r-- | include/configs/meson64.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/configs/meson64.h b/include/configs/meson64.h index f961f43871..40ac079dfc 100644 --- a/include/configs/meson64.h +++ b/include/configs/meson64.h @@ -28,6 +28,18 @@ #define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_TEXT_BASE #define CONFIG_SYS_BOOTM_LEN (64 << 20) /* 64 MiB */ +/* ROM USB boot support, auto-execute boot.scr at scriptaddr */ +#define BOOTENV_DEV_ROMUSB(devtypeu, devtypel, instance) \ + "bootcmd_romusb=" \ + "if test \"${boot_source}\" = \"usb\" && " \ + "test -n \"${scriptaddr}\"; then " \ + "echo '(ROM USB boot)'; " \ + "source ${scriptaddr}; " \ + "fi\0" + +#define BOOTENV_DEV_NAME_ROMUSB(devtypeu, devtypel, instance) \ + "romusb " + #ifdef CONFIG_CMD_USB #define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0) #else @@ -36,6 +48,7 @@ #ifndef BOOT_TARGET_DEVICES #define BOOT_TARGET_DEVICES(func) \ + func(ROMUSB, romusb, na) \ func(MMC, mmc, 0) \ func(MMC, mmc, 1) \ func(MMC, mmc, 2) \ |