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