All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/8] board: starfive: DeepComputing FML13V01
@ 2025-04-24 12:13 Heinrich Schuchardt
  2025-04-24 12:13 ` [PATCH v4 1/8] configs: add jh7110-deepcomputing-fml13v01 to VF2 defconfig Heinrich Schuchardt
                   ` (7 more replies)
  0 siblings, 8 replies; 19+ messages in thread
From: Heinrich Schuchardt @ 2025-04-24 12:13 UTC (permalink / raw)
  To: Rick Chen, Leo, Minda Chen, Hal Feng
  Cc: Tom Rini, E Shattow, Sumit Garg, H Bell, Lukas Funke,
	Matthias Brugger, E . Shattow, Patrice Chotard, Simon Glass,
	Andreas Schwab, u-boot, Heinrich Schuchardt

We use starfive_visionfive2_defconfig for supporting JH7110 based boards.

The DeepComputing Framework motherboard is a new JH7110 device with
upstream kernel support since v6.13.

Add support and documentation for the board.

v4:
	Correct the description of booting from eMMC on JH7110 boards.
v3:
	Rebase upon Milk-V Mars CM removal patch
v2:
	Rebase upon orgin/next
	Carve out common documentation of JH7110 boards
	Drop patch for binman config - not needed anymore
	Add information about the debug UART

Heinrich Schuchardt (8):
  configs: add jh7110-deepcomputing-fml13v01 to VF2 defconfig
  riscv: dts: jh7110: add DeepComputing FML13V01 device-tree
  board: starfive: DeepComputing FML13V01 fdt selection
  board: starfive: spl: support DeepComputing FML13V01
  doc: add DeepComputing FML13V01 documentation
  doc: starfive: use consistent formatting
  doc: starfive: use jh7110_common.rst
  doc: jh7110: describe debug UART

 .../jh7110-deepcomputing-fml13v01-u-boot.dtsi |   7 ++
 board/starfive/visionfive2/spl.c              |   5 +-
 .../visionfive2/starfive_visionfive2.c        |   6 +-
 configs/starfive_visionfive2_defconfig        |   2 +-
 doc/board/starfive/deepcomputing_fml13v01.rst |  80 ++++++++++++++
 doc/board/starfive/index.rst                  |   1 +
 doc/board/starfive/jh7110_common.rst          | 103 ++++++++++++++++++
 doc/board/starfive/milk-v_mars.rst            |  18 +--
 doc/board/starfive/pine64_star64.rst          |  26 +----
 doc/board/starfive/visionfive2.rst            |  47 +-------
 10 files changed, 215 insertions(+), 80 deletions(-)
 create mode 100644 arch/riscv/dts/jh7110-deepcomputing-fml13v01-u-boot.dtsi
 create mode 100644 doc/board/starfive/deepcomputing_fml13v01.rst
 create mode 100644 doc/board/starfive/jh7110_common.rst

-- 
2.48.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v4 1/8] configs: add jh7110-deepcomputing-fml13v01 to VF2 defconfig
  2025-04-24 12:13 [PATCH v4 0/8] board: starfive: DeepComputing FML13V01 Heinrich Schuchardt
@ 2025-04-24 12:13 ` Heinrich Schuchardt
  2025-04-24 14:50   ` E Shattow
  2025-04-24 12:13 ` [PATCH v4 2/8] riscv: dts: jh7110: add DeepComputing FML13V01 device-tree Heinrich Schuchardt
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 19+ messages in thread
From: Heinrich Schuchardt @ 2025-04-24 12:13 UTC (permalink / raw)
  To: Rick Chen, Leo, Minda Chen, Hal Feng
  Cc: Tom Rini, E Shattow, Sumit Garg, H Bell, Lukas Funke,
	Matthias Brugger, E . Shattow, Patrice Chotard, Simon Glass,
	Andreas Schwab, u-boot, Heinrich Schuchardt, Sumit Garg

The DeepComputing Framework motherboard is a JH7110 device support by the
upstream kernel. Add its device-tree to the list of device-trees to be
included into the starfive_visionfive_defconfig.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
v4:
	no change
v3:
	no change
v2:
	rebased
---
 configs/starfive_visionfive2_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configs/starfive_visionfive2_defconfig b/configs/starfive_visionfive2_defconfig
index 6a5b247c4b5..e145ced8db8 100644
--- a/configs/starfive_visionfive2_defconfig
+++ b/configs/starfive_visionfive2_defconfig
@@ -80,7 +80,7 @@ CONFIG_CMD_WDT=y
 CONFIG_CMD_WGET=y
 CONFIG_CMD_BOOTSTAGE=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_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v4 2/8] riscv: dts: jh7110: add DeepComputing FML13V01 device-tree
  2025-04-24 12:13 [PATCH v4 0/8] board: starfive: DeepComputing FML13V01 Heinrich Schuchardt
  2025-04-24 12:13 ` [PATCH v4 1/8] configs: add jh7110-deepcomputing-fml13v01 to VF2 defconfig Heinrich Schuchardt
@ 2025-04-24 12:13 ` Heinrich Schuchardt
  2025-04-24 15:05   ` E Shattow
  2025-04-24 12:13 ` [PATCH v4 3/8] board: starfive: DeepComputing FML13V01 fdt selection Heinrich Schuchardt
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 19+ messages in thread
From: Heinrich Schuchardt @ 2025-04-24 12:13 UTC (permalink / raw)
  To: Rick Chen, Leo, Minda Chen, Hal Feng
  Cc: Tom Rini, E Shattow, Sumit Garg, H Bell, Lukas Funke,
	Matthias Brugger, E . Shattow, Patrice Chotard, Simon Glass,
	Andreas Schwab, u-boot, Heinrich Schuchardt, Sumit Garg

Add the u-boot device-tree include needed to support the
DeepComputing Framework motherboard (FML13V01).

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
v4:
	no change
v3:
	no change
v2:
	no change
---
 arch/riscv/dts/jh7110-deepcomputing-fml13v01-u-boot.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 arch/riscv/dts/jh7110-deepcomputing-fml13v01-u-boot.dtsi

diff --git a/arch/riscv/dts/jh7110-deepcomputing-fml13v01-u-boot.dtsi b/arch/riscv/dts/jh7110-deepcomputing-fml13v01-u-boot.dtsi
new file mode 100644
index 00000000000..ab882d07f6f
--- /dev/null
+++ b/arch/riscv/dts/jh7110-deepcomputing-fml13v01-u-boot.dtsi
@@ -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"
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v4 3/8] board: starfive: DeepComputing FML13V01 fdt selection
  2025-04-24 12:13 [PATCH v4 0/8] board: starfive: DeepComputing FML13V01 Heinrich Schuchardt
  2025-04-24 12:13 ` [PATCH v4 1/8] configs: add jh7110-deepcomputing-fml13v01 to VF2 defconfig Heinrich Schuchardt
  2025-04-24 12:13 ` [PATCH v4 2/8] riscv: dts: jh7110: add DeepComputing FML13V01 device-tree Heinrich Schuchardt
@ 2025-04-24 12:13 ` Heinrich Schuchardt
  2025-04-24 15:25   ` E Shattow
  2025-04-24 12:13 ` [PATCH v4 4/8] board: starfive: spl: support DeepComputing FML13V01 Heinrich Schuchardt
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 19+ messages in thread
From: Heinrich Schuchardt @ 2025-04-24 12:13 UTC (permalink / raw)
  To: Rick Chen, Leo, Minda Chen, Hal Feng
  Cc: Tom Rini, E Shattow, Sumit Garg, H Bell, Lukas Funke,
	Matthias Brugger, E . Shattow, Patrice Chotard, Simon Glass,
	Andreas Schwab, u-boot, Heinrich Schuchardt

