target/xtensa: add dual-core support
[openocd.git] / tcl / target / xtensa.cfg
index 101e13546ffab4a753c9f52a8fb6d0300fb3c841..561131d842f28b3aada33f58b9343ca127e49751 100644 (file)
@@ -5,7 +5,7 @@
 set xtensa_ids { 0x120034e5 0x120134e5
                                 0x209034e5 0x209134e5 0x209234e5 0x209334e5 0x209434e5 0x209534e5 0x209634e5 0x209734e5
                                 0x20a034e5 0x20a134e5 0x20a234e5 0x20a334e5 0x20a434e5 0x20a534e5 0x20a634e5 0x20a734e5 0x20a834e5
-                                0x20b034e5 }
+                                0x20b034e5 0x20b33ac5 0x20b33ac7 }
 set expected_xtensa_ids {}
 foreach i $xtensa_ids {
        lappend expected_xtensa_ids -expected-id $i
@@ -23,6 +23,12 @@ if { [info exists CPUTAPID] } {
        set _CPUTAPARGLIST [join $expected_xtensa_ids]
 }
 
+if { [info exists XTENSA_NUM_CORES] } {
+       set _XTENSA_NUM_CORES $XTENSA_NUM_CORES
+} else {
+       set _XTENSA_NUM_CORES 1
+}
+
 set _TARGETNAME $_CHIPNAME
 set _CPU0NAME cpu
 set _TAPNAME $_CHIPNAME.$_CPU0NAME
@@ -40,12 +46,25 @@ if { [info exists XTENSA_DAP] } {
        } else {
                target create $_TARGETNAME xtensa -dap $_CHIPNAME.dap
        }
-} else {
+} elseif { $_XTENSA_NUM_CORES > 1 } {
        # JTAG direct (without DAP)
+       for {set i 0} {$i < $_XTENSA_NUM_CORES} {incr i} {
+               set _LCPUNAME $_CPU0NAME$i
+               set _LTAPNAME $_CHIPNAME.$_LCPUNAME
+               eval jtag newtap $_CHIPNAME $_LCPUNAME -irlen 5 $_CPUTAPARGLIST
+               target create $_LTAPNAME xtensa -chain-position $_LTAPNAME -coreid $i
+
+               $_LTAPNAME configure -event reset-assert-post { soft_reset_halt }
+       }
+} else {
+       # JTAG direct (without DAP) - for legacy xtensa-config-XXX.cfg format
        eval jtag newtap $_CHIPNAME $_CPU0NAME -irlen 5 $_CPUTAPARGLIST
        target create $_TARGETNAME xtensa -chain-position $_TAPNAME
 }
 
-$_TARGETNAME configure -event reset-assert-post { soft_reset_halt }
+if { $_XTENSA_NUM_CORES == 1 } {
+       # DAP and single-core legacy JTAG
+       $_TARGETNAME configure -event reset-assert-post { soft_reset_halt }
+}
 
 gdb_report_register_access_error enable

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)