From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D87FAC07E95 for ; Tue, 13 Jul 2021 05:51:48 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E7A6661004 for ; Tue, 13 Jul 2021 05:51:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E7A6661004 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2077F82E0B; Tue, 13 Jul 2021 07:51:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="AGz0qS7g"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 62BD482E67; Tue, 13 Jul 2021 07:51:44 +0200 (CEST) Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) (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 1D9AC82E0A for ; Tue, 13 Jul 2021 07:51:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ed1-x52e.google.com with SMTP id k27so7874614edk.9 for ; Mon, 12 Jul 2021 22:51:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=oG392JwnFSIwqbAcRZTBaBlVKg4P63VtTnJ7rQBwkJg=; b=AGz0qS7gn/xJxnQRXYhmuANVP0c0Nn8ZuQCryha8PS0fDiz035IJMEN5YXaLN60wrH kgwiE2ithjvpTEMDO597yFA7CHPsp1us7S5rWFjnpY3mTTvoQS3Ra3j2LY/sIhFgfyNL 7MDve0CedjNzCxiLotA9j83y6DUoMaEN66oW1ORDW7G+UKErVVL6n+xtctMDgC+ELzm+ N8EWGTOlPXq1bEuFVocO0XigouDCJSoMVSYdFZJVngREHloUT4gXuBV7J+n4iY/9JaWS 6DG0+oJNCNfw4g8KEF0aSkWWTpRGPfmv0CpW7sifpSOJne192Hme2jpBf3fX6RXM/q3N LXJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=oG392JwnFSIwqbAcRZTBaBlVKg4P63VtTnJ7rQBwkJg=; b=oHm6P5m9jxFyzaxr9hFDQXFaPobxBdE2sr444bKBOqam6H1a0OrWLA99nsYiMqNv+l nxSQikWc0Pz8WzhHocEevMI4DcvH0siMEJf6SH+kCsUstmQxpKMelxd8e2EiNO9qMGva Em9f9GxYuA9D/3MkZ6yWvb9I3IIznQphp14OJWpJPmplg42QRM47LK921VpEDwT7Nw3y c0JgMlzYfPf4UwFt1RzXGS6QSM3x8Ub3Z9Y0IzE5X61apv1ybS+T5pGku5WZqU+bZyeY lft4PhmNAJuJ+VVghb+ZbxYffr1gXJ9VtojVM+AgNsqgeiohNILUr6q10by5chOd/ohz VJGg== X-Gm-Message-State: AOAM532aU+uW7zLymnMFOsDYX9ugbyhm9HW2gqKR2iwuWTS2MlGss1T/ nPihY1mWjouwg7wytoW9Scdf7Q== X-Google-Smtp-Source: ABdhPJwID4LMCquwLQN+GKa/nR6dlQZdCgEh7kMeGBNjj+Y8k7lqjqWeP8+Qb8Uv1xlIMcvSl/3oBg== X-Received: by 2002:aa7:cd03:: with SMTP id b3mr3329498edw.112.1626155500781; Mon, 12 Jul 2021 22:51:40 -0700 (PDT) Received: from enceladus (athedsl-417902.home.otenet.gr. [79.131.184.108]) by smtp.gmail.com with ESMTPSA id f18sm7545593ejx.23.2021.07.12.22.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 22:51:40 -0700 (PDT) Date: Tue, 13 Jul 2021 08:51:37 +0300 From: Ilias Apalodimas To: Simon Glass Cc: Heinrich Schuchardt , Johannes Holland , Masahisa Kojima , Dhananjay Phadke , U-Boot Mailing List Subject: Re: [PATCH 1/2 v2] tpm2: Introduce TIS tpm core Message-ID: References: <20210707162604.84196-1-ilias.apalodimas@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.103.2 at phobos.denx.de X-Virus-Status: Clean Hi Simon, > > > [...] > > > Yes, but I hope you see my point, that you have added a new interface. > > > It is definitely better than adding a new driver and duplicating all > > > the code, but it is still one more copy and in fact, the code is > > > duplicated. > > > > > > > I get the point but I don't exactly agree here. It's not duplicated code. > > We need to plug in the mmio driver. The original code was just doing what > > every TPM does. It carried the TIS relevant code in the new driver. > > The new approach defines an API for everyone to use and the new driver uses it. > > So I don't see the duplication here. You need the TIS code one way or the > > other. Now it's on a common interface for everyone to use. > > Well how about converting a TPM blindly and then we'll find someone to test it? Let's do the cr50 > > > > > > Can you get access to TPM hardware? I see that you have offered to be > > > the maintainer for this subsystem, so I think that would be useful. > > > Can sandbox use your new API? > > > > It depends, is the sandbox TIS compatible? If it is sure we could use it. > > At present sandbox implements the tpm_ops API. So if we did that we > would need to tear it apart to insert this new API as well. Ok then that might make too much sense for the sandbox. > > > I offered to maintain the drivers because I wrote the API and I have an > > idea of how TPMs should work. If that means I'll have to go and get every > > hardware we support, I'll just volunteer into maintaining the TIS layer. > > Moreover I dont see why I should start porting drivers to use that API. > > People decided to duplicate that code in every driver (in fact multiple times). > > See https://xkcd.com/927/ :-) > Yea I don't disagree with that. That's one of the points of adding myself as a maintainer for the entire tpm/drivers/*. I can just reply 'no thanks' at least for new drivers that don't use it. But frankly I don't see why, adding a new drivers, while using the TIS API boils down to a few lines of code defining the bus accesses > > > > I am happy to work with you on the cr50 i2c driver if that would help. > > Sure that might be easier as I can definitely test it. Ok, let me have a look at that, I still think the patch should go in regardless though. We can always send a follow up for cr50 once we are done testing Cheers /Ilias > > Regards, > Siomn