Merge tag 'efi-2025-07-rc1-3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2025-07-rc1-3 Documentation: * add documentation for the DeepComputing FML13V01 * fix typos UEFI: * build with HII configuration protocol * print image load address in StartImage Boards: * qemu-riscv raise CONFIG_NR_DRAM_BANKS * add support for the DeepComputing FML13V01 board via starfive_visionfive2_defconfig * add UNIT_TESTS to big-endian Malta boards
This commit is contained in:
7
arch/riscv/dts/jh7110-deepcomputing-fml13v01-u-boot.dtsi
Normal file
7
arch/riscv/dts/jh7110-deepcomputing-fml13v01-u-boot.dtsi
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-2.0 OR MIT
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2024 StarFive Technology Co., Ltd.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "jh7110-common-u-boot.dtsi"
|
||||||
|
#include "starfive-visionfive2-binman.dtsi"
|
@@ -125,7 +125,10 @@ int board_fit_config_name_match(const char *name)
|
|||||||
if (strncmp(name, "starfive/", 9))
|
if (strncmp(name, "starfive/", 9))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
name += 9;
|
name += 9;
|
||||||
if (!strncmp(product_id, "VF7110", 6)) {
|
if (!strncmp(product_id, "FML13V01", 8) &&
|
||||||
|
!strcmp(name, "jh7110-deepcomputing-fml13v01")) {
|
||||||
|
return 0;
|
||||||
|
} else if (!strncmp(product_id, "VF7110", 6)) {
|
||||||
version = get_pcb_revision_from_eeprom();
|
version = get_pcb_revision_from_eeprom();
|
||||||
if ((version == 'b' || version == 'B') &&
|
if ((version == 'b' || version == 'B') &&
|
||||||
!strcmp(name, "jh7110-starfive-visionfive-2-v1.3b"))
|
!strcmp(name, "jh7110-starfive-visionfive-2-v1.3b"))
|
||||||
|
@@ -17,6 +17,8 @@
|
|||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
#define JH7110_L2_PREFETCHER_BASE_ADDR 0x2030000
|
#define JH7110_L2_PREFETCHER_BASE_ADDR 0x2030000
|
||||||
#define JH7110_L2_PREFETCHER_HART_OFFSET 0x2000
|
#define JH7110_L2_PREFETCHER_HART_OFFSET 0x2000
|
||||||
|
#define FDTFILE_FML13V01 \
|
||||||
|
"starfive/jh7110-deepcomputing-fml13v01.dtb"
|
||||||
#define FDTFILE_MILK_V_MARS \
|
#define FDTFILE_MILK_V_MARS \
|
||||||
"starfive/jh7110-milkv-mars.dtb"
|
"starfive/jh7110-milkv-mars.dtb"
|
||||||
#define FDTFILE_VISIONFIVE2_1_2A \
|
#define FDTFILE_VISIONFIVE2_1_2A \
|
||||||
@@ -63,7 +65,9 @@ static void set_fdtfile(void)
|
|||||||
log_err("Can't read EEPROM\n");
|
log_err("Can't read EEPROM\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!strncmp(product_id, "MARS", 4)) {
|
if (!strncmp(product_id, "FML13V01", 8)) {
|
||||||
|
fdtfile = FDTFILE_FML13V01;
|
||||||
|
} else if (!strncmp(product_id, "MARS", 4)) {
|
||||||
fdtfile = FDTFILE_MILK_V_MARS;
|
fdtfile = FDTFILE_MILK_V_MARS;
|
||||||
} else if (!strncmp(product_id, "VF7110", 6)) {
|
} else if (!strncmp(product_id, "VF7110", 6)) {
|
||||||
version = get_pcb_revision_from_eeprom();
|
version = get_pcb_revision_from_eeprom();
|
||||||
|
@@ -46,3 +46,4 @@ CONFIG_PCI_MSC01=y
|
|||||||
CONFIG_RTC_MC146818=y
|
CONFIG_RTC_MC146818=y
|
||||||
CONFIG_SYS_NS16550=y
|
CONFIG_SYS_NS16550=y
|
||||||
CONFIG_SYS_NS16550_PORT_MAPPED=y
|
CONFIG_SYS_NS16550_PORT_MAPPED=y
|
||||||
|
CONFIG_UNIT_TEST=y
|
||||||
|
@@ -45,3 +45,4 @@ CONFIG_PCI_MSC01=y
|
|||||||
CONFIG_RTC_MC146818=y
|
CONFIG_RTC_MC146818=y
|
||||||
CONFIG_SYS_NS16550=y
|
CONFIG_SYS_NS16550=y
|
||||||
CONFIG_SYS_NS16550_PORT_MAPPED=y
|
CONFIG_SYS_NS16550_PORT_MAPPED=y
|
||||||
|
CONFIG_UNIT_TEST=y
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
CONFIG_RISCV=y
|
CONFIG_RISCV=y
|
||||||
CONFIG_SYS_MALLOC_LEN=0x800000
|
CONFIG_SYS_MALLOC_LEN=0x800000
|
||||||
CONFIG_NR_DRAM_BANKS=1
|
|
||||||
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
|
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
|
||||||
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80200000
|
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80200000
|
||||||
CONFIG_ENV_SIZE=0x20000
|
CONFIG_ENV_SIZE=0x20000
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
CONFIG_RISCV=y
|
CONFIG_RISCV=y
|
||||||
CONFIG_SYS_MALLOC_LEN=0x800000
|
CONFIG_SYS_MALLOC_LEN=0x800000
|
||||||
CONFIG_NR_DRAM_BANKS=1
|
|
||||||
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
|
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
|
||||||
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80200000
|
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80200000
|
||||||
CONFIG_ENV_SIZE=0x20000
|
CONFIG_ENV_SIZE=0x20000
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
CONFIG_RISCV=y
|
CONFIG_RISCV=y
|
||||||
CONFIG_SYS_MALLOC_LEN=0x800000
|
CONFIG_SYS_MALLOC_LEN=0x800000
|
||||||
CONFIG_NR_DRAM_BANKS=1
|
|
||||||
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
|
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
|
||||||
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80200000
|
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80200000
|
||||||
CONFIG_ENV_SIZE=0x20000
|
CONFIG_ENV_SIZE=0x20000
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
CONFIG_RISCV=y
|
CONFIG_RISCV=y
|
||||||
CONFIG_SYS_MALLOC_LEN=0x800000
|
CONFIG_SYS_MALLOC_LEN=0x800000
|
||||||
CONFIG_NR_DRAM_BANKS=1
|
|
||||||
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
|
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
|
||||||
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80200000
|
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80200000
|
||||||
CONFIG_ENV_SIZE=0x20000
|
CONFIG_ENV_SIZE=0x20000
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
CONFIG_RISCV=y
|
CONFIG_RISCV=y
|
||||||
CONFIG_SYS_MALLOC_LEN=0x800000
|
CONFIG_SYS_MALLOC_LEN=0x800000
|
||||||
CONFIG_NR_DRAM_BANKS=1
|
|
||||||
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
|
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
|
||||||
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80200000
|
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80200000
|
||||||
CONFIG_ENV_SIZE=0x20000
|
CONFIG_ENV_SIZE=0x20000
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
CONFIG_RISCV=y
|
CONFIG_RISCV=y
|
||||||
CONFIG_SYS_MALLOC_LEN=0x800000
|
CONFIG_SYS_MALLOC_LEN=0x800000
|
||||||
CONFIG_NR_DRAM_BANKS=1
|
|
||||||
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
|
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
|
||||||
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80200000
|
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80200000
|
||||||
CONFIG_ENV_SIZE=0x20000
|
CONFIG_ENV_SIZE=0x20000
|
||||||
|
@@ -80,7 +80,7 @@ CONFIG_CMD_WDT=y
|
|||||||
CONFIG_CMD_WGET=y
|
CONFIG_CMD_WGET=y
|
||||||
CONFIG_CMD_BOOTSTAGE=y
|
CONFIG_CMD_BOOTSTAGE=y
|
||||||
CONFIG_OF_BOARD=y
|
CONFIG_OF_BOARD=y
|
||||||
CONFIG_OF_LIST="starfive/jh7110-milkv-mars starfive/jh7110-pine64-star64 starfive/jh7110-starfive-visionfive-2-v1.2a starfive/jh7110-starfive-visionfive-2-v1.3b"
|
CONFIG_OF_LIST="starfive/jh7110-deepcomputing-fml13v01 starfive/jh7110-milkv-mars starfive/jh7110-pine64-star64 starfive/jh7110-starfive-visionfive-2-v1.2a starfive/jh7110-starfive-visionfive-2-v1.3b"
|
||||||
CONFIG_MULTI_DTB_FIT=y
|
CONFIG_MULTI_DTB_FIT=y
|
||||||
CONFIG_ENV_OVERWRITE=y
|
CONFIG_ENV_OVERWRITE=y
|
||||||
CONFIG_ENV_IS_IN_SPI_FLASH=y
|
CONFIG_ENV_IS_IN_SPI_FLASH=y
|
||||||
|
@@ -14,11 +14,11 @@ Notes
|
|||||||
-----
|
-----
|
||||||
|
|
||||||
1. U-Boot can run at any exception level it is entered in, it is
|
1. U-Boot can run at any exception level it is entered in, it is
|
||||||
recommened to enter it in EL3 if U-Boot takes some responsibilities of a
|
recommended to enter it in EL3 if U-Boot takes some responsibilities of a
|
||||||
classical firmware (like initial hardware setup, CPU errata workarounds
|
classical firmware (like initial hardware setup, CPU errata workarounds
|
||||||
or SMP bringup). U-Boot can be entered in EL2 when its main purpose is
|
or SMP bringup). U-Boot can be entered in EL2 when its main purpose is
|
||||||
that of a boot loader. It can drop to lower exception levels before
|
that of a boot loader. It can drop to lower exception levels before
|
||||||
entering the OS. For ARMv8-R it is recommened to enter at S-EL1, as for this
|
entering the OS. For ARMv8-R it is recommended to enter at S-EL1, as for this
|
||||||
architecture there is no S-EL3.
|
architecture there is no S-EL3.
|
||||||
|
|
||||||
2. U-Boot for arm64 is compiled with AArch64-gcc. AArch64-gcc
|
2. U-Boot for arm64 is compiled with AArch64-gcc. AArch64-gcc
|
||||||
|
80
doc/board/starfive/deepcomputing_fml13v01.rst
Normal file
80
doc/board/starfive/deepcomputing_fml13v01.rst
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
.. SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
DeepComputing Framework Motherboard (FLM13V01)
|
||||||
|
==============================================
|
||||||
|
|
||||||
|
The DeepComputing Framework motherboard (FLM13V01) can be combined with a
|
||||||
|
13 inch Framework laptop chassis to provide a complete laptop.
|
||||||
|
|
||||||
|
U-Boot for the board uses the same binaries as the VisionFive 2 board.
|
||||||
|
Currently only serial console output is supported by mainline U-Boot.
|
||||||
|
|
||||||
|
Building
|
||||||
|
--------
|
||||||
|
|
||||||
|
Setup the cross compilation environment variable:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
export CROSS_COMPILE=riscv64-linux-gnu-
|
||||||
|
|
||||||
|
The M-mode software OpenSBI provides the supervisor binary interface (SBI) and
|
||||||
|
is responsible for the switch to S-Mode. It is a prerequisite for building
|
||||||
|
U-Boot. Support for the JH7110 was introduced in OpenSBI 1.2. It is recommended
|
||||||
|
to use a current release.
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
git clone https://github.com/riscv/opensbi.git
|
||||||
|
cd opensbi
|
||||||
|
make PLATFORM=generic FW_TEXT_START=0x40000000 FW_OPTIONS=0
|
||||||
|
export OPENSBI="$(pwd)/build/platform/generic/firmware/fw_dynamic.bin"
|
||||||
|
|
||||||
|
Now build U-Boot SPL and main U-Boot.
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
cd <U-Boot-dir>
|
||||||
|
make starfive_visionfive2_defconfig
|
||||||
|
make
|
||||||
|
|
||||||
|
This will generate the U-Boot SPL image (spl/u-boot-spl.bin.normal.out) as well
|
||||||
|
as the FIT image (u-boot.itb) with OpenSBI, U-Boot, and device-trees.
|
||||||
|
|
||||||
|
Device-tree selection
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
The product ID stored in the board EEPROM is used by U-Boot SPL to select the
|
||||||
|
right configuration and device-tree from the u-boot.itb FIT image.
|
||||||
|
|
||||||
|
Furthermore if variable $fdtfile has not been saved in the environment it is
|
||||||
|
set based on the product ID to *starfive/jh7110-deepcomputing-fml13v01.dtb*.
|
||||||
|
|
||||||
|
To overrule this default the variable can be set manually and saved in the
|
||||||
|
environment
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
setenv fdtfile my_device-tree.dtb
|
||||||
|
env save
|
||||||
|
|
||||||
|
Power switch
|
||||||
|
------------
|
||||||
|
|
||||||
|
A tiny power switch is located in right upper corner of the board.
|
||||||
|
|
||||||
|
Open case detection
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
The board has an open case detection switch. Red lights will flash and the
|
||||||
|
board will not boot if the switch is not held down.
|
||||||
|
|
||||||
|
UART
|
||||||
|
----
|
||||||
|
|
||||||
|
UART 0 is exposed via the side channel contacts SBU1 and SBU2 of the lower,
|
||||||
|
right USB C connector. A USB C cable and a breakout board are needed for
|
||||||
|
physical access. It depends on the cable orientation on which of SBU1 and SBU2
|
||||||
|
you will find RX and TX. The signal voltage is 3.3 V. The baud rate is 115200.
|
||||||
|
|
||||||
|
.. include:: jh7110_common.rst
|
@@ -6,6 +6,7 @@ StarFive
|
|||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
|
|
||||||
|
deepcomputing_fml13v01
|
||||||
milk-v_mars
|
milk-v_mars
|
||||||
pine64_star64
|
pine64_star64
|
||||||
visionfive2
|
visionfive2
|
||||||
|
103
doc/board/starfive/jh7110_common.rst
Normal file
103
doc/board/starfive/jh7110_common.rst
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
.. SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
Boot source selection
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
The board provides DIP switches to select the device for loading the boot
|
||||||
|
firmware.
|
||||||
|
|
||||||
|
=========== === ===
|
||||||
|
Boot source SW1 SW2
|
||||||
|
=========== === ===
|
||||||
|
UART OFF OFF
|
||||||
|
SD-card ON OFF
|
||||||
|
eMMC OFF ON
|
||||||
|
SPI flash ON ON
|
||||||
|
=========== === ===
|
||||||
|
|
||||||
|
Flashing a new U-Boot version
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
U-Boot SPL is provided as file spl/u-boot-spl.bin.normal.out. Main U-Boot is
|
||||||
|
in file u-boot.itb.
|
||||||
|
|
||||||
|
Assuming your new U-Boot version is on partition 1 of an SD-card you could
|
||||||
|
install it to the SPI flash with:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
sf probe
|
||||||
|
load mmc 1:1 $kernel_addr_r u-boot-spl.bin.normal.out
|
||||||
|
sf update $kernel_addr_r 0 $filesize
|
||||||
|
load mmc 1:1 $kernel_addr_r u-boot.itb
|
||||||
|
sf update $kernel_addr_r 0x100000 $filesize
|
||||||
|
|
||||||
|
For loading the files from a TFTP server refer to the dhcp and tftpboot
|
||||||
|
commands.
|
||||||
|
|
||||||
|
After updating U-Boot you may want to erase a saved environment and reboot.
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
env erase
|
||||||
|
reset
|
||||||
|
|
||||||
|
Booting from SD-Card
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
The device boot ROM loads U-Boot SPL (u-boot-spl.bin.normal.out) from the
|
||||||
|
partition with type GUID 2E54B353-1271-4842-806F-E436D6AF6985. You are free
|
||||||
|
to choose any partition number.
|
||||||
|
|
||||||
|
With the default configuration U-Boot SPL loads the U-Boot FIT image
|
||||||
|
(u-boot.itb) from partition 2 (CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=0x2).
|
||||||
|
When formatting it is recommended to use GUID
|
||||||
|
BC13C2FF-59E6-4262-A352-B275FD6F7172 for this partition.
|
||||||
|
|
||||||
|
Booting from eMMC
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
The device boot ROM tries to load U-Boot SPL (u-boot-spl.bin.normal.out) from
|
||||||
|
sector 0 of the eMMC's main hardware partition. But this conflicts with GPT
|
||||||
|
partitioning. Fortunately eMMC can alternatively load U-Boot SPL from a backup
|
||||||
|
position.
|
||||||
|
|
||||||
|
For U-Boot SPL (u-boot-spl.bin.normal.out) starting at sector 2048 (position
|
||||||
|
0x100000) write the following bytes to the eMMC device after GPT partitioning:
|
||||||
|
|
||||||
|
======= ========================
|
||||||
|
Address Bytes
|
||||||
|
======= ========================
|
||||||
|
0x0000 40 02 00 00 00 00 10 00
|
||||||
|
0x0290 40 02 00 00 00 00 10 00
|
||||||
|
======= ========================
|
||||||
|
|
||||||
|
With the default configuration U-Boot SPL loads the U-Boot FIT image
|
||||||
|
(u-boot.itb) from partition 2 (CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=0x2).
|
||||||
|
When formatting it is recommended to use GUID
|
||||||
|
BC13C2FF-59E6-4262-A352-B275FD6F7172 for this partition.
|
||||||
|
|
||||||
|
Booting from UART
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
The boot ROM supports the X-modem protocol to upload
|
||||||
|
spl/u-boot-spl.bin.normal.out. U-Boot SPL support loading the FIT image
|
||||||
|
u-boot.itb via the Y-modem protocol.
|
||||||
|
|
||||||
|
Due to restrictions of the boot ROM not all X-modem implementations are
|
||||||
|
compatible. The package tio (https://github.com/tio/tio) has been found to be
|
||||||
|
usable.
|
||||||
|
|
||||||
|
Debug UART
|
||||||
|
----------
|
||||||
|
|
||||||
|
By default the SBI interface is used for the debug UART. But this only works
|
||||||
|
in main U-Boot. To enable the debug UART in SPL, too, use the following
|
||||||
|
settings::
|
||||||
|
|
||||||
|
CONFIG_DEBUG_UART=y
|
||||||
|
CONFIG_DEBUG_UART_NS16550=y
|
||||||
|
CONFIG_DEBUG_UART_BASE=0x10000000
|
||||||
|
CONFIG_SPL_DEBUG_UART_BASE=0x10000000
|
||||||
|
CONFIG_DEBUG_UART_CLOCK=24000000
|
||||||
|
CONFIG_DEBUG_UART_SHIFT=2
|
@@ -8,7 +8,7 @@ board. In U-Boot SPL the actual board is detected and the device-tree patched
|
|||||||
accordingly.
|
accordingly.
|
||||||
|
|
||||||
Building
|
Building
|
||||||
~~~~~~~~
|
--------
|
||||||
|
|
||||||
1. Add the RISC-V toolchain to your PATH.
|
1. Add the RISC-V toolchain to your PATH.
|
||||||
2. Setup ARCH & cross compilation environment variable:
|
2. Setup ARCH & cross compilation environment variable:
|
||||||
@@ -40,7 +40,7 @@ This will generate the U-Boot SPL image (spl/u-boot-spl.bin.normal.out) as well
|
|||||||
as the FIT image (u-boot.itb) with OpenSBI and U-Boot.
|
as the FIT image (u-boot.itb) with OpenSBI and U-Boot.
|
||||||
|
|
||||||
Device-tree selection
|
Device-tree selection
|
||||||
~~~~~~~~~~~~~~~~~~~~~
|
---------------------
|
||||||
|
|
||||||
Depending on the board version U-Boot set variable $fdtfile to either
|
Depending on the board version U-Boot set variable $fdtfile to either
|
||||||
starfive/jh7110-starfive-visionfive-2-v1.2a.dtb or
|
starfive/jh7110-starfive-visionfive-2-v1.2a.dtb or
|
||||||
@@ -57,15 +57,8 @@ environment
|
|||||||
or the configuration variable CONFIG_DEFAULT_FDT_FILE can be used to set to
|
or the configuration variable CONFIG_DEFAULT_FDT_FILE can be used to set to
|
||||||
provide a default value.
|
provide a default value.
|
||||||
|
|
||||||
Boot source selection
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
The board provides the DIP switches MSEL[1:0] to select the boot device out of
|
|
||||||
SPI flash, eMMC, SD-card, UART. To select booting from SD-card set the DIP
|
|
||||||
switches MSEL[1:0] to 10.
|
|
||||||
|
|
||||||
Preparing the SD-Card
|
Preparing the SD-Card
|
||||||
~~~~~~~~~~~~~~~~~~~~~
|
---------------------
|
||||||
|
|
||||||
The device firmware loads U-Boot SPL (u-boot-spl.bin.normal.out) from the
|
The device firmware loads U-Boot SPL (u-boot-spl.bin.normal.out) from the
|
||||||
partition with type GUID 2E54B353-1271-4842-806F-E436D6AF6985. You are free
|
partition with type GUID 2E54B353-1271-4842-806F-E436D6AF6985. You are free
|
||||||
@@ -105,7 +98,4 @@ Copy U-Boot to the SD card
|
|||||||
sudo cp jh7110-starfive-visionfive-2.dtb /mnt/
|
sudo cp jh7110-starfive-visionfive-2.dtb /mnt/
|
||||||
sudo umount /mnt
|
sudo umount /mnt
|
||||||
|
|
||||||
Booting
|
.. include:: jh7110_common.rst
|
||||||
~~~~~~~
|
|
||||||
|
|
||||||
Once you plugin the sdcard and power up, you should see the U-Boot prompt.
|
|
||||||
|
@@ -8,7 +8,7 @@ In U-Boot SPL the actual board is detected and the device-tree patched
|
|||||||
accordingly.
|
accordingly.
|
||||||
|
|
||||||
Building
|
Building
|
||||||
~~~~~~~~
|
--------
|
||||||
|
|
||||||
1. Add the RISC-V toolchain to your PATH.
|
1. Add the RISC-V toolchain to your PATH.
|
||||||
2. Setup ARCH & cross compilation environment variable:
|
2. Setup ARCH & cross compilation environment variable:
|
||||||
@@ -40,7 +40,7 @@ This will generate the U-Boot SPL image (spl/u-boot-spl.bin.normal.out) as well
|
|||||||
as the FIT image (u-boot.itb) with OpenSBI and U-Boot.
|
as the FIT image (u-boot.itb) with OpenSBI and U-Boot.
|
||||||
|
|
||||||
Device-tree selection
|
Device-tree selection
|
||||||
~~~~~~~~~~~~~~~~~~~~~
|
---------------------
|
||||||
|
|
||||||
U-Boot will set variable $fdtfile to starfive/jh7110-pine64-star64.dtb.
|
U-Boot will set variable $fdtfile to starfive/jh7110-pine64-star64.dtb.
|
||||||
|
|
||||||
@@ -55,21 +55,8 @@ environment
|
|||||||
or the configuration variable CONFIG_DEFAULT_FDT_FILE can be used to set to
|
or the configuration variable CONFIG_DEFAULT_FDT_FILE can be used to set to
|
||||||
provide a default value.
|
provide a default value.
|
||||||
|
|
||||||
Boot source selection
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
Boot mode is selected by an MSEL-DIP marked S1804 and GPIO_0 position adjacent
|
|
||||||
to the 40pin GPIO header. ON/ONKE and number markings of the MSEL-DIP are
|
|
||||||
misleading; Instead refer to the ``L`` (0) and ``H`` (1) silkscreen for
|
|
||||||
accurate selection.
|
|
||||||
|
|
||||||
+ (QSPI) Flash: 00
|
|
||||||
+ SD: 01
|
|
||||||
+ EMMC: 10
|
|
||||||
+ UART: 11
|
|
||||||
|
|
||||||
Preparing the SD-Card
|
Preparing the SD-Card
|
||||||
~~~~~~~~~~~~~~~~~~~~~
|
---------------------
|
||||||
|
|
||||||
The device firmware loads U-Boot SPL (u-boot-spl.bin.normal.out) from the
|
The device firmware loads U-Boot SPL (u-boot-spl.bin.normal.out) from the
|
||||||
partition with type GUID 2E54B353-1271-4842-806F-E436D6AF6985. You are free
|
partition with type GUID 2E54B353-1271-4842-806F-E436D6AF6985. You are free
|
||||||
@@ -109,13 +96,10 @@ Copy U-Boot to the SD card
|
|||||||
sudo cp jh7110-starfive-visionfive-2.dtb /mnt/
|
sudo cp jh7110-starfive-visionfive-2.dtb /mnt/
|
||||||
sudo umount /mnt
|
sudo umount /mnt
|
||||||
|
|
||||||
Booting
|
.. include:: jh7110_common.rst
|
||||||
~~~~~~~
|
|
||||||
|
|
||||||
Once you plugin the sdcard and power up, you should see the U-Boot prompt.
|
|
||||||
|
|
||||||
Serial Number and MAC address issues
|
Serial Number and MAC address issues
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
------------------------------------
|
||||||
|
|
||||||
U-Boot requires valid EEPROM data to determine which board-specific fix-up to
|
U-Boot requires valid EEPROM data to determine which board-specific fix-up to
|
||||||
apply at runtime. This affects the size of memory initialized, network mac
|
apply at runtime. This affects the size of memory initialized, network mac
|
||||||
|
@@ -36,7 +36,7 @@ Currently, the u-boot.itb is used as a dynamic of the OpenSBI FW_DYNAMIC
|
|||||||
firmware with the latest.
|
firmware with the latest.
|
||||||
|
|
||||||
Building
|
Building
|
||||||
~~~~~~~~
|
--------
|
||||||
|
|
||||||
1. Add the RISC-V toolchain to your PATH.
|
1. Add the RISC-V toolchain to your PATH.
|
||||||
2. Setup ARCH & cross compilation environment variable:
|
2. Setup ARCH & cross compilation environment variable:
|
||||||
@@ -72,7 +72,7 @@ This will generate the U-Boot SPL image (spl/u-boot-spl.bin.normal.out) as well
|
|||||||
as the FIT image (u-boot.itb) with OpenSBI and U-Boot.
|
as the FIT image (u-boot.itb) with OpenSBI and U-Boot.
|
||||||
|
|
||||||
Device-tree selection
|
Device-tree selection
|
||||||
~~~~~~~~~~~~~~~~~~~~~
|
---------------------
|
||||||
|
|
||||||
Depending on the board version U-Boot set variable $fdtfile to either
|
Depending on the board version U-Boot set variable $fdtfile to either
|
||||||
starfive/jh7110-starfive-visionfive-2-v1.2a.dtb or
|
starfive/jh7110-starfive-visionfive-2-v1.2a.dtb or
|
||||||
@@ -90,7 +90,7 @@ or the configuration variable CONFIG_DEFAULT_FDT_FILE can be used to provide
|
|||||||
a default value.
|
a default value.
|
||||||
|
|
||||||
Flashing
|
Flashing
|
||||||
~~~~~~~~
|
--------
|
||||||
|
|
||||||
The device firmware loads U-Boot SPL (u-boot-spl.bin.normal.out) from the
|
The device firmware loads U-Boot SPL (u-boot-spl.bin.normal.out) from the
|
||||||
partition with type GUID 2E54B353-1271-4842-806F-E436D6AF6985. You are free
|
partition with type GUID 2E54B353-1271-4842-806F-E436D6AF6985. You are free
|
||||||
@@ -132,16 +132,10 @@ Program the SD card
|
|||||||
sudo cp jh7110-starfive-visionfive-2.dtb /mnt/
|
sudo cp jh7110-starfive-visionfive-2.dtb /mnt/
|
||||||
sudo umount /mnt
|
sudo umount /mnt
|
||||||
|
|
||||||
Booting
|
.. include:: jh7110_common.rst
|
||||||
~~~~~~~
|
|
||||||
|
|
||||||
The board provides the DIP switches MSEL[1:0] to select the boot device.
|
|
||||||
To select booting from SD-card set the DIP switches MSEL[1:0] to 10.
|
|
||||||
|
|
||||||
Once you plugin the sdcard and power up, you should see the U-Boot prompt.
|
|
||||||
|
|
||||||
Sample boot log from StarFive VisionFive2 board
|
Sample boot log from StarFive VisionFive2 board
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
-----------------------------------------------
|
||||||
|
|
||||||
.. code-block:: none
|
.. code-block:: none
|
||||||
|
|
||||||
@@ -479,34 +473,3 @@ Sample boot log from StarFive VisionFive2 board
|
|||||||
|
|
||||||
Welcome to Buildroot
|
Welcome to Buildroot
|
||||||
buildroot login:
|
buildroot login:
|
||||||
|
|
||||||
Booting from SPI
|
|
||||||
----------------
|
|
||||||
|
|
||||||
Use Building steps from "Booting from MMC using U-Boot SPL" section.
|
|
||||||
|
|
||||||
Partition the SPI in Linux via mtdblock. (Require to boot the board in
|
|
||||||
SD boot mode by enabling MTD block in Linux)
|
|
||||||
|
|
||||||
Use prebuilt image from here [1], which support to partition the SPI flash.
|
|
||||||
|
|
||||||
|
|
||||||
Program the SPI (Require to boot the board in SD boot mode)
|
|
||||||
|
|
||||||
Execute below steps on U-Boot proper,
|
|
||||||
|
|
||||||
.. code-block:: none
|
|
||||||
|
|
||||||
sf probe
|
|
||||||
fatload mmc 1:3 $kernel_addr_r u-boot.itb
|
|
||||||
sf update $kernel_addr_r 0x100000 $filesize
|
|
||||||
|
|
||||||
fatload mmc 1:3 $kernel_addr_r u-boot-spl.bin.normal.out
|
|
||||||
sf update $kernel_addr_r 0x0 $filesize
|
|
||||||
|
|
||||||
|
|
||||||
Power off the board
|
|
||||||
|
|
||||||
Change DIP switches MSEL[1:0] are set to 00, select the boot mode to flash
|
|
||||||
|
|
||||||
Power up the board.
|
|
||||||
|
@@ -39,7 +39,7 @@ network. Getting the image to the target is easy enough:
|
|||||||
|
|
||||||
dhcp ${ramdisk_addr_r} rootfs.ext4
|
dhcp ${ramdisk_addr_r} rootfs.ext4
|
||||||
|
|
||||||
But now we are faced with a predicament: how to we extract the kernel
|
But now we are faced with a predicament: how do we extract the kernel
|
||||||
image? Block maps to the rescue!
|
image? Block maps to the rescue!
|
||||||
|
|
||||||
We start by creating a new device:
|
We start by creating a new device:
|
||||||
|
@@ -21,7 +21,7 @@ format that includes the address, hex data and ASCII display. It supports
|
|||||||
various data sizes and uses the endianness of the target.
|
various data sizes and uses the endianness of the target.
|
||||||
|
|
||||||
The specified data_size and length become the defaults for future memory
|
The specified data_size and length become the defaults for future memory
|
||||||
commands commands.
|
commands.
|
||||||
|
|
||||||
address
|
address
|
||||||
start address to display
|
start address to display
|
||||||
|
@@ -50,7 +50,7 @@ The 'part list' command prints or sets an environment variable to the list of pa
|
|||||||
varname
|
varname
|
||||||
an optional environment variable to store the list of partitions value into.
|
an optional environment variable to store the list of partitions value into.
|
||||||
|
|
||||||
The 'part start' commnad sets an environment variable to the start of the partition (in blocks),
|
The 'part start' command sets an environment variable to the start of the partition (in blocks),
|
||||||
part can be either partition number or partition name.
|
part can be either partition number or partition name.
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
@@ -37,7 +37,7 @@ obj-$(CONFIG_EFI_DEVICE_PATH_UTIL) += efi_device_path_utilities.o
|
|||||||
obj-y += efi_dt_fixup.o
|
obj-y += efi_dt_fixup.o
|
||||||
obj-y += efi_fdt.o
|
obj-y += efi_fdt.o
|
||||||
obj-y += efi_file.o
|
obj-y += efi_file.o
|
||||||
obj-$(CONFIG_EFI_LOADER_HII) += efi_hii.o
|
obj-$(CONFIG_EFI_LOADER_HII) += efi_hii.o efi_hii_config.o
|
||||||
obj-y += efi_image_loader.o
|
obj-y += efi_image_loader.o
|
||||||
obj-y += efi_load_options.o
|
obj-y += efi_load_options.o
|
||||||
obj-y += efi_memory.o
|
obj-y += efi_memory.o
|
||||||
|
@@ -3195,7 +3195,7 @@ efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
|
|||||||
struct efi_loaded_image_obj *image_obj =
|
struct efi_loaded_image_obj *image_obj =
|
||||||
(struct efi_loaded_image_obj *)image_handle;
|
(struct efi_loaded_image_obj *)image_handle;
|
||||||
efi_status_t ret;
|
efi_status_t ret;
|
||||||
void *info;
|
struct efi_loaded_image *info;
|
||||||
efi_handle_t parent_image = current_image;
|
efi_handle_t parent_image = current_image;
|
||||||
efi_status_t exit_status;
|
efi_status_t exit_status;
|
||||||
jmp_buf exit_jmp;
|
jmp_buf exit_jmp;
|
||||||
@@ -3213,7 +3213,7 @@ efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
|
|||||||
return EFI_EXIT(EFI_SECURITY_VIOLATION);
|
return EFI_EXIT(EFI_SECURITY_VIOLATION);
|
||||||
|
|
||||||
ret = EFI_CALL(efi_open_protocol(image_handle, &efi_guid_loaded_image,
|
ret = EFI_CALL(efi_open_protocol(image_handle, &efi_guid_loaded_image,
|
||||||
&info, NULL, NULL,
|
(void **)&info, NULL, NULL,
|
||||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL));
|
EFI_OPEN_PROTOCOL_GET_PROTOCOL));
|
||||||
if (ret != EFI_SUCCESS)
|
if (ret != EFI_SUCCESS)
|
||||||
return EFI_EXIT(EFI_INVALID_PARAMETER);
|
return EFI_EXIT(EFI_INVALID_PARAMETER);
|
||||||
@@ -3266,7 +3266,8 @@ efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
|
|||||||
|
|
||||||
current_image = image_handle;
|
current_image = image_handle;
|
||||||
image_obj->header.type = EFI_OBJECT_TYPE_STARTED_IMAGE;
|
image_obj->header.type = EFI_OBJECT_TYPE_STARTED_IMAGE;
|
||||||
EFI_PRINT("Jumping into 0x%p\n", image_obj->entry);
|
EFI_PRINT("Starting image loaded at 0x%p, entry point 0x%p\n",
|
||||||
|
info->image_base, image_obj->entry);
|
||||||
ret = EFI_CALL(image_obj->entry(image_handle, &systab));
|
ret = EFI_CALL(image_obj->entry(image_handle, &systab));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -4,10 +4,6 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 2017 Leif Lindholm
|
* Copyright (c) 2017 Leif Lindholm
|
||||||
* Copyright (c) 2018 AKASHI Takahiro, Linaro Limited
|
* Copyright (c) 2018 AKASHI Takahiro, Linaro Limited
|
||||||
*
|
|
||||||
* As this is still a non-working stub and the protocol is neither required
|
|
||||||
* by the EFI shell nor by the UEFI SCT this module has been removed from
|
|
||||||
* the Makefile.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define LOG_CATEGORY LOGC_EFI
|
#define LOG_CATEGORY LOGC_EFI
|
||||||
|
@@ -80,6 +80,9 @@ efi_status_t efi_root_node_register(void)
|
|||||||
/* HII database protocol */
|
/* HII database protocol */
|
||||||
&efi_guid_hii_database_protocol,
|
&efi_guid_hii_database_protocol,
|
||||||
&efi_hii_database,
|
&efi_hii_database,
|
||||||
|
/* EFI HII Configuration Routing Protocol */
|
||||||
|
&efi_guid_hii_config_routing_protocol,
|
||||||
|
&efi_hii_config_routing,
|
||||||
#endif
|
#endif
|
||||||
NULL);
|
NULL);
|
||||||
efi_root->type = EFI_OBJECT_TYPE_U_BOOT_FIRMWARE;
|
efi_root->type = EFI_OBJECT_TYPE_U_BOOT_FIRMWARE;
|
||||||
|
Reference in New Issue
Block a user