walnux/drivers/misc/Make.defs
Theodore Karatapanis 707cdaf42e drivers/misc/optee: Expanded RPC support.
This commit expands RPC support for the OP-TEE driver using 2 files:
1) drivers/misc/optee_rpc.c
   * Add support for RPCs that can be handled directly by the kernel.
   * Can delegate RPC handling to optee_supplicant.c for RPCs that
     need userspace interaction.
2) drivers/misc/optee_supplicant.c
   * Enable communication between the userspace TEE supplicant and the
     kernel driver.

Additional changes were needed to the following files:
1) drivers/misc/optee.c
   * Add ioctls used SOLELY by the userspace TEE supplicant.
   * Register /dev/teepriv0 if the supplicant is enabled in Kconfig
   * Add OPTEE_ROLE_CA and OPTEE_ROLE_SUPPLICANT conditionals to
     differentiate paths, between a normal Client Application (CA)
     and the TEE supplicant.
   * Change some functions from static to "public" to reuse them
     in other C files.
   * Adjust optee_to/from_msg_param() to work with RPCs.

2) drivers/misc/optee_smc.c
   * Call the RPC handler from optee_rpc.c

3) drivers/misc/optee_msg.h
   * Add definition needed for RPCs

4) drivers/misc/tee.h
   * Add ioctl definitions
   * Add TEE_SHM_SUPP flag, checked when unregistering supplicant
     memory.

5) Documentation/guides/optee.rs
   * Add documentation for RPCs and the supplicant.

6) drivers/misc/{CMakeLists.txt, Make.defs}
   * Account for the new files.

7) drivers/misc/Kconfig
   * Add DEV_OPTEE_SUPPLICANT option to enable/disable the supplicant
     driver.

Signed-off-by: Theodore Karatapanis <tkaratapanis@census-labs.com>
2025-08-06 02:29:33 +08:00

98 lines
2.3 KiB
Text

############################################################################
# drivers/misc/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
ifeq ($(CONFIG_DEV_SIMPLE_ADDRENV),y)
CSRCS += addrenv.c
endif
ifeq ($(CONFIG_DEV_NULL),y)
CSRCS += dev_null.c
endif
ifeq ($(CONFIG_DEV_ZERO),y)
CSRCS += dev_zero.c
endif
ifeq ($(CONFIG_DEV_MEM),y)
CSRCS += dev_mem.c
endif
ifeq ($(CONFIG_DEV_ASCII),y)
CSRCS += dev_ascii.c
endif
ifeq ($(CONFIG_LWL_CONSOLE),y)
CSRCS += lwl_console.c
endif
ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
CSRCS += ramdisk.c
ifeq ($(CONFIG_DRVR_MKRD),y)
CSRCS += mkrd.c
endif
endif
ifeq ($(CONFIG_DRVR_WRITEBUFFER),y)
CSRCS += rwbuffer.c
else ifeq ($(CONFIG_DRVR_READAHEAD),y)
CSRCS += rwbuffer.c
endif
ifeq ($(CONFIG_DEV_RPMSG),y)
CSRCS += rpmsgdev.c
endif
ifeq ($(CONFIG_DEV_RPMSG_SERVER),y)
CSRCS += rpmsgdev_server.c
endif
ifeq ($(CONFIG_BLK_RPMSG),y)
CSRCS += rpmsgblk.c
endif
ifeq ($(CONFIG_BLK_RPMSG_SERVER),y)
CSRCS += rpmsgblk_server.c
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)fs$(DELIM)inode
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)fs
endif
ifneq ($(CONFIG_DEV_OPTEE_NONE),y)
CSRCS += optee.c
ifeq ($(CONFIG_DEV_OPTEE_SMC),y)
CSRCS += optee_smc.c
CSRCS += optee_rpc.c
ifeq ($(CONFIG_DEV_OPTEE_SUPPLICANT),y)
CSRCS += optee_supplicant.c
endif
else
CSRCS += optee_socket.c
endif
endif
ifeq ($(CONFIG_GOLDFISH_PIPE),y)
CSRCS += goldfish_pipe.c
endif
# Include build support
DEPPATH += --dep-path misc
VPATH += :misc