We support all JH7110 boards with starfive_visionfive2_defconfig.
The relevant device-tree is selected at runtime based on EEPROM data.

Support setting $fdtfile to the file name of the DeepComputing Framework
motherboard (FML13V01) device-tree.

Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
v4:
	no change
v3:
	rebased upon Mars CM removal patch
v2:
	no change
---
 board/starfive/visionfive2/starfive_visionfive2.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/board/starfive/visionfive2/starfive_visionfive2.c b/board/starfive/visionfive2/starfive_visionfive2.c
index b8cd509bc89..5fe888d4072 100644
--- a/board/starfive/visionfive2/starfive_visionfive2.c
+++ b/board/starfive/visionfive2/starfive_visionfive2.c
@@ -17,6 +17,8 @@
 DECLARE_GLOBAL_DATA_PTR;
 #define JH7110_L2_PREFETCHER_BASE_ADDR		0x2030000
 #define JH7110_L2_PREFETCHER_HART_OFFSET	0x2000
+#define FDTFILE_FML13V01 \
+	"starfive/jh7110-deepcomputing-fml13v01.dtb"
 #define FDTFILE_MILK_V_MARS \
 	"starfive/jh7110-milkv-mars.dtb"
 #define FDTFILE_VISIONFIVE2_1_2A \
@@ -63,7 +65,9 @@ static void set_fdtfile(void)
 		log_err("Can't read EEPROM\n");
 		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;
 	} else if (!strncmp(product_id, "VF7110", 6)) {
 		version = get_pcb_revision_from_eeprom();
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v4 4/8] board: starfive: spl: support DeepComputing FML13V01
  2025-04-24 12:13 [PATCH v4 0/8] board: starfive: DeepComputing FML13V01 Heinrich Schuchardt
                   ` (2 preceding siblings ...)
  2025-04-24 12:13 ` [PATCH v4 3/8] board: starfive: DeepComputing FML13V01 fdt selection Heinrich Schuchardt
@ 2025-04-24 12:13 ` Heinrich Schuchardt
  2025-04-24 15:29   ` E Shattow
  2025-04-24 12:13 ` [PATCH v4 5/8] doc: add DeepComputing FML13V01 documentation Heinrich Schuchardt
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 19+ messages in thread
From: Heinrich Schuchardt @ 2025-04-24 12:13 UTC (permalink / raw)
  To: Rick Chen, Leo, Minda Chen, Hal Feng
  Cc: Tom Rini, E Shattow, Sumit Garg, H Bell, Lukas Funke,
	Matthias Brugger, E . Shattow, Patrice Chotard, Simon Glass,
	Andreas Schwab, u-boot, Heinrich Schuchardt

On the DeepComputing Framework motherboard (FML13V01) choose the matching
FIT configuration.

Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
v4:
	no change
v3:
	no change
v2:
	rebased
---
 board/starfive/visionfive2/spl.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/board/starfive/visionfive2/spl.c b/board/starfive/visionfive2/spl.c
index 3e4d3e21988..9a3081ef06f 100644
--- a/board/starfive/visionfive2/spl.c
+++ b/board/starfive/visionfive2/spl.c
@@ -125,7 +125,10 @@ int board_fit_config_name_match(const char *name)
 	if (strncmp(name, "starfive/", 9))
 		return -EINVAL;
 	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();
 		if ((version == 'b' || version == 'B') &&
 		    !strcmp(name, "jh7110-starfive-visionfive-2-v1.3b"))
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v4 5/8] doc: add DeepComputing FML13V01 documentation
  2025-04-24 12:13 [PATCH v4 0/8] board: starfive: DeepComputing FML13V01 Heinrich Schuchardt
                   ` (3 preceding siblings ...)
  2025-04-24 12:13 ` [PATCH v4 4/8] board: starfive: spl: support DeepComputing FML13V01 Heinrich Schuchardt
@ 2025-04-24 12:13 ` Heinrich Schuchardt
  2025-04-24 20:26   ` E Shattow
  2025-04-24 12:13 ` [PATCH v4 6/8] doc: starfive: use consistent formatting Heinrich Schuchardt
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 19+ messages in thread
From: Heinrich Schuchardt @ 2025-04-24 12:13 UTC (permalink / raw)
  To: Rick Chen, Leo, Minda Chen, Hal Feng
  Cc: Tom Rini, E Shattow, Sumit Garg, H Bell, Lukas Funke,
	Matthias Brugger, E . Shattow, Patrice Chotard, Simon Glass,
	Andreas Schwab, u-boot, Heinrich Schuchardt

Describe building U-Boot for the board and booting.

Carve out common information for JH7110 boards into an include.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
v4:
	Correct the description of booting JH7110 boards from eMMC
v3:
	rebased
v2:
	carve out common information for JH7110 boards into an include
---
 doc/board/starfive/deepcomputing_fml13v01.rst | 80 +++++++++++++++++
 doc/board/starfive/index.rst                  |  1 +
 doc/board/starfive/jh7110_common.rst          | 89 +++++++++++++++++++
 3 files changed, 170 insertions(+)
 create mode 100644 doc/board/starfive/deepcomputing_fml13v01.rst
 create mode 100644 doc/board/starfive/jh7110_common.rst

diff --git a/doc/board/starfive/deepcomputing_fml13v01.rst b/doc/board/starfive/deepcomputing_fml13v01.rst
new file mode 100644
index 00000000000..5d9612483b4
--- /dev/null
+++ b/doc/board/starfive/deepcomputing_fml13v01.rst
@@ -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
diff --git a/doc/board/starfive/index.rst b/doc/board/starfive/index.rst
index 2cba1b6dc56..66abc6f9d98 100644
--- a/doc/board/starfive/index.rst
+++ b/doc/board/starfive/index.rst
@@ -6,6 +6,7 @@ StarFive
 .. toctree::
    :maxdepth: 1
 
+   deepcomputing_fml13v01
    milk-v_mars
    pine64_star64
    visionfive2
diff --git a/doc/board/starfive/jh7110_common.rst b/doc/board/starfive/jh7110_common.rst
new file mode 100644
index 00000000000..fb8d87a1551
--- /dev/null
+++ b/doc/board/starfive/jh7110_common.rst
@@ -0,0 +1,89 @@
+.. 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.
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v4 6/8] doc: starfive: use consistent formatting
  2025-04-24 12:13 [PATCH v4 0/8] board: starfive: DeepComputing FML13V01 Heinrich Schuchardt
                   ` (4 preceding siblings ...)
  2025-04-24 12:13 ` [PATCH v4 5/8] doc: add DeepComputing FML13V01 documentation Heinrich Schuchardt
