From: Antonios Motakis <antonios.mota...@huawei.com>

Add under config/foundation-v8.c a root cell configuration for the
ARMv8 Foundation model, so we can in use this target with Jailhouse.
We also add the neccessary parameters in asm/platform.h for this
model.

Signed-off-by: Antonios Motakis <antonios.mota...@huawei.com>
[Jan: adjust to new irqchip and platform configuration]
Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>
---
 configs/foundation-v8.c | 149 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 149 insertions(+)
 create mode 100644 configs/foundation-v8.c

diff --git a/configs/foundation-v8.c b/configs/foundation-v8.c
new file mode 100644
index 0000000..a7f4021
--- /dev/null
+++ b/configs/foundation-v8.c
@@ -0,0 +1,149 @@
+/*
+ * Jailhouse AArch64 support
+ *
+ * Copyright (C) 2015 Huawei Technologies Duesseldorf GmbH
+ *
+ * Authors:
+ *  Antonios Motakis <antonios.mota...@huawei.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.
+ */
+
+#include <jailhouse/types.h>
+#include <jailhouse/cell-config.h>
+
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+
+struct {
+       struct jailhouse_system header;
+       __u64 cpus[1];
+       struct jailhouse_memory mem_regions[9];
+       struct jailhouse_irqchip irqchips[3];
+} __attribute__((packed)) config = {
+       .header = {
+               .signature = JAILHOUSE_SYSTEM_SIGNATURE,
+               .hypervisor_memory = {
+                       .phys_start = 0xfc000000,
+                       .size = 0x4000000,
+               },
+               .debug_console = {
+                       .phys_start = 0x1c090000,
+                       .size = 0x1000,
+                       .flags = JAILHOUSE_MEM_IO,
+               },
+               .platform_info.arm = {
+#ifdef CONFIG_ARM_GIC_V3
+                       .gicd_base = 0x2f000000,
+                       .gicr_base = 0x2f100000,
+#else /* GICv2 */
+                       .gicd_base = 0x2c001000,
+                       .gicc_base = 0x2c002000,
+                       .gich_base = 0x2c004000,
+                       .gicv_base = 0x2c006000,
+#endif
+                       .maintenance_irq = 25,
+               },
+               .root_cell = {
+                       .name = "foundation-v8",
+
+                       .cpu_set_size = sizeof(config.cpus),
+                       .num_memory_regions = ARRAY_SIZE(config.mem_regions),
+                       .num_irqchips = ARRAY_SIZE(config.irqchips),
+               },
+       },
+
+       .cpus = {
+               0xf,
+       },
+
+       .mem_regions = {
+               /* ethernet */ {
+                       .phys_start = 0x1a000000,
+                       .virt_start = 0x1a000000,
+                       .size = 0x00010000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_IO,
+               },
+               /* sysreg */ {
+                       .phys_start = 0x1c010000,
+                       .virt_start = 0x1c010000,
+                       .size = 0x00001000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_IO,
+               },
+               /* uart0 */ {
+                       .phys_start = 0x1c090000,
+                       .virt_start = 0x1c090000,
+                       .size = 0x00001000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_IO,
+               },
+               /* uart1 */ {
+                       .phys_start = 0x1c0a0000,
+                       .virt_start = 0x1c0a0000,
+                       .size = 0x00001000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_IO,
+               },
+               /* uart2 */ {
+                       .phys_start = 0x1c0b0000,
+                       .virt_start = 0x1c0b0000,
+                       .size = 0x00001000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_IO,
+               },
+               /* uart3 */ {
+                       .phys_start = 0x1c0c0000,
+                       .virt_start = 0x1c0c0000,
+                       .size = 0x00001000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_IO,
+               },
+               /* virtio_block */ {
+                       .phys_start = 0x1c130000,
+                       .virt_start = 0x1c130000,
+                       .size = 0x00001000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_IO,
+               },
+               /* RAM */ {
+                       .phys_start = 0x80000000,
+                       .virt_start = 0x80000000,
+                       .size = 0x7c000000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_EXECUTE,
+               },
+               /* RAM */ {
+                       .phys_start = 0x880000000,
+                       .virt_start = 0x880000000,
+                       .size = 0x80000000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_EXECUTE,
+               },
+       },
+       .irqchips = {
+               /* GIC v2 */ {
+                       .address = 0x2c001000, /* GIC v3: 0x2f000000 */
+                       .pin_base = 32,
+                       .pin_bitmap = {
+                               0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
+                       },
+               },
+               /* GIC v2 */ {
+                       .address = 0x2c001000, /* GIC v3: 0x2f000000 */
+                       .pin_base = 160,
+                       .pin_bitmap = {
+                               0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
+                       },
+               },
+               /* GIC v2 */ {
+                       .address = 0x2c001000, /* GIC v3: 0x2f000000 */
+                       .pin_base = 288,
+                       .pin_bitmap = {
+                               0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
+                       },
+               },
+       },
+
+};
-- 
2.1.4

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to