Skip to contentSkip to conversation

riscv: sophgo: milkv_duo: add support for Milk-V Duo board

PATCH Superseded Kongyang Liu 2 participants 8 messages Jan 14, 2024 – Jan 16, 2024

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover riscv: sophgo: milkv_duo: add support for Milk-V Duo board

The Milk-V Duo board is built upon Sophgo's CV1800B SoC, featuring two XuanTie C906 CPUs running at 1.0GHz and 700MHz, respectively.

This series introduces fundamental support for the Milk-V Duo board, encompassing UART, CPU, and PLIC support. This ensures that U-Boot can operate in serial console mode.

Changes in v2:
- Fold the defconfig patch to first patch
- Remove unnecessary environment settings of consoledev and baudrate in config

Kongyang Liu (3):
riscv: sophgo: milkv_duo: initial support added
riscv: dts: sophgo: Add basic device tree for Milk-V Duo board
doc: sophgo: milkv_duo: document Milk-V Duo board

 arch/riscv/Kconfig                   |   4 +
 arch/riscv/dts/Makefile              |   1 +
 arch/riscv/dts/cv1800b-milkv-duo.dts |  38 +++++++++
 arch/riscv/dts/cv1800b.dtsi          | 123 +++++++++++++++++++++++++++
 board/sophgo/milkv_duo/Kconfig       |  28 ++++++
 board/sophgo/milkv_duo/MAINTAINERS   |   6 ++
 board/sophgo/milkv_duo/Makefile      |   5 ++
 board/sophgo/milkv_duo/board.c       |   9 ++
 configs/milkv_duo_defconfig          |  24 ++++++
 doc/board/index.rst                  |   1 +
 doc/board/sophgo/index.rst           |   8 ++
 doc/board/sophgo/milkv_duo.rst       |  50 +++++++++++
 include/configs/milkv_duo.h          |  12 +++
 13 files changed, 309 insertions(+)
 create mode 100644 arch/riscv/dts/cv1800b-milkv-duo.dts
 create mode 100644 arch/riscv/dts/cv1800b.dtsi
 create mode 100644 board/sophgo/milkv_duo/Kconfig
 create mode 100644 board/sophgo/milkv_duo/MAINTAINERS
 create mode 100644 board/sophgo/milkv_duo/Makefile
 create mode 100644 board/sophgo/milkv_duo/board.c
 create mode 100644 configs/milkv_duo_defconfig
 create mode 100644 doc/board/sophgo/index.rst
 create mode 100644 doc/board/sophgo/milkv_duo.rst
 create mode 100644 include/configs/milkv_duo.h
Signature · 1 line
2.41.0
#1 lore raw

PATCH v2 1/3 riscv: sophgo: milkv_duo: initial support added

Add support for Sophgo's Milk-V Duo board, only minimal device tree and serial console are enabled, and it can boot via vendor first stage bootloader.

---

Changes in v2:
- Fold the defconfig patch to first patch
- Remove unnecessary environment settings of consoledev and baudrate in config

 arch/riscv/Kconfig                 |  4 ++++
 board/sophgo/milkv_duo/Kconfig     | 28 ++++++++++++++++++++++++++++
 board/sophgo/milkv_duo/MAINTAINERS |  6 ++++++
 board/sophgo/milkv_duo/Makefile    |  5 +++++
 board/sophgo/milkv_duo/board.c     |  9 +++++++++
 configs/milkv_duo_defconfig        | 24 ++++++++++++++++++++++++
 include/configs/milkv_duo.h        | 12 ++++++++++++
 7 files changed, 88 insertions(+)
 create mode 100644 board/sophgo/milkv_duo/Kconfig
 create mode 100644 board/sophgo/milkv_duo/MAINTAINERS
 create mode 100644 board/sophgo/milkv_duo/Makefile
 create mode 100644 board/sophgo/milkv_duo/board.c
 create mode 100644 configs/milkv_duo_defconfig
 create mode 100644 include/configs/milkv_duo.h