@ 2025-04-24 12:13 ` Heinrich Schuchardt
  2025-04-24 20:29   ` E Shattow
  2025-04-24 12:13 ` [PATCH v4 7/8] doc: starfive: use jh7110_common.rst Heinrich Schuchardt
  2025-04-24 12:13 ` [PATCH v4 8/8] doc: jh7110: describe debug UART Heinrich Schuchardt
  7 siblings, 1 reply; 19+ messages in thread
From: Heinrich Schuchardt @ 2025-04-24 12:13 UTC (permalink / raw)
  To: Rick Chen, Leo, Minda Chen, Hal Feng
  Cc: Tom Rini, E Shattow, Sumit Garg, H Bell, Lukas Funke,
	Matthias Brugger, E . Shattow, Patrice Chotard, Simon Glass,
	Andreas Schwab, u-boot, Heinrich Schuchardt

Always use ---- for the H2 level.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
v4:
	no change
v3:
	rebased upong Milk-V Mars CM removal patch
v2:
	new patch
---
 doc/board/starfive/milk-v_mars.rst   | 10 +++++-----
 doc/board/starfive/pine64_star64.rst | 12 ++++++------
 doc/board/starfive/visionfive2.rst   | 10 +++++-----
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/doc/board/starfive/milk-v_mars.rst b/doc/board/starfive/milk-v_mars.rst
index 554932ecfd4..aba9c9c53d4 100644
--- a/doc/board/starfive/milk-v_mars.rst
+++ b/doc/board/starfive/milk-v_mars.rst
@@ -8,7 +8,7 @@ board. In U-Boot SPL the actual board is detected and the device-tree patched
 accordingly.
 
 Building
-~~~~~~~~
+--------
 
 1. Add the RISC-V toolchain to your PATH.
 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.
 
 Device-tree selection
-~~~~~~~~~~~~~~~~~~~~~
+---------------------
 
 Depending on the board version U-Boot set variable $fdtfile to either
 starfive/jh7110-starfive-visionfive-2-v1.2a.dtb or
@@ -58,14 +58,14 @@ or the configuration variable CONFIG_DEFAULT_FDT_FILE can be used to set to
 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
-~~~~~~~~~~~~~~~~~~~~~
+---------------------
 
 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
@@ -106,6 +106,6 @@ Copy U-Boot to the SD card
 	sudo umount /mnt
 
 Booting
-~~~~~~~
+-------
 
 Once you plugin the sdcard and power up, you should see the U-Boot prompt.
diff --git a/doc/board/starfive/pine64_star64.rst b/doc/board/starfive/pine64_star64.rst
index 52e9a907917..1df4b68e4a0 100644
--- a/doc/board/starfive/pine64_star64.rst
+++ b/doc/board/starfive/pine64_star64.rst
@@ -8,7 +8,7 @@ In U-Boot SPL the actual board is detected and the device-tree patched
 accordingly.
 
 Building
-~~~~~~~~
+--------
 
 1. Add the RISC-V toolchain to your PATH.
 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.
 
 Device-tree selection
-~~~~~~~~~~~~~~~~~~~~~
+---------------------
 
 U-Boot will set variable $fdtfile to starfive/jh7110-pine64-star64.dtb.
 
@@ -56,7 +56,7 @@ or the configuration variable CONFIG_DEFAULT_FDT_FILE can be used to set to
 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
@@ -69,7 +69,7 @@ accurate selection.
 + UART: 11
 
 Preparing the SD-Card
-~~~~~~~~~~~~~~~~~~~~~
+---------------------
 
 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
@@ -110,12 +110,12 @@ Copy U-Boot to the SD card
 	sudo umount /mnt
 
 Booting
-~~~~~~~
+-------
 
 Once you plugin the sdcard and power up, you should see the U-Boot prompt.
 
 Serial Number and MAC address issues
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+------------------------------------
 
 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
diff --git a/doc/board/starfive/visionfive2.rst b/doc/board/starfive/visionfive2.rst
index 2c68df3ce4d..44e7fcb3a48 100644
--- a/doc/board/starfive/visionfive2.rst
+++ b/doc/board/starfive/visionfive2.rst
@@ -36,7 +36,7 @@ Currently, the u-boot.itb is used as a dynamic of the OpenSBI FW_DYNAMIC
 firmware with the latest.
 
 Building
-~~~~~~~~
+--------
 
 1. Add the RISC-V toolchain to your PATH.
 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.
 
 Device-tree selection
-~~~~~~~~~~~~~~~~~~~~~
+---------------------
 
 Depending on the board version U-Boot set variable $fdtfile to either
 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.
 
 Flashing
-~~~~~~~~
+--------
 
 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
@@ -133,7 +133,7 @@ Program the SD card
 	sudo umount /mnt
 
 Booting
-~~~~~~~
+-------
 
 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.
@@ -141,7 +141,7 @@ 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
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+-----------------------------------------------
 
 .. code-block:: none
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v4 7/8] doc: starfive: use jh7110_common.rst
  2025-04-24 12:13 [PATCH v4 0/8] board: starfive: DeepComputing FML13V01 Heinrich Schuchardt
                   ` (5 preceding siblings ...)
  2025-04-24 12:13 ` [PATCH v4 6/8] doc: starfive: use consistent formatting Heinrich Schuchardt
