Message ID | 20230930123937.1551-5-jszhang@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp366637vqb; Sat, 30 Sep 2023 05:52:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFDLYNegZTBDZUFxt2Htfi51rdD5oHW69JtuCIwd7xHU5Gkz8yNFDgYfRh1m7e7SybzTCJz X-Received: by 2002:a05:6358:9189:b0:134:f326:e819 with SMTP id j9-20020a056358918900b00134f326e819mr7958370rwa.29.1696078373529; Sat, 30 Sep 2023 05:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696078373; cv=none; d=google.com; s=arc-20160816; b=Z0aOhMuhvy4Aqu5cM8yjDOAsoUXhHIRTAA2n4XcvBTYNATovv67RNmoJWv2ayyQO/8 3gMNx3vgLXnbOCkGpxzoi08XXfrr92fq00+4ht0ZuxkME81ZFT9GdH0yVzT7e8gR6plI CwCX2vHKNYLpIKKLK8sqTbVFAWeH+2H7jRNxIEzi2VzcKwuYEKkPvlIZLJz2j//qcHjo Ex0Fz2ZBkF7YXIu0fNO/Wu0V1YLsgVgi0zW+Ge01TLgje/X9a1+DX/cpGetLnLLEpvlh 9vQ6K7+BvaCObvcOcHTbodfk5WtH1IrKl/vqD/MuKYtXBN3FNrav7zvsklo6+hA6rDCG DTJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/X2BFvcH/cQMUTBqqzAiagMTFXZmd7NNFnTlOZwj1SM=; fh=7ThHOJ31hpzqZLkZyOKZ4WgZv8ifKguzg0MefKgt2oQ=; b=l3La49bZYt1ZV/QlWfawSf8OH34LxDsxwOv1Gf02NxquIzzFSruy7QtK4ZO6JOpijJ IAPrVLpzxh6xHWAs/Xu/unPRodYjfcY25sthTc3eyC3aSbnnTQsCn/gqgR2NPME0i2PG vcNBBLm1cs928HgXYMOWUuuPe7zQIQimSi7+moDV+ml5kxh7OJb+RyfPowV6DouKm92K GyY2yIihiidBmrmXTPqawGft8Q0OiijvBRpF6GIPoqPxvchzlhkcKzOPdKLdXQi6/gWd nUCjBCPwDlTBUpIXeazgJ2q68ld8gEXLgBHgAxnc1KnGYewK46tXwsN6Njd8d73TxzbG OeQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CoGXAnvW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id bs6-20020a632806000000b0057458518e20si8663885pgb.164.2023.09.30.05.52.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 05:52:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CoGXAnvW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id DE30581C0C0C; Sat, 30 Sep 2023 05:52:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234173AbjI3MwN (ORCPT <rfc822;chrisfriedt@gmail.com> + 20 others); Sat, 30 Sep 2023 08:52:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234163AbjI3MwL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 30 Sep 2023 08:52:11 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 138DB1A4 for <linux-kernel@vger.kernel.org>; Sat, 30 Sep 2023 05:52:08 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B07DFC433C7; Sat, 30 Sep 2023 12:52:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696078327; bh=PO36H6jRR8QhXJ+xnlXTqLl+g9y5bq24w4dNdmW+KwE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CoGXAnvWfqasfxJ2+1tOXd6mushKBPwk/rdZ/6ShcRrtT1dgusjMI/Z7X0hG3TIpt GrkBhHQjCj+yD2MFeKQr/oXWqOB1f5WZZId+5KE7niXHbh+OE6sk1+UhbZ4cTi62iz LPKGNDrQnRnIqTNFojocifXICSLMTIHQ1LBqMhDji9H7/mV1ASYGRETmoJPA/TjEGq KczaPvnw8prKwbd7wfisV89bndQoIEZHWz4Rb9tbjyjiS8l7rbaQ8bmYxDPTd6GF8I bpRXBJKFRFRwRASlAptDVQ3GN/yHucwUsa0LfNuhJbnqH8w56pWLMAKGZM36YfywHA T/v5FaUtmigIw== From: Jisheng Zhang <jszhang@kernel.org> To: Thomas Gleixner <tglx@linutronix.de>, Marc Zyngier <maz@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Palmer Dabbelt <palmer@dabbelt.com>, Paul Walmsley <paul.walmsley@sifive.com>, Albert Ou <aou@eecs.berkeley.edu>, Daniel Lezcano <daniel.lezcano@linaro.org>, Anup Patel <anup@brainfault.org> Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, Inochi Amaoto <inochiama@outlook.com>, chao.wei@sophgo.com, xiaoguang.xing@sophgo.com Subject: [PATCH 4/5] riscv: dts: sophgo: add initial CV1800B SoC device tree Date: Sat, 30 Sep 2023 20:39:36 +0800 Message-Id: <20230930123937.1551-5-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230930123937.1551-1-jszhang@kernel.org> References: <20230930123937.1551-1-jszhang@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sat, 30 Sep 2023 05:52:50 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778467076691813034 X-GMAIL-MSGID: 1778467076691813034 |
Series |
Add Milk-V Duo board support
|
|
Commit Message
Jisheng Zhang
Sept. 30, 2023, 12:39 p.m. UTC
Add initial device tree for the CV1800B RISC-V SoC by SOPHGO.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 117 ++++++++++++++++++++++++
1 file changed, 117 insertions(+)
create mode 100644 arch/riscv/boot/dts/sophgo/cv1800b.dtsi
Comments
Hi, Jisheng You add the clint dt-bindings of CV1800B clint, but I don't see the clint node in this dt. The SBI needs this clint node to provide timer for linux. AFAIK, the dt of SBI comes from the linux or the bootloader, and bootloader may load the linux dt and pass it to the SBI. I think it is better to add the clint node. In addition, please separate the peripheral node to a different file, which can be reused by both the CV1800 series and CV1810 series. Thanks, Inochi > >Add initial device tree for the CV1800B RISC-V SoC by SOPHGO. > >Signed-off-by: Jisheng Zhang <jszhang@kernel.org> >--- > arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 117 ++++++++++++++++++++++++ > 1 file changed, 117 insertions(+) > create mode 100644 arch/riscv/boot/dts/sophgo/cv1800b.dtsi > >diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi >new file mode 100644 >index 000000000000..8829bebaa017 >--- /dev/null >+++ b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi >@@ -0,0 +1,117 @@ >+// SPDX-License-Identifier: (GPL-2.0 OR MIT) >+/* >+ * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> >+ */ >+ >+#include <dt-bindings/interrupt-controller/irq.h> >+ >+/ { >+ compatible = "sophgo,cv1800b"; >+ #address-cells = <1>; >+ #size-cells = <1>; >+ >+ 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; >+ #address-cells = <0>; >+ #interrupt-cells = <1>; >+ }; >+ }; >+ }; >+ >+ osc: oscillator { >+ compatible = "fixed-clock"; >+ clock-output-names = "osc_25m"; >+ #clock-cells = <0>; >+ }; >+ >+ soc { >+ compatible = "simple-bus"; >+ interrupt-parent = <&plic>; >+ #address-cells = <1>; >+ #size-cells = <1>; >+ dma-noncoherent; >+ ranges; >+ >+ uart0: serial@04140000 { >+ compatible = "snps,dw-apb-uart"; >+ reg = <0x04140000 0x100>; >+ interrupts = <44 IRQ_TYPE_LEVEL_HIGH>; >+ clocks = <&osc>; >+ reg-shift = <2>; >+ reg-io-width = <4>; >+ status = "disabled"; >+ }; >+ >+ uart1: serial@04150000 { >+ compatible = "snps,dw-apb-uart"; >+ reg = <0x04150000 0x100>; >+ interrupts = <45 IRQ_TYPE_LEVEL_HIGH>; >+ clocks = <&osc>; >+ reg-shift = <2>; >+ reg-io-width = <4>; >+ status = "disabled"; >+ }; >+ >+ uart2: serial@04160000 { >+ compatible = "snps,dw-apb-uart"; >+ reg = <0x04160000 0x100>; >+ interrupts = <46 IRQ_TYPE_LEVEL_HIGH>; >+ clocks = <&osc>; >+ reg-shift = <2>; >+ reg-io-width = <4>; >+ status = "disabled"; >+ }; >+ >+ uart3: serial@04170000 { >+ compatible = "snps,dw-apb-uart"; >+ reg = <0x04170000 0x100>; >+ interrupts = <47 IRQ_TYPE_LEVEL_HIGH>; >+ clocks = <&osc>; >+ reg-shift = <2>; >+ reg-io-width = <4>; >+ status = "disabled"; >+ }; >+ >+ uart4: serial@041c0000 { >+ compatible = "snps,dw-apb-uart"; >+ reg = <0x041c0000 0x100>; >+ interrupts = <48 IRQ_TYPE_LEVEL_HIGH>; >+ clocks = <&osc>; >+ reg-shift = <2>; >+ reg-io-width = <4>; >+ status = "disabled"; >+ }; >+ >+ plic: interrupt-controller@70000000 { >+ compatible = "sophgo,cv1800b-plic", "thead,c900-plic"; >+ reg = <0x70000000 0x4000000>; >+ interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>; >+ interrupt-controller; >+ #address-cells = <0>; >+ #interrupt-cells = <2>; >+ riscv,ndev = <101>; >+ }; >+ }; >+}; >-- >2.40.1 > >
On Sun, Oct 01, 2023 at 06:34:21AM +0800, Inochi Amaoto wrote: > Hi, Jisheng > >Add initial device tree for the CV1800B RISC-V SoC by SOPHGO. > > You add the clint dt-bindings of CV1800B clint, but I don't see the clint > node in this dt. The SBI needs this clint node to provide timer for linux. > AFAIK, the dt of SBI comes from the linux or the bootloader, and bootloader > may load the linux dt and pass it to the SBI. I think it is better to add > the clint node. > In addition, please separate the peripheral node to a different file, which > can be reused by both the CV1800 series and CV1810 series. How do these SoCs differ? Documentation seems rather lacking, but I was able to find something on github that suggests there is also a cv180zb. The difference between the three seems to, from a quick look, be their video encoding capabilities. Is that correct? Cheers, Conor. > > > >Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > >--- > > arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 117 ++++++++++++++++++++++++ > > 1 file changed, 117 insertions(+) > > create mode 100644 arch/riscv/boot/dts/sophgo/cv1800b.dtsi > > > >diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > >new file mode 100644 > >index 000000000000..8829bebaa017 > >--- /dev/null > >+++ b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > >@@ -0,0 +1,117 @@ > >+// SPDX-License-Identifier: (GPL-2.0 OR MIT) > >+/* > >+ * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> > >+ */ > >+ > >+#include <dt-bindings/interrupt-controller/irq.h> > >+ > >+/ { > >+ compatible = "sophgo,cv1800b"; > >+ #address-cells = <1>; > >+ #size-cells = <1>; > >+ > >+ 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; > >+ #address-cells = <0>; > >+ #interrupt-cells = <1>; > >+ }; > >+ }; > >+ }; > >+ > >+ osc: oscillator { > >+ compatible = "fixed-clock"; > >+ clock-output-names = "osc_25m"; > >+ #clock-cells = <0>; > >+ }; > >+ > >+ soc { > >+ compatible = "simple-bus"; > >+ interrupt-parent = <&plic>; > >+ #address-cells = <1>; > >+ #size-cells = <1>; > >+ dma-noncoherent; > >+ ranges; > >+ > >+ uart0: serial@04140000 { > >+ compatible = "snps,dw-apb-uart"; > >+ reg = <0x04140000 0x100>; > >+ interrupts = <44 IRQ_TYPE_LEVEL_HIGH>; > >+ clocks = <&osc>; > >+ reg-shift = <2>; > >+ reg-io-width = <4>; > >+ status = "disabled"; > >+ }; > >+ > >+ uart1: serial@04150000 { > >+ compatible = "snps,dw-apb-uart"; > >+ reg = <0x04150000 0x100>; > >+ interrupts = <45 IRQ_TYPE_LEVEL_HIGH>; > >+ clocks = <&osc>; > >+ reg-shift = <2>; > >+ reg-io-width = <4>; > >+ status = "disabled"; > >+ }; > >+ > >+ uart2: serial@04160000 { > >+ compatible = "snps,dw-apb-uart"; > >+ reg = <0x04160000 0x100>; > >+ interrupts = <46 IRQ_TYPE_LEVEL_HIGH>; > >+ clocks = <&osc>; > >+ reg-shift = <2>; > >+ reg-io-width = <4>; > >+ status = "disabled"; > >+ }; > >+ > >+ uart3: serial@04170000 { > >+ compatible = "snps,dw-apb-uart"; > >+ reg = <0x04170000 0x100>; > >+ interrupts = <47 IRQ_TYPE_LEVEL_HIGH>; > >+ clocks = <&osc>; > >+ reg-shift = <2>; > >+ reg-io-width = <4>; > >+ status = "disabled"; > >+ }; > >+ > >+ uart4: serial@041c0000 { > >+ compatible = "snps,dw-apb-uart"; > >+ reg = <0x041c0000 0x100>; > >+ interrupts = <48 IRQ_TYPE_LEVEL_HIGH>; > >+ clocks = <&osc>; > >+ reg-shift = <2>; > >+ reg-io-width = <4>; > >+ status = "disabled"; > >+ }; > >+ > >+ plic: interrupt-controller@70000000 { > >+ compatible = "sophgo,cv1800b-plic", "thead,c900-plic"; > >+ reg = <0x70000000 0x4000000>; > >+ interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>; > >+ interrupt-controller; > >+ #address-cells = <0>; > >+ #interrupt-cells = <2>; > >+ riscv,ndev = <101>; > >+ }; > >+ }; > >+}; > >-- > >2.40.1 > > > >
>On Sun, Oct 01, 2023 at 06:34:21AM +0800, Inochi Amaoto wrote: >> Hi, Jisheng > >>> Add initial device tree for the CV1800B RISC-V SoC by SOPHGO. > >> >> You add the clint dt-bindings of CV1800B clint, but I don't see the clint >> node in this dt. The SBI needs this clint node to provide timer for linux. >> AFAIK, the dt of SBI comes from the linux or the bootloader, and bootloader >> may load the linux dt and pass it to the SBI. I think it is better to add >> the clint node. > >> In addition, please separate the peripheral node to a different file, which >> can be reused by both the CV1800 series and CV1810 series. > >How do these SoCs differ? AFAIK, the most peripheral of CV1800 and CV1810 are the same. there are only a few difference between CV1800 and CV1810: 1. CV1810 have mmc interrupt, but CV1800 have none 2. CV1810 have more RAM and a more powerful TPU. 3. Some models of CV1810 support I2S. Also is some you have already mentioned, the video capabilities (including encoding, output steam number, input steam number) are different. The only board with a CV1800 soc is Huashan Pi (CV1812H). >Documentation seems rather lacking, but I was able to find something on >github that suggests there is also a cv180zb. The difference between the >three seems to, from a quick look, be their video encoding capabilities. >Is that correct? > Yes. it is correct. It seems like you have forgot a chip called CV1801B, which has 128MB RAM. But I see no board with this soc, so at now it is not necessary to care it.
> >>On Sun, Oct 01, 2023 at 06:34:21AM +0800, Inochi Amaoto wrote: >>> Hi, Jisheng >> >>>> Add initial device tree for the CV1800B RISC-V SoC by SOPHGO. >> >>> >>> You add the clint dt-bindings of CV1800B clint, but I don't see the clint >>> node in this dt. The SBI needs this clint node to provide timer for linux. >>> AFAIK, the dt of SBI comes from the linux or the bootloader, and bootloader >>> may load the linux dt and pass it to the SBI. I think it is better to add >>> the clint node. >> >>> In addition, please separate the peripheral node to a different file, which >>> can be reused by both the CV1800 series and CV1810 series. >> >>How do these SoCs differ? > >AFAIK, the most peripheral of CV1800 and CV1810 are the same. there are >only a few difference between CV1800 and CV1810: >1. CV1810 have mmc interrupt, but CV1800 have none >2. CV1810 have more RAM and a more powerful TPU. >3. Some models of CV1810 support I2S. > >Also is some you have already mentioned, the video capabilities (including >encoding, output steam number, input steam number) are different. > >The only board with a CV1800 soc is Huashan Pi (CV1812H). > A mistake, I mean CV1810 soc, not the CV1800 one. >>Documentation seems rather lacking, but I was able to find something on >>github that suggests there is also a cv180zb. The difference between the >>three seems to, from a quick look, be their video encoding capabilities. >>Is that correct? >> > >Yes. it is correct. >It seems like you have forgot a chip called CV1801B, which has 128MB >RAM. But I see no board with this soc, so at now it is not necessary to >care it. > >
On Sat, Sep 30, 2023 at 08:39:36PM +0800, Jisheng Zhang wrote: > Add initial device tree for the CV1800B RISC-V SoC by SOPHGO. > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > --- > arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 117 ++++++++++++++++++++++++ > 1 file changed, 117 insertions(+) > create mode 100644 arch/riscv/boot/dts/sophgo/cv1800b.dtsi > > diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > new file mode 100644 > index 000000000000..8829bebaa017 > --- /dev/null > +++ b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > @@ -0,0 +1,117 @@ > +// SPDX-License-Identifier: (GPL-2.0 OR MIT) > +/* > + * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> > + */ > + > +#include <dt-bindings/interrupt-controller/irq.h> > + > +/ { > + compatible = "sophgo,cv1800b"; > + #address-cells = <1>; > + #size-cells = <1>; > + > + 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; > + #address-cells = <0>; > + #interrupt-cells = <1>; > + }; > + }; > + }; > + > + osc: oscillator { > + compatible = "fixed-clock"; > + clock-output-names = "osc_25m"; > + #clock-cells = <0>; > + }; Is this a stub that will later be replaced by a real clock controller node, or is this actually a fixed oscillator? If it is the former, could you add it to the commit message if there is a respin? Thanks, Conor.
On Sun, Oct 01, 2023 at 08:22:04PM +0800, Inochi Amaoto wrote: > > > >>On Sun, Oct 01, 2023 at 06:34:21AM +0800, Inochi Amaoto wrote: > >>> Hi, Jisheng > >> > >>>> Add initial device tree for the CV1800B RISC-V SoC by SOPHGO. > >> > >>> > >>> You add the clint dt-bindings of CV1800B clint, but I don't see the clint > >>> node in this dt. The SBI needs this clint node to provide timer for linux. > >>> AFAIK, the dt of SBI comes from the linux or the bootloader, and bootloader > >>> may load the linux dt and pass it to the SBI. I think it is better to add > >>> the clint node. > >> > >>> In addition, please separate the peripheral node to a different file, which > >>> can be reused by both the CV1800 series and CV1810 series. > >> > >>How do these SoCs differ? > > > >AFAIK, the most peripheral of CV1800 and CV1810 are the same. there are > >only a few difference between CV1800 and CV1810: > >1. CV1810 have mmc interrupt, but CV1800 have none > >2. CV1810 have more RAM and a more powerful TPU. > >3. Some models of CV1810 support I2S. > > > >Also is some you have already mentioned, the video capabilities (including > >encoding, output steam number, input steam number) are different. > > > >The only board with a CV1800 soc is Huashan Pi (CV1812H). > > > > A mistake, I mean CV1810 soc, not the CV1800 one. > > >>Documentation seems rather lacking, but I was able to find something on > >>github that suggests there is also a cv180zb. The difference between the > >>three seems to, from a quick look, be their video encoding capabilities. > >>Is that correct? > >> > > > >Yes. it is correct. > >It seems like you have forgot a chip called CV1801B, which has 128MB > >RAM. But I see no board with this soc, so at now it is not necessary to > >care it. FWIW, I do not mind if the properties are left inside a CV1800B specific file, and moved out at a later date if/when someone actually upstreams support for a board with that SoC.
On Sat, Sep 30, 2023 at 08:39:36PM +0800, Jisheng Zhang wrote: > + plic: interrupt-controller@70000000 { > + compatible = "sophgo,cv1800b-plic", "thead,c900-plic"; This fails dtbs_check, the compatible you added to the binding is cv1800-plic. > + reg = <0x70000000 0x4000000>; > + interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>; > + interrupt-controller; > + #address-cells = <0>; > + #interrupt-cells = <2>; > + riscv,ndev = <101>; > + };
在 2023/9/30 20:39, Jisheng Zhang 写道: > Add initial device tree for the CV1800B RISC-V SoC by SOPHGO. > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > --- > arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 117 ++++++++++++++++++++++++ > 1 file changed, 117 insertions(+) > create mode 100644 arch/riscv/boot/dts/sophgo/cv1800b.dtsi Hi, Jisheng, as far as I know, sg2042 and cv180x are now tracked by different people and even in sophgo, they are two independent projects(sg2042 is target for HPC and cv180x is target for embeded device). To facilitate future management and review, I recommend registering the maintainer information in two entries in MAINTAINERS. The example is as follows: ``` SOPHGO CV180X DEVICETREES M: Jisheng Zhang <jszhang@kernel.org> F: arch/riscv/boot/dts/sophgo/cv1800b-milkv-duo.dts F: arch/riscv/boot/dts/sophgo/cv1800b.dtsi SOPHGO SG2042 DEVICETREES M: Chao Wei <chao.wei@sophgo.com> M: Chen Wang <unicornxw@gmail.com> S: Maintained F: arch/riscv/boot/dts/sophgo/Makefile F: arch/riscv/boot/dts/sophgo/sg2042-cpus.dtsi F: arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts F: arch/riscv/boot/dts/sophgo/sg2042.dtsi F: Documentation/devicetree/bindings/riscv/sophgo.yaml ``` For Makefile and sophgo.yaml such common files, just keep in sg2042 entry should be fine. @Conor, what do you think? Thanks, Chen > diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > new file mode 100644 > index 000000000000..8829bebaa017 > --- /dev/null > +++ b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > @@ -0,0 +1,117 @@ > +// SPDX-License-Identifier: (GPL-2.0 OR MIT) > +/* > + * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> > + */ > + > +#include <dt-bindings/interrupt-controller/irq.h> > + > +/ { > + compatible = "sophgo,cv1800b"; > + #address-cells = <1>; > + #size-cells = <1>; > + > + 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; > + #address-cells = <0>; > + #interrupt-cells = <1>; > + }; > + }; > + }; > + > + osc: oscillator { > + compatible = "fixed-clock"; > + clock-output-names = "osc_25m"; > + #clock-cells = <0>; > + }; > + > + soc { > + compatible = "simple-bus"; > + interrupt-parent = <&plic>; > + #address-cells = <1>; > + #size-cells = <1>; > + dma-noncoherent; > + ranges; > + > + uart0: serial@04140000 { > + compatible = "snps,dw-apb-uart"; > + reg = <0x04140000 0x100>; > + interrupts = <44 IRQ_TYPE_LEVEL_HIGH>; > + clocks = <&osc>; > + reg-shift = <2>; > + reg-io-width = <4>; > + status = "disabled"; > + }; > + > + uart1: serial@04150000 { > + compatible = "snps,dw-apb-uart"; > + reg = <0x04150000 0x100>; > + interrupts = <45 IRQ_TYPE_LEVEL_HIGH>; > + clocks = <&osc>; > + reg-shift = <2>; > + reg-io-width = <4>; > + status = "disabled"; > + }; > + > + uart2: serial@04160000 { > + compatible = "snps,dw-apb-uart"; > + reg = <0x04160000 0x100>; > + interrupts = <46 IRQ_TYPE_LEVEL_HIGH>; > + clocks = <&osc>; > + reg-shift = <2>; > + reg-io-width = <4>; > + status = "disabled"; > + }; > + > + uart3: serial@04170000 { > + compatible = "snps,dw-apb-uart"; > + reg = <0x04170000 0x100>; > + interrupts = <47 IRQ_TYPE_LEVEL_HIGH>; > + clocks = <&osc>; > + reg-shift = <2>; > + reg-io-width = <4>; > + status = "disabled"; > + }; > + > + uart4: serial@041c0000 { > + compatible = "snps,dw-apb-uart"; > + reg = <0x041c0000 0x100>; > + interrupts = <48 IRQ_TYPE_LEVEL_HIGH>; > + clocks = <&osc>; > + reg-shift = <2>; > + reg-io-width = <4>; > + status = "disabled"; > + }; > + > + plic: interrupt-controller@70000000 { > + compatible = "sophgo,cv1800b-plic", "thead,c900-plic"; > + reg = <0x70000000 0x4000000>; > + interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>; > + interrupt-controller; > + #address-cells = <0>; > + #interrupt-cells = <2>; > + riscv,ndev = <101>; > + }; > + }; > +};
On 04/10/2023 09:23, Chen Wang wrote: > > 在 2023/9/30 20:39, Jisheng Zhang 写道: >> Add initial device tree for the CV1800B RISC-V SoC by SOPHGO. >> >> Signed-off-by: Jisheng Zhang <jszhang@kernel.org> >> --- >> arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 117 ++++++++++++++++++++++++ >> 1 file changed, 117 insertions(+) >> create mode 100644 arch/riscv/boot/dts/sophgo/cv1800b.dtsi > > Hi, Jisheng, as far as I know, sg2042 and cv180x are now tracked by > different people and even in sophgo, they are two independent > projects(sg2042 is target for HPC and cv180x is target for embeded > device). To facilitate future management and review, I recommend > registering the maintainer information in two entries in MAINTAINERS. > The example is as follows: > > ``` > > SOPHGO CV180X DEVICETREES > M: Jisheng Zhang <jszhang@kernel.org> > F: arch/riscv/boot/dts/sophgo/cv1800b-milkv-duo.dts > F: arch/riscv/boot/dts/sophgo/cv1800b.dtsi > > SOPHGO SG2042 DEVICETREES > M: Chao Wei <chao.wei@sophgo.com> > M: Chen Wang <unicornxw@gmail.com> > S: Maintained > F: arch/riscv/boot/dts/sophgo/Makefile > F: arch/riscv/boot/dts/sophgo/sg2042-cpus.dtsi > F: arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts > F: arch/riscv/boot/dts/sophgo/sg2042.dtsi > F: Documentation/devicetree/bindings/riscv/sophgo.yaml > ``` > > For Makefile and sophgo.yaml such common files, just keep in sg2042 > entry should be fine. > > @Conor, what do you think? We do no have usually per-board maintainer entries (with few exceptions). I strongly prefer this one instead: https://lore.kernel.org/all/829b122da52482707b783dc3d93d3ff0179cb0ca.camel@perches.com/ Best regards, Krzysztof
On Wed, Oct 04, 2023 at 09:57:33AM +0200, Krzysztof Kozlowski wrote: > On 04/10/2023 09:23, Chen Wang wrote: > > > > 在 2023/9/30 20:39, Jisheng Zhang 写道: > >> Add initial device tree for the CV1800B RISC-V SoC by SOPHGO. > >> > >> Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > >> --- > >> arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 117 ++++++++++++++++++++++++ > >> 1 file changed, 117 insertions(+) > >> create mode 100644 arch/riscv/boot/dts/sophgo/cv1800b.dtsi > > > > Hi, Jisheng, as far as I know, sg2042 and cv180x are now tracked by > > different people and even in sophgo, they are two independent > > projects(sg2042 is target for HPC and cv180x is target for embeded > > device). To facilitate future management and review, I recommend > > registering the maintainer information in two entries in MAINTAINERS. > > The example is as follows: > > > > ``` > > > > SOPHGO CV180X DEVICETREES > > M: Jisheng Zhang <jszhang@kernel.org> > > F: arch/riscv/boot/dts/sophgo/cv1800b-milkv-duo.dts > > F: arch/riscv/boot/dts/sophgo/cv1800b.dtsi > > > > SOPHGO SG2042 DEVICETREES > > M: Chao Wei <chao.wei@sophgo.com> > > M: Chen Wang <unicornxw@gmail.com> > > S: Maintained > > F: arch/riscv/boot/dts/sophgo/Makefile > > F: arch/riscv/boot/dts/sophgo/sg2042-cpus.dtsi > > F: arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts > > F: arch/riscv/boot/dts/sophgo/sg2042.dtsi > > F: Documentation/devicetree/bindings/riscv/sophgo.yaml > > ``` > > > > For Makefile and sophgo.yaml such common files, just keep in sg2042 > > entry should be fine. > > > > @Conor, what do you think? > > We do no have usually per-board maintainer entries (with few > exceptions). I strongly prefer this one instead: > > https://lore.kernel.org/all/829b122da52482707b783dc3d93d3ff0179cb0ca.camel@perches.com/ I don't like the suggestion here for a different reason! While I'm fine with having some per-board SoC maintainers, esp. since the cv1800 stuff is very different to the sg2042, I want to see someone step up to apply the patches for the whole arch/riscv/boot/dts/sophgo/ directory once more comfortable with the process, not reduce the entry to cover just the 64 core SoC. Thanks, Conor.
在 2023/10/4 17:13, Conor Dooley 写道: > On Wed, Oct 04, 2023 at 09:57:33AM +0200, Krzysztof Kozlowski wrote: >> On 04/10/2023 09:23, Chen Wang wrote: >>> 在 2023/9/30 20:39, Jisheng Zhang 写道: >>>> Add initial device tree for the CV1800B RISC-V SoC by SOPHGO. >>>> >>>> Signed-off-by: Jisheng Zhang <jszhang@kernel.org> >>>> --- >>>> arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 117 ++++++++++++++++++++++++ >>>> 1 file changed, 117 insertions(+) >>>> create mode 100644 arch/riscv/boot/dts/sophgo/cv1800b.dtsi >>> Hi, Jisheng, as far as I know, sg2042 and cv180x are now tracked by >>> different people and even in sophgo, they are two independent >>> projects(sg2042 is target for HPC and cv180x is target for embeded >>> device). To facilitate future management and review, I recommend >>> registering the maintainer information in two entries in MAINTAINERS. >>> The example is as follows: >>> >>> ``` >>> >>> SOPHGO CV180X DEVICETREES >>> M: Jisheng Zhang <jszhang@kernel.org> >>> F: arch/riscv/boot/dts/sophgo/cv1800b-milkv-duo.dts >>> F: arch/riscv/boot/dts/sophgo/cv1800b.dtsi >>> >>> SOPHGO SG2042 DEVICETREES >>> M: Chao Wei <chao.wei@sophgo.com> >>> M: Chen Wang <unicornxw@gmail.com> >>> S: Maintained >>> F: arch/riscv/boot/dts/sophgo/Makefile >>> F: arch/riscv/boot/dts/sophgo/sg2042-cpus.dtsi >>> F: arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts >>> F: arch/riscv/boot/dts/sophgo/sg2042.dtsi >>> F: Documentation/devicetree/bindings/riscv/sophgo.yaml >>> ``` >>> >>> For Makefile and sophgo.yaml such common files, just keep in sg2042 >>> entry should be fine. >>> >>> @Conor, what do you think? >> We do no have usually per-board maintainer entries (with few >> exceptions). I strongly prefer this one instead: >> >> https://lore.kernel.org/all/829b122da52482707b783dc3d93d3ff0179cb0ca.camel@perches.com/ > I don't like the suggestion here for a different reason! While I'm fine > with having some per-board SoC maintainers, esp. since the cv1800 stuff > is very different to the sg2042, I want to see someone step up to apply > the patches for the whole arch/riscv/boot/dts/sophgo/ directory once more > comfortable with the process, not reduce the entry to cover just the 64 > core SoC. > > Thanks, > Conor. Thanks, Conor and Krzystof. Agree with you, it would be better to keep only one entry for arch/riscv/boot/dts/sophgo/ directory. I will discuss with other people working on sophgo and specify a unified maintenance task to maintain files under it.
On Mon, Oct 02, 2023 at 01:09:38PM +0100, Conor Dooley wrote: > On Sat, Sep 30, 2023 at 08:39:36PM +0800, Jisheng Zhang wrote: > > Add initial device tree for the CV1800B RISC-V SoC by SOPHGO. > > > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > > --- > > arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 117 ++++++++++++++++++++++++ > > 1 file changed, 117 insertions(+) > > create mode 100644 arch/riscv/boot/dts/sophgo/cv1800b.dtsi > > > > diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > > new file mode 100644 > > index 000000000000..8829bebaa017 > > --- /dev/null > > +++ b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > > @@ -0,0 +1,117 @@ > > +// SPDX-License-Identifier: (GPL-2.0 OR MIT) > > +/* > > + * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> > > + */ > > + > > +#include <dt-bindings/interrupt-controller/irq.h> > > + > > +/ { > > + compatible = "sophgo,cv1800b"; > > + #address-cells = <1>; > > + #size-cells = <1>; > > + > > + 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; > > + #address-cells = <0>; > > + #interrupt-cells = <1>; > > + }; > > + }; > > + }; > > + > > + osc: oscillator { > > + compatible = "fixed-clock"; > > + clock-output-names = "osc_25m"; > > + #clock-cells = <0>; > > + }; > > Is this a stub that will later be replaced by a real clock controller > node, or is this actually a fixed oscillator? If it is the former, could Hi Conor, This is a real 25MHZ oscillator. Thanks
diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi new file mode 100644 index 000000000000..8829bebaa017 --- /dev/null +++ b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi @@ -0,0 +1,117 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> + */ + +#include <dt-bindings/interrupt-controller/irq.h> + +/ { + compatible = "sophgo,cv1800b"; + #address-cells = <1>; + #size-cells = <1>; + + 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; + #address-cells = <0>; + #interrupt-cells = <1>; + }; + }; + }; + + osc: oscillator { + compatible = "fixed-clock"; + clock-output-names = "osc_25m"; + #clock-cells = <0>; + }; + + soc { + compatible = "simple-bus"; + interrupt-parent = <&plic>; + #address-cells = <1>; + #size-cells = <1>; + dma-noncoherent; + ranges; + + uart0: serial@04140000 { + compatible = "snps,dw-apb-uart"; + reg = <0x04140000 0x100>; + interrupts = <44 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&osc>; + reg-shift = <2>; + reg-io-width = <4>; + status = "disabled"; + }; + + uart1: serial@04150000 { + compatible = "snps,dw-apb-uart"; + reg = <0x04150000 0x100>; + interrupts = <45 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&osc>; + reg-shift = <2>; + reg-io-width = <4>; + status = "disabled"; + }; + + uart2: serial@04160000 { + compatible = "snps,dw-apb-uart"; + reg = <0x04160000 0x100>; + interrupts = <46 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&osc>; + reg-shift = <2>; + reg-io-width = <4>; + status = "disabled"; + }; + + uart3: serial@04170000 { + compatible = "snps,dw-apb-uart"; + reg = <0x04170000 0x100>; + interrupts = <47 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&osc>; + reg-shift = <2>; + reg-io-width = <4>; + status = "disabled"; + }; + + uart4: serial@041c0000 { + compatible = "snps,dw-apb-uart"; + reg = <0x041c0000 0x100>; + interrupts = <48 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&osc>; + reg-shift = <2>; + reg-io-width = <4>; + status = "disabled"; + }; + + plic: interrupt-controller@70000000 { + compatible = "sophgo,cv1800b-plic", "thead,c900-plic"; + reg = <0x70000000 0x4000000>; + interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <2>; + riscv,ndev = <101>; + }; + }; +};