19#ifndef RCBENCH_LINK_UPDATE_HOST_H
20#define RCBENCH_LINK_UPDATE_HOST_H
36#define LINK_UPH_HASH_STEP 8192u
43#define LINK_UPH_LOST_MS 4000u
48#define LINK_UPH_RESTARTS 3u
50#define LINK_UPH_BLOCK_TRIES 3u
54#define LINK_UPH_BUSY_MS 10000u
56#define LINK_UPH_HASH_MS 10000u
61#define LINK_UPH_SETTLE_MS 500u
66#define LINK_UPH_CONFIRM_MS 12000u
The panel's half of the link: poll, match the reply to the question, and escalate when the answers st...
The page map: what the panel can ask the IOmcu for, and set.
A write of any width, one frame in flight at a time.
SHA-256 (Secure Hash Algorithm, 256-bit digest), as FIPS (Federal Information Processing Standard) 18...
#define LINK_SHA256_BYTES
Bytes in a digest.
Definition link_sha256.h:27
link_uph_phase_t link_uph_step(link_uph_t *u, link_host_t *h, const link_port_t *port)
One step; returns the phase it leaves the update in.
Definition link_update_host.c:838
void link_uph_check(link_uph_t *u, const uint8_t *img, uint32_t len, uint32_t now_ms)
Find out whether the IOmcu runs the build in img: this end's build hash, then the IOmcu's over its ru...
Definition link_update_host.c:57
void link_uph_confirm(link_uph_t *u, uint32_t now_ms)
Buy an image found on trial.
Definition link_update_host.c:92
void link_uph_mismatch_rearm(link_uph_mismatch_t *m)
An update ended: the next mismatched answer owes the check again.
Definition link_update_host.c:891
uint16_t link_uph_permille(const link_uph_t *u)
Blocks committed, in thousandths of the image: 0 to 1000.
Definition link_update_host.c:100
void link_uph_update(link_uph_t *u, const uint8_t *img, uint32_t len, uint32_t now_ms)
Send img to the slot that is not running, check it, start it and buy it.
Definition link_update_host.c:72
link_uph_result_t
How the update ended; held in link_uph_t.result.
Definition link_update_host.h:91
@ LINK_UPH_RESTARTED_OUT
Definition link_update_host.h:101
@ LINK_UPH_BUSY
Definition link_update_host.h:100
@ LINK_UPH_REFUSED
Definition link_update_host.h:98
@ LINK_UPH_NO_ANSWER
Definition link_update_host.h:97
@ LINK_UPH_BAD_DIGEST
Definition link_update_host.h:99
@ LINK_UPH_TRIAL
Definition link_update_host.h:95
@ LINK_UPH_NONE
Definition link_update_host.h:92
@ LINK_UPH_NEEDS_USB
Definition link_update_host.h:96
@ LINK_UPH_UPDATED
Definition link_update_host.h:103
@ LINK_UPH_SAME
Definition link_update_host.h:93
@ LINK_UPH_NOT_STARTED
Definition link_update_host.h:102
@ LINK_UPH_DIFFERENT
Definition link_update_host.h:94
bool link_uph_mismatch_answers(const link_uph_mismatch_t *m)
Whether the last probe was answered by a mismatched IOmcu.
Definition link_update_host.c:886
link_uph_phase_t
The phase the update is in; one per link_uph_step().
Definition link_update_host.h:71
@ LINK_UPH_CHECK_WAIT
Definition link_update_host.h:75
@ LINK_UPH_CHECK_ASK
Definition link_update_host.h:74
@ LINK_UPH_RESYNC
Definition link_update_host.h:79
@ LINK_UPH_SEND
Definition link_update_host.h:78
@ LINK_UPH_RESTARTING
Definition link_update_host.h:83
@ LINK_UPH_PREPARE
Definition link_update_host.h:76
@ LINK_UPH_CHECK_HASH
Definition link_update_host.h:73
@ LINK_UPH_DONE
Definition link_update_host.h:85
bool link_uph_mismatch_probe(link_uph_mismatch_t *m, bool mismatch)
One identity probe: mismatch whether an IOmcu of another protocol major answered it.
Definition link_update_host.c:871
What both ends of the IOmcu update need to know about an RP2350 image: where its TBYB (try before you...
The panel's state for one link: the outstanding request, the counters and the reassembly buffer.
Definition link_host.h:35
A SHA-256 over len bytes fed in pieces, the byte at flag_at read with LINK_IMAGE_TBYB_BIT set or clea...
Definition link_update_image.h:60
How a request reaches the far end and its answer comes back.
Definition link_port.h:52
An IOmcu of another protocol major answers its identity while the link stays down.
Definition link_update_host.h:212
bool owed
Definition link_update_host.h:214
bool told
Definition link_update_host.h:213
The panel's state for one update run.
Definition link_update_host.h:109
bool busy
Definition link_update_host.h:132
uint8_t restarts
Definition link_update_host.h:118
uint8_t digest[LINK_SHA256_BYTES]
Definition link_update_host.h:125
int32_t flag_at
Definition link_update_host.h:112
uint8_t block_tries
Definition link_update_host.h:119
uint8_t error
Definition link_update_host.h:116
uint16_t block
Definition link_update_host.h:128
uint16_t block_tried
Definition link_update_host.h:131
uint16_t slot
Definition link_update_host.h:130
bool missing
Definition link_update_host.h:117
uint16_t ident[LINK_ID_COUNT]
Definition link_update_host.h:138
uint16_t blocks
Definition link_update_host.h:129
uint8_t result
Definition link_update_host.h:115
uint32_t since_ms
Definition link_update_host.h:134
link_image_hash_t hash
Definition link_update_host.h:126
uint8_t build[LINK_SHA256_BYTES]
Definition link_update_host.h:123
bool aborted
Definition link_update_host.h:121
uint32_t missing_ms
Definition link_update_host.h:135
uint8_t after_resync
Definition link_update_host.h:120
uint8_t expect[LINK_SHA256_BYTES]
Definition link_update_host.h:124
uint32_t busy_ms
Definition link_update_host.h:133