command_context_t -> struct command_context
[openocd.git] / src / jtag / zy1000 / zy1000.c
index 14a2aac80a4b517c088f491a0fe345a78edada33..1edf57f8ea2eda4171b1e9caade039c65708e7a9 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2007-2008 by yvind Harboe                              *
+ *   Copyright (C) 2007-2008 by Øyvind Harboe                              *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
 #include "embeddedice.h"
 #include "minidriver.h"
 #include "interface.h"
+#include "zy1000_version.h"
 
 #include <cyg/hal/hal_io.h>             // low level i/o
 #include <cyg/hal/hal_diag.h>
 
-
-#define ZYLIN_VERSION "1.54"
+#define ZYLIN_VERSION GIT_ZY1000_VERSION
 #define ZYLIN_DATE __DATE__
 #define ZYLIN_TIME __TIME__
-#define ZYLIN_OPENOCD "$Revision$"
-#define ZYLIN_OPENOCD_VERSION "Zylin JTAG ZY1000 " ZYLIN_VERSION " " ZYLIN_DATE " " ZYLIN_TIME
+#define ZYLIN_OPENOCD GIT_OPENOCD_VERSION
+#define ZYLIN_OPENOCD_VERSION "ZY1000 " ZYLIN_VERSION " " ZYLIN_DATE
 
 /* low level command set
  */
@@ -40,12 +40,12 @@ void zy1000_reset(int trst, int srst);
 
 
 int zy1000_speed(int speed);
-int zy1000_register_commands(struct command_context_s *cmd_ctx);
+int zy1000_register_commands(struct command_context *cmd_ctx);
 int zy1000_init(void);
 int zy1000_quit(void);
 
 /* interface commands */
-int zy1000_handle_zy1000_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
+int zy1000_handle_zy1000_port_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc);
 
 static int zy1000_khz(int khz, int *jtag_speed)
 {
@@ -110,7 +110,7 @@ static int zy1000_power_dropout(int *dropout)
 }
 
 
-jtag_interface_t zy1000_interface =
+struct jtag_interface zy1000_interface =
 {
        .name = "ZY1000",
        .execute_queue = NULL,
@@ -225,7 +225,7 @@ static void setPower(bool power)
        }
 }
 
