Message ID | 20240206143711.2410135-3-msp@baylibre.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-55128-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1583294dyb; Tue, 6 Feb 2024 06:39:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IGTSWz5iNC566uGm+37fTIbb+wXaXWbeG/2HU9rWeSp1ctk/uVZea7unOpWkhPLXprktLhB X-Received: by 2002:a05:620a:9c3:b0:784:c832:31db with SMTP id y3-20020a05620a09c300b00784c83231dbmr2567247qky.29.1707230374395; Tue, 06 Feb 2024 06:39:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707230374; cv=pass; d=google.com; s=arc-20160816; b=zWNEca/DreirR6ZIvnpwlL9CyF8LeMAWZcOpFJj8kAdtEgUMse8l41l5Pf+WGMDUY5 WsGSeSgpIBrUdyZYC6cJANOfBUBwnP4uMVXrP6SpcgkdD7ag2SgeVc3Img5Nm3Er5a+2 xAqq+WLB8FP7GRqkZUSkO6odwMJeeujTn6JmjyBo9jitGK+s5RFd75bAgUjrh+dykjmb FlHB9FnVR8jsgQHGKLQRrnvVFAcMRjRQEQVtFn6hcmBgTJqyFC55AAb54eGk61IrvqeU nE4Nkb8sqOMtgHDdzSTHU3dtPoJqCAotsa10VNguGQpP/jAhF87JLORz5jADMPkHwmsl nhUQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=MGo2FC7WYDd1/me+URO9ZglcapL0YwY+tHoSxOqlK5Q=; fh=xjEey5xERw/8hQKF5ISr6t626Rj8BIqEZFp1H0wO6a0=; b=p7IGWpfuzRf/dYp6gpIlTRZDT62F2QzXtqHKxIiCgcUw34yr5do1BOeR3/AGo50bXn xbLBfTwNkWpfbWq5KyvLFwlOrfXc4yMj3vaEHbfsibnMfo3MU0XMEzy0ga8lA82mAxnK W+UmTM3qvZh/dRoLrzRhVXbgEIAoISktNLTOClgiptlhjOJzO5UOIlCjss1dlFBULw4b aKTmZsi2flMl+ZmreZOW3Zp8QW+j0QrxFs5DER7LeBFhStrfk2VVsiAFePWCPd3FT5a6 swuUCfZoqu8JnITeK+OpaFfaC0pDvKt2kwU9A0SxRB3jjMuLxibYxDcPy5tPNAh8Fs0e e4rw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=F5HaZh7r; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-55128-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55128-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCUT9O6PYxTvd4XjZQY+u3fIWRf5htSmMEyMsaIW3+Kmi7OwHVMw+i32cvRKcDgHwAcFAbejuD5sej8WtymM9MGlBaF++g== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bs13-20020a05620a470d00b007858b5855b0si2408424qkb.325.2024.02.06.06.39.34 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 06:39:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55128-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=F5HaZh7r; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-55128-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55128-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 335461C221A7 for <ouuuleilei@gmail.com>; Tue, 6 Feb 2024 14:39:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BE172133993; Tue, 6 Feb 2024 14:38:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="F5HaZh7r" Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A809238DFE for <linux-kernel@vger.kernel.org>; Tue, 6 Feb 2024 14:38:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707230283; cv=none; b=VBqBANGFpnwRscMdQ1ppPBbZGfN2OYCgTuzLnNvjIe5e1gGeMtnaRWg/MEjhIg3p4NNBDR2RGa8/fP0H4WWsicXj1TSiUR2fPfiCS02Uj1Yz+4Id6d6UwtMELBjbHy5CHZW5UD/zVbXg7tADOFxzTAKRXRqLGwuXTksm0sc+2Wc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707230283; c=relaxed/simple; bh=HO6KVEaHf/T7d9XWP5w/68iUgcAaz0HDcz/jMuokJ9Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hypwvVRJ0xAKqweRK9zqKSgsXEMhGiJX+aglMeMNC0qM63DgQ9KKsgkGTnZ7S4tnJ1tMP+Re4Az1khMelDarVzT7nHpYoNHF8VuN2efFybKQv8aCJ/TYHA+HS6iUGhHDirD8hqMqpCfhVjMAZ0M33mxd2t7Kt52OHqUPidnxMi0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=F5HaZh7r; arc=none smtp.client-ip=209.85.218.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a36126ee41eso719925166b.2 for <linux-kernel@vger.kernel.org>; Tue, 06 Feb 2024 06:38:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1707230280; x=1707835080; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MGo2FC7WYDd1/me+URO9ZglcapL0YwY+tHoSxOqlK5Q=; b=F5HaZh7rV77AxY79Qfo2D4Cf+bc6TPNq5udZI5pfaXFRgILHCQYQJgsAeHVJPWy/dY xw2XKilNBUxKGHR47MF/X5y0IVk7uNStKVcFfQ1YqXnJy4n8wCvTO3u7EZm+PNGQl8Al yH3CC3DdZuEMes2/r++1evXf2xPlAoGibe81SGBmk/Wiw3pbIG6QhPlz1rITx7BdrqXr Kaovwzif94lhOZTaVzqDrSqMdppNwcsP4P8IRQFDSuN2fM2EXjruBHKLilENcPw4E/30 QxiuQn1SAg1IKH0M6s3Rhyoqucg5i41iFFYIjiD/Ece9e4QaiIbApjyEPKoZbXjW0h3j DvXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707230280; x=1707835080; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MGo2FC7WYDd1/me+URO9ZglcapL0YwY+tHoSxOqlK5Q=; b=Xafj58wsZPDIFn2SfTV8LWbnApgvEYPPafvXcQ7H9E9dOR/fgjqrm/jeHkhJ4gMu+t sloSejb+B83qt87iqS/3rL1gq3fcC2TzMOgnQLGPmFp6M7t8QYd+LLIPixo5RYG4yZEJ VJg/b6j+hOOGpP7fwYyUGoHq+EbEQyFcOxl8F0iUYIUMBNoDcQs2bhUd/1qrJb0jH7q5 /LlM1IQgMSBEP0Q5vd+Gc12WtYlAYoXiwrMAP8XLdnylfoIT2NvDyo/kvRfH4yTijkNG 7zz8X7lmCaNhkpl2gUF5t/kAUNbaUyB+OUPzHjAF57uRfjfzeSsBxZTZpNvLTa5P0y+9 86zg== X-Gm-Message-State: AOJu0Yx7DxQ8/GgLd5SqikHjg1ixc3prWKBktR6VgkpmdnAP79r9hlf9 OGeQt4yMk4uMSmuYCfpgNaJofWE9yKr3T1W4EKvvehlq0JTOGX0FdPCWWRXelic= X-Received: by 2002:a17:907:785a:b0:a37:ee9c:273e with SMTP id lb26-20020a170907785a00b00a37ee9c273emr1653077ejc.53.1707230279829; Tue, 06 Feb 2024 06:37:59 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCUXWFMbNZogEPZ1ITtLgkoEB7IkPokqz7J5Zt/rg5GPnr0bIPNBNVMhc624wKDa5A4GCh+nu2y+4j91OIUDKBeYcPb763wn0zCzf+F+1dxkqRWMQuIiOsT+HjZQs2XzqnT/RtRe+fROtFviI8I5XsL1+TjoUyZX1Ppr+qEdbCTSHS51JvSSxdjpXj5b35O5pDmDdi9DBxL7bhAAhkTvQKLUWyAO+yxWzXa/uW+zRaPkRF2YYxXrEELv120fyFcSmARQQaWi/zJF5vUEqpqp+uiX8oGPqWNflVriBNezI0dGq6mIKRnXla7t2QQBQRANso9sMHj4/QHnXaKpSAZrLJmtjmY23JuV0kUOihwPSezjpdYHvOL5aQqw8GNNSXb6KfvypgWmTeVTpl0srxEFQPZzIrLq/PvdamOx/FZyRlDVzlMgfUla Received: from blmsp.fritz.box ([2001:4091:a246:821e:6f3b:6b50:4762:8343]) by smtp.gmail.com with ESMTPSA id e22-20020a1709062c1600b00a37585d5dcesm1224418ejh.51.2024.02.06.06.37.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 06:37:59 -0800 (PST) From: Markus Schneider-Pargmann <msp@baylibre.com> To: Nishanth Menon <nm@ti.com>, Vignesh Raghavendra <vigneshr@ti.com>, Tero Kristo <kristo@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Srinivas Kandagatla <srinivas.kandagatla@linaro.org>, Santosh Shilimkar <ssantosh@kernel.org> Cc: Andrew Davis <afd@ti.com>, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Markus Schneider-Pargmann <msp@baylibre.com> Subject: [PATCH 2/4] dt-bindings: hwinfo: ti,k3-socinfo: Add nvmem-cells Date: Tue, 6 Feb 2024 15:37:09 +0100 Message-ID: <20240206143711.2410135-3-msp@baylibre.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240206143711.2410135-1-msp@baylibre.com> References: <20240206143711.2410135-1-msp@baylibre.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790160796937154853 X-GMAIL-MSGID: 1790160796937154853 |
Series |
soc: ti: k3-socinfo: Add support for nvmem cells
|
|
Commit Message
Markus Schneider-Pargmann
Feb. 6, 2024, 2:37 p.m. UTC
The information k3-socinfo requires is stored in an efuse area. This area is required by other devices/drivers as well, so using nvmem-cells can be a cleaner way to describe which information are used. If nvmem-cells are supplied, the address range is not required. Cells chipvariant, chippartno and chipmanufacturer are introduced to cover all required information. Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com> Reviewed-by: Andrew Davis <afd@ti.com> --- .../bindings/hwinfo/ti,k3-socinfo.yaml | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-)
Comments
On Tue, 06 Feb 2024 15:37:09 +0100, Markus Schneider-Pargmann wrote: > The information k3-socinfo requires is stored in an efuse area. This > area is required by other devices/drivers as well, so using nvmem-cells > can be a cleaner way to describe which information are used. > > If nvmem-cells are supplied, the address range is not required. > Cells chipvariant, chippartno and chipmanufacturer are introduced to > cover all required information. > > Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com> > Reviewed-by: Andrew Davis <afd@ti.com> > --- > .../bindings/hwinfo/ti,k3-socinfo.yaml | 23 ++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13): yamllint warnings/errors: dtschema/dtc warnings/errors: Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.example.dts:39.27-43.11: Warning (unit_address_vs_reg): /example-1/chipid@14: node has a unit name, but no reg or ranges property doc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20240206143711.2410135-3-msp@baylibre.com The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
On Tue, Feb 06, 2024 at 03:37:09PM +0100, Markus Schneider-Pargmann wrote: > The information k3-socinfo requires is stored in an efuse area. This > area is required by other devices/drivers as well, so using nvmem-cells > can be a cleaner way to describe which information are used. > > If nvmem-cells are supplied, the address range is not required. > Cells chipvariant, chippartno and chipmanufacturer are introduced to > cover all required information. > > Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com> > Reviewed-by: Andrew Davis <afd@ti.com> > --- > .../bindings/hwinfo/ti,k3-socinfo.yaml | 23 ++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml b/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml > index dada28b47ea0..f085b7275b7d 100644 > --- a/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml > +++ b/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml > @@ -26,9 +26,24 @@ properties: > reg: > maxItems: 1 > > + nvmem-cells: > + $ref: /schemas/types.yaml#/definitions/phandle-array > + > + nvmem-cell-names: > + items: > + - const: chipvariant > + - const: chippartno > + - const: chipmanufacturer > + > required: > - compatible > - - reg > + > +oneOf: > + - required: > + - reg > + - required: > + - nvmem-cells > + - nvmem-cell-names > > additionalProperties: false > > @@ -38,3 +53,9 @@ examples: > compatible = "ti,am654-chipid"; > reg = <0x43000014 0x4>; > }; > + - | > + chipid: chipid@14 { > + compatible = "ti,am654-chipid"; This isn't compatible if you have a completely different way to access it. > + nvmem-cells = <&chip_variant>, <&chip_partno>, <&chip_manufacturer>; > + nvmem-cell-names = "chipvariant", "chippartno", "chipmanufacturer"; > + }; > -- > 2.43.0 >
On 06/02/2024 15:37, Markus Schneider-Pargmann wrote: > The information k3-socinfo requires is stored in an efuse area. This > area is required by other devices/drivers as well, so using nvmem-cells > can be a cleaner way to describe which information are used. > > If nvmem-cells are supplied, the address range is not required. > Cells chipvariant, chippartno and chipmanufacturer are introduced to > cover all required information. > > Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com> > Reviewed-by: Andrew Davis <afd@ti.com> > --- > .../bindings/hwinfo/ti,k3-socinfo.yaml | 23 ++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml b/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml > index dada28b47ea0..f085b7275b7d 100644 > --- a/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml > +++ b/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml > @@ -26,9 +26,24 @@ properties: > reg: > maxItems: 1 > > + nvmem-cells: > + $ref: /schemas/types.yaml#/definitions/phandle-array You do not need to redefine the type. You need constraints, so maxItems. > + > + nvmem-cell-names: > + items: > + - const: chipvariant > + - const: chippartno > + - const: chipmanufacturer Best regards, Krzysztof
Hi Rob, On Tue, Feb 06, 2024 at 06:43:05PM +0000, Rob Herring wrote: > On Tue, Feb 06, 2024 at 03:37:09PM +0100, Markus Schneider-Pargmann wrote: > > The information k3-socinfo requires is stored in an efuse area. This > > area is required by other devices/drivers as well, so using nvmem-cells > > can be a cleaner way to describe which information are used. > > > > If nvmem-cells are supplied, the address range is not required. > > Cells chipvariant, chippartno and chipmanufacturer are introduced to > > cover all required information. > > > > Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com> > > Reviewed-by: Andrew Davis <afd@ti.com> > > --- > > .../bindings/hwinfo/ti,k3-socinfo.yaml | 23 ++++++++++++++++++- > > 1 file changed, 22 insertions(+), 1 deletion(-) > > > > diff --git a/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml b/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml > > index dada28b47ea0..f085b7275b7d 100644 > > --- a/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml > > +++ b/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml > > @@ -26,9 +26,24 @@ properties: > > reg: > > maxItems: 1 > > > > + nvmem-cells: > > + $ref: /schemas/types.yaml#/definitions/phandle-array > > + > > + nvmem-cell-names: > > + items: > > + - const: chipvariant > > + - const: chippartno > > + - const: chipmanufacturer > > + > > required: > > - compatible > > - - reg > > + > > +oneOf: > > + - required: > > + - reg > > + - required: > > + - nvmem-cells > > + - nvmem-cell-names > > > > additionalProperties: false > > > > @@ -38,3 +53,9 @@ examples: > > compatible = "ti,am654-chipid"; > > reg = <0x43000014 0x4>; > > }; > > + - | > > + chipid: chipid@14 { > > + compatible = "ti,am654-chipid"; > > This isn't compatible if you have a completely different way to access > it. Thanks, it is not entirely clear to me how I could go forward with this? Are you suggesting to use a different compatible? Or is it something else I could do to proceed with this conversion? Thank you! Best, Markus
On 14/02/2024 10:31, Markus Schneider-Pargmann wrote: > Hi Rob, > > On Tue, Feb 06, 2024 at 06:43:05PM +0000, Rob Herring wrote: >> On Tue, Feb 06, 2024 at 03:37:09PM +0100, Markus Schneider-Pargmann wrote: >>> The information k3-socinfo requires is stored in an efuse area. This >>> area is required by other devices/drivers as well, so using nvmem-cells >>> can be a cleaner way to describe which information are used. >>> >>> If nvmem-cells are supplied, the address range is not required. >>> Cells chipvariant, chippartno and chipmanufacturer are introduced to >>> cover all required information. >>> >>> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com> >>> Reviewed-by: Andrew Davis <afd@ti.com> >>> --- >>> .../bindings/hwinfo/ti,k3-socinfo.yaml | 23 ++++++++++++++++++- >>> 1 file changed, 22 insertions(+), 1 deletion(-) >>> >>> diff --git a/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml b/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml >>> index dada28b47ea0..f085b7275b7d 100644 >>> --- a/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml >>> +++ b/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml >>> @@ -26,9 +26,24 @@ properties: >>> reg: >>> maxItems: 1 >>> >>> + nvmem-cells: >>> + $ref: /schemas/types.yaml#/definitions/phandle-array >>> + >>> + nvmem-cell-names: >>> + items: >>> + - const: chipvariant >>> + - const: chippartno >>> + - const: chipmanufacturer >>> + >>> required: >>> - compatible >>> - - reg >>> + >>> +oneOf: >>> + - required: >>> + - reg >>> + - required: >>> + - nvmem-cells >>> + - nvmem-cell-names >>> >>> additionalProperties: false >>> >>> @@ -38,3 +53,9 @@ examples: >>> compatible = "ti,am654-chipid"; >>> reg = <0x43000014 0x4>; >>> }; >>> + - | >>> + chipid: chipid@14 { >>> + compatible = "ti,am654-chipid"; >> >> This isn't compatible if you have a completely different way to access >> it. > > Thanks, it is not entirely clear to me how I could go forward with this? > Are you suggesting to use a different compatible? Or is it something > else I could do to proceed with this conversion? What you claim now, is that you have one device with entirely different interfaces and programming model. So either this is not the same device or you just wrote bindings to whatever you have in driver. Nothing in commit msg explains this. What you should do? Depends. If you just write bindings for driver, then stop. It's a NAK. Instead write bindings for hardware. If the first choice, just the hardware is somehow like this, then explain in commit msg and device description, how this device can be connected over other bus, not MMIO. You can draw some schematics in commit msg explaining architecture etc. Best regards, Krzysztof
Hi, On Sat, Feb 17, 2024 at 03:25:30PM +0100, Krzysztof Kozlowski wrote: > On 14/02/2024 10:31, Markus Schneider-Pargmann wrote: > > Hi Rob, > > > > On Tue, Feb 06, 2024 at 06:43:05PM +0000, Rob Herring wrote: > >> On Tue, Feb 06, 2024 at 03:37:09PM +0100, Markus Schneider-Pargmann wrote: > >>> The information k3-socinfo requires is stored in an efuse area. This > >>> area is required by other devices/drivers as well, so using nvmem-cells > >>> can be a cleaner way to describe which information are used. > >>> > >>> If nvmem-cells are supplied, the address range is not required. > >>> Cells chipvariant, chippartno and chipmanufacturer are introduced to > >>> cover all required information. > >>> > >>> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com> > >>> Reviewed-by: Andrew Davis <afd@ti.com> > >>> --- > >>> .../bindings/hwinfo/ti,k3-socinfo.yaml | 23 ++++++++++++++++++- > >>> 1 file changed, 22 insertions(+), 1 deletion(-) > >>> > >>> diff --git a/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml b/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml > >>> index dada28b47ea0..f085b7275b7d 100644 > >>> --- a/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml > >>> +++ b/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml > >>> @@ -26,9 +26,24 @@ properties: > >>> reg: > >>> maxItems: 1 > >>> > >>> + nvmem-cells: > >>> + $ref: /schemas/types.yaml#/definitions/phandle-array > >>> + > >>> + nvmem-cell-names: > >>> + items: > >>> + - const: chipvariant > >>> + - const: chippartno > >>> + - const: chipmanufacturer > >>> + > >>> required: > >>> - compatible > >>> - - reg > >>> + > >>> +oneOf: > >>> + - required: > >>> + - reg > >>> + - required: > >>> + - nvmem-cells > >>> + - nvmem-cell-names > >>> > >>> additionalProperties: false > >>> > >>> @@ -38,3 +53,9 @@ examples: > >>> compatible = "ti,am654-chipid"; > >>> reg = <0x43000014 0x4>; > >>> }; > >>> + - | > >>> + chipid: chipid@14 { > >>> + compatible = "ti,am654-chipid"; > >> > >> This isn't compatible if you have a completely different way to access > >> it. > > > > Thanks, it is not entirely clear to me how I could go forward with this? > > Are you suggesting to use a different compatible? Or is it something > > else I could do to proceed with this conversion? > > What you claim now, is that you have one device with entirely different > interfaces and programming model. So either this is not the same device > or you just wrote bindings to whatever you have in driver. > > Nothing in commit msg explains this. > > What you should do? Depends. If you just write bindings for driver, then > stop. It's a NAK. Instead write bindings for hardware. > > If the first choice, just the hardware is somehow like this, then > explain in commit msg and device description, how this device can be > connected over other bus, not MMIO. You can draw some schematics in > commit msg explaining architecture etc. Sorry the information provided in the commit message is not very clear. The basic access to the registes is still MMIO. nvmem is used to have a better abstraction and cleaner description of the hardware. Currently most of the data is exported using the parent syscon device. The relevant data is read-only and contained in a single register with offset 0x14: - Chip variant - Chip part number - Chip manufacturer There are more read-only registers in this section of address space. These are relevant to other components as they define the operating points for example. For the OPP table relevant are chip variant and chip speed (which is in a different register). Instead of devices refering to this whole register range of 0x20000 in size, I would like to introduce this nvmem abstraction in between that describes the information and can directly be referenced by the devices that depend on it. In this case the above mentioned register with offset 0x14 is instead described as nvmem-layout like this: nvmem-layout { compatible = "fixed-layout"; #address-cells = <1>; #size-cells = <1>; chip_manufacturer: jtagidmfg@14 { reg = <0x14 0x2>; bits = <1 11>; }; chip_partno: jtagidpartno@15 { reg = <0x15 0x3>; bits = <4 16>; }; chip_variant: jtagidvariant@17 { reg = <0x17 0x1>; bits = <4 4>; }; chip_speed: jtaguseridspeed@18 { reg = <0x18 0x4>; bits = <6 5>; }; The underlying registers are still the same but they are not hidden by the syscon phandles anymore. The device that consumes this data would now use nvmem-cells = <&chip_variant>, <&chip_speed>; nvmem-cell-names = "chipvariant", "chipspeed"; instead of syscon = <&wkup_conf>; Best, Markus
diff --git a/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml b/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml index dada28b47ea0..f085b7275b7d 100644 --- a/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml +++ b/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml @@ -26,9 +26,24 @@ properties: reg: maxItems: 1 + nvmem-cells: + $ref: /schemas/types.yaml#/definitions/phandle-array + + nvmem-cell-names: + items: + - const: chipvariant + - const: chippartno + - const: chipmanufacturer + required: - compatible - - reg + +oneOf: + - required: + - reg + - required: + - nvmem-cells + - nvmem-cell-names additionalProperties: false @@ -38,3 +53,9 @@ examples: compatible = "ti,am654-chipid"; reg = <0x43000014 0x4>; }; + - | + chipid: chipid@14 { + compatible = "ti,am654-chipid"; + nvmem-cells = <&chip_variant>, <&chip_partno>, <&chip_manufacturer>; + nvmem-cell-names = "chipvariant", "chippartno", "chipmanufacturer"; + };