Skip to contentSkip to conversation

hw/riscv: Add support for Milk-V Duo board

RFC PATCH Superseded Kuan-Wei Chiu 2 participants 10 messages May 12 – May 13

Subsystems (2)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

cover hw/riscv: Add support for Milk-V Duo board

Add initial support for the Milk-V Duo board.

This is something I've been playing around with in my local branch, and I've reached a point where the implementation is enough to boot OpenSBI and reach a Linux shell using an SD card image.

I am sending this as an RFC to get early feedback to understand the gap between this minimal implementation and what is required for a upstream merge. I plan to continue implementing missing blocks (like gpio and clk/rst) in future.

Kuan-Wei Chiu (5):
target/riscv: Add stubs for T-Head PMU CSRs
hw/char: Add dw8250 UART
hw/misc: Add Sophgo CV1800B clock controller
hw/riscv: Add Sophgo CV1800B SoC support
hw/riscv: Add Milk-V Duo board support

 MAINTAINERS                                 |  11 ++
 configs/devices/riscv64-softmmu/default.mak |   1 +
 hw/char/Kconfig                             |   4 +
 hw/char/dw8250.c                            | 118 ++++++++++++++
 hw/char/meson.build                         |   1 +
 hw/misc/Kconfig                             |   3 +
 hw/misc/cv1800b_clk.c                       |  89 +++++++++++
 hw/misc/meson.build                         |   1 +
 hw/riscv/Kconfig                            |  14 ++
 hw/riscv/cv1800b.c                          | 168 ++++++++++++++++++++
 hw/riscv/meson.build                        |   3 +
 hw/riscv/milkv_duo.c                        | 122 ++++++++++++++
 include/hw/char/dw8250.h                    |  27 ++++
 include/hw/misc/cv1800b_clk.h               |  24 +++
 include/hw/riscv/cv1800b.h                  |  52 ++++++
 target/riscv/th_csr.c                       |  30 ++++
 16 files changed, 668 insertions(+)
 create mode 100644 hw/char/dw8250.c
 create mode 100644 hw/misc/cv1800b_clk.c
 create mode 100644 hw/riscv/cv1800b.c
 create mode 100644 hw/riscv/milkv_duo.c
 create mode 100644 include/hw/char/dw8250.h
 create mode 100644 include/hw/misc/cv1800b_clk.h
 create mode 100644 include/hw/riscv/cv1800b.h
Signature · 1 line
2.54.0.563.g4f69b47b94-goog
#1 lore raw

RFC PATCH 1/5 target/riscv: Add stubs for T-Head PMU CSRs

T-Head CPUs use custom CSRs for performance monitoring, specifically mcounterinten (0x7ca) and mcounterof (0x7cb).

Since we don't implement these custom PMU registers yet, the system crashes with an illegal instruction trap when OpenSBI like this:

system_opcode_insn: Failed to access CSR 0x7ca from M-mode
sbi_trap_error: hart0: trap1: illegal instruction handler failed (error -1)

Add simple read/write stubs for these two CSRs. By silently ignoring writes and returning 0 on reads, we prevent the fatal exceptions and allow to continue normally.

---
 target/riscv/th_csr.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
target/riscv/th_csr.c +30 -0
index 49eb7bbab5..b095364c31 100644
@@ -21,12 +21,19 @@
 #include "cpu_vendorid.h"
 
 #define CSR_TH_SXSTATUS 0x5c0
+#define CSR_TH_MCOUNTERINTEN 0x7ca
+#define CSR_TH_MCOUNTEROF    0x7cb
 
 /* TH_SXSTATUS bits */
 #define TH_SXSTATUS_UCME        BIT(16)
 #define TH_SXSTATUS_MAEE        BIT(21)
 #define TH_SXSTATUS_THEADISAEE  BIT(22)
 
