software/include: add stdbool.h
[litex.git] / common / sfl.h
1 #ifndef __SFL_H
2 #define __SFL_H
3
4 #define SFL_MAGIC_LEN 14
5 #define SFL_MAGIC_REQ "sL5DdSMmkekro\n"
6 #define SFL_MAGIC_ACK "z6IHG7cYDID6o\n"
7
8 struct sfl_frame {
9 unsigned char length;
10 unsigned char crc[2];
11 unsigned char cmd;
12 unsigned char payload[255];
13 } __attribute__((packed));
14
15 /* General commands */
16 #define SFL_CMD_ABORT 0x00
17 #define SFL_CMD_LOAD 0x01
18 #define SFL_CMD_JUMP 0x02
19
20 /* Linux-specific commands */
21 #define SFL_CMD_CMDLINE 0x03
22 #define SFL_CMD_INITRDSTART 0x04
23 #define SFL_CMD_INITRDEND 0x05
24
25 /* Replies */
26 #define SFL_ACK_SUCCESS 'K'
27 #define SFL_ACK_CRCERROR 'C'
28 #define SFL_ACK_UNKNOWN 'U'
29 #define SFL_ACK_ERROR 'E'
30
31 #endif /* __SFL_H */