AM275 FreeRTOS SDK  11.00.00
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
bootloader_soc.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021-2023 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_AM62X_H_
34 #define BOOTLOADER_SOC_AM62X_H_
35 
36 #include <drivers/hw_include/cslr_soc.h>
37 #include <drivers/udma.h>
38 
39 #define FREERTOS_SMP_RPRC_CORE_ID (100)
40 #define FREERTOS_SMP_NO_OF_CORES (4)
41 #define FREERTOS_SMP_CSL_CORE_ID_MAX (FREERTOS_SMP_NO_OF_CORES + CSL_CORE_ID_A53SS0_0)
42 
43 /* DMA channel type configured by bootloader layer */
44 #define BOOTLOADER_DMA_CHANNEL_TYPE UDMA_CH_TYPE_TR_BLK_COPY
45 
53 typedef struct
54 {
55  uint32_t tisciProcId;
56  uint32_t tisciDevId;
57  uint32_t tisciClockId;
58  uint32_t defaultClockHz;
59  char coreName[8];
60 
62 
71 typedef void __attribute__((__noreturn__)) (*Bootloader_SelfCoreJump)(void);
72 
82 int32_t Bootloader_socCpuRequest(uint32_t cpuId);
83 
93 int32_t Bootloader_socCpuRelease(uint32_t cpuId);
94 
105 int32_t Bootloader_socCpuSetClock(uint32_t cpuId, uint32_t cpuHz);
106 
116 uint64_t Bootloader_socCpuGetClock(uint32_t cpuId);
117 
128 uint32_t Bootloader_socCpuGetClkDefault(uint32_t cpuId);
129 
141 int32_t Bootloader_socCpuPowerOnReset(uint32_t cpuId, void *socCoreOpMode);
142 
154 int32_t Bootloader_socCpuResetRelease(uint32_t cpuId, uintptr_t entryPoint);
155 
161 
166 void __attribute__((__noreturn__)) Bootloader_socSelfCPUjump();
167 
179 int32_t Bootloader_socCpuSetEntryPoint(uint32_t cpuId, uintptr_t entryPoint);
180 
192 uint32_t Bootloader_socTranslateSectionAddr(uint32_t cslCoreId, uint32_t addr);
193 
201 uint32_t Bootloader_socRprcToCslCoreId(uint32_t rprcCoreId);
202 
210 bool Bootloader_socIsSmpEnable(uint32_t rprcCoreId);
211 
218 
226 char* Bootloader_socGetCoreName(uint32_t cpuId);
227 
235 int32_t Bootloader_socMemInitCpu(uint32_t cpuId);
236 
244 uint32_t Bootloader_socGetSciclientCpuProcId(uint32_t cpuId);
245 
253 uint32_t Bootloader_socGetSciclientCpuDevId(uint32_t cpuId);
254 
261 
268 
275 
283 int32_t Bootloader_socAuthImage(uint32_t certLoadAddr);
284 
292 
293 
302 
309 
316 void Bootloader_socCpuPowerOff(uint32_t cpuId);
317 #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 AM62x 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:56
Bootloader_socCpuRequest
int32_t Bootloader_socCpuRequest(uint32_t cpuId)
Request for a particular CPU in the AM62x SOC.
Bootloader_socIsSmpEnable
bool Bootloader_socIsSmpEnable(uint32_t rprcCoreId)
Check whether the smp is enabled or not for the soc.
Bootloader_socCpuPowerOff
void Bootloader_socCpuPowerOff(uint32_t cpuId)
Power off a core.
Bootloader_socIsMCUResetIsoEnabled
uint32_t Bootloader_socIsMCUResetIsoEnabled()
Check if MCU M4 is reset isolated.
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_socCpuSetEntryPoint
int32_t Bootloader_socCpuSetEntryPoint(uint32_t cpuId, uintptr_t entryPoint)
Set entry point for self CPU in the AM62x 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 AM62x SOC.
Bootloader_CoreBootInfo::defaultClockHz
uint32_t defaultClockHz
Definition: bootloader_soc.h:58
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 AM62x 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:55
Bootloader_CoreBootInfo
Data structure containing information about a core specific to the AM62x SOC.
Definition: bootloader_soc.h:54
Bootloader_enableMCUPLL
void Bootloader_enableMCUPLL(void)
Enable MCU PLL. The MCU PLL will be initialized by SYSFW if devgrp is set to DEVGRP_ALL....
Bootloader_CoreBootInfo::tisciClockId
uint32_t tisciClockId
Definition: bootloader_soc.h:57
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 AM62x SOC.
Bootloader_socCpuRelease
int32_t Bootloader_socCpuRelease(uint32_t cpuId)
Release a particular CPU in the AM62x SOC.
__attribute__
void __attribute__((__noreturn__))(*Bootloader_SelfCoreJump)(void)
Function pointer to jump a self core to specific code location in AM62x SOC.
Definition: bootloader_soc.h:71
udma.h
UDMA Driver API/interface file.
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 AM62x SOC.
Bootloader_socSecHandover
int32_t Bootloader_socSecHandover(void)
API to trigger the security handover from SYSFW.
Bootloader_socCpuResetReleaseSelf
int32_t Bootloader_socCpuResetReleaseSelf()
Release self CPU in the AM62x SOC from reset.
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.