diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2022-08-03 16:55:16 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2022-08-03 17:56:03 +0300 |
commit | bec4ebc22c43c1ff5c3fddb820d44a88bd3aebf0 (patch) | |
tree | cd378e3e0eaff8fe11880bd397f41671e2347a39 /meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000 | |
parent | 79161d7a7126cad324ff0c11a93d8e57d80203ed (diff) | |
download | openbmc-bec4ebc22c43c1ff5c3fddb820d44a88bd3aebf0.tar.xz |
Import 80d60e7 from yoctoproject.org meta-arm
To support ARMv8 SoCs.
meta-arm has several patch files. Since they are maintained by the
upstream meta-arm community, add meta-arm to the ignore list in
run-repotest.
Change-Id: Ia87a2e947bbabd347d256eccc47a343e1c885479
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000')
3 files changed, 187 insertions, 0 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 new file mode 100644 index 0000000000..a4fd673084 --- /dev/null +++ b/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/0001-UPSTREAM-firmware-arm_ffa-Handle-compatibility-with-.patch @@ -0,0 +1,90 @@ +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/corstone1000_kernel_debug.cfg b/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/corstone1000_kernel_debug.cfg new file mode 100644 index 0000000000..aad9e93a64 --- /dev/null +++ b/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/corstone1000_kernel_debug.cfg @@ -0,0 +1,3 @@ +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_KERNEL=y +CONFIG_DEBUG_INFO_DWARF4=y 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 new file mode 100644 index 0000000000..5f0a7e9198 --- /dev/null +++ b/meta-arm/meta-arm-bsp/recipes-kernel/linux/files/corstone1000/defconfig @@ -0,0 +1,94 @@ +CONFIG_LOCALVERSION="-yocto-standard" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_HIGH_RES_TIMERS=y +CONFIG_PREEMPT=y +CONFIG_LOG_BUF_SHIFT=13 +CONFIG_LOG_CPU_MAX_BUF_SHIFT=13 +CONFIG_RELAY=y +CONFIG_BOOT_CONFIG=y +CONFIG_ARCH_VEXPRESS=y +CONFIG_CMDLINE="console=ttyAMA0 loglevel=9" +CONFIG_EFI=y +# CONFIG_SUSPEND is not set +CONFIG_ARM_FFA_TRANSPORT=y +CONFIG_EFI_BOOTLOADER_CONTROL=y +CONFIG_EFI_CAPSULE_LOADER=y +CONFIG_EFI_TEST=y +CONFIG_RESET_ATTACK_MITIGATION=y +# CONFIG_STACKPROTECTOR is not set +CONFIG_MODULES=y +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +CONFIG_SYN_COOKIES=y +CONFIG_NET_SCHED=y +CONFIG_DEVTMPFS=y +CONFIG_SCSI=y +CONFIG_BLK_DEV_SD=y +CONFIG_NETDEVICES=y +# CONFIG_NET_VENDOR_ALACRITECH is not set +# CONFIG_NET_VENDOR_AMAZON is not set +# CONFIG_NET_VENDOR_AMD is not set +# CONFIG_NET_VENDOR_AQUANTIA is not set +# CONFIG_NET_VENDOR_ARC is not set +# CONFIG_NET_VENDOR_BROADCOM is not set +# CONFIG_NET_VENDOR_CADENCE is not set +# CONFIG_NET_VENDOR_CAVIUM is not set +# CONFIG_NET_VENDOR_CORTINA is not set +# CONFIG_NET_VENDOR_EZCHIP is not set +# CONFIG_NET_VENDOR_GOOGLE is not set +# CONFIG_NET_VENDOR_HISILICON is not set +# CONFIG_NET_VENDOR_HUAWEI is not set +# CONFIG_NET_VENDOR_INTEL is not set +# CONFIG_NET_VENDOR_MARVELL is not set +# CONFIG_NET_VENDOR_MICREL is not set +# CONFIG_NET_VENDOR_MICROCHIP is not set +# CONFIG_NET_VENDOR_MICROSEMI is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +# CONFIG_NET_VENDOR_NETRONOME is not set +# CONFIG_NET_VENDOR_NI is not set +# CONFIG_NET_VENDOR_PENSANDO is not set +# CONFIG_NET_VENDOR_QUALCOMM is not set +# CONFIG_NET_VENDOR_RENESAS is not set +# CONFIG_NET_VENDOR_ROCKER is not set +# CONFIG_NET_VENDOR_SAMSUNG is not set +# CONFIG_NET_VENDOR_SEEQ is not set +# CONFIG_NET_VENDOR_SOLARFLARE is not set +CONFIG_SMC91X=y +CONFIG_SMSC911X=y +# CONFIG_NET_VENDOR_SOCIONEXT is not set +# CONFIG_NET_VENDOR_STMICRO is not set +# CONFIG_NET_VENDOR_SYNOPSYS is not set +# CONFIG_NET_VENDOR_VIA is not set +# CONFIG_NET_VENDOR_WIZNET is not set +# CONFIG_NET_VENDOR_XILINX is not set +# CONFIG_SERIO_SERPORT is not set +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_USB=y +CONFIG_USB_STORAGE=y +CONFIG_USB_UAS=y +CONFIG_USB_ISP1760=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_PL031=y +CONFIG_TEE=y +CONFIG_OPTEE=y +CONFIG_VFAT_FS=y +CONFIG_TMPFS=y +CONFIG_CONFIGFS_FS=y +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_CODEPAGE_860=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_ISO8859_15=y +CONFIG_NLS_UTF8=y +CONFIG_LIBCRC32C=y +# CONFIG_SECTION_MISMATCH_WARN_ONLY is not set +CONFIG_DEBUG_FS=y +CONFIG_PANIC_TIMEOUT=5 +CONFIG_STACKTRACE=y |