Revert "Merge branch '2023-07-24-introduce-FF-A-suppport'"

This reverts commit d927d1a80843e1c3e2a3f0b8f6150790bef83da1, reversing
changes made to c07ad9520c6190070513016fdb495d4703a4a853.

These changes do not pass CI currently.

Signed-off-by: Tom Rini <trini@konsulko.com>
diff --git a/arch/arm/cpu/armv8/smccc-call.S b/arch/arm/cpu/armv8/smccc-call.S
index 93f66d3..dc92b28 100644
--- a/arch/arm/cpu/armv8/smccc-call.S
+++ b/arch/arm/cpu/armv8/smccc-call.S
@@ -1,11 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (c) 2015, Linaro Limited
- * Copyright 2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
- *
- * Authors:
- *   Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
-*/
+ */
 #include <linux/linkage.h>
 #include <linux/arm-smccc.h>
 #include <generated/asm-offsets.h>
@@ -49,54 +45,3 @@
 ENTRY(__arm_smccc_hvc)
 	SMCCC	hvc
 ENDPROC(__arm_smccc_hvc)
-
-#ifdef CONFIG_ARM64
-
-	.macro SMCCC_1_2 instr
-	/* Save `res` and free a GPR that won't be clobbered */
-	stp     x1, x19, [sp, #-16]!
-
-	/* Ensure `args` won't be clobbered while loading regs in next step */
-	mov	x19, x0
-
-	/* Load the registers x0 - x17 from the struct arm_smccc_1_2_regs */
-	ldp	x0, x1, [x19, #ARM_SMCCC_1_2_REGS_X0_OFFS]
-	ldp	x2, x3, [x19, #ARM_SMCCC_1_2_REGS_X2_OFFS]
-	ldp	x4, x5, [x19, #ARM_SMCCC_1_2_REGS_X4_OFFS]
-	ldp	x6, x7, [x19, #ARM_SMCCC_1_2_REGS_X6_OFFS]
-	ldp	x8, x9, [x19, #ARM_SMCCC_1_2_REGS_X8_OFFS]
-	ldp	x10, x11, [x19, #ARM_SMCCC_1_2_REGS_X10_OFFS]
-	ldp	x12, x13, [x19, #ARM_SMCCC_1_2_REGS_X12_OFFS]
-	ldp	x14, x15, [x19, #ARM_SMCCC_1_2_REGS_X14_OFFS]
-	ldp	x16, x17, [x19, #ARM_SMCCC_1_2_REGS_X16_OFFS]
-
-	\instr #0
-
-	/* Load the `res` from the stack */
-	ldr	x19, [sp]
-
-	/* Store the registers x0 - x17 into the result structure */
-	stp	x0, x1, [x19, #ARM_SMCCC_1_2_REGS_X0_OFFS]
-	stp	x2, x3, [x19, #ARM_SMCCC_1_2_REGS_X2_OFFS]
-	stp	x4, x5, [x19, #ARM_SMCCC_1_2_REGS_X4_OFFS]
-	stp	x6, x7, [x19, #ARM_SMCCC_1_2_REGS_X6_OFFS]
-	stp	x8, x9, [x19, #ARM_SMCCC_1_2_REGS_X8_OFFS]
-	stp	x10, x11, [x19, #ARM_SMCCC_1_2_REGS_X10_OFFS]
-	stp	x12, x13, [x19, #ARM_SMCCC_1_2_REGS_X12_OFFS]
-	stp	x14, x15, [x19, #ARM_SMCCC_1_2_REGS_X14_OFFS]
-	stp	x16, x17, [x19, #ARM_SMCCC_1_2_REGS_X16_OFFS]
-
-	/* Restore original x19 */
-	ldp     xzr, x19, [sp], #16
-	ret
-	.endm
-
-/*
- * void arm_smccc_1_2_smc(const struct arm_smccc_1_2_regs *args,
- *			  struct arm_smccc_1_2_regs *res);
- */
-ENTRY(arm_smccc_1_2_smc)
-	SMCCC_1_2 smc
-ENDPROC(arm_smccc_1_2_smc)
-
-#endif
diff --git a/arch/arm/lib/asm-offsets.c b/arch/arm/lib/asm-offsets.c
index 181a8ac..6de0ce9 100644
--- a/arch/arm/lib/asm-offsets.c
+++ b/arch/arm/lib/asm-offsets.c
@@ -9,11 +9,6 @@
  * generate asm statements containing #defines,
  * compile this file to assembler, and then extract the
  * #defines from the assembly-language output.
- *
- * 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>
@@ -95,17 +90,6 @@
 	DEFINE(ARM_SMCCC_RES_X2_OFFS, offsetof(struct arm_smccc_res, a2));
 	DEFINE(ARM_SMCCC_QUIRK_ID_OFFS, offsetof(struct arm_smccc_quirk, id));
 	DEFINE(ARM_SMCCC_QUIRK_STATE_OFFS, offsetof(struct arm_smccc_quirk, state));
-#ifdef CONFIG_ARM64
-	DEFINE(ARM_SMCCC_1_2_REGS_X0_OFFS,	offsetof(struct arm_smccc_1_2_regs, a0));
-	DEFINE(ARM_SMCCC_1_2_REGS_X2_OFFS,	offsetof(struct arm_smccc_1_2_regs, a2));
-	DEFINE(ARM_SMCCC_1_2_REGS_X4_OFFS,	offsetof(struct arm_smccc_1_2_regs, a4));
-	DEFINE(ARM_SMCCC_1_2_REGS_X6_OFFS,	offsetof(struct arm_smccc_1_2_regs, a6));
-	DEFINE(ARM_SMCCC_1_2_REGS_X8_OFFS,	offsetof(struct arm_smccc_1_2_regs, a8));
-	DEFINE(ARM_SMCCC_1_2_REGS_X10_OFFS,	offsetof(struct arm_smccc_1_2_regs, a10));
-	DEFINE(ARM_SMCCC_1_2_REGS_X12_OFFS,	offsetof(struct arm_smccc_1_2_regs, a12));
-	DEFINE(ARM_SMCCC_1_2_REGS_X14_OFFS,	offsetof(struct arm_smccc_1_2_regs, a14));
-	DEFINE(ARM_SMCCC_1_2_REGS_X16_OFFS,	offsetof(struct arm_smccc_1_2_regs, a16));
-#endif
 #endif
 
 	return 0;
diff --git a/arch/sandbox/dts/sandbox.dtsi b/arch/sandbox/dts/sandbox.dtsi
index 8aaf911..f0ee0b3 100644
--- a/arch/sandbox/dts/sandbox.dtsi
+++ b/arch/sandbox/dts/sandbox.dtsi
@@ -451,15 +451,6 @@
 	thermal {
 		compatible = "sandbox,thermal";
 	};
-
-	arm-ffa-emul {
-		compatible = "sandbox,arm-ffa-emul";
-
-		sandbox-arm-ffa {
-				compatible = "sandbox,arm-ffa";
-		};
-	};
-
 };
 
 &cros_ec {
diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index f351d5c..b5509ee 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -1831,14 +1831,6 @@
 	extcon {
 		compatible = "sandbox,extcon";
 	};
-
-	arm-ffa-emul {
-		compatible = "sandbox,arm-ffa-emul";
-
-		sandbox-arm-ffa {
-				compatible = "sandbox,arm-ffa";
-		};
-	};
 };
 
 #include "sandbox_pmic.dtsi"
diff --git a/arch/sandbox/include/asm/sandbox_arm_ffa.h b/arch/sandbox/include/asm/sandbox_arm_ffa.h
deleted file mode 100644
index be2790f..0000000
--- a/arch/sandbox/include/asm/sandbox_arm_ffa.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright 2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
- *
- * Authors:
- *   Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
- */
-
-#ifndef __SANDBOX_ARM_FFA_H
-#define __SANDBOX_ARM_FFA_H
-
-#include <arm_ffa.h>
-
-/*
- * This header provides public sandbox FF-A emulator declarations
- * and declarations needed by FF-A sandbox clients
- */
-
-/* UUIDs strings of the emulated services */
-#define SANDBOX_SERVICE1_UUID	"ed32d533-4209-99e6-2d72-cdd998a79cc0"
-#define SANDBOX_SERVICE2_UUID	"ed32d544-4209-99e6-2d72-cdd998a79cc0"
-
-/* IDs of the emulated secure partitions (SPs) */
-#define SANDBOX_SP1_ID 0x1245
-#define SANDBOX_SP2_ID 0x9836
-#define SANDBOX_SP3_ID 0x6452
-#define SANDBOX_SP4_ID 0x7814
-
-/* Invalid service UUID (no matching SP) */
-#define SANDBOX_SERVICE3_UUID	"55d532ed-0942-e699-722d-c09ca798d9cd"
-
-/* Invalid service UUID (invalid UUID string format) */
-#define SANDBOX_SERVICE4_UUID	"32ed-0942-e699-722d-c09ca798d9cd"
-
-/* Number of valid services */
-#define SANDBOX_SP_COUNT_PER_VALID_SERVICE	2
-
-/**
- * struct ffa_sandbox_data - query ABI state data structure
- * @data0_size:	size of the first argument
- * @data0:	pointer to the first argument
- * @data1_size>:	size of the second argument
- * @data1:	pointer to the second argument
- *
- * Used to pass various types of data with different sizes between
- * the test cases and the sandbox emulator.
- * The data is for querying FF-A ABIs state.
- */
-struct ffa_sandbox_data {
-	u32 data0_size; /* size of the first argument */
-	void *data0; /* pointer to the first argument */
-	u32 data1_size; /* size of the second argument */
-	void *data1; /* pointer to the second argument */
-};
-
-/* The sandbox FF-A  emulator public functions */
-
-/**
- * sandbox_query_ffa_emul_state() - Inspect the FF-A ABIs
- * @queried_func_id:	The FF-A function to be queried
- * @func_data:  Pointer to the FF-A function arguments container structure
- *
- * Query the status of FF-A ABI specified in the input argument.
- *
- * Return:
- *
- * 0 on success. Otherwise, failure
- */
-int sandbox_query_ffa_emul_state(u32 queried_func_id,
-				 struct ffa_sandbox_data *func_data);
-
-#endif
diff --git a/arch/sandbox/include/asm/sandbox_arm_ffa_priv.h b/arch/sandbox/include/asm/sandbox_arm_ffa_priv.h
deleted file mode 100644
index b088182..0000000
--- a/arch/sandbox/include/asm/sandbox_arm_ffa_priv.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright 2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
- *
- * Authors:
- *   Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
- */
-
-#ifndef __SANDBOX_ARM_FFA_PRV_H
-#define __SANDBOX_ARM_FFA_PRV_H
-
-#include <arm_ffa_priv.h>
-
-/* This header is exclusively used by the Sandbox FF-A driver and emulator */
-
-/* Non-secure physical FF-A instance */
-#define NS_PHYS_ENDPOINT_ID (0)
-
-#define GET_NS_PHYS_ENDPOINT_ID_MASK		GENMASK(31, 16)
-#define GET_NS_PHYS_ENDPOINT_ID(x)		\
-			((u16)(FIELD_GET(GET_NS_PHYS_ENDPOINT_ID_MASK, (x))))
-
-/* Helper macro for reading the destination partition ID */
-#define GET_DST_SP_ID_MASK		GENMASK(15, 0)
-#define GET_DST_SP_ID(x)		\
-			((u16)(FIELD_GET(GET_DST_SP_ID_MASK, (x))))
-
-/* Helper macro for setting the source partition ID */
-#define PREP_SRC_SP_ID_MASK		GENMASK(31, 16)
-#define PREP_SRC_SP_ID(x)		\
-			(FIELD_PREP(PREP_SRC_SP_ID_MASK, (x)))
-
-/* Helper macro for setting the destination endpoint ID */
-#define PREP_NS_PHYS_ENDPOINT_ID_MASK		GENMASK(15, 0)
-#define PREP_NS_PHYS_ENDPOINT_ID(x)		\
-			(FIELD_PREP(PREP_NS_PHYS_ENDPOINT_ID_MASK, (x)))
-
-/*  RX/TX buffers minimum size */
-#define RXTX_BUFFERS_MIN_SIZE (RXTX_4K)
-#define RXTX_BUFFERS_MIN_PAGES (1)
-
-/* MBZ registers info */
-
-/* x1-x7 MBZ */
-#define FFA_X1X7_MBZ_CNT (7)
-#define FFA_X1X7_MBZ_REG_START (&res->a1)
-
-/* x4-x7 MBZ */
-#define FFA_X4X7_MBZ_CNT (4)
-#define FFA_X4X7_MBZ_REG_START (&res->a4)
-
-/* x3-x7 MBZ */
-#define FFA_X3X7_MBZ_CNT (5)
-#define FFA_X3_MBZ_REG_START (&res->a3)
-
-/* number of emulated FF-A secure partitions (SPs) */
-#define SANDBOX_PARTITIONS_CNT (4)
-
-/* Binary data of the emulated services UUIDs */
-
-/* service 1  UUID binary data (little-endian format) */
-#define SANDBOX_SERVICE1_UUID_A1	0xed32d533
-#define SANDBOX_SERVICE1_UUID_A2	0x99e64209
-#define SANDBOX_SERVICE1_UUID_A3	0x9cc02d72
-#define SANDBOX_SERVICE1_UUID_A4	0xcdd998a7
-
-/* service 2  UUID binary data (little-endian format) */
-#define SANDBOX_SERVICE2_UUID_A1	0xed32d544
-#define SANDBOX_SERVICE2_UUID_A2	0x99e64209
-#define SANDBOX_SERVICE2_UUID_A3	0x9cc02d72
-#define SANDBOX_SERVICE2_UUID_A4	0xcdd998a7
-
-/**
- * struct ffa_rxtxpair_info - structure hosting the RX/TX buffers flags
- * @rxbuf_owned:	RX buffer ownership flag (the owner is non secure world)
- * @rxbuf_mapped:	RX buffer mapping flag
- * @txbuf_owned	TX buffer ownership flag
- * @txbuf_mapped:	TX buffer mapping flag
- * @rxtx_buf_size:	RX/TX buffers size
- *
- * Hosts the ownership/mapping flags of the RX/TX buffers
- * When a buffer is owned/mapped its corresponding flag is set to 1 otherwise 0.
- */
-struct ffa_rxtxpair_info {
-	u8 rxbuf_owned;
-	u8 rxbuf_mapped;
-	u8 txbuf_owned;
-	u8 txbuf_mapped;
-	u32 rxtx_buf_size;
-};
-
-/**
- * struct sandbox_ffa_emul - emulator data
- *
- * @fwk_version:	FF-A framework version
- * @id:	u-boot endpoint ID
- * @partitions:	The partitions descriptors structure
- * @pair:	The RX/TX buffers pair
- * @pair_info:	The RX/TX buffers pair flags and size
- * @test_ffa_data:	The data of the FF-A bus under test
- *
- * Hosts all the emulated secure world data.
- */
-struct sandbox_ffa_emul {
-	u32 fwk_version;
-	u16 id;
-	struct ffa_partitions partitions;
-	struct ffa_rxtxpair pair;
-	struct ffa_rxtxpair_info pair_info;
-};
-
-/**
- * ffa_emul_find() - Finds the FF-A emulator
- * @dev:	the sandbox FF-A device (sandbox-arm-ffa)
- * @emulp:	the FF-A emulator device (sandbox-ffa-emul)
- * Return:
- * 0 on success. Otherwise, failure
- */
-int ffa_emul_find(struct udevice *dev, struct udevice **emulp);
-
-#endif