6 BSL_PKT_TYPE_MIN = 0, /* the bottom of the DL packet type range */
7 BSL_CMD_TYPE_MIN = BSL_PKT_TYPE_MIN, /* 0x0 */
10 BSL_CMD_CONNECT = BSL_CMD_TYPE_MIN, /* 0x0 */
12 /* the start flag of the data downloading */
13 BSL_CMD_START_DATA, /* 0x1 */
14 /* the midst flag of the data downloading */
15 BSL_CMD_MIDST_DATA, /* 0x2 */
16 /* the end flag of the data downloading */
17 BSL_CMD_END_DATA, /* 0x3 */
18 /* Execute from a certain address */
19 BSL_CMD_EXEC_DATA, /* 0x4 */
20 BSL_CMD_NORMAL_RESET, /* 0x5 */
21 BSL_CMD_READ_FLASH, /* 0x6 */
22 BSL_CMD_READ_CHIP_TYPE, /* 0x7 */
23 BSL_CMD_LOOKUP_NVITEM, /* 0x8 */
24 BSL_SET_BAUDRATE, /* 0x9 */
25 BSL_ERASE_FLASH, /* 0xA */
26 BSL_REPARTITION, /* 0xB */
27 BSL_CMD_SWITCH_MODE = 0x0D,
28 BSL_CMD_READ_FLASH_START =0x10,/*0x10*/
29 BSL_CMD_READ_FLASH_MIDST, /*0x11*/
30 BSL_CMD_READ_FLASH_END, /*0x12*/
33 /* Start of the Command can be transmited by phone*/
34 BSL_REP_TYPE_MIN = 0x80,
36 /* The operation acknowledge */
37 BSL_REP_ACK = BSL_REP_TYPE_MIN, /* 0x80 */
38 BSL_REP_VER, /* 0x81 */
40 /* the operation not acknowledge */
42 BSL_REP_INVALID_CMD, /* 0x82 */
43 BSL_REP_UNKNOW_CMD, /* 0x83 */
44 BSL_REP_OPERATION_FAILED, /* 0x84 */
47 BSL_REP_NOT_SUPPORT_BAUDRATE, /* 0x85 */
50 BSL_REP_DOWN_NOT_START, /* 0x86 */
51 BSL_REP_DOWN_MULTI_START, /* 0x87 */
52 BSL_REP_DOWN_EARLY_END, /* 0x88 */
53 BSL_REP_DOWN_DEST_ERROR, /* 0x89 */
54 BSL_REP_DOWN_SIZE_ERROR, /* 0x8A */
55 BSL_REP_VERIFY_ERROR, /* 0x8B */
56 BSL_REP_NOT_VERIFY, /* 0x8C */
58 /* Phone Internal Error */
59 BSL_PHONE_NOT_ENOUGH_MEMORY, /* 0x8D */
60 BSL_PHONE_WAIT_INPUT_TIMEOUT, /* 0x8E */
62 /* Phone Internal return value */
63 BSL_PHONE_SUCCEED, /* 0x8F */
64 BSL_PHONE_VALID_BAUDRATE, /* 0x90 */
65 BSL_PHONE_REPEAT_CONTINUE, /* 0x91 */
66 BSL_PHONE_REPEAT_BREAK, /* 0x92 */
68 BSL_REP_READ_FLASH, /* 0x93 */
69 BSL_REP_READ_CHIP_TYPE, /* 0x94 */
70 BSL_REP_LOOKUP_NVITEM, /* 0x95 */
72 BSL_INCOMPATIBLE_PARTITION, /* 0x96 */
73 BSL_UNKNOWN_DEVICE, /* 0x97 */
74 BSL_INVALID_DEVICE_SIZE, /* 0x98 */
76 BSL_ILLEGAL_SDRAM, /* 0x99 */
77 BSL_WRONG_SDRAM_PARAMETER, /* 0x9a */
78 BSL_EEROR_CHECKSUM = 0xA0,
84 typedef CMD_TYPE DLSTATUS;
86 typedef CMD_TYPE cmd_pkt_type;
87 typedef cmd_pkt_type ret_status;
90 /**---------------------------------------------------------------------------*
91 ** The Follow defines the packet processed result table *
93 ** HDLC_FLAG PKT_TYPE DATALENGHT [DATA] CRC HDLC_FLAG *
94 ** 0x7E MAX:255 MAX:65536 ... ... 0x7E *
97 ** 0x7E MAX:255 0 -- ... 0x7E *
99 ** response packet length: 8 bytes *
100 **---------------------------------------------------------------------------*/
102 typedef struct _PKT_HEADER
106 } PKT_HEADER, *PPKT_HEADER;
108 typedef struct pkt_header_tag
111 unsigned short length;
112 } pkt_header, *pkt_header_ptr;
114 #define PKT_FLAG_SIZE 1
115 #define PKT_CRC_SIZE 2
116 #define PKT_TYPE_SIZE 1
117 #define PKT_LEN_SIZE 2
119 #define PKT_HEADER_SIZE sizeof(PKT_HEADER)
120 #define DATA_ADDR PKT_HEADER_SIZE
123 #define SEND_ERROR_RSP(x) \
125 FDL_SendAckPacket(x); \
128 #endif /* CMD_DEFINE_H */