From patchwork Wed Jun 10 14:50:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Thomsen X-Patchwork-Id: 1306999 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=vaxl/oOJ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49hqgJ50vHz9sRk for ; Thu, 11 Jun 2020 00:51:05 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6C42B81578; Wed, 10 Jun 2020 16:50:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="vaxl/oOJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1484A81684; Wed, 10 Jun 2020 16:50:56 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3FFD3813BC for ; Wed, 10 Jun 2020 16:50:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bruno.thomsen@gmail.com Received: by mail-wm1-x342.google.com with SMTP id f185so2099689wmf.3 for ; Wed, 10 Jun 2020 07:50:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=X/Vqb3gb0gFIyolZFE+JlcwQD/3DSVssX3JFc2JhH4M=; b=vaxl/oOJgp4AWM85ii2+eeQT4Ja2cSds15W9XtImJiBaZmecddlOFAIeN2wDl4fHxv jMuNIcluMZP1ZVxS3Durtr0+ZL6keMqnRege5IZK3Tecz+2XfeR0pUStQ4Hz84At4N+k ndvTo+f8w1JoUA24X8WFtFiGsxA4ZduFli/3iDrZjRC+pJ2vdiayIBqNM0tlcuEeT/Sr trydJwZgPBy1wsCe8t4+sLPDcCmciXV2nYtp+3fyQOSBAlEYHFDwIsWNYrj2BshzWsEb RLENsVQEBxqTO60JU35EXhY+Uq2hoDSDLvnX8bJz+dtfidKK6OdA72ckVkug0twQqYuo K17w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=X/Vqb3gb0gFIyolZFE+JlcwQD/3DSVssX3JFc2JhH4M=; b=b0NuwnHhtBh/hcK90F8LjTvJIHNALlZFDS3+sb2wKftQahNqZKihI1xsAKyfvsWDol QB8kb6WePUHXD3vaK/gZux33BgF6wjcE2+ubYc2uYkvOjsd+o1m4dI/l2ttUmX9lB7Fm ngtFzY1nofKat1HxX86UcjH6fo3B1teLznvSmaACYmN/kOT+T21evy9IxqhEr49bM/pp ZF/siUmEJAzymu18Tn1/zXs+XkKziXEP5u6QpZce5mrG3cGKpzhViZ656/DR+nIEsHzA qF81yhNGPwzVqinVu9UzrApijKirk6wY541PGmHKpqSr+tkEOtDNuQHhUDxFXE5Rq/Km ZD9Q== X-Gm-Message-State: AOAM533bzg5dls1Xiro/OG08CXz7iYiL8M4yWT6LD4Rosr7AdgabVRPe eco/9Xd07fMXYX0tluo1yfkC2y2Pi7o= X-Google-Smtp-Source: ABdhPJzTI3lFejyl9fhZNfyKchNNO16B9e/Uq58hXIHWwBt/Wcrzj25U0GCpWLjw6kv8tDpSe5a2eQ== X-Received: by 2002:a1c:e914:: with SMTP id q20mr3457424wmc.145.1591800651736; Wed, 10 Jun 2020 07:50:51 -0700 (PDT) Received: from xps13.lan (3e6b1cc1.rev.stofanet.dk. [62.107.28.193]) by smtp.googlemail.com with ESMTPSA id o18sm7633703wme.19.2020.06.10.07.50.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2020 07:50:50 -0700 (PDT) From: Bruno Thomsen To: u-boot@lists.denx.de Cc: bth@kamstrup.com, sjg@chromium.org, kayla.theil@mixed-mode.de, bmeng.cn@gmail.com, rka@sysgo.com, Bruno Thomsen Subject: [PATCH] tpm2: tis_spi: add linux compatible fallback string Date: Wed, 10 Jun 2020 16:50:39 +0200 Message-Id: <20200610145039.5346-1-bruno.thomsen@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean This solves a compatibility issue with Linux device trees that contain TPMv2.x hardware. So it's easier to import DTSs from upstream kernel when migrating board init from C code to device tree. The issue is that fallback binding is different between Linux and u-Boot. Linux: "tcg,tpm_tis-spi" U-Boot: "tis,tpm2-spi" Signed-off-by: Bruno Thomsen --- doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt | 2 +- drivers/tpm/tpm2_tis_spi.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt b/doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt index b48a15112d..b0bc9d6a65 100644 --- a/doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt +++ b/doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt @@ -2,7 +2,7 @@ ST33TPHF20 SPI TPMv2.0 bindings ------------------------------- Required properties: -- compatible : Should be "tis,tpm2-spi" +- compatible : Should be "tis,tpm2-spi" or "tcg,tpm_tis-spi" - reg : SPI Chip select Optional properties: diff --git a/drivers/tpm/tpm2_tis_spi.c b/drivers/tpm/tpm2_tis_spi.c index 36016de4a6..73e5b6aab4 100644 --- a/drivers/tpm/tpm2_tis_spi.c +++ b/drivers/tpm/tpm2_tis_spi.c @@ -679,6 +679,10 @@ static const struct udevice_id tpm_tis_spi_ids[] = { .compatible = "tis,tpm2-spi", .data = (ulong)&tpm_tis_std_chip_data, }, + { + .compatible = "tcg,tpm_tis-spi", + .data = (ulong)&tpm_tis_std_chip_data, + }, { } };