For demonstration purposes only. Signed-off-by: Ralf Ramsauer <ralf.ramsa...@oth-regensburg.de> --- configs/riscv/dts/noelv-linux-inmate.dts | 17 +++++++++++++++++ configs/riscv/noelv-linux-demo.c | 12 +++++++++++- configs/riscv/noelv.c | 12 +++++++++++- configs/riscv/qemu-linux-demo.c | 12 +++++++++++- configs/riscv/qemu-riscv64.c | 12 +++++++++++- 5 files changed, 61 insertions(+), 4 deletions(-)
diff --git a/configs/riscv/dts/noelv-linux-inmate.dts b/configs/riscv/dts/noelv-linux-inmate.dts index 486ea82f..ca11b134 100644 --- a/configs/riscv/dts/noelv-linux-inmate.dts +++ b/configs/riscv/dts/noelv-linux-inmate.dts @@ -126,5 +126,22 @@ riscv,ndev = <31>; riscv,max-priority = <7>; }; + + pci@40000000 { + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + + device_type = "pci"; + bus-range = <0 0>; + reg = <0x0 0x40000000 0x0 0x100000>; + ranges = <0x2000000 0x0 0x40100000 0x0 0x40100000 0 0x2000>; + + interrupt-map-mask = <0>; + interrupt-map = <0 0 0 1 &plic0 28 0>; + + compatible = "pci-host-ecam-generic"; + status = "okay"; + }; }; }; diff --git a/configs/riscv/noelv-linux-demo.c b/configs/riscv/noelv-linux-demo.c index bd263b78..9e62d6be 100644 --- a/configs/riscv/noelv-linux-demo.c +++ b/configs/riscv/noelv-linux-demo.c @@ -20,7 +20,7 @@ struct { struct jailhouse_cpu cpus[2]; struct jailhouse_memory mem_regions[8]; struct jailhouse_irqchip irqchips[1]; - struct jailhouse_pci_device pci_devices[0]; + struct jailhouse_pci_device pci_devices[1]; } __attribute__((packed)) config = { .cell = { .signature = JAILHOUSE_CELL_DESC_SIGNATURE, @@ -84,6 +84,16 @@ struct { }, .pci_devices = { + { /* IVSHMEM (networking) */ + .type = JAILHOUSE_PCI_TYPE_IVSHMEM, + .domain = 0x0000, + .bdf = 0x10 << 3, + .bar_mask = JAILHOUSE_IVSHMEM_BAR_MASK_INTX, + .shmem_regions_start = 4, + .shmem_dev_id = 1, + .shmem_peers = 2, + .shmem_protocol = JAILHOUSE_SHMEM_PROTO_VETH, + }, }, .irqchips = { diff --git a/configs/riscv/noelv.c b/configs/riscv/noelv.c index 08389cb0..5c8b6fa3 100644 --- a/configs/riscv/noelv.c +++ b/configs/riscv/noelv.c @@ -25,7 +25,7 @@ struct { struct jailhouse_cpu cpus[6]; struct jailhouse_memory mem_regions[7]; struct jailhouse_irqchip irqchips[1]; - struct jailhouse_pci_device pci_devices[0]; + struct jailhouse_pci_device pci_devices[1]; struct jailhouse_pci_capability pci_caps[0]; } __attribute__((packed)) config = { .header = { @@ -139,5 +139,15 @@ struct { }, .pci_devices = { + { /* IVSHMEM (networking) */ + .type = JAILHOUSE_PCI_TYPE_IVSHMEM, + .domain = 0x0000, + .bdf = 0x10 << 3, + .bar_mask = JAILHOUSE_IVSHMEM_BAR_MASK_INTX, + .shmem_regions_start = 3, + .shmem_dev_id = 0, + .shmem_peers = 2, + .shmem_protocol = JAILHOUSE_SHMEM_PROTO_VETH, + }, }, }; diff --git a/configs/riscv/qemu-linux-demo.c b/configs/riscv/qemu-linux-demo.c index e1947125..0ff62549 100644 --- a/configs/riscv/qemu-linux-demo.c +++ b/configs/riscv/qemu-linux-demo.c @@ -20,7 +20,7 @@ struct { struct jailhouse_cpu cpus[2]; struct jailhouse_memory mem_regions[8]; struct jailhouse_irqchip irqchips[1]; - struct jailhouse_pci_device pci_devices[0]; + struct jailhouse_pci_device pci_devices[1]; } __attribute__((packed)) config = { .cell = { .signature = JAILHOUSE_CELL_DESC_SIGNATURE, @@ -87,6 +87,16 @@ struct { }, .pci_devices = { + { /* IVSHMEM (networking) */ + .type = JAILHOUSE_PCI_TYPE_IVSHMEM, + .domain = 0x0000, + .bdf = 0x10 << 3, + .bar_mask = JAILHOUSE_IVSHMEM_BAR_MASK_INTX, + .shmem_regions_start = 4, + .shmem_dev_id = 1, + .shmem_peers = 2, + .shmem_protocol = JAILHOUSE_SHMEM_PROTO_VETH, + }, }, .irqchips = { diff --git a/configs/riscv/qemu-riscv64.c b/configs/riscv/qemu-riscv64.c index 1ace554b..75102bcc 100644 --- a/configs/riscv/qemu-riscv64.c +++ b/configs/riscv/qemu-riscv64.c @@ -36,7 +36,7 @@ struct { struct jailhouse_cpu cpus [6]; struct jailhouse_memory mem_regions [20]; struct jailhouse_irqchip irqchips [1]; - struct jailhouse_pci_device pci_devices[1]; + struct jailhouse_pci_device pci_devices[2]; struct jailhouse_pci_capability pci_caps[6]; } __attribute__((packed)) config = { .header = { @@ -224,6 +224,16 @@ struct { .msix_region_size = 0x1000, .msix_address = 0x40080000, }, + { /* IVSHMEM (networking) */ + .type = JAILHOUSE_PCI_TYPE_IVSHMEM, + .domain = 0x0000, + .bdf = 0x10 << 3, + .bar_mask = JAILHOUSE_IVSHMEM_BAR_MASK_INTX, + .shmem_regions_start = 16, + .shmem_dev_id = 0, + .shmem_peers = 2, + .shmem_protocol = JAILHOUSE_SHMEM_PROTO_VETH, + }, }, .pci_caps = { -- 2.36.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 jailhouse-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jailhouse-dev/20220627132905.4338-42-ralf.ramsauer%40oth-regensburg.de.