versaloon driver update
[openocd.git] / src / jtag / drivers / versaloon / versaloon_internal.h
1 /***************************************************************************
2 * Copyright (C) 2009 - 2010 by Simon Qian <SimonQian@SimonQian.com> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
18 ***************************************************************************/
19 #ifndef __VERSALOON_INTERNAL_H_INCLUDED__
20 #define __VERSALOON_INTERNAL_H_INCLUDED__
21
22 #define VERSALOON_PRODUCTSTRING_INDEX 2
23 #define VERSALOON_SERIALSTRING_INDEX 3
24
25 #define VERSALOON_PRODUCTSTRING "Versaloon"
26
27 #define VERSALOON_VID 0x0483
28 #define VERSALOON_PID 0xA038
29 #define VERSALOON_INP 0x82
30 #define VERSALOON_OUTP 0x03
31 #define VERSALOON_IFACE 0x00
32
33 #define VERSALOON_FULL 1
34 #define VERSALOON_MINI 2
35 #define VERSALOON_NANO 3
36
37 #define VERSALOON_TIMEOUT 5000
38 #define VERSALOON_TIMEOUT_LONG 60000
39
40 // USB Commands
41 // Common Commands
42 #define VERSALOON_COMMON_CMD_START 0x00
43 #define VERSALOON_COMMON_CMD_END 0x0F
44
45 #define VERSALOON_GET_INFO 0x00
46 #define VERSALOON_GET_TVCC 0x01
47 #define VERSALOON_GET_HARDWARE 0x02
48 #define VERSALOON_GET_OFFLINE_SIZE 0x08
49 #define VERSALOON_ERASE_OFFLINE_DATA 0x09
50 #define VERSALOON_WRITE_OFFLINE_DATA 0x0A
51 #define VERSALOON_GET_OFFLINE_CHECKSUM 0x0B
52 #define VERSALOON_FW_UPDATE 0x0F
53 #define VERSALOON_FW_UPDATE_KEY 0xAA
54
55 // MCU Command
56 #define VERSALOON_MCU_CMD_START 0x10
57 #define VERSALOON_MCU_CMD_END 0x1F
58
59 // USB_TO_XXX Command
60 #define VERSALOON_USB_TO_XXX_CMD_START 0x20
61 #define VERSALOON_USB_TO_XXX_CMD_END 0x7F
62
63 // VSLLink Command
64 #define VERSALOON_VSLLINK_CMD_START 0x80
65 #define VERSALOON_VSLLINK_CMD_END 0xFF
66
67
68
69 // Mass-product
70 #define MP_OK 0x00
71 #define MP_FAIL 0x01
72
73 #define MP_ISSP 0x11
74
75
76
77 // pending struct
78 #define VERSALOON_MAX_PENDING_NUMBER 4096
79 typedef RESULT (*versaloon_callback_t)(void *, uint8_t *, uint8_t *);
80 struct versaloon_want_pos_t
81 {
82 uint16_t offset;
83 uint16_t size;
84 uint8_t *buff;
85 struct versaloon_want_pos_t *next;
86 };
87 struct versaloon_pending_t
88 {
89 uint8_t type;
90 uint8_t cmd;
91 uint16_t want_data_pos;
92 uint16_t want_data_size;
93 uint16_t actual_data_size;
94 uint8_t *data_buffer;
95 uint8_t collect;
96 uint32_t id;
97 struct versaloon_want_pos_t *pos;
98 void *extra_data;
99 versaloon_callback_t callback;
100 };
101 extern struct versaloon_pending_t \
102 versaloon_pending[VERSALOON_MAX_PENDING_NUMBER];
103 extern uint16_t versaloon_pending_idx;
104 void versaloon_set_pending_id(uint32_t id);
105 void versaloon_set_callback(versaloon_callback_t callback);
106 void versaloon_set_extra_data(void * p);
107 RESULT versaloon_add_want_pos(uint16_t offset, uint16_t size, uint8_t *buff);
108 RESULT versaloon_add_pending(uint8_t type, uint8_t cmd, uint16_t actual_szie,
109 uint16_t want_pos, uint16_t want_size, uint8_t *buffer, uint8_t collect);
110 void versaloon_free_want_pos(void);
111
112 RESULT versaloon_send_command(uint16_t out_len, uint16_t *inlen);
113 extern uint8_t *versaloon_buf;
114 extern uint8_t *versaloon_cmd_buf;
115 extern uint16_t versaloon_buf_size;
116
117 #endif /* __VERSALOON_INTERNAL_H_INCLUDED__ */
118

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)