From patchwork Wed Jun 28 00:48:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 697209 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp4080557wrm; Tue, 27 Jun 2023 17:51:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6N5/2b7ALrl4RXnkXDkjksVFK0wB7QYWCfz0VvD0ItJjP+yrecqAGmamXI4D4RP5ZSPR3O X-Received: by 2002:a2e:9650:0:b0:2b6:9dd5:7a5 with SMTP id z16-20020a2e9650000000b002b69dd507a5mr5550293ljh.12.1687913496600; Tue, 27 Jun 2023 17:51:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687913496; cv=none; d=google.com; s=arc-20160816; b=rsNnk9akTHvW9lJMmVJYPXKL1Dr4sd6YqKMGez0TVAyK9pDhpK057oWBskuRsOrA52 ItedVxVfKIwOhGipsgDloK5mI0fKbbOt0DHFxdwdmKIDJG7/RyjyeKeyfMO54i4Mkj02 6m7eBN02/tLlnnNWSPDaKW6sQFnxgUAlq3SKqL8q36nNntAKq7dBaYnLSaI1DC7ClF8M IJsMGLO+lp6WbWi4HNBFKGqpkOanwEsiHPU48gNhmTuypmFhO069+INOZHND9Jwoy/G6 rn4e3alFb+uXT9bWvvO5YFdvSCxnf0JmPwHqKDc9TI1E9jMZjr9iiBlXT4KBSjuer1ZP VUzw== 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=UNec+yYqM/9p8g33e1zRr4zBUrhLWSTWYQhFZ4LteI4=; fh=+s9SE2w9oguEKAMcR35TXtqntCOeVFhiK9u/Kju91lo=; b=hae6VTLx862Je2SCXAbU3T8mEWEJS8FM7XvOCUfL+sbwQnK4zyHtzbADZS0Z5xxRhD tlTFGrF0uqraYbCAScxVV9nkCXspbeVIKP9rGr9IkEAV84B0xWwf39Dr23HxRX8WdiQV lUE8rmuoNcBFAxEeO/q3+kgS16l6myCH2a45Lk508GU4ZqbL9H4nBzS/XG3kj02B3Igb Nmw6JmHwfNIiiclZc7EA5HDT8VrtBVHIoaAYxbhWPEbcNyCiVjRs7J14ifmrnYDqaWUT uFB3nysfFncmHVwGrqIc+d7HFJ1/6syO9jsR1xtvtVtWQUTqCFNe62QjNZxFUgxT/tyH uQYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=neDlYxKC; 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 r15-20020a2e80cf000000b002b6a164afb5si1843883ljg.372.2023.06.27.17.51.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 17:51:36 -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=neDlYxKC; 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 0736E8662D; Wed, 28 Jun 2023 02:51:10 +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="neDlYxKC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A004186615; Wed, 28 Jun 2023 02:50:20 +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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) (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 959CE8660E for ; Wed, 28 Jun 2023 02:49:53 +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-pl1-x62c.google.com with SMTP id d9443c01a7336-1b816d30140so3336075ad.0 for ; Tue, 27 Jun 2023 17:49:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687913391; x=1690505391; 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=UNec+yYqM/9p8g33e1zRr4zBUrhLWSTWYQhFZ4LteI4=; b=neDlYxKCuRK6RNRI3gAz5sP1GBbDzUp25kUPEeSwV4pH8K+vhDHuVzFoSR4AotA+w/ PK/HimR/DTpmfVyB2wvnpF3xxKEQkHcT2yQU0H4N6cyKPZh9PGkkL9hfnVRy5BT3l1U7 yKJHUrc1kuYU4UTjbhbFmtvlZYZ1/TZbi4lysrokYuY62G28+18u5g8MIPEWzK+/fF7c EoV0plerrz1oeuWb7y7bOxVDuXjtzjC+S05aPgTE22YJoljdph1wljvKREnUVOlaEKdY ZJXF9Ahx2EvNmjunmLY9NnYLd8BkzZaDQ0JHcGsCicYcKWmNsTHiJ7F7AUfmes5HlmFs VBAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687913391; x=1690505391; 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=UNec+yYqM/9p8g33e1zRr4zBUrhLWSTWYQhFZ4LteI4=; b=X/DhxbhqvqlHy2lFdeZ938gbI3Gam86Re21aDB2ub7j6ITEUh7k0ovGZDI+5VGfuuD kcb+XscXWDH1OmvTxPOF98jcwrjBEb5/CnWewFkXOBqjMNvD3D1aua/9yrPqZIXU6vMS LR/PG6GoH2/ZxoVZLZH4mI3kdCJh8VH1ieqcqu8riFWL0JjK1L/ths6OuLDFvwQoY7kh O4t0IURU7vE7uAim99jruWtwuWmamDYhWnAqgbUWF35fuI2W7SzGf34RTX+7J4xj0VJN ZN3iRwp4Ip612nsCVgpzWl/b1miEEzul8GybGT5FR1t7hWXe/bde1m/LLvhY6qKz6LvX c6eg== X-Gm-Message-State: AC+VfDyGRRNcoUopFq3bSoKakaBZ8Z6mAf5W+Zw3icvl/v616b2SmT+H CCxV2267t9VkqBIjIfbL+86fCw== X-Received: by 2002:a17:902:f691:b0:1af:adc2:ab5b with SMTP id l17-20020a170902f69100b001afadc2ab5bmr40801291plg.0.1687913391557; Tue, 27 Jun 2023 17:49:51 -0700 (PDT) Received: from laputa.. ([2400:4050:c3e1:100:58b2:60ed:38ea:8b1f]) by smtp.gmail.com with ESMTPSA id u13-20020a170903124d00b001b3fb2f0296sm6517278plh.120.2023.06.27.17.49.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 17:49:51 -0700 (PDT) From: AKASHI Takahiro To: trini@konsulko.com, sjg@chromium.org Cc: etienne.carriere@st.com, u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH 10/10] test: dm: add scmi command test Date: Wed, 28 Jun 2023 09:48:41 +0900 Message-ID: <20230628004841.21774-11-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230628004841.21774-1-takahiro.akashi@linaro.org> References: <20230628004841.21774-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 In this test, "scmi" with different sub-commands is tested. Please note that scmi command is for debug purpose and is not intended in production system. Signed-off-by: AKASHI Takahiro Reviewed-by: Simon Glass --- test/dm/scmi.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/test/dm/scmi.c b/test/dm/scmi.c index 563017bb63e0..b40c84011295 100644 --- a/test/dm/scmi.c +++ b/test/dm/scmi.c @@ -207,6 +207,63 @@ static int dm_test_scmi_base(struct unit_test_state *uts) DM_TEST(dm_test_scmi_base, UT_TESTF_SCAN_FDT); +static int dm_test_scmi_cmd(struct unit_test_state *uts) +{ + struct udevice *agent_dev, *base; + struct scmi_agent_priv *priv; + + /* preparation */ + ut_assertok(uclass_get_device_by_name(UCLASS_SCMI_AGENT, "scmi", + &agent_dev)); + ut_assertnonnull(agent_dev); + ut_assertnonnull(priv = dev_get_uclass_plat(agent_dev)); + ut_assertnonnull(base = scmi_get_protocol(agent_dev, + SCMI_PROTOCOL_ID_BASE)); + + /* scmi base info */ + ut_assertok(run_command("scmi base info", 0)); + + ut_assert_nextline("SCMI device: scmi"); + ut_assert_nextline(" protocol version: 0x20000"); + ut_assert_nextline(" # of agents: 2"); + ut_assert_nextline(" 0: platform"); + ut_assert_nextline(" > 1: OSPM"); + ut_assert_nextline(" # of protocols: 3"); + ut_assert_nextline(" Clock management"); + ut_assert_nextline(" Reset domain management"); + ut_assert_nextline(" Voltage domain management"); + ut_assert_nextline(" vendor: U-Boot"); + ut_assert_nextline(" sub vendor: Sandbox"); + ut_assert_nextline(" impl version: 0x1"); + + ut_assert_console_end(); + + /* scmi base perm_dev */ + ut_assertok(run_command("scmi base perm_dev 1 0 1", 0)); + ut_assert_console_end(); + + ut_assert(run_command("scmi base perm_dev 1 0 0", 0)); + ut_assert_nextline("Denying access to device:0 failed (-13)"); + ut_assert_console_end(); + + /* scmi base perm_proto */ + ut_assertok(run_command("scmi base perm_proto 1 0 14 1", 0)); + ut_assert_console_end(); + + ut_assert(run_command("scmi base perm_proto 1 0 14 0", 0)); + ut_assert_nextline("Denying access to protocol:0x14 on device:0 failed (-13)"); + ut_assert_console_end(); + + /* scmi base reset */ + ut_assert(run_command("scmi base reset 1 1", 0)); + ut_assert_nextline("Reset failed (-13)"); + ut_assert_console_end(); + + return 0; +} + +DM_TEST(dm_test_scmi_cmd, UT_TESTF_SCAN_FDT); + static int dm_test_scmi_clocks(struct unit_test_state *uts) { struct sandbox_scmi_agent *agent;