TCL scripts: collect duplicated procedures
TCL procedures mrw and mmw, originally in DaVinci target code, are duplicated in other TCL scripts. Moved in a common helper file, and added help/usage description. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
committed by
Øyvind Harboe
parent
ea48794210
commit
edefee9880
@@ -7,20 +7,7 @@ proc davinci_pinmux {soc reg value} {
|
||||
mww [expr [dict get $soc sysbase] + 4 * $reg] $value
|
||||
}
|
||||
|
||||
# mrw: "memory read word", returns value of $reg
|
||||
proc mrw {reg} {
|
||||
set value ""
|
||||
mem2array value 32 $reg 1
|
||||
return $value(0)
|
||||
}
|
||||
|
||||
# mmw: "memory modify word", updates value of $reg
|
||||
# $reg <== ((value & ~$clearbits) | $setbits)
|
||||
proc mmw {reg setbits clearbits} {
|
||||
set old [mrw $reg]
|
||||
set new [expr ($old & ~$clearbits) | $setbits]
|
||||
mww $reg $new
|
||||
}
|
||||
source [find mem_helper.tcl]
|
||||
|
||||
#
|
||||
# pll_setup: initialize PLL
|
||||
|
||||
Reference in New Issue
Block a user