* [PATCH 0/2] Do not reserve memory for coprocessor FW
@ 2026-09-21 15:08 Andrei Lalaev
2026-09-21 15:08 ` [PATCH 1/2] riscv: dts: sophgo: cv1800b-milkv-duo: drop reserved memory node Andrei Lalaev
2026-09-21 15:09 ` [PATCH 2/2] riscv: dts: sophgo: sg2002-milkv-duo256m: " Andrei Lalaev
0 siblings, 2 replies; 4+ messages in thread
From: Andrei Lalaev @ 2026-09-21 15:08 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen Wang,
Inochi Amaoto, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, Yao Zi
Cc: devicetree, linux-riscv, sophgo, linux-kernel, Andrei Lalaev
Milk-V Duo and Duo-256M reserve a region for coprocessor FW at
the end of RAM. It is not correct because:
- FSBL can be configured to load FW into a different region
- if no firmware is loaded, the reserved memory is wasted
As explained in [1, 2], FSBL should reserve the region at runtime.
The latest FSBL can boot the system without coprocessor FW:
FSBL Jb2829:g6f8962c394dd-dirty:2026-09-20T13:04:17+00:00
st_on_reason=d0000
st_off_reason=0
P2S/0x1000/0xc00fa00.
SD/0xaa00/0x1000/0x1000/0.P2E.
cv181x DDR init.
ddr_param[0]=0x0.
pkg_type=5
D1_3_2
DDR3-2G-QFN
Data rate=1866.
DDR BIST PASS
PLLS.
PLLE.
C2S/0x0/0x0/0x0.
No C906L image.
MS/0xba00/0x80000000/0x43e00.
SD/0xba00/0x43e00/0x43e00/0.ME.
L2/0x4f800.
SD/0x4f800/0x200/0x200/0.L2/0x33334c42/0xcafe4b49/0x80200000/0x8c200/0x8c200
SD/0x4f800/0x8c200/0x8c200/0.sys_switch_all_to_pll...
Loader_2nd loaded.
Use internal 32k
So it is safe to remove `coprocessor_rtos` nodes.
[1]: https://lore.kernel.org/sophgo/6e4b5c98-7d48-4629-a6a0-4d930327f9a0@sifive.com/
[2]: https://lore.kernel.org/sophgo/aqrhRic7Ww6fPhxg@pie/
Signed-off-by: Andrei Lalaev <andrey.lalaev@gmail.com>
---
Andrei Lalaev (2):
riscv: dts: sophgo: cv1800b-milkv-duo: drop reserved memory node
riscv: dts: sophgo: sg2002-milkv-duo256m: drop reserved memory node
arch/riscv/boot/dts/sophgo/cv1800b-milkv-duo.dts | 11 -----------
arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts | 11 -----------
2 files changed, 22 deletions(-)
---
base-commit: 93f51579e7df248780214094418f205253383cc5
change-id: 20260921-sophgo-remove-coprocessor-node-4e6c59ab58d2
Best regards,
--
Andrei Lalaev <andrey.lalaev@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 1/2] riscv: dts: sophgo: cv1800b-milkv-duo: drop reserved memory node
2026-09-21 15:08 [PATCH 0/2] Do not reserve memory for coprocessor FW Andrei Lalaev
@ 2026-09-21 15:08 ` Andrei Lalaev
2026-09-21 15:09 ` [PATCH 2/2] riscv: dts: sophgo: sg2002-milkv-duo256m: " Andrei Lalaev
1 sibling, 0 replies; 4+ messages in thread
From: Andrei Lalaev @ 2026-09-21 15:08 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen Wang,
Inochi Amaoto, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, Yao Zi
Cc: devicetree, linux-riscv, sophgo, linux-kernel, Andrei Lalaev
The current FSBL can load firmware to any address and can also
disable the coprocessor. Therefore, FSBL should modify the device
tree at runtime. Remove the node accordingly.
Signed-off-by: Andrei Lalaev <andrey.lalaev@gmail.com>
---
arch/riscv/boot/dts/sophgo/cv1800b-milkv-duo.dts | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/arch/riscv/boot/dts/sophgo/cv1800b-milkv-duo.dts b/arch/riscv/boot/dts/sophgo/cv1800b-milkv-duo.dts
index 0e6d79e6e3a4..02848bae2e16 100644
--- a/arch/riscv/boot/dts/sophgo/cv1800b-milkv-duo.dts
+++ b/arch/riscv/boot/dts/sophgo/cv1800b-milkv-duo.dts
@@ -22,17 +22,6 @@ aliases {
chosen {
stdout-path = "serial0:115200n8";
};
-
- reserved-memory {
- #address-cells = <1>;
- #size-cells = <1>;
- ranges;
-
- coprocessor_rtos: region@83f40000 {
- reg = <0x83f40000 0xc0000>;
- no-map;
- };
- };
};
&osc {
--
2.55.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 2/2] riscv: dts: sophgo: sg2002-milkv-duo256m: drop reserved memory node
2026-09-21 15:08 [PATCH 0/2] Do not reserve memory for coprocessor FW Andrei Lalaev
2026-09-21 15:08 ` [PATCH 1/2] riscv: dts: sophgo: cv1800b-milkv-duo: drop reserved memory node Andrei Lalaev
@ 2026-09-21 15:09 ` Andrei Lalaev
2026-09-21 15:15 ` sashiko-bot
1 sibling, 1 reply; 4+ messages in thread
From: Andrei Lalaev @ 2026-09-21 15:09 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen Wang,
Inochi Amaoto, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, Yao Zi
Cc: devicetree, linux-riscv, sophgo, linux-kernel, Andrei Lalaev
The current FSBL can load firmware to any address and can also
disable the coprocessor. Therefore, FSBL should modify the device
tree at runtime. Remove the node accordingly.
Signed-off-by: Andrei Lalaev <andrey.lalaev@gmail.com>
---
arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts b/arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts
index a2797c0bd767..d4e86c15664e 100644
--- a/arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts
+++ b/arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts
@@ -36,17 +36,6 @@ led-0 {
linux,default-trigger = "heartbeat";
};
};
-
- reserved-memory {
- #address-cells = <1>;
- #size-cells = <1>;
- ranges;
-
- coprocessor_rtos: region@8fe00000 {
- reg = <0x8fe00000 0x200000>;
- no-map;
- };
- };
};
&osc {
--
2.55.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 2/2] riscv: dts: sophgo: sg2002-milkv-duo256m: drop reserved memory node
2026-09-21 15:09 ` [PATCH 2/2] riscv: dts: sophgo: sg2002-milkv-duo256m: " Andrei Lalaev
@ 2026-09-21 15:15 ` sashiko-bot
0 siblings, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-09-21 15:15 UTC (permalink / raw)
To: Andrei Lalaev; +Cc: conor+dt, robh, devicetree
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Critical] dts: ABI breakage by dropping coprocessor reserved-memory node
--
commit fa1a6e529f0f63c13f25ecb8772efefbd481942e
Author: Andrei Lalaev <andrey.lalaev@gmail.com>
riscv: dts: sophgo: sg2002-milkv-duo256m: drop reserved memory node
This commit drops the reserved-memory node for the coprocessor from the
sg2002-milkv-duo256m device tree. The change is based on the premise that
the current FSBL handles this dynamically at runtime.
> diff --git a/arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts b/arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts
> index a2797c0bd7671..d4e86c15664e6 100644
> --- a/arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts
> +++ b/arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts
> @@ -36,17 +36,6 @@ led-0 {
> linux,default-trigger = "heartbeat";
> };
> };
> -
> - reserved-memory {
> - #address-cells = <1>;
> - #size-cells = <1>;
> - ranges;
> -
> - coprocessor_rtos: region@8fe00000 {
> - reg = <0x8fe00000 0x200000>;
> - no-map;
> - };
> - };
[Severity: Critical]
Does removing this static fallback node introduce a regression for systems
using an older bootloader?
While newer FSBLs might dynamically inject or update the reserved-memory
node, older FSBLs rely on this static reservation in the device tree. Without
the no-map property for 0x8fe00000, will the kernel treat the 2MB coprocessor
region as general-purpose RAM, since it falls within the standard memory
space?
This could lead to memory corruption if Linux and the active coprocessor
overwrite each other's memory when users upgrade their kernel and device
tree without also upgrading their bootloader, breaking the standard backward
compatibility contract.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260921-sophgo-remove-coprocessor-node-v1-0-ace29446b327@gmail.com?part=2
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-21 15:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-21 15:08 [PATCH 0/2] Do not reserve memory for coprocessor FW Andrei Lalaev
2026-09-21 15:08 ` [PATCH 1/2] riscv: dts: sophgo: cv1800b-milkv-duo: drop reserved memory node Andrei Lalaev
2026-09-21 15:09 ` [PATCH 2/2] riscv: dts: sophgo: sg2002-milkv-duo256m: " Andrei Lalaev
2026-09-21 15:15 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox