Looking for the FW Upgrade Source Code of the Yocto System

Background:
The SoC we use on our board is Genio SoC, and the system running on the board is Yocto 4.0. Currently, we upgrade the Yocto firmware via the genio-flash tool on a Windows PC. The upgrade steps are:

  1. Connect the board’s USB device port to the USB port of the PC.

  2. Open a DOS window on the PC and run genio-flash.

  3. First, turn off the board, press and hold the Update button on the board, then power on the board. The board enters upgrade mode and starts upgrading the firmware to the board’s eMMC.

This upgrade method uses fastboot on the PC to transfer the firmware to the board for the upgrade. We want to switch to upgrading by reading the firmware from the SD card instead, but we couldn’t find the upgrade code—we only found the u-boot code as follows:

  1. By executing the devtool modify u-boot command, we download the u-boot code, which is located in build/workspace/sources/u-boot.

However, the upgrade is not performed in u-boot. May I ask, after pressing the Update button and powering on, where can we find the code that is executed? We want to modify that section so that instead of fastboot transfer, it reads the firmware from the SD card. When the board boots up and detects a firmware image in the SD card, it should read the firmware from the SD card and upgrade the eMMC.

Question:
Please tell us where we can find the source code for the firmware upgrade. We would like to implement boot-time detection of whether there is a Yocto firmware image in the SD card, and if there is, read the firmware and upgrade the board’s eMMC accordingly—thus achieving Yocto OTA upgrades.

This kind of OTA function is not supported by MTK IOT Yocto, and it needs to be implemented by the customer/developer.

  1. You can check for a specific file on the SD card in u-boot.

  2. Flashtool is used to program the eMMC on the board. The flashing process only exists when using Flashtool to enter the programming mode.

  3. The procedure is in the Download Agent (LK).
    However, all the programs in there are protected by NDA and cannot be copied into u-boot (which is GPL code).

  4. Also, the code in LK is not executed during the normal boot process.

  5. In other words, you can only refer to that code, but you cannot use it directly. For OTA code, we recommend that you refer to the capsule update related code in u-boot.

Thank you for your guidance. I used the “devtool modify lk” command to download the LK code, and I can confirm that the firmware upgrade code is indeed in LK.