DONOTSUBMIT Started adding userspace kselftest for FF-A.

Change-Id: I96a0cd2ea3c10e399cc14d809a58ce7205069c3f
diff --git a/tools/testing/selftests/arm64/Makefile b/tools/testing/selftests/arm64/Makefile
index ced910f..324e9db 100644
--- a/tools/testing/selftests/arm64/Makefile
+++ b/tools/testing/selftests/arm64/Makefile
@@ -4,7 +4,7 @@
 ARCH ?= $(shell uname -m 2>/dev/null || echo not)
 
 ifneq (,$(filter $(ARCH),aarch64 arm64))
-ARM64_SUBTARGETS ?= tags signal pauth fp mte bti
+ARM64_SUBTARGETS ?= tags signal pauth ffa fp mte bti
 else
 ARM64_SUBTARGETS :=
 endif
diff --git a/tools/testing/selftests/arm64/ffa/.gitignore b/tools/testing/selftests/arm64/ffa/.gitignore
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tools/testing/selftests/arm64/ffa/.gitignore
diff --git a/tools/testing/selftests/arm64/ffa/Makefile b/tools/testing/selftests/arm64/ffa/Makefile
new file mode 100644
index 0000000..0727355
--- /dev/null
+++ b/tools/testing/selftests/arm64/ffa/Makefile
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (C) 2021 - Google LLC
+
+CFLAGS += -std=gnu99 -I. -lpthread
+SRCS := $(wildcard *.c)
+PROGS := $(patsubst %.c,%,$(SRCS))
+
+# Generated binaries to be installed by top KSFT script
+TEST_GEN_PROGS := $(PROGS)
+
+# Get Kernel headers installed and use them.
+KSFT_KHDR_INSTALL := 1
+
+# Include KSFT lib.mk.
+include ../../lib.mk
diff --git a/tools/testing/selftests/arm64/ffa/ffa-get-version.c b/tools/testing/selftests/arm64/ffa/ffa-get-version.c
new file mode 100644
index 0000000..a5955ee
--- /dev/null
+++ b/tools/testing/selftests/arm64/ffa/ffa-get-version.c
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (C) 2021 - Google LLC
+ * Author: Andrew Walbran <qwandor@google.com>
+ */
+
+#include "../../kselftest.h"
+
+int main(int argc, char **argv)
+{
+	ksft_print_header();
+        ksft_set_plan(1);
+
+        // TODO: Install test kernel module
+        // TODO: Use custom ioctl to call FFA_VERSION and get response
+        // TODO: Use custom ioctl to call FFA_FN64_RXTX_MAP and get response
+
+        ksft_test_result_fail("Some error");
+
+	ksft_exit_pass();
+
+        return 0;
+}