Message ID | IA1PR20MB49532560A3CA2670A0EAB846BBCEA@IA1PR20MB4953.namprd20.prod.outlook.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1799821vqo; Mon, 9 Oct 2023 04:29:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6sdd3zEjMTo6BqidIpEwjDNCm56g44tRMD4aODAjlIELwqoTH6AlA34apElCKmrs/R8T6 X-Received: by 2002:a17:902:7893:b0:1bc:6c8:cded with SMTP id q19-20020a170902789300b001bc06c8cdedmr14305174pll.67.1696850972935; Mon, 09 Oct 2023 04:29:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696850972; cv=pass; d=google.com; s=arc-20160816; b=XU+ziz9dTz8SpZ9rD3mVRvB51STGpZwB/jGrXtAwoYcTkajBUBhmJF5ff4tTVPtY9y KUksHVlTK7uAVhof/3rt2w/oYeVqDfKOFVJ2FxXXENY1WEAHFEbefM6xxPeEKIJhmwAC ppPoEKD6e6bD19iaG0++a3HeDZrvRPcDMnpzszVbvOU7umiZ5vrCbgrwiNDgxYxqumT7 hiPTzAXu/AoYFST2Yu0CeyecaYY7ujuKtmnZG6xAROM0npmyygteXTmoSWTadOJribsW vLEPQl5yhSBh+YbzA9BWfHT2TLRFx2ra+kxmdBI8jlmRlGqcg/DZmqbfbWCtjIvj9BDM 7F9Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6IttFsZmWbuo/ioO2E6XMM0wPsbeCqH6n87b8vDr/Ho=; fh=jdQ31Tz3LHgVfMSs0EEgQEi1BiId7RxGfLARZWSDsWQ=; b=YMiWadSGTKoPL5aa6jSy4Eh64KSDHAEI3fl476gu/MmyQ0wI1y98p1Du0Qp53w5ocH sSylsI/UfKGDwSfPWX6SUVBkGDxTXxmk4TK6xiJ7vddNLfZqSPxcld86yrTJ5kgH9Xiv o52yG8Rva1cC8qNOX+eqE59MlDa5dMY7e/HE9siC5pPxFip4F1MPIelziC5Wu3rbPktm 4F7zTZ9xSZvubcDAv7hn3MP+AgU0GTLrsoC5Waikt1EgK/eGooUdxrnCUKxrSrLDdGin ic7SY+Oezim5D8oGhF7dQwdSuSyAcrhsFF5KJk/n4x4T7gwHlEhJAS/0ZOR9aNGb9Yqw YFPA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=GgIHnoQR; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id ko7-20020a17090307c700b001c20db25108si8831532plb.41.2023.10.09.04.29.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 04:29:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=GgIHnoQR; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id E33FB80398EF; Mon, 9 Oct 2023 04:29:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346226AbjJIL2v (ORCPT <rfc822;ezelljr.billy@gmail.com> + 18 others); Mon, 9 Oct 2023 07:28:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346281AbjJIL2h (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 9 Oct 2023 07:28:37 -0400 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02olkn2037.outbound.protection.outlook.com [40.92.44.37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE0D6AB; Mon, 9 Oct 2023 04:28:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mebWXH6KM0IOlwUkzPCdMd5Jlbmzvknxo2omosZ3zEUCrHLg5e83J9bPng5z3ZHqtxm6fthXXXeQ+cweEDGztLnPUO0ww4iIXK5r4Rs+LKXYmmRZlX1yjK+VuKcMtQzBtGDBbrBiQFRZTLVOvY3E5SMCY7pdhlsPhL1x+QlciHVgrmAx/Rdv0wSTQdC4cdUry45uaiXMLvAqFwo9apwq5ojgXWcxwIK0HCtN23s5GeV1wRuS8VOIZjcb+ScT+PyktHAcfe8OeEQxn8xvM0zhCQhnjAb4Cj22rTI1pv46LRv21b0n/IIYevAly7LQ29wGPxU0fckSVn+uEQwgpjohpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6IttFsZmWbuo/ioO2E6XMM0wPsbeCqH6n87b8vDr/Ho=; b=XukAV85qCY2arppXDn7/O/h6MBxwM0sWAzJGuZ3rNLEXQyqae3ChWHOeIIASySL2Y9jLGJWurv/yKUvLx9UhtmUY5RB46/kp6j6CjBE5mnMtYe7WrLeHBuBUzbloIxdMH0REFW2vOs23WSZkp7fr/nnbMGXgoGiGCv7evOUWumCTrxoR0Ug00va5sA2YeCiaiP5zKLRTsqwszpGstynf8Es4mE8ORjYj46IFcpPB4+wocrdt5HD19x71FjDxLgPUYTeFhHv3Jp+4OLHNmozbelI0vlRMYZfMNlzI0QrBjzQ27JqtPG8Ch7Hc50l4APrkkU46f7g56MfMOXuU93n03w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6IttFsZmWbuo/ioO2E6XMM0wPsbeCqH6n87b8vDr/Ho=; b=GgIHnoQRESyQxe13+CRftlzsG+yx6jwoE0QDyvNBYOYYO9ix3A+sgrTDHg1PVVhquKVGr5z+jlu3Ego6z3aXw5fKfAKSV9KOzJi26Mzm9NX+HmtqbBYgewev41OuhzmPaeZSrotfl8qrYnvj4HRyTCQW28VY9ILoLLdzniliRLsAVFbrHBUt51LwIQ4drbr/amnHhqWhmaZcJQ82bNX6e7Uu/uUQyMLS5B29uxCwMFKEDAp4Msk4BSqXuk8QMOu5bY3gsl64am1Cd9iaC7guFTLh4Mpr2dWtIYg9NnjLf9Q+3renunrVzVWXig5iNVt65QurQqyZSEb4qH6n1Esj5g== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by PH0PR20MB6129.namprd20.prod.outlook.com (2603:10b6:510:2a2::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.37; Mon, 9 Oct 2023 11:26:58 +0000 Received: from IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::d050:882f:a8a7:8263]) by IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::d050:882f:a8a7:8263%5]) with mapi id 15.20.6838.040; Mon, 9 Oct 2023 11:26:58 +0000 From: Inochi Amaoto <inochiama@outlook.com> To: Chao Wei <chao.wei@sophgo.com>, Chen Wang <unicorn_wang@outlook.com>, Conor Dooley <conor@kernel.org>, Rob Herring <robh+dt@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> Cc: Jisheng Zhang <jszhang@kernel.org>, Inochi Amaoto <inochiama@outlook.com>, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v2 4/7] riscv: dts: sophgo: Separate common devices from cv1800b soc Date: Mon, 9 Oct 2023 19:26:35 +0800 Message-ID: <IA1PR20MB49532560A3CA2670A0EAB846BBCEA@IA1PR20MB4953.namprd20.prod.outlook.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231009112642.477337-1-inochiama@outlook.com> References: <IA1PR20MB49531C1C34C3E972DBBA4151BBCEA@IA1PR20MB4953.namprd20.prod.outlook.com> <20231009112642.477337-1-inochiama@outlook.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [VoTnJ72mA8S040VgJxervUTWhdojVV3liCHQszPll70=] X-ClientProxiedBy: TYCP301CA0049.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:384::13) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20231009112642.477337-4-inochiama@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|PH0PR20MB6129:EE_ X-MS-Office365-Filtering-Correlation-Id: df777fea-78ed-462c-e53c-08dbc8baa61c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Yh5YgJejdk2XQeQNIqiPzTdsEEaot33VAyQhC9HbCYcAvKHtuY0ezlwVf9CHwfdJVtFXUJLiIe7LVlTM/LCPxSKsdnAhl0e0boodH6ozctoVxqB0SpGHjvRNBeyM2idGI3sqP+y9iZo/NYGhSzC6FuuoyHQuEdll/1Vxn98rJwSQps+vaUeSFSgmzk8RKAO2AT/HrekM+JDB2R9qwTv6MHudxCeiwYPe4eSXxPf7mFjHVAjaMQ7jR0IGNlqBNvEsSjwqqC5hfpEYAYTvty1Jh/QTT8eC+CoHghmdmYugeyRtM2ZJ2bw4rJo9nV82XKrQzIGJadbvpK31q4+d56pIV0HMT+HeHnYSqi0czJCd3qXmYCDWoJ98K4OXmj1h2BHPzfnOZOBT/jXF9X2z7NmIxqqemK1nGzxPrLw1fZ1Xk9jidElLjdKR5loJgy8yW5UmDRCpqVR5eCKeuPQgPDO+Vu75SI01z0a6yY+vUusB3kZbl75WFGfoTkBoxcRIc/8OFSvIk3qnPhVs7bZ4+rkaZJbKPJ4UEGrcOu9hQyh3TT2TcxdLBWlt4d1hOAdGcyDp2Ab86XUzu+Wb8V0wL9mH+Ia5NhUF7Tu6j8R4BUM1vE623xHa4Y/TtgbIoiGyV2bv X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: E2ZnhJGqZEJbDqcQz9Rh4ZLMT2VY50BjwyxrVjnQO2b5+iIuixDu496j0y58JfM+2miWKSIdnCxuP3f1z/23dh97gMNMoFhAZQ/RQcbNBri3no4UAwwv4/FmcdQ56g/2f/FOEo3MY6Vu7sq4iYV0GECI6YEj2W/pm2K8BVu7G54opIp6SZyJsMnRJeKsLcIn61a2Gb8XrEljmMxTqikHk7p3HrZ1oL7I6/emGnNPS/vK5/Ug9HUAga5VatHLUPNzK2iVH2vs5zEehnQtqylItz5XPjFFLb9iqp3iq73LYocxY7TjjiCjj2vkctVfOtSqdFt3iQnHIsFwn+3HLb10KxGLa9dl69g+2U9FKCcQuhVjw9agahJtnvVIzlzUJHSm1z8zmxplYJIgoO1ZG6rO9jqqTNrZh8haEXoITBVL26L5EP0zXNEUKn4aNBdPdqQa38y/WWw2hIWb94Dk4sLNd+F5Hgkaj8LiW81AjwSuQxpsrz3fLtZb8wZIcCTqHUFZ0PotNqmwit5BBW1uVcw/kG4UaPyPFjnOLCQ2tqAfoNlC+/9AbYDu1ErbsmJJxO8k98F9Al07FGiQ1VRpYDFmwoEG/7bncrFq8CVduPqS1jtv2GFEuOxxQ5nYr1C4Kne/bHlhVlFYzvHspByCA0xENHOjj91eGsSdCfMESxObP09mZsYS0Y0QYHkjlCKpDbhu1sB8YBp4Fx9DClTVACpi8/Y75g/Xg7o10SqQNDM59nPVzw5+ijXkmbrSpmp8h/Spz2oCQLKPuJf6/za3Zb6LkOEAM4FwZlPCo2UuXW37eUSdrrq4CPOf44hD0FIMHraNQdfdRegcWwLtsMqsPxyerK5UPomxkNUpadYJSwxafoj7jihvcpjNcIR7wmbiUZiVCqBPkrupgSp29huz/VVFkU+3Z9n0c1R3YwHuxkHgwj/ccL0Skc2PD1QfD3WarPty1NOBPBiU2q2jdnUg9h9SJfTlhfGLezso/yKC+tOXFaJxSZA69lzQScAPeGyNAZkiA2iKBAk9h0zIx2E+Gp3goNWMeDhRqohCqQdHDS4xCx0ek10844vFHbegC8hf6EZiBt2UF3LbhARfmC4OgWeCuvjtuO2sCB/21HnWz6sbVWr+V3eql4SUlam35eFZc9Hy0tUA2YrYYICDeM91tByoKyj6U5UAeoAc/EXtO+L9tM9VzcOPtg0qXSElc4HzDfo53dFkEDb6u5y/ioc3/xAOoBgmgMPfmRQPBrW5c03swwA= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: df777fea-78ed-462c-e53c-08dbc8baa61c X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 11:26:58.8555 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR20MB6129 X-Spam-Status: No, score=3.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Mon, 09 Oct 2023 04:29:23 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779277205823068646 X-GMAIL-MSGID: 1779277205823068646 |
Series |
Add Huashan Pi board support
|
|
Commit Message
Inochi Amaoto
Oct. 9, 2023, 11:26 a.m. UTC
Move the cpu and the common peripherals of CV181x and CV180x to new file.
Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
---
arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 95 +------------------
.../dts/sophgo/{cv1800b.dtsi => cv180x.dtsi} | 19 +---
2 files changed, 2 insertions(+), 112 deletions(-)
copy arch/riscv/boot/dts/sophgo/{cv1800b.dtsi => cv180x.dtsi} (80%)
--
2.42.0
Comments
On 2023/10/9 19:26, Inochi Amaoto wrote: > Move the cpu and the common peripherals of CV181x and CV180x to new file. > > Signed-off-by: Inochi Amaoto <inochiama@outlook.com> > --- > arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 95 +------------------ > .../dts/sophgo/{cv1800b.dtsi => cv180x.dtsi} | 19 +--- > 2 files changed, 2 insertions(+), 112 deletions(-) > copy arch/riscv/boot/dts/sophgo/{cv1800b.dtsi => cv180x.dtsi} (80%) > > diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > index df40e87ee063..0904154f9829 100644 > --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > +++ b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi Hi,Jisheng Do you have any more comment on this change related to cv1800b? > @@ -3,106 +3,13 @@ > * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> > */ > > -#include <dt-bindings/interrupt-controller/irq.h> > +#include "cv180x.dtsi" > > / { > 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@4140000 { > - 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@4150000 { > - 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@4160000 { > - 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@4170000 { > - 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@41c0000 { > - 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"; > diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv180x.dtsi > similarity index 80% > copy from arch/riscv/boot/dts/sophgo/cv1800b.dtsi > copy to arch/riscv/boot/dts/sophgo/cv180x.dtsi > index df40e87ee063..ffaf51724c98 100644 > --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > +++ b/arch/riscv/boot/dts/sophgo/cv180x.dtsi > @@ -1,12 +1,12 @@ > // SPDX-License-Identifier: (GPL-2.0 OR MIT) > /* > * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> > + * Copyright (C) 2023 Inochi Amaoto <inochiama@outlook.com> > */ > > #include <dt-bindings/interrupt-controller/irq.h> > > / { > - compatible = "sophgo,cv1800b"; > #address-cells = <1>; > #size-cells = <1>; > > @@ -48,7 +48,6 @@ osc: oscillator { > > soc { > compatible = "simple-bus"; > - interrupt-parent = <&plic>; > #address-cells = <1>; > #size-cells = <1>; > dma-noncoherent; > @@ -103,21 +102,5 @@ uart4: serial@41c0000 { > 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>; > - }; > - > - clint: timer@74000000 { > - compatible = "sophgo,cv1800b-clint", "thead,c900-clint"; > - reg = <0x74000000 0x10000>; > - interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>; > - }; > }; > }; > -- > 2.42.0 >
On 2023/10/9 19:26, Inochi Amaoto wrote: > Move the cpu and the common peripherals of CV181x and CV180x to new file. > > Signed-off-by: Inochi Amaoto <inochiama@outlook.com> > --- > arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 95 +------------------ > .../dts/sophgo/{cv1800b.dtsi => cv180x.dtsi} | 19 +--- > 2 files changed, 2 insertions(+), 112 deletions(-) > copy arch/riscv/boot/dts/sophgo/{cv1800b.dtsi => cv180x.dtsi} (80%) LGTM Acked-by: Chen Wang <unicorn_wang@outlook.com> > diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > index df40e87ee063..0904154f9829 100644 > --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > +++ b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > @@ -3,106 +3,13 @@ > * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> > */ > > -#include <dt-bindings/interrupt-controller/irq.h> > +#include "cv180x.dtsi" > > / { > 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@4140000 { > - 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@4150000 { > - 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@4160000 { > - 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@4170000 { > - 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@41c0000 { > - 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"; > diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv180x.dtsi > similarity index 80% > copy from arch/riscv/boot/dts/sophgo/cv1800b.dtsi > copy to arch/riscv/boot/dts/sophgo/cv180x.dtsi > index df40e87ee063..ffaf51724c98 100644 > --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > +++ b/arch/riscv/boot/dts/sophgo/cv180x.dtsi > @@ -1,12 +1,12 @@ > // SPDX-License-Identifier: (GPL-2.0 OR MIT) > /* > * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> > + * Copyright (C) 2023 Inochi Amaoto <inochiama@outlook.com> > */ > > #include <dt-bindings/interrupt-controller/irq.h> > > / { > - compatible = "sophgo,cv1800b"; > #address-cells = <1>; > #size-cells = <1>; > > @@ -48,7 +48,6 @@ osc: oscillator { > > soc { > compatible = "simple-bus"; > - interrupt-parent = <&plic>; > #address-cells = <1>; > #size-cells = <1>; > dma-noncoherent; > @@ -103,21 +102,5 @@ uart4: serial@41c0000 { > 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>; > - }; > - > - clint: timer@74000000 { > - compatible = "sophgo,cv1800b-clint", "thead,c900-clint"; > - reg = <0x74000000 0x10000>; > - interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>; > - }; > }; > }; > -- > 2.42.0 >
Yo, On Mon, Oct 09, 2023 at 07:26:35PM +0800, Inochi Amaoto wrote: > Move the cpu and the common peripherals of CV181x and CV180x to new file. > > Signed-off-by: Inochi Amaoto <inochiama@outlook.com> > --- > arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 95 +------------------ > .../dts/sophgo/{cv1800b.dtsi => cv180x.dtsi} | 19 +--- > 2 files changed, 2 insertions(+), 112 deletions(-) > copy arch/riscv/boot/dts/sophgo/{cv1800b.dtsi => cv180x.dtsi} (80%) > > diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > index df40e87ee063..0904154f9829 100644 > --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > +++ b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > @@ -3,106 +3,13 @@ > * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> > */ > > -#include <dt-bindings/interrupt-controller/irq.h> > +#include "cv180x.dtsi" > > / { > 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@4140000 { > - 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@4150000 { > - 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@4160000 { > - 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@4170000 { > - 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@41c0000 { > - 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"; > diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv180x.dtsi > similarity index 80% > copy from arch/riscv/boot/dts/sophgo/cv1800b.dtsi > copy to arch/riscv/boot/dts/sophgo/cv180x.dtsi > index df40e87ee063..ffaf51724c98 100644 Firstly, this form of diff really threw me, I was quite confused for a few minutes. A copy plus a pair of diffs doesn't really make much sense, when the operation being carried is an extraction of some nodes to a different file. > --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > +++ b/arch/riscv/boot/dts/sophgo/cv180x.dtsi > @@ -1,12 +1,12 @@ > // SPDX-License-Identifier: (GPL-2.0 OR MIT) > /* > * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> > + * Copyright (C) 2023 Inochi Amaoto <inochiama@outlook.com> Also, is moving around some bits of hw description really a copyrightable change? > */ > > #include <dt-bindings/interrupt-controller/irq.h> > > / { > - compatible = "sophgo,cv1800b"; > #address-cells = <1>; > #size-cells = <1>; > > @@ -48,7 +48,6 @@ osc: oscillator { > > soc { > compatible = "simple-bus"; > - interrupt-parent = <&plic>; > #address-cells = <1>; > #size-cells = <1>; > dma-noncoherent; > @@ -103,21 +102,5 @@ uart4: serial@41c0000 { > 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>; > - }; > - > - clint: timer@74000000 { > - compatible = "sophgo,cv1800b-clint", "thead,c900-clint"; > - reg = <0x74000000 0x10000>; > - interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>; > - }; > }; > }; What I wanted to comment on was this though - it seems that both the cv1800b and the cv1812h have identical plic and clint nodes, other than their compatibles? If that is the case, why create a cv1800b and a cv1812h specific file containing entirely new nodes, when overriding the compatible would be sufficient? Doubly so if the other SoCs in the cv18xx series are going to have identical layouts. I gave it a quick test locally with the below diff applied on top of this series - although I didn't make sure that I didn't re-order the plic & clint nodes, I just wanted to demonstrate what I had done. Cheers, Conor. -- 8< -- diff --git a/arch/riscv/boot/dts/sophgo/cv1800b-milkv-duo.dts b/arch/riscv/boot/dts/sophgo/cv1800b-milkv-duo.dts index 3af9e34b3bc7..a9d809a49e7a 100644 --- a/arch/riscv/boot/dts/sophgo/cv1800b-milkv-duo.dts +++ b/arch/riscv/boot/dts/sophgo/cv1800b-milkv-duo.dts @@ -5,7 +5,7 @@ /dts-v1/; -#include "cv1800b.dtsi" +#include "cv180x.dtsi" / { model = "Milk-V Duo"; diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi index 0904154f9829..e69de29bb2d1 100644 --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi +++ b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: (GPL-2.0 OR MIT) -/* - * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> - */ - -#include "cv180x.dtsi" - -/ { - compatible = "sophgo,cv1800b"; - - soc { - interrupt-parent = <&plic>; - - 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>; - }; - - clint: timer@74000000 { - compatible = "sophgo,cv1800b-clint", "thead,c900-clint"; - reg = <0x74000000 0x10000>; - interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>; - }; - }; -}; diff --git a/arch/riscv/boot/dts/sophgo/cv180x.dtsi b/arch/riscv/boot/dts/sophgo/cv180x.dtsi index 64ffb23d3626..1a2c44ba4de9 100644 --- a/arch/riscv/boot/dts/sophgo/cv180x.dtsi +++ b/arch/riscv/boot/dts/sophgo/cv180x.dtsi @@ -48,6 +48,7 @@ osc: oscillator { soc { compatible = "simple-bus"; + interrupt-parent = <&plic>; #address-cells = <1>; #size-cells = <1>; dma-noncoherent; @@ -174,5 +175,21 @@ uart4: serial@41c0000 { 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>; + }; + + clint: timer@74000000 { + compatible = "sophgo,cv1800b-clint", "thead,c900-clint"; + reg = <0x74000000 0x10000>; + interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>; + }; }; }; diff --git a/arch/riscv/boot/dts/sophgo/cv1812h.dtsi b/arch/riscv/boot/dts/sophgo/cv1812h.dtsi index 3864d34b0100..c0a8d3290cc8 100644 --- a/arch/riscv/boot/dts/sophgo/cv1812h.dtsi +++ b/arch/riscv/boot/dts/sophgo/cv1812h.dtsi @@ -15,22 +15,13 @@ memory@80000000 { }; soc { - interrupt-parent = <&plic>; plic: interrupt-controller@70000000 { compatible = "sophgo,cv1812h-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>; }; clint: timer@74000000 { compatible = "sophgo,cv1812h-clint", "thead,c900-clint"; - reg = <0x74000000 0x10000>; - interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>; }; }; };
>Yo, > >On Mon, Oct 09, 2023 at 07:26:35PM +0800, Inochi Amaoto wrote: >> Move the cpu and the common peripherals of CV181x and CV180x to new file. >> >> Signed-off-by: Inochi Amaoto <inochiama@outlook.com> >> --- >> arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 95 +------------------ >> .../dts/sophgo/{cv1800b.dtsi => cv180x.dtsi} | 19 +--- >> 2 files changed, 2 insertions(+), 112 deletions(-) >> copy arch/riscv/boot/dts/sophgo/{cv1800b.dtsi => cv180x.dtsi} (80%) >> >> diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi >> index df40e87ee063..0904154f9829 100644 >> --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi >> +++ b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi >> @@ -3,106 +3,13 @@ >> * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> >> */ >> >> -#include <dt-bindings/interrupt-controller/irq.h> >> +#include "cv180x.dtsi" >> >> / { >> 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@4140000 { >> - 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@4150000 { >> - 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@4160000 { >> - 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@4170000 { >> - 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@41c0000 { >> - 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"; >> diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv180x.dtsi >> similarity index 80% >> copy from arch/riscv/boot/dts/sophgo/cv1800b.dtsi >> copy to arch/riscv/boot/dts/sophgo/cv180x.dtsi >> index df40e87ee063..ffaf51724c98 100644 > >Firstly, this form of diff really threw me, I was quite confused for a >few minutes. A copy plus a pair of diffs doesn't really make much sense, >when the operation being carried is an extraction of some nodes to a >different file. > I was told to use -C/-M/-B to generate patch, and the git format-patch give me this wired output if I use -C, using -M seems no change from v1. The -B output is also disappointing. Maybe I need to generate agaion? The v1 version: https://lore.kernel.org/linux-riscv/IA1PR20MB495360B632D106BBB833D82ABBCFA@IA1PR20MB4953.namprd20.prod.outlook.com/ >> --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi >> +++ b/arch/riscv/boot/dts/sophgo/cv180x.dtsi >> @@ -1,12 +1,12 @@ >> // SPDX-License-Identifier: (GPL-2.0 OR MIT) >> /* >> * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> >> + * Copyright (C) 2023 Inochi Amaoto <inochiama@outlook.com> > >Also, is moving around some bits of hw description really a >copyrightable change? > It seems to be a mistake when I splitting the patch from v1. This copyright should in the next patch. >> */ >> >> #include <dt-bindings/interrupt-controller/irq.h> >> >> / { >> - compatible = "sophgo,cv1800b"; >> #address-cells = <1>; >> #size-cells = <1>; >> >> @@ -48,7 +48,6 @@ osc: oscillator { >> >> soc { >> compatible = "simple-bus"; >> - interrupt-parent = <&plic>; >> #address-cells = <1>; >> #size-cells = <1>; >> dma-noncoherent; >> @@ -103,21 +102,5 @@ uart4: serial@41c0000 { >> 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>; >> - }; >> - >> - clint: timer@74000000 { >> - compatible = "sophgo,cv1800b-clint", "thead,c900-clint"; >> - reg = <0x74000000 0x10000>; >> - interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>; >> - }; >> }; >> }; > >What I wanted to comment on was this though - it seems that both the >cv1800b and the cv1812h have identical plic and clint nodes, other than >their compatibles? If that is the case, why create a cv1800b and a >cv1812h specific file containing entirely new nodes, when overriding the >compatible would be sufficient? Doubly so if the other SoCs in the >cv18xx series are going to have identical layouts. > >I gave it a quick test locally with the below diff applied on top of >this series - although I didn't make sure that I didn't re-order the >plic & clint nodes, I just wanted to demonstrate what I had done. > Thanks for demonstration. AFAIK, what you said is true. the most devices of CV180x and CV181x are the same, including plic and clint. The reason I used a new one is to identify these two devices without making the compatible string confusing. Should I change the binding name of plic and clint to "sophgo,cv1800-xxx" to mark there are the same series? I think this can avoid this confusing dt nodes. >Cheers, >Conor. >
Sorry for the wrong title. >Yo, > >On Mon, Oct 09, 2023 at 07:26:35PM +0800, Inochi Amaoto wrote: >> Move the cpu and the common peripherals of CV181x and CV180x to new file. >> >> Signed-off-by: Inochi Amaoto <inochiama@outlook.com> >> --- >> arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 95 +------------------ >> .../dts/sophgo/{cv1800b.dtsi => cv180x.dtsi} | 19 +--- >> 2 files changed, 2 insertions(+), 112 deletions(-) >> copy arch/riscv/boot/dts/sophgo/{cv1800b.dtsi => cv180x.dtsi} (80%) >> >> diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi >> index df40e87ee063..0904154f9829 100644 >> --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi >> +++ b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi >> @@ -3,106 +3,13 @@ >> * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> >> */ >> >> -#include <dt-bindings/interrupt-controller/irq.h> >> +#include "cv180x.dtsi" >> >> / { >> 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@4140000 { >> - 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@4150000 { >> - 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@4160000 { >> - 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@4170000 { >> - 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@41c0000 { >> - 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"; >> diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv180x.dtsi >> similarity index 80% >> copy from arch/riscv/boot/dts/sophgo/cv1800b.dtsi >> copy to arch/riscv/boot/dts/sophgo/cv180x.dtsi >> index df40e87ee063..ffaf51724c98 100644 > >Firstly, this form of diff really threw me, I was quite confused for a >few minutes. A copy plus a pair of diffs doesn't really make much sense, >when the operation being carried is an extraction of some nodes to a >different file. > I was told to use -C/-M/-B to generate patch, and the git format-patch give me this wired output if I use -C, using -M seems no change from v1. The -B output is also disappointing. Maybe I need to generate agaion? The v1 version: https://lore.kernel.org/linux-riscv/IA1PR20MB495360B632D106BBB833D82ABBCFA@IA1PR20MB4953.namprd20.prod.outlook.com/ >> --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi >> +++ b/arch/riscv/boot/dts/sophgo/cv180x.dtsi >> @@ -1,12 +1,12 @@ >> // SPDX-License-Identifier: (GPL-2.0 OR MIT) >> /* >> * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> >> + * Copyright (C) 2023 Inochi Amaoto <inochiama@outlook.com> > >Also, is moving around some bits of hw description really a >copyrightable change? > It seems to be a mistake when I splitting the patch from v1. This copyright should in the next patch. >> */ >> >> #include <dt-bindings/interrupt-controller/irq.h> >> >> / { >> - compatible = "sophgo,cv1800b"; >> #address-cells = <1>; >> #size-cells = <1>; >> >> @@ -48,7 +48,6 @@ osc: oscillator { >> >> soc { >> compatible = "simple-bus"; >> - interrupt-parent = <&plic>; >> #address-cells = <1>; >> #size-cells = <1>; >> dma-noncoherent; >> @@ -103,21 +102,5 @@ uart4: serial@41c0000 { >> 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>; >> - }; >> - >> - clint: timer@74000000 { >> - compatible = "sophgo,cv1800b-clint", "thead,c900-clint"; >> - reg = <0x74000000 0x10000>; >> - interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>; >> - }; >> }; >> }; > >What I wanted to comment on was this though - it seems that both the >cv1800b and the cv1812h have identical plic and clint nodes, other than >their compatibles? If that is the case, why create a cv1800b and a >cv1812h specific file containing entirely new nodes, when overriding the >compatible would be sufficient? Doubly so if the other SoCs in the >cv18xx series are going to have identical layouts. > >I gave it a quick test locally with the below diff applied on top of >this series - although I didn't make sure that I didn't re-order the >plic & clint nodes, I just wanted to demonstrate what I had done. > Thanks for demonstration. AFAIK, what you said is true. the most devices of CV180x and CV181x are the same, including plic and clint. The reason I used a new one is to identify these two devices without making the compatible string confusing. Should I change the binding name of plic and clint to "sophgo,cv1800-xxx" to mark there are the same series? I think this can avoid this confusing dt nodes. >Cheers, >Conor. >
On Fri, Oct 13, 2023 at 05:52:03PM +0800, Inochi Amaoto wrote: > Sorry for the wrong title. > > >Yo, > > > >On Mon, Oct 09, 2023 at 07:26:35PM +0800, Inochi Amaoto wrote: > >> Move the cpu and the common peripherals of CV181x and CV180x to new file. > >> > >> Signed-off-by: Inochi Amaoto <inochiama@outlook.com> > >> --- > >> arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 95 +------------------ > >> .../dts/sophgo/{cv1800b.dtsi => cv180x.dtsi} | 19 +--- > >> 2 files changed, 2 insertions(+), 112 deletions(-) > >> copy arch/riscv/boot/dts/sophgo/{cv1800b.dtsi => cv180x.dtsi} (80%) > >> > >> diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > >> index df40e87ee063..0904154f9829 100644 > >> --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > >> +++ b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > >> @@ -3,106 +3,13 @@ > >> * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> > >> */ > >> > >> -#include <dt-bindings/interrupt-controller/irq.h> > >> +#include "cv180x.dtsi" > >> > >> / { > >> 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@4140000 { > >> - 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@4150000 { > >> - 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@4160000 { > >> - 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@4170000 { > >> - 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@41c0000 { > >> - 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"; > >> diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv180x.dtsi > >> similarity index 80% > >> copy from arch/riscv/boot/dts/sophgo/cv1800b.dtsi > >> copy to arch/riscv/boot/dts/sophgo/cv180x.dtsi > >> index df40e87ee063..ffaf51724c98 100644 > > > >Firstly, this form of diff really threw me, I was quite confused for a > >few minutes. A copy plus a pair of diffs doesn't really make much sense, > >when the operation being carried is an extraction of some nodes to a > >different file. > > > > I was told to use -C/-M/-B to generate patch, and the git format-patch > give me this wired output if I use -C, using -M seems no change from v1. > The -B output is also disappointing. Maybe I need to generate agaion? I don't think generating it again is going to change the outcome & I don't really think the -C version of this patch makes much sense, it is hard to tell what has actually been moved. > The v1 version: > https://lore.kernel.org/linux-riscv/IA1PR20MB495360B632D106BBB833D82ABBCFA@IA1PR20MB4953.namprd20.prod.outlook.com/ > > >> --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > >> +++ b/arch/riscv/boot/dts/sophgo/cv180x.dtsi > >> @@ -1,12 +1,12 @@ > >> // SPDX-License-Identifier: (GPL-2.0 OR MIT) > >> /* > >> * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> > >> + * Copyright (C) 2023 Inochi Amaoto <inochiama@outlook.com> > > > >Also, is moving around some bits of hw description really a > >copyrightable change? > > > > It seems to be a mistake when I splitting the patch from v1. > This copyright should in the next patch. > > >> */ > >> > >> #include <dt-bindings/interrupt-controller/irq.h> > >> > >> / { > >> - compatible = "sophgo,cv1800b"; > >> #address-cells = <1>; > >> #size-cells = <1>; > >> > >> @@ -48,7 +48,6 @@ osc: oscillator { > >> > >> soc { > >> compatible = "simple-bus"; > >> - interrupt-parent = <&plic>; > >> #address-cells = <1>; > >> #size-cells = <1>; > >> dma-noncoherent; > >> @@ -103,21 +102,5 @@ uart4: serial@41c0000 { > >> 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>; > >> - }; > >> - > >> - clint: timer@74000000 { > >> - compatible = "sophgo,cv1800b-clint", "thead,c900-clint"; > >> - reg = <0x74000000 0x10000>; > >> - interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>; > >> - }; > >> }; > >> }; > > > >What I wanted to comment on was this though - it seems that both the > >cv1800b and the cv1812h have identical plic and clint nodes, other than > >their compatibles? If that is the case, why create a cv1800b and a > >cv1812h specific file containing entirely new nodes, when overriding the > >compatible would be sufficient? Doubly so if the other SoCs in the > >cv18xx series are going to have identical layouts. > > > >I gave it a quick test locally with the below diff applied on top of > >this series - although I didn't make sure that I didn't re-order the > >plic & clint nodes, I just wanted to demonstrate what I had done. > > > > Thanks for demonstration. AFAIK, what you said is true. the most devices > of CV180x and CV181x are the same, including plic and clint. The reason I > used a new one is to identify these two devices without making the > compatible string confusing. > Should I change the binding name of plic and clint to "sophgo,cv1800-xxx" > to mark there are the same series? I think this can avoid this confusing > dt nodes. I personally don't find the compatibles (or the dt nodes) confusing, so I dunno. Having reusing the compatible is not something that I am a fan of either, since this seems to be a different soc (given the sram & coprocessor etc) even if the addresses of the peripherals are identical.
> >On Fri, Oct 13, 2023 at 05:52:03PM +0800, Inochi Amaoto wrote: >> Sorry for the wrong title. >> >>> Yo, >>> >>> On Mon, Oct 09, 2023 at 07:26:35PM +0800, Inochi Amaoto wrote: >>>> Move the cpu and the common peripherals of CV181x and CV180x to new file. >>>> >>>> Signed-off-by: Inochi Amaoto <inochiama@outlook.com> >>>> --- >>>> arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 95 +------------------ >>>> .../dts/sophgo/{cv1800b.dtsi => cv180x.dtsi} | 19 +--- >>>> 2 files changed, 2 insertions(+), 112 deletions(-) >>>> copy arch/riscv/boot/dts/sophgo/{cv1800b.dtsi => cv180x.dtsi} (80%) >>>> >>>> diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi >>>> index df40e87ee063..0904154f9829 100644 >>>> --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi >>>> +++ b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi >>>> @@ -3,106 +3,13 @@ >>>> * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> >>>> */ >>>> >>>> -#include <dt-bindings/interrupt-controller/irq.h> >>>> +#include "cv180x.dtsi" >>>> >>>> / { >>>> 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@4140000 { >>>> - 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@4150000 { >>>> - 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@4160000 { >>>> - 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@4170000 { >>>> - 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@41c0000 { >>>> - 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"; >>>> diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv180x.dtsi >>>> similarity index 80% >>>> copy from arch/riscv/boot/dts/sophgo/cv1800b.dtsi >>>> copy to arch/riscv/boot/dts/sophgo/cv180x.dtsi >>>> index df40e87ee063..ffaf51724c98 100644 >>> >>> Firstly, this form of diff really threw me, I was quite confused for a >>> few minutes. A copy plus a pair of diffs doesn't really make much sense, >>> when the operation being carried is an extraction of some nodes to a >>> different file. >>> >> >> I was told to use -C/-M/-B to generate patch, and the git format-patch >> give me this wired output if I use -C, using -M seems no change from v1. >> The -B output is also disappointing. Maybe I need to generate agaion? > >I don't think generating it again is going to change the outcome & I >don't really think the -C version of this patch makes much sense, it is >hard to tell what has actually been moved. > I mean regenerating without -C, This shows the the code move, but it gives a huge output, since the git can not detect this move and output all the moved line in the diff as changed. >> The v1 version: >> https://lore.kernel.org/linux-riscv/IA1PR20MB495360B632D106BBB833D82ABBCFA@IA1PR20MB4953.namprd20.prod.outlook.com/ >> >>>> --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi >>>> +++ b/arch/riscv/boot/dts/sophgo/cv180x.dtsi >>>> @@ -1,12 +1,12 @@ >>>> // SPDX-License-Identifier: (GPL-2.0 OR MIT) >>>> /* >>>> * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> >>>> + * Copyright (C) 2023 Inochi Amaoto <inochiama@outlook.com> >>> >>> Also, is moving around some bits of hw description really a >>> copyrightable change? >>> >> >> It seems to be a mistake when I splitting the patch from v1. >> This copyright should in the next patch. >> >>>> */ >>>> >>>> #include <dt-bindings/interrupt-controller/irq.h> >>>> >>>> / { >>>> - compatible = "sophgo,cv1800b"; >>>> #address-cells = <1>; >>>> #size-cells = <1>; >>>> >>>> @@ -48,7 +48,6 @@ osc: oscillator { >>>> >>>> soc { >>>> compatible = "simple-bus"; >>>> - interrupt-parent = <&plic>; >>>> #address-cells = <1>; >>>> #size-cells = <1>; >>>> dma-noncoherent; >>>> @@ -103,21 +102,5 @@ uart4: serial@41c0000 { >>>> 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>; >>>> - }; >>>> - >>>> - clint: timer@74000000 { >>>> - compatible = "sophgo,cv1800b-clint", "thead,c900-clint"; >>>> - reg = <0x74000000 0x10000>; >>>> - interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>; >>>> - }; >>>> }; >>>> }; >>> >>> What I wanted to comment on was this though - it seems that both the >>> cv1800b and the cv1812h have identical plic and clint nodes, other than >>> their compatibles? If that is the case, why create a cv1800b and a >>> cv1812h specific file containing entirely new nodes, when overriding the >>> compatible would be sufficient? Doubly so if the other SoCs in the >>> cv18xx series are going to have identical layouts. >>> >>> I gave it a quick test locally with the below diff applied on top of >>> this series - although I didn't make sure that I didn't re-order the >>> plic & clint nodes, I just wanted to demonstrate what I had done. >>> >> >> Thanks for demonstration. AFAIK, what you said is true. the most devices >> of CV180x and CV181x are the same, including plic and clint. The reason I >> used a new one is to identify these two devices without making the >> compatible string confusing. >> Should I change the binding name of plic and clint to "sophgo,cv1800-xxx" >> to mark there are the same series? I think this can avoid this confusing >> dt nodes. > >I personally don't find the compatibles (or the dt nodes) confusing, so >I dunno. Having reusing the compatible is not something that I am a fan of >either, since this seems to be a different soc (given the sram & >coprocessor etc) even if the addresses of the peripherals are identical. Thanks. It is more like I have misunderstood something. > >
On Fri, Oct 13, 2023 at 10:08:24AM +0100, Conor Dooley wrote: > Yo, > > On Mon, Oct 09, 2023 at 07:26:35PM +0800, Inochi Amaoto wrote: > > Move the cpu and the common peripherals of CV181x and CV180x to new file. > > ... > > }; > > }; > > What I wanted to comment on was this though - it seems that both the > cv1800b and the cv1812h have identical plic and clint nodes, other than > their compatibles? If that is the case, why create a cv1800b and a > cv1812h specific file containing entirely new nodes, when overriding the > compatible would be sufficient? Doubly so if the other SoCs in the > cv18xx series are going to have identical layouts. > > I gave it a quick test locally with the below diff applied on top of > this series - although I didn't make sure that I didn't re-order the > plic & clint nodes, I just wanted to demonstrate what I had done. > > Cheers, > Conor. > > -- 8< -- > > diff --git a/arch/riscv/boot/dts/sophgo/cv1800b-milkv-duo.dts b/arch/riscv/boot/dts/sophgo/cv1800b-milkv-duo.dts > index 3af9e34b3bc7..a9d809a49e7a 100644 > --- a/arch/riscv/boot/dts/sophgo/cv1800b-milkv-duo.dts > +++ b/arch/riscv/boot/dts/sophgo/cv1800b-milkv-duo.dts > @@ -5,7 +5,7 @@ > > /dts-v1/; > > -#include "cv1800b.dtsi" > +#include "cv180x.dtsi" > > / { > model = "Milk-V Duo"; > diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > index 0904154f9829..e69de29bb2d1 100644 > --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > +++ b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi > @@ -1,30 +0,0 @@ > -// SPDX-License-Identifier: (GPL-2.0 OR MIT) > -/* > - * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> > - */ > - > -#include "cv180x.dtsi" > - > -/ { > - compatible = "sophgo,cv1800b"; > - > - soc { > - interrupt-parent = <&plic>; > - > - 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>; > - }; > - > - clint: timer@74000000 { > - compatible = "sophgo,cv1800b-clint", "thead,c900-clint"; > - reg = <0x74000000 0x10000>; > - interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>; > - }; > - }; > -}; > diff --git a/arch/riscv/boot/dts/sophgo/cv180x.dtsi b/arch/riscv/boot/dts/sophgo/cv180x.dtsi > index 64ffb23d3626..1a2c44ba4de9 100644 > --- a/arch/riscv/boot/dts/sophgo/cv180x.dtsi > +++ b/arch/riscv/boot/dts/sophgo/cv180x.dtsi > @@ -48,6 +48,7 @@ osc: oscillator { > > soc { > compatible = "simple-bus"; > + interrupt-parent = <&plic>; > #address-cells = <1>; > #size-cells = <1>; > dma-noncoherent; > @@ -174,5 +175,21 @@ uart4: serial@41c0000 { > 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>; > + }; > + > + clint: timer@74000000 { > + compatible = "sophgo,cv1800b-clint", "thead,c900-clint"; > + reg = <0x74000000 0x10000>; > + interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>; > + }; > }; > }; > diff --git a/arch/riscv/boot/dts/sophgo/cv1812h.dtsi b/arch/riscv/boot/dts/sophgo/cv1812h.dtsi > index 3864d34b0100..c0a8d3290cc8 100644 > --- a/arch/riscv/boot/dts/sophgo/cv1812h.dtsi > +++ b/arch/riscv/boot/dts/sophgo/cv1812h.dtsi > @@ -15,22 +15,13 @@ memory@80000000 { > }; > > soc { > - interrupt-parent = <&plic>; > > plic: interrupt-controller@70000000 { > compatible = "sophgo,cv1812h-plic", "thead,c900-plic"; Hi Conor, Maybe this has been discussed before but I didn't find it. I'm wondering the reason of adding each plic and clint binding for each SoC, can we just use the thead,c900-plic for plic? FWICT, arm gic dt usage follows this way, there's no binding for each SoC's gic but directly use "arm,gic-v3" and so on. Thanks in advance > - reg = <0x70000000 0x4000000>; > - interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>; > - interrupt-controller; > - #address-cells = <0>; > - #interrupt-cells = <2>; > - riscv,ndev = <101>; > }; > > clint: timer@74000000 { > compatible = "sophgo,cv1812h-clint", "thead,c900-clint"; > - reg = <0x74000000 0x10000>; > - interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>;
> Maybe this has been discussed before but I didn't find it. I'm wondering > the reason of adding each plic and clint binding for each SoC, can we > just use the thead,c900-plic for plic? > FWICT, arm gic dt usage follows this way, there's no binding for each SoC's > gic but directly use "arm,gic-v3" and so on. I'm not aware of why the gic-v3 is done like this, but having different compatibles allows differentiation between implementations/integrations of this interrupt controller. I think having that ability is especially helpful given T-Head have open-sourced a bunch of their IP.
diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi index df40e87ee063..0904154f9829 100644 --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi +++ b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi @@ -3,106 +3,13 @@ * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> */ -#include <dt-bindings/interrupt-controller/irq.h> +#include "cv180x.dtsi" / { 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@4140000 { - 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@4150000 { - 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@4160000 { - 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@4170000 { - 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@41c0000 { - 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"; diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv180x.dtsi similarity index 80% copy from arch/riscv/boot/dts/sophgo/cv1800b.dtsi copy to arch/riscv/boot/dts/sophgo/cv180x.dtsi index df40e87ee063..ffaf51724c98 100644 --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi +++ b/arch/riscv/boot/dts/sophgo/cv180x.dtsi @@ -1,12 +1,12 @@ // SPDX-License-Identifier: (GPL-2.0 OR MIT) /* * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> + * Copyright (C) 2023 Inochi Amaoto <inochiama@outlook.com> */ #include <dt-bindings/interrupt-controller/irq.h> / { - compatible = "sophgo,cv1800b"; #address-cells = <1>; #size-cells = <1>; @@ -48,7 +48,6 @@ osc: oscillator { soc { compatible = "simple-bus"; - interrupt-parent = <&plic>; #address-cells = <1>; #size-cells = <1>; dma-noncoherent; @@ -103,21 +102,5 @@ uart4: serial@41c0000 { 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>; - }; - - clint: timer@74000000 { - compatible = "sophgo,cv1800b-clint", "thead,c900-clint"; - reg = <0x74000000 0x10000>; - interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>; - }; }; };