@ 2025-04-24 12:13 ` Heinrich Schuchardt
  2025-04-24 20:33   ` E Shattow
  2025-04-24 12:13 ` [PATCH v4 8/8] doc: jh7110: describe debug UART Heinrich Schuchardt
  7 siblings, 1 reply; 19+ messages in thread
From: Heinrich Schuchardt @ 2025-04-24 12:13 UTC (permalink / raw)
  To: Rick Chen, Leo, Minda Chen, Hal Feng
  Cc: Tom Rini, E Shattow, Sumit Garg, H Bell, Lukas Funke,
	Matthias Brugger, E . Shattow, Patrice Chotard, Simon Glass,
	Andreas Schwab, u-boot, Heinrich Schuchardt

To avoid duplicate maintenance just include jh7110_common.rst to describe
the usage of the different boot sources.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
v4:
	no change
v3:
	no change
v2:
	new patch
---
 doc/board/starfive/milk-v_mars.rst   | 12 +--------
 doc/board/starfive/pine64_star64.rst | 18 +------------
 doc/board/starfive/visionfive2.rst   | 39 +---------------------------
 3 files changed, 3 insertions(+), 66 deletions(-)

diff --git a/doc/board/starfive/milk-v_mars.rst b/doc/board/starfive/milk-v_mars.rst
index aba9c9c53d4..ce4539a46f1 100644
--- a/doc/board/starfive/milk-v_mars.rst
+++ b/doc/board/starfive/milk-v_mars.rst
@@ -57,13 +57,6 @@ environment
 or the configuration variable CONFIG_DEFAULT_FDT_FILE can be used to set to
 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
 ---------------------
 
@@ -105,7 +98,4 @@ Copy U-Boot to the SD card
 	sudo cp jh7110-starfive-visionfive-2.dtb /mnt/
 	sudo umount /mnt
 
-Booting
--------
-
-Once you plugin the sdcard and power up, you should see the U-Boot prompt.
+.. include:: jh7110_common.rst
diff --git a/doc/board/starfive/pine64_star64.rst b/doc/board/starfive/pine64_star64.rst
index 1df4b68e4a0..d1752c452da 100644
--- a/doc/board/starfive/pine64_star64.rst
+++ b/doc/board/starfive/pine64_star64.rst
@@ -55,19 +55,6 @@ environment
 or the configuration variable CONFIG_DEFAULT_FDT_FILE can be used to set to
 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
 ---------------------
 
@@ -109,10 +96,7 @@ Copy U-Boot to the SD card
 	sudo cp jh7110-starfive-visionfive-2.dtb /mnt/
 	sudo umount /mnt
 
-Booting
--------
-
-Once you plugin the sdcard and power up, you should see the U-Boot prompt.
+.. include:: jh7110_common.rst
 
 Serial Number and MAC address issues
 ------------------------------------
diff --git a/doc/board/starfive/visionfive2.rst b/doc/board/starfive/visionfive2.rst
index 44e7fcb3a48..6f3c572f1f8 100644
--- a/doc/board/starfive/visionfive2.rst
+++ b/doc/board/starfive/visionfive2.rst
@@ -132,13 +132,7 @@ Program the SD card
 	sudo cp jh7110-starfive-visionfive-2.dtb /mnt/
 	sudo umount /mnt
 
-Booting
--------
-
-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.
+.. include:: jh7110_common.rst
 
 Sample boot log from StarFive VisionFive2 board
 -----------------------------------------------
@@ -479,34 +473,3 @@ Sample boot log from StarFive VisionFive2 board
 
 	Welcome to Buildroot
 	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.
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v4 8/8] doc: jh7110: describe debug UART
  2025-04-24 12:13 [PATCH v4 0/8] board: starfive: DeepComputing FML13V01 Heinrich Schuchardt
                   ` (6 preceding siblings ...)
  2025-04-24 12:13 ` [PATCH v4 7/8] doc: starfive: use jh7110_common.rst Heinrich Schuchardt
@ 2025-04-24 12:13 ` Heinrich Schuchardt
  2025-04-24 20:36   ` E Shattow
  7 siblings, 1 reply; 19+ messages in thread
From: Heinrich Schuchardt @ 2025-04-24 12:13 UTC (permalink / raw)
  To: Rick Chen, Leo, Minda Chen, Hal Feng
  Cc: Tom Rini, E Shattow, Sumit Garg, H Bell, Lukas Funke,
	Matthias Brugger, E . Shattow, Patrice Chotard, Simon Glass,
	Andreas Schwab, u-boot, Heinrich Schuchardt

Provide the settings for using the debug UART in SPL.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
v4:
	no change
v3:
	no change
v2:
	new patch
---
 doc/board/starfive/jh7110_common.rst | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/doc/board/starfive/jh7110_common.rst b/doc/board/starfive/jh7110_common.rst
index fb8d87a1551..4a8058ee5da 100644
--- a/doc/board/starfive/jh7110_common.rst
+++ b/doc/board/starfive/jh7110_common.rst
@@ -87,3 +87,17 @@ 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
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 1/8] configs: add jh7110-deepcomputing-fml13v01 to VF2 defconfig
  2025-04-24 12:13 ` [PATCH v4 1/8] configs: add jh7110-deepcomputing-fml13v01 to VF2 defconfig Heinrich Schuchardt
@ 2025-04-24 14:50   ` E Shattow
  0 siblings, 0 replies; 19+ messages in thread
From: E Shattow @ 2025-04-24 14:50 UTC (permalink / raw)
  To: Heinrich Schuchardt, Rick Chen, Leo, Minda Chen, Hal Feng
  Cc: Tom Rini, Sumit Garg, H Bell, Lukas Funke, Matthias Brugger,
	E . Shattow, Patrice Chotard, Simon Glass, Andreas Schwab, u-boot,
	Sumit Garg



On 4/24/25 05:13, Heinrich Schuchardt wrote:
> The DeepComputing Framework motherboard is a JH7110 device support by the
> upstream kernel. Add its device-tree to the list of device-trees to be
> included into the starfive_visionfive_defconfig.
> 
> Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
> Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
> Reviewed-by: Matthias Brugger <mbrugger@suse.com>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
> v4:
> 	no change
> v3:
> 	no change
> v2:
> 	rebased
> ---
>  configs/starfive_visionfive2_defconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configs/starfive_visionfive2_defconfig b/configs/starfive_visionfive2_defconfig
> index 6a5b247c4b5..e145ced8db8 100644
> --- a/configs/starfive_visionfive2_defconfig
> +++ b/configs/starfive_visionfive2_defconfig
> @@ -80,7 +80,7 @@ CONFIG_CMD_WDT=y
>  CONFIG_CMD_WGET=y
>  CONFIG_CMD_BOOTSTAGE=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_ENV_OVERWRITE=y
>  CONFIG_ENV_IS_IN_SPI_FLASH=y

Reviewed-by: E Shattow <e@freeshell.de>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 2/8] riscv: dts: jh7110: add DeepComputing FML13V01 device-tree
  2025-04-24 12:13 ` [PATCH v4 2/8] riscv: dts: jh7110: add DeepComputing FML13V01 device-tree Heinrich Schuchardt
@ 2025-04-24 15:05   ` E Shattow
  0 siblings, 0 replies; 19+ messages in thread
From: E Shattow @ 2025-04-24 15:05 UTC (permalink / raw)
  To: Heinrich Schuchardt, Rick Chen, Leo, Minda Chen, Hal Feng
  Cc: Tom Rini, Sumit Garg, H Bell, Matthias Brugger, Patrice Chotard,
	Simon Glass, Andreas Schwab, u-boot, Sumit Garg



On 4/24/25 05:13, Heinrich Schuchardt wrote:
> Add the u-boot device-tree include needed to support the
> DeepComputing Framework motherboard (FML13V01).
> 
> Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
> Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
> Reviewed-by: Matthias Brugger <mbrugger@suse.com>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
> v4:
> 	no change
> v3:
> 	no change
> v2:
> 	no change
> ---
>  arch/riscv/dts/jh7110-deepcomputing-fml13v01-u-boot.dtsi | 7 +++++++
>  1 file changed, 7 insertions(+)
>  create mode 100644 arch/riscv/dts/jh7110-deepcomputing-fml13v01-u-boot.dtsi
> 
> diff --git a/arch/riscv/dts/jh7110-deepcomputing-fml13v01-u-boot.dtsi b/arch/riscv/dts/jh7110-deepcomputing-fml13v01-u-boot.dtsi
> new file mode 100644
> index 00000000000..ab882d07f6f
> --- /dev/null
> +++ b/arch/riscv/dts/jh7110-deepcomputing-fml13v01-u-boot.dtsi
> @@ -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"

Reviewed-by: E Shattow <e@freeshell.de>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 3/8] board: starfive: DeepComputing FML13V01 fdt selection
  2025-04-24 12:13 ` [PATCH v4 3/8] board: starfive: DeepComputing FML13V01 fdt selection Heinrich Schuchardt
