> -----Original Message-----
> From: Jan Kiszka [mailto:[email protected]]
> Sent: 2022年3月3日 20:00
> To: Peng Fan (OSS) <[email protected]>;
> [email protected]
> Cc: Peng Fan <[email protected]>
> Subject: Re: [PATCH] configs: arm64: qemu zephyr inmate
> 
> On 01.03.22 09:09, Peng Fan (OSS) wrote:
> > From: Peng Fan <[email protected]>
> >
> > After root cell start up, use following steps to start zephyr inmate:
> > jailhouse cell create qemu-arm64-zephyr-demo.cell jailhouse cell load
> > zephyr.bin -a 0x70000000 jailhouse cell start
> >
> > Currently ivshmem not supported.
> >
> > Signed-off-by: Peng Fan <[email protected]>
> > ---
> >
> > V1:
> >  Just a copy of linux inmate cell with minor update for zephyr usage.
> >  zephyr ivshmem-v2 is not supported for now, but I not remove that
> > from  cell file.
> >  Zephyr PR:
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> >
> ub.com%2Fzephyrproject-rtos%2Fzephyr%2Fpull%2F43301&amp;data=04%7
> C01%7
> >
> Cpeng.fan%40nxp.com%7Ce66ac20ef6444d239fab08d9fd0d5e35%7C686ea1
> d3bc2b4
> >
> c6fa92cd99c5c301635%7C0%7C0%7C637819056122949007%7CUnknown%
> 7CTWFpbGZsb
> >
> 3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0
> %3D%
> >
> 7C3000&amp;sdata=5W%2FeJXaP4LCVWAvrUePKG%2FlKb93oQuo%2FtT0rsv
> sQTrs%3D&
> > amp;reserved=0
> >
> 
> What is the delta, and why do we need it (asking while being too lazy to diff
> myself - but you should also try to make my life easy here ;) ).
> Can we possibly enhance linux-inmate to cater both cases?

Zephyr inmate has cpu_reset_address and use cpu 0,1.
Zephyr arm64 not only support boots from cpu 0 now, but this could be
addressed in future.

Regards,
Peng.

