From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90669340DA5 for ; Wed, 17 Dec 2025 09:06:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765962385; cv=none; b=kIMAOwHESQPf+LTGt9nbsLWhezk38tcNbgTdUA0/BTUr3gwKPgLsfXzu6ttE8dSegBaxBd2reMtVdx9pQsIVQMgun9rtou5GkZTOBxB0Ai6pk9mX1ojoIKXtGJe3Zt1Xlm+byZCc83uY16Wj3i1+2aUUDVfs3/wt+IkkfWpzG44= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765962385; c=relaxed/simple; bh=Z0lMYo5+NJ79AHAUbnTNntH5jebkTrZggk5FVdEzBq0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Yk5vdqJ+UBedVcYevg9eyMJvsFjh+h/iK4fyHjOo9Lzw/A9hRHS3GYh1LIV5m8quMy8VYY5pPW1mVlhF3AXEVat3yszj3qE2wU3fg33tieUiRGaVHQE3k77ALpIsp/wJf6Kk64ulpctjOe+m/tqBSop8QTDCShVp5oX259bQM2c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=B7BlFVrh; arc=none smtp.client-ip=209.85.216.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B7BlFVrh" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-34c1d98ba11so5134954a91.3 for ; Wed, 17 Dec 2025 01:06:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765962383; x=1766567183; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=g1VRWjeuH/kViMmS59iXj3V5sEFdHUh9qPFuC/Iijp4=; b=B7BlFVrhMI4D0POPuexZtxAwJHNEmgOYYu7BRI4K5mWSCmUlzdfTMUX7E45DwF+klC ptSOONI96qFQesWjKvCU4ripnqrvEPpJ63/bFAe50vn18y+wfnWuGPL3ImtmQJw7jcti K+RneF5ogEBuBYOQqxFEOrB7YXsQEAHU3QHTAN109phcn5qDr8nu66IJZomjBQz71Fal 3MeAyTO+Myvrj2aeePVgSrbiWeqL2MP7Zv/B0ltJALz7a0TEmmq3NpAScmVqtR+xUSMe aCZ/FtWKttkzOkUC4nFrF0sLoV0281BJ9lGVtYhpR0ZIAShMu8SO0flS1Gy/wUAcK/L1 klEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765962383; x=1766567183; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=g1VRWjeuH/kViMmS59iXj3V5sEFdHUh9qPFuC/Iijp4=; b=mtG7AZmTYurKTuzlruH0SjGpTB8UnA+qNBx2DVJlCOKNTG9qxOWUMvOozdkrkAzl0d o1V5nAtMnWTVB+CzhwkJRI+fl4apg+F2u22zwRPL6uznj7dp5aKi0+UrwUcCbt6ZPZxf pa0YedmrrwFZCuN3APNv6BL76TGDMT+XTbU70qxKs7uog8APDQ2TKiBGiU1GerN1Oray LS9A4+qRm+iojL9dy2Vj8JkTO7Ofdoh6E8EjaYj39kBTvjbap9UQ3CNOxA42A0gfPDFF QgN4w/vs3fP/voe+FPw9K5TjBuOklCOeWXaAZcAVRezv+HMQhhqyJPg4jWdfCmMcnTkp V9JQ== X-Forwarded-Encrypted: i=1; AJvYcCUaMM0i4pvETczCoFeyZvsmYgaEMwFcwY16b9UBJIvGbKqFDBRaQ9mwclz97JTLW3Wz0wRVthjDu8SnMyg=@vger.kernel.org X-Gm-Message-State: AOJu0Yz+Syq0UUC2Ggnbi6FF+yTTrDe8ffo8iNKXm0Uf4Dv4ANoLvWmB 3gqNG2NmHkNVLvqUlFUFu8oAB/44AZA2HRlHf4cerDXz4CdDE8ZbpCg0 X-Gm-Gg: AY/fxX5pUb7M+Tp6jNC2jx1EDz7JPGcMamdCG5PN3AjCfb6qnEoYbjHDbie4gpVEgUq 0ENM0hbo6+5mwEFcRTNbu76qkIUsVw8ZhxPfPskA9lhTgFWsZ4+8r9+Pv4gXVjyaX+HOeiw/Uoz oUQDUwVkHl4MqCxeuWQ+ShqiMPPC2P3NaX2wQcxOwwgsI0rIpmptIa4uvLnbxLofqrNusRBR3WA 75RvZzzmzBBnrrw6tO4+Az19hIWiJdSA4hDHIZ4n9xU/YnG9+mSeey/zv6pl7SSvj7MTR3Qj0pO yBMQN7oPnCo40WJfbWez3BcM8xotVpIGIfbKV0Tq5zl7FcSEwMeZwQWzVES6TqmO6t2BiKGB/1O y0j5Uo0FL402INu8WQLSqACzrfFbckJTmvECleHpHLACc6JbTH34M7mnDHhcbnChUIWidwzmaTr LpYEw42LqnlN0C X-Google-Smtp-Source: AGHT+IE6PfmxAkj5HlkxzkJmnrwLpLmQDasxQXTlueI2ut1ZFaSRcM/T3o7RF88n/l5r5DOiJzvQyA== X-Received: by 2002:a17:90b:3f85:b0:330:6d5e:f174 with SMTP id 98e67ed59e1d1-34abd751aa3mr16360133a91.20.1765962382751; Wed, 17 Dec 2025 01:06:22 -0800 (PST) Received: from [192.168.0.13] ([172.92.174.155]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7fcbc0be691sm2048570b3a.58.2025.12.17.01.06.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Dec 2025 01:06:22 -0800 (PST) Message-ID: Date: Wed, 17 Dec 2025 01:04:27 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 8/8] riscv: dts: spacemit: add SpacemiT K3 Pico-ITX board device tree To: Guodong Xu , Heinrich Schuchardt Cc: Paul Walmsley , Conor Dooley , Heinrich Schuchardt , Kevin Meng Zhang , 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 , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Yixun Lan , Daniel Lezcano , Thomas Gleixner , Samuel Holland , Anup Patel , Greg Kroah-Hartman , Jiri Slaby , Lubomir Rintel , Yangyu Chen References: <20251216-k3-basic-dt-v1-0-a0d256c9dc92@riscstar.com> <20251216-k3-basic-dt-v1-8-a0d256c9dc92@riscstar.com> <3c38ce9c-4259-4149-bf2c-a54e74c00a34@canonical.com> Content-Language: en-US From: Bo Gan In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Guodong, On 12/16/25 23:13, Guodong Xu wrote: > On Tue, Dec 16, 2025 at 10:33 PM Heinrich Schuchardt > 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 >>> --- >>> 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 >>> + */ >>> + >>> +#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"; >>> +}; >>> >> >