Skip to content

Commit 759e7a2

Browse files
qzedandersson
authored andcommitted
firmware: Add support for Qualcomm UEFI Secure Application
On platforms using the Qualcomm UEFI Secure Application (uefisecapp), EFI variables cannot be accessed via the standard interface in EFI runtime mode. The respective functions return EFI_UNSUPPORTED. On these platforms, we instead need to talk to uefisecapp. This commit provides support for this and registers the respective efivars operations to access EFI variables from the kernel. Communication with uefisecapp follows the Qualcomm QSEECOM / Secure OS conventions via the respective SCM call interface. This is also the reason why variable access works normally while boot services are active. During this time, said SCM interface is managed by the boot services. When calling ExitBootServices(), the ownership is transferred to the kernel. Therefore, UEFI must not use that interface itself (as multiple parties accessing this interface at the same time may lead to complications) and cannot access variables for us. Signed-off-by: Maximilian Luz <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Reviewed-by: Johan Hovold <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 00b1248 commit 759e7a2

File tree

5 files changed

+897
-1
lines changed

5 files changed

+897
-1
lines changed

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17806,6 +17806,12 @@ L: [email protected]
1780617806
S: Maintained
1780717807
F: drivers/firmware/qcom_qseecom.c
1780817808

17809+
QUALCOMM QSEECOM UEFISECAPP DRIVER
17810+
M: Maximilian Luz <[email protected]>
17811+
17812+
S: Maintained
17813+
F: drivers/firmware/qcom_qseecom_uefisecapp.c
17814+
1780917815
QUALCOMM RMNET DRIVER
1781017816
M: Subash Abhinov Kasiviswanathan <[email protected]>
1781117817
M: Sean Tranchetti <[email protected]>

drivers/firmware/Kconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,22 @@ config QCOM_QSEECOM
242242

243243
Select Y here to enable the QSEECOM interface driver.
244244

245+
config QCOM_QSEECOM_UEFISECAPP
246+
bool "Qualcomm SEE UEFI Secure App client driver"
247+
depends on QCOM_QSEECOM
248+
depends on EFI
249+
help
250+
Various Qualcomm SoCs do not allow direct access to EFI variables.
251+
Instead, these need to be accessed via the UEFI Secure Application
252+
(uefisecapp), residing in the Secure Execution Environment (SEE).
253+
254+
This module provides a client driver for uefisecapp, installing efivar
255+
operations to allow the kernel accessing EFI variables, and via that also
256+
provide user-space with access to EFI variables via efivarfs.
257+
258+
Select Y here to provide access to EFI variables on the aforementioned
259+
platforms.
260+
245261
config SYSFB
246262
bool
247263
select BOOT_VESA_SUPPORT

drivers/firmware/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ obj-$(CONFIG_FW_CFG_SYSFS) += qemu_fw_cfg.o
2121
obj-$(CONFIG_QCOM_SCM) += qcom-scm.o
2222
qcom-scm-objs += qcom_scm.o qcom_scm-smc.o qcom_scm-legacy.o
2323
obj-$(CONFIG_QCOM_QSEECOM) += qcom_qseecom.o
24+
obj-$(CONFIG_QCOM_QSEECOM_UEFISECAPP) += qcom_qseecom_uefisecapp.o
2425
obj-$(CONFIG_SYSFB) += sysfb.o
2526
obj-$(CONFIG_SYSFB_SIMPLEFB) += sysfb_simplefb.o
2627
obj-$(CONFIG_TI_SCI_PROTOCOL) += ti_sci.o

drivers/firmware/qcom_qseecom.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ static int qseecom_client_register(struct platform_device *qseecom_dev,
8383
* assuming the app has already been loaded (usually by firmware bootloaders)
8484
* and its ID can be queried successfully.
8585
*/
86-
static const struct qseecom_app_desc qcom_qseecom_apps[] = {};
86+
static const struct qseecom_app_desc qcom_qseecom_apps[] = {
87+
{ "qcom.tz.uefisecapp", "uefisecapp" },
88+
};
8789

8890
static int qcom_qseecom_probe(struct platform_device *qseecom_dev)
8991
{

0 commit comments

Comments
 (0)