Skip to contentSkip to conversation

Add upstream board Xunlong Orange Pi RV

PATCH Superseded E Shattow 2 participants 8 messages Mar 5 – Mar 9

lore
Share & tools
lore

E Shattow

author
#0 lore raw

v4 cover Add upstream board Xunlong Orange Pi RV

Xunlong Orange Pi RV patches are now in the Linux v6.19 release, so let's introduce support for this board.

Note: The content of EEPROM is known to not be unique on this board, and an (optional) invented "XOPIRV" identifier is implemented with this series. Without, there are reports that the board is detected in U-Boot as StarFive VisionFive 2 1.3b, and is then functional enough to load the devicetree prior to booting Linux.

Changes since v3:
- Collect tags (no code changes)
- Cherry-picked dts subtree patches dropped as redundant:
Drop patch 1/5 "dt-bindings: riscv: starfive: add xunlong,orangepi-rv" Drop patch 2/5 "riscv: dts: starfive: add Orange Pi RV"

Changes since v2:
- Collect tags (no code changes)
- Adjust missing S-o-by tag to first of tags list order for patch 4 "configs: starfive: Add Orange Pi RV to visionfive2".

Changes since RFC v1:
- Cherrypick from devicetree-rebasing instead of importing upstream dts as -u-boot.dtsi overrides.
- Add basic documentation
- Mention invented "XOPIRV" identifier in commit messages
- Rebase on origin/next

E Shattow (3):
board: starfive: visionfive2: Add Orange Pi RV selection by product_id
configs: starfive: Add Orange Pi RV to visionfive2
doc: board: starfive: Add Xunlong OrangePi RV

 board/starfive/visionfive2/spl.c              |  3 ++
 .../visionfive2/starfive_visionfive2.c        |  2 ++
 configs/starfive_visionfive2_defconfig        |  2 +-
 doc/board/starfive/index.rst                  |  1 +
 doc/board/starfive/orangepi_rv.rst            | 35 +++++++++++++++++++
 5 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 doc/board/starfive/orangepi_rv.rst

base-commit: c0ca147ac6228949a6d6497531c9f2f4a0dc6c67

Signature · 1 line
2.50.0
author
#1 lore raw

PATCH v4 1/3 board: starfive: visionfive2: Add Orange Pi RV selection by product_id

Add XOPIRV identifier for Orange Pi RV to dts selection callback in SPL, and to fdtfile environment variable default value selection in payload.

---
 board/starfive/visionfive2/spl.c                  | 3 +++
 board/starfive/visionfive2/starfive_visionfive2.c | 2 ++
 2 files changed, 5 insertions(+)
board/starfive/visionfive2/spl.c +3 -0
index 2d9431d2976..684605278c0 100644
@@ -131,6 +131,9 @@ int board_fit_config_name_match(const char *name)
 		    !strncmp(get_product_id_from_eeprom(), "MARC", 4) &&
 		    !get_mmc_size_from_eeprom()) {
 		return 0;
+	} else if (!strcmp(name, "starfive/jh7110-orangepi-rv") &&
+		    !strncmp(get_product_id_from_eeprom(), "XOPIRV", 6)) {
+		return 0;
 	} else if (!strcmp(name, "starfive/jh7110-pine64-star64") &&
 		    !strncmp(get_product_id_from_eeprom(), "STAR64", 6)) {
 		return 0;
board/starfive/visionfive2/starfive_visionfive2.c +2 -0
index 6c39fd4af35..d59622f6b64 100644
@@ -63,6 +63,8 @@ static void set_fdtfile(void)
 		} else {
 			fdtfile = "starfive/jh7110-milkv-marscm-lite.dtb";
 		}
