AM64x MCU+ SDK  10.00.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_AM64X_H_
34 #define BOOTLOADER_SOC_AM64X_H_
35 
36 #ifdef __cplusplus
37 extern "C"
38 {
39 #endif
40 
41 
42 #include <drivers/hw_include/cslr_soc.h>
43 
44 #define BOOTLOADER_DEVICE_VARIANT_SINGLE_CORE (0x00000000U)
45 #define BOOTLOADER_DEVICE_VARIANT_DUAL_CORE (0x00040000U)
46 #define BOOTLOADER_DEVICE_VARIANT_QUAD_CORE (0x000C0000U)
47 
48 #define BOOTLOADER_R5FSS0 (0x00000000U)
49 #define BOOTLOADER_R5FSS1 (0x00010000U)
50 
51 #define BOOTLOADER_ICSS_CORE_DEFAULT_FREQUENCY (200000000U)
52 
60 typedef struct
61 {
62  uint32_t tisciProcId;
63  uint32_t tisciDevId;
64  uint32_t tisciClockId;
65  uint32_t defaultClockHz;
66  char coreName[8];
67 
69 
79 int32_t Bootloader_socCpuRequest(uint32_t cpuId);
80 
90 int32_t Bootloader_socCpuRelease(uint32_t cpuId);
91 
102 int32_t Bootloader_socCpuSetClock(uint32_t cpuId, uint32_t cpuHz);
103 
113 uint64_t Bootloader_socCpuGetClock(uint32_t cpuId);
114 
125 uint32_t Bootloader_socCpuGetClkDefault(uint32_t cpuId);
126 
138 int32_t Bootloader_socCpuPowerOnReset(uint32_t cpuId,void *socCoreOpMode);
139 
151 int32_t Bootloader_socCpuResetRelease(uint32_t cpuId, uintptr_t entryPoint);
152 
159 
171 int32_t Bootloader_socCpuSetEntryPoint(uint32_t cpuId, uintptr_t entryPoint);
172 
184 uint32_t Bootloader_socTranslateSectionAddr(uint32_t cslCoreId, uint32_t addr);
185 
193 uint32_t Bootloader_socRprcToCslCoreId(uint32_t rprcCoreId);
194 
201 
209 char* Bootloader_socGetCoreName(uint32_t cpuId);
210 
218 int32_t Bootloader_socMemInitCpu(uint32_t cpuId);
219 
227 uint32_t Bootloader_socGetSciclientCpuProcId(uint32_t cpuId);
228 
236 uint32_t Bootloader_socGetSciclientCpuDevId(uint32_t cpuId);
237 
244 
251 
258 
266 int32_t Bootloader_socAuthImage(uint32_t certLoadAddr);
267 
275 
281 uint32_t Bootloader_socIsR5FSSDual(uint32_t ssNum);
282 
293 
300 
309 
316 
323 
331 int32_t Bootloader_socEnableICSSCores(uint32_t clkFreq);
332 
339 void Bootloader_socGetBootSeqOid(uint8_t* boot_seq_oid);
340 
344 int32_t Bootloader_socCpuSetAppEntryPoint(uint32_t cpuId, uintptr_t entryPoint);
345 
346 #ifdef __cplusplus
347 }
348 #endif
349 
350 #endif /* BOOTLOADER_SOC_AM64X_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_CoreBootInfo::tisciDevId
uint32_t tisciDevId
Definition: bootloader_soc.h:63
Bootloader_socCpuRequest
int32_t Bootloader_socCpuRequest(uint32_t cpuId)
Request for a particular CPU in the AM64x SOC.
Bootloader_socGetSciclientCpuProcId
uint32_t Bootloader_socGetSciclientCpuProcId(uint32_t cpuId)
Obtain the Sciclient Proc Id corresponding to the CSL core ID.
Bootloader_socWaitForFWBoot
int32_t Bootloader_socWaitForFWBoot(void)
API to wait for boot notification from SYSFW/ROM.
Bootloader_socResetWorkaround
void Bootloader_socResetWorkaround(void)
Workaround API to prevent CPSW register lockup. Checks the reset source and does a warm reset in case...
Bootloader_socNotifyFirewallOpen
void Bootloader_socNotifyFirewallOpen(void)
Notify other cores firewall open from SBL. Function writes a Software defined magic word to PSRAM add...
Bootloader_socCpuSetAppEntryPoint
int32_t Bootloader_socCpuSetAppEntryPoint(uint32_t cpuId, uintptr_t entryPoint)
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...
Bootloader_socCpuPowerOnReset
int32_t Bootloader_socCpuPowerOnReset(uint32_t cpuId, void *socCoreOpMode)
Do power-on-reset of a particular CPU in the AM64x SOC.
Bootloader_CoreBootInfo::defaultClockHz
uint32_t defaultClockHz
Definition: bootloader_soc.h:65
addr
uint64_t addr
Definition: csl_udmap_tr.h:3
Bootloader_socCpuResetRelease
int32_t Bootloader_socCpuResetRelease(uint32_t cpuId, uintptr_t entryPoint)
Release a particular CPU in the AM64x SOC from reset.
Bootloader_socGetSciclientCpuDevId
uint32_t Bootloader_socGetSciclientCpuDevId(uint32_t cpuId)
Obtain the Sciclient Device Id corresponding to the CSL core ID.
Bootloader_CoreBootInfo::tisciProcId
uint32_t tisciProcId
Definition: bootloader_soc.h:62
Bootloader_CoreBootInfo
Data structure containing information about a core specific to the AM64x SOC.
Definition: bootloader_soc.h:61
Bootloader_enableMCUPLL
void Bootloader_enableMCUPLL(void)
Enable MCU PLL. The MCU PLL will be initialized by DMSC if devgrp is set to DEVGRP_ALL....
Bootloader_socIsMCUResetIsoEnabled
uint32_t Bootloader_socIsMCUResetIsoEnabled(void)
Check if MCU domain is reset isolated.
Bootloader_CoreBootInfo::tisciClockId
uint32_t tisciClockId
Definition: bootloader_soc.h:64
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_socIsR5FSSDual
uint32_t Bootloader_socIsR5FSSDual(uint32_t ssNum)
API to check if an R5 cluster/subsystem has dual cores enabled or not.
Bootloader_socGetCoreVariant
uint32_t Bootloader_socGetCoreVariant(void)
API to check the GPN variant of the SOC - whether it's a quad core, dual core or a single core varian...
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_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_socEnableICSSCores
int32_t Bootloader_socEnableICSSCores(uint32_t clkFreq)
API to enable ICSS cores when applicable.
Bootloader_socOpenFirewalls
int32_t Bootloader_socOpenFirewalls(void)
API to open required firewalls using SYSFW.
Bootloader_socMemInitCpu
int32_t Bootloader_socMemInitCpu(uint32_t cpuId)
Initialize the core memories of a specific core.