7#ifndef _BOOT_PICOBOOT_H
8#define _BOOT_PICOBOOT_H
14#ifndef NO_PICO_PLATFORM
24#define PICOBOOT_MAGIC 0x431fd10bu
31#define PICOBOOT_IF_RESET 0x41
34#define PICOBOOT_IF_CMD_STATUS 0x42
46 PC_EXCLUSIVE_ACCESS = 0x1,
52 PC_ENTER_CMD_XIP = 0x7,
54 PC_VECTORIZE_FLASH = 0x9
59 PICOBOOT_UNKNOWN_CMD = 1,
60 PICOBOOT_INVALID_CMD_LENGTH = 2,
61 PICOBOOT_INVALID_TRANSFER_LENGTH = 3,
62 PICOBOOT_INVALID_ADDRESS = 4,
63 PICOBOOT_BAD_ALIGNMENT = 5,
64 PICOBOOT_INTERLEAVED_WRITE = 6,
65 PICOBOOT_REBOOTING = 7,
66 PICOBOOT_UNKNOWN_ERROR = 8,
86enum picoboot_exclusive_type {
97struct __packed __aligned(4) picoboot_cmd {
103 le_uint32_t dTransferLength;
113static_assert(32 ==
sizeof(
struct picoboot_cmd),
"picoboot_cmd must be 32 bytes big");
115struct __packed __aligned(4) picoboot_cmd_status {
117 le_uint32_t dStatusCode;
123static_assert(16 ==
sizeof(
struct picoboot_cmd_status),
"picoboot_cmd_status must be 16 bytes big");