arch/riscv/Kconfig +4 -0
index 6d0d812ddb..de99ce3a28 100644
@@ -14,6 +14,9 @@ config TARGET_ANDES_AE350
 config TARGET_MICROCHIP_ICICLE
 	bool "Support Microchip PolarFire-SoC Icicle Board"
 
+config TARGET_MILKV_DUO
+	bool "Support Milk-v Duo Board"
+
 config TARGET_OPENPITON_RISCV64
 	bool "Support RISC-V cores on OpenPiton SoC"
 
@@ -80,6 +83,7 @@ source "board/openpiton/riscv64/Kconfig"
 source "board/sifive/unleashed/Kconfig"
 source "board/sifive/unmatched/Kconfig"
 source "board/sipeed/maix/Kconfig"
+source "board/sophgo/milkv_duo/Kconfig"
 source "board/starfive/visionfive2/Kconfig"
 source "board/thead/th1520_lpi4a/Kconfig"
 
board/sophgo/milkv_duo/Kconfig new file +28 -0
new file mode 100644
index 0000000000..2a458f291c
@@ -0,0 +1,28 @@
+if TARGET_MILKV_DUO
+
+config SYS_BOARD
+	default "milkv_duo"
+
+config SYS_VENDOR
+	default "sophgo"
+
+config SYS_CPU
+	default "generic"
+
+config SYS_CONFIG_NAME
+	default "milkv_duo"
+
+config TEXT_BASE
+	default 0x80200000
+
+config ENV_SIZE
+	default 0x20000
+
+config ENV_SECT_SIZE
+	default 0x40000
+
+config BOARD_SPECIFIC_OPTIONS
+	def_bool y
+	select GENERIC_RISCV
+
+endif
board/sophgo/milkv_duo/MAINTAINERS new file +6 -0
new file mode 100644
index 0000000000..651a0592f7
@@ -0,0 +1,6 @@
+Milk-V Duo
+M:	Kongyang Liu <[email protected]>
+S:	Maintained
+F:	board/sophgo/milkv_duo/
+F:	configs/milkv_duo_defconfig
+F:	doc/board/sophgo/milkv_duo.rst
board/sophgo/milkv_duo/Makefile new file +5 -0
new file mode 100644
index 0000000000..a087013f5c
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (c) 2024, Kongyang Liu <[email protected]>
+
+obj-y := board.o
board/sophgo/milkv_duo/board.c new file +9 -0
new file mode 100644
index 0000000000..eaa47be173
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2024, Kongyang Liu <[email protected]>
+ */
+
+int board_init(void)
+{
+	return 0;
+}
configs/milkv_duo_defconfig new file +24 -0
new file mode 100644
index 0000000000..c4782639ef
@@ -0,0 +1,24 @@
+CONFIG_RISCV=y
+CONFIG_SYS_MALLOC_LEN=0x820000
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
+CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x82300000
+CONFIG_DEFAULT_DEVICE_TREE="cv1800b-milkv-duo"
+CONFIG_IDENT_STRING="milkv_duo"
+CONFIG_SYS_LOAD_ADDR=0x80080000
+CONFIG_TARGET_MILKV_DUO=y
+CONFIG_ARCH_RV64I=y
+CONFIG_RISCV_SMODE=y
+CONFIG_FIT=y
+CONFIG_SUPPORT_RAW_INITRD=y
+CONFIG_HUSH_PARSER=y
+CONFIG_SYS_PROMPT="milkv_duo# "
+CONFIG_SYS_MAXARGS=64
+CONFIG_SYS_CBSIZE=512
+CONFIG_SYS_PBSIZE=544
+CONFIG_SYS_BOOTM_LEN=0x4000000
+CONFIG_ENV_OVERWRITE=y
+CONFIG_SYS_NS16550=y
+CONFIG_SYS_NS16550_MEM32=y
+# CONFIG_EFI_LOADER is not set
include/configs/milkv_duo.h new file +12 -0
new file mode 100644
index 0000000000..0b4109dc1f
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2024, Kongyang Liu <[email protected]>
+ *
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#define CFG_SYS_SDRAM_BASE         0x80000000
+
+#endif /* __CONFIG_H */
Signature · 1 line
2.41.0
#2 lore raw

