1# SPDX-License-Identifier: Apache-2.0
2# Copyright (c) 2018 SiFive, Inc.
3
4set(SUPPORTED_EMU_PLATFORMS renode qemu)
5set(RENODE_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/support/hifive1.resc)
6set(RENODE_UART sysbus.uart0)
7
8set(QEMU_binary_suffix riscv32)
9set(QEMU_CPU_TYPE_${ARCH} riscv32)
10
11set(QEMU_FLAGS_${ARCH}
12  -nographic
13  -machine sifive_e
14  )
15
16if("${BOARD_REVISION}" STREQUAL "A")
17  board_set_flasher_ifnset(hifive1)
18  board_finalize_runner_args(hifive1)
19  board_runner_args(openocd --cmd-load "hifive1-load")
20  board_runner_args(openocd --cmd-reset-halt "hifive1-reset-halt")
21  board_runner_args(openocd --cmd-post-verify "hifive1-post-verify")
22  include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
23elseif("${BOARD_REVISION}" STREQUAL "B")
24  board_runner_args(jlink "--device=FE310")
25  board_runner_args(jlink "--iface=JTAG")
26  board_runner_args(jlink "--speed=4000")
27  board_runner_args(jlink "--tool-opt=-jtagconf -1,-1")
28  board_runner_args(jlink "--tool-opt=-autoconnect 1")
29  include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
30endif()
31
32set_ifndef(BOARD_SIM_RUNNER renode)
33set_ifndef(BOARD_ROBOT_RUNNER renode-robot)
34include(${ZEPHYR_BASE}/boards/common/renode.board.cmake)
35include(${ZEPHYR_BASE}/boards/common/renode_robot.board.cmake)
36