@ 2025-04-24 15:25   ` E Shattow
  0 siblings, 0 replies; 19+ messages in thread
From: E Shattow @ 2025-04-24 15:25 UTC (permalink / raw)
  To: Heinrich Schuchardt, Rick Chen, Leo, Minda Chen, Hal Feng
  Cc: Tom Rini, Sumit Garg, H Bell, Matthias Brugger, Patrice Chotard,
	Simon Glass, Andreas Schwab, u-boot

In a different series I suggest removal of this fdtfile setting code,
but now is more important to get this variant added to VF2 board target
in U-Boot as done here.

On 4/24/25 05:13, Heinrich Schuchardt wrote:
> We support all JH7110 boards with starfive_visionfive2_defconfig.
> The relevant device-tree is selected at runtime based on EEPROM data.
> 
> Support setting $fdtfile to the file name of the DeepComputing Framework
> motherboard (FML13V01) device-tree.
> 
> Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
> Reviewed-by: Matthias Brugger <mbrugger@suse.com>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
> v4:
> 	no change
> v3:
> 	rebased upon Mars CM removal patch
> v2:
> 	no change
> ---
>  board/starfive/visionfive2/starfive_visionfive2.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/board/starfive/visionfive2/starfive_visionfive2.c b/board/starfive/visionfive2/starfive_visionfive2.c
> index b8cd509bc89..5fe888d4072 100644
> --- a/board/starfive/visionfive2/starfive_visionfive2.c
> +++ b/board/starfive/visionfive2/starfive_visionfive2.c
> @@ -17,6 +17,8 @@
>  DECLARE_GLOBAL_DATA_PTR;
>  #define JH7110_L2_PREFETCHER_BASE_ADDR		0x2030000
>  #define JH7110_L2_PREFETCHER_HART_OFFSET	0x2000
> +#define FDTFILE_FML13V01 \
> +	"starfive/jh7110-deepcomputing-fml13v01.dtb"
>  #define FDTFILE_MILK_V_MARS \
>  	"starfive/jh7110-milkv-mars.dtb"
>  #define FDTFILE_VISIONFIVE2_1_2A \
> @@ -63,7 +65,9 @@ static void set_fdtfile(void)
>  		log_err("Can't read EEPROM\n");
>  		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;
>  	} else if (!strncmp(product_id, "VF7110", 6)) {
>  		version = get_pcb_revision_from_eeprom();

Reviewed-by: E Shattow <e@freeshell.de>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 4/8] board: starfive: spl: support DeepComputing FML13V01
  2025-04-24 12:13 ` [PATCH v4 4/8] board: starfive: spl: support DeepComputing FML13V01 Heinrich Schuchardt
@ 2025-04-24 15:29   ` E Shattow
  0 siblings, 0 replies; 19+ messages in thread
From: E Shattow @ 2025-04-24 15:29 UTC (permalink / raw)
  To: Heinrich Schuchardt, Rick Chen, Leo, Minda Chen, Hal Feng
  Cc: Tom Rini, Sumit Garg, H Bell, Matthias Brugger, Patrice Chotard,
	Simon Glass, Andreas Schwab, u-boot

In a different series I refactor this logic to match the sorting of
configs/starfive_visionfive2_defconfig:CONFIG_OF_LIST but now is more
important to get this variant added to VF2 board target
in U-Boot as done here.

On 4/24/25 05:13, Heinrich Schuchardt wrote:
> On the DeepComputing Framework motherboard (FML13V01) choose the matching
> FIT configuration.
> 
> Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
> Reviewed-by: Matthias Brugger <mbrugger@suse.com>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
> v4:
> 	no change
> v3:
> 	no change
> v2:
> 	rebased
> ---
>  board/starfive/visionfive2/spl.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/board/starfive/visionfive2/spl.c b/board/starfive/visionfive2/spl.c
> index 3e4d3e21988..9a3081ef06f 100644
> --- a/board/starfive/visionfive2/spl.c
> +++ b/board/starfive/visionfive2/spl.c
> @@ -125,7 +125,10 @@ int board_fit_config_name_match(const char *name)
>  	if (strncmp(name, "starfive/", 9))
>  		return -EINVAL;
>  	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();
>  		if ((version == 'b' || version == 'B') &&
>  		    !strcmp(name, "jh7110-starfive-visionfive-2-v1.3b"))

Reviewed-by: E Shattow <e@freeshell.de>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 5/8] doc: add DeepComputing FML13V01 documentation
  2025-04-24 12:13 ` [PATCH v4 5/8] doc: add DeepComputing FML13V01 documentation Heinrich Schuchardt
@ 2025-04-24 20:26   ` E Shattow
  2025-04-25  7:38     ` Maud Spierings
  0 siblings, 1 reply; 19+ messages in thread
From: E Shattow @ 2025-04-24 20:26 UTC (permalink / raw)
  To: Heinrich Schuchardt, Rick Chen, Leo, Minda Chen, Hal Feng
  Cc: Tom Rini, Sumit Garg, H Bell, Matthias Brugger, Patrice Chotard,
	Simon Glass, Andreas Schwab, u-boot

Overall I think this patch is acceptable as-is and I'll be willing to
make a later series with my suggestions; it's documentation so it is
never really completed, I think, and I spend an hour or two editing then
decide that what I want to do is its own other series. None of the what
I'd like to suggest here should delay a PR for this series.

On 4/24/25 05:13, Heinrich Schuchardt wrote:
> Describe building U-Boot for the board and booting.
> 
> Carve out common information for JH7110 boards into an include.
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
> v4:
> 	Correct the description of booting JH7110 boards from eMMC
> v3:
> 	rebased
> v2:
> 	carve out common information for JH7110 boards into an include
> ---
>  doc/board/starfive/deepcomputing_fml13v01.rst | 80 +++++++++++++++++
>  doc/board/starfive/index.rst                  |  1 +
>  doc/board/starfive/jh7110_common.rst          | 89 +++++++++++++++++++
>  3 files changed, 170 insertions(+)
>  create mode 100644 doc/board/starfive/deepcomputing_fml13v01.rst
>  create mode 100644 doc/board/starfive/jh7110_common.rst
> 
> diff --git a/doc/board/starfive/deepcomputing_fml13v01.rst b/doc/board/starfive/deepcomputing_fml13v01.rst
> new file mode 100644
> index 00000000000..5d9612483b4
> --- /dev/null
> +++ b/doc/board/starfive/deepcomputing_fml13v01.rst
> @@ -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
> diff --git a/doc/board/starfive/index.rst b/doc/board/starfive/index.rst
> index 2cba1b6dc56..66abc6f9d98 100644
> --- a/doc/board/starfive/index.rst
> +++ b/doc/board/starfive/index.rst
> @@ -6,6 +6,7 @@ StarFive
>  .. toctree::
>     :maxdepth: 1
>  
> +   deepcomputing_fml13v01
>     milk-v_mars
>     pine64_star64
>     visionfive2
> diff --git a/doc/board/starfive/jh7110_common.rst b/doc/board/starfive/jh7110_common.rst
> new file mode 100644
> index 00000000000..fb8d87a1551
> --- /dev/null
> +++ b/doc/board/starfive/jh7110_common.rst
> @@ -0,0 +1,89 @@
> +.. 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.

