diff --git a/Readme.md b/Readme.md index 22874798ba5453fbd62d962fd05b665b99c03374..2a564f7c1f70efd0cca96a5091e01223b42f2375 100755 --- a/Readme.md +++ b/Readme.md @@ -137,6 +137,29 @@ D2000支持FreeRTOS和VxWorks, FreeRTOS支持64位,VxWorks支持32位和64位 ![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000q_FreeRTOS64.png) + +32位FreeRTOS运行序列和效果如下所示: + + # modprobe jailhouse; + # jailhouse enable e2000q.cell; + # jailhouse cell create e2000q-inmate-rtos32.cell; + # jailhouse cell load 1 freertos32.bin --address 0xa0100000; + # jailhouse cell start 1; + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000q_FreeRTOS32.png) + + +32位VxWorks运行序列和效果如下所示: + + # modprobe jailhouse; + # jailhouse enable e2000q.cell; + # jailhouse cell create e2000q-inmate-rtos32.cell; + # jailhouse cell load 1 vxWorks32.bin --address 0xa0100000; + # jailhouse cell start 1; + +![](https://gitee.com/phytium_embedded/phytium-jailhouse/raw/master/pic/e2000q_vxworks32.png) + + ## 3.4 Linux 运行non-root Linux除加载Jailhouse驱动和root cell外,还需要提供内核镜像,设备树和根文件系统(目前为Ramdisk),还需要设定合适的启动参数,命令序列和运行效果如下图所示。 diff --git a/pic/e2000q_FreeRTOS32.png b/pic/e2000q_FreeRTOS32.png new file mode 100644 index 0000000000000000000000000000000000000000..1dd6726c13a24bf390e89872dc8a9fa58e38c19e Binary files /dev/null and b/pic/e2000q_FreeRTOS32.png differ diff --git a/pic/e2000q_vxworks32.png b/pic/e2000q_vxworks32.png new file mode 100644 index 0000000000000000000000000000000000000000..dc6e89b8a6745c0a8488ec208b6c4b41c60612ff Binary files /dev/null and b/pic/e2000q_vxworks32.png differ diff --git a/src/jailhouse/configs/arm64/e2000q-inmate-rtos32.c b/src/jailhouse/configs/arm64/e2000q-inmate-rtos32.c new file mode 100755 index 0000000000000000000000000000000000000000..f15b05b1200e23bf5f5b7329f8a5bbd9c19153ae --- /dev/null +++ b/src/jailhouse/configs/arm64/e2000q-inmate-rtos32.c @@ -0,0 +1,74 @@ +/* + * Jailhouse, a Linux-based partitioning hypervisor + * + * Configuration for rtos32 on Phytium e2000q + */ + +#include +#include + +struct { + struct jailhouse_cell_desc cell; + __u64 cpus[1]; + struct jailhouse_memory mem_regions[3]; + struct jailhouse_irqchip irqchips[1]; +} __attribute__((packed)) config = { + .cell = { + .signature = JAILHOUSE_CELL_DESC_SIGNATURE, + .revision = JAILHOUSE_CONFIG_REVISION, + .name = "e2000q-inmate-rtos32", + .flags = JAILHOUSE_CELL_PASSIVE_COMMREG | JAILHOUSE_CELL_AARCH32, + + .cpu_set_size = sizeof(config.cpus), + .cpu_reset_address = 0xa0100000, + .num_memory_regions = ARRAY_SIZE(config.mem_regions), + .num_irqchips = ARRAY_SIZE(config.irqchips), + + .console = { + .address = 0x2800d000, + .type = JAILHOUSE_CON_TYPE_PL011, + .flags = JAILHOUSE_CON_ACCESS_MMIO | + JAILHOUSE_CON_REGDIST_4, + }, + }, + + .cpus = { + 0x4, + }, + + .irqchips = { + { + .address = 0x30800000, + .pin_base = 32, + .pin_bitmap = { + 0, + 0, + 1 << (116 - 96), + 0, + }, + }, + }, + + .mem_regions = { + /* UART 1 */{ + .phys_start = 0x2800d000, + .virt_start = 0x2800d000, + .size = 0x1000, + .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE | + JAILHOUSE_MEM_IO | JAILHOUSE_MEM_ROOTSHARED, + }, + /* RAM */ { + .phys_start = 0xa0000000, + .virt_start = 0xa0000000, + .size = 0x10000000, + .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE | + JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_LOADABLE, + }, + /* communication region */ { + .virt_start = 0xa0000000, + .size = 0x1000, + .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE | + JAILHOUSE_MEM_COMM_REGION, + }, + }, +};