Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2333765rdb; Thu, 21 Sep 2023 15:55:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJcJIeSjJ+QDZuRUOg1QeIrMEH2YNACUAINTGXFGrS9WHhuXRfLvIU5cwdO8bzGQRWCkAT X-Received: by 2002:a05:6a21:789b:b0:15d:721e:44d8 with SMTP id bf27-20020a056a21789b00b0015d721e44d8mr2383927pzc.4.1695336952889; Thu, 21 Sep 2023 15:55:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695336952; cv=none; d=google.com; s=arc-20160816; b=r8IjSFR15AUW20h5ExWsJgX2hc8TyFnFvjqy/7CGZTJRS7cAfPZiDhnkREnYEQa9tj sfFR+pbxx0uCVN1LdL8Pl/Uqj99JySi+ObFOpfyVyIACTNOtGO19NoPRy1x8RI7SFGzr cc/dCRdnVc9nK/rVsxteKvQc8q1Ax4XYhylRBQnrflWyabkdgbM3f53xx3dFVUIJmXJH PfgqlkjbjF3zftvu6MFc2RDrT8WgJAlosyAgBXA5z4+zjMvh6Grv2qar9Y490MpTMrZj lMinNs9GzqiRKFyz9DZRvlvUTMmwjGG4Zh/c4002T3QWH8pNa6ghoCVyNDMdxrfd+n+k 4s2w== 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=0IKpw092SrJp2gnCnlvHA6saOt+HNPaHwSySp0tb4Yw=; fh=8is5k64RVmUpbI6rCMDWNb/XixDfrt0O/Am6aBwVSPc=; b=AUFPcJlExcT7hIp40WHBS4VLFJByBLCa3+lBzha4mfeIS8JIZrREtq3TTynzb8i0RJ /pP4NuYF8fwmFsieWcoeIPC67n6D0DbvpMOnV1/GxMsk9HZcMUiUCqI6X3x5yJDlbsNI KwpHqLsB6aOOSez/yKr4Lph9ijIlKJeqpQuz8vNoSQLVfMRpWiq+HFH+4Xbc6pkVgIMr VZfQBEspoOUCJITD9lVQz6Rh/LuNYJOloRLnw9u49hC6KUxh/ElKER+D7jx3Tk2uByqi XB+DlT/HpP3/9eziQEoDB2pt347HnoI0PRqws3WqdTavprZjyLAuPVtTiSZig7WNd4PA HrHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FB4UmtJM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id y3-20020a17090a86c300b00276945c92a1si4635304pjv.88.2023.09.21.15.55.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 15:55:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FB4UmtJM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 296D981A0594; Thu, 21 Sep 2023 14:03:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232281AbjIUVDX (ORCPT + 99 others); Thu, 21 Sep 2023 17:03:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232033AbjIUVC7 (ORCPT ); Thu, 21 Sep 2023 17:02:59 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACDF64EC8 for ; Thu, 21 Sep 2023 10:22:31 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 984F5C3278F; Thu, 21 Sep 2023 10:15:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695291338; bh=jFAqRCOVnDBQwszMKppgpfrfYXgx2S1l2UVTVChzJ6o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FB4UmtJMfn+nsX5DZ3qo2JYzuPEw/NKKLuoRNU1w4rR862MDRN47bHTygae5k0amd oZFJeZk6psc3v49kSRgSuKWnb6qSVKyWIinaBQSDn8SnNX157QjRg+M7ghCNAs3yIU ddyCNZdvngVyPb/heuhDlL/snul1qeJW5/53Yr5XQMnxSg0nftB0P18lUPoG8WAeur RATGdFpyQDj/qc5sLQfrnbG7H8S0URXgZ05YATQsuMLKwjM6cQVpwfw2AHy0km/r03 Eso5n0WarjMTlhsqZh/NdkDgeUkgZbhiyBsuJ+tCvNZQCrUQgDenOwzJfsS63ybdQ3 Z28EfOHcPvUig== Date: Thu, 21 Sep 2023 11:15:32 +0100 From: Conor Dooley To: Chen Wang Cc: Conor Dooley , aou@eecs.berkeley.edu, chao.wei@sophgo.com, devicetree@vger.kernel.org, emil.renner.berthing@canonical.com, guoren@kernel.org, jszhang@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, palmer@dabbelt.com, paul.walmsley@sifive.com, robh+dt@kernel.org, xiaoguang.xing@sophgo.com, Chen Wang , Inochi Amaoto Subject: Re: [PATCH v2 09/11] riscv: dts: add initial SOPHGO SG2042 SoC device tree Message-ID: <20230921-d2db829b289c937081dc8a72@fedora> References: <20230920-financial-declared-7b4b4baae517@wendy> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fmkZD3PJDOz3F1Rh" Content-Disposition: inline In-Reply-To: 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,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 21 Sep 2023 14:03:49 -0700 (PDT) --fmkZD3PJDOz3F1Rh Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 21, 2023 at 05:56:28PM +0800, Chen Wang wrote: > Regards, >=20 > unicornx >=20 > Conor Dooley =E4=BA=8E2023=E5=B9=B49=E6=9C= =8820=E6=97=A5=E5=91=A8=E4=B8=89 16:58=E5=86=99=E9=81=93=EF=BC=9A > > > > Yo, > > > > On Wed, Sep 20, 2023 at 02:40:32PM +0800, Chen Wang wrote: > > > Milk-V Pioneer motherboard is powered by SOPHON's SG2042. > > > > > > SG2042 is server grade chip with high performance, low power > > > consumption and high data throughput. > > > Key features: > > > - 64 RISC-V cpu cores which implements IMAFDC > > > > That's not quite true though, is it? >=20 > The cpu cores of SG2042 is c902 from T-HEAD, it supports vector, but > it's v0.7, not official v1.0. If we declare it as supporting > v-extension, the latest kernel(since 6.5) will issue rvv1.0 > instructions during booting and make c902 crash. So we have to remove > "v" from the capability of ISA to pass the booting of machine. You can > check the "riscv,isa =3D "rv64imafdc";" in DTS. I know all of this, not my first rodeo looking at stuff using T-Head cores ;) What I meant was, imafdc is only a subset of what is supported, there are other things like the T-Head bitmanip extensions too, right? I'm not asking for it to be listed in the devicetree (yet), just actually curious what else is on the c920 as I do not speak a language that allows me to read the documentation for the cpu that I have been able to find online. > > > - 4 cores per cluster, 16 clusters on chip > > > - ...... > > > > What's a "....."? ;) > I just cited a description from TRM of SG2042 and it looks too long. I > will give a better description here and avoid using "......" in the > next revision. >=20 > > > > > > > > More info is available at [1]. > > > > > > [1]: https://en.sophgo.com/product/introduce/sg2042.html > > > > Link: please. > > > > > Currently only support booting into console with only uart, > > > other features will be added soon later. > > > > > > Acked-by: Xiaoguang Xing > > > Signed-off-by: Xiaoguang Xing > > > Signed-off-by: Inochi Amaoto > > > Signed-off-by: Emil Renner Berthing > > > Signed-off-by: Chen Wang > > > > There are 4 sign-offs here. Surely some of these should be > > co-developed-bys? > > > > > + cpu0: cpu@0 { > > > + compatible =3D "thead,c920", "riscv"; > > > + device_type =3D "cpu"; > > > + riscv,isa =3D "rv64imafdc"; > > > > Please also add riscv,isa-base & riscv,isa-extensions. > > > > > + reg =3D <0>; > > > + i-cache-block-size =3D <64>; > > > + i-cache-size =3D <65536>; > > > + i-cache-sets =3D <512>; > > > + d-cache-block-size =3D <64>; > > > + d-cache-size =3D <65536>; > > > + d-cache-sets =3D <512>; > > > + next-level-cache =3D <&l2_cache0>; > > > + mmu-type =3D "riscv,sv39"; > > > + > > > + cpu0_intc: interrupt-controller { > > > + compatible =3D "riscv,cpu-intc"; > > > + interrupt-controller; > > > + #interrupt-cells =3D <1>; > > > + }; > > > + }; > > > > > diff --git a/arch/riscv/boot/dts/sophgo/sg2042.dtsi b/arch/riscv/boot= /dts/sophgo/sg2042.dtsi > > > new file mode 100644 > > > index 000000000000..747fd9764c95 > > > --- /dev/null > > > +++ b/arch/riscv/boot/dts/sophgo/sg2042.dtsi > > > @@ -0,0 +1,439 @@ > > > +// SPDX-License-Identifier: GPL-2.0 OR MIT > > > > You should add () around the GPL-2.0 OR MIT. > > > > > +/* > > > + * Copyright (C) 2022 Sophgo Technology Inc. All rights reserved. > > > + */ > > > + > > > +/dts-v1/; > > > +#include > > > + > > > +#include "sg2042-cpus.dtsi" > > > + > > > +#define SOC_PERIPHERAL_IRQ(nr) (nr) > > > > Why? What does this do? Where was it copied from? > > > It should be unnecessary=EF=BC=8C I will remove it in the next revision. >=20 > > > + > > > +/ { > > > + compatible =3D "sophgo,sg2042"; > > > + #address-cells =3D <2>; > > > + #size-cells =3D <2>; > > > + dma-noncoherent; > > > + > > > + aliases { > > > + serial0 =3D &uart0; > > > + }; > > > + > > > + /* the mem node will be updated by ZSBL. */ > > > > huh? So these are random numbers below? Either put something useful here > > or delete it please. >=20 > The memory for SG2042 is not fixed, the bootloader will detect memory > installed on board during booting and fill the actual address and size > in the memory node. The comment " /* the mem node will be updated by > ZSBL. */" is telling this. Yes, I read the comment! > We write memory nodes like this to make them act just as placeholders > and the value is by default written as zero. Why knowingly add something that is wrong, rather than omitting them entirely? Thanks, Conor. >=20 >=20 > > > > > + memory@0 { > > > + device_type =3D "memory"; > > > + reg =3D <0x00000000 0x00000000 0x00000000 0x00000000>; > > > + }; > > > + > > > + memory@1 { > > > + device_type =3D "memory"; > > > + reg =3D <0x00000000 0x00000001 0x00000000 0x00000000>; > > > + }; > > > + > > > + memory@2 { > > > + device_type =3D "memory"; > > > + reg =3D <0x00000000 0x00000002 0x00000000 0x00000000>; > > > + }; > > > + > > > + memory@3 { > > > + device_type =3D "memory"; > > > + reg =3D <0x00000000 0x00000003 0x00000000 0x00000000>; > > > + }; > > > > > + soc: soc { > > > + compatible =3D "simple-bus"; > > > + #address-cells =3D <2>; > > > + #size-cells =3D <2>; > > > + ranges; > > > + > > > + clint_mswi: interrupt-controller@7094000000 { > > > + compatible =3D "sophgo,sg2042-clint-mswi", "the= ad,c900-clint-mswi"; > > > + reg =3D <0x00000070 0x94000000 0x00000000 0x000= 04000>; > > > > & nak to this without further explanation! > > > > Thanks, > > Conor. > > --fmkZD3PJDOz3F1Rh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZQwXwQAKCRB4tDGHoIJi 0jl6AQCO0iHjWqM9oAoOC3vM0RKXtmi36doTgL/y4uLTh6RcxgEApx827mJwlqM+ T2Mfp1BE1i0rJvGerwlfpLGvc4y8Pws= =djLA -----END PGP SIGNATURE----- --fmkZD3PJDOz3F1Rh--