Patrick Williams | 8dd6848 | 2022-10-04 07:57:18 -0500 | [diff] [blame^] | 1 | From 47be0456ea1760837d2de857e57842e595e9ea5e Mon Sep 17 00:00:00 2001 |
| 2 | From: Davidson K <davidson.kumaresan@arm.com> |
| 3 | Date: Mon, 27 Jun 2022 14:11:27 +0530 |
| 4 | Subject: [PATCH 7/7] arm_ffa: unmap rxtx buffer before exiting u-boot |
| 5 | |
| 6 | The linux kernel ffa driver will be used after the kernel boots. It |
| 7 | will try to map its own rxtx buffer. But there can be only one rxtx |
| 8 | buffer mapped from the non secure world. Since the rxtx buffer of |
| 9 | the u-boot is no longer used and we have to map the rxtx buffer of |
| 10 | the linux kernel, the rxtx buffer of the u-boot should be unmapped. |
| 11 | |
| 12 | This will not be needed after the efi runtime services are enabled |
| 13 | |
| 14 | Signed-off-by: Davidson K <davidson.kumaresan@arm.com> |
| 15 | Change-Id: I9deb6283d81f791185aa0a32d205b394d6d91f76 |
| 16 | Upstream-Status: Pending [Not submitted to upstream yet] |
| 17 | --- |
| 18 | drivers/arm-ffa/core.c | 12 ++++++++++++ |
| 19 | 1 file changed, 12 insertions(+) |
| 20 | |
| 21 | diff --git a/drivers/arm-ffa/core.c b/drivers/arm-ffa/core.c |
| 22 | index 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 | -- |
| 50 | 2.34.1 |
| 51 | |