mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-08-17 18:07:01 +02:00
This change implements platform services for stm32mp1 to expose clock and reset controllers over SCMI clock and reset domain protocols in sp_min firmware. Requests execution use a fastcall SMC context using a SiP function ID. The setup allows the create SCMI channels by assigning a specific SiP SMC function ID for each channel/agent identifier defined. In this change, stm32mp1 exposes a single channel and hence expects single agent at a time. The input payload in copied in secure memory before the message in passed through the SCMI server drivers. BL32/sp_min is invoked for a single SCMI message processing and always returns with a synchronous response message passed back to the caller agent. This change fixes and updates STM32_COMMON_SIP_NUM_CALLS that was previously wrongly set 4 whereas only 1 SiP SMC function ID was to be counted. STM32_COMMON_SIP_NUM_CALLS is now set to 3 since the 2 added SiP SMC function IDs for SCMI services. Change-Id: Icb428775856b9aec00538172aea4cf11e609b033 Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
62 lines
1.6 KiB
C
62 lines
1.6 KiB
C
/*
|
|
* Copyright (c) 2016-2019, STMicroelectronics - All Rights Reserved
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef STM32MP1_SMC_H
|
|
#define STM32MP1_SMC_H
|
|
|
|
/*
|
|
* SMC function IDs for STM32 Service queries
|
|
* STM32 SMC services use the space between 0x82000000 and 0x8200FFFF
|
|
* like this is defined in SMC calling Convention by ARM
|
|
* for SiP (silicon Partner)
|
|
* https://developer.arm.com/docs/den0028/latest
|
|
*/
|
|
|
|
/* Secure Service access from Non-secure */
|
|
|
|
/*
|
|
* STM32_SMC_BSEC call API
|
|
*
|
|
* Argument a0: (input) SMCC ID
|
|
* (output) status return code
|
|
* Argument a1: (input) Service ID (STM32_SMC_BSEC_xxx)
|
|
* Argument a2: (input) OTP index
|
|
* (output) OTP read value, if applicable
|
|
* Argument a3: (input) OTP value if applicable
|
|
*/
|
|
#define STM32_SMC_BSEC 0x82001003
|
|
|
|
/*
|
|
* STM32_SIP_SMC_SCMI_AGENT0
|
|
* STM32_SIP_SMC_SCMI_AGENT1
|
|
* Process SCMI message pending in SCMI shared memory buffer.
|
|
*
|
|
* Argument a0: (input) SMCC ID
|
|
*/
|
|
#define STM32_SIP_SMC_SCMI_AGENT0 0x82002000
|
|
#define STM32_SIP_SMC_SCMI_AGENT1 0x82002001
|
|
|
|
/* SMC function IDs for SiP Service queries */
|
|
#define STM32_SIP_SVC_CALL_COUNT 0x8200ff00
|
|
#define STM32_SIP_SVC_UID 0x8200ff01
|
|
/* 0x8200ff02 is reserved */
|
|
#define STM32_SIP_SVC_VERSION 0x8200ff03
|
|
|
|
/* STM32 SiP Service Calls version numbers */
|
|
#define STM32_SIP_SVC_VERSION_MAJOR 0x0
|
|
#define STM32_SIP_SVC_VERSION_MINOR 0x1
|
|
|
|
/* Number of STM32 SiP Calls implemented */
|
|
#define STM32_COMMON_SIP_NUM_CALLS 3
|
|
|
|
/* Service for BSEC */
|
|
#define STM32_SMC_READ_SHADOW 0x01
|
|
#define STM32_SMC_PROG_OTP 0x02
|
|
#define STM32_SMC_WRITE_SHADOW 0x03
|
|
#define STM32_SMC_READ_OTP 0x04
|
|
|
|
#endif /* STM32MP1_SMC_H */
|