JH7110 Boot User Guide says "Since document release 1.2, boot from SD
Card or eMMC is no longer recommended. But to maintain the code
structure, the following SD/eMMC boot address allocations are modified
as "reserved". Be aware of this change when designing your device based
on JH7110." [1]

1:https://doc-en.rvspace.org/VisionFive2/Developer_Guide/JH7110_Boot_UG.pdf

So this is important we preserve documentation how SD-card and eMMC Boot
source modes can be prepared that are since dropped from official
documentation. Yet on my patch for bootph-pre-ram device-tree hints to
LKML there is Hal (StarFive) and some other people that want this
functionality of SD-card and eMMC boot to remain working in U-Boot even
though it's recommended against and dropped from official StarFive
documentation.

I don't know, which is it? This appears to be an academic exercise to
make those deprecated boot modes working. It certainly belongs in
jh7110_common.rst as something interesting the hardware may be capable
of, but not as the recommended standard operating procedure.

@ Hal can you describe what the JH7110 boot code is doing for SD-card
and eMMC Boot modes? What magic numbers and logic is this process? If
you want these boot modes to be functional then please help with the
documentation here that is now deleted from StarFive officially.

With that,

Reviewed-by: E Shattow <e@freeshell.de>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 6/8] doc: starfive: use consistent formatting
  2025-04-24 12:13 ` [PATCH v4 6/8] doc: starfive: use consistent formatting Heinrich Schuchardt
@ 2025-04-24 20:29   ` E Shattow
  0 siblings, 0 replies; 19+ messages in thread
From: E Shattow @ 2025-04-24 20:29 UTC (permalink / raw)
  To: Heinrich Schuchardt, Rick Chen, Leo, Minda Chen, Hal Feng
  Cc: Tom Rini, Sumit Garg, H Bell, Matthias Brugger, Patrice Chotard,
	Simon Glass, Andreas Schwab, u-boot



On 4/24/25 05:13, Heinrich Schuchardt wrote:
> Always use ---- for the H2 level.
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
> v4:
> 	no change
> v3:
> 	rebased upong Milk-V Mars CM removal patch
> v2:
> 	new patch
> ---
>  doc/board/starfive/milk-v_mars.rst   | 10 +++++-----
>  doc/board/starfive/pine64_star64.rst | 12 ++++++------
>  doc/board/starfive/visionfive2.rst   | 10 +++++-----
>  3 files changed, 16 insertions(+), 16 deletions(-)
> 
> diff --git a/doc/board/starfive/milk-v_mars.rst b/doc/board/starfive/milk-v_mars.rst
> index 554932ecfd4..aba9c9c53d4 100644
> --- a/doc/board/starfive/milk-v_mars.rst
> +++ b/doc/board/starfive/milk-v_mars.rst
> @@ -8,7 +8,7 @@ board. In U-Boot SPL the actual board is detected and the device-tree patched
>  accordingly.
>  
>  Building
> -~~~~~~~~
> +--------
>  
>  1. Add the RISC-V toolchain to your PATH.
>  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.
>  
>  Device-tree selection
> -~~~~~~~~~~~~~~~~~~~~~
> +---------------------
>  
>  Depending on the board version U-Boot set variable $fdtfile to either
>  starfive/jh7110-starfive-visionfive-2-v1.2a.dtb or
> @@ -58,14 +58,14 @@ or the configuration variable CONFIG_DEFAULT_FDT_FILE can be used to set to
>  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
> -~~~~~~~~~~~~~~~~~~~~~
> +---------------------
>  
>  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
> @@ -106,6 +106,6 @@ Copy U-Boot to the SD card
>  	sudo umount /mnt
>  
>  Booting
> -~~~~~~~
> +-------
>  
>  Once you plugin the sdcard and power up, you should see the U-Boot prompt.
> diff --git a/doc/board/starfive/pine64_star64.rst b/doc/board/starfive/pine64_star64.rst
> index 52e9a907917..1df4b68e4a0 100644
> --- a/doc/board/starfive/pine64_star64.rst
> +++ b/doc/board/starfive/pine64_star64.rst
> @@ -8,7 +8,7 @@ In U-Boot SPL the actual board is detected and the device-tree patched
>  accordingly.
>  
>  Building
> -~~~~~~~~
> +--------
>  
>  1. Add the RISC-V toolchain to your PATH.
>  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.
>  
>  Device-tree selection
> -~~~~~~~~~~~~~~~~~~~~~
> +---------------------
>  
>  U-Boot will set variable $fdtfile to starfive/jh7110-pine64-star64.dtb.
>  
> @@ -56,7 +56,7 @@ or the configuration variable CONFIG_DEFAULT_FDT_FILE can be used to set to
>  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
> @@ -69,7 +69,7 @@ accurate selection.
>  + UART: 11
>  
>  Preparing the SD-Card
> -~~~~~~~~~~~~~~~~~~~~~
> +---------------------
>  
>  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
> @@ -110,12 +110,12 @@ Copy U-Boot to the SD card
>  	sudo umount /mnt
>  
>  Booting
> -~~~~~~~
> +-------
>  
>  Once you plugin the sdcard and power up, you should see the U-Boot prompt.
>  
>  Serial Number and MAC address issues
> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +------------------------------------
>  
>  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
> diff --git a/doc/board/starfive/visionfive2.rst b/doc/board/starfive/visionfive2.rst
> index 2c68df3ce4d..44e7fcb3a48 100644
> --- a/doc/board/starfive/visionfive2.rst
> +++ b/doc/board/starfive/visionfive2.rst
> @@ -36,7 +36,7 @@ Currently, the u-boot.itb is used as a dynamic of the OpenSBI FW_DYNAMIC
>  firmware with the latest.
>  
>  Building
> -~~~~~~~~
> +--------
>  
>  1. Add the RISC-V toolchain to your PATH.
>  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.
>  
>  Device-tree selection
> -~~~~~~~~~~~~~~~~~~~~~
> +---------------------
>  
>  Depending on the board version U-Boot set variable $fdtfile to either
>  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.
>  
>  Flashing
> -~~~~~~~~
> +--------
>  
>  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
> @@ -133,7 +133,7 @@ Program the SD card
>  	sudo umount /mnt
>  
>  Booting
> -~~~~~~~
> +-------
>  
>  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.
> @@ -141,7 +141,7 @@ 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
> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +-----------------------------------------------
>  
>  .. code-block:: none
>  

