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=-15.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 1F9DAC47080 for ; Tue, 1 Jun 2021 06:43:31 +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 DDA8061378 for ; Tue, 1 Jun 2021 06:43:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DDA8061378 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com 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 88B4780F0E; Tue, 1 Jun 2021 08:43:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="kuJB5os1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5FB8980FBD; Tue, 1 Jun 2021 08:43:26 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on20601.outbound.protection.outlook.com [IPv6:2a01:111:f400:7ea9::601]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E6ED580C98 for ; Tue, 1 Jun 2021 08:43:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michals@xilinx.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TiWZhf9dZGAtZc8RBexzAsZJZwvLaj6TNgvZfSbX1VAwgJc1wn3OOBTQAWQuIcOH0re5VOoQyXNUGuN7rn9xka6c4x+1GYSEeJdmWMYaKJPVl8pzAeRwHCILXtWeOLkH10C8n3yZGvLNVlWzDKg8obqbHA5FIRhIdLrbRwEBq58+RMDfNMEWxfiuwKanKCadMeK061pcKXBnw7YUjfmweWJ7dv0ObcRn+5Tt4b8Sc9SwEnk5ocSk6nPFPJrtiBe73WVlz3p4xu823TOdh2YyrvqUjxVIOx30KhLzfG472jhew/Pddl/nmI3jy4gcudggTJbhl2DUS8EDr4WXMUW8Ag== 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-SenderADCheck; bh=WENusk9fDpSlDgaXokxhjsZlj+Xjj0+U/ZkhsdHvbAY=; b=mrL70pZcDJdeUUAQceSSS07KmdDROg6xhNgQbe+HSnOhJoDFQFXEiiciswd5+xwxqXkQzqm8vy8Vk1vxg6Lzh7AcCPDbvtjwndh1Z0HGizlYwnJtUcxo0Xr2gqSX1BxbljlFPtioRZXMlT+DVNWfQm4u5xQfZbAoMCrpaH5JmaXHb4627spzroDHktlRMktcCEFyZelcyCQvfFx/HGxmbDGxaPZvpClObx3WQrlM1ZfNl57N1posoANDiOl4j7FsKpaH0bLsCv51flOZvch2tMo+ExLTk56Tb1/y141ZtctdhLKmz3LB635jQSohgW0mv/0IuE5DkZ53oQQYqrJ5JA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=lists.denx.de smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WENusk9fDpSlDgaXokxhjsZlj+Xjj0+U/ZkhsdHvbAY=; b=kuJB5os19Fl/8BZC983I4G1lqwrPSiqRLMFuv7pd3iAbrVXBD9aLn0ACWVNp8nmNTiSjJbip3xBbHlBN76W47V2cjCblmaaXU0fwp9EH6liBtwkZyr7x/kz4DMlhz+ch/PzaRXe7/7TbX7WqRkvBCBTcjLZAiG72p1UnEHxTqe4= Received: from DS7PR05CA0010.namprd05.prod.outlook.com (2603:10b6:5:3b9::15) by DM6PR02MB6873.namprd02.prod.outlook.com (2603:10b6:5:259::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.26; Tue, 1 Jun 2021 06:43:16 +0000 Received: from DM3NAM02FT054.eop-nam02.prod.protection.outlook.com (2603:10b6:5:3b9:cafe::81) by DS7PR05CA0010.outlook.office365.com (2603:10b6:5:3b9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.9 via Frontend Transport; Tue, 1 Jun 2021 06:43:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; lists.denx.de; dkim=none (message not signed) header.d=none;lists.denx.de; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT054.mail.protection.outlook.com (10.13.5.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4150.30 via Frontend Transport; Tue, 1 Jun 2021 06:43:14 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 31 May 2021 23:43:13 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Mon, 31 May 2021 23:43:13 -0700 Envelope-to: u-boot@lists.denx.de, bruno.thomsen@gmail.com, sjg@chromium.org, jorge@foundries.io Received: from [172.30.17.109] (port=34682) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lny7M-0006um-Ur; Mon, 31 May 2021 23:43:13 -0700 To: Jorge Ramirez-Ortiz , , CC: , References: <20210601060927.30894-1-jorge@foundries.io> From: Michal Simek Subject: Re: [PATCHv2] drivers: tpm2: update reset gpio semantics Message-ID: Date: Tue, 1 Jun 2021 08:43:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <20210601060927.30894-1-jorge@foundries.io> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2d7be8a9-75c9-4367-8c91-08d924c88861 X-MS-TrafficTypeDiagnostic: DM6PR02MB6873: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:398; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CpV0+29JXw+IXBZ8CMjIKmspqljdAjraTZSUslXbQcBMEdghAktFMILXESFcfYAb935vCI4lxrruz9TOQNRo3kKLVX03pM3DHx7IlE+KTaRPqaF6wo1ZjWCgc6C49zZaMsWMlqFIMZezZh+qkSVwIV1HrHhftWCT0/Vn/zWdZAt9Chl+OQxGCmxQNy3YKNTR2nz5bsaFddpg+1By+XJ23FFXcVzZs3yAhI2qKwnFK1W+EZqpRJ0Du4NVWSpjqpcipPqVlpotryhJxG0I1YNp5BzRZRLGNcdSTUDjUzNd8Tl736rjNioJ4vuIFbfe/sH8HPjTNFhlHcZ7f7v7mn0TfQC3lElryTjFuT9nZ9n1kvPWzi2UUjKMwx4vbfgTbhjCWoxZg2PUbP7P3pLSRK+CcOTcmS1EXjy0MBZYIlyWkysfn+i4szXjsT+CCV/cUKyoJ+cfLe8ANPNrWcISdsnnWbnkw59OSO3LOarz9O1Zg+MUWrAMaPZsRYzeja18YSXu7pWsgXcHjEwZyexoxC3R8lf5yFlIm2ZNucbIcC3z5huDcI4RtVykL2uFVAO6o0TEg06cY6lcPmsXwEwzFpAEk6kEYU7aDVx9U2AHqiKjVxVzBZZs6J/6FeJHwkoO4duRC2gGGXINTzh5iwSB0rtZs3K47EGxVKG0NMUiD5K4+QFhbWfEom4rvuj9KP3eOBXzQ0hdN4fDp4kVsVzjP7aytg== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(346002)(39860400002)(376002)(136003)(396003)(46966006)(36840700001)(9786002)(15650500001)(4326008)(53546011)(83380400001)(26005)(8676002)(110136005)(54906003)(36756003)(8936002)(316002)(82310400003)(336012)(31686004)(47076005)(70586007)(426003)(44832011)(2616005)(36860700001)(478600001)(5660300002)(356005)(7636003)(70206006)(82740400003)(31696002)(186003)(2906002)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2021 06:43:14.8889 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2d7be8a9-75c9-4367-8c91-08d924c88861 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT054.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB6873 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.102.4 at phobos.denx.de X-Virus-Status: Clean On 6/1/21 8:09 AM, Jorge Ramirez-Ortiz wrote: > Use the more generic reset-gpios propery name. > > Signed-off-by: Jorge Ramirez-Ortiz > --- > v2: kept gpio-reset as legacy > > .../tpm2/tis-tpm2-spi.txt | 2 +- > drivers/tpm/tpm2_tis_spi.c | 21 ++++++++++++------- > 2 files changed, 14 insertions(+), 9 deletions(-) > > diff --git a/doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt b/doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt > index 3a2ee4bd17..bbcd12950f 100644 > --- a/doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt > +++ b/doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt > @@ -6,7 +6,7 @@ Required properties: > - reg : SPI Chip select > > Optional properties: > -- gpio-reset : Reset GPIO (if not connected to the SoC reset line) As I said you shouldn't remove this. Just extend description that it is deprecated and reset-gpios should be used instead. > +- reset-gpios : Reset GPIO (if not connected to the SoC reset line) > - spi-max-frequency : See spi-bus.txt > > Example: > diff --git a/drivers/tpm/tpm2_tis_spi.c b/drivers/tpm/tpm2_tis_spi.c > index 4b33ac8fd3..1f9f89f68f 100644 > --- a/drivers/tpm/tpm2_tis_spi.c > +++ b/drivers/tpm/tpm2_tis_spi.c > @@ -589,18 +589,23 @@ static int tpm_tis_spi_probe(struct udevice *dev) > if (CONFIG_IS_ENABLED(DM_GPIO)) { > struct gpio_desc reset_gpio; > > - ret = gpio_request_by_name(dev, "gpio-reset", 0, > + ret = gpio_request_by_name(dev, "reset-gpios", 0, > &reset_gpio, GPIOD_IS_OUT); > if (ret) { > - log(LOGC_NONE, LOGL_NOTICE, "%s: missing reset GPIO\n", > - __func__); > - } else { > - dm_gpio_set_value(&reset_gpio, 1); > - mdelay(1); > - dm_gpio_set_value(&reset_gpio, 0); > + /* legacy reset */ > + ret = gpio_request_by_name(dev, "gpio-reset", 0, > + &reset_gpio, GPIOD_IS_OUT); > + if (ret) { > + log(LOGC_NONE, LOGL_NOTICE, > + "%s: missing reset GPIO\n", __func__); > + goto init; > + } And here it is clear that gpio-reset is used which should deprecated that's why you should print message about it here. > } > + dm_gpio_set_value(&reset_gpio, 1); > + mdelay(1); > + dm_gpio_set_value(&reset_gpio, 0); > } What about this to remove that goto? ret = gpio_request_by_name(dev, "reset-gpios", 0, &reset_gpio, GPIOD_IS_OUT); if (ret) { /* trying legacy reset */ ret = gpio_request_by_name(dev, "gpio-reset", 0, &reset_gpio, GPIOD_IS_OUT); if (!ret) log(LOGC_NONE, LOGL_NOTICE, "%s: Using deprecated gpio-reset switch to reset-gpios\n", __func__); } if (!ret) { dm_gpio_set_value(&reset_gpio, 1); mdelay(1); dm_gpio_set_value(&reset_gpio, 0); } > - > +init: > /* Ensure a minimum amount of time elapsed since reset of the TPM */ > mdelay(drv_data->time_before_first_cmd_ms); > > M