+	} else if (!strncmp(get_product_id_from_eeprom(), "XOPIRV", 6)) {
+		fdtfile = "starfive/jh7110-orangepi-rv.dtb";
 	} else if (!strncmp(get_product_id_from_eeprom(), "STAR64", 6)) {
 		fdtfile = "starfive/jh7110-pine64-star64.dtb";
 	} else if (!strncmp(get_product_id_from_eeprom(), "VF7110A", 7)) {
Signature · 1 line
2.50.0
Reviewed-by on v4 1/3
#2 lore raw

Re: [PATCH v4 1/3] board: starfive: visionfive2: Add Orange Pi RV selection by product_id

Quoted 2 lines · E Shattow

Add XOPIRV identifier for Orange Pi RV to dts selection callback in SPL, and to fdtfile environment variable default value selection in payload.

Did Shenzhen Xunlong Software Co., Ltd ever respond to the suggested EEPROM change?

Quoted 13 lines
---
  board/starfive/visionfive2/spl.c                  | 3 +++
  board/starfive/visionfive2/starfive_visionfive2.c | 2 ++
  2 files changed, 5 insertions(+)
board/starfive/visionfive2/spl.c +0 -0
index 2d9431d2976..684605278c0 100644

board/starfive/visionfive2/spl.c int board_fit_config_name_match(const char *name) · line 134

Quoted 4 lines
board/starfive/visionfive2/spl.c +1 -0
@@ -131,6 +131,9 @@ int board_fit_config_name_match(const char *name)
  		    !strncmp(get_product_id_from_eeprom(), "MARC", 4) &&
  		    !get_mmc_size_from_eeprom()) {
  		return 0;
+	} else if (!strcmp(name, "starfive/jh7110-orangepi-rv") &&

This matches the name of the device-tree in upstream Linux.

Quoted 18 lines
board/starfive/visionfive2/spl.c +2 -0
+		    !strncmp(get_product_id_from_eeprom(), "XOPIRV", 6)) {
+		return 0;
  	} else if (!strcmp(name, "starfive/jh7110-pine64-star64") &&
  		    !strncmp(get_product_id_from_eeprom(), "STAR64", 6)) {
  		return 0;
board/starfive/visionfive2/starfive_visionfive2.c +2 -0
index 6c39fd4af35..d59622f6b64 100644
@@ -63,6 +63,8 @@ static void set_fdtfile(void)
  		} else {
  			fdtfile = "starfive/jh7110-milkv-marscm-lite.dtb";
  		}