Reviewed-by: E Shattow <e@freeshell.de>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 7/8] doc: starfive: use jh7110_common.rst
  2025-04-24 12:13 ` [PATCH v4 7/8] doc: starfive: use jh7110_common.rst Heinrich Schuchardt
@ 2025-04-24 20:33   ` E Shattow
  0 siblings, 0 replies; 19+ messages in thread
From: E Shattow @ 2025-04-24 20:33 UTC (permalink / raw)
  To: Heinrich Schuchardt, Rick Chen, Leo, Minda Chen, Hal Feng
  Cc: Tom Rini, Sumit Garg, H Bell, Matthias Brugger, Patrice Chotard,
	Simon Glass, Andreas Schwab, u-boot

Milk-V Mars has some board revisions with a push-button and transistor
logic limiting boot source selection to just SPI NOR flash or UART, but
that's something I'll get into detail on when Mars CM/Lite are
re-introduced later on or if we add Pine64 PineTab-V which have similar
limits to boot source selection. Not needed to make a change for that now.

On 4/24/25 05:13, Heinrich Schuchardt wrote:
> To avoid duplicate maintenance just include jh7110_common.rst to describe
> the usage of the different boot sources.
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
> v4:
> 	no change
> v3:
> 	no change
> v2:
> 	new patch
> ---
>  doc/board/starfive/milk-v_mars.rst   | 12 +--------
>  doc/board/starfive/pine64_star64.rst | 18 +------------
>  doc/board/starfive/visionfive2.rst   | 39 +---------------------------
>  3 files changed, 3 insertions(+), 66 deletions(-)
> 
> diff --git a/doc/board/starfive/milk-v_mars.rst b/doc/board/starfive/milk-v_mars.rst
> index aba9c9c53d4..ce4539a46f1 100644
> --- a/doc/board/starfive/milk-v_mars.rst
> +++ b/doc/board/starfive/milk-v_mars.rst
> @@ -57,13 +57,6 @@ environment
>  or the configuration variable CONFIG_DEFAULT_FDT_FILE can be used to set to
>  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
>  ---------------------
>  
> @@ -105,7 +98,4 @@ Copy U-Boot to the SD card
>  	sudo cp jh7110-starfive-visionfive-2.dtb /mnt/
>  	sudo umount /mnt
>  
> -Booting
> --------
> -
> -Once you plugin the sdcard and power up, you should see the U-Boot prompt.
> +.. include:: jh7110_common.rst
> diff --git a/doc/board/starfive/pine64_star64.rst b/doc/board/starfive/pine64_star64.rst
> index 1df4b68e4a0..d1752c452da 100644
> --- a/doc/board/starfive/pine64_star64.rst
> +++ b/doc/board/starfive/pine64_star64.rst
> @@ -55,19 +55,6 @@ environment
>  or the configuration variable CONFIG_DEFAULT_FDT_FILE can be used to set to
>  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
>  ---------------------
>  
> @@ -109,10 +96,7 @@ Copy U-Boot to the SD card
>  	sudo cp jh7110-starfive-visionfive-2.dtb /mnt/
>  	sudo umount /mnt
>  
> -Booting
> --------
> -
> -Once you plugin the sdcard and power up, you should see the U-Boot prompt.
> +.. include:: jh7110_common.rst
>  
>  Serial Number and MAC address issues
>  ------------------------------------
> diff --git a/doc/board/starfive/visionfive2.rst b/doc/board/starfive/visionfive2.rst
> index 44e7fcb3a48..6f3c572f1f8 100644
> --- a/doc/board/starfive/visionfive2.rst
> +++ b/doc/board/starfive/visionfive2.rst
> @@ -132,13 +132,7 @@ Program the SD card
>  	sudo cp jh7110-starfive-visionfive-2.dtb /mnt/
>  	sudo umount /mnt
>  
> -Booting
> --------
> -
> -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.
> +.. include:: jh7110_common.rst
>  
>  Sample boot log from StarFive VisionFive2 board
>  -----------------------------------------------
> @@ -479,34 +473,3 @@ Sample boot log from StarFive VisionFive2 board
>  
>  	Welcome to Buildroot
>  	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.

With that,

Reviewed-by: E Shattow <e@freeshell.de>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 8/8] doc: jh7110: describe debug UART
  2025-04-24 12:13 ` [PATCH v4 8/8] doc: jh7110: describe debug UART Heinrich Schuchardt
@ 2025-04-24 20:36   ` E Shattow
  0 siblings, 0 replies; 19+ messages in thread
From: E Shattow @ 2025-04-24 20:36 UTC (permalink / raw)
  To: Heinrich Schuchardt, Rick Chen, Leo, Minda Chen, Hal Feng
  Cc: Tom Rini, Sumit Garg, H Bell, Matthias Brugger, Patrice Chotard,
	Simon Glass, Andreas Schwab, u-boot

I do not know what a Debug UART is (different than Serial Console?) and
did not test on hardware available to me but the description sounds
reasonable enough.

On 4/24/25 05:13, Heinrich Schuchardt wrote:
> Provide the settings for using the debug UART in SPL.
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
> v4:
> 	no change
> v3:
> 	no change
> v2:
> 	new patch
> ---
>  doc/board/starfive/jh7110_common.rst | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/doc/board/starfive/jh7110_common.rst b/doc/board/starfive/jh7110_common.rst
> index fb8d87a1551..4a8058ee5da 100644
> --- a/doc/board/starfive/jh7110_common.rst
> +++ b/doc/board/starfive/jh7110_common.rst
> @@ -87,3 +87,17 @@ 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

Reviewed-by: E Shattow <e@freeshell.de>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 5/8] doc: add DeepComputing FML13V01 documentation
  2025-04-24 20:26   ` E Shattow
@ 2025-04-25  7:38     ` Maud Spierings
  2025-04-25  9:34       ` Heinrich Schuchardt
  0 siblings, 1 reply; 19+ messages in thread
From: Maud Spierings @ 2025-04-25  7:38 UTC (permalink / raw)
  To: e
  Cc: dmoo_dv, hal.feng, heinrich.schuchardt, mbrugger, minda.chen,
	patrice.chotard, rick, schwab, sjg, sumit.garg, trini, u-boot,
	ycliang

On 4/24/25 13:26, E Shattow wrote:
> Overall I think this patch is acceptable as-is and I'll be willing to
> make a later series with my suggestions; it's documentation so it is
> never really completed, I think, and I spend an hour or two editing then
> decide that what I want to do is its own other series. None of the what
> I'd like to suggest here should delay a PR for this series.
> 
> On 4/24/25 05:13, Heinrich Schuchardt wrote:
>> Describe building U-Boot for the board and booting.
>> 
>> Carve out common information for JH7110 boards into an include.
>> 
>> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
>> ---

[...]

>> +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.
> 
> JH7110 Boot User Guide says "Since document release 1.2, boot from SD
> Card or eMMC is no longer recommended. But to maintain the code
> structure, the following SD/eMMC boot address allocations are modified
> as "reserved". Be aware of this change when designing your device based
> on JH7110." [1]
> 
> 1:https://doc-en.rvspace.org/VisionFive2/Developer_Guide/JH7110_Boot_UG.pdf
> 
> So this is important we preserve documentation how SD-card and eMMC Boot
> source modes can be prepared that are since dropped from official
> documentation. Yet on my patch for bootph-pre-ram device-tree hints to
> LKML there is Hal (StarFive) and some other people that want this
> functionality of SD-card and eMMC boot to remain working in U-Boot even
> though it's recommended against and dropped from official StarFive
> documentation.

Can confirm that I would like this functionality to stay, as I've used 
it a couple of times already on the fml13v01 board specifically to test 
firmware before flashing it to spi flash.

I believe it is actually the default boot mode selected by deepcomputing 
on new boards, but don't quote me on that.

I have only confirmed the sd card to work though, since my eMMC is my 
main drive and is already full of efi/bootfs/rootfs.

I should try that uart booting at some point, I already use tio. Would 
love to see a more detailed how to on it. I guess set to uart, then 
ctrl+t x and then just send the spl, then ctrl+t x to send the FIT?

Kind regards,
Maud

> I don't know, which is it? This appears to be an academic exercise to
> make those deprecated boot modes working. It certainly belongs in
> jh7110_common.rst as something interesting the hardware may be capable
> of, but not as the recommended standard operating procedure.
> 
> @ Hal can you describe what the JH7110 boot code is doing for SD-card
> and eMMC Boot modes? What magic numbers and logic is this process? If
> you want these boot modes to be functional then please help with the
> documentation here that is now deleted from StarFive officially.
> 
> With that,
> 
> Reviewed-by: E Shattow <e@freeshell.de>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 5/8] doc: add DeepComputing FML13V01 documentation
  2025-04-25  7:38     ` Maud Spierings
