From patchwork Fri Apr 21 09:13:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Yarlagadda X-Patchwork-Id: 13219656 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 C9190C77B75 for ; Fri, 21 Apr 2023 09:14:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231211AbjDUJOC (ORCPT ); Fri, 21 Apr 2023 05:14:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230033AbjDUJOB (ORCPT ); Fri, 21 Apr 2023 05:14:01 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10hn2229.outbound.protection.outlook.com [52.100.157.229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F84BAF0F; Fri, 21 Apr 2023 02:13:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NoJ/uR/xTJXp2ZJMPT4c8KrUTf0784pEHeO0xapyzV6QbDLa8i/eQCP1phZSAYxC/2wRmtgj5+xdJ0duNRmw01FYNSIxnsk9OiZxVYJMBYvOG8N5XokMLUd2mhLGSuTDa9okTLfqp7eot/CnCoRUzCsDV0QZVtdrBkia0CtKeF8z3UStMdDKAF/FRwKIkGOmh57cdNQ4xEAQiTKzwMhEBU7vyVS0AVqn2UcPpFAxjsmUGAhZRV7yseJE0lqSWGapzxB4dKmoV1YkJBgUz9hHfWlOQ4B3yhVFrpzmdSA5CBtG6wPquugz8zMiET920al2aEMMUbqp/v1TCFyiUl/lNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JDEXG2aOGP5HfveanhYkpEt+gV88x/8/T+EHM12vP5o=; b=S0Ur78eGoI3Ziq+qcc2Q5eF/9k4faIrClRJQppbPW2D8W0hGgzl3cyfVFDVlkdhH7HBUQSXPaRqngQDB7V5/8mwG2NevCYKXN9kIb9oUQuyKXxtgbv27sGZ6bZkFAWC2VxJtkMREGGWtWRVEI+btWayq7gTA+KqXX/3y8t+rXDGS7JNTKjpGxyzaabIGZFSkSueGVNQXVa4Z+XiNI+S2hGabS7mo/tknTM39fTIq5WXEjkRsF9ey8L/Itr/zpx/47sNSMnjEhyXXNk/fSxnImksGoDqmhaxQvX2aVNVN4sWDfvw9MzhV32US196LQc8+5FfKyEEKpfrmc0eyrN6bLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JDEXG2aOGP5HfveanhYkpEt+gV88x/8/T+EHM12vP5o=; b=mtHKhxoeYEqfRA4u/WPviNer5bMIiPKSSoX97CAIii7iR56MwdNffqHBTAS7qNaf9i3S73ZKsZxsRI0MFCClUAiCsb3QL5qUA1S+QT0YxhkM9MHtKzBJ7In3JkWYVicowBF1NpJz3NUz5WXshIm1ns8v3ZMTQC/F/DKmezBZTT4jXwvzYyD7qEQk24wyZhJINp7mlIRr99W0S+tlZNtQHzIj/aGJzHukFJEfXLgFVjXIn+Zp8Bwg+2tRy4YyGAkx+Uabf4eEQPuEgdMMgxtJBZN8eWaQklRfEgCfmlKhZzawqoWlPvPXkll8YPmj0OPJO8W+VD4lVpYdcenf/FLS4Q== Received: from MW4PR04CA0353.namprd04.prod.outlook.com (2603:10b6:303:8a::28) by MW5PR12MB5683.namprd12.prod.outlook.com (2603:10b6:303:1a0::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Fri, 21 Apr 2023 09:13:41 +0000 Received: from CO1NAM11FT115.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8a:cafe::7) by MW4PR04CA0353.outlook.office365.com (2603:10b6:303:8a::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.27 via Frontend Transport; Fri, 21 Apr 2023 09:13:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by CO1NAM11FT115.mail.protection.outlook.com (10.13.174.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.27 via Frontend Transport; Fri, 21 Apr 2023 09:13:41 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Fri, 21 Apr 2023 02:13:34 -0700 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Fri, 21 Apr 2023 02:13:33 -0700 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Fri, 21 Apr 2023 02:13:29 -0700 From: Krishna Yarlagadda To: , , , , , , , , , , CC: , , , , Krishna Yarlagadda Subject: [Patch V10 1/3] spi: Add TPM HW flow flag Date: Fri, 21 Apr 2023 14:43:07 +0530 Message-ID: <20230421091309.2672-2-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230421091309.2672-1-kyarlagadda@nvidia.com> References: <20230421091309.2672-1-kyarlagadda@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT115:EE_|MW5PR12MB5683:EE_ X-MS-Office365-Filtering-Correlation-Id: 98ce3719-bf10-4a3f-1449-08db4248b336 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IT5HhZyCJJcu+IdTMyWB+tFy94erBtNhz5VdM98Rxjxo2tQRhOPs0m9YdxiByKLRT135AqVH3clxtH0I2YrLUpk6J8pv2mgwYyO+QQwVYkibNnPJM1Po15QPGS8NODU7xlYH1drl1aHRAKKiqLwHHCr9edOM4A3j60AwtTFPbENbA0PxEppmbrhQEtT8NmBYKCZ7kyoilHDKxR5+fihMd60MPlkmX2vKlW5KGc+SvYEPmaHXvPZVEgH3brz7twa6GtKD4qfUxhKUAVc5I1/19YE7MlIRSe4VSDxV8QrqMidOpg0MLK2SROfw2LhrVFbc9Qw6tCM4b9maeHI8qnuDMtPB8H+7gdVBFi3+c9CYSt9FbrMCeBDwZyf96DTknj7Y4Wxt1kQuvs7CB87IpkbrnxhQbqLg4xaVsVTo3EA0cdDIkDtnOfXSgiI2akOOiEQrSpWHXa4KATCi0+JP9iaLKWC0UowK2MCjFJ3wK6zpavkHyrcahkKUdAen+tGsvIg+HGAu7hj3grgGZN83bJvoyrjeiU8gyH89udxM/aM20+zZAvfySF9cLGtFPY4I8R7yCKzUaTzaQjtJaIa+gMyUMF3PXlYSA0SnLY5TNu+sQrG7qLTfN86QXr9+iub8ryUfhdEGNGRtEXMqmBK9/r+FVwyKSa6GMU3PLQyGG4HpZwMmHvWIBLAvPMxqYB+AlkGxX8xIW74YBTJ9dun2VpkvzZW9zr0nZEeHXg/+uyx3umbJiDR02CmBf23XuQO1e1hvjofieXRkz1Sl7xsXfa4SWRI8YPujEJPKLnKvo6kYtRdqvYESplCEY4IjehIIKGZrDrFXYHp8K7o0FIOzUjdU6Za4uYrakBKtNmotKDUFnFO38ehCtAJjgMyQjS/3RzdRBXrAQhaKNThY/LoIsKTbv6DZfTAbexyfZjqn6wc/OEk= X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(376002)(396003)(136003)(451199021)(5400799015)(36840700001)(46966006)(40470700004)(966005)(40460700003)(107886003)(70586007)(70206006)(4326008)(316002)(110136005)(7696005)(40480700001)(6666004)(86362001)(54906003)(82310400005)(478600001)(34020700004)(5660300002)(36756003)(7416002)(2616005)(8676002)(8936002)(356005)(7636003)(921005)(82740400003)(2906002)(83380400001)(47076005)(336012)(426003)(36860700001)(41300700001)(1076003)(26005)(186003)(2101003)(83996005)(12100799030);DIR:OUT;SFP:1501; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2023 09:13:41.4020 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 98ce3719-bf10-4a3f-1449-08db4248b336 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT115.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR12MB5683 Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org TPM specification [1] defines flow control over SPI. Client device can insert a wait state on MISO when address is transmitted by controller on MOSI. Detecting the wait state in software is only possible for full duplex controllers. For controllers that support only half- duplex, the wait state detection needs to be implemented in hardware. Add a flag SPI_TPM_HW_FLOW for TPM device to set when software flow control is not possible and hardware flow control is expected from SPI controller. Reference: [1] https://trustedcomputinggroup.org/resource/pc-client-platform-tpm -profile-ptp-specification/ Signed-off-by: Krishna Yarlagadda --- include/linux/spi/spi.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 873ced6ae4ca..cfe42f8cd7a4 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -184,8 +184,18 @@ struct spi_device { u8 chip_select; u8 bits_per_word; bool rt; -#define SPI_NO_TX BIT(31) /* No transmit wire */ -#define SPI_NO_RX BIT(30) /* No receive wire */ +#define SPI_NO_TX BIT(31) /* No transmit wire */ +#define SPI_NO_RX BIT(30) /* No receive wire */ + /* + * TPM specification defines flow control over SPI. Client device + * can insert a wait state on MISO when address is transmitted by + * controller on MOSI. Detecting the wait state in software is only + * possible for full duplex controllers. For controllers that support + * only half-duplex, the wait state detection needs to be implemented + * in hardware. TPM devices would set this flag when hardware flow + * control is expected from SPI controller. + */ +#define SPI_TPM_HW_FLOW BIT(29) /* TPM HW flow control */ /* * All bits defined above should be covered by SPI_MODE_KERNEL_MASK. * The SPI_MODE_KERNEL_MASK has the SPI_MODE_USER_MASK counterpart, @@ -195,7 +205,7 @@ struct spi_device { * These bits must not overlap. A static assert check should make sure of that. * If adding extra bits, make sure to decrease the bit index below as well. */ -#define SPI_MODE_KERNEL_MASK (~(BIT(30) - 1)) +#define SPI_MODE_KERNEL_MASK (~(BIT(29) - 1)) u32 mode; int irq; void *controller_state; From patchwork Fri Apr 21 09:13:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Yarlagadda X-Patchwork-Id: 13219658 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 76984C77B75 for ; Fri, 21 Apr 2023 09:14:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231644AbjDUJOc (ORCPT ); Fri, 21 Apr 2023 05:14:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231893AbjDUJOQ (ORCPT ); Fri, 21 Apr 2023 05:14:16 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02hn2244.outbound.protection.outlook.com [52.100.160.244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D497A253; Fri, 21 Apr 2023 02:13:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rq5NBg8CQ3nSQBTATIAc0rUBOgNLkfeQ/Bi6tze1odHT58fh48CHvQ59fUz3cQIKRhyC1zcZ80WESkO16Fbl5RTky4uMAaP1cHMlzmc1SRPgwZA4HN1y3DyTCSmYJQQMzr1YQIfZNePKlCEi54u8xeaa7L9RwSviW/uTPd8uvMwkN/ynvalDD8mJqxZMJRlIlaK1VxswD5/cUOp47o3ctiuxeq42oDYTsjBXIPN8VtmDE/dev92SDsxX7ZaVayj0zDLOWW1BBeU2ZAgAFZ22raRFnP6VQ6V6MuFw2RDLIGp5V/gMacTGte5Bw3fJJjjXI6reuSxJRfR5QuHOIW10Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=T/OCcEi0eKhWhbsKIPJhHnH3b4V/eOLudTwMFUOom5Q=; b=bVA0fczgFZ9J3C2qxX4BLAEGdvR3AVynRuZEP/ugnfme6JrwRejm+LxCRfIbD0Bo6IKgzNttltfTRsEO+v7vDCwtEI0QQg9P08gHTdRMgTFKieFGC5imVsZrKPsWRGMgRcm9oVyzzWk1IcNlowdTpuLKYRZJg7Yqt1gOnh4RW/hsjh48WfGk5vx+s1J2RxfZHHxKw3IzbJGI8JKO2+DaXaing7onfTg4qbvTSNIp7oSycxwQN5t4elg52DIYxjYa/VWaieMOQcNSN1W0pHjuBRHcpMicYsEKo0Iy/QAewf16MXqzaOLs+f12N+tiPUnH31kXXRTgYMZk0yNtIUwZ+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=T/OCcEi0eKhWhbsKIPJhHnH3b4V/eOLudTwMFUOom5Q=; b=Ey18GQukF4icBkIVTjwexCM1SYCa+cpSJCjJjGk2IZ7+CdabuYb+Cdm/Beh9pqieGK455Khs/dlSzNRZUe4ItotMYE1K7SRLQ2P8CdMgjE+iU1lQIGPqt//h7OjJO73AIBBlk8CmtRfG6VDb/PUzhBFJY2CN0nxNITTUYj0bUHC+c/sO6gRywJcX8zRQ8kOSrYCEyEthkIChQIePENd0P6H/N1tb5GJM/qe3H9dy1+XEA2WQJj5TkPuu+DIB1oANhU30iKjfBZuUdXT64xmf/BC8NQ+W3GNAd6jbCD8YDQwUNRLhdF0WHBvysrF2yDXt/ZuwdN0YQtGJfexrp1/S8A== Received: from MW4PR04CA0354.namprd04.prod.outlook.com (2603:10b6:303:8a::29) by DS0PR12MB8319.namprd12.prod.outlook.com (2603:10b6:8:f7::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Fri, 21 Apr 2023 09:13:45 +0000 Received: from CO1NAM11FT115.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8a:cafe::42) by MW4PR04CA0354.outlook.office365.com (2603:10b6:303:8a::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.27 via Frontend Transport; Fri, 21 Apr 2023 09:13:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by CO1NAM11FT115.mail.protection.outlook.com (10.13.174.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.27 via Frontend Transport; Fri, 21 Apr 2023 09:13:45 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Fri, 21 Apr 2023 02:13:39 -0700 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Fri, 21 Apr 2023 02:13:39 -0700 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Fri, 21 Apr 2023 02:13:34 -0700 From: Krishna Yarlagadda To: , , , , , , , , , , CC: , , , , Krishna Yarlagadda Subject: [Patch V10 2/3] tpm_tis-spi: Add hardware wait polling Date: Fri, 21 Apr 2023 14:43:08 +0530 Message-ID: <20230421091309.2672-3-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230421091309.2672-1-kyarlagadda@nvidia.com> References: <20230421091309.2672-1-kyarlagadda@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT115:EE_|DS0PR12MB8319:EE_ X-MS-Office365-Filtering-Correlation-Id: a8f6fd34-cad4-44a4-6048-08db4248b5b7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: L3gPf0ezKIBQ4xUhpzQWN5ionU9HDL8UStkgq3COJ6e7DTs3QgTG4H4xKxXgBzkkL2cOW/BKUIgTEkuS/syvXQtK/WG5zEYWmV0MCK7kx315ZMzxvCu5i1nDEwjxaIGeCQrJVamQ1bclR7FzzdNLEcyakI9Vghwd1ParZZuh1RVCH8asPOA9+Rp6FO3c6yu/aDsjBai2WJGExpMvKyYNbnTFA7qFOBKNkjBjazXVQZMumt7hWJ7cailacuNssyqUHYYVy9lh2NVOmuiJjNQawEVsyTuRBSrTMfs090lnTYVb5UQqhOPFCFTE8XXSz577gqXkuzpvmRArCeIYmwnwO3H3BXk0uum1RkLHAtfI0FJ3586aEjpEH9fj6Y3h62IjyIQmJylxQjOKoNV5Lec1taOvWrqnvwyUU8ZlrhKMoJOWWy3ZpZIMu/JD78fJgbkrGw5WnZ80V/DCaxoKMtkHXYVAVjZryTxmONJIq3drL4lekx0g1Oca1GgT/VDR8VRpcw2wBCFHtgyPhYSeIaUYQ8oe0b8QfuqM0HMHWbuvRpg5TpyLKNFrG9eGh6BgK7avCPOlafGeQkl/9rZDY6YT0mjpgI5CgUPFhHNPyVdBzq3RQKLcDudh7MonOC9k67XiduUsKvBwlmNM+mMHRo80J82vG0dqJecffCLa23JiW5UFL4zgkNKNtRhY00T9UXCg9k2PGxocSv61np8Eo6qTAssuAqUwGmPOz7vT9EGNiNu0MljECJV6H7/SSmNaoBzc/LYsobBd8BxPJiifGrMkn6cS6bEFWcUmxAOLLuGcpHN0HNdtNxybwy74OLdHLj28kzmQ3ke6SHj83vO1Q7AJ7CdqmUcFhUp10yAqAyH8XY7+zD18WvAIwJiPgbwp/BHB X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(396003)(376002)(346002)(5400799015)(451199021)(36840700001)(46966006)(40470700004)(186003)(1076003)(26005)(41300700001)(107886003)(7636003)(921005)(356005)(426003)(6666004)(7696005)(47076005)(36860700001)(2616005)(83380400001)(336012)(478600001)(40460700003)(34020700004)(7416002)(4326008)(40480700001)(82310400005)(70206006)(70586007)(316002)(82740400003)(110136005)(5660300002)(54906003)(36756003)(8676002)(86362001)(8936002)(2906002)(83996005)(2101003)(12100799030);DIR:OUT;SFP:1501; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2023 09:13:45.5892 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a8f6fd34-cad4-44a4-6048-08db4248b5b7 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT115.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8319 Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org TPM devices may insert wait state on last clock cycle of ADDR phase. For SPI controllers that support full-duplex transfers, this can be detected using software by reading the MISO line. For SPI controllers that only support half-duplex transfers, such as the Tegra QSPI, it is not possible to detect the wait signal from software. The QSPI controller in Tegra234 and Tegra241 implement hardware detection of the wait signal which can be enabled in the controller for TPM devices. The current TPM TIS driver only supports software detection of the wait signal. To support SPI controllers that use hardware to detect the wait signal, add the function tpm_tis_spi_hw_flow_transfer() and move the existing code for software based detection into a function called tpm_tis_spi_sw_flow_transfer(). SPI controllers that only support half-duplex transfers will always call tpm_tis_spi_hw_flow_transfer() because they cannot support software based detection. The bit SPI_TPM_HW_FLOW is set to indicate to the SPI controller that hardware detection is required and it is the responsibility of the SPI controller driver to determine if this is supported or not. For hardware flow control, CMD-ADDR-DATA messages are combined into a single message where as for software flow control exiting method of CMD-ADDR in a message and DATA in another is followed. Signed-off-by: Krishna Yarlagadda Reviewed-by: Jarkko Sakkinen --- drivers/char/tpm/tpm_tis_spi_main.c | 91 ++++++++++++++++++++++++++++- 1 file changed, 89 insertions(+), 2 deletions(-) diff --git a/drivers/char/tpm/tpm_tis_spi_main.c b/drivers/char/tpm/tpm_tis_spi_main.c index a0963a3e92bd..8967f179f808 100644 --- a/drivers/char/tpm/tpm_tis_spi_main.c +++ b/drivers/char/tpm/tpm_tis_spi_main.c @@ -71,8 +71,74 @@ static int tpm_tis_spi_flow_control(struct tpm_tis_spi_phy *phy, return 0; } -int tpm_tis_spi_transfer(struct tpm_tis_data *data, u32 addr, u16 len, - u8 *in, const u8 *out) +/* + * Half duplex controller with support for TPM wait state detection like + * Tegra QSPI need CMD, ADDR & DATA sent in single message to manage HW flow + * control. Each phase sent in different transfer for controller to idenity + * phase. + */ +static int tpm_tis_spi_transfer_half(struct tpm_tis_data *data, u32 addr, + u16 len, u8 *in, const u8 *out) +{ + struct tpm_tis_spi_phy *phy = to_tpm_tis_spi_phy(data); + struct spi_transfer spi_xfer[3]; + struct spi_message m; + u8 transfer_len; + int ret; + + while (len) { + transfer_len = min_t(u16, len, MAX_SPI_FRAMESIZE); + + spi_message_init(&m); + phy->iobuf[0] = (in ? 0x80 : 0) | (transfer_len - 1); + phy->iobuf[1] = 0xd4; + phy->iobuf[2] = addr >> 8; + phy->iobuf[3] = addr; + + memset(&spi_xfer, 0, sizeof(spi_xfer)); + + spi_xfer[0].tx_buf = phy->iobuf; + spi_xfer[0].len = 1; + spi_message_add_tail(&spi_xfer[0], &m); + + spi_xfer[1].tx_buf = phy->iobuf + 1; + spi_xfer[1].len = 3; + spi_message_add_tail(&spi_xfer[1], &m); + + if (out) { + spi_xfer[2].tx_buf = &phy->iobuf[4]; + spi_xfer[2].rx_buf = NULL; + memcpy(&phy->iobuf[4], out, transfer_len); + out += transfer_len; + } + + if (in) { + spi_xfer[2].tx_buf = NULL; + spi_xfer[2].rx_buf = &phy->iobuf[4]; + } + + spi_xfer[2].len = transfer_len; + spi_message_add_tail(&spi_xfer[2], &m); + + reinit_completion(&phy->ready); + + ret = spi_sync(phy->spi_device, &m); + if (ret < 0) + return ret; + + if (in) { + memcpy(in, &phy->iobuf[4], transfer_len); + in += transfer_len; + } + + len -= transfer_len; + } + + return ret; +} + +static int tpm_tis_spi_transfer_full(struct tpm_tis_data *data, u32 addr, + u16 len, u8 *in, const u8 *out) { struct tpm_tis_spi_phy *phy = to_tpm_tis_spi_phy(data); int ret = 0; @@ -140,6 +206,24 @@ int tpm_tis_spi_transfer(struct tpm_tis_data *data, u32 addr, u16 len, return ret; } +int tpm_tis_spi_transfer(struct tpm_tis_data *data, u32 addr, u16 len, + u8 *in, const u8 *out) +{ + struct tpm_tis_spi_phy *phy = to_tpm_tis_spi_phy(data); + struct spi_controller *ctlr = phy->spi_device->controller; + + /* + * TPM flow control over SPI requires full duplex support. + * Send entire message to a half duplex controller to handle + * wait polling in controller. + * Set TPM HW flow control flag.. + */ + if (ctlr->flags & SPI_CONTROLLER_HALF_DUPLEX) + return tpm_tis_spi_transfer_half(data, addr, len, in, out); + else + return tpm_tis_spi_transfer_full(data, addr, len, in, out); +} + static int tpm_tis_spi_read_bytes(struct tpm_tis_data *data, u32 addr, u16 len, u8 *result, enum tpm_tis_io_mode io_mode) { @@ -181,6 +265,9 @@ static int tpm_tis_spi_probe(struct spi_device *dev) phy->flow_control = tpm_tis_spi_flow_control; + if (dev->controller->flags & SPI_CONTROLLER_HALF_DUPLEX) + dev->mode |= SPI_TPM_HW_FLOW; + /* If the SPI device has an IRQ then use that */ if (dev->irq > 0) irq = dev->irq; From patchwork Fri Apr 21 09:13:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Yarlagadda X-Patchwork-Id: 13219659 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 8570EC7EE21 for ; Fri, 21 Apr 2023 09:14:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231890AbjDUJOf (ORCPT ); Fri, 21 Apr 2023 05:14:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231955AbjDUJOW (ORCPT ); Fri, 21 Apr 2023 05:14:22 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2059.outbound.protection.outlook.com [40.107.243.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 733FFAF20; Fri, 21 Apr 2023 02:13:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HcoSur/NKaj/1vrZmN3frx69RshmW6wlfnYqRH/olB4IRcDQQoLCOlXVQh+kzHslto/0Nkl5MXrqaSw2zdqzCXSfXmuP35mijcR762is+y1A/EYfAGh33a/0lrBPS01KfCjuuy9Fux7208aiSaFqMG/HsXhb/DEzD+2aFww1a44ucNefvbTASA/9v9I7VGK+zzYhFJQSrrjOxtu8QRSyGDGg3658IkJjUxkuhlOQ723wTU40nPwHyBkc+bkGG8RB7Zlt3KJr9LCbZZbKW6HyVeip6Ozz5a2AA115n6RgiPZWwB+O6xEUacmI9M2cpEwE6SfAeFEkzTT8Bi+IdxN0dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YUsSpoKQuIhRMFitmIN57d/3toAqN22GXDMTeeyP36A=; b=fXlPLrsfqtlwCOHyYA7847iJVQ9iskd5gCVG5dIXYY5SUIEQz3jCecruQGliMEBbrxHVuabSb6LVq7kjXwwJ3xZCdz0qDBv8k0vR7rVrhpaplh1lKf7mnwxdPPHmFA1rUrVgO2halI3WlK7XC3BxHk8M0dpZUimizOmfGqzAn4+GrxuMjAA35ch3yHu10RJ0sqDUSySOhyEpHD5ojcCGS3N8e/WSssbEx2jHn/cm85rlQeBmg6Z5AbT2ryMNIlNWEQ/HrX8YkiCfnnyms2vQmvlhYikiSI1vnjJ/15a+EKJRoOaGxDdQ9ATquE8t5hgwgMq4g+CLYqOJqxkz5Bihdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YUsSpoKQuIhRMFitmIN57d/3toAqN22GXDMTeeyP36A=; b=plD0fIScnitp2uQcdkW/j5k9dokqtVL2nDIGqKb066GqZvE50TdJe6pzcSAeFGfugzNFIVOqs03JLgoxa/AH+XhRJKFZN0DkG+XgLqZUCxmTnsV+mE6QHwKGSU+GlCcMOxe16QfywlgeF0Tuvl2KWQfLE7tbF41TWHOubryQfmrnCuF6tlp2zvBOLxeLjqHdKk64dyvniuE8uIHxdtK7mioOGhlwA3DGiX+4w2N0xMOJW0LBx3cxqC/cwAyB42y8LJNTC4z7ls+1yPrCyZD2DufhfGI6ql4OI/wwtUw8e9ZDXPvqhAvtyKgp3TrDm3PaCN6VzytcT2AVxV5cYHBZEA== Received: from MN2PR10CA0025.namprd10.prod.outlook.com (2603:10b6:208:120::38) by DS0PR12MB8199.namprd12.prod.outlook.com (2603:10b6:8:de::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Fri, 21 Apr 2023 09:13:53 +0000 Received: from BL02EPF000145B8.namprd05.prod.outlook.com (2603:10b6:208:120:cafe::2f) by MN2PR10CA0025.outlook.office365.com (2603:10b6:208:120::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.25 via Frontend Transport; Fri, 21 Apr 2023 09:13:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by BL02EPF000145B8.mail.protection.outlook.com (10.167.241.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.16 via Frontend Transport; Fri, 21 Apr 2023 09:13:53 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Fri, 21 Apr 2023 02:13:44 -0700 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Fri, 21 Apr 2023 02:13:44 -0700 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Fri, 21 Apr 2023 02:13:39 -0700 From: Krishna Yarlagadda To: , , , , , , , , , , CC: , , , , Krishna Yarlagadda Subject: [Patch V10 3/3] spi: tegra210-quad: Enable TPM wait polling Date: Fri, 21 Apr 2023 14:43:09 +0530 Message-ID: <20230421091309.2672-4-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230421091309.2672-1-kyarlagadda@nvidia.com> References: <20230421091309.2672-1-kyarlagadda@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF000145B8:EE_|DS0PR12MB8199:EE_ X-MS-Office365-Filtering-Correlation-Id: ba773f36-76da-4ba0-4e12-08db4248ba49 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xSoZdK7VV7FiR86gfa8s1yJVjL6DFuOV/vMUyCV7k3I0f/hWv6dF2gvuyaaXQBdt1i0dwWpD44fyXZRLOI7LVhvZMyFFzB37L8dXpbj7v4J5vQEegPQA3jze6rKPvlJn4JX70eIMDFk+g52pb+JNnD8Gl3gmuLyVhJyr40lK08Cjl/dGhFwgAPzwRRu7pGvjJYISaEiBtS9I9sdBsMtaVtO2RPtgUgStuuYZC0FgJhmAZLsrcaaD9sIViMzSER54PbsStwW0KGlfcsXUJlbCLsw12021ys8aU3hLCBXFq4aNBmflkDhrQKd9iwuNsp/B2GlFUMz/+y8CuLRykb2TXALA1jRNEKUJWZIdYvnPY8hBzMepWqAju6qzjlAPhelWzXC8gfshLHEaIIiUSCC8DlFO/0SHzyMUTOQZJX+iw2EfJipM7D43Ipl2ikdusA3u+0VrTQpPVfY9fMfpOwpf8Nj9zbau30QxbXGeJhb4ewbIAUHfNYqzGSqJtGbenQo82tkj5Q1V7rJ+8nIBddhhrejTdmxO+VgdsOyUsnnciqJJvSbMBH9seQEZP2caCDOpSmrvYTLmkbAk/5xTK1wrQ9rIFnT7dol8UXioMI+OyjetAGK99SbSr/cxHG/wj5cxfO/FHgeb6cIVUrMgATZjOl8WwRW1P5cCXv/rUrKkA1ymTFOyDSU/a0HI0jJ52B02OsCVqzYd5bmAdqjnur6vXgtt0e4EXyX/q+PnrfRrM5TAqOfKwBFjzX0ifvhK+aDokAEa96WZDXf5xE5NYgnpSsws6aB9FZM/X/0RQvq/VSI2ROmS4SX3hDAVQj1d4P0m X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(376002)(346002)(39860400002)(396003)(451199021)(46966006)(36840700001)(40470700004)(921005)(316002)(54906003)(110136005)(70206006)(70586007)(4326008)(40460700003)(1076003)(26005)(107886003)(47076005)(36860700001)(336012)(426003)(2616005)(186003)(83380400001)(40480700001)(8676002)(5660300002)(41300700001)(8936002)(478600001)(7696005)(6666004)(82310400005)(86362001)(36756003)(82740400003)(2906002)(7416002)(7636003)(356005)(83996005)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2023 09:13:53.1470 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ba773f36-76da-4ba0-4e12-08db4248ba49 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF000145B8.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8199 Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org Trusted Platform Module requires flow control. As defined in TPM interface specification, client would drive MISO line at same cycle as last address bit on MOSI. Tegra234 and Tegra241 QSPI controllers have TPM wait state detection feature which is enabled for TPM client devices reported in SPI device mode bits. Signed-off-by: Krishna Yarlagadda Reviewed-by: Jon Hunter --- drivers/spi/spi-tegra210-quad.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c index bea376acea1f..fbd14dd7be44 100644 --- a/drivers/spi/spi-tegra210-quad.c +++ b/drivers/spi/spi-tegra210-quad.c @@ -142,6 +142,7 @@ #define QSPI_GLOBAL_CONFIG 0X1a4 #define QSPI_CMB_SEQ_EN BIT(0) +#define QSPI_TPM_WAIT_POLL_EN BIT(1) #define QSPI_CMB_SEQ_ADDR 0x1a8 #define QSPI_ADDRESS_VALUE_SET(X) (((x) & 0xFFFF) << 0) @@ -164,6 +165,7 @@ struct tegra_qspi_soc_data { bool has_dma; bool cmb_xfer_capable; + bool supports_tpm; unsigned int cs_count; }; @@ -1065,6 +1067,12 @@ static int tegra_qspi_combined_seq_xfer(struct tegra_qspi *tqspi, /* Enable Combined sequence mode */ val = tegra_qspi_readl(tqspi, QSPI_GLOBAL_CONFIG); + if (spi->mode & SPI_TPM_HW_FLOW) { + if (tqspi->soc_data->supports_tpm) + val |= QSPI_TPM_WAIT_POLL_EN; + else + return -EIO; + } val |= QSPI_CMB_SEQ_EN; tegra_qspi_writel(tqspi, val, QSPI_GLOBAL_CONFIG); /* Process individual transfer list */ @@ -1196,6 +1204,8 @@ static int tegra_qspi_non_combined_seq_xfer(struct tegra_qspi *tqspi, /* Disable Combined sequence mode */ val = tegra_qspi_readl(tqspi, QSPI_GLOBAL_CONFIG); val &= ~QSPI_CMB_SEQ_EN; + if (tqspi->soc_data->supports_tpm) + val &= ~QSPI_TPM_WAIT_POLL_EN; tegra_qspi_writel(tqspi, val, QSPI_GLOBAL_CONFIG); list_for_each_entry(transfer, &msg->transfers, transfer_list) { struct spi_transfer *xfer = transfer; @@ -1454,24 +1464,28 @@ static irqreturn_t tegra_qspi_isr_thread(int irq, void *context_data) static struct tegra_qspi_soc_data tegra210_qspi_soc_data = { .has_dma = true, .cmb_xfer_capable = false, + .supports_tpm = false, .cs_count = 1, }; static struct tegra_qspi_soc_data tegra186_qspi_soc_data = { .has_dma = true, .cmb_xfer_capable = true, + .supports_tpm = false, .cs_count = 1, }; static struct tegra_qspi_soc_data tegra234_qspi_soc_data = { .has_dma = false, .cmb_xfer_capable = true, + .supports_tpm = true, .cs_count = 1, }; static struct tegra_qspi_soc_data tegra241_qspi_soc_data = { .has_dma = false, .cmb_xfer_capable = true, + .supports_tpm = true, .cs_count = 4, };