Re: [PATCH v2 1/3] riscv: sophgo: milkv_duo: initial support added

Quoted 5 lines · Kongyang Liu

Add support for Sophgo's Milk-V Duo board, only minimal device tree and serial console are enabled, and it can boot via vendor first stage bootloader.

The sequence of patches seems to be wrong.

We expect that after each single patch building succeeds. But the device-tree is neither in this patch nor in a preceding patch. Please, swap patch 1 and 2.

make[2]: *** No rule to make target 'arch/riscv/dts/cv1800b-milkv-duo.dtb', needed by 'dtbs'.

Quoted 38 lines

---

Changes in v2:
- Fold the defconfig patch to first patch
- Remove unnecessary environment settings of consoledev and baudrate in config

  arch/riscv/Kconfig                 |  4 ++++
  board/sophgo/milkv_duo/Kconfig     | 28 ++++++++++++++++++++++++++++
  board/sophgo/milkv_duo/MAINTAINERS |  6 ++++++
  board/sophgo/milkv_duo/Makefile    |  5 +++++
  board/sophgo/milkv_duo/board.c     |  9 +++++++++
  configs/milkv_duo_defconfig        | 24 ++++++++++++++++++++++++
  include/configs/milkv_duo.h        | 12 ++++++++++++
  7 files changed, 88 insertions(+)

create mode 100644 board/sophgo/milkv_duo/Kconfig create mode 100644 board/sophgo/milkv_duo/MAINTAINERS create mode 100644 board/sophgo/milkv_duo/Makefile create mode 100644 board/sophgo/milkv_duo/board.c create mode 100644 configs/milkv_duo_defconfig create mode 100644 include/configs/milkv_duo.h

arch/riscv/Kconfig +3 -0
index 6d0d812ddb..de99ce3a28 100644
@@ -14,6 +14,9 @@ config TARGET_ANDES_AE350
  config TARGET_MICROCHIP_ICICLE
  	bool "Support Microchip PolarFire-SoC Icicle Board"
 
+config TARGET_MILKV_DUO
+	bool "Support Milk-v Duo Board"
+
  config TARGET_OPENPITON_RISCV64
  	bool "Support RISC-V cores on OpenPiton SoC"
 

arch/riscv/Kconfig source "board/openpiton/riscv64/Kconfig" · line 88

Quoted 6 lines
arch/riscv/Kconfig +1 -0
@@ -80,6 +83,7 @@ source "board/openpiton/riscv64/Kconfig"
  source "board/sifive/unleashed/Kconfig"
  source "board/sifive/unmatched/Kconfig"
  source "board/sipeed/maix/Kconfig"
+source "board/sophgo/milkv_duo/Kconfig"
  source "board/starfive/visionfive2/Kconfig"
  source "board/thead/th1520_lpi4a/Kconfig"

error: patch failed: arch/riscv/Kconfig:80

Please, rebase.

Quoted 93 lines
board/sophgo/milkv_duo/Kconfig new file +28 -0
new file mode 100644
index 0000000000..2a458f291c
@@ -0,0 +1,28 @@
+if TARGET_MILKV_DUO
+
+config SYS_BOARD
+	default "milkv_duo"
+
+config SYS_VENDOR
+	default "sophgo"
+
+config SYS_CPU
+	default "generic"
+
+config SYS_CONFIG_NAME
+	default "milkv_duo"
+
+config TEXT_BASE
+	default 0x80200000
+
+config ENV_SIZE
+	default 0x20000
+
+config ENV_SECT_SIZE
+	default 0x40000
+
+config BOARD_SPECIFIC_OPTIONS
+	def_bool y
+	select GENERIC_RISCV
+
+endif
board/sophgo/milkv_duo/MAINTAINERS new file +6 -0
new file mode 100644
index 0000000000..651a0592f7
@@ -0,0 +1,6 @@
+Milk-V Duo
+M:	Kongyang Liu <[email protected]>
+S:	Maintained
+F:	board/sophgo/milkv_duo/
+F:	configs/milkv_duo_defconfig
+F:	doc/board/sophgo/milkv_duo.rst
board/sophgo/milkv_duo/Makefile new file +5 -0
new file mode 100644
index 0000000000..a087013f5c
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (c) 2024, Kongyang Liu <[email protected]>
+
+obj-y := board.o
board/sophgo/milkv_duo/board.c new file +9 -0
new file mode 100644
index 0000000000..eaa47be173
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2024, Kongyang Liu <[email protected]>
+ */
+
+int board_init(void)
+{
+	return 0;
+}
configs/milkv_duo_defconfig new file +14 -0
new file mode 100644
index 0000000000..c4782639ef
@@ -0,0 +1,24 @@
+CONFIG_RISCV=y
+CONFIG_SYS_MALLOC_LEN=0x820000
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
+CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x82300000
+CONFIG_DEFAULT_DEVICE_TREE="cv1800b-milkv-duo"
+CONFIG_IDENT_STRING="milkv_duo"
+CONFIG_SYS_LOAD_ADDR=0x80080000
+CONFIG_TARGET_MILKV_DUO=y
+CONFIG_ARCH_RV64I=y
+CONFIG_RISCV_SMODE=y
+CONFIG_FIT=y
+CONFIG_SUPPORT_RAW_INITRD=y

