Add layer to support Jailhouse hypervisor
[AGL/meta-agl-devel.git] / meta-agl-jailhouse / recipes-kernel / linux / linux / 0011-ivshmem-Add-header-file.patch
1 From 61d003be018fb5b874e6ffbf746684c53556c00e Mon Sep 17 00:00:00 2001
2 From: Jan Kiszka <jan.kiszka@siemens.com>
3 Date: Tue, 1 Oct 2019 12:33:25 +0200
4 Subject: [PATCH 11/32] ivshmem: Add header file
5
6 Common defines and structures for the ivshmem device.
7
8 Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
9 ---
10  include/linux/ivshmem.h | 30 ++++++++++++++++++++++++++++++
11  1 file changed, 30 insertions(+)
12  create mode 100644 include/linux/ivshmem.h
13
14 diff --git a/include/linux/ivshmem.h b/include/linux/ivshmem.h
15 new file mode 100644
16 index 000000000000..bad8547f071b
17 --- /dev/null
18 +++ b/include/linux/ivshmem.h
19 @@ -0,0 +1,30 @@
20 +/* SPDX-License-Identifier: GPL-2.0-only */
21 +#ifndef _LINUX_IVSHMEM_H
22 +#define _LINUX_IVSHMEM_H
23 +
24 +#include <linux/types.h>
25 +
26 +#define IVSHM_PROTO_UNDEFINED          0x0000
27 +#define IVSHM_PROTO_NET                        0x0001
28 +#define IVSHM_PROTO_VIRTIO_FRONT       0x8000
29 +#define IVSHM_PROTO_VIRTIO_BACK                0xc000
30 +#define IVSHM_PROTO_VIRTIO_DEVID_MASK  0x7fff
31 +
32 +#define IVSHM_CFG_PRIV_CNTL            0x03
33 +# define IVSHM_PRIV_CNTL_ONESHOT_INT   BIT(0)
34 +#define IVSHM_CFG_STATE_TAB_SZ         0x04
35 +#define IVSHM_CFG_RW_SECTION_SZ                0x08
36 +#define IVSHM_CFG_OUTPUT_SECTION_SZ    0x10
37 +#define IVSHM_CFG_ADDRESS              0x18
38 +
39 +struct ivshm_regs {
40 +       u32 id;
41 +       u32 max_peers;
42 +       u32 int_control;
43 +       u32 doorbell;
44 +       u32 state;
45 +};
46 +
47 +#define IVSHM_INT_ENABLE               BIT(0)
48 +
49 +#endif /* _LINUX_IVSHMEM_H */
50 -- 
51 2.11.0
52