]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/AArch64/RTSMFoundationBoot.S
ARM Packages: use GCC_ASM_EXPORT to export functions
[mirror_edk2.git] / ArmPlatformPkg / ArmVExpressPkg / Library / ArmVExpressSecLibRTSM / AArch64 / RTSMFoundationBoot.S
CommitLineData
f9cec5f1 1//\r
51ad04cb 2// Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
f9cec5f1
HL
3//\r
4// This program and the accompanying materials\r
5// are licensed and made available under the terms and conditions of the BSD License\r
6// which accompanies this distribution. The full text of the license may be found at\r
7// http://opensource.org/licenses/bsd-license.php\r
8//\r
9// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11//\r
12//\r
13\r
51ad04cb 14#include <AsmMacroIoLibV8.h>\r
f9cec5f1
HL
15#include <Base.h>\r
16#include <Library/ArmPlatformLib.h>\r
17#include <AutoGen.h>\r
18#include <ArmPlatform.h>\r
19\r
20.text\r
21.align 3\r
22\r
919a3a02
BJ
23GCC_ASM_EXPORT(ArmPlatformSecBootAction)\r
24GCC_ASM_EXPORT(ArmPlatformSecBootMemoryInit)\r
25GCC_ASM_EXPORT(ArmSecMpCoreSecondariesWrite)\r
26GCC_ASM_EXPORT(ArmSecMpCoreSecondariesRead)\r
f9cec5f1
HL
27\r
28/**\r
29 Call at the beginning of the platform boot up\r
30\r
31 This function allows the firmware platform to do extra actions at the early\r
32 stage of the platform power up.\r
33\r
34 Note: This function must be implemented in assembler as there is no stack set up yet\r
35\r
36**/\r
37ASM_PFX(ArmPlatformSecBootAction):\r
38 ret\r
39\r
40/**\r
41 Initialize the memory where the initial stacks will reside\r
42\r
43 This memory can contain the initial stacks (Secure and Secure Monitor stacks).\r
44 In some platform, this region is already initialized and the implementation of this function can\r
45 do nothing. This memory can also represent the Secure RAM.\r
46 This function is called before the stack has been set up. Its implementation must ensure the stack\r
47 pointer is not used (probably required to use assembly language)\r
48\r
49**/\r
50ASM_PFX(ArmPlatformSecBootMemoryInit):\r
51 // The SMC does not need to be initialized for RTSM\r
52 ret\r
53\r
54\r
55// NOTE:\r
56// The foundation model does not have the VE_SYS_REGS like all the other VE\r
57// platforms. We pick a spot in RAM that *should* be safe in the simple case\r
58// of no UEFI apps interfering (Only the Linux loader getting used). By the\r
59// time we come to load Linux we should have all the cores in a safe place.\r
60// The image expects to be loaded at 0xa0000000. We also place the mailboxes\r
61// here as it does not matter if we corrupt the image at this time.\r
62// NOTE also see: "ArmVExpressLibRTSM/RTSMFoundation.c"\r
63\r
64/* Write the flag register used to start Secondary cores */\r
65ASM_PFX(ArmSecMpCoreSecondariesWrite):\r
66 ldr x1, =0xa0000000\r
67 str w0, [x1]\r
68 ret\r
69\r
70\r
71/* Read the flag register used to start Secondary cores */\r
72ASM_PFX(ArmSecMpCoreSecondariesRead):\r
73 ldr x1, =0xa0000000\r
74 ldr w0, [x1]\r
75 ret\r