From f087f528f80e49636be581e3ef5711f0fc89bbda Mon Sep 17 00:00:00 2001 From: Appana Durga Kedareswara rao Date: Fri, 18 Oct 2024 14:14:52 +0530 Subject: [PATCH] boards: amd: kv260_r5: update the board cmake to use xsdb runner Update the board cmake to use xsdb runner, If users would like to use default xsdb.cfg then need to pass the fsbl.elf binary via --fsbl option when using west flash or twister commands. Usage: 1) west flash --runner xsdb --elf-file kv260_r5/zephyr/zephyr.elf --fsbl /fsbl.elf 2) ./scripts/twister -p kv260_r5 --west-runner xsdb --device-testing --device-serial /dev/ttyUSB0 --west-flash="--fsbl=/fsbl.elf" Signed-off-by: Appana Durga Kedareswara rao --- boards/amd/kv260_r5/board.cmake | 1 + boards/amd/kv260_r5/support/xsdb.cfg | 24 ++++++++++++++++++++++++ boards/common/xsdb.board.cmake | 6 ++++++ 3 files changed, 31 insertions(+) create mode 100644 boards/amd/kv260_r5/support/xsdb.cfg create mode 100644 boards/common/xsdb.board.cmake diff --git a/boards/amd/kv260_r5/board.cmake b/boards/amd/kv260_r5/board.cmake index 029cda7417c..1b095406484 100644 --- a/boards/amd/kv260_r5/board.cmake +++ b/boards/amd/kv260_r5/board.cmake @@ -1,3 +1,4 @@ # Copyright (c) 2022 Linaro. # # SPDX-License-Identifier: Apache-2.0 +include(${ZEPHYR_BASE}/boards/common/xsdb.board.cmake) diff --git a/boards/amd/kv260_r5/support/xsdb.cfg b/boards/amd/kv260_r5/support/xsdb.cfg new file mode 100644 index 00000000000..2976c9e763f --- /dev/null +++ b/boards/amd/kv260_r5/support/xsdb.cfg @@ -0,0 +1,24 @@ +# Copyright (c) 2024 Advanced Micro Devices, Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +proc load_image args { + set elf_file [lindex $args 0] + set fsblelf_file [lindex $args 1] + connect -url 127.0.0.1:3121 + after 2000 + targets -set -nocase -filter {name =~ "*R5*#0"} + rst -proc + dow $fsblelf_file + after 1000 + con + after 1000 + stop + targets -set -nocase -filter {name =~ "*R5*#0"} + after 2000 + dow $elf_file + con + exit +} + +load_image {*}$argv diff --git a/boards/common/xsdb.board.cmake b/boards/common/xsdb.board.cmake new file mode 100644 index 00000000000..2d95922a9c6 --- /dev/null +++ b/boards/common/xsdb.board.cmake @@ -0,0 +1,6 @@ +# Copyright (c) 2024 Advanced Micro Devices, Inc. +# +# SPDX-License-Identifier: Apache-2.0 +board_set_debugger_ifnset(xsdb) +board_set_flasher_ifnset(xsdb) +board_finalize_runner_args(xsdb)