configs/milkv_duo_defconfig line 24

Quoted 10 lines
configs/milkv_duo_defconfig new file +10 -0
+CONFIG_HUSH_PARSER=y
+CONFIG_SYS_PROMPT="milkv_duo# "
+CONFIG_SYS_MAXARGS=64
+CONFIG_SYS_CBSIZE=512
+CONFIG_SYS_PBSIZE=544
+CONFIG_SYS_BOOTM_LEN=0x4000000
+CONFIG_ENV_OVERWRITE=y
+CONFIG_SYS_NS16550=y
+CONFIG_SYS_NS16550_MEM32=y
+# CONFIG_EFI_LOADER is not set

Is there a limitation on the size of the binary or why are you excluding this option?

With the loady command you should be able to load an EFI binary via the UART and then launch it. U-Boot comes with some EFI test applications that you could run like smbiosdump.efi.

Best regards

Heinrich

Quoted 18 lines
include/configs/milkv_duo.h new file +12 -0
new file mode 100644
index 0000000000..0b4109dc1f
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2024, Kongyang Liu <[email protected]>
+ *
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#define CFG_SYS_SDRAM_BASE         0x80000000
+
+#endif /* __CONFIG_H */
#3 lore raw

Re: [PATCH v2 1/3] riscv: sophgo: milkv_duo: initial support added

Quoted 8 lines · Heinrich Schuchardt <[email protected]> 于2024年1月15日周一 05:57写道:
Quoted 5 lines · Kongyang Liu

Add support for Sophgo's Milk-V Duo board, only minimal device tree and serial console are enabled, and it can boot via vendor first stage bootloader.

Quoted 10 lines

The sequence of patches seems to be wrong.

We expect that after each single patch building succeeds. But the device-tree is neither in this patch nor in a preceding patch. Please, swap patch 1 and 2.

make[2]: *** No rule to make target 'arch/riscv/dts/cv1800b-milkv-duo.dtb', needed by 'dtbs'.

I forgot defconfig relies on dts files, I will swap patch 1 and 2.

Quoted 47 lines
Quoted 38 lines

---

Changes in v2:
- Fold the defconfig patch to first patch
- Remove unnecessary environment settings of consoledev and baudrate in config

  arch/riscv/Kconfig                 |  4 ++++
  board/sophgo/milkv_duo/Kconfig     | 28 ++++++++++++++++++++++++++++
  board/sophgo/milkv_duo/MAINTAINERS |  6 ++++++
  board/sophgo/milkv_duo/Makefile    |  5 +++++
  board/sophgo/milkv_duo/board.c     |  9 +++++++++
  configs/milkv_duo_defconfig        | 24 ++++++++++++++++++++++++
  include/configs/milkv_duo.h        | 12 ++++++++++++
  7 files changed, 88 insertions(+)

