On 04.02.20 11:13, Vijai Kumar K wrote:
> - GIC demo and ivshmem-demo are validated.
> 
> Signed-off-by: Vijai Kumar K <vijaikumar.kanagara...@gmail.com>
> ---
>  configs/arm64/pine64-plus-inmate-demo.c | 131 ++++++++++++++++++++++++
>  1 file changed, 131 insertions(+)
>  create mode 100644 configs/arm64/pine64-plus-inmate-demo.c
> 
> diff --git a/configs/arm64/pine64-plus-inmate-demo.c 
> b/configs/arm64/pine64-plus-inmate-demo.c
> new file mode 100644
> index 00000000..0564412d
> --- /dev/null
> +++ b/configs/arm64/pine64-plus-inmate-demo.c
> @@ -0,0 +1,131 @@
> +/*
> + * Jailhouse, a Linux-based partitioning hypervisor
> + *
> + * Configuration for gic-demo inmate on Pine64+ board
> + *
> + * Copyright (c) Vijai Kumar K, 2019-2020
> + *
> + * Authors:
> + *  Vijai Kumar K <vijaikumar.kanagara...@gmail.com>
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2.  See
> + * the COPYING file in the top-level directory.
> + */
> +
> +#include <jailhouse/types.h>
> +#include <jailhouse/cell-config.h>
> +
> +struct {
> +     struct jailhouse_cell_desc cell;
> +     __u64 cpus[1];
> +     struct jailhouse_memory mem_regions[8];
> +     struct jailhouse_irqchip irqchips[1];
> +     struct jailhouse_pci_device pci_devices[1];
> +} __attribute__((packed)) config = {
> +     .cell = {
> +             .signature = JAILHOUSE_CELL_DESC_SIGNATURE,
> +             .revision = JAILHOUSE_CONFIG_REVISION,
> +             .name = "inmate-demo",
> +             .flags = JAILHOUSE_CELL_PASSIVE_COMMREG,
> +
> +             .cpu_set_size = sizeof(config.cpus),
> +             .num_memory_regions = ARRAY_SIZE(config.mem_regions),
> +             .num_pci_devices = ARRAY_SIZE(config.pci_devices),
> +             .num_irqchips = ARRAY_SIZE(config.irqchips),
> +             .vpci_irq_base = 125,
> +
> +             .console = {
> +                     .address = 0x1c28000,
> +                     .type = JAILHOUSE_CON_TYPE_8250,
> +                     .flags = JAILHOUSE_CON_ACCESS_MMIO |
> +                              JAILHOUSE_CON_REGDIST_4,
> +             },
> +     },
> +
> +     .cpus = {
> +             0x2,
> +     },
> +
> +     .mem_regions = {
> +             /* IVSHMEM shared memory regions for 00:00.0 (demo) */
> +             /* State Table */ {
> +                     .phys_start = 0xbbef1000,
> +                     .virt_start = 0xbbef1000,
> +                     .size = 0x1000,
> +                     .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_ROOTSHARED,
> +             },
> +             /* Read/Write Section */ {
> +                     .phys_start = 0xbbef2000,
> +                     .virt_start = 0xbbef2000,
> +                     .size = 0x9000,
> +                     .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
> +                             JAILHOUSE_MEM_ROOTSHARED,
> +             },
> +             /* Output (peer 0) */ {
> +                     .phys_start = 0xbbefb000,
> +                     .virt_start = 0xbbefb000,
> +                     .size = 0x2000,
> +                     .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_ROOTSHARED,
> +             },
> +             /* Output (peer 1) */ {
> +                     .phys_start = 0xbbefd000,
> +                     .virt_start = 0xbbefd000,
> +                     .size = 0x2000,
> +                     .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
> +                             JAILHOUSE_MEM_ROOTSHARED,
> +             },
> +             /* Output (peer 2) */ {
> +                     .phys_start = 0xbbeff000,
> +                     .virt_start = 0xbbeff000,
> +                     .size = 0x2000,
> +                     .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_ROOTSHARED,
> +             },
> +             /* UART */ {
> +                     .phys_start = 0x1c28000,
> +                     .virt_start = 0x1c28000,
> +                     .size = 0x400,
> +                     .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
> +                             JAILHOUSE_MEM_IO | JAILHOUSE_MEM_IO_32 |
> +                             JAILHOUSE_MEM_ROOTSHARED,
> +             },
> +             /* RAM */ {
> +                     .phys_start = 0xbbee1000,
> +                     .virt_start = 0,
> +                     .size = 0x00010000,
> +                     .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
> +                             JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_LOADABLE,
> +             },
> +             /* communication region */ {
> +                     .virt_start = 0x80000000,
> +                     .size = 0x00001000,
> +                     .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
> +                             JAILHOUSE_MEM_COMM_REGION,
> +             },
> +     },
> +
> +     .irqchips = {
> +             /* GIC */ {
> +                     .address = 0x01c81000,
> +                     .pin_base = 32,
> +                     .pin_bitmap = {
> +                             0,
> +                             0,
> +                             0,
> +                             (1 << (157 - 128))
> +                     },
> +             },
> +     },
> +
> +     .pci_devices = {
> +             { /* IVSHMEM 0001:00:00.0 (demo) */
> +                     .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
> +                     .domain = 1,

Domain is actually 0 for this inmate, but also meaningless (only
processed by the Linux driver for the root cell).

> +                     .bdf = 0 << 3,
> +                     .bar_mask = JAILHOUSE_IVSHMEM_BAR_MASK_INTX,
> +                     .shmem_regions_start = 0,
> +                     .shmem_dev_id = 1,
> +                     .shmem_peers = 3,
> +                     .shmem_protocol = JAILHOUSE_SHMEM_PROTO_UNDEFINED,
> +             },
> +     },
> +};
> 

Jan

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/512cf9ab-a1ea-7b1e-a4c5-4f81afb0280d%40siemens.com.

Reply via email to