2009-10-14 03:34:41 -05:00
|
|
|
# utility fn's for Freescale i.MX series
|
|
|
|
|
2011-10-29 16:32:17 -05:00
|
|
|
global TARGETNAME
|
2009-10-14 03:34:41 -05:00
|
|
|
set TARGETNAME $_TARGETNAME
|
|
|
|
|
|
|
|
# rewrite commands of the form below to arm11 mcr...
|
|
|
|
# Data.Set c15:0x042f %long 0x40000015
|
|
|
|
proc setc15 {regs value} {
|
2020-04-25 18:07:27 -05:00
|
|
|
global TARGETNAME
|
2009-10-14 03:34:41 -05:00
|
|
|
|
2011-10-29 16:32:17 -05:00
|
|
|
echo [format "set p15 0x%04x, 0x%08x" $regs $value]
|
2009-10-14 03:34:41 -05:00
|
|
|
|
2021-04-09 18:23:57 -05:00
|
|
|
arm mcr 15 [expr {($regs>>12)&0x7}] [expr {($regs>>0)&0xf}] [expr {($regs>>4)&0xf}] [expr {($regs>>8)&0x7}] $value
|
2009-10-14 03:34:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
proc imx3x_reset {} {
|
|
|
|
# this reset script comes from the Freescale PDK
|
|
|
|
#
|
|
|
|
# http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=IMX35PDK
|
2011-10-29 16:32:17 -05:00
|
|
|
|
2009-10-14 03:34:41 -05:00
|
|
|
echo "Target Setup: initialize DRAM controller and peripherals"
|
2011-10-29 16:32:17 -05:00
|
|
|
|
2009-10-14 03:34:41 -05:00
|
|
|
# Data.Set c15:0x01 %long 0x00050078
|
|
|
|
setc15 0x01 0x00050078
|
2011-10-29 16:32:17 -05:00
|
|
|
|
2009-10-14 03:34:41 -05:00
|
|
|
echo "configuring CP15 for enabling the peripheral bus"
|
|
|
|
# Data.Set c15:0x042f %long 0x40000015
|
|
|
|
setc15 0x042f 0x40000015
|
|
|
|
}
|