blob: 5c437232df65d3d6fb1e21f42ea51c55daa8a35d [file] [log] [blame]
Patrick Williams8dd68482022-10-04 07:57:18 -05001From 47be0456ea1760837d2de857e57842e595e9ea5e Mon Sep 17 00:00:00 2001
2From: Davidson K <davidson.kumaresan@arm.com>
3Date: Mon, 27 Jun 2022 14:11:27 +0530
4Subject: [PATCH 7/7] arm_ffa: unmap rxtx buffer before exiting u-boot
5
6The linux kernel ffa driver will be used after the kernel boots. It
7will try to map its own rxtx buffer. But there can be only one rxtx
8buffer mapped from the non secure world. Since the rxtx buffer of
9the u-boot is no longer used and we have to map the rxtx buffer of
10the linux kernel, the rxtx buffer of the u-boot should be unmapped.
11
12This will not be needed after the efi runtime services are enabled
13
14Signed-off-by: Davidson K <davidson.kumaresan@arm.com>
15Change-Id: I9deb6283d81f791185aa0a32d205b394d6d91f76
16Upstream-Status: Pending [Not submitted to upstream yet]
17---
18 drivers/arm-ffa/core.c | 12 ++++++++++++
19 1 file changed, 12 insertions(+)
20
21diff --git a/drivers/arm-ffa/core.c b/drivers/arm-ffa/core.c
22index 98e2d2fa17..0c619439cb 100644
23--- a/drivers/arm-ffa/core.c
24+++ b/drivers/arm-ffa/core.c
25@@ -1470,6 +1470,16 @@ static const struct udevice_id ffa_match_id[] = {
26 {},
27 };
28
29+/**
30+ * Unmap the rxtx buffer before exiting u-boot
31+ * This avoids conflicts with the linux kernel ffa driver
32+ */
33+
34+static int ffa_remove(struct udevice *dev)
35+{
36+ return ffa_unmap_rxtx_buffers();
37+}
38+
39 /**
40 * Declaring the arm_ffa driver under UCLASS_FFA
41 */
42@@ -1481,4 +1491,6 @@ U_BOOT_DRIVER(arm_ffa) = {
43 .of_to_plat = ffa_of_to_plat,
44 .probe = ffa_probe,
45 .plat_auto = sizeof(struct ffa_pdata),
46+ .remove = ffa_remove,
47+ .flags = DM_FLAG_OS_PREPARE,
48 };
49--
502.34.1
51