arm_adi_v5: rewrite dap_to_jtag and dap_to_swd
[openocd.git] / src / flash / nor / stellaris.c
index ecfc10e141e407f16dc10023bf397d63b3f657ad..8731f8b88d089e02faa1cd53fe1a5677ce3dbf0b 100644 (file)
@@ -16,9 +16,7 @@
  *   GNU General Public License for more details.                          *
  *                                                                         *
  *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
  ***************************************************************************/
 
 /***************************************************************************
@@ -602,7 +600,7 @@ static void stellaris_read_clock_info(struct flash_bank *bank)
        LOG_DEBUG("Stellaris PLLCFG %" PRIx32 "", pllcfg);
 
        stellaris_info->rcc = rcc;
-       stellaris_info->rcc = rcc2;
+       stellaris_info->rcc2 = rcc2;
 
        sysdiv = (rcc >> 23) & 0xF;
        usesysdiv = (rcc >> 22) & 0x1;
@@ -1357,6 +1355,7 @@ COMMAND_HANDLER(stellaris_handle_mass_erase_command)
 COMMAND_HANDLER(stellaris_handle_recover_command)
 {
        struct flash_bank *bank;
+       struct arm *arm;
        int retval;
 
        if (CMD_ARGC != 0)
@@ -1385,12 +1384,13 @@ COMMAND_HANDLER(stellaris_handle_recover_command)
        }
        adapter_assert_reset();
 
+       arm = target_to_arm(bank->target);
        for (int i = 0; i < 5; i++) {
-               retval = dap_to_swd(bank->target);
+               retval = dap_to_swd(arm->dap);
                if (retval != ERROR_OK)
                        goto done;
 
-               retval = dap_to_jtag(bank->target);
+               retval = dap_to_jtag(arm->dap);
                if (retval != ERROR_OK)
                        goto done;
        }
@@ -1454,4 +1454,5 @@ struct flash_driver stellaris_flash = {
        .erase_check = default_flash_blank_check,
        .protect_check = stellaris_protect_check,
        .info = get_stellaris_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };

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)