From 40e843aa5d2e1b52e125d4bbd595e78aae7182ff Mon Sep 17 00:00:00 2001 From: Yan-Jie Wang Date: Fri, 13 Oct 2023 12:24:08 +0800 Subject: [PATCH] fix(demos/linux+zephyr): fix linux+zephyr demo on fvp-a The addresses in config file of bao and the device tree for zephyr are not consistent. Change the config file of bao to match the addresses in the device tree for zephyr. Signed-off-by: Yan-Jie Wang Signed-off-by: Jose Martins --- demos/linux+zephyr/configs/fvp-a-aarch32.c | 138 ++++++++++++++++++++- demos/linux+zephyr/configs/fvp-a.c | 12 +- 2 files changed, 143 insertions(+), 7 deletions(-) mode change 120000 => 100755 demos/linux+zephyr/configs/fvp-a-aarch32.c diff --git a/demos/linux+zephyr/configs/fvp-a-aarch32.c b/demos/linux+zephyr/configs/fvp-a-aarch32.c deleted file mode 120000 index 32d6eb3..0000000 --- a/demos/linux+zephyr/configs/fvp-a-aarch32.c +++ /dev/null @@ -1 +0,0 @@ -fvp-a.c \ No newline at end of file diff --git a/demos/linux+zephyr/configs/fvp-a-aarch32.c b/demos/linux+zephyr/configs/fvp-a-aarch32.c new file mode 100755 index 0000000..9a49fd8 --- /dev/null +++ b/demos/linux+zephyr/configs/fvp-a-aarch32.c @@ -0,0 +1,137 @@ +#include + +VM_IMAGE(linux_image, XSTR(BAO_DEMOS_WRKDIR_IMGS/linux.bin)); +VM_IMAGE(zephyr_image, XSTR(BAO_DEMOS_WRKDIR_IMGS/zephyr.bin)); + +struct config config = { + + .shmemlist_size = 1, + .shmemlist = (struct shmem[]) { + [0] = { .size = 0x00010000, } + }, + + .vmlist_size = 2, + .vmlist = { + { + .image = { + .base_addr = 0xa0000000, + .load_addr = VM_IMAGE_OFFSET(linux_image), + .size = VM_IMAGE_SIZE(linux_image), + }, + + .entry = 0xa0000000, + + .platform = { + .cpu_num = 2, + + .region_num = 1, + .regions = (struct vm_mem_region[]) { + { + .base = 0xa0000000, + .size = 0x40000000, + .place_phys = true, + .phys = 0xa0000000, + } + }, + + .ipc_num = 1, + .ipcs = (struct ipc[]) { + { + .base = 0xf0000000, + .size = 0x00010000, + .shmem_id = 0, + .interrupt_num = 1, + .interrupts = (irqid_t[]) {52} + } + }, + + .dev_num = 3, + .devs = (struct vm_dev_region[]) { + { + /* UART1, PL011 */ + .pa = 0x1c0a0000, + .va = 0x1c0a0000, + .size = 0x10000, + .interrupt_num = 1, + .interrupts = (irqid_t[]) {38} + }, + { + /* smsc,lan91c111t */ + .pa = 0x01a000000, + .va = 0x01a000000, + .size = 0x10000, + .interrupt_num = 1, + .interrupts = (irqid_t[]) {47} + }, + { + .interrupt_num = 1, + .interrupts = (irqid_t[]) {27} + } + }, + + .arch = { + .gic = { + .gicr_addr = 0x2F100000, + .gicd_addr = 0x2F000000 + } + } + }, + }, + { + .image = { + .base_addr = 0x20000000, + .load_addr = VM_IMAGE_OFFSET(zephyr_image), + .size = VM_IMAGE_SIZE(zephyr_image) + }, + + .entry = 0x20000000, + + .platform = { + .cpu_num = 2, + + .region_num = 1, + .regions = (struct vm_mem_region[]) { + { + .base = 0x20000000, + .size = 0x8000000 + } + }, + + + .ipc_num = 1, + .ipcs = (struct ipc[]) { + { + .base = 0x70000000, + .size = 0x00010000, + .shmem_id = 0, + .interrupt_num = 1, + .interrupts = (irqid_t[]) {52} + } + }, + + .dev_num = 2, + .devs = (struct vm_dev_region[]) { + { + /* UART2, PL011 */ + .pa = 0x1c0b0000, + .va = 0x9c0b0000, + .size = 0x10000, + .interrupt_num = 1, + .interrupts = (irqid_t[]) {39} + }, + { + .interrupt_num = 1, + .interrupts = (irqid_t[]) {27} + } + }, + + .arch = { + .gic = { + .gicd_addr = 0xaf000000, + .gicr_addr = 0xaf100000, + } + } + }, + }, + }, +}; diff --git a/demos/linux+zephyr/configs/fvp-a.c b/demos/linux+zephyr/configs/fvp-a.c index 9a49fd8..d51b6c0 100755 --- a/demos/linux+zephyr/configs/fvp-a.c +++ b/demos/linux+zephyr/configs/fvp-a.c @@ -79,12 +79,12 @@ struct config config = { }, { .image = { - .base_addr = 0x20000000, + .base_addr = 0x90000000, .load_addr = VM_IMAGE_OFFSET(zephyr_image), .size = VM_IMAGE_SIZE(zephyr_image) }, - .entry = 0x20000000, + .entry = 0x90000000, .platform = { .cpu_num = 2, @@ -92,7 +92,7 @@ struct config config = { .region_num = 1, .regions = (struct vm_mem_region[]) { { - .base = 0x20000000, + .base = 0x90000000, .size = 0x8000000 } }, @@ -114,7 +114,7 @@ struct config config = { { /* UART2, PL011 */ .pa = 0x1c0b0000, - .va = 0x9c0b0000, + .va = 0x1c0b0000, .size = 0x10000, .interrupt_num = 1, .interrupts = (irqid_t[]) {39} @@ -127,8 +127,8 @@ struct config config = { .arch = { .gic = { - .gicd_addr = 0xaf000000, - .gicr_addr = 0xaf100000, + .gicd_addr = 0x2f000000, + .gicr_addr = 0x2f100000, } } },