blob: 28f93ab9a1b7455ce2a8099910a42dc1a1c26f53 [file] [log] [blame]
Ruari Phipps8c4e5b62020-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>
Olivier Depreza4a11fe2020-12-16 15:46:14 +010011#include <sp_debug.h>
Ruari Phipps8c4e5b62020-09-10 14:05:55 +010012#include <sp_helpers.h>
13
14#include "ivy.h"
15
16/* Host machine information injected by the build system in the ELF file. */
17extern const char build_message[];
18extern const char version_string[];
19
20void __dead2 ivy_main(void)
21{
22 u_register_t ret;
23 svc_args args;
24
Olivier Depreza4a11fe2020-12-16 15:46:14 +010025 set_putc_impl(SVC_CALL_AS_STDOUT);
26
Ruari Phipps8c4e5b62020-09-10 14:05:55 +010027 NOTICE("Entering S-EL0 Secure Partition\n");
28 NOTICE("%s\n", build_message);
29 NOTICE("%s\n", version_string);
30
31init:
32 args = (svc_args){.fid = FFA_MSG_WAIT};
33 ret = sp_svc(&args);
Olivier Depreza4a11fe2020-12-16 15:46:14 +010034
Ruari Phipps8c4e5b62020-09-10 14:05:55 +010035 while (1) {
36 if (ret != FFA_MSG_SEND_DIRECT_REQ_SMC32) {
37 ERROR("unknown FF-A request %lx\n", ret);
38 goto init;
39 }
Olivier Depreza4a11fe2020-12-16 15:46:14 +010040
Ruari Phipps8c4e5b62020-09-10 14:05:55 +010041 VERBOSE("Received request: %lx\n", args.arg3);
Olivier Depreza4a11fe2020-12-16 15:46:14 +010042
Ruari Phipps8c4e5b62020-09-10 14:05:55 +010043 args.fid = FFA_MSG_SEND_DIRECT_RESP_SMC32;
44 args.arg1 = 0x80020000;
45 args.arg2 = 0;
46 args.arg3 = 0;
Olivier Depreza4a11fe2020-12-16 15:46:14 +010047
Ruari Phipps8c4e5b62020-09-10 14:05:55 +010048 ret = sp_svc(&args);
49 }
50}