Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 72 additions & 9 deletions boards/amd/kv260_r5/support/xsdb.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,86 @@
#
# SPDX-License-Identifier: Apache-2.0

proc boot_jtag { } {
# switch to JTAG boot mode #
targets -set -filter {name =~ "PSU*"}
stop
# update multiboot to ZERO
mwr 0xffca0010 0x0
# change boot mode to JTAG
mwr 0xff5e0200 0x0100
# reset
rst -system
}

proc load_image args {
set elf_file [lindex $args 0]
set fsblelf_file [lindex $args 1]
connect -url 127.0.0.1:3121
set bitfile [lindex $args 1]
set fsblelf_file [lindex $args 2]

if { [info exists ::env(HW_SERVER_URL)] } {
connect -url $::env(HW_SERVER_URL)
} else {
connect
}

after 2000

# setup jtag boot mode
boot_jtag
after 2000

targets -set -nocase -filter {name =~ "*R5*#0"}

# load bitstream if passed
if { [string length $bitfile] != 0 } {
fpga -f $bitfile -no-revision-check
}

rst -proc
dow $fsblelf_file
after 1000
con
after 1000
stop
targets -set -nocase -filter {name =~ "*R5*#0"}

# load FSBL if passed
if { [string length $fsblelf_file] != 0 } {
dow $fsblelf_file
after 1000
con
after 1000
stop
}

after 2000
dow $elf_file
con
exit
}

load_image {*}$argv
switch $argc {
"1" {
set zephyr_elf [lindex $argv 0]
set bitstream ""
set fsbl_elf ""
}
"2" {
set par [lindex $argv 1]
set substring "*.bit"
if { [string match -nocase $substring $par] == 0 } {
set bitstream ""
set fsbl_elf $par
} else {
set bitstream $par
set fsbl_elf ""
}
set zephyr_elf [lindex $argv 0]
}
"3" {
set zephyr_elf [lindex $argv 0]
set bitstream [lindex $argv 1]
set fsbl_elf [lindex $argv 2]
}
default {
puts "Unsifficient number for args"
exit -1
}
}

load_image "$zephyr_elf" "$bitstream" "$fsbl_elf"
Loading