From patchwork Tue Sep 13 09:10:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 12974586 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B2FDC6FA82 for ; Tue, 13 Sep 2022 09:10:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231521AbiIMJKq (ORCPT ); Tue, 13 Sep 2022 05:10:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231566AbiIMJKn (ORCPT ); Tue, 13 Sep 2022 05:10:43 -0400 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8883E5789E; Tue, 13 Sep 2022 02:10:42 -0700 (PDT) Received: by mail-pg1-x52d.google.com with SMTP id s206so10756856pgs.3; Tue, 13 Sep 2022 02:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date; bh=0fVYsPpgbLrfPt7bLk4lwcWWIsrCzoQTWLFoUGZ6eQA=; b=mD5Nrf9RC73HP7UlMAlqVZ7qrPKSzlaRv1D1fvm79DjLszTOee1+MXHRJnxK/PXkTe lFjlbQKOPIKElRI52MdvQ30Zn0FPR8k/+xhBzwSY1cMi8tevL1XE0k/tWq2SRYESEkMi j12TXt/L2PzwxGwZvbcqljYDBEjmF96chrePeYFR7xYlRww5sD7glw8CBF3UIsonyymB QVSRM8k80x40WStagLQY4I2XLazNhAgAj2UCmvTwLzEuczM1l/ad1VuSbSb6KrUP45IS p7XPH4vHqi7zqP74+lkLBrDaXHbG0GfbeQuJeP0u03koD+nJOLCyUpvt55XH00I0iDK6 Hrxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date; bh=0fVYsPpgbLrfPt7bLk4lwcWWIsrCzoQTWLFoUGZ6eQA=; b=WHkfxdxx9YZBsA2+xRCjv6OatWejpnshxHLv8gW0pRemC/qm+EAfWLoC6rYZWSuYkZ dBM4qSh+TW+kATHS3x2Gxfkpp9p+TduXls9AUDxkBpj4YeLgI1wqGt/SDBVlSW//Vtzk c3R1WjFr0ay1sAFo31U/QiKcEkCabsbwElP3WmaEgfjRGKg6Lk28jWa/IUg1NHQYGxlZ 65uhLS3vKrAvTuFgwvGRVkC9/7K6GdvBHHHOcQuzOQ+zlrFkTU4XP2ZBqfvzzp8dbtp1 7rdJ9RtSvMdk/ImiLjaIxhwDxE3gGam/DY16gbd1SLbiPXZdsEB5Ga+tgKU76u0Uy3dA Vmow== X-Gm-Message-State: ACgBeo0ympJlswfVgaPHRbwkcrR+ezj9ZfUuVrWZmv6fMVDf2X68OsFZ i/p5MJxq9fjfX21gKEl9eXQ= X-Google-Smtp-Source: AA6agR5vx4/PQEVnRCknNIWqZbl79A20RYHcHvnVgGv2e2ZUTpNB5MkLCDVP5yILwwciFJlKAw3igQ== X-Received: by 2002:a63:174c:0:b0:438:aece:e2f5 with SMTP id 12-20020a63174c000000b00438aecee2f5mr14212391pgx.366.1663060241941; Tue, 13 Sep 2022 02:10:41 -0700 (PDT) Received: from voyager.lan ([45.124.203.18]) by smtp.gmail.com with ESMTPSA id s8-20020a17090ad48800b001f2fa09786asm6801668pju.19.2022.09.13.02.10.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Sep 2022 02:10:41 -0700 (PDT) Sender: "joel.stan@gmail.com" From: Joel Stanley To: Rob Herring , Peter Huewe , Jarkko Sakkinen Cc: Johannes Holland , devicetree@vger.kernel.org, linux-integrity@vger.kernel.org, Jason Gunthorpe , eajames@linux.ibm.com Subject: [PATCH 1/2] dt-bindings: tpm: Add schema for TIS I2C devices Date: Tue, 13 Sep 2022 18:40:23 +0930 Message-Id: <20220913091025.1768882-2-joel@jms.id.au> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220913091025.1768882-1-joel@jms.id.au> References: <20220913091025.1768882-1-joel@jms.id.au> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org From: Johannes Holland Add a YAML schema to support device tree bindings for the generic I2C physical layer. Refer to the TCG PC Client Platform TPM Profile (PTP) Specification for TPM 2.0 v1.04 Revision 14. This includes descriptions for the Nuvoton and Infineon devices. Signed-off-by: Johannes Holland Signed-off-by: Joel Stanley --- .../bindings/security/tpm/tpm-tis-i2c.yaml | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Documentation/devicetree/bindings/security/tpm/tpm-tis-i2c.yaml diff --git a/Documentation/devicetree/bindings/security/tpm/tpm-tis-i2c.yaml b/Documentation/devicetree/bindings/security/tpm/tpm-tis-i2c.yaml new file mode 100644 index 000000000000..fb7b747ff2a5 --- /dev/null +++ b/Documentation/devicetree/bindings/security/tpm/tpm-tis-i2c.yaml @@ -0,0 +1,49 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/security/tpm/tpm-tis-i2c.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: I2C PTP based TPM Device Tree Bindings + +maintainers: + - Johannes Holland + +description: + Device Tree Bindings for I2C based Trusted Platform Module (TPM). + +properties: + $nodename: + pattern: "^tpm(@[0-9a-f]+)?$" + + compatible: + oneOf: + - description: Infineon's Trusted Platform Module (TPM) (SLB9673). + items: + - const: infineon,slb9673 + - description: Nuvoton's Trusted Platform Module (TPM) (NPCT75x). + items: + - const: nuvoton,npct75x + - const: tcg,tpm-tis-i2c + - const: tcg,tpm-tis-i2c + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + tpm@2e { + compatible = "nuvoton,npct75x", "tcg,tpm-tis-i2c"; + reg = <0x2e>; + }; + }; +... From patchwork Tue Sep 13 09:10:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 12974587 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30882C54EE9 for ; Tue, 13 Sep 2022 09:10:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230521AbiIMJKt (ORCPT ); Tue, 13 Sep 2022 05:10:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231435AbiIMJKs (ORCPT ); Tue, 13 Sep 2022 05:10:48 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC9CB57890; Tue, 13 Sep 2022 02:10:46 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id q9-20020a17090a178900b0020265d92ae3so14946184pja.5; Tue, 13 Sep 2022 02:10:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date; bh=fmTTNMO6nsNe3wwRALCsW2vgWT26jAViSTGEkQkN2xQ=; b=EssyJK6fB0axPke6T/p2C87jv/sbiRJHoG4x/dQN6+jfPRmKpLaEVPmPJi+unkfh6k wsetk8D4aeMRuFu9sPhjw0hQaWPficm+2owXUmNXAQgqT6ZuwKat94c8MFK54xy8Rt9u Z33pfb6IO4diwG/nA4yVOkeorrRC9ogoYXIStxpS2Mr/weWRysl0Fn7ZgUZMgqKUIpV3 EV1Gv5B89rEP7oul9rG14R/Prndtw/svOyfwVUrg1+3JdVXgEtNcCvJOYH1zed0lxs52 ljUYZlz0sHAKTiDBCsFV93BapwlxhDvMbRBTdjsBNNuC7vVRl+A9SKaa6ybUELgfz5gn +qxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date; bh=fmTTNMO6nsNe3wwRALCsW2vgWT26jAViSTGEkQkN2xQ=; b=mr+0yL9go5fow8/pAgdzBbh0tLqdLKHswrw10Eyg4J0FiPhTXbOLr8O4qVfXp9Dgzn 88FiqyEV1+WnJ99yd44yNk8oRWxESzdu3su+4TCRi0r9k2XhRhMMpC+/VhAJ/6rNelAK 66dSGG6YMOBWC87EtZ2IEzMovj40wnUqM7i/wuq7mRwa95D+1yTWUUGelud6KMQvJv6m yuTQvlqT7lEVBM2cmtgSYBarL533O/mUFWt19zRqAYw5JEdNlGGJim/YHgPwSMMshflb SUYbOzeohHnP1CHP6SGNa65gk0U/rPzpUvo9Ab8RFC0AFbPqyNJIvSLjiDyoCg5BcL9L 7ADA== X-Gm-Message-State: ACgBeo3cebE6hJ8CU5VXh4Xcv4SiYIoFR3Ytzlxn548KEz3TGbG8Lql4 DJwf+EyfpTAejwA+sJQrh0c= X-Google-Smtp-Source: AA6agR43iKPyWbCNjo8QDkPPZS91dQUTqq08M32ENbNk1z73i0He52m8DNdf1aE0cIL/jbK5VYyJMQ== X-Received: by 2002:a17:90b:4c4e:b0:202:fd53:7acd with SMTP id np14-20020a17090b4c4e00b00202fd537acdmr1413111pjb.98.1663060246366; Tue, 13 Sep 2022 02:10:46 -0700 (PDT) Received: from voyager.lan ([45.124.203.18]) by smtp.gmail.com with ESMTPSA id s8-20020a17090ad48800b001f2fa09786asm6801668pju.19.2022.09.13.02.10.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Sep 2022 02:10:45 -0700 (PDT) Sender: "joel.stan@gmail.com" From: Joel Stanley To: Rob Herring , Peter Huewe , Jarkko Sakkinen Cc: devicetree@vger.kernel.org, linux-integrity@vger.kernel.org, Jason Gunthorpe , Johannes Holland , eajames@linux.ibm.com Subject: [PATCH 2/2] tpm: tis-i2c: Add more compatible strings Date: Tue, 13 Sep 2022 18:40:24 +0930 Message-Id: <20220913091025.1768882-3-joel@jms.id.au> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220913091025.1768882-1-joel@jms.id.au> References: <20220913091025.1768882-1-joel@jms.id.au> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org The NPCT75x TPM is TIS compatible. It has an I2C and SPI interface. https://www.nuvoton.com/products/cloud-computing/security/trusted-platform-module-tpm/ Add a compatible string for it, and the generic compatible. Signed-off-by: Joel Stanley --- drivers/char/tpm/tpm_tis_i2c.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/char/tpm/tpm_tis_i2c.c b/drivers/char/tpm/tpm_tis_i2c.c index 0692510dfcab..4af27b7ec5b1 100644 --- a/drivers/char/tpm/tpm_tis_i2c.c +++ b/drivers/char/tpm/tpm_tis_i2c.c @@ -368,6 +368,8 @@ MODULE_DEVICE_TABLE(i2c, tpm_tis_i2c_id); #ifdef CONFIG_OF static const struct of_device_id of_tis_i2c_match[] = { { .compatible = "infineon,slb9673", }, + { .compatible = "nuvoton,npct75x", }, + { .compatible = "tcg,tpm-tis-i2c", }, {} }; MODULE_DEVICE_TABLE(of, of_tis_i2c_match);