Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2376953rwd; Fri, 19 May 2023 05:06:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6fDUiY3o8UJVrJYd92PEYzfF6owEh7RGb8nw8C8JdzILKG03zD+UchPatkoFXT1j46KtZa X-Received: by 2002:a05:6a21:9008:b0:109:c0c9:f087 with SMTP id tq8-20020a056a21900800b00109c0c9f087mr1593884pzb.23.1684498002423; Fri, 19 May 2023 05:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684498002; cv=none; d=google.com; s=arc-20160816; b=pJ2nX5mWhxtSRAWiZbiaybgffflrCkSCYusWGy5mqRZ5VvXwAKvvg2CLfcsQsN7G1s DBq0WdyVXZWsOgoMkWO+QY4DdxeQ5p5j7nR5P5Xs9WfCEGzvoGA5X6aOppiCehH793hh aJW+56V87WRyOZ1pnGXWbbHmj+Uw73MiEgngWeUPG3Ckbm6webKwVb+/DhLiiHSWdyUG 5esM+JVkA5ngM7cOrHpOXWhjS+GeNb2Ywjb3WWMtRZIRuKMomJn8LoWWPvdnFvOxKoGs aoqpZ2zRKnZtuQ7GTrO3xVWrXDaIZ9dlA8K3vJc90UvPi8a7P2Hj4T9AcPsl1pJk9Ust cqkg== 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=GZC/weKfbb689CF/rSB8uk/rCRukkuxbE5o26l5sL1g=; b=bXBSvPEk+58q91KdmGn1meZ/hoWE+fwPxHW6ZE0UBIz4NEofmS7E7mjVOkwAeLBN/E dggdd9Qm0Ml2D179MAQ9EYHML1sXYr82c9EffS541k4J5bpskn6q+HOG0CGLALaAcaw/ ThmchN2+sYk6TJw7fdg49HUWce8s5lLUYcP9oLwrM6v7GXRR4Xuo4UlL2WVImHKbbThU VTMuNKp/JZIAF2ShDlWU88R1tvbWlJWW6urZZSh124DVGaytl3vumIUsXAEqC+Xlpizn V5JN/KaVmvXx2qFGILOKjAo/Dhyr1w7/Vw4UICPvl3FBJ2hi6VE9wG+88FMfehuDHeBc 6n/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=YthhLdx4; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n7-20020a6543c7000000b0053071414c3asi3387957pgp.562.2023.05.19.05.06.30; Fri, 19 May 2023 05:06:42 -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=@microchip.com header.s=mchp header.b=YthhLdx4; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231717AbjESLza (ORCPT + 99 others); Fri, 19 May 2023 07:55:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229972AbjESLz3 (ORCPT ); Fri, 19 May 2023 07:55:29 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FBCD191; Fri, 19 May 2023 04:55:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1684497328; x=1716033328; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=ZcnD1s9sB8FFoJCCwAYWXI3hUc+y0AnVUaksQh1t5oY=; b=YthhLdx4CS3XELfxLHioR1+9GNrJt2q81drKB8VR7LtAb2CX1fhlaXTf aKEKalHMVHPfTFplE5layI5DaQj0mrL4OtYx9XR/ZRzrTD0DXUPLL77FM f3fZidlmePAFf0Wkty77ExnW4iEDXLfnq85YU2hE9TUkjzhGmAZqaM9Ma J3m+DlbVFLwMDpgWVefB4jDa735SQRZoYohQ+IWBfpIS7wHqxGiF8XR4/ C8h6Lfjbf9XoRjx7CYPey1NGLw1ulU4yvaQeyLBpqnjx57mYaiV/T6xoN fBE1QvItW6bQ8zVDFx0t5a5mTWLUDOvn9y/nEPR5ogDQt/GUh1J9Dqggd w==; X-IronPort-AV: E=Sophos;i="6.00,176,1681196400"; d="asc'?scan'208";a="214581983" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 19 May 2023 04:55:27 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Fri, 19 May 2023 04:55:26 -0700 Received: from wendy (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Fri, 19 May 2023 04:55:24 -0700 Date: Fri, 19 May 2023 12:55:02 +0100 From: Conor Dooley To: Samuel Holland CC: Jisheng Zhang , Rob Herring , Krzysztof Kozlowski , Conor Dooley , , , , , 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: <20230519-squad-undermine-6124aafebafa@wendy> References: <20230518152244.2178-1-jszhang@kernel.org> <20230518152244.2178-7-jszhang@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LxBuwS+otbeaG+3j" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 --LxBuwS+otbeaG+3j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. > >=20 > > 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= =2Eyaml > >=20 > > 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 >=20 > 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." >=20 > 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 > 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. >=20 > 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? 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. --LxBuwS+otbeaG+3j Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZGdjlgAKCRB4tDGHoIJi 0tAQAQCdbojzTmY2QrZpKQo0nj8+qxFONs8VYRfCsU2Xg2afPAEAtrBzj/r6BfCS 68C3HwnUUv5Vx+6SNWmBVEN/782qPAM= =iT9e -----END PGP SIGNATURE----- --LxBuwS+otbeaG+3j--