Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1703631rwd; Sun, 21 May 2023 04:44:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5StXY/Iw6TLCxEE0E421fH27VgDuNZ+R30wq/8euJFUDTzKUJAZsiWfBbngDf1WeVHHzMc X-Received: by 2002:a17:902:e80e:b0:1af:a049:45d with SMTP id u14-20020a170902e80e00b001afa049045dmr3720174plg.18.1684669470985; Sun, 21 May 2023 04:44:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684669470; cv=none; d=google.com; s=arc-20160816; b=mcmf6vee3dI/8hxl5C4IV4ExWRgbguMtOoXcZ9S4INb1ImSaYPjdhRJkbXDwok7/GD iv+cnsXjJlSIYLd6kqfigZyGSRWJ0h3J/iZPLnp/jgcIRXIRk/hz/8zyKMeIcE1S3aA7 2geWnKs8UVv56NKqDhAVJMCtT94723qqaKP1gOlyLSVSj7/2NCN67NYWQZZfQHyo/czP fR1lwdAL4sgt/fPgSYyVjGUxAZaGX1sh2LoADGUzk7TNbFl81EfYI4lbxrODhvQReC2E ImpF5ay6cO4HzhbKrjNiy7jF7ZtQ06vYf3Iaat5OUQXQP3HBZJ9AWA9DOQ40AnxTU4bR ZRAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hlCo9uTec3cQ7zi95daXBEn9tUftyfNV/XlQZphi0+4=; b=uLlPFfM0vELyBULKECR7jIKyYlMllA8jyx0iB5kET7erz1+dhq7nU9DmlWks8MzahT b9HrBXmj24ZZfM1JJWUrIjIKtK7WUl6CbYrq0WOmFBH/vDJprXWFYJuxiiWYP0e5o3jg wOH1gwsXR3WwqeXXCVM8TYMQ87wBQ8aEQAD2+s48FiEPnRbi6IEacZ3KSYFCScuamflG 6nfXMfT25qb7kAcxVAcl87lSiRidnCQfoBr5Iba0iVFOHPyLgBHuNm2kUABPuPnX1bxj s0Ic5PyBvfWt94irQoo4HDSaUCtaE1qOER1ErfkT7Pk+Qz+RS7pc59j0J4xYgDfRlGXh XNCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="LulV7j/t"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a17-20020a170902ecd100b001a6ff6a83e2si3114771plh.522.2023.05.21.04.44.06; Sun, 21 May 2023 04:44:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="LulV7j/t"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230046AbjEUJk5 (ORCPT + 99 others); Sun, 21 May 2023 05:40:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229511AbjEUJk4 (ORCPT ); Sun, 21 May 2023 05:40:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34B7ECF; Sun, 21 May 2023 02:40:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BD3A160D3A; Sun, 21 May 2023 09:40:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABEE3C433EF; Sun, 21 May 2023 09:40:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684662054; bh=zn+bwbfOWEOxmWCFFGMUlWUHM6muZcBbeHLgBc2cySo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LulV7j/tBHNSTt3ElLvDShJGisLjKgLsLNuy8+Zuxti6O44lTU2sK2viChpxPMbS2 q0rTXLRt8uWQEQLdUvxNn94Fa2MmGLuBgk5xyA3Bb2Y2V3XOt9romGdOXSahOWrTp9 gz1RxOfYKiG83gCgxqX9zPifw43kOsHlHDyavBOmqfn3qLL0Gh6lXQYelLCjSeYU4j NtLpjmmxYqeG/tH/lhBi+PgBv9Rq75RFA+VzJa0TLMtZwVhQUZ9oLekx9mT8OSj/Jz kw7JU5wrgezUS5Nk3NjKHpu57AWl+my6sL4b+jbJ6nKsTskqG7/e6kPBNruLZqPDYD t/u8SJeslUrmQ== Date: Sun, 21 May 2023 17:29:41 +0800 From: Jisheng Zhang To: Conor Dooley Cc: Samuel Holland , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-serial@vger.kernel.org, Palmer Dabbelt , Thomas Gleixner , Marc Zyngier , Palmer Dabbelt , Paul Walmsley , Albert Ou , Greg Kroah-Hartman , Jiri Slaby , Arnd Bergmann Subject: Re: [PATCH v4 06/10] dt-bindings: riscv: Add bouffalolab bl808 board compatibles Message-ID: References: <20230518152244.2178-1-jszhang@kernel.org> <20230518152244.2178-7-jszhang@kernel.org> <20230519-squad-undermine-6124aafebafa@wendy> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230519-squad-undermine-6124aafebafa@wendy> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 19, 2023 at 12:55:02PM +0100, Conor Dooley wrote: > On Thu, May 18, 2023 at 10:31:35PM -0500, Samuel Holland wrote: > > Hi Jisheng, DT maintainers, > > Sick, thanks for piping up Samuel! > Both Rob and Krzysztof are not around at the moment, so that probably > leaves it up to me.. I'm adding Arnd in case he has a take here too. > > > On 5/18/23 10:22, Jisheng Zhang wrote: > > > Several SoMs and boards are available that feature the Bouffalolab > > > bl808 SoC. Document the compatible strings. > > > > > > Signed-off-by: Jisheng Zhang > > > Acked-by: Palmer Dabbelt > > > Reviewed-by: Conor Dooley > > > --- > > > .../bindings/riscv/bouffalolab.yaml | 29 +++++++++++++++++++ > > > 1 file changed, 29 insertions(+) > > > create mode 100644 Documentation/devicetree/bindings/riscv/bouffalolab.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/riscv/bouffalolab.yaml b/Documentation/devicetree/bindings/riscv/bouffalolab.yaml > > > new file mode 100644 > > > index 000000000000..3b25d1a5d04a > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/riscv/bouffalolab.yaml > > > @@ -0,0 +1,29 @@ > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > > +%YAML 1.2 > > > +--- > > > +$id: http://devicetree.org/schemas/riscv/bouffalolab.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: Bouffalo Lab Technology SoC-based boards > > > + > > > +maintainers: > > > + - Jisheng Zhang > > > + > > > +description: > > > + Bouffalo Lab Technology SoC-based boards > > > + > > > +properties: > > > + $nodename: > > > + const: '/' > > > + compatible: > > > + oneOf: > > > + - description: Carrier boards for the Sipeed M1s SoM > > > + items: > > > + - enum: > > > + - sipeed,m1s-dock > > > + - const: sipeed,m1s > > > + - const: bouffalolab,bl808 > > > > As mentioned in the message for patch 5, "The Bouffalolab bl808 SoC > > contains three riscv CPUs, namely M0, D0 and LP. The D0 is 64bit RISC-V > > GC compatible, so can run linux." > > > > I have also been running U-Boot and NOMMU Linux on the less powerful, > > but still quite fast, "M0" core. However, this core needs a different Just FYI, I successfully ran nommu rv32 linux kernel on the "M0" core with some patches to the riscv head and irqchip driver. > > DTB because: > > 1) The CPU is different (T-HEAD E907 instead of C906). > > 2) The interrupt routing is completely different. > > a. The M0 core contains a CLIC instead of a PLIC. > > b. The peripherals in the SoC are split between two buses. Those > > on one bus have their IRQs directly connected to M0, and share > > a multiplexed IRQ connection to D0; and vice versa for the > > other bus. So each bus's interrupt-parent needs to be swapped. > > > > Using some preprocessor magic like we did for Allwinner and Renesas, I > > was able to share most of the SoC and board DTs between the cores[1]. > > However, this still ends up with two DTs for each board. So here are my > > questions: > > - Is this acceptable? > > I expected it to look worse than it actually turned out to be. > I don't think Krzysztof in particular is a fan of having conditional > bits in dts files, but for the shared arm/riscv stuff there was not > really another sensible option. > > > - Is there precedent for how we should name the two board DTs? > > Arnd might have some idea about precedent here, but I like your naming > well enough. > > > - How does this affect the board and SoC compatible strings? > > - Should there be a separate "bouffalolab,bl808-d0" in addition to > > "bouffalolab,bl808"? > > What ordering were you intending here? > "pine64,0x64" "bouffalolab,bl808" "bouffalolab,bl808-d0"? > > That doesn't really seem correct though, as it does not get less specific > as you move right. > > "pine64,0x64" "bouffalolab,bl808-d0" "bouffalolab,bl808" doesn't seem > right either though, for the same sort of reason. > > > - Is it acceptable to use the same board compatible string for both, > > since the _board_ part of the DT does not change, only things > > inside the SoC? what about describing the DT as the SoC is, e.g lp: cpu@0 { ... status = disabled; }; m0: cpu@1 { ... status = disabled; }; d0: cpu@2 { ... status = disabled; }; Then in m0 dts: &m0 { status = okay; }; in d0 dts: &m0 { status = okay; }; > > I think you may need to have 2 compatibles per board, depending on which > cpu. Perhaps even as verbose as: > "pine61,0x64-d0" "pine64,0x64" "bouffalolab,bl808-d0" "bouffalolab,bl808" > > Not exactly straightforward though, is it! > > > It would be possible to avoid having two DTs per board by guarding all > > of the differences behind "#ifdef CONFIG_64BIT", but that seems wrong > > because you would end up with two totally incompatible DTBs named the > > same thing, depending on how the DTB was built. > > I think having 2 dtbs is fine, and as I mentioned, I've seen Krzysztof > complain previously about conditional bits like that. > > Cheers, > Conor.