Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2756800rdb; Fri, 22 Sep 2023 07:38:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF+5ttN4le3LknaaAZR/6t4sQJr881V1QJtFfI+mgzlKKePlfdQpUb7KcerH9/nxnGrZT9o X-Received: by 2002:a05:6a20:5483:b0:155:1710:664a with SMTP id i3-20020a056a20548300b001551710664amr4718227pzk.18.1695393538412; Fri, 22 Sep 2023 07:38:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695393538; cv=pass; d=google.com; s=arc-20160816; b=BZM7BzSvp0PVWziWMVwzc5jkz2AlQ0bQdvTXNb3Cz64gLJj0T8reexYm9b+xt/K7sf +Zb9CgqePrjGP4y+6zStz/VN22N1EJDuzg5aQ3joAwmqD9ko2DBqFdLJNExghhCVLKn3 F2c3FKv7vk5jWgL2fWl5smQtwrcCG6nF9eygI9vImA8zdYzy/oWIQsL1r/0xtJYRMGnp 1+0YYZGChM0WdFviF7wkAioWsSU3CcmxllmhW9GMDuYCDv1sz3tdRyVyoXhDwC2DftFk JHlEjxwWg3yZWkpbjyvV/75mD36b9+sWmM2shHWzgXW4mGpA6Zpkh8hHoeB/o8Kfhaqx c3Vw== 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=nD4BLs26vobSSri7AQGCY2GUyFMyL8gjki2dHbJ/pKw=; fh=oxzxHHRRB2y4OLaoS3Egbz7oFDAuG/8suLOrC0nasyY=; b=sA9vkFjXDfC5g705mI1l4IakiXqTJXX5VlX0URLu3LqL+xURoK863z+Uc2QwV3Wbgq Kv6T/nBS6tj6H10zEe/2wl8wh8ChpWuydB23tolXdKdePIFBMzJaBzV5F5TIWARBhl1g klaQ4aM8TZ7JjBeFhNeSQyjMyfmBdpVGEhB6q3x/4H3OTOniL6RvNgG+er07mebP4DQm J1FxaImsIn74FGmyrLoLtcAgrjIc/UepXHMIV7ew4U6T+80bAi7I+OIpCVm9/K+zzlPH fyTq7ASg7pucN7vTerMt1Dj51/5Huqn3WUw0Ub4RwQkJ6j+uzyA85ix/XWrUEim27OtO 6a6g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=eXJSFv5r; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id y18-20020a056a00181200b00690a75a318asi4382343pfa.67.2023.09.22.07.38.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 07:38:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=eXJSFv5r; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 7A84884AF1C5; Thu, 21 Sep 2023 22:17:23 -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 S230461AbjIVFRN (ORCPT + 99 others); Fri, 22 Sep 2023 01:17:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230379AbjIVFRK (ORCPT ); Fri, 22 Sep 2023 01:17:10 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10olkn2075.outbound.protection.outlook.com [40.92.40.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62B7918F; Thu, 21 Sep 2023 22:17:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MUB5slVhuME6g9EaHTBkDBiJSyg7a29FC4N3kgK2STFqDNbGUaa7o3rDAJKLiK1wfiAB/uvyPDldgg1JbZuvUjW+iH+QUQhokVrSRrUx8EJ2f6W86uv3MCja7I5IWXlnSyUTpDm27/kSlVKY5GSj/skOP8Bg1H56qMmhq2VmmQT3gBUGdMLOtP9cNv6+Cg/0vOv+0Q/1vaLQYbV5ITJ4hkl9vj5VR4ESAs5wcfckjRxIeaNxXcAlNSwDAHUVH/dgUJ48+Kdqn/4Yr9Iu/c0/iRSGI/OH46wDHtDCXbW2YQnzm5IGIsQpAnfyqf7Fi09DMCgpQz+TS9hHpKk5BgC/CQ== 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=nD4BLs26vobSSri7AQGCY2GUyFMyL8gjki2dHbJ/pKw=; b=kpdQsoSwh6MgLMCyjI7NvpdNokWLVD6weadmIOaQ2eXJMek0LpH1X7/IbLA3lCWgvzx4X9NUQEag0c+d1klARnBxQxFB/uyqGMwQJbCmrenBVoncqf6mOR6U5h+UYqndsKMNTA3dTZ7BtOzQZZ5WmbnQ4itXymStGTmeby6pJp0soqshUvTsrLNWdXmsTieCsDYYQegPkANXWqH6A73mgasGr+K/RYD8PWeaxFMdN5KcdEJmMlm4ApekBxGuV6N5Oed29QvCeJwQOjH5vxdCtmZEdFhDgdwAZp64x5jJjFknn7U+giWxePW++mDH7+ZpXfys9NtpQw/lsajGQTz61Q== 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=nD4BLs26vobSSri7AQGCY2GUyFMyL8gjki2dHbJ/pKw=; b=eXJSFv5r0IzjiVEKFIV6BefhAxPGvUtdLg961yefPuYxWwchXzL2hd4OTDkdSYGl6Brwh6g9VxPnTEG5tensDVw+q5XbrioIHH8Zupv0+YplwLW+RU/d52NBN0wzDYj/NuzVoCpyJHccf16jJNimY4IZZ5sybYx5WSX7QHBQJTkXPWl17otB/zOxJxnC5PAOPWHK8zxNeVCk/Ims2qMZghQeH8JhdiTuH/YuUifA7KuivuHfPqmt7X9yGyLOo752YBLFmLtnVPOxrh8W+KonB/340mjBBBJrsmBO/4zxKPO40vMYU6b/Szmxhh5/CEXVE/WVpo7Yh6NuIqOwdpg4Ew== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by DS0PR20MB5664.namprd20.prod.outlook.com (2603:10b6:8:13b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.30; Fri, 22 Sep 2023 05:17:01 +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.6813.017; Fri, 22 Sep 2023 05:17:01 +0000 From: Inochi Amaoto To: Conor Dooley Cc: Anup Patel , Krzysztof Kozlowski , aou@eecs.berkeley.edu, chao.wei@sophgo.com, evicetree@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 06/11] dt-bindings: timer: Add Sophgo sg2042 clint Date: Fri, 22 Sep 2023 13:16:35 +0800 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230920-992a56b66366f3c0591a6a94@fedora> References: <20230920-992a56b66366f3c0591a6a94@fedora> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TMN: [2pN40UUBm1/G+N940wNCYJE6oncjwZUc3/+mEEEgvzk=] X-ClientProxiedBy: TYCPR01CA0056.jpnprd01.prod.outlook.com (2603:1096:405:2::20) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20230922051636.30743-1-inochiama@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|DS0PR20MB5664:EE_ X-MS-Office365-Filtering-Correlation-Id: 01267ccb-7f6d-410b-8045-08dbbb2b248a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yujMIR3hYweCWQLNscOY1aU6zILYRML1ZHBV3cF1ZxKXkVn/iOYf0PaT90uHB7qsOWvXXwWa9YHTU62rH3o7ocZab0knJRm4VDijy8TNwNuuWyK9vx8/26z4JxXScgBSGLpbIwrX+hHx2PLQRJYRG9JVrX4ne/fwAolSBn7PwTlMtrx4N60zGn4Df/Fqi97UCYYafIYUKyhZ/8QuGuzIakAxFL+Rj8brTsPOIyotsXDw/ivUK5r1ZBvVYuE5b38ODhI7BIJCY79p3WNSpQj0v7kodrGndTSE2EgUwM/QYblss7Ucup+0gXMF8sn7rBQtzy1ZEy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xSGlnTy96MGtmV0JqOUZCdWN6dVJ3?= =?utf-8?B?bVdacllXZHhYZEZqa3pkZnpqMldaWVEvTG9HeThjeXByWG90VlE5b1kxYm10?= =?utf-8?B?MEV3cGkvdnFBUlRKN0JaQWsxbFJJTEszeldVMlRKTm11QzhzK2sySUxBRWNv?= =?utf-8?B?K2VkK0ptcGo3NHNhZFNId3JOKzEyUWJjb2orNHZoL3Vsbk1pZW9RemQzazlL?= =?utf-8?Q?qDi06AVIOucZNQl8Q5NKY3UypmHfCJy4kJlnA1d1T+o0=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 01267ccb-7f6d-410b-8045-08dbbb2b248a X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2023 05:17:01.8034 (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: DS0PR20MB5664 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 21 Sep 2023 22:17:23 -0700 (PDT) > >On Wed, Sep 20, 2023 at 08:08:49PM +0530, Anup Patel wrote: >> On Wed, Sep 20, 2023 at 6:28 PM Conor Dooley wrote: >>> >>> On Wed, Sep 20, 2023 at 08:40:07PM +0800, Inochi Amaoto wrote: >>>>> On 20/09/2023 14:15, Inochi Amaoto wrote: >>>>>>> On 20/09/2023 08:39, Chen Wang wrote: >>>>>>>> From: Inochi Amaoto >>>>>>>> >>>>>>>> Add two new compatible string formatted like `C9xx-clint-xxx` to identify >>>>>>>> the timer and ipi device separately, and do not allow c900-clint as the >>>>>>> >>>>>>> Why? >>>>>>> >>>>>> >>>>>> If use the same compatible, SBI will process this twice in both ipi and >>>>>> timer, use different compatible will allow SBI to treat these as different. >>>>>> AFAIK, the aclint in SBI use the same concepts, which make hard to use the >>>>>> second register range. I have explained in another response. >>>>> >>>>> What is a SBI? Linux driver? If so, why some intermediate Linux driver >>>>> choice should affect bindings? >>>>> Best regards, >>>>> Krzysztof >>>>> >>>> >>>> SBI (Supervisor Binary Interface) is defined by riscv, which is an interface >>>> between the Supervisor Execution Environment (SEE) and the supervisor. The >>>> detailed documentation can be found in [1]. >>>> >>>> The implement of SBI needs fdt info of the platform, which is provided by >>>> kernel. So we need a dt-bindings for these devices, and these will be >>>> processed by SBI. >>>> >>>> [1] https://github.com/riscv-non-isa/riscv-sbi-doc >>> >>> Yeah, this is the unfortunate problem of half-baked bindings (IMO) >>> ending up in OpenSBI (which likely means they also ended up in QEMU). >>> This T-Head stuff is coming across our (metaphorical) desks, so we are >>> obviously going to try to do things correctly. I may end up speaking to >>> Anup later today, if I do I will point him at this thread (if he hasn't >>> seen it already). >> >> RISC-V ACLINT is one of those unfortunate non-ISA specs (like >> SiFive PLIC) which is implemented by various organizations but >> not officially ratified by RVI. > >Yeah, I brought this stuff up at the weekly pw sync call, and Paul >pointed that out. > >> The SiFive CLINT has flexibility related limitations which makes it >> not useful for multi-socket and mult-die systems. The SiFive CLINT >> is also not useful for systems with AIA because with AIA M-mode has >> a new way of doing M-mode IPIs. Due to this reasons, the RISC-V >> ACLINT spec breaks down traditional SiFive CLINT into two separate >> devices namely mtimer and mswi. This allows platforms to implement >> only the required set of devices. The mtimer as defined by the ACLINT >> specifications also allows platforms to place mtime and mtimecmp >> registers at different locations. >> >> Refer, https://github.com/riscv/riscv-aclint/blob/main/riscv-aclint.adoc >> >> We need a separate DT bindings document for ACLINT MTIMER >> and ACLINT MSWI because these are separate devices. The >> Sophgo sg2042 SoC should add their implementation specific >> compatible strings in this document. > >If the spec isn't frozen, I'm not accepting a binding for the "generic" >version of it. Bindings for this specific implemtnation are okay. >For sure though, squeezing this into the sifive,plic binding isn't >appropriate. > It seems I have missed a point. I wonder whether it is better to add a "aclint" binding firstly and then add sg2042 to it, or just use sg2042 specific binding? If use "aclint" binding, I wonder it is OK to add thead quirks as compatible specific properties, or left this to the SBI to handle? e.g. T-HEAD timer is not 64bit timer, and we should identify this. >What was pointed out, I think by Samuel, that the reason that this may >need to be split is the fact that there are many possible MTIMER >register ranges & possibly sswi stuff too that would need to be >differentiated. > >> >> Regards, >> Anup >