+	} else if (!strncmp(get_product_id_from_eeprom(), "XOPIRV", 6)) {
+		fdtfile = "starfive/jh7110-orangepi-rv.dtb";
  	} else if (!strncmp(get_product_id_from_eeprom(), "STAR64", 6)) {
  		fdtfile = "starfive/jh7110-pine64-star64.dtb";
  	} else if (!strncmp(get_product_id_from_eeprom(), "VF7110A", 7)) {
author
#3 lore raw

PATCH v4 2/3 configs: starfive: Add Orange Pi RV to visionfive2

In reply to E Shattow

Add Orange Pi RV to visionfive2 CONFIG_OF_LIST

---
 configs/starfive_visionfive2_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configs/starfive_visionfive2_defconfig +1 -1
index a754134a313..7c957cc0ea1 100644
@@ -80,7 +80,7 @@ CONFIG_WGET_HTTPS=y
 CONFIG_CMD_BOOTSTAGE=y
 CONFIG_OF_BOARD=y
 CONFIG_DEVICE_TREE_INCLUDES="starfive-visionfive2-u-boot.dtsi"
-CONFIG_OF_LIST="starfive/jh7110-deepcomputing-fml13v01 starfive/jh7110-milkv-mars starfive/jh7110-milkv-marscm-emmc starfive/jh7110-milkv-marscm-lite 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-milkv-marscm-emmc starfive/jh7110-milkv-marscm-lite starfive/jh7110-orangepi-rv 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
Signature · 1 line
2.50.0
Reviewed-by on v4 2/3
#4 lore raw

Re: [PATCH v4 2/3] configs: starfive: Add Orange Pi RV to visionfive2

Quoted 4 lines · E Shattow

Add Orange Pi RV to visionfive2 CONFIG_OF_LIST

Quoted 17 lines
---
  configs/starfive_visionfive2_defconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
configs/starfive_visionfive2_defconfig +1 -1
index a754134a313..7c957cc0ea1 100644
@@ -80,7 +80,7 @@ CONFIG_WGET_HTTPS=y
  CONFIG_CMD_BOOTSTAGE=y
  CONFIG_OF_BOARD=y
  CONFIG_DEVICE_TREE_INCLUDES="starfive-visionfive2-u-boot.dtsi"
-CONFIG_OF_LIST="starfive/jh7110-deepcomputing-fml13v01 starfive/jh7110-milkv-mars starfive/jh7110-milkv-marscm-emmc starfive/jh7110-milkv-marscm-lite 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-milkv-marscm-emmc starfive/jh7110-milkv-marscm-lite starfive/jh7110-orangepi-rv 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
author
#5 lore raw

PATCH v4 3/3 doc: board: starfive: Add Xunlong OrangePi RV

In reply to E Shattow

OrangePi RV is a board that uses the same EEPROM product serial identifier as the StarFive VisionFive 2 1.3b.

In fact it is not completely compatible with the StarFive VisionFive 2 1.3b for use with Linux Kernel however it is good enough for use with U-Boot SPL and U-Boot Main. Describe how to set the devicetree search path and, for advanced users, suggest that it is possible to update the EEPROM data with an invented "XOPIRV" identifier for automatic board detection.

---
 doc/board/starfive/index.rst       |  1 +
 doc/board/starfive/orangepi_rv.rst | 35 ++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 doc/board/starfive/orangepi_rv.rst
doc/board/starfive/index.rst +1 -0
index f85d7376b44..0996e0a68aa 100644
@@ -10,5 +10,6 @@ StarFive
    milk-v_mars
    milkv_marscm_emmc
    milkv_marscm_lite
+   orangepi_rv
    pine64_star64
    visionfive2
doc/board/starfive/orangepi_rv.rst new file +35 -0
new file mode 100644
index 00000000000..29cc58a1e2b
@@ -0,0 +1,35 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+Xunlong OrangePi RV
+===================
+
+U-Boot for the OrangePi RV uses the same U-Boot binaries as the VisionFive 2
+board. In U-Boot SPL the actual board is detected as a VisionFive2 1.3b due to
+a manufacturer problem and having the same EEPROM data as VisionFive2 1.3b.
+
+Device-tree selection
+---------------------
+
+U-Boot will set variable $fdtfile to starfive/jh7110-starfive-visionfive-2-v1.3b.dtb
+
+This is sufficient for U-Boot however fails to work correctly with the Linux Kernel.
+
+To overrule this selection the variable can be set manually and saved in the
+environment
+
+::
+
+    env set fdtfile starfive/jh7110-orangepi-rv.dtb
+    env save
+
+EEPROM modification
+-------------------
+
+For advanced users and developers an EEPROM identifier product serial number
+beginning with "XOPIRV" will match the OrangePi RV and automatically set the
+correct device-tree at U-Boot SPL phase. The procedure for writing EEPROM data
+is not detailed here however is similar to that of the Pine64 Star64 and Milk-V
+Mars CM. The write-protect disable pads on the Orange Pi RV circuit board
+bottom are labeled WP and GND near the M.2 connector.
+
+.. include:: jh7110_common.rst
Signature · 1 line
2.50.0
Reviewed-by on v4 3/3
#6 lore raw

Re: [PATCH v4 3/3] doc: board: starfive: Add Xunlong OrangePi RV

Quoted 10 lines · E Shattow

OrangePi RV is a board that uses the same EEPROM product serial identifier as the StarFive VisionFive 2 1.3b.

In fact it is not completely compatible with the StarFive VisionFive 2 1.3b for use with Linux Kernel however it is good enough for use with U-Boot SPL and U-Boot Main. Describe how to set the devicetree search path and, for advanced users, suggest that it is possible to update the EEPROM data with an invented "XOPIRV" identifier for automatic board detection.

Quoted 58 lines
---
  doc/board/starfive/index.rst       |  1 +
  doc/board/starfive/orangepi_rv.rst | 35 ++++++++++++++++++++++++++++++
  2 files changed, 36 insertions(+)

create mode 100644 doc/board/starfive/orangepi_rv.rst

doc/board/starfive/index.rst +1 -0
index f85d7376b44..0996e0a68aa 100644
@@ -10,5 +10,6 @@ StarFive
     milk-v_mars
     milkv_marscm_emmc
     milkv_marscm_lite
+   orangepi_rv
     pine64_star64
     visionfive2
doc/board/starfive/orangepi_rv.rst new file +35 -0
new file mode 100644
index 00000000000..29cc58a1e2b
@@ -0,0 +1,35 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+Xunlong OrangePi RV
+===================
+
+U-Boot for the OrangePi RV uses the same U-Boot binaries as the VisionFive 2
+board. In U-Boot SPL the actual board is detected as a VisionFive2 1.3b due to
+a manufacturer problem and having the same EEPROM data as VisionFive2 1.3b.
+
+Device-tree selection
+---------------------
+
+U-Boot will set variable $fdtfile to starfive/jh7110-starfive-visionfive-2-v1.3b.dtb
+
+This is sufficient for U-Boot however fails to work correctly with the Linux Kernel.
+
+To overrule this selection the variable can be set manually and saved in the
+environment
+
+::
+
+    env set fdtfile starfive/jh7110-orangepi-rv.dtb
+    env save
+
+EEPROM modification
+-------------------
+
+For advanced users and developers an EEPROM identifier product serial number
+beginning with "XOPIRV" will match the OrangePi RV and automatically set the
+correct device-tree at U-Boot SPL phase. The procedure for writing EEPROM data
+is not detailed here however is similar to that of the Pine64 Star64 and Milk-V
+Mars CM. The write-protect disable pads on the Orange Pi RV circuit board
+bottom are labeled WP and GND near the M.2 connector.
+
+.. include:: jh7110_common.rst
author
#7 lore raw
In reply to E Shattow
Quoted 41 lines · E Shattow

Xunlong Orange Pi RV patches are now in the Linux v6.19 release, so let's introduce support for this board.

Note: The content of EEPROM is known to not be unique on this board, and an (optional) invented "XOPIRV" identifier is implemented with this series. Without, there are reports that the board is detected in U-Boot as StarFive VisionFive 2 1.3b, and is then functional enough to load the devicetree prior to booting Linux.

Changes since v3:
- Collect tags (no code changes)
- Cherry-picked dts subtree patches dropped as redundant:
Drop patch 1/5 "dt-bindings: riscv: starfive: add xunlong,orangepi-rv" Drop patch 2/5 "riscv: dts: starfive: add Orange Pi RV"

Changes since v2:
- Collect tags (no code changes)
- Adjust missing S-o-by tag to first of tags list order for patch 4 "configs: starfive: Add Orange Pi RV to visionfive2".

Changes since RFC v1:
- Cherrypick from devicetree-rebasing instead of importing upstream dts as -u-boot.dtsi overrides.
- Add basic documentation
- Mention invented "XOPIRV" identifier in commit messages
- Rebase on origin/next

E Shattow (3):
board: starfive: visionfive2: Add Orange Pi RV selection by product_id
configs: starfive: Add Orange Pi RV to visionfive2
doc: board: starfive: Add Xunlong OrangePi RV

 board/starfive/visionfive2/spl.c              |  3 ++
 .../visionfive2/starfive_visionfive2.c        |  2 ++
 configs/starfive_visionfive2_defconfig        |  2 +-
 doc/board/starfive/index.rst                  |  1 +
 doc/board/starfive/orangepi_rv.rst            | 35 +++++++++++++++++++
 5 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 doc/board/starfive/orangepi_rv.rst
Quoted 1 line

base-commit: c0ca147ac6228949a6d6497531c9f2f4a0dc6c67

Well that's embarrassing as I thought I'd collected the tags but it doesn't show up in what I sent to the list. Re-sending shortly, disregard this thread and sorry for the noise. -E