summaryrefslogtreecommitdiff
path: root/utils/hwstub/include/hwstub_protocol.h
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2016-08-04 17:06:11 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2017-01-24 15:25:14 +0100
commit8fabbb008c1a31c809a3d97f22351f141a2bd02d (patch)
tree6e16386a7348197920a5ce1d99f623d0e10b6c3c /utils/hwstub/include/hwstub_protocol.h
parentd91d9f6851bba401650912c5cabcfe4c5f1150df (diff)
downloadrockbox-8fabbb008c1a31c809a3d97f22351f141a2bd02d.tar.gz
rockbox-8fabbb008c1a31c809a3d97f22351f141a2bd02d.zip
hwstub: add support for coprocessor operations
At the moment the stub only implement them for MIPS. Change-Id: Ica835a0e9c70fa5675c3d655eae986e812a47de8
Diffstat (limited to 'utils/hwstub/include/hwstub_protocol.h')
-rw-r--r--utils/hwstub/include/hwstub_protocol.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/utils/hwstub/include/hwstub_protocol.h b/utils/hwstub/include/hwstub_protocol.h
index f767e50571..ed26ee78e4 100644
--- a/utils/hwstub/include/hwstub_protocol.h
+++ b/utils/hwstub/include/hwstub_protocol.h
@@ -33,7 +33,7 @@
33 */ 33 */
34 34
35#define HWSTUB_VERSION_MAJOR 4 35#define HWSTUB_VERSION_MAJOR 4
36#define HWSTUB_VERSION_MINOR 2 36#define HWSTUB_VERSION_MINOR 3
37 37
38#define HWSTUB_VERSION__(maj, min) #maj"."#min 38#define HWSTUB_VERSION__(maj, min) #maj"."#min
39#define HWSTUB_VERSION_(maj, min) HWSTUB_VERSION__(maj, min) 39#define HWSTUB_VERSION_(maj, min) HWSTUB_VERSION__(maj, min)
@@ -169,6 +169,7 @@ struct hwstub_net_hdr_t
169#define HWSTUB_EXEC 0x44 169#define HWSTUB_EXEC 0x44
170#define HWSTUB_READ2_ATOMIC 0x45 170#define HWSTUB_READ2_ATOMIC 0x45
171#define HWSTUB_WRITE_ATOMIC 0x46 171#define HWSTUB_WRITE_ATOMIC 0x46
172#define HWSTUB_COPROCESSOR_OP 0x47
172 173
173/* the following commands and the ACK/NACK mechanism are net only */ 174/* the following commands and the ACK/NACK mechanism are net only */
174#define HWSERVER_ACK(n) (0x100|(n)) 175#define HWSERVER_ACK(n) (0x100|(n))
@@ -252,6 +253,35 @@ struct hwstub_exec_req_t
252} __attribute__((packed)); 253} __attribute__((packed));
253 254
254/** 255/**
256 * HWSTUB_COPROCESSOR_OP
257 * Execute a coprocessor operation. The operation is describe in the header of
258 * the structure. There are currently two supported operations:
259 * - read: following the HWSTUB_COPROCESSOR_OP, the host can retrieve the data
260 * by sending a HWSTUB_READ2 request (just like a regular read) of
261 * the appropriate size
262 * - write: the header is followed by the data to write.
263 * If the request has two parts (second being READ2) then both requests must use
264 * the same ID in wValue, otherwise the second request will be STALLed.
265 * If a particular operation is not supported, it must be STALLed by the device.
266 */
267
268#define HWSTUB_COP_READ 0 /* read operation */
269#define HWSTUB_COP_WRITE 1 /* write operation */
270/* for MIPS */
271#define HWSTUB_COP_MIPS_COP 0 /* coprocessor number */
272#define HWSTUB_COP_MIPS_REG 1 /* coprocessor register */
273#define HWSTUB_COP_MIPS_SEL 2 /* coprocessor select */
274
275#define HWSTUB_COP_ARGS 7 /* maximum number of arguments */
276
277struct hwstub_cop_req_t
278{
279 uint8_t bOp; /* operation to execute */
280 uint8_t bArgs[HWSTUB_COP_ARGS]; /* arguments to the operation */
281 /* followed by data for WRITE operation */
282};
283
284/**
255 * HWSERVER_HELLO: 285 * HWSERVER_HELLO:
256 * Say hello to the server, give protocol version and get server version. 286 * Say hello to the server, give protocol version and get server version.
257 * Send: args[0] = major << 8 | minor, no data 287 * Send: args[0] = major << 8 | minor, no data