esp.c: add asc_mode property to indicate the current ESP mode
Add a new asc_mode property to ESPState which indicates the current mode of the ESP and update the ESP state machine accordingly. Bump the vmstate version and include migration logic to ensure that asc_mode is set to initiator mode such that any commands in progress will always continue. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20250711204636.542964-7-mark.cave-ayland@ilande.co.uk> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
28a579a349
commit
ab1207401e
2 changed files with 27 additions and 1 deletions
|
|
@ -14,6 +14,12 @@ typedef void (*ESPDMAMemoryReadWriteFunc)(void *opaque, uint8_t *buf, int len);
|
|||
#define ESP_FIFO_SZ 16
|
||||
#define ESP_CMDFIFO_SZ 32
|
||||
|
||||
enum ESPASCMode {
|
||||
ESP_ASC_MODE_DIS = 0, /* Disconnected */
|
||||
ESP_ASC_MODE_INI = 1, /* Initiator */
|
||||
ESP_ASC_MODE_TGT = 2 /* Target */
|
||||
};
|
||||
|
||||
#define TYPE_ESP "esp"
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(ESPState, ESP)
|
||||
|
||||
|
|
@ -38,6 +44,7 @@ struct ESPState {
|
|||
uint8_t cmdfifo_cdb_offset;
|
||||
uint8_t lun;
|
||||
uint32_t do_cmd;
|
||||
uint8_t asc_mode;
|
||||
|
||||
bool data_ready;
|
||||
int dma_enabled;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue