Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8389975ybl; Thu, 16 Jan 2020 15:55:41 -0800 (PST) X-Google-Smtp-Source: APXvYqya/dQQ2Juf9vqn2TdGEXmVF8X2GSWEBS9++PWh5Q4pbiupmiw3CwvxWxBjr7kVJIZ8FJB4 X-Received: by 2002:aca:ef82:: with SMTP id n124mr1442183oih.88.1579218941257; Thu, 16 Jan 2020 15:55:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579218941; cv=none; d=google.com; s=arc-20160816; b=MLQRLXtkJ464/WZl5u6lmSRHkWlhMt+dtTDRaYrj0YH2R5idTu2gPVPFWLHF5sCdmF xIp2YQ1UuEI+T7YNfx55w0knTG+mReNDMr+GDJ6/kOXxVRhwq5Ft6t1NadytG5kj6PQq IEqCpO+oYTJ+5Z94cj7+BGKWw5862qI3HlnyYSzm9ku8Q6YWO42ZgZ1GhDp7qAVcYBzI 4L5NkJY96E4+9v3o+2rmAsqvSoD+RdpkfdvHgibdwJiWy/7dx4XlKDIN2EgDEF8jFWPw TssUbEyN0OCg6X+9eJv44NcdS5eKUhv8MyCCRgv4Zo1xIc6JAbcPaEe14yUp7pVWVKkB cYaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ownIKscCoJ0ifHnW+WtXLNIaHz3TKTKB9xX6VT8y1A8=; b=rfgrGA40ipuhwBb7kHML318LZEkqoM/Iwc+vACnLDjIigfk4uSDbfxRjZAWGkfe+SH +PXCDgH0blsKfwiGzLlgKYv2/DQSTM+B1q6FyI+pDbU+9totnr3l/JC0TDrU7CKjzgt/ dFeBmI2m/MouwvM2reIGWgiST+eOR0oW8l6k/aJWI1HbWw+B+ovA6zgmLLYgN1gcICvV XOH9KG08uZJ7+1eYVfZSpJdGWqpUK89TghdlYOd7MJh0py/W61TgLM9YqlIE9ADSxYE1 UudMReE8dkSuPK0jaxiSTfR7OK1ox+VGGXVUnF99xtzv5ovqZ7XGnIKu98c2DsNePCuu 6HeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=f44+CoWj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v25si14314181otn.125.2020.01.16.15.55.27; Thu, 16 Jan 2020 15:55:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=f44+CoWj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394740AbgAPR7L (ORCPT + 99 others); Thu, 16 Jan 2020 12:59:11 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:34334 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394723AbgAPR7I (ORCPT ); Thu, 16 Jan 2020 12:59:08 -0500 Received: by mail-ed1-f66.google.com with SMTP id l8so19738719edw.1 for ; Thu, 16 Jan 2020 09:59:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ownIKscCoJ0ifHnW+WtXLNIaHz3TKTKB9xX6VT8y1A8=; b=f44+CoWj4lO/C+QdvGojAgqPOI4YZ5boSw/hGgMBaiTA4H+d+tLuOpWvF99HpOOy3A iqkPKL8kBRo9t8ns8InBbiB/zCzzOxaT0N7uBbkLZGBFz8f/SvuTmzL5s/PgsrFmPg76 Bjtkflj/Fk1zbC/Vt4uT8Aa+gjWLtXgUcFpMY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ownIKscCoJ0ifHnW+WtXLNIaHz3TKTKB9xX6VT8y1A8=; b=qV98hMd0yGFSyTeECaO+Cv2Bchta8ZC60JpFC/hvfQpEUPbZ1iuL5PfYl32B7Och93 RtKcFYS++tWdal0RmPu/kbyIYoFrrOz842wHP90taHDIol/q+tJuNtOapSs4d+/9gG2M qwLQmfVrh96MFjQzNbH5CqKaWnCqGLqvbNR99tRS4gDYUa6pZ738RJ2xc0pLp7Sy3fld vlqqh86kyEf1ajIGck70Z0H1aMuKEBzefCw/IvUPseFePnaMcO6g4Wx1DK8CUj4/GnVl UNHwtmY4ps9+mdEPR8r80yMm9oeGTthlk3QOgCJ9EemADZUkaT02oIFQPJnncHIvk+/X Sy9w== X-Gm-Message-State: APjAAAVSSwbDJ4rvb56v3NQ29gHlFEhuBm4mhkffcFPwRZpVnP8h0P3c /2Nw55Qvt++TSZnesGeqVDKbvifXNV4= X-Received: by 2002:a17:906:33db:: with SMTP id w27mr4168230eja.347.1579197545699; Thu, 16 Jan 2020 09:59:05 -0800 (PST) Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com. [209.85.208.42]) by smtp.gmail.com with ESMTPSA id k26sm902652edv.13.2020.01.16.09.59.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Jan 2020 09:59:05 -0800 (PST) Received: by mail-ed1-f42.google.com with SMTP id l8so19738641edw.1 for ; Thu, 16 Jan 2020 09:59:04 -0800 (PST) X-Received: by 2002:a05:6402:1547:: with SMTP id p7mr37597769edx.73.1579197544298; Thu, 16 Jan 2020 09:59:04 -0800 (PST) MIME-Version: 1.0 References: <20191217005424.226858-1-swboyd@chromium.org> <20191220231040.GA11384@bogus> <5e12cc29.1c69fb81.fe838.d5f3@mx.google.com> In-Reply-To: <5e12cc29.1c69fb81.fe838.d5f3@mx.google.com> From: Andrey Pronin Date: Thu, 16 Jan 2020 09:58:52 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] dt-bindings: tpm: Convert cr50 binding to YAML To: Stephen Boyd Cc: Doug Anderson , Rob Herring , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 5, 2020 at 9:57 PM Stephen Boyd wrote: > > Quoting Rob Herring (2019-12-20 15:10:40) > > On Tue, Dec 17, 2019 at 09:45:02AM -0800, Doug Anderson wrote: > > > On Mon, Dec 16, 2019 at 4:54 PM Stephen Boyd wrote: > > > > diff --git a/Documentation/devicetree/bindings/security/tpm/google,cr50.yaml b/Documentation/devicetree/bindings/security/tpm/google,cr50.yaml > > > > new file mode 100644 > > > > index 000000000000..8bfff0e757af > > > > --- /dev/null > > > > +++ b/Documentation/devicetree/bindings/security/tpm/google,cr50.yaml > > > > @@ -0,0 +1,52 @@ > > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > > > +%YAML 1.2 > > > > +--- > > > > +$id: http://devicetree.org/schemas/tpm/google,cr50.yaml# > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > > + > > > > +title: H1 Secure Microcontroller with Cr50 Firmware on SPI Bus > > > > + > > > > +description: > > > > + H1 Secure Microcontroller running Cr50 firmware provides several functions, > > > > + including TPM-like functionality. It communicates over SPI using the FIFO > > > > + protocol described in the PTP Spec, section 6. > > > > + > > > > +maintainers: > > > > + - Andrey Pronin > > > > > > Does Andrey agree to be the maintainer here? > > I Cced Andrey in hopes of eliciting a response. Yes, I finally can confirm I agree to be the maintainer. > > > > > > > > > > I'd like to see if we can delete most of what you've written here. > > > Specifically in "spi/spi-controller.yaml" you can see a really nice > > > description of what SPI devices ought to look like. Can we just > > > reference that? To do that I _think_ we actually need to break that > > > description into a separate YAML file and then include it from there > > > and here. Maybe someone on the list can confirm or we can just post > > > some patches for that? > > I'm not sure what to do here. > > > > > > > > > > > +properties: > > > > + compatible: > > > > + const: google,cr50 > > > > + > > > > + reg: > > > > + maxItems: 1 > > > > > > I'm curious if you need a minItems here. ...and if we don't somehow > > > include it, should we follow 'spi-controller.yaml' and treat this like > > > an int? > > > > Really, just 'true' is sufficient as you can't say which CS number it is > > here. > > Ok. > > > > > > > > > > > +required: > > > > + - compatible > > > > + - reg > > > > + - spi-max-frequency > > > > > > Technically spi-max-frequency might not be required (the SPI binding > > > doesn't list it as such), but I guess it was before... > > > > Generally, we expect a device knows its max and this should only be used > > it a board has a lower value. However, sometimes there's exceptions. > > > > Shouldn't really be debate here unless the old binding doc was wrong. > > The old binding doc had it as required and the spi framework seems to > bail out if this property isn't specified (see of_spi_parse_dt() for > more details). > > > > > > > > > > > > > + - interrupts > > > > + > > > > +additionalProperties: false > > > > + > > > > +examples: > > > > + - | > > > > + #include > > > > + spi { > > > > + #address-cells = <0x1>; > > > > + #size-cells = <0x0>; > > > > + tpm@0 { > > > > + compatible = "google,cr50"; > > > > + reg = <0>; > > > > + spi-max-frequency = <800000>; > > > > + interrupts = <50 IRQ_TYPE_EDGE_RISING>; > > > > > > I would tend to prefer seeing the interrupt parent in the example > > > since it's pretty likely that the GPIO controller isn't the overall > > > parent and likely that our interrupt is a GPIO. I'm not sure the > > > convention, though. > > > > Example is fine, but shouldn't be in the schema. > > Ok. Will add an interrupt parent like > > interrupt-parent = <&gpio_controller>; > -- Andrey