blob: bdb67055014ff890092876c3123f9d6c62f34d43 [file] [log] [blame]
Andrew Scull6d2db332018-10-10 15:28:17 +01001/*
Andrew Walbran692b3252019-03-07 15:51:31 +00002 * Copyright 2018 The Hafnium Authors.
Andrew Scull6d2db332018-10-10 15:28:17 +01003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * https://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
Andrew Walbran95534922019-06-19 11:32:54 +010019#include "hf/spci.h"
Andrew Scull6d2db332018-10-10 15:28:17 +010020#include "hf/types.h"
21
Andrew Walbranf0c314d2019-10-02 14:24:26 +010022/* Keep macro alignment */
23/* clang-format off */
24
25/* TODO: Define constants below according to spec. */
26#define HF_VM_GET_COUNT 0xff01
27#define HF_VCPU_GET_COUNT 0xff02
28#define HF_VM_CONFIGURE 0xff03
29#define HF_MAILBOX_CLEAR 0xff04
30#define HF_MAILBOX_WRITABLE_GET 0xff05
31#define HF_MAILBOX_WAITER_GET 0xff06
32#define HF_INTERRUPT_ENABLE 0xff07
33#define HF_INTERRUPT_GET 0xff08
34#define HF_INTERRUPT_INJECT 0xff09
35#define HF_SHARE_MEMORY 0xff0a
36
37/* Custom SPCI-like calls returned from SPCI_RUN. */
38#define HF_SPCI_RUN_WAIT_FOR_INTERRUPT 0xff0b
39#define HF_SPCI_RUN_WAKE_UP 0xff0c
40
41/* This matches what Trusty and its ATF module currently use. */
42#define HF_DEBUG_LOG 0xbd000000
43
44/* clang-format on */
45
Andrew Scull6386f252018-12-06 13:29:10 +000046enum hf_share {
47 /**
48 * Relinquish ownership and access to the memory and pass them to the
49 * recipient.
50 */
51 HF_MEMORY_GIVE,
52
53 /**
54 * Retain ownership of the memory but relinquish access to the
55 * recipient.
56 */
57 HF_MEMORY_LEND,
58
59 /**
60 * Retain ownership and access but additionally allow access to the
61 * recipient.
62 */
63 HF_MEMORY_SHARE,
64};