When U-Boot is executed during USB boot [1,2] on E850-96 board, two issues happen:
1. eMMC fails to initialize 2. Attempt to use USB PHY driver leads to abort It was identified that issue #1 happens due to enalbed Flash Memory Protector bits in MMC block registers during USB boot, and it's handled in patch series [3]. Issue #2 on the other hand happens because ROM code expects the bootloader (U-Boot) to download remaining binaries (LDFW and TZSW) over USB using SMC calls. Before that, the access to USB blocks (USB PHY and DWC3) is disabled, probably because corresponding TrustZone domains are configured for access from Secure World only. This patch series implements downloading LDFW and TZSW firmware over USB during USB boot, which makes it possible to use U-Boot for flashing images to eMMC using fastboot and DFU protocols. That in turn simplifies the U-Boot development, as one can use `dltool' [1] to run U-Boot binary during USB boot, and update U-Boot on eMMC this way (e.g. using DFU). It's not possible when using LittleKernel bootloader, as it expects non-standard Samsung GPT partition, but in case of U-Boot we use the regular one. Once this patch series and patch series [3] are applied it'll be possible to use U-Boot during USB boot. The two series are independent of each other, and can be applied in any particular order. Changes in v3: - Added PATCH #6 (enter DFU automatically on USB boot) - Rebased on top of the most recent master Changes in v2: - PATCH #4: Return 0 on success in load_image_usb() [1] https://gitlab.com/LinaroLtd/e850-96/tools/dltool [2] https://docs.u-boot.org/en/latest/board/samsung/e850-96.html [3] https://lore.kernel.org/u-boot/[email protected]/ Sam Protsenko (6): board: samsung: e850-96: Keep public functions together board: samsung: e850-96: Add routines for checking boot dev board: samsung: e850-96: Split LDFW loading and init board: samsung: e850-96: Add routine for loading images over USB board: samsung: e850-96: Load firmwares over USB on USB boot board: samsung: e850-96: Enter DFU automatically on USB boot board/samsung/e850-96/Makefile | 2 +- board/samsung/e850-96/bootdev.c | 99 +++++++++++++++++++++++++++++++++ board/samsung/e850-96/bootdev.h | 23 ++++++++ board/samsung/e850-96/e850-96.c | 71 ++++++++++++++++++----- board/samsung/e850-96/fw.c | 76 ++++++++++++++++++------- board/samsung/e850-96/fw.h | 10 +++- 6 files changed, 246 insertions(+), 35 deletions(-) create mode 100644 board/samsung/e850-96/bootdev.c create mode 100644 board/samsung/e850-96/bootdev.h base-commit: 91861e5a30d217d8e70130c9124c1646f4afef29 -- 2.47.3

