blob: 434c7c98d76efe42b681c1e9b0e8a52a138df220 [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
Andrew Walbran8a0f5ca2019-11-05 13:12:23 +000029#define HF_MAILBOX_WRITABLE_GET 0xff04
30#define HF_MAILBOX_WAITER_GET 0xff05
31#define HF_INTERRUPT_ENABLE 0xff06
32#define HF_INTERRUPT_GET 0xff07
33#define HF_INTERRUPT_INJECT 0xff08
34#define HF_SHARE_MEMORY 0xff09
Andrew Walbranf0c314d2019-10-02 14:24:26 +010035
36/* Custom SPCI-like calls returned from SPCI_RUN. */
Andrew Walbran8a0f5ca2019-11-05 13:12:23 +000037#define HF_SPCI_RUN_WAIT_FOR_INTERRUPT 0xff0a
38#define HF_SPCI_RUN_WAKE_UP 0xff0b
Andrew Walbranf0c314d2019-10-02 14:24:26 +010039
40/* This matches what Trusty and its ATF module currently use. */
41#define HF_DEBUG_LOG 0xbd000000
42
43/* clang-format on */
44
Andrew Scull6386f252018-12-06 13:29:10 +000045enum hf_share {
46 /**
47 * Relinquish ownership and access to the memory and pass them to the
48 * recipient.
49 */
50 HF_MEMORY_GIVE,
51
52 /**
53 * Retain ownership of the memory but relinquish access to the
54 * recipient.
55 */
56 HF_MEMORY_LEND,
57
58 /**
59 * Retain ownership and access but additionally allow access to the
60 * recipient.
61 */
62 HF_MEMORY_SHARE,
63};