-int handle_power_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+int handle_power_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc)
 {
        if (argc > 1)
        {
@@ -270,10 +270,7 @@ static int jim_zy1000_version(Jim_Interp *interp, int argc, Jim_Obj *const *argv
                const char *str = Jim_GetString(argv[1], NULL);
                if (strcmp("openocd", str) == 0)
                {
-                       int revision;
-                       revision = atol(ZYLIN_OPENOCD + strlen("XRevision: "));
-                       sprintf(buff, "%d", revision);
-                       version_str = buff;
+                       version_str = ZYLIN_OPENOCD;
                }
                else if (strcmp("zy1000", str) == 0)
                {
@@ -283,6 +280,10 @@ static int jim_zy1000_version(Jim_Interp *interp, int argc, Jim_Obj *const *argv
                {
                        version_str = ZYLIN_DATE;
                }
+               else if (strcmp("time", str) == 0)
+               {
+                       version_str = ZYLIN_TIME;
+               }
                else if (strcmp("pcb", str) == 0)
                {
 #ifdef CYGPKG_HAL_NIOS2
@@ -353,7 +354,7 @@ zylinjtag_Jim_Command_powerstatus(Jim_Interp *interp,
        return JIM_OK;
 }
 
-int zy1000_register_commands(struct command_context_s *cmd_ctx)
+int zy1000_register_commands(struct command_context *cmd_ctx)
 {
        register_command(cmd_ctx, NULL, "power", handle_power_command, COMMAND_ANY,
                        "power <on/off> - turn power switch to target on/off. No arguments - print status.");
@@ -461,7 +462,7 @@ static void gotoEndState(tap_state_t end_state)
        setCurrentState(end_state);
 }
 
-static __inline void scanFields(int num_fields, const scan_field_t *fields, tap_state_t shiftState, int pause)
+static __inline void scanFields(int num_fields, const struct scan_field *fields, tap_state_t shiftState, int pause)
 {
        int i;
        int j;
@@ -531,18 +532,12 @@ static __inline void scanFields(int num_fields, const scan_field_t *fields, tap_
        }
 }
 
-int interface_jtag_set_end_state(tap_state_t state)
-{
-       return ERROR_OK;
-}
-
-
-int interface_jtag_add_ir_scan(int num_fields, const scan_field_t *fields, tap_state_t state)
+int interface_jtag_add_ir_scan(int num_fields, const struct scan_field *fields, tap_state_t state)
 {
 
        int j;
        int scan_size = 0;
-       jtag_tap_t *tap, *nextTap;
+       struct jtag_tap *tap, *nextTap;
        for (tap = jtag_tap_next_enabled(NULL); tap!= NULL; tap = nextTap)
        {
                nextTap = jtag_tap_next_enabled(tap);
@@ -573,7 +568,7 @@ int interface_jtag_add_ir_scan(int num_fields, const scan_field_t *fields, tap_s
                        /* if a device isn't listed, set it to BYPASS */
                        uint8_t ones[]={0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff};
 
-                       scan_field_t tmp;
+                       struct scan_field tmp;
                        memset(&tmp, 0, sizeof(tmp));
                        tmp.out_value = ones;
                        tmp.num_bits = scan_size;
@@ -592,7 +587,7 @@ int interface_jtag_add_ir_scan(int num_fields, const scan_field_t *fields, tap_s
 
 
 
-int interface_jtag_add_plain_ir_scan(int num_fields, const scan_field_t *fields, tap_state_t state)
+int interface_jtag_add_plain_ir_scan(int num_fields, const struct scan_field *fields, tap_state_t state)
 {
        scanFields(num_fields, fields, TAP_IRSHIFT, 1);
        gotoEndState(state);
@@ -602,11 +597,11 @@ int interface_jtag_add_plain_ir_scan(int num_fields, const scan_field_t *fields,
 
 /*extern jtag_command_t **jtag_get_last_command_p(void);*/
 
-int interface_jtag_add_dr_scan(int num_fields, const scan_field_t *fields, tap_state_t state)
+int interface_jtag_add_dr_scan(int num_fields, const struct scan_field *fields, tap_state_t state)
 {
 
        int j;
-       jtag_tap_t *tap, *nextTap;
+       struct jtag_tap *tap, *nextTap;
        for (tap = jtag_tap_next_enabled(NULL); tap!= NULL; tap = nextTap)
        {
                nextTap = jtag_tap_next_enabled(tap);
@@ -624,7 +619,7 @@ int interface_jtag_add_dr_scan(int num_fields, const scan_field_t *fields, tap_s
                }
                if (!found)
                {
-                       scan_field_t tmp;
+                       struct scan_field tmp;
                        /* program the scan field to 1 bit length, and ignore it's value */
                        tmp.num_bits = 1;
                        tmp.out_value = NULL;
@@ -640,7 +635,7 @@ int interface_jtag_add_dr_scan(int num_fields, const scan_field_t *fields, tap_s
        return ERROR_OK;
 }
 
-int interface_jtag_add_plain_dr_scan(int num_fields, const scan_field_t *fields, tap_state_t state)
+int interface_jtag_add_plain_dr_scan(int num_fields, const struct scan_field *fields, tap_state_t state)
 {
        scanFields(num_fields, fields, TAP_DRSHIFT, 1);
        gotoEndState(state);
@@ -657,9 +652,6 @@ int interface_jtag_add_tlr()
 
 
 
-extern int jtag_nsrst_delay;
-extern int jtag_ntrst_delay;
-
 int interface_jtag_add_reset(int req_trst, int req_srst)
 {
        zy1000_reset(req_trst, req_srst);
@@ -767,7 +759,7 @@ int interface_jtag_add_pathmove(int num_states, const tap_state_t *path)
 
 
 
-void embeddedice_write_dcc(jtag_tap_t *tap, int reg_addr, uint8_t *buffer, int little, int count)
+void embeddedice_write_dcc(struct jtag_tap *tap, int reg_addr, uint8_t *buffer, int little, int count)
 {
 //     static int const reg_addr = 0x5;
        tap_state_t end_state = jtag_get_end_state();

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)