Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp177072rdb; Thu, 30 Nov 2023 01:31:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/5NLfXW7rshM7MLRV9s1ZfPpialUgeZ0/hzQHaCQFD0mOGN9JI8UdOpBseFzTiA9vUm24 X-Received: by 2002:a05:6a00:21c8:b0:690:f877:aa1e with SMTP id t8-20020a056a0021c800b00690f877aa1emr28266019pfj.12.1701336714997; Thu, 30 Nov 2023 01:31:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701336714; cv=none; d=google.com; s=arc-20160816; b=VNCgq/Vs/FAmCuy+mMfDypU/LcBp92KixzsN4SuNqMp3NPZlNP9uqObtze2tAc1gD9 h7Wy7abS111xRfvz/T+4XSbGggP8ftKEYtL5JqcbnPMHFh/GPgICjBvhO8yovrV5O+yg KTy9vki6D4gTbwkJrG4BYABAwhka5F4CHoyIaJqRe7AzljhXemswFL/pM3qtFmIS7kcR NopDzAclG1gDlVVbtMv53BMCF5kGrTWUQ8uBMGIaAi6XWCTIAp136va0lIjyS9IHsjLc IfO2ZabA1hSov5ZQzyAburJfx1KnvU9IiANPUk1f9I3aiZQIZiDdbmYBBgcS8/XPxa4E r5og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=j8OBcWs9lPOHMqo4r9Od8zwOOfWlpHAGN+FvmpBlGKI=; fh=xUJVR1FUpDq+Nd6xsIOS0UdruG1jkXrhGHKnnvKJapw=; b=q0kjMPboPSp/jjVNclthWz/8YNi4G/dHGzo+dqj9clncPAUWqgxaGqoL+eNhMr2aXM m2PX3FY6efyXPs0/79Xfe9bYgiDYf7g4YLi3T5Vr9QXj6OCQ43TTSf76GdGq5UyXZ3II HBEruawCI5b0+RvRosH5A16Ml+jvS8xaBvd9d3OvgWn3SY1MtWTxCol6gwS8X9RdBYhQ OnqsqLHs5t7fPebIbg16/wT6BxCCywIgu6Hb6GpDXmuJGUpXojMqw71NZN2n6FiUHLT6 Q3t5l5Rl7+Dew6/WDs5s0y0t0docVfRQMKPbq+uZwz2Lh8FMIF/kxH6a3tvZ7804s9xP 4xwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=bhoqoJ2G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id q5-20020a056a00088500b006cbbdc31d10si889392pfj.220.2023.11.30.01.31.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 01:31:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=bhoqoJ2G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id DC9098096FED; Thu, 30 Nov 2023 01:31:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229462AbjK3Jbd (ORCPT + 99 others); Thu, 30 Nov 2023 04:31:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229596AbjK3Jbb (ORCPT ); Thu, 30 Nov 2023 04:31:31 -0500 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BFE28F for ; Thu, 30 Nov 2023 01:31:37 -0800 (PST) Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6cde14ff73bso670735b3a.0 for ; Thu, 30 Nov 2023 01:31:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1701336697; x=1701941497; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=j8OBcWs9lPOHMqo4r9Od8zwOOfWlpHAGN+FvmpBlGKI=; b=bhoqoJ2GfXNh/2FZPFM51/Bnfdg12IK7mdKxpoSItOTK1I537Ctn9BG4j+D2X76Y4T CN6FEtFXyVliMu17iY+dRFVQ7hooXL0NZwIvjUXdY2TSuLYMU75pBfNwvPbufgqSB1Mb 1YExLfBAlc+qeZHQwVozve7XDlRELYn4obHt7NCAahKlgW/uCxm4ZvFzK473bl7ukyYa HEW4vz4HqTq0BfxuAgYaAe9RhmXHvWHHjO/8PHc8abtkNWKBZ84bBGYrKEIckwqqtoYy 7SN3dE6ud32DQOsLpxyURRYALgzFj3PUPFFCL0Z7ZX3Flo/Mze8S7gugPfM6d5VM4EgQ WQEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701336697; x=1701941497; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=j8OBcWs9lPOHMqo4r9Od8zwOOfWlpHAGN+FvmpBlGKI=; b=sjKaaIecOmymLX2gpo9Dettx8V1nb4qnuTs/kgamfDBUqx/zykgVkccAwP1um5aZ0m yquH2lQodBlR/kIyXXrnHLBJOkQxb1SzOX2dIdCB7mMQYgTbzMuoVrjNWCCGtimD3Uhd XLvaxwFo5mFf8Tw61wJ78m3y935L1Eh4kKlozojLD/YqIWlH2efX0iGq7UhI5Daqhz8M P8VIkaD7Jvbg+e9XT0LyLY+7LTPaaxuLwIiwrhkUYhw5LwLERsBzs+I9/jAdl0JwZAIn RATvAkUSnpUG+ZNjbdm5wheOBRam+FYMMvsXrIu518bS0b6wNXO/v39uj2VXQ5QHMVRx xchw== X-Gm-Message-State: AOJu0Yz6PLQuKhbNbGdeVRMtPuhJq37UQlkXD2wwR4K79hLXorXFsj0c kYDMmUgwurJkZDt79IyGGyemukvr/98PYOS3n4KAEw== X-Received: by 2002:a05:6a00:2296:b0:6cb:735c:67af with SMTP id f22-20020a056a00229600b006cb735c67afmr31018795pfe.0.1701336696772; Thu, 30 Nov 2023 01:31:36 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Anup Patel Date: Thu, 30 Nov 2023 15:01:24 +0530 Message-ID: Subject: Re: [PATCH v4 1/2] dt-bindings: timer: thead,c900-aclint-mtimer: separate mtime and mtimecmp regs 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 groat.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 (groat.vger.email [0.0.0.0]); Thu, 30 Nov 2023 01:31:51 -0800 (PST) On Sat, Nov 18, 2023 at 12:39=E2=80=AFPM 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. > > 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. > > 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. > > 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 The ratified Priv v1.12 specification defines platform specific M-mode time= r registers without defining any layout of mtime and mtimecmp registers. (Refer, "3.2.1 Machine Timer Registers (mtime and mtimecmp)") The "thead,c900-aclint-mtimer" can be thought of as is one possible implementation of "riscv,mtimer" defined by the Priv v1.12 specificaiton. If it is not too late then I suggest making this binding into generic "riscv,mtimer" binding. Regards, Anup > --- > .../timer/thead,c900-aclint-mtimer.yaml | 42 ++++++++++++++++++- > 1 file changed, 41 insertions(+), 1 deletion(-) > > 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 > > 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 > > interrupts-extended: > minItems: 1 > @@ -28,8 +41,34 @@ additionalProperties: false > required: > - compatible > - reg > + - reg-names > - interrupts-extended > > +allOf: > + - if: > + properties: > + compatible: > + contains: > + const: thead,c900-aclint-mtimer > + 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 > + > examples: > - | > timer@ac000000 { > @@ -39,5 +78,6 @@ examples: > <&cpu3intc 7>, > <&cpu4intc 7>; > reg =3D <0xac000000 0x00010000>; > + reg-names =3D "mtimecmp"; > }; > ... > -- > 2.42.1 > >