boards: arm: QEMU target for Cortex-A9 simulation
The qemu_cortex_a9 target simulates the Xilinx Zynq-7000 in a single core configuration with 512 MB of RAM. Supported peripherals are the Zynq's two UARTs, of which one is activated for console use, and the two Ethernet controllers, of which GEM0 can be linked to the local zeth interface. This target uses Xilinx' fork of QEMU, which is already being used by the qemu_cortex_r5 target. Although being labelled 'arm64', this version of QEMU is also capable of emulating the Zynq-7000 based on a binary device tree file. While regular QEMU provides a Zynq-based machine, this implementation is buggy and/or incomplete. Signed-off-by: Immo Birnbaum <Immo.Birnbaum@weidmueller.com>
This commit is contained in:
parent
01882b8624
commit
d90f3b4dd5
7 changed files with 231 additions and 0 deletions
11
boards/arm/qemu_cortex_a9/Kconfig.board
Normal file
11
boards/arm/qemu_cortex_a9/Kconfig.board
Normal file
|
@ -0,0 +1,11 @@
|
|||
#
|
||||
# Kconfig - Cortex-A9 QEMU Emulation
|
||||
#
|
||||
# Copyright (c) 2021, Weidmueller Interface GmbH & Co. KG
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
config BOARD_QEMU_CORTEX_A9
|
||||
bool "Cortex-A9 Emulation (QEMU)"
|
||||
depends on SOC_XILINX_ZYNQ7000
|
||||
select QEMU_TARGET
|
99
boards/arm/qemu_cortex_a9/Kconfig.defconfig
Normal file
99
boards/arm/qemu_cortex_a9/Kconfig.defconfig
Normal file
|
@ -0,0 +1,99 @@
|
|||
#
|
||||
# Kconfig - Cortex-A9 (Zynq-7000) QEMU Emulation
|
||||
#
|
||||
# Copyright (c) 2021, Weidmueller Interface GmbH & Co. KG
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
if BOARD_QEMU_CORTEX_A9
|
||||
|
||||
config BUILD_OUTPUT_BIN
|
||||
default n
|
||||
|
||||
config BOARD
|
||||
default "qemu_cortex_a9"
|
||||
|
||||
config SYS_CLOCK_HW_CYCLES_PER_SEC
|
||||
int
|
||||
default 100000000
|
||||
|
||||
config SYS_CLOCK_TICKS_PER_SEC
|
||||
default 100
|
||||
|
||||
if CONSOLE
|
||||
|
||||
config UART_CONSOLE
|
||||
default y
|
||||
|
||||
endif # CONSOLE
|
||||
|
||||
if LOG
|
||||
|
||||
if LOG_PROCESS_THREAD
|
||||
|
||||
config LOG_PROCESS_THREAD_STACK_SIZE
|
||||
default 8192
|
||||
|
||||
endif # LOG_PROCESS_THREAD
|
||||
|
||||
endif # LOG
|
||||
|
||||
if NETWORKING
|
||||
|
||||
config NET_L2_ETHERNET
|
||||
default y
|
||||
|
||||
config NET_TX_STACK_SIZE
|
||||
default 8192
|
||||
|
||||
config NET_RX_STACK_SIZE
|
||||
default 8192
|
||||
|
||||
if NET_TCP
|
||||
|
||||
config NET_TCP_WORKQ_STACK_SIZE
|
||||
default 8192
|
||||
|
||||
endif # NET_TCP
|
||||
|
||||
if NET_MGMT_EVENT
|
||||
|
||||
config NET_MGMT_EVENT_STACK_SIZE
|
||||
default 8192
|
||||
|
||||
endif # NET_MGMT_EVENT
|
||||
|
||||
config TEST_RANDOM_GENERATOR
|
||||
default y
|
||||
|
||||
endif # NETWORKING
|
||||
|
||||
if QEMU_ICOUNT
|
||||
|
||||
config QEMU_ICOUNT_SHIFT
|
||||
default 3
|
||||
|
||||
endif # QEMU_ICOUNT
|
||||
|
||||
if SERIAL
|
||||
|
||||
config UART_XLNX_PS
|
||||
default y
|
||||
|
||||
endif # SERIAL
|
||||
|
||||
if SHELL
|
||||
|
||||
config SHELL_STACK_SIZE
|
||||
default 8192
|
||||
|
||||
endif # SHELL
|
||||
|
||||
if UART_PIPE
|
||||
|
||||
config UART_PIPE_ON_DEV_NAME
|
||||
default "uart1"
|
||||
|
||||
endif # UART_PIPE
|
||||
|
||||
endif # BOARD_QEMU_CORTEX_A9
|
21
boards/arm/qemu_cortex_a9/board.cmake
Normal file
21
boards/arm/qemu_cortex_a9/board.cmake
Normal file
|
@ -0,0 +1,21 @@
|
|||
#
|
||||
# Copyright (c) 2021, Weidmueller Interface GmbH & Co. KG
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set(EMU_PLATFORM qemu)
|
||||
set(QEMU_ARCH xilinx-aarch64)
|
||||
|
||||
set(QEMU_CPU_TYPE_${ARCH} cortex-a9)
|
||||
|
||||
set(QEMU_FLAGS_${ARCH}
|
||||
-nographic
|
||||
-machine arm-generic-fdt-7series
|
||||
-dtb ${ZEPHYR_BASE}/boards/${ARCH}/${BOARD}/fdt-zynq7000s.dtb
|
||||
)
|
||||
|
||||
set(QEMU_KERNEL_OPTION
|
||||
"-device;loader,file=\$<TARGET_FILE:\${logical_target_for_zephyr_elf}>,cpu-num=0"
|
||||
)
|
||||
|
||||
board_set_debugger_ifnset(qemu)
|
BIN
boards/arm/qemu_cortex_a9/fdt-zynq7000s.dtb
Normal file
BIN
boards/arm/qemu_cortex_a9/fdt-zynq7000s.dtb
Normal file
Binary file not shown.
51
boards/arm/qemu_cortex_a9/qemu_cortex_a9.dts
Normal file
51
boards/arm/qemu_cortex_a9/qemu_cortex_a9.dts
Normal file
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* Copyright (c) 2021 Weidmueller Interface GmbH & Co. KG
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include <xilinx/zynq7000.dtsi>
|
||||
#include <dt-bindings/ethernet/xlnx_gem.h>
|
||||
|
||||
/ {
|
||||
model = "QEMU Cortex-A9";
|
||||
compatible = "xlnx,zynq7000";
|
||||
interrupt-parent = <&gic>;
|
||||
|
||||
sram0: memory@100000 {
|
||||
compatible = "mmio-sram";
|
||||
reg = <0x00100000 DT_SIZE_M(512)>;
|
||||
};
|
||||
|
||||
flash0: flash@0 {
|
||||
reg = <0x00000000 DT_SIZE_M(256)>;
|
||||
};
|
||||
|
||||
chosen {
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,console = &uart0;
|
||||
zephyr,shell-uart = &uart0;
|
||||
zephyr,ocm = &ocm_low;
|
||||
};
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
status = "okay";
|
||||
current-speed = <115200>;
|
||||
clock-frequency = <50000000>;
|
||||
};
|
||||
|
||||
&uart1 {
|
||||
status = "okay";
|
||||
current-speed = <115200>;
|
||||
clock-frequency = <50000000>;
|
||||
};
|
||||
|
||||
&gem0 {
|
||||
status = "okay";
|
||||
clock-frequency = <1000000000>;
|
||||
mdc-divider = <XLNX_GEM_MDC_DIVIDER_224>;
|
||||
local-mac-address = [00 00 00 01 02 03];
|
||||
};
|
26
boards/arm/qemu_cortex_a9/qemu_cortex_a9.yaml
Normal file
26
boards/arm/qemu_cortex_a9/qemu_cortex_a9.yaml
Normal file
|
@ -0,0 +1,26 @@
|
|||
#
|
||||
# Copyright (c) 2018, Diego Sueiro
|
||||
# Copyright (c) 2021, Weidmueller Interface GmbH & Co. KG
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
identifier: qemu_cortex_a9
|
||||
name: QEMU Emulation for Cortex-A9
|
||||
type: qemu
|
||||
simulation: qemu
|
||||
arch: arm
|
||||
toolchain:
|
||||
- zephyr
|
||||
- gnuarmemb
|
||||
- xtools
|
||||
supported:
|
||||
- net
|
||||
- netif:eth
|
||||
ram: 524288
|
||||
flash: 262144
|
||||
testing:
|
||||
default: true
|
||||
ignore_tags:
|
||||
- bluetooth
|
||||
- gpio
|
23
boards/arm/qemu_cortex_a9/qemu_cortex_a9_defconfig
Normal file
23
boards/arm/qemu_cortex_a9/qemu_cortex_a9_defconfig
Normal file
|
@ -0,0 +1,23 @@
|
|||
#
|
||||
# Copyright (c) 2021, Weidmueller Interface GmbH & Co. KG
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
CONFIG_SOC_SERIES_XILINX_ZYNQ7000=y
|
||||
CONFIG_SOC_XILINX_ZYNQ7000=y
|
||||
CONFIG_BOARD_QEMU_CORTEX_A9=y
|
||||
|
||||
CONFIG_ARM_ARCH_TIMER=y
|
||||
|
||||
CONFIG_SERIAL=y
|
||||
CONFIG_CONSOLE=y
|
||||
|
||||
CONFIG_ARMV7_EXCEPTION_STACK_SIZE=8192
|
||||
CONFIG_ARMV7_FIQ_STACK_SIZE=8192
|
||||
CONFIG_ARMV7_SVC_STACK_SIZE=8192
|
||||
CONFIG_ARMV7_SYS_STACK_SIZE=8192
|
||||
CONFIG_IDLE_STACK_SIZE=8192
|
||||
CONFIG_ISR_STACK_SIZE=8192
|
||||
CONFIG_MAIN_STACK_SIZE=8192
|
||||
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192
|
Loading…
Add table
Add a link
Reference in a new issue