From patchwork Wed Oct 11 10:06:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 731923 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp316177wrv; Wed, 11 Oct 2023 03:09:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+XYlveOC7jp2JfgkF1JdT/ohqfXV8rcLBZa5802VzuLXT0gPJCPdFTORGRveOPz1/nOD3 X-Received: by 2002:a19:9148:0:b0:504:2d54:b4d0 with SMTP id y8-20020a199148000000b005042d54b4d0mr17858110lfj.19.1697018993482; Wed, 11 Oct 2023 03:09:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697018993; cv=none; d=google.com; s=arc-20160816; b=HfFL640ijYIQ7SzPI+Frp2ylOQG6A8Hp8p4CnfBYGsnYl1TPENrszUUJhRS8Pm6I1a alPL+Fl/BN78XAZ9+E6eDz2OTXgK5Xvup30IACVGirWMQvdB/9JsDjZ/WUQSG+xOHV2Z mZGfYNQUvJK2dOVfUi0b3G8BJ/zWsy73H3aTMjLu237Y8us/5pavY4cuBlUuax+P3F7U MGfzPpGYJdbzBfLpd8g7NwFefgRKLWJ4POS0baG4G8spdnUi+ZVzjQb/XhtIyVI9az9h vSk2B/tLqxjcpUk6iTrkZsQ9Ek4jiWYQguxTOqxUD6YOw8kzDXvYK19YVh0YAZmlc8pt lkag== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bKQCA4NmtQLw2v1OtVuIkV/l8UfbIwEX1Xgxft/0LvQ=; fh=K4dQhL74gef2glEqNOnE2YOBTqRi7qf0ycKBewrN6K8=; b=hMc06NOB8pFTLKKzjdop+Zxq2OJO9SAFTgVaSAZGFVdK5jqg+RuX7dOFSbXy9ThZUy PbztRfP5sU4qksXY7f5d6aTWi9zs0DL6qeRV+17CvwU8JPLvNhUFfMDm8+gWc+tFpaTO cgrt4NIXjySaoQ9ZsGfrNvzIJpnEkr4vcZ1xHFcIcqoSSXab/O5a+JxHGNSeTkvHBo08 Wxh0TonfAFD3Z0l1xxCyHePzEb+FKK0GPTmDlgrUONvQzFMnWivAwiwd0CZVEiGvymmD sap0bQlQ1U0qdPi2QyBCdeLn7n9BsiRJHM6zCXZGGuXbIykEyof6GO0JzSQWFdOhP9pg /t+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aEkAq1yH; 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 v5-20020a05600c428500b004047ef37bbfsi7361291wmc.218.2023.10.11.03.09.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:09:53 -0700 (PDT) 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=aEkAq1yH; 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 708E986D5E; Wed, 11 Oct 2023 12:08:07 +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="aEkAq1yH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4A58386D01; Wed, 11 Oct 2023 12:07:55 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) (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 D316586CFD for ; Wed, 11 Oct 2023 12:07:42 +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=takahiro.akashi@linaro.org Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3ae473c0bd6so1173534b6e.0 for ; Wed, 11 Oct 2023 03:07:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697018858; x=1697623658; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bKQCA4NmtQLw2v1OtVuIkV/l8UfbIwEX1Xgxft/0LvQ=; b=aEkAq1yHxNa5Qbe0T6SPEOgzekI5yoJb/jIX21Rw6XEM++pHDuq6IJD7JqCCjz9il6 FBuKtOHjEfWRJkufQjD/O1hw9LzKA2RWSbs1TKQZSWh5bPKVNMT8nuMqwWK+cLjm0m+p 1pn76Bkf5waSI7hLTLjcnnm72wegi2mwTgJKgRReCg37IUf/DHLQqS16LnGQqJKv9shS aWDbSWyyM+Pr8EnqKGWClzMJ+z7V55tyLZfxd+AchRy51Wct7nRdF10ExlsuFYXwg9t9 GeFiIqMNvu5yo0I0JjpX/JEuvKsUdAgxUWDysSAa9AtEBNwqDZuPNVWa46qjrXBzVNko xzTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697018858; x=1697623658; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bKQCA4NmtQLw2v1OtVuIkV/l8UfbIwEX1Xgxft/0LvQ=; b=hGghDV3M56y7t1kxS2nWHrwg6PgzO+cvb15XITobuxb2/CIrQop9lInAXDzg2vDIJK FXfhNNSgkMmTK1qTaBBe7SS+ucF8KVNDaPIoQoby4asdaG5vCZdqNHkQSYVl4mE+8+3l Y86xsKLRS+mvbjx1zJNZ8DvNYHPtZ3v8sX4NjecPh44u7GvmVHfeliPw34Mw8lh0ii0O TnucjADdTdp+QwnhbMmX4gwhgEvlCLiQTqaz8W8CJbJA+Zt1cBNqieeLMUtcAuDBAPkv Z9vgv954R+ZG++0LsOOiJFuXh1hGN1Bs2W36PgpHiVOEuQdb5VwyVIdM37WEzPpCDcqo cs+Q== X-Gm-Message-State: AOJu0YymNbWAQVxhCas8It6+EedvtBoZWbg6KMLnJRXC9A/y5e11vPFK BCUPCZlQ7jR12kiR3yv4XnIlxBpo1smC8RmpnjNQ+Q== X-Received: by 2002:a05:6808:3008:b0:3ad:af12:2fe0 with SMTP id ay8-20020a056808300800b003adaf122fe0mr23806151oib.3.1697018857755; Wed, 11 Oct 2023 03:07:37 -0700 (PDT) Received: from octopus.. ([2400:4050:c3e1:100:5c6c:b11a:476c:8ebb]) by smtp.gmail.com with ESMTPSA id e4-20020a62ee04000000b006889664aa6csm9663358pfi.5.2023.10.11.03.07.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:07:37 -0700 (PDT) From: AKASHI Takahiro To: trini@konsulko.com, sjg@chromium.org Cc: etienne.carriere@st.com, u-boot@lists.denx.de, AKASHI Takahiro , Etienne Carriere Subject: [PATCH v6 06/14] test: dm: add protocol-specific channel test Date: Wed, 11 Oct 2023 19:06:59 +0900 Message-Id: <20231011100707.1007417-7-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231011100707.1007417-1-takahiro.akashi@linaro.org> References: <20231011100707.1007417-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean Any SCMI protocol may have its own channel. Test this feature on sandbox as the necessary framework was added in a prior commit. Signed-off-by: AKASHI Takahiro Reviewed-by: Simon Glass Reviewed-by: Etienne Carriere --- v6 * add missing header files (scmi_agent.h, scmi_protocols.h) v5 * new commit --- arch/sandbox/dts/test.dts | 1 + test/dm/scmi.c | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index 057e1ca1f4a8..73224e385b8a 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -700,6 +700,7 @@ clk_scmi: protocol@14 { reg = <0x14>; #clock-cells = <1>; + linaro,sandbox-channel-id = <0x14>; }; reset_scmi: protocol@16 { diff --git a/test/dm/scmi.c b/test/dm/scmi.c index d87e2731ce42..8db3ad32f85e 100644 --- a/test/dm/scmi.c +++ b/test/dm/scmi.c @@ -16,6 +16,8 @@ #include #include #include +#include +#include #include #include #include @@ -109,7 +111,7 @@ static int dm_test_scmi_clocks(struct unit_test_state *uts) struct sandbox_scmi_devices *scmi_devices; struct sandbox_scmi_service *scmi_ctx; struct sandbox_scmi_agent *agent; - struct udevice *dev; + struct udevice *agent_dev, *clock_dev, *dev; int ret_dev; int ret; @@ -124,6 +126,14 @@ static int dm_test_scmi_clocks(struct unit_test_state *uts) agent = scmi_ctx->agent; ut_assertnonnull(agent); + /* Sandbox SCMI clock protocol has its own channel */ + ut_assertok(uclass_get_device_by_name(UCLASS_SCMI_AGENT, "scmi", + &agent_dev)); + ut_assertnonnull(agent_dev); + clock_dev = scmi_get_protocol(agent_dev, SCMI_PROTOCOL_ID_CLOCK); + ut_assertnonnull(clock_dev); + ut_asserteq(0x14, sandbox_scmi_channel_id(clock_dev)); + /* Test SCMI clocks rate manipulation */ ut_asserteq(333, agent->clk[0].rate); ut_asserteq(200, agent->clk[1].rate); @@ -172,7 +182,7 @@ static int dm_test_scmi_resets(struct unit_test_state *uts) struct sandbox_scmi_devices *scmi_devices; struct sandbox_scmi_service *scmi_ctx; struct sandbox_scmi_agent *agent; - struct udevice *dev = NULL; + struct udevice *agent_dev, *reset_dev, *dev = NULL; int ret; ret = load_sandbox_scmi_test_devices(uts, &dev); @@ -186,6 +196,14 @@ static int dm_test_scmi_resets(struct unit_test_state *uts) agent = scmi_ctx->agent; ut_assertnonnull(agent); + /* Sandbox SCMI reset protocol doesn't have its own channel */ + ut_assertok(uclass_get_device_by_name(UCLASS_SCMI_AGENT, "scmi", + &agent_dev)); + ut_assertnonnull(agent_dev); + reset_dev = scmi_get_protocol(agent_dev, SCMI_PROTOCOL_ID_RESET_DOMAIN); + ut_assertnonnull(reset_dev); + ut_asserteq(0x0, sandbox_scmi_channel_id(reset_dev)); + /* Test SCMI resect controller manipulation */ ut_assert(!agent->reset[0].asserted);