AM261x MCU+ SDK  10.02.00
bootloader_soc.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021-2024 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef BOOTLOADER_SOC_AM263X_H_
34 #define BOOTLOADER_SOC_AM263X_H_
35 
36 #ifdef __cplusplus
37 extern "C"
38 {
39 #endif
40 
41 
42 #include <drivers/hw_include/cslr_soc.h>
44 /* ========================================================================== */
45 /* Macros & Typedefs */
46 /* ========================================================================== */
47 
49 #define BOOTLOADER_APP_SEGMENT_CANBE_ENCRYPTED (0xA5U)
50 
51 #define BOOTLOADER_APP_SEGMENT_CANNOTBE_ENCRYPTED (0x5AU)
52 
54 #define BOOTLOADER_SOC_APP_CERT_SIZE (0x1000)
55 
62 #define BOOTLOADER_DEVTYPE_HSSE (0x0AU)
63 
64 #define BOOTLOADER_DEVTYPE_HSFS (0xAAU)
65 
66 #define BOOTLOADER_DEVTYPE_GP (0x03U)
67 
68 #define BOOTLOADER_CLIENT_ID (0x02)
69 
71 #define BOOTLOADER_MAX_SBL_SIZE_IN_TCM_KB (640U)
72 
81 typedef struct
82 {
83  uint32_t defaultClockHz;
84  char coreName[8];
85 
87 
94 typedef struct Bootloader_socCoreOpModeConfig_s
95 {
96  uint32_t r5fss0_opMode;
99  uint32_t r5fss1_opMode;
103 
113 int32_t Bootloader_socCpuRequest(uint32_t cpuId);
114 
124 int32_t Bootloader_socCpuRelease(uint32_t cpuId);
125 
136 int32_t Bootloader_socCpuSetClock(uint32_t cpuId, uint32_t cpuHz);
137 
147 uint64_t Bootloader_socCpuGetClock(uint32_t cpuId);
148 
159 uint32_t Bootloader_socCpuGetClkDefault(uint32_t cpuId);
160 
173 int32_t Bootloader_socCpuPowerOnReset(uint32_t cpuId,void *socCoreOpMode);
174 
186 int32_t Bootloader_socCpuResetRelease(uint32_t cpuId, uintptr_t entryPoint);
187 
194 
206 int32_t Bootloader_socCpuSetEntryPoint(uint32_t cpuId, uintptr_t entryPoint);
207 
219 uint32_t Bootloader_socTranslateSectionAddr(uint32_t cslCoreId, uint32_t addr);
220 
228 uint32_t Bootloader_socRprcToCslCoreId(uint32_t rprcCoreId);
229 
236 
244 char* Bootloader_socGetCoreName(uint32_t cpuId);
245 
253 int32_t Bootloader_socMemInitCpu(uint32_t cpuId);
254 
261 
266 
271 
279 int32_t Bootloader_socAuthImage(uint32_t certLoadAddr);
280 
288 
295 void Bootloader_socGetBootSeqOid(uint8_t* boot_seq_oid);
296 
300 void Bootloader_socLoadHsmRtFw(HsmClient_t *gHSMClient, const uint8_t *HsmRtFw, uint32_t hsmRTSize);
301 
305 void Bootloader_socLoadHsmRtFwNonBlocking(HsmClient_t *gHSMClient, const uint8_t *HsmRtFw, uint32_t hsmRTSize);
306 
311 
315 int32_t Bootloader_socCpuSetAppEntryPoint(uint32_t cpuId, uintptr_t entryPoint);
316 
320 int32_t Bootloader_authStart(uintptr_t startAddr, uint32_t size);
321 
325 int32_t Bootloader_authUpdate(uintptr_t startAddr, uint32_t size, uint8_t enc);
326 
330 int32_t Bootloader_authFinish(void);
331 
332 #ifdef __cplusplus
333 }
334 #endif
335 
336 #endif /* BOOTLOADER_SOC_AM263X_H_ */
Bootloader_socCpuSetClock
int32_t Bootloader_socCpuSetClock(uint32_t cpuId, uint32_t cpuHz)
Set the clock of a particular CPU in the AM64x SOC.
Bootloader_socGetCoreName
char * Bootloader_socGetCoreName(uint32_t cpuId)
Get the name of a core.
Bootloader_authUpdate
int32_t Bootloader_authUpdate(uintptr_t startAddr, uint32_t size, uint8_t enc)
API to update the Secure Boot Stream with a new segment.
Bootloader_socCpuRequest
int32_t Bootloader_socCpuRequest(uint32_t cpuId)
Request for a particular CPU in the AM64x SOC.
Bootloader_socConfigurePll
void Bootloader_socConfigurePll(void)
API to configure Core and Per PLLS.
Bootloader_authStart
int32_t Bootloader_authStart(uintptr_t startAddr, uint32_t size)
API to start streaming boot authentication.
Bootloader_socCpuSetAppEntryPoint
int32_t Bootloader_socCpuSetAppEntryPoint(uint32_t cpuId, uintptr_t entryPoint)
hsmclient.h
Bootloader_socCpuSetEntryPoint
int32_t Bootloader_socCpuSetEntryPoint(uint32_t cpuId, uintptr_t entryPoint)
Set entry point for self CPU in the AM64x SOC from reset.
Bootloader_socIsAuthRequired
uint32_t Bootloader_socIsAuthRequired(void)
API to check if authentication is required for the device. Checks the SYS_STATUS register to see if d...
HsmClient_t
This is a HSMClient type which holds the information needed by hsm client to communicate with HSM .
Definition: hsmclient.h:111
Bootloader_socCpuPowerOnReset
int32_t Bootloader_socCpuPowerOnReset(uint32_t cpuId, void *socCoreOpMode)
Do power-on-reset of a particular CPU in the AM64x SOC.
Bootloader_socCoreOpModeConfig
Data structure containing information about the operating mode specific to the SOC.
Definition: bootloader_soc.h:95
Bootloader_CoreBootInfo::defaultClockHz
uint32_t defaultClockHz
Definition: bootloader_soc.h:83
Bootloader_socCpuResetRelease
int32_t Bootloader_socCpuResetRelease(uint32_t cpuId, uintptr_t entryPoint)
Release a particular CPU in the AM64x SOC from reset.
Bootloader_authFinish
int32_t Bootloader_authFinish(void)
API to finish streaming boot authentication.
Bootloader_socLoadHsmRtFw
void Bootloader_socLoadHsmRtFw(HsmClient_t *gHSMClient, const uint8_t *HsmRtFw, uint32_t hsmRTSize)
API to load hsm runtime firmware.
Bootloader_CoreBootInfo
Data structure containing information about a core specific to the SOC.
Definition: bootloader_soc.h:82
Bootloader_socRprcToCslCoreId
uint32_t Bootloader_socRprcToCslCoreId(uint32_t rprcCoreId)
Obtain the CSL core ID of a CPU from its RPRC core ID.
Bootloader_socCpuGetClock
uint64_t Bootloader_socCpuGetClock(uint32_t cpuId)
Get the clock of a particular CPU in the AM64x SOC.
Bootloader_socGetBootSeqOid
void Bootloader_socGetBootSeqOid(uint8_t *boot_seq_oid)
API to get boot sequence oid.
Bootloader_socCpuRelease
int32_t Bootloader_socCpuRelease(uint32_t cpuId)
Release a particular CPU in the AM64x SOC.
Bootloader_socCoreOpModeConfig::r5fss1_opMode
uint32_t r5fss1_opMode
Definition: bootloader_soc.h:99
Bootloader_socInitL2MailBoxMemory
void Bootloader_socInitL2MailBoxMemory(void)
API to Init L2,L3 Banks and Mailbox Memory.
Bootloader_socCpuResetReleaseSelf
int32_t Bootloader_socCpuResetReleaseSelf(void)
Release self CPU in the AM64x SOC from reset.
Bootloader_socAuthImage
int32_t Bootloader_socAuthImage(uint32_t certLoadAddr)
API to authenticate (and decrypt if needed) an appimage using SYSFW.
Bootloader_socTranslateSectionAddr
uint32_t Bootloader_socTranslateSectionAddr(uint32_t cslCoreId, uint32_t addr)
Translate a CPU address to the SOC address wherever applicable.
Bootloader_socGetSelfCpuList
uint32_t * Bootloader_socGetSelfCpuList(void)
Get the list of self cpus in the SOC.
Bootloader_socSetAutoClock
void Bootloader_socSetAutoClock()
API to set CPU clock to 200 MHz or 400 MHz on the basis of eFUSE bits configuration.
Bootloader_socCpuGetClkDefault
uint32_t Bootloader_socCpuGetClkDefault(uint32_t cpuId)
Get the default clock of a particular CPU in the AM64x SOC.
Bootloader_socSecHandover
int32_t Bootloader_socSecHandover(void)
API to trigger the security handover from SYSFW.
Bootloader_socCoreOpModeConfig::r5fss0_opMode
uint32_t r5fss0_opMode
Definition: bootloader_soc.h:96
Bootloader_socLoadHsmRtFwNonBlocking
void Bootloader_socLoadHsmRtFwNonBlocking(HsmClient_t *gHSMClient, const uint8_t *HsmRtFw, uint32_t hsmRTSize)
Non blocking API to load hsm runtime firmware.
Bootloader_socMemInitCpu
int32_t Bootloader_socMemInitCpu(uint32_t cpuId)
Initialize the core memories of a specific core.