create mode 100644 board/sophgo/milkv_duo/Kconfig create mode 100644 board/sophgo/milkv_duo/MAINTAINERS create mode 100644 board/sophgo/milkv_duo/Makefile create mode 100644 board/sophgo/milkv_duo/board.c create mode 100644 configs/milkv_duo_defconfig create mode 100644 include/configs/milkv_duo.h

arch/riscv/Kconfig +3 -0
index 6d0d812ddb..de99ce3a28 100644
@@ -14,6 +14,9 @@ config TARGET_ANDES_AE350
  config TARGET_MICROCHIP_ICICLE
      bool "Support Microchip PolarFire-SoC Icicle Board"
 
+config TARGET_MILKV_DUO
+     bool "Support Milk-v Duo Board"
+
  config TARGET_OPENPITON_RISCV64
      bool "Support RISC-V cores on OpenPiton SoC"
 

arch/riscv/Kconfig source "board/openpiton/riscv64/Kconfig" · line 88

Quoted 6 lines
arch/riscv/Kconfig +1 -0
@@ -80,6 +83,7 @@ source "board/openpiton/riscv64/Kconfig"
  source "board/sifive/unleashed/Kconfig"
  source "board/sifive/unmatched/Kconfig"
  source "board/sipeed/maix/Kconfig"
+source "board/sophgo/milkv_duo/Kconfig"
  source "board/starfive/visionfive2/Kconfig"
  source "board/thead/th1520_lpi4a/Kconfig"

error: patch failed: arch/riscv/Kconfig:80

Quoted 3 lines

Please, rebase.

I will rebase it.

Quoted 107 lines
Quoted 93 lines
board/sophgo/milkv_duo/Kconfig new file +28 -0
new file mode 100644
index 0000000000..2a458f291c
@@ -0,0 +1,28 @@
+if TARGET_MILKV_DUO
+
+config SYS_BOARD
+     default "milkv_duo"
+
+config SYS_VENDOR
+     default "sophgo"
+
+config SYS_CPU
+     default "generic"
+
+config SYS_CONFIG_NAME
+     default "milkv_duo"
+
+config TEXT_BASE
+     default 0x80200000
+
+config ENV_SIZE
+     default 0x20000
+
+config ENV_SECT_SIZE
+     default 0x40000
+
+config BOARD_SPECIFIC_OPTIONS
+     def_bool y
+     select GENERIC_RISCV
+
+endif
board/sophgo/milkv_duo/MAINTAINERS new file +6 -0
new file mode 100644
index 0000000000..651a0592f7
@@ -0,0 +1,6 @@
+Milk-V Duo
+M:   Kongyang Liu <[email protected]>
+S:   Maintained
+F:   board/sophgo/milkv_duo/
+F:   configs/milkv_duo_defconfig
+F:   doc/board/sophgo/milkv_duo.rst
board/sophgo/milkv_duo/Makefile new file +5 -0
new file mode 100644
index 0000000000..a087013f5c
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (c) 2024, Kongyang Liu <[email protected]>
+
+obj-y := board.o
board/sophgo/milkv_duo/board.c new file +9 -0
new file mode 100644
index 0000000000..eaa47be173
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2024, Kongyang Liu <[email protected]>
+ */
+
+int board_init(void)
+{
+     return 0;
+}
configs/milkv_duo_defconfig new file +14 -0
new file mode 100644
index 0000000000..c4782639ef
@@ -0,0 +1,24 @@
+CONFIG_RISCV=y
+CONFIG_SYS_MALLOC_LEN=0x820000
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
+CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x82300000
+CONFIG_DEFAULT_DEVICE_TREE="cv1800b-milkv-duo"
+CONFIG_IDENT_STRING="milkv_duo"
+CONFIG_SYS_LOAD_ADDR=0x80080000
+CONFIG_TARGET_MILKV_DUO=y
+CONFIG_ARCH_RV64I=y
+CONFIG_RISCV_SMODE=y
+CONFIG_FIT=y
+CONFIG_SUPPORT_RAW_INITRD=y

configs/milkv_duo_defconfig line 24

