blob: f51fcb511d1b0711e9e35d482475633cd64f7ffb [file] [log] [blame]
Ruari Phipps1925b2a2020-09-10 14:05:55 +01001/*
2 * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <assert.h>
8#include <debug.h>
9#include <errno.h>
10#include <ffa_helpers.h>
11#include <ivy_def.h>
12#include <platform_def.h>
13#include <sp_helpers.h>
14
15#include "ivy.h"
16
17/* Host machine information injected by the build system in the ELF file. */
18extern const char build_message[];
19extern const char version_string[];
20
21void __dead2 ivy_main(void)
22{
23 u_register_t ret;
24 svc_args args;
25
26 NOTICE("Entering S-EL0 Secure Partition\n");
27 NOTICE("%s\n", build_message);
28 NOTICE("%s\n", version_string);
29
30init:
31 args = (svc_args){.fid = FFA_MSG_WAIT};
32 ret = sp_svc(&args);
33 while (1) {
34 if (ret != FFA_MSG_SEND_DIRECT_REQ_SMC32) {
35 ERROR("unknown FF-A request %lx\n", ret);
36 goto init;
37 }
38 VERBOSE("Received request: %lx\n", args.arg3);
39 args.fid = FFA_MSG_SEND_DIRECT_RESP_SMC32;
40 args.arg1 = 0x80020000;
41 args.arg2 = 0;
42 args.arg3 = 0;
43 ret = sp_svc(&args);
44 }
45}