]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm_ffa: introduce armffa command Sandbox test
authorAbdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Thu, 13 Jul 2023 13:28:45 +0000 (14:28 +0100)
committerTom Rini <trini@konsulko.com>
Mon, 24 Jul 2023 19:30:03 +0000 (15:30 -0400)
Add Sandbox test for the armffa command

Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Jens Wiklander <jens.wiklander@linaro.org>
MAINTAINERS
test/cmd/Makefile
test/cmd/armffa.c [new file with mode: 0644]

index 4e47c41db14111b08ed26f33319629769c1822b8..61089a28e28819f0ede883ba7e78d85d97361c8a 100644 (file)
@@ -276,6 +276,7 @@ F:  doc/arch/arm64.ffa.rst
 F:     doc/usage/cmd/armffa.rst
 F:     drivers/firmware/arm-ffa/
 F:     include/arm_ffa.h
+F:     test/cmd/armffa.c
 F:     test/dm/ffa.c
 
 ARM FREESCALE IMX
index a3cf983739e757debb6f691a9346ed6d582224b5..6e3d7e919ef26808e51db14ad15f4dc9cb1f3ef6 100644 (file)
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 # Copyright (c) 2013 Google, Inc
+# Copyright 2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
 
 ifdef CONFIG_HUSH_PARSER
 obj-$(CONFIG_CONSOLE_RECORD) += test_echo.o
@@ -24,6 +25,7 @@ obj-$(CONFIG_CMD_SEAMA) += seama.o
 ifdef CONFIG_SANDBOX
 obj-$(CONFIG_CMD_READ) += rw.o
 obj-$(CONFIG_CMD_SETEXPR) += setexpr.o
+obj-$(CONFIG_ARM_FFA_TRANSPORT) += armffa.o
 endif
 obj-$(CONFIG_CMD_TEMPERATURE) += temperature.o
 obj-$(CONFIG_CMD_WGET) += wget.o
diff --git a/test/cmd/armffa.c b/test/cmd/armffa.c
new file mode 100644 (file)
index 0000000..9a44a39
--- /dev/null
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Test for armffa command
+ *
+ * Copyright 2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
+ *
+ * Authors:
+ *   Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
+ */
+
+#include <common.h>
+#include <string.h>
+#include <asm/sandbox_arm_ffa.h>
+#include <dm/test.h>
+#include <test/test.h>
+#include <test/ut.h>
+
+/* Basic test of 'armffa' command */
+static int dm_test_armffa_cmd(struct unit_test_state *uts)
+{
+       /* armffa getpart <UUID> */
+       ut_assertok(run_command("armffa getpart " SANDBOX_SERVICE1_UUID, 0));
+
+       /* armffa ping <ID> */
+       ut_assertok(run_commandf("armffa ping 0x%x", SANDBOX_SP1_ID));
+
+       /* armffa devlist */
+       ut_assertok(run_command("armffa devlist", 0));
+
+       return 0;
+}
+
+DM_TEST(dm_test_armffa_cmd, UT_TESTF_SCAN_FDT | UT_TESTF_CONSOLE_REC);