Quoted 10 lines
configs/milkv_duo_defconfig new file +10 -0
+CONFIG_HUSH_PARSER=y
+CONFIG_SYS_PROMPT="milkv_duo# "
+CONFIG_SYS_MAXARGS=64
+CONFIG_SYS_CBSIZE=512
+CONFIG_SYS_PBSIZE=544
+CONFIG_SYS_BOOTM_LEN=0x4000000
+CONFIG_ENV_OVERWRITE=y
+CONFIG_SYS_NS16550=y
+CONFIG_SYS_NS16550_MEM32=y
+# CONFIG_EFI_LOADER is not set

Is there a limitation on the size of the binary or why are you excluding this option?

Quoted 4 lines

With the loady command you should be able to load an EFI binary via the UART and then launch it. U-Boot comes with some EFI test applications that you could run like smbiosdump.efi.

In my memory, enabling the CONFIG_EFI_LOADER option resulted in some errors on this board, but I forgot what those errors were. I will verify it, and if
there are no issues, I will enable this option.

Best regards
Kongyang Liu

Quoted 23 lines

Best regards

Heinrich

Quoted 18 lines
include/configs/milkv_duo.h new file +12 -0
new file mode 100644
index 0000000000..0b4109dc1f
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2024, Kongyang Liu <[email protected]>
+ *
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#define CFG_SYS_SDRAM_BASE         0x80000000
+
+#endif /* __CONFIG_H */
#4 lore raw

PATCH v2 2/3 riscv: dts: sophgo: Add basic device tree for Milk-V Duo board

In reply to Kongyang Liu

Import device tree from Linux kernel to add basic support for CPU, PLIC, UART and Timer. The name cv1800b in the filename represent the chip used on Milk-V Duo board.

---

(no changes since v1)

 arch/riscv/dts/Makefile              |   1 +
 arch/riscv/dts/cv1800b-milkv-duo.dts |  38 +++++++++
 arch/riscv/dts/cv1800b.dtsi          | 123 +++++++++++++++++++++++++++
 3 files changed, 162 insertions(+)
 create mode 100644 arch/riscv/dts/cv1800b-milkv-duo.dts
 create mode 100644 arch/riscv/dts/cv1800b.dtsi
arch/riscv/dts/Makefile +1 -0
index be6c8a4227..b9e1678676 100644
@@ -2,6 +2,7 @@
 
 dtb-$(CONFIG_TARGET_ANDES_AE350) += ae350_32.dtb ae350_64.dtb
 dtb-$(CONFIG_TARGET_MICROCHIP_ICICLE) += mpfs-icicle-kit.dtb
+dtb-$(CONFIG_TARGET_MILKV_DUO) += cv1800b-milkv-duo.dtb
 dtb-$(CONFIG_TARGET_QEMU_VIRT) += qemu-virt32.dtb qemu-virt64.dtb
 dtb-$(CONFIG_TARGET_OPENPITON_RISCV64) += openpiton-riscv64.dtb
 dtb-$(CONFIG_TARGET_SIFIVE_UNLEASHED) += hifive-unleashed-a00.dtb
