From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: Etienne CARRIERE <etienne.carriere@st.com>
Cc: "trini@konsulko.com" <trini@konsulko.com>,
"sjg@chromium.org" <sjg@chromium.org>,
"u-boot@lists.denx.de" <u-boot@lists.denx.de>,
Etienne CARRIERE - foss <etienne.carriere@foss.st.com>
Subject: Re: [PATCH v3 13/13] test: dm: add scmi command test
Date: Mon, 11 Sep 2023 16:22:49 +0900 [thread overview]
Message-ID: <ZP7ASf6h524kQHty@octopus> (raw)
In-Reply-To: <PAXPR10MB4687E186E8A0810CF1784121FDEDA@PAXPR10MB4687.EURPRD10.PROD.OUTLOOK.COM>
On Fri, Sep 08, 2023 at 02:27:15PM +0000, Etienne CARRIERE wrote:
> > From: AKASHI Takahiro <takahiro.akashi@linaro.org>
> > Sent: Friday, September 8, 2023 04:51
> >
> > In this test, "scmi" command is tested against different sub-commands.
> > Please note that scmi command is for debug purpose and is not intended
> > in production system.
> >
> > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> > Reviewed-by: Simon Glass <sjg@chromium.org>
> > Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
> > ---
> > v3
> > * change char to u8 in vendor/agent names
> > v2
> > * use helper functions, removing direct uses of ops
> > ---
>
> This change breaks pytest ut_dm_dm_test_scmi_cmd.
> CONFIG_CMD_SCMI=y is missing in sandbox_defconfig.
Sure.
>
> > test/dm/scmi.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++----
> > 1 file changed, 57 insertions(+), 5 deletions(-)
> >
> > diff --git a/test/dm/scmi.c b/test/dm/scmi.c
> > index 0785948186f0..423b6ef70b29 100644
> > --- a/test/dm/scmi.c
> > +++ b/test/dm/scmi.c
> > @@ -104,8 +104,7 @@ static int dm_test_scmi_base(struct unit_test_state *uts)
> > struct scmi_agent_priv *priv;
> > u32 version, num_agents, num_protocols, impl_version;
> > u32 attributes, agent_id;
> > - char *vendor, *agent_name;
> > - u8 *protocols;
> > + u8 *vendor, *agent_name, *protocols;
>
> Could you squash these fixups into patch 10/13
> ("test: dm: add SCMI base protocol test") unlesswhat that patch
> makes sandbox test build to fail.
Okay.
> > int ret;
> >
> > /* preparation */
> > @@ -134,9 +133,9 @@ static int dm_test_scmi_base(struct unit_test_state *uts)
> > free(vendor);
> >
> > /* message attributes */
> > - ret = scmi_protocol_message_attrs(base,
> > - SCMI_BASE_DISCOVER_SUB_VENDOR,
> > - &attributes);
> > + ret = scmi_base_protocol_message_attrs(base,
> > + SCMI_BASE_DISCOVER_SUB_VENDOR,
> > + &attributes);
>
> Same here.
Yes.
-Takahiro Akashi
> BR,
> etienne
>
> > ut_assertok(ret);
> > ut_assertok(attributes);
> >
> > @@ -207,6 +206,59 @@ 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;
> > +
> > + /* preparation */
> > + ut_assertok(uclass_get_device_by_name(UCLASS_SCMI_AGENT, "scmi",
> > + &agent_dev));
> > + ut_assertnonnull(agent_dev);
> > +
> > + /* scmi info */
> > + ut_assertok(run_command("scmi 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 perm_dev */
> > + ut_assertok(run_command("scmi perm_dev 1 0 1", 0));
> > + ut_assert_console_end();
> > +
> > + ut_assert(run_command("scmi perm_dev 1 0 0", 0));
> > + ut_assert_nextline("Denying access to device:0 failed (-13)");
> > + ut_assert_console_end();
> > +
> > + /* scmi perm_proto */
> > + ut_assertok(run_command("scmi perm_proto 1 0 14 1", 0));
> > + ut_assert_console_end();
> > +
> > + ut_assert(run_command("scmi 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 reset */
> > + ut_assert(run_command("scmi 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;
> > --
> > 2.34.1
> >
prev parent reply other threads:[~2023-09-11 7:23 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-08 2:51 [PATCH v3 00/13] firmware: scmi: add SCMI base protocol support AKASHI Takahiro
2023-09-08 2:51 ` [PATCH v3 01/13] scmi: refactor the code to hide a channel from devices AKASHI Takahiro
2023-09-08 14:01 ` Etienne CARRIERE
2023-09-11 6:43 ` AKASHI Takahiro
2023-09-08 2:51 ` [PATCH v3 02/13] firmware: scmi: implement SCMI base protocol AKASHI Takahiro
2023-09-08 2:51 ` [PATCH v3 03/13] firmware: scmi: move scmi_bind_protocols() backward AKASHI Takahiro
2023-09-08 2:51 ` [PATCH v3 04/13] firmware: scmi: framework for installing additional protocols AKASHI Takahiro
2023-09-08 14:01 ` Etienne CARRIERE
2023-09-11 6:56 ` AKASHI Takahiro
2023-09-08 2:51 ` [PATCH v3 05/13] firmware: scmi: install base protocol to SCMI agent AKASHI Takahiro
2023-09-08 14:02 ` Etienne CARRIERE
2023-09-11 7:07 ` AKASHI Takahiro
2023-09-08 14:19 ` Etienne CARRIERE
2023-09-12 5:18 ` AKASHI Takahiro
2023-09-08 2:51 ` [PATCH v3 06/13] firmware: scmi: add a check against availability of protocols AKASHI Takahiro
2023-09-08 2:51 ` [PATCH v3 07/13] sandbox: remove SCMI base node definition from test.dts AKASHI Takahiro
2023-09-08 2:51 ` [PATCH v3 08/13] firmware: scmi: fake base protocol commands on sandbox AKASHI Takahiro
2023-09-08 2:51 ` [PATCH v3 09/13] test: dm: simplify SCMI unit test " AKASHI Takahiro
2023-09-08 2:51 ` [PATCH v3 10/13] test: dm: add SCMI base protocol test AKASHI Takahiro
2023-09-08 2:51 ` [PATCH v3 11/13] cmd: add scmi command for SCMI firmware AKASHI Takahiro
2023-09-08 2:51 ` [PATCH v3 12/13] doc: cmd: add documentation for scmi AKASHI Takahiro
2023-09-08 2:51 ` [PATCH v3 13/13] test: dm: add scmi command test AKASHI Takahiro
2023-09-08 14:27 ` Etienne CARRIERE
2023-09-11 7:22 ` AKASHI Takahiro [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZP7ASf6h524kQHty@octopus \
--to=takahiro.akashi@linaro.org \
--cc=etienne.carriere@foss.st.com \
--cc=etienne.carriere@st.com \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.