- Timestamp:
-
08/14/15 15:26:19 (9 years ago)
- Author:
-
Ric Claus
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v3
|
v4
|
|
7 | 7 | Xilinx define the JTAG access to the Zynq part with a 14-pin header while suitable adaptors such as the Flyswatter2 have the standard ARM 20pin header. You can buy from Avnet a [http://www.em.avnet.com/en-us/design/drc/Pages/ZedBoard-Processor-Debug-Adapter.aspx ZedBoard Processor Debug Adapter]. |
8 | 8 | |
9 | | JTAG access to the Zynq only operates if the board is in a suitable JTAG mode and it is not in a secure boot mode. Please refer to the Xilinx Zynq-7000 Technical Reference Manual and any user manul for your hardware for details on how to set the board's mode into JTAG. |
| 9 | JTAG access to the Zynq only operates if the board is in a suitable JTAG mode and it is not in a secure boot mode. Please refer to the Xilinx Zynq-7000 Technical Reference Manual and any user manual for your hardware for details on how to set the board's mode into JTAG. |
10 | 10 | |
11 | 11 | == Xilinx SDK PS7 Initialisation == |
… |
… |
|
18 | 18 | # |
19 | 19 | |
20 | | proc mrd { addr } { |
21 | | mem2array x 32 $addr 1 |
22 | | return $x(0) |
| 20 | proc mrd { args } { |
| 21 | if {[llength $args] == 0} { |
| 22 | echo "mrd address \[count \[w|h|b\]\]" |
| 23 | echo " Read <count> memory locations starting at <address>. Defaults to one word." |
| 24 | return |
| 25 | } |
| 26 | set addr [lindex $args 0] |
| 27 | set count 1 |
| 28 | set bits 32 |
| 29 | if {[llength $args] > 1} { |
| 30 | set count [lindex $args 1] |
| 31 | if {[llength $args] > 2} { |
| 32 | switch [lindex $args 2] { |
| 33 | w { set bits 32 } |
| 34 | h { set bits 16 } |
| 35 | b { set bits 8 } |
| 36 | default { set bits 32 } |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | mem2array x $bits $addr $count |
| 41 | set nibbles [expr {$bits / 4}] |
| 42 | set bytes [expr {$bits / 8}] |
| 43 | set result {} |
| 44 | foreach {idx elmt} $x { |
| 45 | append result [format "%08x: %0*x\n" [expr {$addr + $idx * $bytes}] $nibbles $elmt] |
| 46 | } |
| 47 | return $result |
23 | 48 | } |
24 | 49 | |
25 | 50 | proc mask_write { addr mask value } { |
26 | | set curval "[mrd $addr]" |
| 51 | set curval "0x[string range [mrd $addr] end-8 end]" |
27 | 52 | set maskedval [expr {$curval & ~$mask}] |
28 | 53 | #echo "curval = [format 0x%08x $curval] maskedval = [format 0x%08x $maskedval]" |
… |
… |
|
46 | 71 | }}} |
47 | 72 | |
48 | | This file will allow you to run the TCL script from the Xilinx SDK using OpenOCD. There are some instances around some parts of the initialisation that may not work. Uncomment the `echo` lines, location the writes that fail and comment those out from your PS7 init TCL script. |
| 73 | This file will allow you to run the TCL script from the Xilinx SDK using OpenOCD. There are some instances around some parts of the initialisation that may not work. Uncomment the `echo` lines, locate the writes that fail and comment those out from your PS7 init TCL script. |
49 | 74 | |
50 | 75 | The main purpose of this initialisation process is to get working clocks and DDR memory so you can load your code and run it. |
… |
… |
|
52 | 77 | == First Stage Boot Loader Initialisation == |
53 | 78 | |
54 | | A second approach to initialisation is to use the FSBL. The FSBL contains the C version of the PS7 initialisation produced by the SDK. The FSBL should detect the mode is JTAG and place the ARM code in a state where JTAG access is enabled. To do this you create an OpenOCD TCL script that loads the FSBL as an ELF file into the OCM and run it, pause for a small amount of time then halt the ARM code. At this point in time the Zynq will be initialised and you can download your application into DDR RAM. |
| 79 | A second approach to initialisation is to use the FSBL. The FSBL contains the C version of the PS7 initialisation produced by the SDK. The FSBL should detect the mode is JTAG and place the ARM code in a state where JTAG access is enabled. To do this you create an OpenOCD TCL script that loads the FSBL as an ELF file into the OCM and runs it, pauses for a small amount of time to let it complete and then halts the ARM code. At this point in time the Zynq will be initialised and you can download your application into DDR RAM. |
55 | 80 | |
56 | 81 | == Xilinx Zynq-7000 Configuration File == |
… |
… |
|
81 | 106 | } else { |
82 | 107 | global _CHIPNAME |
83 | | set _CHIPNAME zc706 |
| 108 | set _CHIPNAME zynq |
84 | 109 | } |
85 | 110 | |
… |
… |
|
102 | 127 | # PL Tap. |
103 | 128 | # |
104 | | # ZC706 devices: |
105 | | # 0x03731093 - Eval board 1.1 |
| 129 | # See ug585 ZYNQ-7000 TRM PSS_IDCODE for how this number is constructed. |
| 130 | # 0x03731093 - ZC706 Eval board 1.1 |
106 | 131 | # 0x23731093 - ?? |
| 132 | # 0x23727093 - Zedboard Rev. C and D |
107 | 133 | # |
108 | 134 | # Set in your configuration file or board specific file. |
… |
… |
|
120 | 146 | # CoreSight Debug Access Port |
121 | 147 | # |
122 | | if { [info exists DAPTAPID] } { |
| 148 | if { [info exists DAP_TAPID] } { |
123 | 149 | set _DAP_TAPID $DAP_TAPID |
124 | 150 | } else { |
… |
… |
|
258 | 284 | } |
259 | 285 | |
260 | | proc zynq_zc706_gdb_attach { target } { |
| 286 | proc zynq_gdb_attach { target } { |
261 | 287 | catch { |
262 | 288 | halt |
… |
… |
|
315 | 341 | == GDB Configuration == |
316 | 342 | |
317 | | This configuration allow you to commit into your repository a standard configuration placing the host specific configuration in your home directory. |
| 343 | This configuration allows you to commit into your repository a standard configuration placing the host specific configuration in your home directory. |
318 | 344 | |
319 | 345 | Create a `$HOME/.gdbinit` file and place in it: |
… |
… |
|
321 | 347 | {{{ |
322 | 348 | def zynq-connect |
323 | | target remote :3334 |
| 349 | target remote :3333 |
324 | 350 | end |
325 | 351 | |
… |
… |
|
367 | 393 | b bsp_reset |
368 | 394 | |
369 | | tb main |
| 395 | tb Init |
370 | 396 | c |
371 | 397 | }}} |