kernel: update NVMEM subsystem to the v6.3
[openwrt/staging/hauke.git] / target / linux / generic / backport-5.15 / 809-v6.3-0011-nvmem-stm32-fix-OPTEE-dependency.patch
1 From 1dc7e37bb0ec1c997fac82031332a38c7610352f Mon Sep 17 00:00:00 2001
2 From: Arnd Bergmann <arnd@arndb.de>
3 Date: Mon, 6 Feb 2023 13:43:56 +0000
4 Subject: [PATCH] nvmem: stm32: fix OPTEE dependency
5
6 The stm32 nvmem driver fails to link as built-in when OPTEE
7 is a loadable module:
8
9 aarch64-linux-ld: drivers/nvmem/stm32-bsec-optee-ta.o: in function `stm32_bsec:
10 stm32-bsec-optee-ta.c:(.text+0xc8): undefined reference to `tee_client_open_session'
11 aarch64-linux-ld: drivers/nvmem/stm32-bsec-optee-ta.o: in function `stm32_bsec:
12 stm32-bsec-optee-ta.c:(.text+0x1fc): undefined reference to `tee_client_open_context'
13
14 Change the CONFIG_NVMEM_STM32_ROMEM definition so it can only
15 be built-in if OPTEE is either built-in or disabled, and
16 make NVMEM_STM32_BSEC_OPTEE_TA a hidden symbol instead.
17
18 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
19 Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
20 Link: https://lore.kernel.org/r/20230206134356.839737-23-srinivas.kandagatla@linaro.org
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 ---
23 drivers/nvmem/Kconfig | 5 ++---
24 1 file changed, 2 insertions(+), 3 deletions(-)
25
26 --- a/drivers/nvmem/Kconfig
27 +++ b/drivers/nvmem/Kconfig
28 @@ -291,8 +291,7 @@ config NVMEM_SPRD_EFUSE
29 will be called nvmem-sprd-efuse.
30
31 config NVMEM_STM32_BSEC_OPTEE_TA
32 - bool "STM32MP BSEC OP-TEE TA support for nvmem-stm32-romem driver"
33 - depends on OPTEE
34 + def_bool NVMEM_STM32_ROMEM && OPTEE
35 help
36 Say y here to enable the accesses to STM32MP SoC OTPs by the OP-TEE
37 trusted application STM32MP BSEC.
38 @@ -303,7 +302,7 @@ config NVMEM_STM32_BSEC_OPTEE_TA
39 config NVMEM_STM32_ROMEM
40 tristate "STMicroelectronics STM32 factory-programmed memory support"
41 depends on ARCH_STM32 || COMPILE_TEST
42 - imply NVMEM_STM32_BSEC_OPTEE_TA
43 + depends on OPTEE || !OPTEE
44 help
45 Say y here to enable read-only access for STMicroelectronics STM32
46 factory-programmed memory area.