+static RISCVException mmode(CPURISCVState *env, int csrno)
+{
+    return RISCV_EXCP_NONE;
+}
+
 static RISCVException smode(CPURISCVState *env, int csrno)
 {
     if (riscv_has_ext(env, RVS)) {
@@ -49,11 +56,34 @@ static RISCVException read_th_sxstatus(CPURISCVState *env, int csrno,
     return RISCV_EXCP_NONE;
 }
 
+static RISCVException read_th_pmu(CPURISCVState *env, int csrno,
+                                  target_ulong *val)
+{
+    *val = 0;
+    return RISCV_EXCP_NONE;
+}
+
+static RISCVException write_th_pmu(CPURISCVState *env, int csrno,
+                                   target_ulong val, uintptr_t retaddr)
+{
+    return RISCV_EXCP_NONE;
+}
+
 const RISCVCSR th_csr_list[] = {
     {
         .csrno = CSR_TH_SXSTATUS,
         .insertion_test = test_thead_mvendorid,
         .csr_ops = { "th.sxstatus", smode, read_th_sxstatus }
     },
+    {
+        .csrno = CSR_TH_MCOUNTERINTEN,
+        .insertion_test = test_thead_mvendorid,
+        .csr_ops = { "th.mcounterinten", mmode, read_th_pmu, write_th_pmu }
+    },
+    {
+        .csrno = CSR_TH_MCOUNTEROF,
+        .insertion_test = test_thead_mvendorid,
+        .csr_ops = { "th.mcounterof", mmode, read_th_pmu, write_th_pmu }
+    },
     { }
 };
Signature · 1 line
2.54.0.563.g4f69b47b94-goog
#2 lore raw

Re: [PATCH RFC 1/5] target/riscv: Add stubs for T-Head PMU CSRs

Quoted 7 lines · Kuan-Wei Chiu

T-Head CPUs use custom CSRs for performance monitoring, specifically mcounterinten (0x7ca) and mcounterof (0x7cb).

Since we don't implement these custom PMU registers yet, the system crashes with an illegal instruction trap when OpenSBI like this:

Quoted 6 lines

system_opcode_insn: Failed to access CSR 0x7ca from M-mode
sbi_trap_error: hart0: trap1: illegal instruction handler failed (error -1)

Add simple read/write stubs for these two CSRs. By silently ignoring writes and returning 0 on reads, we prevent the fatal exceptions and allow to continue normally.

Can you include a link to the documentation for the CSRs

Alistair

#3 lore raw

Re: [PATCH RFC 1/5] target/riscv: Add stubs for T-Head PMU CSRs

Quoted 8 lines · Alistair Francis
Quoted 7 lines · Kuan-Wei Chiu

T-Head CPUs use custom CSRs for performance monitoring, specifically mcounterinten (0x7ca) and mcounterof (0x7cb).

Since we don't implement these custom PMU registers yet, the system crashes with an illegal instruction trap when OpenSBI like this:

Quoted 9 lines
Quoted 6 lines

system_opcode_insn: Failed to access CSR 0x7ca from M-mode
sbi_trap_error: hart0: trap1: illegal instruction handler failed (error -1)

Add simple read/write stubs for these two CSRs. By silently ignoring writes and returning 0 on reads, we prevent the fatal exceptions and allow to continue normally.

Can you include a link to the documentation for the CSRs

Sure.
I'll add the link in v2.

Regards,
Kuan-Wei

#4 lore raw

RFC PATCH 2/5 hw/char: Add dw8250 UART

In reply to Kuan-Wei Chiu

Add the dw8250 uart support. This hardware is a widely used 16550A derivative that includes additional registers.

Without this specific device support, the Linux 8250_dw driver fails to probe the extended registers (UCV, CPR, etc.), which are essential for correct feature detection:

[    0.293566] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.306929] Oops - store (or AMO) access fault [#1]
[    0.307020] Modules linked in:
[    0.307192] CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 7.0.0 #1 PREEMPTLAZY
[    0.307250] Hardware name: Milk-V Duo (DT)
[    0.307294] epc : dw8250_setup_port+0x22/0x520
[    0.307504]  ra : dw8250_probe+0x57e/0x5b8
[    0.307518] epc : ffffffff80708dd6 ra : ffffffff8070a49e sp : ffffffc60000b820
[    0.307525]  gp : ffffffff81a32ba8 tp : ffffffd602180cc0 t0 : 0000000000000073
[    0.307533]  t1 : 000000000000006c t2 : 0000000000000000 s0 : ffffffc60000b830
[    0.307539]  s1 : ffffffd6028c8640 a0 : ffffffc60000b848 a1 : ffffffff813162c1
[    0.307546]  a2 : ffffffff813162c0 a3 : ffffffd6028c8640 a4 : ffffffc60002d0b4
[    0.307552]  a5 : 0000000000000001 a6 : 0000000000000094 a7 : 0000000000000060
[    0.307558]  s2 : ffffffd60225d410 s3 : ffffffd60225d400 s4 : 0000000000000000
[    0.307573]  s5 : ffffffff80e31a48 s6 : 0000000000000008 s7 : 0000000000000000
[    0.307584]  s8 : 0000000000000149 s9 : 0000000000000000 s10: 0000000000000000
[    0.307590]  s11: 0000000000000000 t3 : ffffffd602007c00 t4 : ffffffff81601540
[    0.307604]  t5 : 0000000000000003 t6 : ffffffd602a42f82 ssp : 0000000000000000
[    0.307611] status: 0000000200000120 badaddr: ffffffc60002d0b4 cause: 0000000000000007
[    0.307652] [<ffffffff80708dd6>] dw8250_setup_port+0x22/0x520
[    0.307695] [<ffffffff8070a49e>] dw8250_probe+0x57e/0x5b8
[    0.307702] [<ffffffff80731f0e>] platform_probe+0x46/0x80
[    0.307708] [<ffffffff8072f67c>] really_probe+0x84/0x22c
[    0.307715] [<ffffffff8072f880>] __driver_probe_device+0x5c/0xd4
[    0.307721] [<ffffffff8072f9be>] driver_probe_device+0x2e/0xf4
[    0.307727] [<ffffffff8072fbe6>] __driver_attach+0x6e/0x14c
[    0.307734] [<ffffffff8072d5f0>] bus_for_each_dev+0x60/0xb0
[    0.307740] [<ffffffff8072f1b2>] driver_attach+0x1a/0x24
[    0.307746] [<ffffffff8072e8da>] bus_add_driver+0xca/0x1d8
[    0.307752] [<ffffffff80730aaa>] driver_register+0x3e/0xdc
[    0.307757] [<ffffffff80731c54>] __platform_driver_register+0x1c/0x24
[    0.307779] [<ffffffff80c334f6>] dw8250_platform_driver_init+0x1a/0x24
[    0.307793] [<ffffffff80011992>] do_one_initcall+0x4e/0x2a4
[    0.307800] [<ffffffff80c01362>] kernel_init_freeable+0x226/0x2b0
[    0.307807] [<ffffffff80bc3798>] kernel_init+0x1c/0x144
[    0.307813] [<ffffffff8001361c>] ret_from_fork_kernel+0x18/0x164
[    0.307820] [<ffffffff80bcefb6>] ret_from_fork_kernel_asm+0x16/0x18
[    0.307914] Code: 3683 2085 0b63 32f7 000f 0140 6918 4785 0713 0b47 (c31c) 2583
[    0.308041] ---[ end trace 0000000000000000 ]---
[    0.308180] Kernel panic - not syncing: Fatal exception in interrupt
[    0.315760] ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]---
---
 hw/char/Kconfig          |   4 ++
 hw/char/dw8250.c         | 118 +++++++++++++++++++++++++++++++++++++++
 hw/char/meson.build      |   1 +
 include/hw/char/dw8250.h |  27 +++++++++
 4 files changed, 150 insertions(+)
 create mode 100644 hw/char/dw8250.c
 create mode 100644 include/hw/char/dw8250.h
hw/char/Kconfig +4 -0
index 020c0a84bb..418d99b757 100644
@@ -95,3 +95,7 @@ config IP_OCTAL_232
     bool
     default y
     depends on IPACK
+
+config DW8250
+    bool
+    select SERIAL
hw/char/dw8250.c new file +118 -0

118 lines not on this page · raw message

hw/char/meson.build +1 -0
index fc3d7ee506..b2250ee6ae 100644
@@ -38,6 +38,7 @@ system_ss.add(when: 'CONFIG_STM32L4X5_USART', if_true: files('stm32l4x5_usart.c'
 system_ss.add(when: 'CONFIG_MCHP_PFSOC_MMUART', if_true: files('mchp_pfsoc_mmuart.c'))
 system_ss.add(when: 'CONFIG_HTIF', if_true: files('riscv_htif.c'))
 system_ss.add(when: 'CONFIG_GOLDFISH_TTY', if_true: files('goldfish_tty.c'))
+system_ss.add(when: 'CONFIG_DW8250', if_true: files('dw8250.c'))
 
 specific_ss.add(when: 'CONFIG_TERMINAL3270', if_true: files('terminal3270.c'))
 specific_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr_vty.c'))
include/hw/char/dw8250.h new file +27 -0
new file mode 100644
index 0000000000..59396ad202
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Synopsys DesignWare APB UART (DW 8250)
+ *
+ * Copyright (c) 2026 Kuan-Wei Chiu <[email protected]>
+ */
+
+#ifndef HW_CHAR_DW8250_H
+#define HW_CHAR_DW8250_H
+
+#include "hw/core/sysbus.h"
+#include "qom/object.h"
+
+#define TYPE_DW8250 "dw8250"
+OBJECT_DECLARE_SIMPLE_TYPE(DW8250State, DW8250)
+
+struct DW8250State {
+    SysBusDevice parent_obj;
+
+    MemoryRegion container;
+    MemoryRegion ext_iomem;
+    DeviceState *serial_mm;
+
+    uint8_t regshift;
+};
+
+#endif
Signature · 1 line
2.54.0.563.g4f69b47b94-goog
#5 lore raw

RFC PATCH 3/5 hw/misc: Add Sophgo CV1800B clock controller

In reply to Kuan-Wei Chiu

Add a stub for the CV1800B clock controller. This is specifically required for the SDHCI controller to function correctly under Linux.

The Linux 'sophgo,cv1800-clk' driver probes this device to determine the clock tree configuration. This implementation sets the bypass registers (CLK_BYP_0 and CLK_BYP_1) to 0xFFFFFFFF during reset, matching the POR default state. This bypasses the PLLs and allows the SDHCI and other peripherals to operate using the 25MHz reference clock.

Without this device, the SD card driver fails to initialize, preventing the system from mounting the root filesystem from the SD card:

[    0.888739] Waiting for root device /dev/mmcblk0...
[   10.727739] mmc0: Timeout waiting for hardware cmd interrupt.
[   10.728042] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[   10.728356] mmc0: sdhci: Sys addr:  0x00000002 | Version:  0x00002402
[   10.728618] mmc0: sdhci: Blk size:  0x00000000 | Blk cnt:  0x00000000
[   10.728919] mmc0: sdhci: Argument:  0x00000000 | Trn mode: 0x00000000
[   10.729271] mmc0: sdhci: Present:   0x01ff0000 | Host ctl: 0x00000001
[   10.729591] mmc0: sdhci: Power:     0x0000000f | Blk gap:  0x00000000
[   10.729903] mmc0: sdhci: Wake-up:   0x00000000 | Clock:    0x00000000
[   10.730223] mmc0: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
[   10.730537] mmc0: sdhci: Int enab:  0x00ff0083 | Sig enab: 0x00ff0083
[   10.730795] mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[   10.731005] mmc0: sdhci: Caps:      0x056900b9 | Caps_1:   0x00000000
[   10.731211] mmc0: sdhci: Cmd:       0x00000000 | Max curr: 0x00000000
[   10.731415] mmc0: sdhci: Resp[0]:   0x00000000 | Resp[1]:  0x00000000
[   10.731636] mmc0: sdhci: Resp[2]:   0x00000000 | Resp[3]:  0x00000000
[   10.731851] mmc0: sdhci: Host ctl2: 0x00000000
[   10.732018] mmc0: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0x00000000
[   10.732229] mmc0: sdhci: ============================================
---
 hw/misc/Kconfig               |  3 ++
 hw/misc/cv1800b_clk.c         | 89 +++++++++++++++++++++++++++++++++++
 hw/misc/meson.build           |  1 +
 include/hw/misc/cv1800b_clk.h | 24 ++++++++++
 4 files changed, 117 insertions(+)
 create mode 100644 hw/misc/cv1800b_clk.c
 create mode 100644 include/hw/misc/cv1800b_clk.h
hw/misc/Kconfig +3 -0
index 99bdf09219..42cdf771a4 100644
@@ -254,4 +254,7 @@ config IOSB
 config XLNX_VERSAL_TRNG
     bool
 
+config SOPHGO_CV1800B_CLK
+    bool
+
 source macio/Kconfig
hw/misc/cv1800b_clk.c new file +89 -0

89 lines not on this page · raw message

hw/misc/meson.build +1 -0
index 245ab9b98c..a4c5f90cd8 100644
@@ -35,6 +35,7 @@ system_ss.add(when: 'CONFIG_SIFIVE_E_PRCI', if_true: files('sifive_e_prci.c'))
 system_ss.add(when: 'CONFIG_SIFIVE_E_AON', if_true: files('sifive_e_aon.c'))
 system_ss.add(when: 'CONFIG_SIFIVE_U_OTP', if_true: files('sifive_u_otp.c'))
 system_ss.add(when: 'CONFIG_SIFIVE_U_PRCI', if_true: files('sifive_u_prci.c'))
+system_ss.add(when: 'CONFIG_SOPHGO_CV1800B_CLK', if_true: files('cv1800b_clk.c'))
 
 subdir('macio')
 
include/hw/misc/cv1800b_clk.h new file +24 -0
new file mode 100644
index 0000000000..05c0d1ca1b
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Sophgo CV1800B Clock Controller
+ *
+ * Copyright (c) 2026 Kuan-Wei Chiu <[email protected]>
+ */
+
+#ifndef HW_MISC_CV1800B_CLK_H
+#define HW_MISC_CV1800B_CLK_H
+
+#include "hw/core/sysbus.h"
+#include "qom/object.h"
+
+#define TYPE_CV1800B_CLK "cv1800b-clk"
+OBJECT_DECLARE_SIMPLE_TYPE(CV1800BClkState, CV1800B_CLK)
+
+struct CV1800BClkState {
+    SysBusDevice parent_obj;
+
+    MemoryRegion iomem;
+    uint32_t regs[0x1000 / 4];
+};
+
+#endif
Signature · 1 line
2.54.0.563.g4f69b47b94-goog
#6 lore raw

RFC PATCH 4/5 hw/riscv: Add Sophgo CV1800B SoC support

In reply to Kuan-Wei Chiu

Add the Sophgo CV1800B SoC, which is the heart of the Milk-V Duo board.

The SoC features a T-Head C906 CPU along with integrated PLIC, CLINT, and dw8250 UART. The memory map and interrupts are configured according to the CV1800B datasheet. [1]

Several peripheral blocks are included as unimplemented devices to ensure that drivers can probe successfully without causing errors during boot.

---
 hw/riscv/Kconfig           |   8 ++
 hw/riscv/cv1800b.c         | 168 +++++++++++++++++++++++++++++++++++++
 hw/riscv/meson.build       |   2 +
 include/hw/riscv/cv1800b.h |  52 ++++++++++++
 4 files changed, 230 insertions(+)
 create mode 100644 hw/riscv/cv1800b.c
 create mode 100644 include/hw/riscv/cv1800b.h
hw/riscv/Kconfig +8 -0
index 2518b04175..5b68991edb 100644
@@ -138,3 +138,11 @@ config MIPS_BOSTON_AIA
     select RISCV_MIPS_CMGCR
     select RISCV_MIPS_CPC
     select RISCV_MIPS_CPS
+
+config SOPHGO_CV1800B
+    bool
+    depends on RISCV64
+    select RISCV_ACLINT
+    select SIFIVE_PLIC
+    select SOPHGO_CV1800B_CLK
+    select DW8250
hw/riscv/cv1800b.c new file +168 -0

168 lines not on this page · raw message

hw/riscv/meson.build +2 -0
index 533472e22a..04e25eeece 100644
@@ -18,4 +18,6 @@ riscv_ss.add(when: 'CONFIG_XIANGSHAN_KUNMINGHU', if_true: files('xiangshan_kmh.c
 riscv_ss.add(when: 'CONFIG_RISCV_MIPS_CPS', if_true: files('cps.c'))
 riscv_ss.add(when: 'CONFIG_MIPS_BOSTON_AIA', if_true: files('boston-aia.c'))
 
+riscv_ss.add(when: 'CONFIG_SOPHGO_CV1800B', if_true: files('cv1800b.c'))
+
 hw_arch += {'riscv': riscv_ss}
include/hw/riscv/cv1800b.h new file +52 -0

52 lines not on this page · raw message

Signature · 1 line
2.54.0.563.g4f69b47b94-goog
#7 lore raw

RFC PATCH 5/5 hw/riscv: Add Milk-V Duo board support

In reply to Kuan-Wei Chiu

Add support for the Milk-V Duo development board, which is powered by the Sophgo CV1800B SoC.

The implementation includes:
- Board-level machine initialization with 64mb of default ram.
- Integration of the CV1800B SoC.
- Support for loading external FDT, kernel, and initrd images.
- Proper setup of the reset vector to match the CV1800B's boot flow.

---
 MAINTAINERS                                 |  11 ++
 configs/devices/riscv64-softmmu/default.mak |   1 +
 hw/riscv/Kconfig                            |   6 +
 hw/riscv/meson.build                        |   1 +
 hw/riscv/milkv_duo.c                        | 122 ++++++++++++++++++++
 5 files changed, 141 insertions(+)
 create mode 100644 hw/riscv/milkv_duo.c
MAINTAINERS +11 -0
index afa178c5cc..2e729098d0 100644
@@ -1780,6 +1780,17 @@ F: docs/system/riscv/xiangshan-kunminghu.rst
 F: hw/riscv/xiangshan_kmh.c
 F: include/hw/riscv/xiangshan_kmh.h
 
+Milk-V Duo
+M: Kuan-Wei Chiu <[email protected]>
+S: Maintained
+F: hw/riscv/cv1800b.c
+F: hw/riscv/milkv_duo.c
+F: include/hw/riscv/cv1800b.h
+F: hw/misc/cv1800b_clk.c
+F: include/hw/misc/cv1800b_clk.h
+F: hw/char/dw8250.c
+F: include/hw/char/dw8250.h
+
 RX Machines
 -----------
 rx-gdbsim
configs/devices/riscv64-softmmu/default.mak +1 -0
index a8e4d0ab33..2ba91b14d4 100644
@@ -13,3 +13,4 @@
 # CONFIG_SHAKTI_C=n
 # CONFIG_XIANGSHAN_KUNMINGHU=n
 # CONFIG_MIPS_BOSTON_AIA=n
+# CONFIG_MILKV_DUO=n
hw/riscv/Kconfig +6 -0
index 5b68991edb..8615b1cc3e 100644
@@ -146,3 +146,9 @@ config SOPHGO_CV1800B
     select SIFIVE_PLIC
     select SOPHGO_CV1800B_CLK
     select DW8250
+
+config MILKV_DUO
+    bool
+    depends on RISCV64
+    default y
+    select SOPHGO_CV1800B
hw/riscv/meson.build +1 -0
index 04e25eeece..19a0bf8e5b 100644
@@ -19,5 +19,6 @@ riscv_ss.add(when: 'CONFIG_RISCV_MIPS_CPS', if_true: files('cps.c'))
 riscv_ss.add(when: 'CONFIG_MIPS_BOSTON_AIA', if_true: files('boston-aia.c'))
 
 riscv_ss.add(when: 'CONFIG_SOPHGO_CV1800B', if_true: files('cv1800b.c'))
+riscv_ss.add(when: 'CONFIG_MILKV_DUO', if_true: files('milkv_duo.c'))
 
 hw_arch += {'riscv': riscv_ss}
hw/riscv/milkv_duo.c new file +122 -0

122 lines not on this page · raw message

Signature · 1 line
2.54.0.563.g4f69b47b94-goog
#8 lore raw
In reply to Kuan-Wei Chiu
Quoted 6 lines · Kuan-Wei Chiu

Add initial support for the Milk-V Duo board.

This is something I've been playing around with in my local branch, and I've reached a point where the implementation is enough to boot OpenSBI and reach a Linux shell using an SD card image.

Great job!

Quoted 5 lines

I am sending this as an RFC to get early feedback to understand the gap between this minimal implementation and what is required for a upstream merge. I plan to continue implementing missing blocks (like gpio and clk/rst) in future.

Overall this looks good and is going in the right direction. Being able to boot Linux is a great start and a good achievement.

This could be submitted now, there is no requirement to add extra functionality to upstream it. It would be great if you could add some unit tests as well, so then we can test this as part of the QEMU CI.

Alistair

#9 lore raw

Hi Alistair,

Quoted 16 lines · Alistair Francis
Quoted 6 lines · Kuan-Wei Chiu

Add initial support for the Milk-V Duo board.

This is something I've been playing around with in my local branch, and I've reached a point where the implementation is enough to boot OpenSBI and reach a Linux shell using an SD card image.

Great job!

Quoted 5 lines

I am sending this as an RFC to get early feedback to understand the gap between this minimal implementation and what is required for a upstream merge. I plan to continue implementing missing blocks (like gpio and clk/rst) in future.

Quoted 7 lines

Overall this looks good and is going in the right direction. Being able to boot Linux is a great start and a good achievement.

This could be submitted now, there is no requirement to add extra functionality to upstream it. It would be great if you could add some unit tests as well, so then we can test this as part of the QEMU CI.

Thanks for the prompt response and the review!
I'll try to add some tests and send out as v2.

Regards,
Kuan-Wei