arch/riscv/dts/cv1800b-milkv-duo.dts new file +38 -0
new file mode 100644
index 0000000000..3af9e34b3b
@@ -0,0 +1,38 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2023 Jisheng Zhang <[email protected]>
+ */
+
+/dts-v1/;
+
+#include "cv1800b.dtsi"
+
+/ {
+	model = "Milk-V Duo";
+	compatible = "milkv,duo", "sophgo,cv1800b";
+
+	aliases {
+		serial0 = &uart0;
+		serial1 = &uart1;
+		serial2 = &uart2;
+		serial3 = &uart3;
+		serial4 = &uart4;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	memory@80000000 {
+		device_type = "memory";
+		reg = <0x80000000 0x3f40000>;
+	};
+};
+
+&osc {
+	clock-frequency = <25000000>;
+};
+
+&uart0 {
+	status = "okay";
+};
arch/riscv/dts/cv1800b.dtsi new file +123 -0

123 lines not on this page · raw message

Signature · 1 line
2.41.0
#5 lore raw

PATCH v2 3/3 doc: sophgo: milkv_duo: document Milk-V Duo board

In reply to Kongyang Liu

Add document for Milk-V Duo board which based on Sophgo's CV1800B SoC.

---

(no changes since v1)

 doc/board/index.rst            |  1 +
 doc/board/sophgo/index.rst     |  8 ++++++
 doc/board/sophgo/milkv_duo.rst | 50 ++++++++++++++++++++++++++++++++++
 3 files changed, 59 insertions(+)
 create mode 100644 doc/board/sophgo/index.rst
 create mode 100644 doc/board/sophgo/milkv_duo.rst
doc/board/index.rst +1 -0
index 531e547e7e..a0bd534742 100644
@@ -45,6 +45,7 @@ Board-specific doc
    sifive/index
    sipeed/index
    socionext/index
+   sophgo/index
    st/index
    starfive/index
    ste/index
doc/board/sophgo/index.rst new file +8 -0
new file mode 100644
index 0000000000..e097afdac6
@@ -0,0 +1,8 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+Sophgo
+======
+.. toctree::
+   :maxdepth: 1
+
+   milkv_duo
doc/board/sophgo/milkv_duo.rst new file +50 -0

50 lines not on this page · raw message

Signature · 1 line
2.41.0
#6 lore raw

Re: [PATCH v2 3/3] doc: sophgo: milkv_duo: document Milk-V Duo board

Quoted 68 lines · Kongyang Liu

Add document for Milk-V Duo board which based on Sophgo's CV1800B SoC.

---

(no changes since v1)

  doc/board/index.rst            |  1 +
  doc/board/sophgo/index.rst     |  8 ++++++
  doc/board/sophgo/milkv_duo.rst | 50 ++++++++++++++++++++++++++++++++++
  3 files changed, 59 insertions(+)

create mode 100644 doc/board/sophgo/index.rst create mode 100644 doc/board/sophgo/milkv_duo.rst

doc/board/index.rst +1 -0
index 531e547e7e..a0bd534742 100644
@@ -45,6 +45,7 @@ Board-specific doc
     sifive/index
     sipeed/index
     socionext/index
+   sophgo/index
     st/index
     starfive/index
     ste/index
doc/board/sophgo/index.rst new file +8 -0
new file mode 100644
index 0000000000..e097afdac6
@@ -0,0 +1,8 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+Sophgo
+======
+.. toctree::
+   :maxdepth: 1
+
+   milkv_duo
doc/board/sophgo/milkv_duo.rst new file +22 -0
new file mode 100644
index 0000000000..b63304b510
@@ -0,0 +1,50 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+Milk-V Duo
+==========
+
+CV1800B RISC-V SoC
+------------------
+The CV1800B is a high-performance, low-power 1+1 64-bit RISC-V SoC from Sophgo.
+
+Mainline support
+----------------
+The support for following drivers are already enabled:
+1. ns16550 UART Driver.
+
+Building
+~~~~~~~~
+1. Add the RISC-V toolchain to your PATH.
+2. Setup ARCH & cross compilation environment variable:
+
+.. code-block:: console
+
+   export CROSS_COMPILE=<riscv64 toolchain prefix>

doc/board/sophgo/milkv_duo.rst line 32

Quoted 10 lines
doc/board/sophgo/milkv_duo.rst new file +10 -0
+   cd <U-Boot-dir>
+   make milkv_duo_defconfig
+   make
+
+This will generate u-boot-dtb.bin
+
+Booting
+~~~~~~~
+Currently, we rely on vendor FSBL(First Stage Boot Loader) to initialize the
+clock and load the u-boot image, then bootup from it.

Thank you for providing documentation for the board.

Could you please, additionally describe the procedure to run u-boot-dtb.bin on top of FSBL.

Best regards

Heinrich

Quoted 18 lines
doc/board/sophgo/milkv_duo.rst new file +18 -0
+
+Sample boot log from Milk-V Duo board
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.. code-block:: none
+
+   U-Boot 2024.01-rc5-00010-g51965baa36 (Dec 28 2023 - 13:15:53 +0800)milkv_duo
+
+   DRAM:  63.3 MiB
+   Core:  10 devices, 8 uclasses, devicetree: separate
+   Loading Environment from nowhere... OK
+   In:    serial@4140000
+   Out:   serial@4140000
+   Err:   serial@4140000
+   Net:   No ethernet found.
+   milkv_duo# cpu detail
+     0: cpu@0      rv64imafdc
+      ID = 0, freq = 0 Hz: L1 cache, MMU
+   milkv_duo#
#7 lore raw

Re: [PATCH v2 3/3] doc: sophgo: milkv_duo: document Milk-V Duo board

Quoted 83 lines · Heinrich Schuchardt <[email protected]> 于2024年1月15日周一 05:27写道:
Quoted 68 lines · Kongyang Liu

Add document for Milk-V Duo board which based on Sophgo's CV1800B SoC.

---

(no changes since v1)

  doc/board/index.rst            |  1 +
  doc/board/sophgo/index.rst     |  8 ++++++
  doc/board/sophgo/milkv_duo.rst | 50 ++++++++++++++++++++++++++++++++++
  3 files changed, 59 insertions(+)

create mode 100644 doc/board/sophgo/index.rst create mode 100644 doc/board/sophgo/milkv_duo.rst

doc/board/index.rst +1 -0
index 531e547e7e..a0bd534742 100644
@@ -45,6 +45,7 @@ Board-specific doc
     sifive/index
     sipeed/index
     socionext/index
+   sophgo/index
     st/index
     starfive/index
     ste/index
doc/board/sophgo/index.rst new file +8 -0
new file mode 100644
index 0000000000..e097afdac6
@@ -0,0 +1,8 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+Sophgo
+======
+.. toctree::
+   :maxdepth: 1
+
+   milkv_duo
doc/board/sophgo/milkv_duo.rst new file +22 -0
new file mode 100644
index 0000000000..b63304b510
@@ -0,0 +1,50 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+Milk-V Duo
+==========
+
+CV1800B RISC-V SoC
+------------------
+The CV1800B is a high-performance, low-power 1+1 64-bit RISC-V SoC from Sophgo.
+
+Mainline support
+----------------
+The support for following drivers are already enabled:
+1. ns16550 UART Driver.
+
+Building
+~~~~~~~~
+1. Add the RISC-V toolchain to your PATH.
+2. Setup ARCH & cross compilation environment variable:
+
+.. code-block:: console
+
+   export CROSS_COMPILE=<riscv64 toolchain prefix>

doc/board/sophgo/milkv_duo.rst line 32

Quoted 10 lines
doc/board/sophgo/milkv_duo.rst new file +10 -0
+   cd <U-Boot-dir>
+   make milkv_duo_defconfig
+   make
+
+This will generate u-boot-dtb.bin
+
+Booting
+~~~~~~~
+Currently, we rely on vendor FSBL(First Stage Boot Loader) to initialize the
+clock and load the u-boot image, then bootup from it.

Thank you for providing documentation for the board.

Quoted 3 lines

Could you please, additionally describe the procedure to run u-boot-dtb.bin on top of FSBL.

I'd like to clarify your request for describing the procedure to run u-boot-dtb.bin on top of FSBL. Are you looking for a detailed, step-by-step guide to replicate the process and successfully run u-boot-dtb.bin, or would you prefer a more concise overview?

Best regards
Kongyang Liu

Quoted 23 lines

Best regards

Heinrich

Quoted 18 lines
doc/board/sophgo/milkv_duo.rst new file +18 -0
+
+Sample boot log from Milk-V Duo board
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.. code-block:: none
+
+   U-Boot 2024.01-rc5-00010-g51965baa36 (Dec 28 2023 - 13:15:53 +0800)milkv_duo
+
+   DRAM:  63.3 MiB
+   Core:  10 devices, 8 uclasses, devicetree: separate
+   Loading Environment from nowhere... OK
+   In:    serial@4140000
+   Out:   serial@4140000
+   Err:   serial@4140000
+   Net:   No ethernet found.
+   milkv_duo# cpu detail
+     0: cpu@0      rv64imafdc
+      ID = 0, freq = 0 Hz: L1 cache, MMU
+   milkv_duo#