libusb: return oocd error values
[openocd.git] / src / jtag / aice / aice_interface.c
index 838b54faaf994ebfab045176fcddcf76ed767d2a..c758bb43b9156ce800fe5b0bfb61ada034d19cbc 100644 (file)
@@ -13,9 +13,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/>. *
  ***************************************************************************/
 
 #ifdef HAVE_CONFIG_H
@@ -31,7 +29,7 @@
 #include "aice_usb.h"
 
 #define AICE_KHZ_TO_SPEED_MAP_SIZE     16
-static int aice_khz_to_speed_map[AICE_KHZ_TO_SPEED_MAP_SIZE] = {
+static const int aice_khz_to_speed_map[AICE_KHZ_TO_SPEED_MAP_SIZE] = {
        30000,
        15000,
        7500,
@@ -241,6 +239,30 @@ static int aice_khz(int khz, int *jtag_speed)
        return ERROR_OK;
 }
 
+int aice_scan_jtag_chain(void)
+{
+       LOG_DEBUG("=== %s ===", __func__);
+       uint8_t num_of_idcode = 0;
+       struct target *target;
+
+       int res = aice_port->api->idcode(aice_target_id_codes, &num_of_idcode);
+       if (res != ERROR_OK) {
+               LOG_ERROR("<-- TARGET ERROR! Failed to identify AndesCore "
+                                       "JTAG Manufacture ID in the JTAG scan chain. "
+                                       "Failed to access EDM registers. -->");
+               return res;
+       }
+
+       for (uint32_t i = 0; i < num_of_idcode; i++)
+               LOG_DEBUG("id_codes[%d] = 0x%x", i, aice_target_id_codes[i]);
+
+       /* Update tap idcode */
+       for (target = all_targets; target; target = target->next)
+               target->tap->idcode = aice_target_id_codes[target->tap->abs_chain_position];
+
+       return ERROR_OK;
+}
+
 /***************************************************************************/
 /* Command handlers */
 COMMAND_HANDLER(aice_handle_aice_info_command)

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)