U-Boot Configuration

Configure Kernel Menu for U-Boot

Follow the steps below to enable the kernel menu configuration for U-Boot.
  1. Enter the root directory of the SDK: freelight-u-sdk.
  2. Run the following command to build the kernel menu configuration dialog.
    make uboot-menuconfig
  3. If you need to enable a function, navigate the menu and select your target option in correspondence with the function.
  4. Save your change before you exit the kernel configuration dialog.
  5. Run the make command to generate the bin file.
Note:
You can use menuconfig to view and edit any a macro definition in the deconfiguration file as described in Deconfigure Kernel Menu for U-Boot.
  1. Enter the kernel menu configuration dialog.
  2. Type “/” to enter the search screen.
  3. Input the keyword of the macro definition which you want to search.
  4. Edit the macro definition following your need.

Deconfigure Kernel Menu for U-Boot

Follow the steps below to enable the kernel menu deconfiguration for U-Boot.
  1. Use the following command to open the configuration file (with the ".configuration" extension).
    • For JH-7110 EVB:
      vim freelight-u-sdk/u-boot/configs/starfive_evb_defconfig
    • For VisionFive 2:
      vim freelight-u-sdk/u-boot/configs/starfive_visionfive_defconfig
  2. Locate your target macro definition item, and use the following approach to disable the function if needed.
    • To disable a function, simply add a "#" ahead of the corresponding macro definition, or change the "y" inline with a macro definition to "n".
    Note: You are not allowed to enable a function in the deconfiguation file. If you need to re-enable a disabled function, perform the operation using menuconfig as described in Configure Kernel Menu for U-Boot. The deconfiguration file will be updated once you have successfully enabled your target function.
    The following image shows an example of the configuration file.
    Note: The example is based on VisionFive 2. If you are working on the JH-7110 EVB, make sure you understand the macro definition you encounter can be different.
    Figure 1. Deconfiguration File

Update Startup Logo

You can change the VisionFive 2 startup logo that is stored in the following path: visionfive/u-boot/tools/logos/starfive.bmp.

  1. Replace the starfive.bmp with another logo image you want to display.
    Note: The logo file must be in bmp format.
  2. Rename the logo file to starfive.bmp.
    Note: The file size should not exceed 1500 KB.
  3. Perform the following steps to recompile the new image:
    1. Use cd command to back to your u-sdk directory.
      cd <X>/visionfive/
      where <X> is the path where you store the u-sdk repository on your local drive.
    2. Execute the following command to clean the old image.
      make clean
    3. Execute the following command to recompile the new image.
      make -j8
      The new images, visionfive2_fw_payload.img and u-boot-sp1.bin.normal.out are generated under work directory.
      Note: The logo is center display by default, if you want to change the logo display position, you need to change the code.
  4. To update the SPL and U-Boot, perform the following steps:
    1. Prepare the TFTP server. The following is an example command for Ubuntu distribution.
      sudo apt install tftpd-hpa
    2. Power on VisionFive 2 and wait until it enters the U-Boot command line interface.
    3. Configure the environment variables by running the following command:
      setenv ipaddr 192.168.120.222;setenv serverip 192.168.120.99
    4. Check the connectivity by pinging the host PC from VisionFive 2.
    5. Initialize SPI flash:
      sf probe
    6. Update SPL binary:
      tftpboot ${loadaddr} u-boot-spl.bin.normal.out
      sf update ${loadaddr} 0x0 $filesize
    7. Update U-Boot binary:
      tftpboot ${loadaddr} visionfive2_fw_payload.img
      sf update ${loadaddr}s 0x100000 $filesize