From: Nikhil Devshatwar <[email protected]> Add a virtual PCI device with IVSHMEM type (id = 1) Create IVSHMEM regions for 2 peer communication Enable the vpci_irq for doorbell interrupt
This allows to run the ivshmem-demo baremetal inmate inside this cell. Signed-off-by: Nikhil Devshatwar <[email protected]> --- configs/arm64/k3-j721e-evm-inmate-demo.c | 64 ++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/configs/arm64/k3-j721e-evm-inmate-demo.c b/configs/arm64/k3-j721e-evm-inmate-demo.c index 7440a258..39c6c414 100644 --- a/configs/arm64/k3-j721e-evm-inmate-demo.c +++ b/configs/arm64/k3-j721e-evm-inmate-demo.c @@ -20,7 +20,9 @@ struct { struct jailhouse_cell_desc cell; __u64 cpus[1]; - struct jailhouse_memory mem_regions[3]; + struct jailhouse_memory mem_regions[7]; + struct jailhouse_irqchip irqchips[1]; + struct jailhouse_pci_device pci_devices[1]; } __attribute__((packed)) config = { .cell = { .signature = JAILHOUSE_CELL_DESC_SIGNATURE, @@ -30,8 +32,9 @@ struct { .cpu_set_size = sizeof(config.cpus), .num_memory_regions = ARRAY_SIZE(config.mem_regions), - .num_irqchips = 0, - .num_pci_devices = 0, + .num_irqchips = 1, + .num_pci_devices = 1, + .vpci_irq_base = 195 -32, .console = { .address = 0x02810000, @@ -48,6 +51,33 @@ struct { }, .mem_regions = { + /* IVSHMEM shared memory regions for 00:00.0 (demo) */ + { + .phys_start = 0x89fe00000, + .virt_start = 0x89fe00000, + .size = 0x10000, + .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_ROOTSHARED, + }, + { + .phys_start = 0x89fe10000, + .virt_start = 0x89fe10000, + .size = 0x10000, + .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_ROOTSHARED | + JAILHOUSE_MEM_WRITE , + }, + { + .phys_start = 0x89fe20000, + .virt_start = 0x89fe20000, + .size = 0x10000, + .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_ROOTSHARED, + }, + { + .phys_start = 0x89fe30000, + .virt_start = 0x89fe30000, + .size = 0x10000, + .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_ROOTSHARED | + JAILHOUSE_MEM_WRITE , + }, /* main_uart1 */ { .phys_start = 0x02810000, .virt_start = 0x02810000, @@ -68,5 +98,31 @@ struct { .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE | JAILHOUSE_MEM_COMM_REGION, }, - } + }, + + .irqchips = { + { + .address = 0x01800000, + .pin_base = 160, + /* + * virtual PCI SPI_163 => idx 1 bit [3] + */ + .pin_bitmap = { + 0x00000000, 0x00000008, 0x00000000, 0x00000000, + }, + }, + }, + + .pci_devices = { + /* 00:00.0 (demo) */ { + .type = JAILHOUSE_PCI_TYPE_IVSHMEM, + .domain = 4, + .bdf = 0 << 3, + .bar_mask = JAILHOUSE_IVSHMEM_BAR_MASK_INTX_64K, + .shmem_regions_start = 0, + .shmem_dev_id = 1, + .shmem_peers = 2, + .shmem_protocol = JAILHOUSE_SHMEM_PROTO_UNDEFINED, + }, + }, }; -- 2.17.1 -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jailhouse-dev/20200608104255.18358-6-nikhil.nd%40ti.com.
