Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bo Gan <ganboing@gmail.com>
To: Guodong Xu <guodong@riscstar.com>,
	Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
	Conor Dooley <conor@kernel.org>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Kevin Meng Zhang <zhangmeng.kevin@linux.spacemit.com>,
	devicetree@vger.kernel.org, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org, spacemit@lists.linux.dev,
	linux-serial@vger.kernel.org, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>, Yixun Lan <dlan@gentoo.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Samuel Holland <samuel.holland@sifive.com>,
	Anup Patel <anup@brainfault.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Lubomir Rintel <lkundrak@v3.sk>, Yangyu Chen <cyy@cyyself.name>
Subject: Re: [PATCH 8/8] riscv: dts: spacemit: add SpacemiT K3 Pico-ITX board device tree
Date: Wed, 17 Dec 2025 01:04:27 -0800	[thread overview]
Message-ID: <e5d92ecd-6bc1-438d-87ec-96f60d1b8a24@gmail.com> (raw)
In-Reply-To: <CAH1PCMbzv_uggyZ3JLPyWXSwbe2dJAh7jVT64xpM6SLG77VZqQ@mail.gmail.com>

Hi Guodong,

On 12/16/25 23:13, Guodong Xu wrote:
> On Tue, Dec 16, 2025 at 10:33 PM Heinrich Schuchardt
> <heinrich.schuchardt@canonical.com> wrote:
>>
>> On 12/16/25 14:32, Guodong Xu wrote:
>>> K3 Pico-ITX is a 2.5-inch single-board computer equipted with a SpacemiT
>>> K3 SoC.
>>>
>>> This minimal device tree enables booting into a serial console with UART
>>> output.
>>>
>>> Signed-off-by: Guodong Xu <guodong@riscstar.com>
>>> ---
>>>    arch/riscv/boot/dts/spacemit/Makefile        |  1 +
>>>    arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 25 +++++++++++++++++++++++++
>>>    2 files changed, 26 insertions(+)
>>>
>>> diff --git a/arch/riscv/boot/dts/spacemit/Makefile b/arch/riscv/boot/dts/spacemit/Makefile
>>> index 95889e7269d1bae679b28cd053e1b0a23ae6de68..7e2b877025718113a0e31917eadf7562f488d825 100644
>>> --- a/arch/riscv/boot/dts/spacemit/Makefile
>>> +++ b/arch/riscv/boot/dts/spacemit/Makefile
>>> @@ -4,3 +4,4 @@ dtb-$(CONFIG_ARCH_SPACEMIT) += k1-milkv-jupiter.dtb
>>>    dtb-$(CONFIG_ARCH_SPACEMIT) += k1-musepi-pro.dtb
>>>    dtb-$(CONFIG_ARCH_SPACEMIT) += k1-orangepi-r2s.dtb
>>>    dtb-$(CONFIG_ARCH_SPACEMIT) += k1-orangepi-rv2.dtb
>>> +dtb-$(CONFIG_ARCH_SPACEMIT) += k3-pico-itx.dtb
>>> diff --git a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
>>> new file mode 100644
>>> index 0000000000000000000000000000000000000000..0f9d04dd352f5331e82599285113b86af5b09ebe
>>> --- /dev/null
>>> +++ b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
>>> @@ -0,0 +1,25 @@
>>> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
>>> +/*
>>> + * Copyright (c) 2025 SpacemiT (Hangzhou) Technology Co. Ltd
>>> + * Copyright (c) 2025 Guodong Xu <guodong@riscstar.com>
>>> + */
>>> +
>>> +#include "k3.dtsi"
>>> +
>>> +/ {
>>> +     model = "SpacemiT K3 Pico-ITX";
>>> +     compatible = "spacemit,k3-pico-itx", "spacemit,k3";
>>> +
>>> +     chosen {
>>> +             stdout-path = "serial0";
>>> +     };
>>> +
>>> +     memory@100200000 {
>>> +             device_type = "memory";
>>> +             reg = <0x1 0x00200000 0x3 0xffe00000>;
>>
>> Shouldn't the reserved memory be described as no-map /reserved-memory
>> nodes instead?
> 
> Hi Heinrich,
> 
> Yes, you are right. Using a reserved-memory node with the no-map property is
> the correct approach. I will update this in the next version to explicitly
> reserve the first 2MB.
> 
>>
>> I would assume that 0x1,0000,0000 is the location of OpenSBI.
>> What is at 0x3,ffe0,0000?
> 
> Yes, confirmed, 0x100000000 is the start of OpenSBI. The size 0x3ffe00000 in
> my original patch was the result of manually subtracting the 2MB OpenSBI
> offset from the total 16GB memory.
> 
> I will correct this in v2 to show the actual memory and put the first 2MB in
> reserved-memory {} for opensbi.

I don't think this is the right approach. The Linux kernel shouldn't care
about the size of the underlying SBI implementation. The size of OpenSBI
also depends on the version and features enabled. Thus, you should just
let the OpenSBI or whatever SBI fix up the device-tree for you. OpenSBI
already does that today. It inserts one or more reserved-memory node and
carves out the memory region of its own. If there's some bootloader in
between SBI <-> Linux, such as U-boot, then it's responsible for copying
over those reserved regions from OpenSBI into the device-tree Linux uses
(U-boot already does). Thus, there's no need to manually specify it.

Bo

> 
> Thanks for the review.
> 
> BR,
> Guodong Xu
> 
> 
>>
>> Best regards
>>
>> Heinrich
>>
>>> +     };
>>> +};
>>> +
>>> +&uart0 {
>>> +     status = "okay";
>>> +};
>>>
>>
>

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2025-12-17  9:06 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-16 13:32 [PATCH 0/8] riscv: spacemit: Add SpacemiT K3 SoC and K3 Pico-ITX board Guodong Xu
2025-12-16 13:32 ` [PATCH 1/8] dt-bindings: riscv: add SpacemiT X100 CPU compatible Guodong Xu
2025-12-16 14:08   ` Heinrich Schuchardt
2025-12-16 15:07   ` Yixun Lan
2025-12-17  2:06     ` Guodong Xu
2025-12-16 15:16   ` Yixun Lan
2025-12-17  3:38     ` Guodong Xu
2025-12-16 15:33   ` Krzysztof Kozlowski
2025-12-17  1:54     ` Guodong Xu
2025-12-16 13:32 ` [PATCH 2/8] dt-bindings: timer: add SpacemiT K3 CLINT Guodong Xu
2025-12-16 16:40   ` Conor Dooley
2025-12-16 13:32 ` [PATCH 3/8] dt-bindings: interrupt-controller: add SpacemiT K3 APLIC Guodong Xu
2025-12-16 16:40   ` Conor Dooley
2025-12-16 13:32 ` [PATCH 4/8] dt-bindings: interrupt-controller: add SpacemiT K3 IMSIC Guodong Xu
2025-12-16 15:33   ` Krzysztof Kozlowski
2025-12-17  3:48     ` Guodong Xu
2025-12-16 13:32 ` [PATCH 5/8] dt-bindings: serial: 8250: add SpacemiT K3 UART compatible Guodong Xu
2025-12-16 16:41   ` Conor Dooley
2025-12-16 13:32 ` [PATCH 6/8] dt-bindings: riscv: spacemit: add K3 and Pico-ITX board bindings Guodong Xu
2025-12-16 15:05   ` Yixun Lan
2025-12-16 16:33     ` Conor Dooley
2025-12-17  1:23       ` Guodong Xu
2025-12-16 13:32 ` [PATCH 7/8] riscv: dts: spacemit: add initial device tree of SpacemiT K3 SoC Guodong Xu
2025-12-16 14:24   ` Heinrich Schuchardt
2025-12-17  7:11     ` Guodong Xu
2025-12-17  8:07       ` Heinrich Schuchardt
2025-12-18  0:56         ` Conor Dooley
2025-12-19  2:03           ` Guodong Xu
2025-12-19  8:08             ` Heinrich Schuchardt
2025-12-20  2:48             ` Yao Zi
2025-12-22  9:27               ` Guodong Xu
2025-12-20 23:23             ` Conor Dooley
2025-12-21  0:10               ` Heinrich Schuchardt
2025-12-22 10:32                 ` Guodong Xu
2025-12-22 20:36                 ` Conor Dooley
2025-12-26  6:53                   ` Guodong Xu
2026-01-01  0:24                     ` Conor Dooley
2026-01-08 19:23                   ` Samuel Holland
2025-12-16 15:35   ` Krzysztof Kozlowski
2025-12-17  5:39     ` Guodong Xu
2025-12-16 13:32 ` [PATCH 8/8] riscv: dts: spacemit: add SpacemiT K3 Pico-ITX board device tree Guodong Xu
2025-12-16 14:33   ` Heinrich Schuchardt
2025-12-17  7:13     ` Guodong Xu
2025-12-17  9:04       ` Bo Gan [this message]
2025-12-18 22:43         ` Guodong Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e5d92ecd-6bc1-438d-87ec-96f60d1b8a24@gmail.com \
    --to=ganboing@gmail.com \
    --cc=alex@ghiti.fr \
    --cc=anup@brainfault.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor+dt@kernel.org \
    --cc=conor@kernel.org \
    --cc=cyy@cyyself.name \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlan@gentoo.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=guodong@riscstar.com \
    --cc=heinrich.schuchardt@canonical.com \
    --cc=jirislaby@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=lkundrak@v3.sk \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=pjw@kernel.org \
    --cc=robh@kernel.org \
    --cc=samuel.holland@sifive.com \
    --cc=spacemit@lists.linux.dev \
    --cc=tglx@linutronix.de \
    --cc=xypron.glpk@gmx.de \
    --cc=zhangmeng.kevin@linux.spacemit.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox