From patchwork Thu Mar 2 04:18:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Yarlagadda X-Patchwork-Id: 13156672 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 BA8AEC678D4 for ; Thu, 2 Mar 2023 04:19:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229496AbjCBETV (ORCPT ); Wed, 1 Mar 2023 23:19:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229965AbjCBES1 (ORCPT ); Wed, 1 Mar 2023 23:18:27 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11hn2237.outbound.protection.outlook.com [52.100.173.237]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 264542CC46; Wed, 1 Mar 2023 20:18:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a8X2wCkkQlidvUsSIrVCiNLWJfR8kgXCtUhtaujkjRfCRP/FQK9Zz/IB/SPKtOoly6j9adnskvN068lOsjxJkIxXSyozuz8Q/HOtBjnGkgB8RcmT2PqCxGVErXmqOTez0dP9h5xmWQRDscdwB+AmbeTpvDIZQFqPowgb+vUPB6dI2u55NTPpTSeV8oNNAamXHihW+5uslP+MQB/gnxiIn701xn8/iKrcHnQG2EAHsrGUdv56A0qhgtoBlKhuGDT0yOAIZRUEdOS96G21+oweGq9fkYvjRZRlRCecKTU5u9IdPdaYOoazlh+4kyLiD1V9ADFLHfXPn+oF+rTUb4UvgQ== 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=Mh9Ua9+PFTGOWRtWUmLN86IqbLOmxsmrJzCJu52I840=; b=BDIrgOwP0qzZaJ1IYqV2SB7p3I7L2Br1uNx5arrO7GMpj4W/YQToPPHG6vqAl+277LTUa9gxCkUPI9aODENs2fza2LbNcZxJr+LJEGNFqGJGurdcaeZlvPV8B2OmW/e5axV8XnpzQf0yBupdh9RLPh3Jmnern2pwDTF0F4Rxpnp+zw5hDXmkc1mxFf8mCmX2auvYEdeKPEPIQxsr7z1BG86PG8Un5yRIlM5ZgaNQ0T0zBPDQgzdVg+HS7JXlEbrgG/jyfiHkQr7hffRte8II6FH5Y6V7QVLKIQaezlKlMclCpn/D1orVqapDqnUfWQ+ybRWPHXRF+jnu6RYEzqWlFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=kernel.org 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=Mh9Ua9+PFTGOWRtWUmLN86IqbLOmxsmrJzCJu52I840=; b=QxXR7zeLZvzBcMVheyuwu1jgNyWPBAIRJij8a37T/FartXOIGSjvsrlRroUf8lY8xOWIA8GNB2YiVEBa9cGAGSYlqYBVDf//+Sb6CKkF2yoHT9Jn2Q+MAhUMagoaRgRv7uzCJS/FZLiITpANlGqG7eQK6/2dhSy7sgUxAI0d5oDQ1QPsUZ6/NxxdgVV6gCumxdOJkv6aSKt6/U6JoUa1peAD7gpBfwVoQq5txE8RJtYc8Qys9jMoZfU3QXp+Zm5BI0gZmYSEmzVqYrSYAKSeGs2CWq+h6XYnguZTVI5yJ9bNzzywOOFT1GzAWujMKrmss2hqaRP161vXaYTFD3uV9w== Received: from DM5PR08CA0059.namprd08.prod.outlook.com (2603:10b6:4:60::48) by BL1PR12MB5731.namprd12.prod.outlook.com (2603:10b6:208:386::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.30; Thu, 2 Mar 2023 04:18:20 +0000 Received: from DM6NAM11FT112.eop-nam11.prod.protection.outlook.com (2603:10b6:4:60:cafe::10) by DM5PR08CA0059.outlook.office365.com (2603:10b6:4:60::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.30 via Frontend Transport; Thu, 2 Mar 2023 04:18:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DM6NAM11FT112.mail.protection.outlook.com (10.13.173.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.19 via Frontend Transport; Thu, 2 Mar 2023 04:18:20 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Wed, 1 Mar 2023 20:18:18 -0800 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Wed, 1 Mar 2023 20:18:18 -0800 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server id 15.2.986.5 via Frontend Transport; Wed, 1 Mar 2023 20:18:13 -0800 From: Krishna Yarlagadda To: , , , , , , , , , CC: , , , , Krishna Yarlagadda Subject: [Patch V8 1/3] spi: Add TPM HW flow flag Date: Thu, 2 Mar 2023 09:48:02 +0530 Message-ID: <20230302041804.24718-2-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230302041804.24718-1-kyarlagadda@nvidia.com> References: <20230302041804.24718-1-kyarlagadda@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT112:EE_|BL1PR12MB5731:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d9e2af2-3283-40ac-027c-08db1ad527dc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vYGHZYq1PeT0asEO6qY7LaevG+IrMEBGGfmsjqV6crppEZINvAqXfGaRvqcFB2gl145HR14xI/YD2/Snv25/URALufKZY7TPCCctK8ZodE5tGXprzVqMUAoFJ11uL90jBgbU8Uvu2Z9VnjB4TsfuNL9MunhGTmH0vIj3979kqsUMNkCgSB4c6ZINsstkGoPMMP624jhAsydP/wPUOTyqfE2Bk0ZFdkkqBNKIx3Dl7JlDMA+BHnD8s6QrWq3XZxJUwNpoD/qc1mV2DoYK6bIBgdMojb3uSIdOUJofmIN3qK+DmpOBxTqEQvCpxqeAooNnI6OKFXdXVoiAopIwn/QgnA7oBLCLZOXgNkAtL1mA1i485fL+YmNu31986uncm9S5xOL4dZomoH0kRltFFdozmjo6DVMtj2Cbfo68KzvfwCWmGW8fE9c0EK25Mqku7NdGXjO/IXdoKjjVUwoatt3GBIObHgNxo66m0k1xuayl9Fr421nRf3gDLtLhaO9LdCzRbJKngYo8efWJr7rjFmqrrGIu92WZzvXVBoFA5GT8pfIMqJAIn42XgGzhhxkPV4nBJ37VNn1BlWCMIRduKPgrmsmB2IzDzsZp2ljvrlv8Hc7cHidwtNjEXF3wYQo5Bc8MZ68BkvZz8nVaT9k/Eo0KrCA580UScQbA/ERX9VRL7n+M9wUHjU1vxE+VLs8pEZmA41ZER9HbTWVPnP+yVktf0pQXgxseiutRvLFVZpT+FJjVw78BTicHCl4j1nOWF8zD3+cu82K1SrOXuWMjGl32/ct2ow4/SUyEWWn91O6YBTi0sqj1ayq1Uk+UO00G0CvbinRbdURBqCpK+MnkuNWB4CUp7UW0kx1FwVoP1daUZMuJl7B7cD4bnz24ROIuMaMr X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230025)(4636009)(376002)(396003)(39860400002)(136003)(346002)(451199018)(5400799012)(40470700004)(46966006)(36840700001)(2906002)(921005)(47076005)(2616005)(82740400003)(336012)(426003)(356005)(7636003)(34020700004)(82310400005)(36860700001)(54906003)(83380400001)(966005)(110136005)(36756003)(316002)(7696005)(6666004)(40460700003)(107886003)(478600001)(40480700001)(1076003)(5660300002)(86362001)(8936002)(7416002)(41300700001)(186003)(4326008)(26005)(8676002)(70206006)(70586007)(83996005)(2101003)(12100799018);DIR:OUT;SFP:1501; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2023 04:18:20.0580 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4d9e2af2-3283-40ac-027c-08db1ad527dc X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT112.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5731 Precedence: bulk List-ID: X-Mailing-List: linux-spi@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-work-group- pc-client-specific-tpm-interface-specification-tis/ 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 4fa26b9a3572..b9e49ed42955 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 Thu Mar 2 04:18:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Yarlagadda X-Patchwork-Id: 13156673 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 9800AC7EE37 for ; Thu, 2 Mar 2023 04:19:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229799AbjCBETW (ORCPT ); Wed, 1 Mar 2023 23:19:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229813AbjCBESd (ORCPT ); Wed, 1 Mar 2023 23:18:33 -0500 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04hn20328.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8d::328]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BA5E311DF; Wed, 1 Mar 2023 20:18:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VAQs38G+3zm6v0ffhoQsRSvHjvre46Kq5FebxQz05xDfNmnUjpAegaZdH45aZdOJw3C7L+12y11/gM4GoYOu3UIgGLaKG+m1GuYkXQ9YFjMxiesNBVA11AlvOesWiL3OjKDipw3roD1DGp3MFOUqEeIpdCR71SIyZOXhicKsRCOvyLrBpeqEh6EWer5HyrQXxg0sW0SnYgUgIjYlRA+quh7y89YOsA0+TZqi0z1vpEDb5cu31/C/u7ioLFMHxpASzRE2dokxIoIW2yfS3Q0SKLnvLAqIMpZ2Op6FCSf8OwXnNTPUfKFI9Vyh/jXLFJ/v1OsZj6Lb69ZCJ0YCqORdFg== 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=hzncxuURJjV4GP959QHXdVb3ilQTKDNs1iK0EzLlCuQ=; b=S1sk2onZqgH/0mfsqlGMw0GnDd7Zr/Ek6Fg+Woj6oIL0xarx7MkHopk7ZCvRDDs9RdiLy7dINnCEPruWiCC8Gdd9/7cr1IFrXT9h0HsvwzWbbtjyWiaL+J+wtPtAtr5jALg45ZJwE1TxAKKXsKHokLn67jGrPs++2RO+WVmmAGVUz3WMyunDrRfYRE/IMDrMeP5qwRAlprSHZIIX3EjZL66emq6HNYHw72ZCveERAeuFcttgItBsFf2B91VCe+rb3JC05dgSME2ctONq2vvoOh53eidqzbQeBH1t/VmrDWsoujFHxSo3JrtovAf3YOlmzRy3SsdHEi5RYC4+lhuoLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=kernel.org 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=hzncxuURJjV4GP959QHXdVb3ilQTKDNs1iK0EzLlCuQ=; b=SZ7Y/Wws1vBcnAdfJMxPkoH8NH+tFPmC/0IZ0MqZiUU4jWpgf13/g5oQEgXgsm/TpTYJxUVXuas//5TtqDyDA1fYMr72iVK07taOm6MgytC8PjXm/FeFyFuuzpVPpbqb9AxzYvEmTv7y2WNzBFNKQk5inWLeYSxVxJ18eT+KMcDsGett43y0atDYNIgJgPdhAWQDBIL/5+Q6DU4sqj8dqLhrWF0QJTTwPaH1M8ygpaCUAEQxWmFbTSlJAC9DaFnxvDrXEVXCOq3pak7s7+/Qnp5VOD/s1VoXJ98u9ALBV6kCIElXDHNukcjyri9mDAQ8axELOEjKukbd/6VMaSxORg== Received: from DS7PR03CA0182.namprd03.prod.outlook.com (2603:10b6:5:3b6::7) by IA1PR12MB6625.namprd12.prod.outlook.com (2603:10b6:208:3a3::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.26; Thu, 2 Mar 2023 04:18:26 +0000 Received: from DM6NAM11FT022.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b6:cafe::41) by DS7PR03CA0182.outlook.office365.com (2603:10b6:5:3b6::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.18 via Frontend Transport; Thu, 2 Mar 2023 04:18:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DM6NAM11FT022.mail.protection.outlook.com (10.13.172.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.18 via Frontend Transport; Thu, 2 Mar 2023 04:18:26 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Wed, 1 Mar 2023 20:18:23 -0800 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Wed, 1 Mar 2023 20:18:22 -0800 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server id 15.2.986.5 via Frontend Transport; Wed, 1 Mar 2023 20:18:18 -0800 From: Krishna Yarlagadda To: , , , , , , , , , CC: , , , , Krishna Yarlagadda Subject: [Patch V8 2/3] tpm_tis-spi: Add hardware wait polling Date: Thu, 2 Mar 2023 09:48:03 +0530 Message-ID: <20230302041804.24718-3-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230302041804.24718-1-kyarlagadda@nvidia.com> References: <20230302041804.24718-1-kyarlagadda@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT022:EE_|IA1PR12MB6625:EE_ X-MS-Office365-Filtering-Correlation-Id: 97f5ca47-a31f-44d9-3253-08db1ad52b69 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 71epHBS0m4aafXUCMQ/oNwFmxvGxCkO41i/rdxArclahMVDOWlkBo/r9kISfHswERKlOtmM7uvI4vz5o36yjTvcJMrTXDpuL6+Qh8T40Mevx87/9zYK05kXdXob+nkOCpcYAa37Bx0ufl+k+Ewg+Jvdd6+QC8GOqOMos3vziuca4/CAAF7gc+fcdAs2oxUwWijRpKyrIeA6KdEvHBSIkqeGqDwqwSMQmm7gF19ptm96PsAKFTtxgxZr51A5MI5Rbg6Fnz20jfvlZTrAmkGhsEP2ik/fz4csDDGkDzJnheJ1+OrUQ1D7RNvWJ2EVbguA8lUO4c5qD+KEc6DW4oGp0GBkSVo0W8Ss0ortdxmeWm+Mu5wODvKR9QKFDYaMkeul0G8WomUJDocApR4QKaZFCD3l00lCeCxnBqIimSRgTrPDl3sMSWJUZCPmsa8Gf/5v9CWCQMaf+9A9j8uKK3D2VH5khwHI7YFiMITGE8C2WWOIyoha5DwWoyzYJFy8hMxS9EdM/wFFxudizwHB/vP5jNFxFvL70CKMeOqGls/lrkblMK5b/zxKYNMPISIk7jXi1MO4NeuGwuWb5dUpb/W+deSRk9bOxHWirI+5q7ZrnoJIvzHXZNhsT7B/1wJi3r6kC8yZPk/NgrwZG8ZpdsuYSv9Dczqep0g5d6GWL08c4Ktv/dDeEh+/koH+kDJZwWk3vUukBcf5yR8oSt8y/W/pkW6KIXqe1+k212Lbj2YV3saROZLGY/9y/rscn3UiFLZ4PY0OYwperK5BzoCgshO+ZgCMtoGXm9M5I0YqCNLjjI0zfrv1gZTHctmzhGjtSaZzn63Q4hPzJrLtksmIyXesfyw== X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(376002)(136003)(396003)(346002)(5400799012)(451199018)(40470700004)(36840700001)(46966006)(478600001)(70586007)(70206006)(7696005)(110136005)(4326008)(82310400005)(41300700001)(8936002)(8676002)(356005)(36756003)(107886003)(40480700001)(86362001)(40460700003)(6666004)(26005)(2616005)(47076005)(7636003)(82740400003)(426003)(186003)(336012)(1076003)(5660300002)(83380400001)(54906003)(316002)(2906002)(7416002)(36860700001)(921005)(34020700004)(2101003)(83996005)(12100799018);DIR:OUT;SFP:1501; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2023 04:18:26.0009 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97f5ca47-a31f-44d9-3253-08db1ad52b69 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT022.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6625 Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 --- drivers/char/tpm/tpm_tis_spi_main.c | 95 ++++++++++++++++++++++++++++- 1 file changed, 93 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..d0c1073bfa06 100644 --- a/drivers/char/tpm/tpm_tis_spi_main.c +++ b/drivers/char/tpm/tpm_tis_spi_main.c @@ -71,8 +71,76 @@ 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_hw_flow_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_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_locked(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_sw_flow_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); int ret = 0; @@ -140,6 +208,26 @@ 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_hw_flow_transfer(data, addr, len, in, + out); + else + return tpm_tis_spi_sw_flow_transfer(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 +269,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 Thu Mar 2 04:18:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Yarlagadda X-Patchwork-Id: 13156675 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 E7166C83003 for ; Thu, 2 Mar 2023 04:19:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229812AbjCBETX (ORCPT ); Wed, 1 Mar 2023 23:19:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229877AbjCBESd (ORCPT ); Wed, 1 Mar 2023 23:18:33 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12hn2213.outbound.protection.outlook.com [52.100.167.213]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A222305E5; Wed, 1 Mar 2023 20:18:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NYSXb8/jJg9GS+G8Pe2HeJG0AH3P3HLjlK6iQKtFB++/2q2G+fN+cvlLRuYBWKafOt0xBGGkLbvt0XyOugk6sL/aM3LC0XKlcJEsmjDkpaf52YcPr7Sf4qcFs0q/xFaRLoRoCei47G/e1/421E5Tj70JHdBiJv9gRHcaEcWZieKNmI6xcTfbD4RR4yl1/OrvpfALszob/zSyUKq3Vco57gmAtUNyF691tr+4poUYJKABUtfxAE/ibdy1scfK9rNrYZ+/LMi/X+AfORvpRGAyUeo3nV54vw3iRUyfnrGaoFU+i0A80L7YemZ84uIbBCSgq0maIXxwqHRjHHOX7Btauw== 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=Z6cfpwnnVrUbHlknS5XSwMZgssAwk958FxhAcSDRmG8=; b=m/YloCqmFeGPT2pnNeB/25qddEtuQsEEC4qb9Knond/DJKGSlwRxH+zYMxxgIUwcuizNukRWmw9ukZHarzpVXwbEtHgOqInYIhKStkfh74G+b+jz2hz+tqAVlzV0M0S8reCPTPV4ZaJDhiaa0q0Qk/GP4NBo1yayxQ93jujvUyCXGdWBdVJq82LcI7nngQL3CgcWj+Y+KBhuDuGLwRtc3GS1yGRf9AY88+2AIyb6X6F66CHeiKquNS2p67DUJBHG6gGQYQYZfe5EG+1hkLihbc5LRcsExhHBEqdeu3J5QbK90EfkpctxwhmgbE2TVd6npGYpLeeYLF/1CFIjYXcbPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=kernel.org 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=Z6cfpwnnVrUbHlknS5XSwMZgssAwk958FxhAcSDRmG8=; b=ApID+C0tU3YeKgax7/oe9ObeCkjwYLl9VcnBwn6QqxKk7fUhzE3BTgRBxk7oZMdXpISm/8JLRtClyhd/f8uE+C85OtzZ5QZ2yvc+oZJPsrHIzmwnQpWQVnDWgXv2sQ+c8O4F3XuHcXsfovQKwZOtaB/tCyjMkFYooVypTdYjbhMC/mTfdS1waJIeQhyY2kpYmztemlO1yeNrjjwuEcaJhn8v3O9rWi6ugtU6KdBm+wMtqugEajDadbhM5z/NLO+kknq7PfxaGayz3ZAnSuB5FC48RNjURROWN2k/hmKGQirKmB1J++vkUYhzDKqYsN9wQx6cWUicultvEgqhMJy1gg== Received: from DS7PR03CA0029.namprd03.prod.outlook.com (2603:10b6:5:3b8::34) by DS7PR12MB6238.namprd12.prod.outlook.com (2603:10b6:8:96::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.17; Thu, 2 Mar 2023 04:18:29 +0000 Received: from DM6NAM11FT114.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b8:cafe::a7) by DS7PR03CA0029.outlook.office365.com (2603:10b6:5:3b8::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.18 via Frontend Transport; Thu, 2 Mar 2023 04:18:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT114.mail.protection.outlook.com (10.13.172.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.12 via Frontend Transport; Thu, 2 Mar 2023 04:18:29 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Wed, 1 Mar 2023 20:18:28 -0800 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Wed, 1 Mar 2023 20:18:27 -0800 Received: from BUILDSERVER-IO-L4T.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server id 15.2.986.5 via Frontend Transport; Wed, 1 Mar 2023 20:18:23 -0800 From: Krishna Yarlagadda To: , , , , , , , , , CC: , , , , Krishna Yarlagadda Subject: [Patch V8 3/3] spi: tegra210-quad: Enable TPM wait polling Date: Thu, 2 Mar 2023 09:48:04 +0530 Message-ID: <20230302041804.24718-4-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230302041804.24718-1-kyarlagadda@nvidia.com> References: <20230302041804.24718-1-kyarlagadda@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT114:EE_|DS7PR12MB6238:EE_ X-MS-Office365-Filtering-Correlation-Id: a81d767b-eea6-4059-44e8-08db1ad52d93 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Bym+l8Iz0mv1GqPrwH1cs2oLtYefLreGcb5oxl9U9TuommyORAu+Okz5rYMoRnXAXDxSKty0AK0IMsdXL53VO3oGK8XwOufOAN/A2I8rkBPtm667nOR8dTFs+Qs2f4Yp32gcsiFV1uGJM0g9RXMcZ0tUs9moDRxiHndSTKkze0XRroyN2M2VWo7CzSqaoWWE8+g8FjIQsRcJFtZCVun5vxLjVyHrmkOXxY92x1N23v+D9HP1wC+jRCuGV/ao17ycwUSr22hAzvUVdhiXqK4Ez1lsZCk+1aI1zOYc2QGRTcNvLAPUtR8Bnr0P033BRf6N1BV1/YqAwawBsTJ8gF/fBh6/zaIAgNm3B5HW72iNcb+TlT3SWEjI+p2zD4KA1HEf4pTOj2qySVI++RCqhwYiMW/9pWNN96lcKOVQGG20g1zX8n+TovkyJPx5W7rKDdjPAZQ9rpnUwzmG1PWXO86f5BjBpj7VyuueTL/x85jgPX2zkGuoSFyr4t5L+7vMeIp0pIb/JcTGB7TZRAGHb2cD9/X5nWxXXc6MEuJZqPk9ktgvwrEAE8AHl2jNsDK/0N+oqpFepKxlvsP4YAvnmoCh4TZ8oqYQO9b76F616CR6sZ4UUPVIMwkIoIGME5gvQvs9xVx4wp+ZBWw/PpICEa2tBG5VfevLiAXpLlMUZVQypwGCG2rEhH782GJKRLA6SFi+AqLv1x/zNEwVAz2D2m5Lkd8eFDgc/km4/o9d7o7pr+cLN/oylK6ljhM6SRWrQJbVMNiQTAw0PjKMS5mQzcmab9rqC48oQFumXgQ1EsFzzk0/TtGP2wMfuOhV3z8UFH60ryDxrQLdU5X449ZoGYX00w== X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230025)(4636009)(346002)(136003)(39860400002)(396003)(376002)(451199018)(5400799012)(36840700001)(46966006)(40470700004)(4326008)(70206006)(36756003)(40480700001)(41300700001)(7416002)(8936002)(5660300002)(2906002)(86362001)(7636003)(921005)(356005)(8676002)(34020700004)(82740400003)(36860700001)(82310400005)(6666004)(107886003)(7696005)(54906003)(316002)(478600001)(110136005)(70586007)(83380400001)(47076005)(426003)(186003)(2616005)(40460700003)(1076003)(336012)(26005)(2101003)(83996005)(12100799018);DIR:OUT;SFP:1501; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2023 04:18:29.6633 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a81d767b-eea6-4059-44e8-08db1ad52d93 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT114.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6238 Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 --- 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 0b9bc3b7f53a..82aec6cb7863 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, };