From patchwork Thu Feb 18 12:54:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 384409 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp3652427jao; Thu, 18 Feb 2021 04:56:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJyE8jRoqQdkBLGPlJzSLXt7afnqyCluyocJShyfUkpge0x8idt71n/9TOg5i5nsq0I8r7no X-Received: by 2002:a05:6402:b82:: with SMTP id cf2mr3986336edb.87.1613652988990; Thu, 18 Feb 2021 04:56:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613652988; cv=none; d=google.com; s=arc-20160816; b=PBb6VKLnUEkK4jd3c0OQJDsnYAoN053Nwwdj04Zs59UMpADb2gmIa3c4oJ6t30JWOK FJQ2Scw3lX3/OyCoa+I9TSJjOzLcwhAQPp9RKb06oyx6rVSu5riVWyCaU7t4tF92dYlR MJ5kYSgtuu/Tios4RMJLYBsV97ZZ8QTUscm2MZL8V4qbvtu4Xfgahkin9ThORtak40tr NPj5+fS0EMwo3kosFKndwiX5QXis/F8aPTiJWNyfuwdadpoj1ota62VL8RsVTNp9aYq4 upUeaSqBeGDrCBDJuKoycc7UInS+aLz7fdlUPkXTsMKWqe5uj+JzzgIdIxX5UMVHRlDV GnmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=yNztXoxDeK6i4oejyDkLCO6i4loPBrEpPT4CXkZsNx8=; b=NxcZbRklHFfu4nioN+AF5lWF3uQ1xyGRAVd2tYEo6A6FeS1MkffqYirPjK+gyrprmT axkCoF37jTGFJlHeszV2Lm/Ozk9uQ7QWMeY70/ULW0GlZcpgWXSap82k7lbZi/uA8IEB 69odqGRrBrl6l1RBTtF7Q0bCcOaVdSGX+L9rncZnCEuf4yAE08tPUtOYFrzrx/6rDP7h 5z2ytWC4lKxNQW7TxJzu4Sib1sV1Zq7n7L9T9s8idoQfmtn9gJc4893YVjToNtqX/NW4 KEc21/7JNPwOp+Kyd5ZQ1Ems7t/Qr8e4+W0CPgxMlyVKA8qffWMYAYLY22jFq2EudZOA VW/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ocpn47ie; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id q18si3761792edd.608.2021.02.18.04.56.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Feb 2021 04:56:28 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ocpn47ie; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EF42C826FB; Thu, 18 Feb 2021 13:56:21 +0100 (CET) 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="Ocpn47ie"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 292FF82764; Thu, 18 Feb 2021 13:56:20 +0100 (CET) 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,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) (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 77A3882540 for ; Thu, 18 Feb 2021 13:55:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=etienne.carriere@linaro.org Received: by mail-wm1-x32a.google.com with SMTP id x16so3536618wmk.3 for ; Thu, 18 Feb 2021 04:55:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yNztXoxDeK6i4oejyDkLCO6i4loPBrEpPT4CXkZsNx8=; b=Ocpn47ie3YQwg5zGry1WvHLBhQBWzW1M0BNZg3cfj34REVjjLQnMEYB8vkWdNHU1j/ Gm5auUgr1JRan+JIOhvkgPTG75PcXaEfTAiXxA/icZiLZGwdilGAqAXG6PZCEo2y/qP/ m7rM9T8HXMnTn57cw9G9EeZqeRJcq6bKrvnV1EnY1pTHCrobCPmyojgsrmohyXeYjAJY jCMimlFGS3h/RneOPrOngAW6ztk+7hdSD56CBzJA9yDogg72RNFrBfESn4rhymWvxDLG B5E0JRFYAWSPcdepkrmPX0NVrSQ5FbHo1hS9dI+0exrm42Em7pHxbrb62VYryJLW7nb/ eIqA== 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; bh=yNztXoxDeK6i4oejyDkLCO6i4loPBrEpPT4CXkZsNx8=; b=GOdq2i3UBdMyAnbwRLmfgx81iNq4cs+Ucz6gcFxIWOJiKXIpTSut4mYE+iWscPuE0q bXofR1jQmr/4Wq50w6N2FkLyxF7PS3ItiGC0ReR9TrwpN+n9YMyFhBjDEuKTnH/i+ajw GGp2ZGJloF2bu1vGKNmEKcfdSox2MqyhjQKmhlXHEK70iItDgFlk1GXmHaehKMpD3wpO qtl8hVOQdgpCsPTfc8wzIQccs3EGcNrHz6sXC2DpAfvApelcccpBvCptbSzbkKeH/b+q yh3brp+raN0udXOh5zpCz66cR7pM0IQ+yGFYIAwbxh/+kWeBVfLxI60MHSK7mjD9v+R3 6r+A== X-Gm-Message-State: AOAM530In+mHjDk1Zapkf7mZFi0+vynAGqXUcge5Vvb5UfkMyA7gZr0t GYqThDOSBwFvuLLF6oMJ6lMQQG2BTEaD7wEB X-Received: by 2002:a1c:f20e:: with SMTP id s14mr2719201wmc.104.1613652954874; Thu, 18 Feb 2021 04:55:54 -0800 (PST) Received: from lmecxl0524.home (2a01cb058b850800b51a732fdac74386.ipv6.abo.wanadoo.fr. [2a01:cb05:8b85:800:b51a:732f:dac7:4386]) by smtp.gmail.com with ESMTPSA id f2sm8745418wrt.7.2021.02.18.04.55.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Feb 2021 04:55:54 -0800 (PST) From: Etienne Carriere To: u-boot@lists.denx.de Cc: Simon Glass , Jaehoon Chung , Patrick Delaunay , Patrice Chotard , etienne.carriere@linaro.org Subject: [PATCH 3/3] firmware: scmi: fix inline comments and minor coding style issues Date: Thu, 18 Feb 2021 13:54:44 +0100 Message-Id: <20210218125444.4090-3-etienne.carriere@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210218125444.4090-1-etienne.carriere@linaro.org> References: <20210218125444.4090-1-etienne.carriere@linaro.org> 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.3 at phobos.denx.de X-Virus-Status: Clean Fix inline comments and empty line in scmi driver and test files. Condition SCMI clock and reset tests to U-Boot configuration. Change-Id: Iac37398cedc1942cf1cc114fc60cbe04c599313e Signed-off-by: Etienne Carriere --- arch/sandbox/include/asm/scmi_test.h | 5 +++-- drivers/firmware/scmi/sandbox-scmi_agent.c | 4 ++-- test/dm/scmi.c | 21 ++++++++++++--------- 3 files changed, 17 insertions(+), 13 deletions(-) -- 2.17.1 diff --git a/arch/sandbox/include/asm/scmi_test.h b/arch/sandbox/include/asm/scmi_test.h index 9b7031531..2930e686d 100644 --- a/arch/sandbox/include/asm/scmi_test.h +++ b/arch/sandbox/include/asm/scmi_test.h @@ -24,6 +24,7 @@ struct sandbox_scmi_clk { /** * struct sandbox_scmi_reset - Simulated reset controller exposed by SCMI + * @id: Identifier of the reset controller used in the SCMI protocol * @asserted: Reset control state: true if asserted, false if desasserted */ struct sandbox_scmi_reset { @@ -48,8 +49,8 @@ struct sandbox_scmi_voltd { * @idx: Identifier for the SCMI agent, its index * @clk: Simulated clocks * @clk_count: Simulated clocks array size - * @clk: Simulated reset domains - * @clk_count: Simulated reset domains array size + * @reset: Simulated reset domains + * @reset_count: Simulated reset domains array size * @voltd: Simulated voltage domains (regulators) * @voltd_count: Simulated voltage domains array size */ diff --git a/drivers/firmware/scmi/sandbox-scmi_agent.c b/drivers/firmware/scmi/sandbox-scmi_agent.c index 3eafc49bd..56125a57b 100644 --- a/drivers/firmware/scmi/sandbox-scmi_agent.c +++ b/drivers/firmware/scmi/sandbox-scmi_agent.c @@ -18,7 +18,7 @@ * processing. It simulates few of the SCMI services for some of the * SCMI protocols embedded in U-Boot. Currently: * - SCMI clock protocol: emulate 2 agents each exposing few clocks - * - SCMI reset protocol: emulate 1 agents each exposing a reset + * - SCMI reset protocol: emulate 1 agent exposing a reset controller * - SCMI voltage domain protocol: emulate 1 agent exposing 2 regulators * * Agent #0 simulates 2 clocks, 1 reset domain and 1 voltage domain. @@ -29,7 +29,7 @@ * * All clocks and regulators are default disabled and reset controller down. * - * This Driver exports sandbox_scmi_service_ct() for the test sequence to + * This Driver exports sandbox_scmi_service_ctx() for the test sequence to * get the state of the simulated services (clock state, rate, ...) and * check back-end device state reflects the request send through the * various uclass devices, as clocks and reset controllers. diff --git a/test/dm/scmi.c b/test/dm/scmi.c index f21a3ff97..cc611c1e0 100644 --- a/test/dm/scmi.c +++ b/test/dm/scmi.c @@ -57,18 +57,24 @@ static int ut_assert_scmi_state_postprobe(struct unit_test_state *uts, ut_asserteq(2, scmi_ctx->agent_count); ut_assertnonnull(scmi_ctx->agent[0]); - ut_asserteq(2, scmi_ctx->agent[0]->clk_count); - ut_assertnonnull(scmi_ctx->agent[0]->clk); - ut_asserteq(1, scmi_ctx->agent[0]->reset_count); - ut_assertnonnull(scmi_ctx->agent[0]->reset); + if (IS_ENABLED(CONFIG_CLK_SCMI)) { + ut_asserteq(2, scmi_ctx->agent[0]->clk_count); + ut_assertnonnull(scmi_ctx->agent[0]->clk); + } + if (IS_ENABLED(CONFIG_RESET_SCMI)) { + ut_asserteq(1, scmi_ctx->agent[0]->reset_count); + ut_assertnonnull(scmi_ctx->agent[0]->reset); + } if (IS_ENABLED(CONFIG_DM_REGULATOR_SCMI)) { ut_asserteq(2, scmi_ctx->agent[0]->voltd_count); ut_assertnonnull(scmi_ctx->agent[0]->voltd); } ut_assertnonnull(scmi_ctx->agent[1]); - ut_assertnonnull(scmi_ctx->agent[1]->clk); - ut_asserteq(1, scmi_ctx->agent[1]->clk_count); + if (IS_ENABLED(CONFIG_CLK_SCMI)) { + ut_assertnonnull(scmi_ctx->agent[1]->clk); + ut_asserteq(1, scmi_ctx->agent[1]->clk_count); + } return 0; } @@ -113,7 +119,6 @@ static int dm_test_scmi_sandbox_agent(struct unit_test_state *uts) return ret; } - DM_TEST(dm_test_scmi_sandbox_agent, UT_TESTF_SCAN_FDT); static int dm_test_scmi_clocks(struct unit_test_state *uts) @@ -175,7 +180,6 @@ static int dm_test_scmi_clocks(struct unit_test_state *uts) return release_sandbox_scmi_test_devices(uts, dev); } - DM_TEST(dm_test_scmi_clocks, UT_TESTF_SCAN_FDT); static int dm_test_scmi_resets(struct unit_test_state *uts) @@ -206,7 +210,6 @@ static int dm_test_scmi_resets(struct unit_test_state *uts) return release_sandbox_scmi_test_devices(uts, dev); } - DM_TEST(dm_test_scmi_resets, UT_TESTF_SCAN_FDT); static int dm_test_scmi_voltage_domains(struct unit_test_state *uts)