diff options
Diffstat (limited to 'meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000')
-rw-r--r-- | meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0001-UPSTREAM-firmware-arm_ffa-Handle-compatibility-with-.patch | 90 | ||||
-rw-r--r-- | meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0003-Add-rpmsg-driver-for-corstone1000.patch (renamed from meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0003-Add-rpsmg-driver-for-corstone1000.patch) | 4 | ||||
-rw-r--r-- | meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0004-rpmsg-arm-fix-return-value.patch | 35 | ||||
-rw-r--r-- | meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0005-rpmsg-arm-update-chrdev-to-ctrldev-registration.patch | 33 | ||||
-rw-r--r-- | meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0006-Adds-workaround-for-cs1k-specific-bug.patch | 41 | ||||
-rw-r--r-- | meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/defconfig | 1 |
6 files changed, 112 insertions, 92 deletions
diff --git a/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0001-UPSTREAM-firmware-arm_ffa-Handle-compatibility-with-.patch b/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0001-UPSTREAM-firmware-arm_ffa-Handle-compatibility-with-.patch deleted file mode 100644 index a4fd673084..0000000000 --- a/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0001-UPSTREAM-firmware-arm_ffa-Handle-compatibility-with-.patch +++ /dev/null @@ -1,90 +0,0 @@ -Upstream-Status: Backport [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8e3f9da608f14cfebac2659d8dd8737b79d01308] -Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com> - -From a8f3e351c07c48774be2a45e184b9f08dc92f1db Mon Sep 17 00:00:00 2001 -From: Sudeep Holla <sudeep.holla@arm.com> -Date: Wed, 13 Apr 2022 15:43:19 +0100 -Subject: [PATCH] UPSTREAM: firmware: arm_ffa: Handle compatibility with - different firmware versions - -The driver currently just support v1.0 of Arm FFA specification. It also -expects the firmware implementation to match the same and bail out if it -doesn't match. This is causing issue when running with higher version of -firmware implementation(e.g. v1.1 which will released soon). - -In order to support compatibility with different firmware versions, let -us add additional checks and find the compatible version the driver can -work with. - -Link: https://lore.kernel.org/r/20211013091127.990992-1-sudeep.holla@arm.com -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> -Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> -(cherry picked from commit 8e3f9da608f14cfebac2659d8dd8737b79d01308) -Change-Id: I7bc9a3b172a9067bfd4e9bb9d50b4729e915b5a5 -Bug: 168585974 ---- - drivers/firmware/arm_ffa/driver.c | 37 ++++++++++++++++++++++++++----- - 1 file changed, 32 insertions(+), 5 deletions(-) - -diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c -index c9fb56afbcb4..6e0c883ab708 100644 ---- a/drivers/firmware/arm_ffa/driver.c -+++ b/drivers/firmware/arm_ffa/driver.c -@@ -167,6 +167,28 @@ struct ffa_drv_info { - - static struct ffa_drv_info *drv_info; - -+/* -+ * The driver must be able to support all the versions from the earliest -+ * supported FFA_MIN_VERSION to the latest supported FFA_DRIVER_VERSION. -+ * The specification states that if firmware supports a FFA implementation -+ * that is incompatible with and at a greater version number than specified -+ * by the caller(FFA_DRIVER_VERSION passed as parameter to FFA_VERSION), -+ * it must return the NOT_SUPPORTED error code. -+ */ -+static u32 ffa_compatible_version_find(u32 version) -+{ -+ u32 compat_version; -+ u16 major = MAJOR_VERSION(version), minor = MINOR_VERSION(version); -+ u16 drv_major = MAJOR_VERSION(FFA_DRIVER_VERSION); -+ u16 drv_minor = MINOR_VERSION(FFA_DRIVER_VERSION); -+ -+ if ((major < drv_major) || (major == drv_major && minor <= drv_minor)) -+ return version; -+ -+ pr_info("Firmware version higher than driver version, downgrading\n"); -+ return FFA_DRIVER_VERSION; -+} -+ - static int ffa_version_check(u32 *version) - { - ffa_value_t ver; -@@ -180,15 +202,20 @@ static int ffa_version_check(u32 *version) - return -EOPNOTSUPP; - } - -- if (ver.a0 < FFA_MIN_VERSION || ver.a0 > FFA_DRIVER_VERSION) { -- pr_err("Incompatible version %d.%d found\n", -- MAJOR_VERSION(ver.a0), MINOR_VERSION(ver.a0)); -+ if (ver.a0 < FFA_MIN_VERSION) { -+ pr_err("Incompatible v%d.%d! Earliest supported v%d.%d\n", -+ MAJOR_VERSION(ver.a0), MINOR_VERSION(ver.a0), -+ MAJOR_VERSION(FFA_MIN_VERSION), -+ MINOR_VERSION(FFA_MIN_VERSION)); - return -EINVAL; - } - -- *version = ver.a0; -- pr_info("Version %d.%d found\n", MAJOR_VERSION(ver.a0), -+ pr_info("Driver version %d.%d\n", MAJOR_VERSION(FFA_DRIVER_VERSION), -+ MINOR_VERSION(FFA_DRIVER_VERSION)); -+ pr_info("Firmware version %d.%d found\n", MAJOR_VERSION(ver.a0), - MINOR_VERSION(ver.a0)); -+ *version = ffa_compatible_version_find(ver.a0); -+ - return 0; - } - --- -2.17.1 - diff --git a/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0003-Add-rpsmg-driver-for-corstone1000.patch b/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0003-Add-rpmsg-driver-for-corstone1000.patch index d88acfc0f6..809661487d 100644 --- a/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0003-Add-rpsmg-driver-for-corstone1000.patch +++ b/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0003-Add-rpmsg-driver-for-corstone1000.patch @@ -4,9 +4,9 @@ Signed-off-by: Emekcan Aras <emekcan.aras@arm.com> From e683c37ee51717e625c8a598056cf4bb1bdadcbc Mon Sep 17 00:00:00 2001 From: Emekcan <emekcan.aras@arm.com> Date: Wed, 17 Aug 2022 14:21:42 +0100 -Subject: [PATCH] Add rpsmg driver for corstone1000 +Subject: [PATCH] Add rpmsg driver for corstone1000 -Adds rpsmg driver to communicate with external +Adds rpmsg driver to communicate with external system in corstone1000 platform. Signed-off-by: Emekcan Aras <emekcan.aras@arm.com> diff --git a/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0004-rpmsg-arm-fix-return-value.patch b/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0004-rpmsg-arm-fix-return-value.patch new file mode 100644 index 0000000000..2074768869 --- /dev/null +++ b/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0004-rpmsg-arm-fix-return-value.patch @@ -0,0 +1,35 @@ +Upstream-Status: Pending [Not submitted to upstream yet] +Signed-off-by: Rui Miguel Silva <rui.silva@arm.com> + +From 1426dd2b541cb51741bffbd95191ae5593e1749d Mon Sep 17 00:00:00 2001 +From: Rui Miguel Silva <rui.silva@linaro.org> +Date: Tue, 27 Sep 2022 10:05:27 +0100 +Subject: [PATCH 1/2] rpmsg: arm: fix return value + +The creation of and endpoint returns a pointer, fix the return +value to the right type. + +Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> +--- + drivers/rpmsg/rpmsg_arm_mailbox.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/rpmsg/rpmsg_arm_mailbox.c b/drivers/rpmsg/rpmsg_arm_mailbox.c +index 4a80102669f6..5c0dcc8e353d 100644 +--- a/drivers/rpmsg/rpmsg_arm_mailbox.c ++++ b/drivers/rpmsg/rpmsg_arm_mailbox.c +@@ -103,8 +103,9 @@ static struct rpmsg_endpoint *arm_create_ept(struct rpmsg_device *rpdev, + + channel->mbox = mbox_request_channel_byname(&channel->cl, chinfo.name); + if (IS_ERR_OR_NULL(channel->mbox)) { +- printk("RPMsg ARM: Cannot get channel by name: '%s'\n", chinfo.name); +- return -1; ++ printk("RPMsg ARM: Cannot get channel by name: %s\n", ++ chinfo.name); ++ return ERR_PTR(-ENOENT); + } + + return &channel->ept; +-- +2.37.3 + diff --git a/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0005-rpmsg-arm-update-chrdev-to-ctrldev-registration.patch b/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0005-rpmsg-arm-update-chrdev-to-ctrldev-registration.patch new file mode 100644 index 0000000000..504fa676c5 --- /dev/null +++ b/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0005-rpmsg-arm-update-chrdev-to-ctrldev-registration.patch @@ -0,0 +1,33 @@ +Upstream-Status: Pending [Not submitted to upstream yet] +Signed-off-by: Rui Miguel Silva <rui.silva@arm.com> + +From 20cd41fee8e4638eb47072b91d9a9f985730583b Mon Sep 17 00:00:00 2001 +From: Rui Miguel Silva <rui.silva@linaro.org> +Date: Tue, 27 Sep 2022 10:07:21 +0100 +Subject: [PATCH 2/2] rpmsg: arm: update chrdev to ctrldev registration + +Since "rpmsg: Update rpmsg_chrdev_register_device function", +there was a replacement of the chrdev driver to ctrldev +driver. Fix the registration. + +Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> +--- + drivers/rpmsg/rpmsg_arm_mailbox.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/rpmsg/rpmsg_arm_mailbox.c b/drivers/rpmsg/rpmsg_arm_mailbox.c +index 5c0dcc8e353d..90bc8df90885 100644 +--- a/drivers/rpmsg/rpmsg_arm_mailbox.c ++++ b/drivers/rpmsg/rpmsg_arm_mailbox.c +@@ -142,7 +142,7 @@ static int client_probe(struct platform_device *pdev) + rpdev->dev.parent = dev; + rpdev->dev.release = arm_release_device; + +- return rpmsg_chrdev_register_device(rpdev); ++ return rpmsg_ctrldev_register_device(rpdev); + } + + static const struct of_device_id client_of_match[] = { +-- +2.37.3 + diff --git a/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0006-Adds-workaround-for-cs1k-specific-bug.patch b/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0006-Adds-workaround-for-cs1k-specific-bug.patch new file mode 100644 index 0000000000..5cd8e4b0d1 --- /dev/null +++ b/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0006-Adds-workaround-for-cs1k-specific-bug.patch @@ -0,0 +1,41 @@ +Upstream-Status: Inappropriate[Temporary bugfix] +Signed-off-by: Emekcan Aras <emekcan.aras@arm.com> + +From f1a869ea986305a6fb20f3c770c11778a898b86d Mon Sep 17 00:00:00 2001 +From: Emekcan <emekcan.aras@arm.com> +Date: Thu, 13 Oct 2022 20:53:42 +0100 +Subject: [PATCH] Adds workaround for cs1k specific bug + +Adds a temporary workaround to solve a possible +race-conditioning issue in the tee driver +for corstone1000. + +Signed-off-by: Emekcan Aras <emekcan.aras@arm.com> +--- + drivers/firmware/arm_ffa/driver.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c +index ec731e9e942b..2a3ef649935e 100644 +--- a/drivers/firmware/arm_ffa/driver.c ++++ b/drivers/firmware/arm_ffa/driver.c +@@ -32,6 +32,7 @@ + #include <linux/scatterlist.h> + #include <linux/slab.h> + #include <linux/uuid.h> ++#include <linux/delay.h> + + #include "common.h" + +@@ -344,7 +345,7 @@ static int ffa_msg_send_direct_req(u16 src_id, u16 dst_id, bool mode_32bit, + { + u32 req_id, resp_id, src_dst_ids = PACK_TARGET_INFO(src_id, dst_id); + ffa_value_t ret; +- ++ msleep(1); + if (mode_32bit) { + req_id = FFA_MSG_SEND_DIRECT_REQ; + resp_id = FFA_MSG_SEND_DIRECT_RESP; +-- +2.17.1 + diff --git a/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/defconfig b/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/defconfig index 3fe7a03877..f6e6409cea 100644 --- a/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/defconfig +++ b/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/defconfig @@ -97,3 +97,4 @@ CONFIG_ARM_MHU_V2=y CONFIG_RPMSG=y CONFIG_RPMSG_CHAR=y CONFIG_RPMSG_ARM=y +CONFIG_RPMSG_CTRL=y |