Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1007488pxb; Wed, 6 Apr 2022 06:34:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzSr+cVUspWu4vS8nfWOCde2yYLrPFtIKUrBjE0LZxw4uKmW48ardqIrKBt6IJpofvC2Lk X-Received: by 2002:a17:902:ec88:b0:156:b24a:40f with SMTP id x8-20020a170902ec8800b00156b24a040fmr8656129plg.67.1649252086854; Wed, 06 Apr 2022 06:34:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649252086; cv=none; d=google.com; s=arc-20160816; b=YoF38tmZ2R0bfORWWA83IzTNBzjrS89MbXcCoCC8HKHW+bV2pJHCC1JBQs8/xPqA+K 6zoV35KeiKZmy/iiAucqkzT0ia+J5r0hQoCEw5O/xpOuCqMxa1u5bP7+A6mYp0NSP/0p Bd5oN5cyLM9X2eUJ14aRZs6GswvMb+7/YB5eqopjeg/vv/3bCCXsdeeSxcT61nhxLJ5U 5+IwTnHATAAvk+KWor1d4585vtMoDgbkf3bdqfyV6Ad2vLugxDFLvpO/jbnVsNTA0BoO RRKIogE2Va2EZabb/Y8Wb/k+7aN3UqwVfzP4aVmoOTyp6MLSYXd8L7fzdbJrTtyASWFy QFyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Nwu8jpVkI6C7VwnrywKtcRGeDT2fuyh+kt2g5bo1y9w=; b=ZNs9rffKfMAnD9+ZO3k8eylwPtu45nqN9XcQ8DKqRfDi5IMlIYWqmoDgEd+2//5hGs BsMq4RFxcjsoXENhCY9251l4tkiW54f0tPSNJRi+hgRUNYSXiIAyeMCffPQ53G51EIwb QnHnPU+Ui4VFL4wc1iSrt+dep+8ax7bSFR1iogFI/1awAoh34xwUvf8n1lb1Cc4mJCEe 4puPbzh9S4uu8bMORXtc7FZ9U31j8djHMMEWghZgecetwSfWdcyCiuKL4EvJ+EVOiKtr SNU/rx+IMlYaVMtaWaPoQfckGByWhFP4dy+g0TF7ogZGU2oMbd3x1BWuZ78hqxl2CaGt E5PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Lw5EATL+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k17-20020a63f011000000b003816043ef29si16160289pgh.286.2022.04.06.06.34.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:34:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Lw5EATL+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7DED0540743; Wed, 6 Apr 2022 04:14:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349038AbiDEUem (ORCPT + 99 others); Tue, 5 Apr 2022 16:34:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1572980AbiDERjw (ORCPT ); Tue, 5 Apr 2022 13:39:52 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CE2EB8203 for ; Tue, 5 Apr 2022 10:37:53 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id s11so7085272pla.8 for ; Tue, 05 Apr 2022 10:37:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Nwu8jpVkI6C7VwnrywKtcRGeDT2fuyh+kt2g5bo1y9w=; b=Lw5EATL+sOQBSkpUq+6d2yFb3UX+wLpMPBMs1qT7H2FEnxAxS+Out/GTJK1O6Dl9Rh zzVeKLhcn9Iqw5nnSbmT59AtX+vxfT3tVF++IZuE8YPig+uL0Qd73A/szLBe14lkFRhT sKkEy0M5HsZGZhfriWrrucPJywYn7pNKnInUE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Nwu8jpVkI6C7VwnrywKtcRGeDT2fuyh+kt2g5bo1y9w=; b=BfmUb870CgyuCBdvCs97mIRLX2AISnjbUys9RBrjfdZN2Eq66rLKxUOGpUOvxtq/Kl ezJC7YlbDCy0GuctsE1vM4RM35W5HoROZD3sy6sEXBoeZvVF2ERszVGHzqjJeSbaerae X35On3R5p6cZmwuSLFmFZU3uWpxsan35oAG6Dc+1o+MaRRgv2+Px+serFAaS8olzS78k H+Hh3qJvzKkFHSD3Kngx15gjVkYy2JwQpc6rpzspcGB/GVr9obIRfvv+cHjpyH5+ylYU ltm0bYLjrvuK7mHu3Xpz0zklK8Obded91OK7p+s0z5OIeDYdqIGttrqF+h8nym01zwQ1 kulg== X-Gm-Message-State: AOAM530h9sOgz9ojYphXL36phFnt6w+2OaIrhahkKnABFtXX15/0U0mk uL5aw/IZbP4SC0FViX3TZTGnTA== X-Received: by 2002:a17:902:7ec1:b0:156:17a4:a2f8 with SMTP id p1-20020a1709027ec100b0015617a4a2f8mr4774620plb.155.1649180273187; Tue, 05 Apr 2022 10:37:53 -0700 (PDT) Received: from localhost ([2620:15c:202:201:1331:63a2:a876:db1d]) by smtp.gmail.com with UTF8SMTPSA id v3-20020a056a00148300b004fb04acde5dsm16033146pfu.166.2022.04.05.10.37.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Apr 2022 10:37:52 -0700 (PDT) From: "Jes B. Klinke" To: linux-integrity@vger.kernel.org Cc: Paul Menzel , "Jes B. Klinke" , Jarkko Sakkinen , Jason Gunthorpe , Peter Huewe , linux-kernel@vger.kernel.org Subject: [PATCH] tpm: cr50: Add new device/vendor ID 0x504a6666 Date: Tue, 5 Apr 2022 10:37:41 -0700 Message-Id: <20220405173741.4023216-1-jbk@chromium.org> X-Mailer: git-send-email 2.35.1.1094.g7c7d902a7c-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Accept one additional numerical value of DID:VID for next generation Google TPM, to be used in future Chromebooks. This patch touches more lines than may seem necessary, as a result of the need to move the error case to sit after the two recognized cases. Signed-off-by: Jes B. Klinke --- drivers/char/tpm/tpm_tis_i2c_cr50.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/char/tpm/tpm_tis_i2c_cr50.c b/drivers/char/tpm/tpm_tis_i2c_cr50.c index f6c0affbb4567..bf54ebd6724b0 100644 --- a/drivers/char/tpm/tpm_tis_i2c_cr50.c +++ b/drivers/char/tpm/tpm_tis_i2c_cr50.c @@ -31,6 +31,7 @@ #define TPM_CR50_TIMEOUT_SHORT_MS 2 /* Short timeout during transactions */ #define TPM_CR50_TIMEOUT_NOIRQ_MS 20 /* Timeout for TPM ready without IRQ */ #define TPM_CR50_I2C_DID_VID 0x00281ae0L /* Device and vendor ID reg value */ +#define TPM_TI50_I2C_DID_VID 0x504a6666L /* Device and vendor ID reg value */ #define TPM_CR50_I2C_MAX_RETRIES 3 /* Max retries due to I2C errors */ #define TPM_CR50_I2C_RETRY_DELAY_LO 55 /* Min usecs between retries on I2C */ #define TPM_CR50_I2C_RETRY_DELAY_HI 65 /* Max usecs between retries on I2C */ @@ -742,16 +743,20 @@ static int tpm_cr50_i2c_probe(struct i2c_client *client) } vendor = le32_to_cpup((__le32 *)buf); - if (vendor != TPM_CR50_I2C_DID_VID) { - dev_err(dev, "Vendor ID did not match! ID was %08x\n", vendor); - tpm_cr50_release_locality(chip, true); - return -ENODEV; + if (vendor == TPM_CR50_I2C_DID_VID) { + dev_info(dev, "cr50 TPM 2.0 (i2c 0x%02x irq %d id 0x%x)\n", + client->addr, client->irq, vendor >> 16); + return tpm_chip_register(chip); + } + if (vendor == TPM_TI50_I2C_DID_VID) { + dev_info(dev, "ti50 TPM 2.0 (i2c 0x%02x irq %d id 0x%x)\n", + client->addr, client->irq, vendor >> 16); + return tpm_chip_register(chip); } - dev_info(dev, "cr50 TPM 2.0 (i2c 0x%02x irq %d id 0x%x)\n", - client->addr, client->irq, vendor >> 16); - - return tpm_chip_register(chip); + dev_err(dev, "Vendor ID did not match! ID was %08x\n", vendor); + tpm_cr50_release_locality(chip, true); + return -ENODEV; } /** -- 2.35.1.1094.g7c7d902a7c-goog