Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1641320rdb; Wed, 20 Sep 2023 15:26:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEM1pNV8ysokxhVak0zbKFbGdJiAWBuPfUsWxsMIcvKzF/1MNNdAZE95VhTywVVLbPGuv0V X-Received: by 2002:a17:902:e843:b0:1c5:b1a6:8118 with SMTP id t3-20020a170902e84300b001c5b1a68118mr4342204plg.42.1695248792516; Wed, 20 Sep 2023 15:26:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695248792; cv=pass; d=google.com; s=arc-20160816; b=xs+hbruivKheo6XE4uSMN4vhuYWYRKbJuHjJoLA+avlj2GSeIr/YHbrVOQ2xDtEDCU dB8vXyaIAp+KgPwnkBnUrMNwJkEIJBsNLVJnEP+l0KNn5QgxhCJCvuecEImeXMhwHMu5 CaD0EYo3l2kq6JCNI/IAI31wyWtRnZ5EKZ1r9AkGpukgxKwuXk5XAkOS6O84MbKGVBV0 HoTFeW//wjBEGw/4tJbQOJzqnjGPcY2LJDbt0Ao+zhc2RT5l6ZVrEyUOemt41wsxOj6B WItuP/9vt7typKO1thjdneiUYhj/c/2sDbbRwjivDSLZTkKpcqOFMjxhZZgbkRVMvRkZ L1FA== 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=N/SjzU1WZGGPI//CTri6AQ6g5/d2Xomw+KVu629KzzM=; fh=uuflYEojT0tCnu0aN3cQoiBtU0bjCa1RS1ZBsTmTLRo=; b=07n6S7TwIqAE7KYPOjSJwlF6UNH6frGO+b2bSnKa0CqhaqCPcE0n0ooYfBqiSzTLkZ /exP96QyCuw+3/sCBjtAVodqRE6Qy62R+9Nf+0dwMSWyhbawr55gz+ykSrhP/GOLkGoA 5Ks+iTunaH4TgXB9X+A8NVNW1lKU6mweWp2Jj6taOvPdEivMzPHM+RlSu+RUdXUQZoMA 8lLSWmb1ji69PQlp/DkdrU3Q1+HLoemiZ80e9dHT2Glmkhl+TeF7cei8to1vakr/0SGZ DSy/So6wVldjW+a514mht0xGggzygF4Xz+dwrKAK47KY+AaWTKrq5JSvi14sEvZxsKaA TgFQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=RFpyFERD; arc=pass (i=1); 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=QUARANTINE dis=NONE) header.from=outlook.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id lc13-20020a170902fa8d00b001be025f8407si52343plb.37.2023.09.20.15.26.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 15:26:32 -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=@outlook.com header.s=selector1 header.b=RFpyFERD; arc=pass (i=1); 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=QUARANTINE dis=NONE) header.from=outlook.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C9ECE818BCB0; Wed, 20 Sep 2023 15:22:12 -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 S229512AbjITWV6 (ORCPT + 99 others); Wed, 20 Sep 2023 18:21:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbjITWV5 (ORCPT ); Wed, 20 Sep 2023 18:21:57 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11olkn2018.outbound.protection.outlook.com [40.92.19.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E18CD6; Wed, 20 Sep 2023 15:21:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KrPDdy/t3ShL8zXp17zZr33jFBcann9HMD841F/fxxpr/AvfiL01WFZZyZfOFVB6ae6oRAV9tWdUjUCvXqe1RuVGn3nxY+tagi3ORBkeIW5yeQLmu6wLQqmQFgzlRwPAj0odRmm5u9Si10zwNbniTa5N57IxRdKC+nyi0CecWspaDNoAqmSHowujreWaor5Dl6CW3ybuReqGN0r1YEACq4XCbUiiAvAQcEO/1wKUdB4uqGrcMhGuCD2vmPWjfmSifLseb9X/kQHu43oNXkebVLJF8JGZ9VlVt1h184KmDpvcvABtOBUwsiOsBbnLriT3KIjWmaEXBsVNtj3kgSJgOA== 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=N/SjzU1WZGGPI//CTri6AQ6g5/d2Xomw+KVu629KzzM=; b=Y3DKGleBiNcap8qbC4/xC/M5tpHVUfH/sHUBM3VtNC1joWpTZhwvXQt0WLNCMO91u9FzQAfyGx6KsAcNPaOp+PySeJWn4vwp8+f5E1GRIJ/ozUAcqPaM2ZFX3nGOhS4Sl5Q0QV0a+becoypBTfkvS8P2Bu1CNTJbQ+6kZa2x+ocLx1/fkM4AnBoHwABzEYKmmC3/kSSnIuKU9QKsuik3YPig+3rn9hjK9XyPs1MRHWVNTvmZdPFvc7+9oCGk1INMzfb+gYKRBv5Ka1w3F9Ukm6mtUD7+Y+fUfPTLBXSfxo3TVlALeVDlHChVbg0lfFd7E8J2kXLpmWxKFaELBSjYHg== 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=N/SjzU1WZGGPI//CTri6AQ6g5/d2Xomw+KVu629KzzM=; b=RFpyFERDCvhXg8hgQFsyK4M8HMGlZtIT+yoGCUrDkOjCmYjFJkIflnHjCoXpbQ/tDpIIxFAgbYn7sYDHVkd3I90rZNhQO6AU+sYq0g+68oAh2x/UDbTHLuMajr2XPZOVF9I7lKKcF9Y29I2ECiBUb3uGppJ9dhwc0kfoHR/VK48mBMinw8pz4NjDp4jTNU2HQNYUc0UdXfZsdp56WMFUPemYSjZdI0rrQyUB01Q8+7LixYod0d+Jk9xH1ZhJ/WCPAAfUT6xK4XWbPi+tUgK8Cvb6AgLMlB3iGfMJOIhrwDcTIjgNXiKyRcvdzIOyyf+f28p5XAEr/RzxrimwlNxblw== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by MW5PR20MB4428.namprd20.prod.outlook.com (2603:10b6:303:1a3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.20; Wed, 20 Sep 2023 22:21:46 +0000 Received: from IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::d050:882f:a8a7:8263]) by IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::d050:882f:a8a7:8263%4]) with mapi id 15.20.6792.026; Wed, 20 Sep 2023 22:21:46 +0000 From: Inochi Amaoto To: Conor Dooley Cc: Anup Patel , Krzysztof Kozlowski , aou@eecs.berkeley.edu, chao.wei@sophgo.com, conor@kernel.org, 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: Thu, 21 Sep 2023 06:20:58 +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: [+hQ5Ru9z/hKr435Dz2T8P58CyWWIzz5QtLbEye2GuKc=] X-ClientProxiedBy: BY5PR16CA0003.namprd16.prod.outlook.com (2603:10b6:a03:1a0::16) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20230920222059.6068-1-inochiama@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|MW5PR20MB4428:EE_ X-MS-Office365-Filtering-Correlation-Id: 79369663-36e4-4cb5-6f9d-08dbba27f955 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3Cm+br/KMu+TMzivty4G2CAwE6hBMYqTC92Yi+Ddm0eU1UwOCkjIh5/ymPQ4/CGywZfxrgQGZjkjD5yEiuVh2PlteN5t8LQJ6MGec0zzekJrIzXKctBb9GPjZHNtgCXeXa+0mfubb/FMJ+RrUA+LGs7kjX8jPqsxL5OciY/E+T68Qdx7WUl8Up8IYRUucEb7M7r0ugyrutrIHDxp9bddkhOhh4OF0srUTKrc4HyUka2dHVcJMAbyZb22D/7putHIS52/qW0bGQU2Hzd7LRt7LyZXIkvm8qzjKlBm37s8o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aURQcG1jMjlGTUdXSlhnU05zMHhUQk82VEVSTGF1R0hU?= =?utf-8?B?YjNZemM4blMwVEZ5OUNEUGFxVEJ4QVFJMzh2Q2FpMk41ZVVrajM2T2xQOHRv?= =?utf-8?B?Z2tQdEhuRTcyMUdrS2R1OHIwY0F0NGlBWXdWblZHVXBlZkJKMjFEaENYSXcr?= =?utf-8?B?QTlIYVdtVEZlNXdLQ0VnSFJIZS8xNjJJUmdha0JFZ1Y4Mk1WT1V0VGV1NEcw?= =?utf-8?Q?Mxds4zZ21mp0XEE2fEG/eCQtLscQOe3hSwwlBEFQKva4=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79369663-36e4-4cb5-6f9d-08dbba27f955 X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2023 22:21:46.7473 (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: MW5PR20MB4428 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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]); Wed, 20 Sep 2023 15:22:12 -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. > A specific implemtnation sounds like a good idea, as the clint layout of sg2042 is wired and hard to merge (ipi is continous but the timer is per cluster). For a specific implemtnation, I wonder if it is better to use two files to identify these device each, instead of one for all? >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 >