]> rtime.felk.cvut.cz Git - jailhouse.git/blobdiff - configs/f2a88xm-hd3.c
config, core: Improve irqchip configuration
[jailhouse.git] / configs / f2a88xm-hd3.c
index f8b4f31bb0a11d5a545aaab6f0b9163ffdac2f89..321d148dfa8dd20085f716eb9323aadfe41dca7b 100644 (file)
 #include <linux/types.h>
 #include <jailhouse/cell-config.h>
 
-#define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0])
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
 
 struct {
        struct jailhouse_system header;
        __u64 cpus[1];
-       struct jailhouse_memory mem_regions[33];
-       struct jailhouse_irqchip irqchips[1];
+       struct jailhouse_memory mem_regions[35];
+       struct jailhouse_irqchip irqchips[2];
        __u8 pio_bitmap[0x2000];
-       struct jailhouse_pci_device pci_devices[24];
-       struct jailhouse_pci_capability pci_caps[26];
+       struct jailhouse_pci_device pci_devices[26];
+       struct jailhouse_pci_capability pci_caps[27];
 } __attribute__((packed)) config = {
        .header = {
+               .signature = JAILHOUSE_SYSTEM_SIGNATURE,
                .hypervisor_memory = {
                        .phys_start = 0x3b000000,
                        .size = 0x4000000,
                },
+               .debug_console = {
+                       .phys_start = 0x3f8,
+               },
                .platform_info.x86 = {
                        .mmconfig_base = 0xe0000000,
                        .mmconfig_end_bus = 0xff,
                        .pm_timer_address = 0x808,
-                       .pm_timer_val_ext = 1
-               },
+                       .iommu_units = {
+                               {
+                                       .base = 0xfeb80000,
+                                       .size = 0x80000,
+                                       .amd_bdf = 0x02,
+                                       .amd_base_cap = 0x40,
+                                       .amd_msi_cap = 0x54,
+                                       .amd_features = 0x80048824,
+                               },
+                       },
+               },
+               .interrupt_limit = 256,
                .root_cell = {
                        .name = "F2A88XM-HD3",
                        .cpu_set_size = sizeof(config.cpus),
@@ -87,34 +101,50 @@ struct {
                        .size = 0x20000,
                        .flags = JAILHOUSE_MEM_READ,
                },
-               /* MemRegion: 00100000-3affffff : System RAM */
+               /* MemRegion: 00100000-00ffffff : System RAM */
                {
                        .phys_start = 0x100000,
                        .virt_start = 0x100000,
-                       .size = 0x3af00000,
+                       .size = 0xf00000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA,
+               },
+               /* MemRegion: 01000000-01ffffff : Kernel */
+               {
+                       .phys_start = 0x1000000,
+                       .virt_start = 0x1000000,
+                       .size = 0x1000000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA,
+               },
+               /* MemRegion: 02000000-3affffff : System RAM */
+               {
+                       .phys_start = 0x2000000,
+                       .virt_start = 0x2000000,
+                       .size = 0x39000000,
                        .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
                                JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA,
                },
-               /* MemRegion: 3f200000-6c046fff : System RAM */
+               /* MemRegion: 3f200000-6b8ecfff : System RAM */
                {
                        .phys_start = 0x3f200000,
                        .virt_start = 0x3f200000,
-                       .size = 0x2ce47000,
+                       .size = 0x2c6ed000,
                        .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
                                JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA,
                },
-               /* MemRegion: 6c077000-6c339fff : System RAM */
+               /* MemRegion: 6b91d000-6bbdffff : System RAM */
                {
-                       .phys_start = 0x6c077000,
-                       .virt_start = 0x6c077000,
+                       .phys_start = 0x6b91d000,
+                       .virt_start = 0x6b91d000,
                        .size = 0x2c3000,
                        .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
                                JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA,
                },
-               /* MemRegion: 6c33a000-6c407fff : ACPI Non-volatile Storage */
+               /* MemRegion: 6bbe0000-6bcadfff : ACPI Non-volatile Storage */
                {
-                       .phys_start = 0x6c33a000,
-                       .virt_start = 0x6c33a000,
+                       .phys_start = 0x6bbe0000,
+                       .virt_start = 0x6bbe0000,
                        .size = 0xce000,
                        .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
                },
@@ -269,7 +299,7 @@ struct {
                        .size = 0x1000,
                        .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
                },
-               /* MemRegion: feb80000-febfffff : amd_iommu */
+               /* MemRegion: feb80000-febfffff : pnp 00:02 */
                {
                        .phys_start = 0xfeb80000,
                        .virt_start = 0xfeb80000,
@@ -283,7 +313,7 @@ struct {
                        .size = 0x1000,
                        .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
                },
-               /* MemRegion: fed61000-fed70fff : pnp 00:0a */
+               /* MemRegion: fed61000-fed70fff : pnp 00:09 */
                {
                        .phys_start = 0xfed61000,
                        .virt_start = 0xfed61000,
@@ -300,10 +330,21 @@ struct {
        },
 
        .irqchips = {
-               /* IOAPIC */ {
+               /* IOAPIC 0, GSI base 0 */
+               {
                        .address = 0xfec00000,
                        .id = 0x0,
-                       .pin_bitmap = 0xffffff,
+                       .pin_bitmap = {
+                               0xffffff
+                       },
+               },
+               /* IOAPIC 1, GSI base 24 */
+               {
+                       .address = 0xfec01000,
+                       .id = 0x0,
+                       .pin_bitmap = {
+                               0xffffff
+                       },
                },
        },
 
@@ -333,190 +374,361 @@ struct {
                        .bdf = 0x0,
                        .caps_start = 0,
                        .num_caps = 0,
-               },
-               /* PCIDevice: 00:00.2 */
-               {
-                       .type = JAILHOUSE_PCI_TYPE_DEVICE,
-                       .domain = 0x0,
-                       .bdf = 0x2,
-                       .caps_start = 0,
-                       .num_caps = 3,
+                       .num_msi_vectors = 0,
+                       .msi_64bits = 0,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
                },
                /* PCIDevice: 00:01.0 */
                {
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0x8,
                        .caps_start = 3,
-                       .num_caps = 3,
+                       .num_caps = 4,
+                       .num_msi_vectors = 1,
+                       .msi_64bits = 1,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
                },
                /* PCIDevice: 00:01.1 */
                {
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0x9,
                        .caps_start = 3,
-                       .num_caps = 3,
+                       .num_caps = 4,
+                       .num_msi_vectors = 1,
+                       .msi_64bits = 1,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
                },
-               /* PCIDevice: 00:04.0 */
+               /* PCIDevice: 00:02.0 */
+               {
+                       .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
+                       .domain = 0x0,
+                       .bdf = 0x10,
+                       .caps_start = 0,
+                       .num_caps = 0,
+                       .num_msi_vectors = 0,
+                       .msi_64bits = 0,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
+               },
+               /* PCIDevice: 00:03.0 */
+               {
+                       .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
+                       .domain = 0x0,
+                       .bdf = 0x18,
+                       .caps_start = 0,
+                       .num_caps = 0,
+                       .num_msi_vectors = 0,
+                       .msi_64bits = 0,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
+               },
+               /* PCIDevice: 00:03.1 */
                {
                        .type = JAILHOUSE_PCI_TYPE_BRIDGE,
+                       .iommu = 0,
                        .domain = 0x0,
-                       .bdf = 0x20,
-                       .caps_start = 6,
+                       .bdf = 0x19,
+                       .caps_start = 7,
                        .num_caps = 5,
+                       .num_msi_vectors = 1,
+                       .msi_64bits = 1,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
+               },
+               /* PCIDevice: 00:04.0 */
+               {
+                       .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
+                       .domain = 0x0,
+                       .bdf = 0x20,
+                       .caps_start = 0,
+                       .num_caps = 0,
+                       .num_msi_vectors = 0,
+                       .msi_64bits = 0,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
                },
                /* PCIDevice: 00:10.0 */
                {
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0x80,
-                       .caps_start = 11,
+                       .caps_start = 12,
                        .num_caps = 4,
+                       .num_msi_vectors = 8,
+                       .msi_64bits = 1,
+                       .num_msix_vectors = 8,
+                       .msix_region_size = 0x1000,
+                       .msix_address = 0xfeb6b000,
                },
                /* PCIDevice: 00:10.1 */
                {
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0x81,
-                       .caps_start = 11,
+                       .caps_start = 12,
                        .num_caps = 4,
+                       .num_msi_vectors = 8,
+                       .msi_64bits = 1,
+                       .num_msix_vectors = 8,
+                       .msix_region_size = 0x1000,
+                       .msix_address = 0xfeb69000,
                },
                /* PCIDevice: 00:11.0 */
                {
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0x88,
-                       .caps_start = 15,
+                       .caps_start = 16,
                        .num_caps = 2,
+                       .num_msi_vectors = 8,
+                       .msi_64bits = 1,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
                },
                /* PCIDevice: 00:12.0 */
                {
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0x90,
                        .caps_start = 0,
                        .num_caps = 0,
+                       .num_msi_vectors = 0,
+                       .msi_64bits = 0,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
                },
                /* PCIDevice: 00:12.2 */
                {
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0x92,
-                       .caps_start = 17,
+                       .caps_start = 18,
                        .num_caps = 2,
+                       .num_msi_vectors = 0,
+                       .msi_64bits = 0,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
                },
                /* PCIDevice: 00:13.0 */
                {
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0x98,
                        .caps_start = 0,
                        .num_caps = 0,
+                       .num_msi_vectors = 0,
+                       .msi_64bits = 0,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
                },
                /* PCIDevice: 00:13.2 */
                {
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0x9a,
-                       .caps_start = 17,
+                       .caps_start = 18,
                        .num_caps = 2,
+                       .num_msi_vectors = 0,
+                       .msi_64bits = 0,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
                },
                /* PCIDevice: 00:14.0 */
                {
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0xa0,
                        .caps_start = 0,
                        .num_caps = 0,
+                       .num_msi_vectors = 0,
+                       .msi_64bits = 0,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
                },
                /* PCIDevice: 00:14.2 */
                {
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0xa2,
-                       .caps_start = 19,
+                       .caps_start = 20,
                        .num_caps = 1,
+                       .num_msi_vectors = 0,
+                       .msi_64bits = 0,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
                },
                /* PCIDevice: 00:14.3 */
                {
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0xa3,
                        .caps_start = 0,
                        .num_caps = 0,
+                       .num_msi_vectors = 0,
+                       .msi_64bits = 0,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
                },
                /* PCIDevice: 00:14.4 */
                {
                        .type = JAILHOUSE_PCI_TYPE_BRIDGE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0xa4,
                        .caps_start = 0,
                        .num_caps = 0,
+                       .num_msi_vectors = 0,
+                       .msi_64bits = 0,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
                },
                /* PCIDevice: 00:14.5 */
                {
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0xa5,
                        .caps_start = 0,
                        .num_caps = 0,
+                       .num_msi_vectors = 0,
+                       .msi_64bits = 0,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
                },
                /* PCIDevice: 00:18.0 */
                {
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0xc0,
                        .caps_start = 0,
                        .num_caps = 0,
+                       .num_msi_vectors = 0,
+                       .msi_64bits = 0,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
                },
                /* PCIDevice: 00:18.1 */
                {
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0xc1,
                        .caps_start = 0,
                        .num_caps = 0,
+                       .num_msi_vectors = 0,
+                       .msi_64bits = 0,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
                },
                /* PCIDevice: 00:18.2 */
                {
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0xc2,
                        .caps_start = 0,
                        .num_caps = 0,
+                       .num_msi_vectors = 0,
+                       .msi_64bits = 0,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
                },
                /* PCIDevice: 00:18.3 */
                {
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0xc3,
-                       .caps_start = 20,
+                       .caps_start = 21,
                        .num_caps = 1,
+                       .num_msi_vectors = 0,
+                       .msi_64bits = 0,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
                },
                /* PCIDevice: 00:18.4 */
                {
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0xc4,
                        .caps_start = 0,
                        .num_caps = 0,
+                       .num_msi_vectors = 0,
+                       .msi_64bits = 0,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
                },
                /* PCIDevice: 00:18.5 */
                {
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0xc5,
                        .caps_start = 0,
                        .num_caps = 0,
+                       .num_msi_vectors = 0,
+                       .msi_64bits = 0,
+                       .num_msix_vectors = 0,
+                       .msix_region_size = 0x0,
+                       .msix_address = 0x0,
                },
                /* PCIDevice: 01:00.0 */
                {
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .iommu = 0,
                        .domain = 0x0,
                        .bdf = 0x100,
-                       .caps_start = 21,
+                       .caps_start = 22,
                        .num_caps = 5,
+                       .num_msi_vectors = 1,
+                       .msi_64bits = 1,
+                       .num_msix_vectors = 4,
+                       .msix_region_size = 0x1000,
+                       .msix_address = 0xd0800000,
                },
        },
 
@@ -542,6 +754,12 @@ struct {
                },
                /* PCIDevice: 00:01.0 */
                /* PCIDevice: 00:01.1 */
+               {
+                       .id = 0x9,
+                       .start = 0x48,
+                       .len = 2,
+                       .flags = 0,
+               },
                {
                        .id = 0x1,
                        .start = 0x50,
@@ -560,7 +778,7 @@ struct {
                        .len = 14,
                        .flags = JAILHOUSE_PCICAPS_WRITE,
                },
-               /* PCIDevice: 00:04.0 */
+               /* PCIDevice: 00:03.1 */
                {
                        .id = 0x1,
                        .start = 0x50,