From patchwork Sun Mar 17 22:52:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 1057610 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kbf3LKU7"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KS/HPJoC"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44MvnR0xpmz9s7h for ; Mon, 18 Mar 2019 09:56:27 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YF7vAZujZYyRl/HW7Zm4B7bOLoJ3AtNlbImBXOkBi9Y=; b=kbf3LKU7F0Jfjh rMQvMr9/lL0VKrKYZ2AnabTSL4jLtLIoRPU3mKRIN92h4P9IwtQAQ5+m6B1Wn383eFVv5lxJ7Jaf5 ANqBA/2ilOo80RxYgDSvilw1FBgQZY85l43OdCeoKcLyg98GSg1UvlOheb26HIBgp2kZAjo84lzTv o9mBD5ATZP4FMk7OhwynAT2hi0sV2WMCHAGIKENMofU3r0ltnnE8rh9Yc7HCNXaOgjk+TnQXBOPge vFY24zH1UYYw+Fi1vbKruhbAkNVP4S0s72UijcWdpGT1J5C2+GIt/ryKAnZcfExcjIFUxnH7JrDwI OVwP+f+CrJ8GgAkhLIsQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5ehW-0007aa-05; Sun, 17 Mar 2019 22:56:18 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5eh3-000742-D2 for linux-arm-kernel@lists.infradead.org; Sun, 17 Mar 2019 22:55:51 +0000 Received: by mail-pf1-x444.google.com with SMTP id c207so936960pfc.7 for ; Sun, 17 Mar 2019 15:55:49 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=wNzJGGyEOize1LzTO0+y1Kgh6PGMJqQwtkfpH9Pt58o=; b=KS/HPJoCizQS/MGEIiwJMWEe55oqGw+mflnBa/9xG+7mjBVs6x+v3qYAUIXOalW1fW RJvQAFUTBDry4mmHZ1meEYtTZuSUUjphqLiXje1IrRRsLJazt3A26MrMcj755njP8XZF JXvmMoW8nWThkHRw1JwTfHm9qDXkGm8kKl2bPfcC8QEjVGItEwoeCgsJo+ViGMpzozll qmGG/1RTouaymqGSg/V7qlPVsOAtRHn2CD+mnH076g2fr9PJfGH4fiSftTHvszPkPlqF HxQe6cT9FmzPj7k7k5ccXMHqzSjtuiScme0EIgQmwI9sv3VWqo+ntVAmQ6d8OZb3O5Pg JqGw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=wNzJGGyEOize1LzTO0+y1Kgh6PGMJqQwtkfpH9Pt58o=; b=JfzTOlAQywTjI8MpDDWdlSnH7kRyZ21gVEWICpU0kJxbOfMO/gbHxtXRM1qxBkzGl8 4cyjrmCQYIplEvP1bPnGYXJt44gOjJpTh8oUwkSGpuzUjfnpNf/PNSfOYA30tnASUt44 GIx0Y1/p0kcCQ49PjWqE1lZ7Nv2YiRqubCr23HH4VeCfzxRmQ8+osgyrRrsBDquHmCz/ 1uZN7oUE57RCXr1OxPBmqlM1a9mSV/j6a1lwRGfg9z4ByV4ewItCw5EeXDJ7JQQuAxc8 lXkCp24E0e6lcXRVn7lxTKRVp7snmd30HluIiNui+zToriHS1FYA0gHF3Xzn+IW18DgE 9GsQ== X-Gm-Message-State: APjAAAW+5ke8B4heFjZVY81t/iNdl5Ic8JsACymjXk+hYJSXpiloQkVM fkJnP/RcFnri/AiXAreaVTQ= X-Google-Smtp-Source: APXvYqxcTo0Wcwu7bj5yIzZO1FtGxruGm26JpgvnPbswyc6Ya5LV5ZdYzM83DkpdMWOd8mh7xXJuWg== X-Received: by 2002:a65:62c2:: with SMTP id m2mr14666478pgv.348.1552863348757; Sun, 17 Mar 2019 15:55:48 -0700 (PDT) Received: from localhost.localdomain (ppp94-29-37-86.pppoe.spdop.ru. [94.29.37.86]) by smtp.gmail.com with ESMTPSA id v2sm13738838pfg.118.2019.03.17.15.55.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Mar 2019 15:55:48 -0700 (PDT) From: Dmitry Osipenko To: Russell King , Thierry Reding , Jonathan Hunter , Robert Yang , =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v10 3/7] ARM: trusted_foundations: Provide information about whether firmware is registered Date: Mon, 18 Mar 2019 01:52:06 +0300 Message-Id: <20190317225211.23091-4-digetx@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190317225211.23091-1-digetx@gmail.com> References: <20190317225211.23091-1-digetx@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190317_155549_864470_A3EAE208 X-CRM114-Status: GOOD ( 11.54 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (digetx[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Add a helper that provides information about whether Trusted Foundations firmware operations have been registered. Tested-by: Robert Yang Tested-by: Michał Mirosław Signed-off-by: Dmitry Osipenko --- arch/arm/firmware/trusted_foundations.c | 5 +++++ arch/arm/include/asm/trusted_foundations.h | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/arch/arm/firmware/trusted_foundations.c b/arch/arm/firmware/trusted_foundations.c index 720904a43c00..bb2ee73d9e02 100644 --- a/arch/arm/firmware/trusted_foundations.c +++ b/arch/arm/firmware/trusted_foundations.c @@ -167,3 +167,8 @@ void of_register_trusted_foundations(void) panic("Trusted Foundation: missing version-minor property\n"); register_trusted_foundations(&pdata); } + +bool trusted_foundations_registered(void) +{ + return firmware_ops == &trusted_foundations_ops; +} diff --git a/arch/arm/include/asm/trusted_foundations.h b/arch/arm/include/asm/trusted_foundations.h index 201ceb259e71..54513c533811 100644 --- a/arch/arm/include/asm/trusted_foundations.h +++ b/arch/arm/include/asm/trusted_foundations.h @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -50,6 +51,7 @@ struct trusted_foundations_platform_data { void register_trusted_foundations(struct trusted_foundations_platform_data *pd); void of_register_trusted_foundations(void); +bool trusted_foundations_registered(void); #else /* CONFIG_TRUSTED_FOUNDATIONS */ static inline void tf_dummy_write_sec(unsigned long val, unsigned int reg) @@ -84,6 +86,11 @@ static inline void of_register_trusted_foundations(void) if (of_find_compatible_node(NULL, NULL, "tlm,trusted-foundations")) register_trusted_foundations(NULL); } + +static inline bool trusted_foundations_registered(void) +{ + return false; +} #endif /* CONFIG_TRUSTED_FOUNDATIONS */ #endif