From: Conor Dooley <conor.dooley@microchip.com> To: Icenowy Zheng <uwu@icenowy.me>, Samuel Holland <samuel@sholland.org>, Jisheng Zhang <jszhang@kernel.org> Cc: "Samuel Holland" <samuel@sholland.org>, "Jisheng Zhang" <jszhang@kernel.org>, linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, "Rob Herring" <robh+dt@kernel.org>, "Conor Dooley" <conor@kernel.org>, "Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>, "Paul Walmsley" <paul.walmsley@sifive.com>, "Palmer Dabbelt" <palmer@dabbelt.com>, "Albert Ou" <aou@eecs.berkeley.edu>, "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>, "Jiri Slaby" <jirislaby@kernel.org>, "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com> Subject: Re: [PATCH v2 6/9] riscv: dts: bouffalolab: add the bl808 SoC base device tree Date: Mon, 5 Dec 2022 10:29:43 +0000 [thread overview] Message-ID: <Y43IF/MpM9kX2gD6@wendy> (raw) In-Reply-To: <04abc8d6d8a9200e593f3f667a31ea0d3674c64b.camel@icenowy.me> [-- Attachment #1: Type: text/plain, Size: 6818 bytes --] On Mon, Dec 05, 2022 at 04:17:59PM +0800, Icenowy Zheng wrote: > 在 2022-11-30星期三的 01:21 -0600,Samuel Holland写道: > > On 11/27/22 07:24, Jisheng Zhang wrote: > > > Add a baisc dtsi for the bouffalolab bl808 SoC. > > > > > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > > > --- > > > arch/riscv/boot/dts/bouffalolab/bl808.dtsi | 74 > > > ++++++++++++++++++++++ > > > 1 file changed, 74 insertions(+) > > > create mode 100644 arch/riscv/boot/dts/bouffalolab/bl808.dtsi > > > > > > diff --git a/arch/riscv/boot/dts/bouffalolab/bl808.dtsi > > > b/arch/riscv/boot/dts/bouffalolab/bl808.dtsi > > > new file mode 100644 > > > index 000000000000..f4b170ccc32e > > > --- /dev/null > > > +++ b/arch/riscv/boot/dts/bouffalolab/bl808.dtsi > > > @@ -0,0 +1,74 @@ > > > +// SPDX-License-Identifier: (GPL-2.0+ or MIT) > > > +/* > > > + * Copyright (C) 2022 Jisheng Zhang <jszhang@kernel.org> > > > + */ > > > + > > > +#include <dt-bindings/interrupt-controller/irq.h> > > > + > > > +/ { > > > + compatible = "bouffalolab,bl808"; > > > + #address-cells = <1>; > > > + #size-cells = <1>; > > > + > > > + cpus { > > > + timebase-frequency = <1000000>; > > > + #address-cells = <1>; > > > + #size-cells = <0>; > > > + > > > + cpu0: cpu@0 { > > > + compatible = "thead,c906", "riscv"; > > > + device_type = "cpu"; > > > + reg = <0>; > > > + d-cache-block-size = <64>; > > > + d-cache-sets = <256>; > > > + d-cache-size = <32768>; > > > + i-cache-block-size = <64>; > > > + i-cache-sets = <128>; > > > + i-cache-size = <32768>; > > > + mmu-type = "riscv,sv39"; > > > + riscv,isa = "rv64imafdc"; > > > + > > > + cpu0_intc: interrupt-controller { > > > + compatible = "riscv,cpu-intc"; > > > + interrupt-controller; > > > + #address-cells = <0>; > > > + #interrupt-cells = <1>; > > > + }; > > > + }; > > > + }; > > > + > > > + xtal: xtal-clk { > > > + compatible = "fixed-clock"; > > > + #clock-cells = <0>; > > > + /* This value must be overridden by the board */ > > > + clock-frequency = <0>; > > > + }; > > > + > > > + soc { > > > + compatible = "simple-bus"; > > > + ranges; > > > + interrupt-parent = <&plic>; > > > + dma-noncoherent; > > > + #address-cells = <1>; > > > + #size-cells = <1>; > > > + > > > + uart0: serial@30002000 { > > > > It's unfortunate that the SDK/documentation calls this peripheral > > both > > UART0 and UART3. I don't know if we can/should put the "M0" and "D0" > > bus > > peripherals in the same DT; it seems like most of the "M0" > > peripherals > > are not accessible from the C906. But if we did, this would conflict > > with the other UART0. > > They're accessible but their interrupts are not, and I think this is > called d0_uart or uart3, but not uart0 at all. > > > > > > + compatible = "bouffalolab,bl808-uart"; > > > + reg = <0x30002000 0x1000>; > > > + interrupts = <20 IRQ_TYPE_LEVEL_HIGH>; > > > + clocks = <&xtal>; > > > > There's a clock controller with a mux and a gate between the crystal > > and the UART. I'm not sure what the policy is about adding "fake" > > suppliers before the real supplier has a binding defined. > > > > Unfortunately, Bouffalolab threw everything and the kitchen sink into > > the GLB register space, so that complicates defining the binding for > > the clock/reset controller part. I think it depends on how backwards/forwards compatible it's going to be? If new kernel + old DT works then that's all that's "required", right? Old kernel + new DT isn't going to work, but that's not required AFAIU. > > > > > + status = "disabled"; > > > + }; > > > + > > > + plic: interrupt-controller@e0000000 { > > > + compatible = "thead,c900-plic"; > > Using a single c900-plic here needs more discussion, I think. Yah. Per the discussion on [1], I think I'd rather we avoided the single c900-plic. Either a SoC-specific value, or "something" involving the "openplic" naming is needed here. Thanks, Conor. 1 - https://lore.kernel.org/linux-riscv/20221121041757.418645-3-uwu@icenowy.me/ > > > + reg = <0xe0000000 0x4000000>; > > > + interrupts-extended = <&cpu0_intc > > > 0xffffffff>, > > > > The C906 PLIC has an M-mode context, so 0xffffffff is not correct. > > This > > should reference the M-mode external interrupt. > > > > > + <&cpu0_intc 9>; > > > + interrupt-controller; > > > + #address-cells = <0>; > > > + #interrupt-cells = <2>; > > > + riscv,ndev = <64>; > > > > The SDK/documentation lists IRQ numbers up to BL808_IRQ_PDS == 82, so > > this value should be at least that. > > > > Regards, > > Samuel > > > > > + }; > > > + }; > > > +}; [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Conor Dooley <conor.dooley@microchip.com> To: Icenowy Zheng <uwu@icenowy.me>, Samuel Holland <samuel@sholland.org>, Jisheng Zhang <jszhang@kernel.org> Cc: "Samuel Holland" <samuel@sholland.org>, "Jisheng Zhang" <jszhang@kernel.org>, linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, "Rob Herring" <robh+dt@kernel.org>, "Conor Dooley" <conor@kernel.org>, "Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>, "Paul Walmsley" <paul.walmsley@sifive.com>, "Palmer Dabbelt" <palmer@dabbelt.com>, "Albert Ou" <aou@eecs.berkeley.edu>, "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>, "Jiri Slaby" <jirislaby@kernel.org>, "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com> Subject: Re: [PATCH v2 6/9] riscv: dts: bouffalolab: add the bl808 SoC base device tree Date: Mon, 5 Dec 2022 10:29:43 +0000 [thread overview] Message-ID: <Y43IF/MpM9kX2gD6@wendy> (raw) In-Reply-To: <04abc8d6d8a9200e593f3f667a31ea0d3674c64b.camel@icenowy.me> [-- Attachment #1.1: Type: text/plain, Size: 6818 bytes --] On Mon, Dec 05, 2022 at 04:17:59PM +0800, Icenowy Zheng wrote: > 在 2022-11-30星期三的 01:21 -0600,Samuel Holland写道: > > On 11/27/22 07:24, Jisheng Zhang wrote: > > > Add a baisc dtsi for the bouffalolab bl808 SoC. > > > > > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > > > --- > > > arch/riscv/boot/dts/bouffalolab/bl808.dtsi | 74 > > > ++++++++++++++++++++++ > > > 1 file changed, 74 insertions(+) > > > create mode 100644 arch/riscv/boot/dts/bouffalolab/bl808.dtsi > > > > > > diff --git a/arch/riscv/boot/dts/bouffalolab/bl808.dtsi > > > b/arch/riscv/boot/dts/bouffalolab/bl808.dtsi > > > new file mode 100644 > > > index 000000000000..f4b170ccc32e > > > --- /dev/null > > > +++ b/arch/riscv/boot/dts/bouffalolab/bl808.dtsi > > > @@ -0,0 +1,74 @@ > > > +// SPDX-License-Identifier: (GPL-2.0+ or MIT) > > > +/* > > > + * Copyright (C) 2022 Jisheng Zhang <jszhang@kernel.org> > > > + */ > > > + > > > +#include <dt-bindings/interrupt-controller/irq.h> > > > + > > > +/ { > > > + compatible = "bouffalolab,bl808"; > > > + #address-cells = <1>; > > > + #size-cells = <1>; > > > + > > > + cpus { > > > + timebase-frequency = <1000000>; > > > + #address-cells = <1>; > > > + #size-cells = <0>; > > > + > > > + cpu0: cpu@0 { > > > + compatible = "thead,c906", "riscv"; > > > + device_type = "cpu"; > > > + reg = <0>; > > > + d-cache-block-size = <64>; > > > + d-cache-sets = <256>; > > > + d-cache-size = <32768>; > > > + i-cache-block-size = <64>; > > > + i-cache-sets = <128>; > > > + i-cache-size = <32768>; > > > + mmu-type = "riscv,sv39"; > > > + riscv,isa = "rv64imafdc"; > > > + > > > + cpu0_intc: interrupt-controller { > > > + compatible = "riscv,cpu-intc"; > > > + interrupt-controller; > > > + #address-cells = <0>; > > > + #interrupt-cells = <1>; > > > + }; > > > + }; > > > + }; > > > + > > > + xtal: xtal-clk { > > > + compatible = "fixed-clock"; > > > + #clock-cells = <0>; > > > + /* This value must be overridden by the board */ > > > + clock-frequency = <0>; > > > + }; > > > + > > > + soc { > > > + compatible = "simple-bus"; > > > + ranges; > > > + interrupt-parent = <&plic>; > > > + dma-noncoherent; > > > + #address-cells = <1>; > > > + #size-cells = <1>; > > > + > > > + uart0: serial@30002000 { > > > > It's unfortunate that the SDK/documentation calls this peripheral > > both > > UART0 and UART3. I don't know if we can/should put the "M0" and "D0" > > bus > > peripherals in the same DT; it seems like most of the "M0" > > peripherals > > are not accessible from the C906. But if we did, this would conflict > > with the other UART0. > > They're accessible but their interrupts are not, and I think this is > called d0_uart or uart3, but not uart0 at all. > > > > > > + compatible = "bouffalolab,bl808-uart"; > > > + reg = <0x30002000 0x1000>; > > > + interrupts = <20 IRQ_TYPE_LEVEL_HIGH>; > > > + clocks = <&xtal>; > > > > There's a clock controller with a mux and a gate between the crystal > > and the UART. I'm not sure what the policy is about adding "fake" > > suppliers before the real supplier has a binding defined. > > > > Unfortunately, Bouffalolab threw everything and the kitchen sink into > > the GLB register space, so that complicates defining the binding for > > the clock/reset controller part. I think it depends on how backwards/forwards compatible it's going to be? If new kernel + old DT works then that's all that's "required", right? Old kernel + new DT isn't going to work, but that's not required AFAIU. > > > > > + status = "disabled"; > > > + }; > > > + > > > + plic: interrupt-controller@e0000000 { > > > + compatible = "thead,c900-plic"; > > Using a single c900-plic here needs more discussion, I think. Yah. Per the discussion on [1], I think I'd rather we avoided the single c900-plic. Either a SoC-specific value, or "something" involving the "openplic" naming is needed here. Thanks, Conor. 1 - https://lore.kernel.org/linux-riscv/20221121041757.418645-3-uwu@icenowy.me/ > > > + reg = <0xe0000000 0x4000000>; > > > + interrupts-extended = <&cpu0_intc > > > 0xffffffff>, > > > > The C906 PLIC has an M-mode context, so 0xffffffff is not correct. > > This > > should reference the M-mode external interrupt. > > > > > + <&cpu0_intc 9>; > > > + interrupt-controller; > > > + #address-cells = <0>; > > > + #interrupt-cells = <2>; > > > + riscv,ndev = <64>; > > > > The SDK/documentation lists IRQ numbers up to BL808_IRQ_PDS == 82, so > > this value should be at least that. > > > > Regards, > > Samuel > > > > > + }; > > > + }; > > > +}; [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --] [-- Attachment #2: Type: text/plain, Size: 161 bytes --] _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2022-12-05 10:30 UTC|newest] Thread overview: 88+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-11-27 13:24 [PATCH v2 0/9] riscv: add Bouffalolab bl808 support Jisheng Zhang 2022-11-27 13:24 ` Jisheng Zhang 2022-11-27 13:24 ` [PATCH v2 1/9] dt-bindings: serial: add documentation for Bouffalolab UART Driver Jisheng Zhang 2022-11-27 13:24 ` Jisheng Zhang 2022-11-30 5:45 ` Samuel Holland 2022-11-30 5:45 ` Samuel Holland 2022-12-01 11:02 ` Krzysztof Kozlowski 2022-12-01 11:02 ` Krzysztof Kozlowski 2022-11-27 13:24 ` [PATCH v2 2/9] serial: bflb_uart: add " Jisheng Zhang 2022-11-27 13:24 ` Jisheng Zhang 2022-11-28 6:10 ` Jiri Slaby 2022-11-28 6:10 ` Jiri Slaby 2022-11-28 14:21 ` Jisheng Zhang 2022-11-28 14:21 ` Jisheng Zhang 2022-11-28 16:01 ` Ilpo Järvinen 2022-11-28 16:01 ` Ilpo Järvinen 2022-11-28 23:20 ` Jisheng Zhang 2022-11-28 23:20 ` Jisheng Zhang 2022-11-29 6:32 ` Jiri Slaby 2022-11-29 6:32 ` Jiri Slaby 2022-12-05 20:03 ` kernel test robot 2022-12-05 20:03 ` kernel test robot 2022-11-27 13:24 ` [PATCH v2 3/9] riscv: add the Bouffalolab SoC family Kconfig option Jisheng Zhang 2022-11-27 13:24 ` Jisheng Zhang 2022-11-30 6:48 ` Samuel Holland 2022-11-30 6:48 ` Samuel Holland 2022-11-27 13:24 ` [PATCH v2 4/9] dt-bindings: vendor-prefixes: add bouffalolab Jisheng Zhang 2022-11-27 13:24 ` Jisheng Zhang 2022-11-27 17:23 ` Conor Dooley 2022-11-27 17:23 ` Conor Dooley 2022-12-01 11:03 ` Krzysztof Kozlowski 2022-12-01 11:03 ` Krzysztof Kozlowski 2022-11-27 13:24 ` [PATCH v2 5/9] dt-bindings: riscv: Add bouffalolab bl808 board compatibles Jisheng Zhang 2022-11-27 13:24 ` Jisheng Zhang 2022-11-27 16:25 ` Rob Herring 2022-11-27 16:25 ` Rob Herring 2022-11-27 17:29 ` Conor Dooley 2022-11-27 17:29 ` Conor Dooley 2022-12-01 11:05 ` Krzysztof Kozlowski 2022-12-01 11:05 ` Krzysztof Kozlowski 2022-12-01 11:14 ` Conor Dooley 2022-12-01 11:14 ` Conor Dooley 2022-12-01 11:41 ` Krzysztof Kozlowski 2022-12-01 11:41 ` Krzysztof Kozlowski 2022-11-27 13:24 ` [PATCH v2 6/9] riscv: dts: bouffalolab: add the bl808 SoC base device tree Jisheng Zhang 2022-11-27 13:24 ` Jisheng Zhang 2022-11-27 17:21 ` Conor Dooley 2022-11-27 17:21 ` Conor Dooley 2022-11-28 9:52 ` Icenowy Zheng 2022-11-28 9:52 ` Icenowy Zheng 2022-11-28 14:52 ` Conor Dooley 2022-11-28 14:52 ` Conor Dooley 2022-11-30 7:21 ` Samuel Holland 2022-11-30 7:21 ` Samuel Holland 2022-12-05 8:17 ` Icenowy Zheng 2022-12-05 8:17 ` Icenowy Zheng 2022-12-05 10:29 ` Conor Dooley [this message] 2022-12-05 10:29 ` Conor Dooley 2023-01-04 8:32 ` Michael Walle 2023-01-04 8:32 ` Michael Walle 2022-11-27 13:24 ` [PATCH v2 7/9] riscv: dts: bouffalolab: add Sipeed M1s SoM and Dock devicetree Jisheng Zhang 2022-11-27 13:24 ` Jisheng Zhang 2022-11-27 17:32 ` Conor Dooley 2022-11-27 17:32 ` Conor Dooley 2022-11-30 7:25 ` Samuel Holland 2022-11-30 7:25 ` Samuel Holland 2022-12-05 8:15 ` Icenowy Zheng 2022-12-05 8:15 ` Icenowy Zheng 2022-11-27 13:24 ` [PATCH v2 8/9] MAINTAINERS: riscv: add entry for Bouffalolab SoC Jisheng Zhang 2022-11-27 13:24 ` Jisheng Zhang 2022-11-27 17:35 ` Conor Dooley 2022-11-27 17:35 ` Conor Dooley 2022-11-27 17:36 ` Conor Dooley 2022-11-27 17:36 ` Conor Dooley 2022-11-28 14:30 ` Jisheng Zhang 2022-11-28 14:30 ` Jisheng Zhang 2022-11-28 14:34 ` Jisheng Zhang 2022-11-28 14:34 ` Jisheng Zhang 2022-11-28 14:50 ` Conor Dooley 2022-11-28 14:50 ` Conor Dooley 2022-11-30 7:27 ` Samuel Holland 2022-11-30 7:27 ` Samuel Holland 2022-11-27 13:24 ` [PATCH v2 9/9] riscv: defconfig: enable BOUFFALOLAB SoC Jisheng Zhang 2022-11-27 13:24 ` Jisheng Zhang 2022-11-27 17:36 ` Conor Dooley 2022-11-27 17:36 ` Conor Dooley 2022-12-02 17:54 ` [PATCH v2 0/9] riscv: add Bouffalolab bl808 support Palmer Dabbelt 2022-12-02 17:54 ` Palmer Dabbelt
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=Y43IF/MpM9kX2gD6@wendy \ --to=conor.dooley@microchip.com \ --cc=aou@eecs.berkeley.edu \ --cc=conor@kernel.org \ --cc=devicetree@vger.kernel.org \ --cc=gregkh@linuxfoundation.org \ --cc=ilpo.jarvinen@linux.intel.com \ --cc=jirislaby@kernel.org \ --cc=jszhang@kernel.org \ --cc=krzysztof.kozlowski+dt@linaro.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-riscv@lists.infradead.org \ --cc=linux-serial@vger.kernel.org \ --cc=palmer@dabbelt.com \ --cc=paul.walmsley@sifive.com \ --cc=robh+dt@kernel.org \ --cc=samuel@sholland.org \ --cc=uwu@icenowy.me \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.