diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2016-08-04 17:06:11 +0100 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2017-01-24 15:25:14 +0100 |
commit | 8fabbb008c1a31c809a3d97f22351f141a2bd02d (patch) | |
tree | 6e16386a7348197920a5ce1d99f623d0e10b6c3c /utils/hwstub/include/hwstub_protocol.h | |
parent | d91d9f6851bba401650912c5cabcfe4c5f1150df (diff) |
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.h | 32 |
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 @@ */ #define HWSTUB_VERSION_MAJOR 4 -#define HWSTUB_VERSION_MINOR 2 +#define HWSTUB_VERSION_MINOR 3 #define HWSTUB_VERSION__(maj, min) #maj"."#min #define HWSTUB_VERSION_(maj, min) HWSTUB_VERSION__(maj, min) @@ -169,6 +169,7 @@ struct hwstub_net_hdr_t #define HWSTUB_EXEC 0x44 #define HWSTUB_READ2_ATOMIC 0x45 #define HWSTUB_WRITE_ATOMIC 0x46 +#define HWSTUB_COPROCESSOR_OP 0x47 /* the following commands and the ACK/NACK mechanism are net only */ #define HWSERVER_ACK(n) (0x100|(n)) @@ -252,6 +253,35 @@ struct hwstub_exec_req_t } __attribute__((packed)); /** + * HWSTUB_COPROCESSOR_OP + * Execute a coprocessor operation. The operation is describe in the header of + * the structure. There are currently two supported operations: + * - read: following the HWSTUB_COPROCESSOR_OP, the host can retrieve the data + * by sending a HWSTUB_READ2 request (just like a regular read) of + * the appropriate size + * - write: the header is followed by the data to write. + * If the request has two parts (second being READ2) then both requests must use + * the same ID in wValue, otherwise the second request will be STALLed. + * If a particular operation is not supported, it must be STALLed by the device. + */ + +#define HWSTUB_COP_READ 0 /* read operation */ +#define HWSTUB_COP_WRITE 1 /* write operation */ +/* for MIPS */ +#define HWSTUB_COP_MIPS_COP 0 /* coprocessor number */ +#define HWSTUB_COP_MIPS_REG 1 /* coprocessor register */ +#define HWSTUB_COP_MIPS_SEL 2 /* coprocessor select */ + +#define HWSTUB_COP_ARGS 7 /* maximum number of arguments */ + +struct hwstub_cop_req_t +{ + uint8_t bOp; /* operation to execute */ + uint8_t bArgs[HWSTUB_COP_ARGS]; /* arguments to the operation */ + /* followed by data for WRITE operation */ +}; + +/** * HWSERVER_HELLO: * Say hello to the server, give protocol version and get server version. * Send: args[0] = major << 8 | minor, no data |