is the low level API upon which @command{flash banks} is implemented.
@itemize @bullet
-@item @b{ocd_mem2array} <@var{varname}> <@var{width}> <@var{addr}> <@var{nelems}>
+@item @b{mem2array} <@var{varname}> <@var{width}> <@var{addr}> <@var{nelems}>
Read memory and return as a Tcl array for script processing
-@item @b{ocd_array2mem} <@var{varname}> <@var{width}> <@var{addr}> <@var{nelems}>
+@item @b{array2mem} <@var{varname}> <@var{width}> <@var{addr}> <@var{nelems}>
Convert a Tcl array to memory locations and write the values
@item @b{ocd_flash_banks} <@var{driver}> <@var{base}> <@var{size}> <@var{chip_width}> <@var{bus_width}> <@var{target}> [@option{driver options} ...]
.usage = "filename [offset [type]]",
},
{
- .name = "ocd_mem2array",
+ .name = "mem2array",
.mode = COMMAND_EXEC,
.jim_handler = jim_mem2array,
.help = "read 8/16/32 bit memory and return as a TCL array "
.usage = "arrayname bitwidth address count",
},
{
- .name = "ocd_array2mem",
+ .name = "array2mem",
.mode = COMMAND_EXEC,
.jim_handler = jim_array2mem,
.help = "convert a TCL array to memory locations "
}
proc peek32 {address} {
- ocd_mem2array t 32 $address 1
+ mem2array t 32 $address 1
return $t(0)
}
proc read_register {register} {
set result ""
- ocd_mem2array result 32 $register 1
+ mem2array result 32 $register 1
return $result(0)
}
proc show_AIC { } {
global AIC_SMR
- if [catch { ocd_mem2array aaa 32 $AIC_SMR [expr 32 * 4] } msg ] {
+ if [catch { mem2array aaa 32 $AIC_SMR [expr 32 * 4] } msg ] {
error [format "%s (%s)" $msg AIC_SMR]
}
puts "AIC_SMR: Mode & Type"
incr x
}
global AIC_SVR
- if [catch { ocd_mem2array aaa 32 $AIC_SVR [expr 32 * 4] } msg ] {
+ if [catch { mem2array aaa 32 $AIC_SVR [expr 32 * 4] } msg ] {
error [format "%s (%s)" $msg AIC_SVR]
}
puts "AIC_SVR: Vectors"
proc memread32 {ADDR} {
set foo(0) 0
- if ![ catch { ocd_mem2array foo 32 $ADDR 1 } msg ] {
+ if ![ catch { mem2array foo 32 $ADDR 1 } msg ] {
return $foo(0)
} else {
error "memread32: $msg"
proc memread16 {ADDR} {
set foo(0) 0
- if ![ catch { ocd_mem2array foo 16 $ADDR 1 } msg ] {
+ if ![ catch { mem2array foo 16 $ADDR 1 } msg ] {
return $foo(0)
} else {
error "memread16: $msg"
proc memread8 {ADDR} {
set foo(0) 0
- if ![ catch { ocd_mem2array foo 8 $ADDR 1 } msg ] {
+ if ![ catch { mem2array foo 8 $ADDR 1 } msg ] {
return $foo(0)
} else {
error "memread8: $msg"
proc memwrite32 {ADDR DATA} {
set foo(0) $DATA
- if ![ catch { ocd_array2mem foo 32 $ADDR 1 } msg ] {
+ if ![ catch { array2mem foo 32 $ADDR 1 } msg ] {
return $foo(0)
} else {
error "memwrite32: $msg"
proc memwrite16 {ADDR DATA} {
set foo(0) $DATA
- if ![ catch { ocd_array2mem foo 16 $ADDR 1 } msg ] {
+ if ![ catch { array2mem foo 16 $ADDR 1 } msg ] {
return $foo(0)
} else {
error "memwrite16: $msg"
proc memwrite8 {ADDR DATA} {
set foo(0) $DATA
- if ![ catch { ocd_array2mem foo 8 $ADDR 1 } msg ] {
+ if ![ catch { array2mem foo 8 $ADDR 1 } msg ] {
return $foo(0)
} else {
error "memwrite8: $msg"
# mrw: "memory read word", returns value of $reg
proc mrw {reg} {
set value ""
- ocd_mem2array value 32 $reg 1
+ mem2array value 32 $reg 1
return $value(0)
}
# read a 64-bit register (memory mapped)
proc mr64bit {reg} {
set value ""
- ocd_mem2array value 32 $reg 2
+ mem2array value 32 $reg 2
return $value
}
set PLL_CLK_BYPASS [regs PLL_CLK_BYPASS]
puts [format "CLKCORE_AHB_CLK_CNTRL (0x%x): 0x%x" $CLKCORE_AHB_CLK_CNTRL [mrw $CLKCORE_AHB_CLK_CNTRL]]
- ocd_mem2array value 32 $CLKCORE_AHB_CLK_CNTRL 1
+ mem2array value 32 $CLKCORE_AHB_CLK_CNTRL 1
# see if the PLL is in bypass mode
set bypass [expr ($value(0) & $PLL_CLK_BYPASS) >> 24 ]
puts [format "PLL bypass bit: %d" $bypass]
set PLL_CLK_BYPASS [regs PLL_CLK_BYPASS]
puts [format "CLKCORE_ARM_CLK_CNTRL (0x%x): 0x%x" $CLKCORE_ARM_CLK_CNTRL [mrw $CLKCORE_ARM_CLK_CNTRL]]
- ocd_mem2array value 32 $CLKCORE_ARM_CLK_CNTRL 1
+ mem2array value 32 $CLKCORE_ARM_CLK_CNTRL 1
# see if the PLL is in bypass mode
set bypass [expr ($value(0) & $PLL_CLK_BYPASS) >> 24 ]
puts [format "PLL bypass bit: %d" $bypass]
# mrw: "memory read word", returns value of $reg
proc mrw {reg} {
set value ""
- ocd_mem2array value 32 $reg 1
+ mem2array value 32 $reg 1
return $value(0)
}
echo "# code to trigger $name vector"
set addr 0x20000000
- # ocd_array2mem should be faster, though we'd need to
+ # array2mem should be faster, though we'd need to
# compute the resulting $addr ourselves
foreach opcode $halfwords {
mwh $addr $opcode