str9xpec: Find flash controller from the chain.
authorSanteri Salko <santeri.salko@gmail.com>
Thu, 13 Jan 2011 13:21:06 +0000 (15:21 +0200)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Fri, 14 Jan 2011 13:55:24 +0000 (14:55 +0100)
Find the flash controller by position since it is before the core,
not after it.

This fixes the problem that str9xpec enable_turbo (or any other
str9xpec command) did not work. (See my post in
http://forum.sparkfun.com/viewtopic.php?f=18&t=25542)

Signed-off-by: Santeri Salko <santeri.salko@gmail.com>
src/flash/nor/str9xpec.c
src/jtag/core.c
src/jtag/jtag.h

index 18761c2f616045103349d4a9ff236634aa609d11..c06e6d163dd707c1c9db3e259a1f54712fe0f248 100644 (file)
@@ -306,7 +306,8 @@ FLASH_BANK_COMMAND_HANDLER(str9xpec_flash_bank_command)
        arm7_9 = armv4_5->arch_info;
        jtag_info = &arm7_9->jtag_info;
 
-       str9xpec_info->tap = bank->target->tap;
+       /* The core is the next tap after the flash controller in the chain */
+       str9xpec_info->tap = jtag_tap_by_position(jtag_info->tap->abs_chain_position - 1);
        str9xpec_info->isc_enable = 0;
 
        str9xpec_build_block_list(bank);
index 0c222db91e2193c3b72b0b933e87f80f609daa45..d7e1ccec764e50b93f80727185b08be73af44280 100644 (file)
@@ -216,7 +216,7 @@ void jtag_tap_add(struct jtag_tap *t)
 }
 
 /* returns a pointer to the n-th device in the scan chain */
-static inline struct jtag_tap *jtag_tap_by_position(unsigned n)
+struct jtag_tap *jtag_tap_by_position(unsigned n)
 {
        struct jtag_tap *t = jtag_all_taps();
 
index df01537697dac1d787daad7386df3f13d2ff89ae..6709cf717daef7c734973189b17be1660335c817 100644 (file)
@@ -173,6 +173,7 @@ struct jtag_tap* jtag_all_taps(void);
 const char *jtag_tap_name(const struct jtag_tap *tap);
 struct jtag_tap* jtag_tap_by_string(const char* dotted_name);
 struct jtag_tap* jtag_tap_by_jim_obj(Jim_Interp* interp, Jim_Obj* obj);
+struct jtag_tap* jtag_tap_by_position(unsigned abs_position);
 struct jtag_tap* jtag_tap_next_enabled(struct jtag_tap* p);
 unsigned jtag_tap_count_enabled(void);
 unsigned jtag_tap_count(void);

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)