-
Notifications
You must be signed in to change notification settings - Fork 3
/
baremetal-linux-shmem.c
110 lines (91 loc) · 3.05 KB
/
baremetal-linux-shmem.c
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#include <config.h>
VM_IMAGE(baremetal_image, XSTR(BAO_WRKDIR_IMGS/baremetal-linux-shmem-setup/baremetal.bin));
VM_IMAGE(linux_image, XSTR(BAO_WRKDIR_IMGS/baremetal-linux-shmem-setup/linux-shmem.bin));
struct config config = {
CONFIG_HEADER
.shmemlist_size = 1,
.shmemlist = (struct shmem[]) {
[0] = { .size = 0x00010000, }
},
.vmlist_size = 2,
.vmlist = {
{
.image = VM_IMAGE_BUILTIN(baremetal_image, 0x80200000),
.entry = 0x80200000,
.platform = {
.cpu_num = 1,
.region_num = 1,
.regions = (struct vm_mem_region[]) {
{
.base = 0x80200000,
.size = 0x4000000
}
},
.ipc_num = 1,
.ipcs = (struct ipc[]) {
{
.base = 0x70000000,
.size = 0x00010000,
.shmem_id = 0,
.interrupt_num = 1,
.interrupts = (irqid_t[]) {52}
}
},
.dev_num = 1,
.devs = (struct vm_dev_region[]) {
{
/* 8250 */
.pa = 0x10000000,
.va = 0x10000000,
.size = 0x1000,
.interrupt_num = 1,
.interrupts = (irqid_t[]) {10}
}
},
.arch = {
.plic_base = 0xc000000,
}
},
},
{
.image = VM_IMAGE_BUILTIN(linux_image, 0x90200000),
.entry = 0x90200000,
.platform = {
.cpu_num = 3,
.region_num = 1,
.regions = (struct vm_mem_region[]) {
{
.base = 0x90000000,
.size = 0x40000000,
.place_phys = true,
.phys = 0x90000000
}
},
.ipc_num = 1,
.ipcs = (struct ipc[]) {
{
.base = 0xf0000000,
.size = 0x00010000,
.shmem_id = 0,
.interrupt_num = 1,
.interrupts = (irqid_t[]) {52}
}
},
.dev_num = 1,
.devs = (struct vm_dev_region[]) {
{
/* virtio devices */
.pa = 0x10001000,
.va = 0x10001000,
.size = 0x8000,
.interrupt_num = 8,
.interrupts = (irqid_t[]) {1, 2,3,4,5,6,7,8}
},
},
.arch = {
.plic_base = 0xc000000,
}
},
}
},
};