-
Notifications
You must be signed in to change notification settings - Fork 2
/
protocol.h
104 lines (86 loc) · 3.7 KB
/
protocol.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#ifndef __PROTOCOL_H
#define __PROTOCOL_H
#define SPRD_START_BYTE 0x7e
#define SPRD_END_BYTE 0x7e
#define SPRD_FRAME_START_OFF 0
#define SPRD_FRAME_TYPE_OFF 2
#define SPRD_FRAME_DATA_SIZE_OFF 3
#define SPRD_FRAME_DATA_OFF 5
/*
typedef struct sprd_frame{
}
*/
typedef enum sprd_cmd_type {
BSL_PKT_TYPE_MIN = 0, /* the bottom of the DL packet type range */
BSL_CMD_TYPE_MIN = BSL_PKT_TYPE_MIN, /* 0x0 */
/* Link Control */
BSL_CMD_CONNECT = BSL_CMD_TYPE_MIN, /* 0x0 */
/* Data Download */
/* the start flag of the data downloading */
BSL_CMD_START_DATA, /* 0x1 */
/* the midst flag of the data downloading */
BSL_CMD_MIDST_DATA, /* 0x2 */
/* the end flag of the data downloading */
BSL_CMD_END_DATA, /* 0x3 */
/* Execute from a certain address */
BSL_CMD_EXEC_DATA, /* 0x4 */
BSL_CMD_NORMAL_RESET, /* 0x5 */
BSL_CMD_READ_FLASH, /* 0x6 */
BSL_CMD_READ_CHIP_TYPE, /* 0x7 */
BSL_CMD_LOOKUP_NVITEM, /* 0x8 */
BSL_SET_BAUDRATE, /* 0x9 */
BSL_ERASE_FLASH, /* 0xA */
BSL_REPARTITION, /* 0xB */
BSL_CMD_READ_MCP_TYPE=0xD, /* 0xD */
BSL_CMD_READ_FLASH_START =0x10,/*0x10*/
BSL_CMD_READ_FLASH_MIDST, /*0x11*/
BSL_CMD_READ_FLASH_END, /*0x12*/
BSL_CMD_OFF_CHG = 0x13, /* 0x13*/
BSL_CMD_POWER_DOWN_TYPE = 0x17, /* 0x17*/
BSL_CMD_CHECK_ROOTFLAG = 0x19, /* 0x19*/
BSL_CMD_TYPE_MAX,
/* Start of the Command can be transmited by phone*/
BSL_REP_TYPE_MIN = 0x80,
/* The operation acknowledge */
BSL_REP_ACK = BSL_REP_TYPE_MIN, /* 0x80 */
BSL_REP_VER, /* 0x81 */
/* the operation not acknowledge */
/* system */
BSL_REP_INVALID_CMD, /* 0x82 */
BSL_REP_UNKNOW_CMD, /* 0x83 */
BSL_REP_OPERATION_FAILED, /* 0x84 */
/* Link Control*/
BSL_REP_NOT_SUPPORT_BAUDRATE, /* 0x85 */
/* Data Download */
BSL_REP_DOWN_NOT_START, /* 0x86 */
BSL_REP_DOWN_MULTI_START, /* 0x87 */
BSL_REP_DOWN_EARLY_END, /* 0x88 */
BSL_REP_DOWN_DEST_ERROR, /* 0x89 */
BSL_REP_DOWN_SIZE_ERROR, /* 0x8A */
BSL_REP_VERIFY_ERROR, /* 0x8B */
BSL_REP_NOT_VERIFY, /* 0x8C */
/* Phone Internal Error */
BSL_PHONE_NOT_ENOUGH_MEMORY, /* 0x8D */
BSL_PHONE_WAIT_INPUT_TIMEOUT, /* 0x8E */
/* Phone Internal return value */
BSL_PHONE_SUCCEED, /* 0x8F */
BSL_PHONE_VALID_BAUDRATE, /* 0x90 */
BSL_PHONE_REPEAT_CONTINUE, /* 0x91 */
BSL_PHONE_REPEAT_BREAK, /* 0x92 */
BSL_REP_READ_FLASH, /* 0x93 */
BSL_REP_READ_CHIP_TYPE, /* 0x94 */
BSL_REP_LOOKUP_NVITEM, /* 0x95 */
BSL_INCOMPATIBLE_PARTITION, /* 0x96 */
BSL_UNKNOWN_DEVICE, /* 0x97 */
BSL_INVALID_DEVICE_SIZE, /* 0x98 */
BSL_ILLEGAL_SDRAM, /* 0x99 */
BSL_WRONG_SDRAM_PARAMETER, /* 0x9a */
BSL_REP_READ_MCP_TYPE, /* 0x9b*/
BSL_EEROR_CHECKSUM = 0xA0,
BSL_CHECKSUM_DIFF,
BSL_WRITE_ERROR,
/*phone root return value*/
BSL_PHONE_ROOTFLAG = 0xA7,
BSL_PKT_TYPE_MAX
}sprd_cmd_type_t ;
#endif