]> rtime.felk.cvut.cz Git - jailhouse.git/blobdiff - tools/root-cell-config.c.tmpl
configs, core, tools: Remove device_limit field from system configuration
[jailhouse.git] / tools / root-cell-config.c.tmpl
index 51f2f47e93d8b6f9b51a4180d1000bca627a73bf..451869ae5f707f1c005756c626f3034244fc7770 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Jailhouse, a Linux-based partitioning hypervisor
  *
- * Copyright (c) Siemens AG, 2014, 2015
+ * Copyright (c) Siemens AG, 2014-2016
  *
  * This work is licensed under the terms of the GNU GPL, version 2.  See
  * the COPYING file in the top-level directory.
@@ -54,23 +54,35 @@ struct {
        struct jailhouse_pci_capability pci_caps[${len(pcicaps)}];
 } __attribute__((packed)) config = {
        .header = {
+               .signature = JAILHOUSE_SYSTEM_SIGNATURE,
                .hypervisor_memory = {
                        .phys_start = ${hex(hvmem[0])},
                        .size = ${hex(hvmem[1])},
                },
+               .debug_console = {
+                       .phys_start = 0x3f8,
+               },
                .platform_info.x86 = {
                        .mmconfig_base = ${hex(mmconfig.base)},
                        .mmconfig_end_bus = ${hex(mmconfig.end_bus)},
                        .pm_timer_address = ${hex(pm_timer_base)},
                        % if iommu_units:
-                       .iommu_base = {
-                               % for d in iommu_units:
-                               ${hex(d)},
+                       .iommu_units = {
+                               % for unit in iommu_units:
+                               {
+                                       .base = ${hex(unit.base_addr)},
+                                       .size = ${hex(unit.mmio_size)},
+                                       % if unit.is_amd_iommu:
+                                       .amd_bdf = ${hex(unit.amd_bdf)},
+                                       .amd_base_cap = ${hex(unit.amd_base_cap)},
+                                       .amd_msi_cap = ${hex(unit.amd_msi_cap)},
+                                       .amd_features = ${hex(unit.amd_features)},
+                                       % endif
+                               },
                                % endfor
                        },
                        % endif
                },
-               .device_limit = 128,
                .interrupt_limit = 256,
                .root_cell = {
                        .name = "RootCell",
@@ -125,7 +137,7 @@ struct {
                [  0x60/8 ...   0x67/8] = 0xec, /* HACK: NMI status/control */
                [  0x68/8 ...   0x6f/8] = -1,
                [  0x70/8 ...   0x77/8] = 0xfc, /* RTC */
-               [  0x78/8 ...   0x7f/7] = -1,
+               [  0x78/8 ...   0x7f/8] = -1,
                [  0x80/8 ...   0x87/8] = 0xfe, /* Linux: native_io_delay() */
                [  0x88/8 ...  0x3af/8] = -1,
                [ 0x3b0/8 ...  0x3df/8] = 0x00, /* VGA */
@@ -143,6 +155,10 @@ struct {
                        % endif
                        .domain = ${hex(d.domain)},
                        .bdf = ${hex(d.bdf())},
+                       .bar_mask = {
+                               ${'0x%08x' % d.bars.mask[0]}, ${'0x%08x' % d.bars.mask[1]}, ${'0x%08x' % d.bars.mask[2]},
+                               ${'0x%08x' % d.bars.mask[3]}, ${'0x%08x' % d.bars.mask[4]}, ${'0x%08x' % d.bars.mask[5]},
+                       },
                        .caps_start = ${d.caps_start},
                        .num_caps = ${d.num_caps},
                        .num_msi_vectors = ${d.num_msi_vectors},
@@ -160,7 +176,11 @@ struct {
                /* ${comment} */
                % endfor
                {
+                       % if (c.id & 0x8000) != 0:
+                       .id = ${hex(c.id & 0x7fff)} | JAILHOUSE_PCI_EXT_CAP,
+                       % else:
                        .id = ${hex(c.id)},
+                       % endif
                        .start = ${hex(c.start)},
                        .len = ${c.len},
                        .flags = ${c.flags},