> 
> Jan
> 
> >  configs/arm64/qemu-arm64-zephyr-demo.c | 155
> > +++++++++++++++++++++++++
> >  1 file changed, 155 insertions(+)
> >  create mode 100644 configs/arm64/qemu-arm64-zephyr-demo.c
> >
> > diff --git a/configs/arm64/qemu-arm64-zephyr-demo.c
> > b/configs/arm64/qemu-arm64-zephyr-demo.c
> > new file mode 100644
> > index 00000000..e5e36237
> > --- /dev/null
> > +++ b/configs/arm64/qemu-arm64-zephyr-demo.c
> > @@ -0,0 +1,155 @@
> > +/*
> > + * Jailhouse, a Linux-based partitioning hypervisor
> > + *
> > + * Configuration for zephyr-demo inmate on QEMU arm64:
> > + * 2 CPUs, 128M RAM, serial port
> > + *
> > + * Copyright (c) Siemens AG, 2014-2017
> > + * Copyright 2022 NXP
> > + *
> > + * Authors:
> > + *  Jan Kiszka <[email protected]>
> > + *  Peng Fan <[email protected]>
> > + *
> > + * 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[13];
> > +   struct jailhouse_irqchip irqchips[1];
> > +   struct jailhouse_pci_device pci_devices[2]; }
> > +__attribute__((packed)) config = {
> > +   .cell = {
> > +           .signature = JAILHOUSE_CELL_DESC_SIGNATURE,
> > +           .revision = JAILHOUSE_CONFIG_REVISION,
> > +           .name = "qemu-arm64-zephyr-demo",
> > +           .flags = JAILHOUSE_CELL_PASSIVE_COMMREG |
> > +                   JAILHOUSE_CELL_VIRTUAL_CONSOLE_PERMITTED,
> > +
> > +           .cpu_set_size = sizeof(config.cpus),
> > +           .num_memory_regions = ARRAY_SIZE(config.mem_regions),
> > +           .num_irqchips = ARRAY_SIZE(config.irqchips),
> > +           .num_pci_devices = ARRAY_SIZE(config.pci_devices),
> > +
> > +           .vpci_irq_base = 140-32,
> > +           .cpu_reset_address = 0x70000000,
> > +
> > +           .console = {
> > +                   .address = 0x09000000,
> > +                   .type = JAILHOUSE_CON_TYPE_PL011,
> > +                   .flags = JAILHOUSE_CON_ACCESS_MMIO |
> > +                            JAILHOUSE_CON_REGDIST_4,
> > +           },
> > +   },
> > +
> > +   .cpus = {
> > +           0x3,
> > +   },
> > +
> > +   .mem_regions = {
> > +           /* IVSHMEM shared memory regions (demo) */
> > +           {
> > +                   .phys_start = 0x7faf0000,
> > +                   .virt_start = 0x7faf0000,
> > +                   .size = 0x1000,
> > +                   .flags = JAILHOUSE_MEM_READ |
> JAILHOUSE_MEM_ROOTSHARED,
> > +           },
> > +           {
> > +                   .phys_start = 0x7faf1000,
> > +                   .virt_start = 0x7faf1000,
> > +                   .size = 0x9000,
> > +                   .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
> > +                           JAILHOUSE_MEM_ROOTSHARED,
> > +           },
> > +           {
> > +                   .phys_start = 0x7fafa000,
> > +                   .virt_start = 0x7fafa000,
> > +                   .size = 0x2000,
> > +                   .flags = JAILHOUSE_MEM_READ |
> JAILHOUSE_MEM_ROOTSHARED,
> > +           },
> > +           {
> > +                   .phys_start = 0x7fafc000,
> > +                   .virt_start = 0x7fafc000,
> > +                   .size = 0x2000,
> > +                   .flags = JAILHOUSE_MEM_READ |
> JAILHOUSE_MEM_ROOTSHARED,
> > +           },
> > +           {
> > +                   .phys_start = 0x7fafe000,
> > +                   .virt_start = 0x7fafe000,
> > +                   .size = 0x2000,
> > +                   .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
> > +                           JAILHOUSE_MEM_ROOTSHARED,
> > +           },
> > +           /* IVSHMEM shared memory region */
> > +           JAILHOUSE_SHMEM_NET_REGIONS(0x7fb00000, 1),
> > +           /* UART */ {
> > +                   .phys_start = 0x09000000,
> > +                   .virt_start = 0x09000000,
> > +                   .size = 0x1000,
> > +                   .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
> > +                           JAILHOUSE_MEM_IO | JAILHOUSE_MEM_ROOTSHARED,
> > +           },
> > +           /* RAM */ {
> > +                   .phys_start = 0x7f900000,
> > +                   .virt_start = 0,
> > +                   .size = 0x10000,
> > +                   .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
> > +                           JAILHOUSE_MEM_EXECUTE |
> JAILHOUSE_MEM_LOADABLE,
> > +           },
> > +           /* RAM */ {
> > +                   .phys_start = 0x70000000,
> > +                   .virt_start = 0x70000000,
> > +                   .size = 0x8000000,
> > +                   .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
> > +                           JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA |
> > +                           JAILHOUSE_MEM_LOADABLE,
> > +           },
> > +           /* communication region */ {
> > +                   .virt_start = 0x80000000,
> > +                   .size = 0x00001000,
> > +                   .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
> > +                           JAILHOUSE_MEM_COMM_REGION,
> > +           },
> > +   },
> > +
> > +   .irqchips = {
> > +           /* GIC */ {
> > +                   .address = 0x08000000,
> > +                   .pin_base = 32,
> > +                   .pin_bitmap = {
> > +                           1 << (33 - 32),
> > +                           0,
> > +                           0,
> > +                           (1 << (140 - 128)) | (1 << (141 - 128))
> > +                   },
> > +           },
> > +   },
> > +
> > +   .pci_devices = {
> > +           { /* IVSHMEM 00:00.0 (demo) */
> > +                   .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
> > +                   .domain = 1,
> > +                   .bdf = 0 << 3,
> > +                   .bar_mask = JAILHOUSE_IVSHMEM_BAR_MASK_INTX,
> > +                   .shmem_regions_start = 0,
> > +                   .shmem_dev_id = 2,
> > +                   .shmem_peers = 3,
> > +                   .shmem_protocol = JAILHOUSE_SHMEM_PROTO_UNDEFINED,
> > +           },
> > +           { /* IVSHMEM 00:01.0 (networking) */
> > +                   .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
> > +                   .bdf = 1 << 3,
> > +                   .bar_mask = JAILHOUSE_IVSHMEM_BAR_MASK_INTX,
> > +                   .shmem_regions_start = 5,
> > +                   .shmem_dev_id = 1,
> > +                   .shmem_peers = 2,
> > +                   .shmem_protocol = JAILHOUSE_SHMEM_PROTO_VETH,
> > +           },
> > +   },
> > +};
> 
> --
> Siemens AG, Technology
> 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/DU0PR04MB9417FB18D5606654EE4A51D888059%40DU0PR04MB9417.eurprd04.prod.outlook.com.

Reply via email to