intf.h 1.55 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#ifndef INTF_H
#define INTF_H

/**
 * Flags used in IPC req
 */
#define FLAG_DO_ACK			(U(1) << 0)
#define FLAG_RING_DOORBELL		(U(1) << 1)

/* Bit 1 is designated for CCPlex in secure world */
#define HSP_MASTER_CCPLEX_BIT		(U(1) << 1)
/* Bit 19 is designated for BPMP in non-secure world */
#define HSP_MASTER_BPMP_BIT		(U(1) << 19)
/* Timeout to receive response from BPMP is 1 sec */
#define TIMEOUT_RESPONSE_FROM_BPMP_US	U(1000000) /* in microseconds */

/**
 * IVC protocol defines and command/response frame
 */

/**
 * IVC specific defines
 */
#define IVC_CMD_SZ_BYTES		U(128)
#define IVC_DATA_SZ_BYTES		U(120)

/**
 * Holds frame data for an IPC request
 */
struct frame_data {
	/* Identification as to what kind of data is being transmitted */
	uint32_t mrq;

	/* Flags for slave as to how to respond back */
	uint32_t flags;

	/* Actual data being sent */
	uint8_t data[IVC_DATA_SZ_BYTES];
};

/**
 * Commands send to the BPMP firmware
 */

/**
 * MRQ code to issue a module reset command to BPMP
 */
#define MRQ_RESET			U(20)

/**
 * Reset sub-commands
 */
#define CMD_RESET_ASSERT		U(1)
#define CMD_RESET_DEASSERT		U(2)
#define CMD_RESET_MODULE		U(3)

/**
 * Used by the sender of an #MRQ_RESET message to request BPMP to
 * assert or deassert a given reset line.
 */
struct __attribute__((packed)) mrq_reset_request {
	/* reset action to perform (mrq_reset_commands) */
	uint32_t cmd;
	/* id of the reset to affected */
	uint32_t reset_id;
};

#endif /* INTF_H */