f889432b50c1089baec88e709b7ca9e12e4509b4
[fw/openocd] / tcl / target / ti_dm365.cfg
1 #\r
2 # Texas Instruments DaVinci family:  TMS320DM365\r
3 #\r
4 if { [info exists CHIPNAME] } {\r
5    set  _CHIPNAME $CHIPNAME\r
6 } else {\r
7    set  _CHIPNAME dm365\r
8 }\r
9 \r
10 #\r
11 # For now, expect EMU0/EMU1 jumpered LOW (not TI's default) so ARM and ETB\r
12 # are enabled without making ICEpick route ARM and ETB into the JTAG chain.\r
13 #\r
14 # Also note:  when running without RTCK before the PLLs are set up, you\r
15 # may need to slow the JTAG clock down quite a lot (under 2 MHz).\r
16 #\r
17 source [find target/icepick.cfg]\r
18 set EMU01 "-enable"\r
19 #set EMU01 "-disable"\r
20 \r
21 # Subsidiary TAP: ARM ETB11, with scan chain for 4K of ETM trace buffer\r
22 if { [info exists ETB_TAPID ] } {\r
23    set _ETB_TAPID $ETB_TAPID\r
24 } else {\r
25    set _ETB_TAPID 0x2b900f0f\r
26 }\r
27 jtag newtap $_CHIPNAME etb -irlen 4 -ircapture 0x1 -irmask 0xf \\r
28         -expected-id $_ETB_TAPID $EMU01\r
29 jtag configure $_CHIPNAME.etb -event tap-enable \\r
30         "icepick_c_tapenable $_CHIPNAME.jrc 1"\r
31 \r
32 # Subsidiary TAP: ARM926ejs with scan chains for ARM Debug, EmbeddedICE-RT, ETM.\r
33 if { [info exists CPU_TAPID ] } {\r
34    set _CPU_TAPID $CPU_TAPID\r
35 } else {\r
36    set _CPU_TAPID 0x0792602f\r
37 }\r
38 jtag newtap $_CHIPNAME arm -irlen 4 -ircapture 0x1 -irmask 0xf \\r
39         -expected-id $_CPU_TAPID $EMU01\r
40 jtag configure $_CHIPNAME.arm -event tap-enable \\r
41         "icepick_c_tapenable $_CHIPNAME.jrc 0"\r
42 \r
43 # Primary TAP: ICEpick (JTAG route controller) and boundary scan\r
44 if { [info exists JRC_TAPID ] } {\r
45    set _JRC_TAPID $JRC_TAPID\r
46 } else {\r
47    set _JRC_TAPID 0x0b83e02f\r
48 }\r
49 jtag newtap $_CHIPNAME jrc -irlen 6 -ircapture 0x1 -irmask 0x3f \\r
50         -expected-id $_JRC_TAPID\r
51 \r
52 ################\r
53 \r
54 # various symbol definitions, to avoid hard-wiring addresses\r
55 # and enable some sharing of DaVinci-family utility code\r
56 global dm365\r
57 set dm365 [ dict create ]\r
58 \r
59 # Physical addresses for controllers and memory\r
60 # (Some of these are valid for many DaVinci family chips)\r
61 dict set dm365 sram0            0x00010000\r
62 dict set dm365 sram1            0x00014000\r
63 dict set dm365 sysbase          0x01c40000\r
64 dict set dm365 pllc1            0x01c40800\r
65 dict set dm365 pllc2            0x01c40c00\r
66 dict set dm365 psc              0x01c41000\r
67 dict set dm365 gpio             0x01c67000\r
68 dict set dm365 a_emif           0x01d10000\r
69 dict set dm365 a_emif_cs0       0x02000000\r
70 dict set dm365 a_emif_cs1       0x04000000\r
71 dict set dm365 ddr_emif         0x20000000\r
72 dict set dm365 ddr              0x80000000\r
73 \r
74 source [find target/davinci.cfg]\r
75 \r
76 ################\r
77 # GDB target:  the ARM, using SRAM1 for scratch.  SRAM0 (also 16K)\r
78 # and the ETB memory (4K) are other options, while trace is unused.\r
79 set _TARGETNAME $_CHIPNAME.arm\r
80 \r
81 target create $_TARGETNAME arm926ejs -chain-position $_TARGETNAME\r
82 \r
83 # NOTE that work-area-virt presumes a Linux 2.6.30-rc2+ kernel,\r
84 # and that the work area is used only with a kernel mmu context ...\r
85 $_TARGETNAME configure \\r
86         -work-area-virt [expr 0xfffe0000 + 0x4000] \\r
87         -work-area-phys [dict get $dm365 sram1] \\r
88         -work-area-size 0x4000 \\r
89         -work-area-backup 0\r
90 \r
91 arm7_9 dbgrq enable\r
92 arm7_9 fast_memory_access enable\r
93 arm7_9 dcc_downloads enable\r
94 \r
95 # trace setup\r
96 etm config $_TARGETNAME 16 normal full etb\r
97 etb config $_TARGETNAME $_CHIPNAME.etb\r