Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2360194rdb; Mon, 20 Nov 2023 08:52:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPoHelbizHKf7vHLUV+zc5jfmtjayGnNhES5jhrCJ5Xvzj5+rTU/QH20q8PVYSM1LffJo1 X-Received: by 2002:a05:6a20:12c4:b0:188:24d0:e904 with SMTP id v4-20020a056a2012c400b0018824d0e904mr11564191pzg.15.1700499164942; Mon, 20 Nov 2023 08:52:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700499164; cv=none; d=google.com; s=arc-20160816; b=mvRBqx3c7zlCY00KbJcp2lu1YVSiDveyE66+GCJhAYK3o5Ktnz7acHV5PecfhmUtSH zcp/zlILgDD5t2T4yHHpE5yImyPaCpdRRVs6FE8U/fPtDxkMlpUbQ75GfzQunh7l0gZN +YtuH7egxyDhfDfAkivYJgdqH5xW7KedM3nW6aIqKFU168B6KYbMXHHP0+wAk1zLHKbU 4kKllYAHDeL3DW6/HUTdzbsqjOBUTTYhCuQ7CC/DBeHzjFXQyQdO9j18rcXlrc/l6vC/ bV1hAprV+f4u9Vd5EHNyZZVN6+Rc2yxH1q75Ks5Vxy9yOqoXV7BMvN0ZoZ3M9Nft/r9Z oBCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fOY1m11FhXK8U8gS5/+or/Zgz4mY+uzgpwhiZr6NfM4=; fh=xUJVR1FUpDq+Nd6xsIOS0UdruG1jkXrhGHKnnvKJapw=; b=FWs721xcQfWwJ0XanaGPidJtQ7ZiqYz5jYRS6qkSYNrIpA7l36Zm5vVatJq9WvKB0x 1ki6tJZisjlESQvM5tsoqahodLJVbTDTFdjf/skyYT/QlMAgOcugV7zLxNPHWpSfQOKX 1VZj7P5c9Qn8vnb7VV4LXMkN5HbCbcW3B5cGBhV9siRy790fdQTHRlQF0vxYInE4um8t Wzz7OmVzjVnhDeqTe2XByNKE02QAd9fiQyVzNimtLCMAmVjqN09lTJKhjEHz9VOrxlho 0aDA27ui8/Wf4FNDabjBOboOSqZ1dT6k8KyNv+0fegrycQTO/S3Xbi7MsmoTyS89WPPe LXyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IoAIyUvx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id h13-20020a170902f54d00b001ca4ad8635esi8802217plf.240.2023.11.20.08.52.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 08:52:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IoAIyUvx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id DA7F880401B6; Mon, 20 Nov 2023 08:52:27 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233365AbjKTQwO (ORCPT + 99 others); Mon, 20 Nov 2023 11:52:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231904AbjKTQwN (ORCPT ); Mon, 20 Nov 2023 11:52:13 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD796BC for ; Mon, 20 Nov 2023 08:52:09 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C29AC433C7; Mon, 20 Nov 2023 16:52:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700499129; bh=z+uggHQMjKoAbxyCf88m6HvumZukoCO2tr4KQ+XI2wk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IoAIyUvxhqiQY4jivygg20akkYxVre2lsLT+tqFsNQ3Nqy071EkFNQ1BKZsQ9CN2E JThL4ZA+RaGqhKtNCdg7rDC7tBQcn4hbNXoLyWP6U6KpIXC3byeVmvNhy18maQouAO 2OL3a56K3dhYOOaobGiQHm4MxGAGsJlsNSEIxeQJi0F/bNIXgXhnGRr9wAn0eTJEGq Ff7ORxkAipElAzfC+lYdGgjKdlBRfVLYlRODJT+wt9Eg7lRMxOGrhaHGeoDGNy1iEz ewTlbbpMnXNQ2Rc87svL8vUYbC3bbw1KbidkmaxMNNs24khT9Cxma/QrDWvvz5HDIn 5Vb5eZmKEJWLA== Date: Mon, 20 Nov 2023 16:52:03 +0000 From: Conor Dooley To: Inochi Amaoto Cc: Daniel Lezcano , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Chen Wang , Anup Patel , Samuel Holland , Guo Ren , Jisheng Zhang , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v4 1/2] dt-bindings: timer: thead,c900-aclint-mtimer: separate mtime and mtimecmp regs Message-ID: <20231120-banshee-traverse-554723cd9490@spud> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="SyM6lyfFJB4JBnze" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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]); Mon, 20 Nov 2023 08:52:28 -0800 (PST) --SyM6lyfFJB4JBnze Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Yo, On Sat, Nov 18, 2023 at 03:10:26PM +0800, Inochi Amaoto wrote: > The timer registers of aclint don't follow the clint layout and can > be mapped on any different offset. As sg2042 uses separated timer > and mswi for its clint, it should follow the aclint spec and have > separated registers. >=20 > The previous patch introduced a new type of T-HEAD aclint timer which > has clint timer layout. Although it has the clint timer layout, it > should follow the aclint spec and uses the separated mtime and mtimecmp > regs. So a ABI change is needed to make the timer fit the aclint spec. >=20 > To make T-HEAD aclint timer more closer to the aclint spec, use > regs-names to represent the mtimecmp register, which can avoid hack > for unsupport mtime register of T-HEAD aclint timer. >=20 > Signed-off-by: Inochi Amaoto > Fixes: 4734449f7311 ("dt-bindings: timer: Add Sophgo sg2042 CLINT timer") > Link: https://lists.infradead.org/pipermail/opensbi/2023-October/005693.h= tml > Link: https://github.com/riscv/riscv-aclint/blob/main/riscv-aclint.adoc > --- > .../timer/thead,c900-aclint-mtimer.yaml | 42 ++++++++++++++++++- > 1 file changed, 41 insertions(+), 1 deletion(-) >=20 > diff --git a/Documentation/devicetree/bindings/timer/thead,c900-aclint-mt= imer.yaml b/Documentation/devicetree/bindings/timer/thead,c900-aclint-mtime= r.yaml > index fbd235650e52..053488fb1286 100644 > --- a/Documentation/devicetree/bindings/timer/thead,c900-aclint-mtimer.ya= ml > +++ b/Documentation/devicetree/bindings/timer/thead,c900-aclint-mtimer.ya= ml > @@ -17,7 +17,20 @@ properties: > - const: thead,c900-aclint-mtimer >=20 > reg: > - maxItems: 1 > + oneOf: > + - items: > + - description: MTIME Registers > + - description: MTIMECMP Registers > + - items: > + - description: MTIMECMP Registers > + > + reg-names: > + oneOf: > + - items: > + - const: mtime > + - const: mtimecmp > + - items: > + - const: mtimecmp >=20 > interrupts-extended: > minItems: 1 > @@ -28,8 +41,34 @@ additionalProperties: false > required: > - compatible > - reg > + - reg-names > - interrupts-extended >=20 > +allOf: > + - if: > + properties: > + compatible: > + contains: > + const: thead,c900-aclint-mtimer Is this being the c900 compatible correct? You mention in your commit message that this split is done on the sg2042, but the rule is applied here for any c900 series "aclint". Do we know if this is a sophgo specific thing (or even sg2042 specific), or if it applies generally? > + then: > + properties: > + reg: > + items: > + - description: MTIMECMP Registers > + reg-names: > + items: > + - const: mtimecmp > + else: > + properties: > + reg: > + items: > + - description: MTIME Registers > + - description: MTIMECMP Registers > + reg-names: > + items: > + - const: mtime > + - const: mtimecmp If it applies generally, I would probably just delete this, but unless someone can confirm this to be general, I'd probably leave the else clause and swap for the specific sg2042 compatible above. Otherwise, this looks like a better fix than you had proposed before :) Thanks, Conor. --SyM6lyfFJB4JBnze Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZVuOswAKCRB4tDGHoIJi 0nUgAP9Qh7o82eKAfQthXVortYfkS6wXhMlYq7MkGEyue00G5AD7BR46o/k6lslh FIQz+iWXPJH+kSgGoq/KvFIQUph8TwU= =JOFi -----END PGP SIGNATURE----- --SyM6lyfFJB4JBnze--