@ 2025-04-25  9:34       ` Heinrich Schuchardt
  0 siblings, 0 replies; 19+ messages in thread
From: Heinrich Schuchardt @ 2025-04-25  9:34 UTC (permalink / raw)
  To: Maud Spierings
  Cc: dmoo_dv, hal.feng, mbrugger, minda.chen, patrice.chotard, rick,
	schwab, sjg, sumit.garg, trini, u-boot, ycliang, e

On 25.04.25 09:38, Maud Spierings wrote:
> On 4/24/25 13:26, E Shattow wrote:
>> Overall I think this patch is acceptable as-is and I'll be willing to
>> make a later series with my suggestions; it's documentation so it is
>> never really completed, I think, and I spend an hour or two editing then
>> decide that what I want to do is its own other series. None of the what
>> I'd like to suggest here should delay a PR for this series.
>>
>> On 4/24/25 05:13, Heinrich Schuchardt wrote:
>>> Describe building U-Boot for the board and booting.
>>>
>>> Carve out common information for JH7110 boards into an include.
>>>
>>> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
>>> ---
> 
> [...]
> 
>>> +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.
>>
>> JH7110 Boot User Guide says "Since document release 1.2, boot from SD
>> Card or eMMC is no longer recommended. But to maintain the code
>> structure, the following SD/eMMC boot address allocations are modified
>> as "reserved". Be aware of this change when designing your device based
>> on JH7110." [1]
>>
>> 1:https://doc-en.rvspace.org/VisionFive2/Developer_Guide/ 
>> JH7110_Boot_UG.pdf
>>
>> So this is important we preserve documentation how SD-card and eMMC Boot
>> source modes can be prepared that are since dropped from official
>> documentation. Yet on my patch for bootph-pre-ram device-tree hints to
>> LKML there is Hal (StarFive) and some other people that want this
>> functionality of SD-card and eMMC boot to remain working in U-Boot even
>> though it's recommended against and dropped from official StarFive
>> documentation.
> 
> Can confirm that I would like this functionality to stay, as I've used 
> it a couple of times already on the fml13v01 board specifically to test 
> firmware before flashing it to spi flash.

The functionality is in the Boot ROM. So unless somebody changes the 
lithography mask it won't change.

> 
> I believe it is actually the default boot mode selected by deepcomputing 
> on new boards, but don't quote me on that.

The fml13v01 comes without installed eMMC. My board came with U-Boot on 
SPI flash.

> 
> I have only confirmed the sd card to work though, since my eMMC is my 
> main drive and is already full of efi/bootfs/rootfs.
> 
> I should try that uart booting at some point, I already use tio. Would 
> love to see a more detailed how to on it. I guess set to uart, then 
> ctrl+t x and then just send the spl, then ctrl+t x to send the FIT?

Ctrl+t x to send u-boot-spl.bin.normal.out.
Ctrl+t y to send u-boot.itb. We use Y-Modem at that stage.

https://docs.u-boot.org/en/v2025.01/board/starfive/milk-v_mars_cm.html
had this well described.

We can add in more detail again after this series.

Best regards

Heinrich

> 
> Kind regards,
> Maud
> 
>> I don't know, which is it? This appears to be an academic exercise to
>> make those deprecated boot modes working. It certainly belongs in
>> jh7110_common.rst as something interesting the hardware may be capable
>> of, but not as the recommended standard operating procedure.
>>
>> @ Hal can you describe what the JH7110 boot code is doing for SD-card
>> and eMMC Boot modes? What magic numbers and logic is this process? If
>> you want these boot modes to be functional then please help with the
>> documentation here that is now deleted from StarFive officially.
>>
>> With that,
>>
>> Reviewed-by: E Shattow <e@freeshell.de>


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2025-04-25 14:09 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-24 12:13 [PATCH v4 0/8] board: starfive: DeepComputing FML13V01 Heinrich Schuchardt
2025-04-24 12:13 ` [PATCH v4 1/8] configs: add jh7110-deepcomputing-fml13v01 to VF2 defconfig Heinrich Schuchardt
2025-04-24 14:50   ` E Shattow
2025-04-24 12:13 ` [PATCH v4 2/8] riscv: dts: jh7110: add DeepComputing FML13V01 device-tree Heinrich Schuchardt
2025-04-24 15:05   ` E Shattow
2025-04-24 12:13 ` [PATCH v4 3/8] board: starfive: DeepComputing FML13V01 fdt selection Heinrich Schuchardt
2025-04-24 15:25   ` E Shattow
2025-04-24 12:13 ` [PATCH v4 4/8] board: starfive: spl: support DeepComputing FML13V01 Heinrich Schuchardt
2025-04-24 15:29   ` E Shattow
2025-04-24 12:13 ` [PATCH v4 5/8] doc: add DeepComputing FML13V01 documentation Heinrich Schuchardt
2025-04-24 20:26   ` E Shattow
2025-04-25  7:38     ` Maud Spierings
2025-04-25  9:34       ` Heinrich Schuchardt
2025-04-24 12:13 ` [PATCH v4 6/8] doc: starfive: use consistent formatting Heinrich Schuchardt
2025-04-24 20:29   ` E Shattow
2025-04-24 12:13 ` [PATCH v4 7/8] doc: starfive: use jh7110_common.rst Heinrich Schuchardt
2025-04-24 20:33   ` E Shattow
2025-04-24 12:13 ` [PATCH v4 8/8] doc: jh7110: describe debug UART Heinrich Schuchardt
2025-04-24 20:36   ` E Shattow

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.