Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Alexander Sverdlin <alexander.sverdlin@gmail.com>,
	Inochi Amaoto <inochiama@gmail.com>,
	soc@lists.linux.dev
Cc: Chen Wang <unicorn_wang@outlook.com>,
	Inochi Amaoto <inochiama@outlook.com>,
	linux-riscv@lists.infradead.org, devicetree@vger.kernel.org,
	Haylen Chu <heylenay@outlook.com>,
	linux-arm-kernel@lists.infradead.org,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>, Arnd Bergmann <arnd@arndb.de>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jisheng Zhang <jszhang@kernel.org>,
	Chao Wei <chao.wei@sophgo.com>
Subject: Re: [PATCH v2 1/7] riscv: dts: sophgo: cv18xx: Move RiscV-specific part into SoCs' .dtsi files
Date: Wed, 12 Feb 2025 17:46:12 +0100	[thread overview]
Message-ID: <33654180-5488-4601-9103-8e4218c4a198@kernel.org> (raw)
In-Reply-To: <708cdc497b8474609989395dbf8a0898037a22de.camel@gmail.com>

On 12/02/2025 10:26, Alexander Sverdlin wrote:
> Hi Inochi, Krzysztof,
> 
> On Wed, 2025-02-12 at 08:31 +0800, Inochi Amaoto wrote:
>> On Mon, Feb 10, 2025 at 11:09:41PM +0100, Alexander Sverdlin wrote:
>>> Make the peripheral device tree re-usable on ARM64 platform by moving CPU
>>> core and interrupt controllers' parts into the respective per-SoC .dtsi
>>> files.
>>>
>>> Add SOC_PERIPHERAL_IRQ() macro which explicitly maps peripheral nubering
>>> into "plic" interrupt-controller numbering.
>>>
>>> Have a nice refactoring side-effect that "plic" and "clint" "compatible"
>>> property is not specified outside of the corresponding device itself.
>>>
>>> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
>>> ---
>>> Changelog:
>>> v2:
>>> - instead of carving out peripherals' part, carve out ARCH-specifics (CPU
>>> core, interrupt controllers) and spread them among 3 SoC .dtsi files which
>>> included cv18xx.dtsi;
>>> - define a label for the "soc" node and use it in the newly introduced DTs;
>>>
>>>  arch/riscv/boot/dts/sophgo/cv1800b.dtsi    | 64 ++++++++++++---
>>>  arch/riscv/boot/dts/sophgo/cv1812h.dtsi    | 64 ++++++++++++---
>>>  arch/riscv/boot/dts/sophgo/cv181x.dtsi     |  2 +-
>>>  arch/riscv/boot/dts/sophgo/cv18xx-cpu.dtsi | 57 ++++++++++++++
>>>  arch/riscv/boot/dts/sophgo/cv18xx.dtsi     | 91 ++++++----------------
>>>  arch/riscv/boot/dts/sophgo/sg2002.dtsi     | 64 ++++++++++++---
>>>  6 files changed, 240 insertions(+), 102 deletions(-)
>>>  create mode 100644 arch/riscv/boot/dts/sophgo/cv18xx-cpu.dtsi
>>>
>>> diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi
>>> index aa1f5df100f0..eef2884b36f9 100644
>>> --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi
>>> +++ b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi
>>> @@ -3,6 +3,8 @@
>>>   * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org>
>>>   */
>>>  
>>> +#define SOC_PERIPHERAL_IRQ(nr)	((nr) + 16)
>>> +
>>>  #include <dt-bindings/pinctrl/pinctrl-cv1800b.h>
>>>  #include "cv18xx.dtsi"
>>>  
>>> @@ -14,22 +16,62 @@ memory@80000000 {
>>>  		reg = <0x80000000 0x4000000>;
>>>  	};
>>>  
>>
>>> -	soc {
>>> -		pinctrl: pinctrl@3001000 {
>>> -			compatible = "sophgo,cv1800b-pinctrl";
>>> -			reg = <0x03001000 0x1000>,
>>> -			      <0x05027000 0x1000>;
>>> -			reg-names = "sys", "rtc";
>>
>>
>>> +	cpus: cpus {
>>> +		#address-cells = <1>;
>>> +		#size-cells = <0>;
>>> +		timebase-frequency = <25000000>;
>>> +
>>> +		cpu0: cpu@0 {
>>> +			compatible = "thead,c906", "riscv";
>>> +			device_type = "cpu";
>>> +			reg = <0>;
>>> +			d-cache-block-size = <64>;
>>> +			d-cache-sets = <512>;
>>> +			d-cache-size = <65536>;
>>> +			i-cache-block-size = <64>;
>>> +			i-cache-sets = <128>;
>>> +			i-cache-size = <32768>;
>>> +			mmu-type = "riscv,sv39";
>>> +			riscv,isa = "rv64imafdc";
>>> +			riscv,isa-base = "rv64i";
>>> +			riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicntr", "zicsr",
>>> +					       "zifencei", "zihpm";
>>> +
>>> +			cpu0_intc: interrupt-controller {
>>> +				compatible = "riscv,cpu-intc";
>>> +				interrupt-controller;
>>> +				#interrupt-cells = <1>;
>>> +			};
>>>  		};
>>>  	};
>>>  };
>>
>> Make all soc definition include the common cpu file. 
>> Not just copy it.
> 
> I was acting according to Krzysztof's suggestion:
> https://lore.kernel.org/soc/d3ba0ea5-0491-42d5-a18e-64cf21df696c@kernel.org/
> 
> Krzysztof, I can name the file cv18xx-cpu-intc.dtsi and pack CPU core + interrupt
> controllers into it. Would it make sense?


I don't understand the original suggestion.

Inochi, please trim unnecessary context from replies.

Best regards,
Krzysztof

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

  reply	other threads:[~2025-02-12 17:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-10 22:09 [PATCH v2 0/7] arm64 support for Milk-V Duo Module 01 EVB Alexander Sverdlin
2025-02-10 22:09 ` [PATCH v2 1/7] riscv: dts: sophgo: cv18xx: Move RiscV-specific part into SoCs' .dtsi files Alexander Sverdlin
2025-02-12  0:31   ` Inochi Amaoto
2025-02-12  9:26     ` Alexander Sverdlin
2025-02-12 16:46       ` Krzysztof Kozlowski [this message]
2025-02-12 17:44         ` Alexander Sverdlin
2025-02-12 19:24           ` Krzysztof Kozlowski
2025-02-12 22:32             ` Inochi Amaoto
2025-02-12 22:31           ` Inochi Amaoto
2025-02-10 22:09 ` [PATCH v2 2/7] dt-bindings: soc: sophgo: Move SoCs/boards from riscv into soc, add SG2000 Alexander Sverdlin
2025-02-11  1:29   ` Chen Wang
2025-02-11 18:18   ` Conor Dooley
2025-02-10 22:09 ` [PATCH v2 3/7] arm64: dts: sophgo: Add initial SG2000 SoC device tree Alexander Sverdlin
2025-02-10 22:09 ` [PATCH v2 4/7] arm64: dts: sophgo: Add Duo Module 01 Alexander Sverdlin
2025-02-10 22:09 ` [PATCH v2 5/7] arm64: dts: sophgo: Add Duo Module 01 Evaluation Board Alexander Sverdlin
2025-02-10 22:09 ` [PATCH v2 6/7] arm64: Add SOPHGO SOC family Kconfig support Alexander Sverdlin
2025-02-11  1:25   ` Chen Wang
2025-02-10 22:09 ` [PATCH v2 7/7] arm64: defconfig: Enable rudimentary Sophgo SG2000 support Alexander Sverdlin
2025-02-11 10:50 ` [PATCH v2 0/7] arm64 support for Milk-V Duo Module 01 EVB Conor Dooley
2025-02-11 12:43   ` Alexander Sverdlin
2025-02-11 13:48     ` Conor Dooley

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=33654180-5488-4601-9103-8e4218c4a198@kernel.org \
    --to=krzk@kernel.org \
    --cc=alexander.sverdlin@gmail.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=arnd@arndb.de \
    --cc=chao.wei@sophgo.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heylenay@outlook.com \
    --cc=inochiama@gmail.com \
    --cc=inochiama@outlook.com \
    --cc=jszhang@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh@kernel.org \
    --cc=soc@lists.linux.dev \
    --cc=unicorn_wang@outlook.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