From 95e882148aea21dbdcc815c628aa3ca1585a3f0d Mon Sep 17 00:00:00 2001 From: Christoph Thelen Date: Fri, 27 Oct 2023 15:25:40 +0200 Subject: [PATCH] Replace mem2array with read_memory. The function "mem2array" is deprecated. Replace it with "read_memory", which has a slightly different footprint. --- plugins/romloader/jtag/openocd/tcl/chip_init.tcl | 8 ++------ plugins/romloader/jtag/openocd/tcl/jtag_detect_init.tcl | 4 +--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/plugins/romloader/jtag/openocd/tcl/chip_init.tcl b/plugins/romloader/jtag/openocd/tcl/chip_init.tcl index e7ecdfa..9c843f8 100644 --- a/plugins/romloader/jtag/openocd/tcl/chip_init.tcl +++ b/plugins/romloader/jtag/openocd/tcl/chip_init.tcl @@ -244,9 +244,7 @@ proc init_chip {iChiptyp} { puts "Configuring pad ctrl for MMIO4-7 (input, disable pull-down)" proc read_data32 {addr} { - set value(0) 0 - mem2array value 32 $addr 1 - return $value(0) + return [read_memory $addr 32 1] } proc unlock_asic_ctrl {} { @@ -296,9 +294,7 @@ proc init_chip {iChiptyp} { puts "Init netIOL (preliminary)" proc read_data32 {addr} { - set value(0) 0 - mem2array value 32 $addr 1 - return $value(0) + return [read_memory $addr 32 1] } # Initialize the PLL. diff --git a/plugins/romloader/jtag/openocd/tcl/jtag_detect_init.tcl b/plugins/romloader/jtag/openocd/tcl/jtag_detect_init.tcl index 6d7ef8e..0202b3a 100644 --- a/plugins/romloader/jtag/openocd/tcl/jtag_detect_init.tcl +++ b/plugins/romloader/jtag/openocd/tcl/jtag_detect_init.tcl @@ -510,9 +510,7 @@ proc probe_cpu {strCpu} { # ################################################################### proc mread32 {addr} { - set value(0) 0 - mem2array value 32 $addr 1 - return $value(0) + return [read_memory $addr 32 1] } # todo: pass target name from plugin