On 27.05.20 14:32, [email protected] wrote:
> 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 | 63 ++++++++++++++++++++++--
> 1 file changed, 59 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..e09c4850 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,
This means the kernel is configured for 64K pages - rather uncommon and
problematic in many regards (just had to turn it off on AM65x because it
breaks userspace [1]).
> + .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,30 @@ 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 */ {
> + .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
> + .bdf = 0 << 3,
> + .bar_mask = JAILHOUSE_IVSHMEM_BAR_MASK_INTX,
This constant assumes 4K pages.
Given all the problems with 64K, I suspect it's better to switch to
standard 4K.
Jan
> + .shmem_regions_start = 0,
> + .shmem_dev_id = 1,
> + .shmem_peers = 2,
> + .shmem_protocol = JAILHOUSE_SHMEM_PROTO_UNDEFINED,
> + },
> + },
> };
>
[1]
https://github.com/siemens/meta-iot2050/commit/fb1d72677fb7443d851b032517d693bbd0e1d1e4
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
--
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/6e2a0459-3707-99ea-27b0-184f643d27fb%40siemens.com.