tizen 2.4 release
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / include / asm / arch-sc9630 / cmd_def.h
1 #ifndef CMD_DEFINE_H
2 #define CMD_DEFINE_H
3 #include "cmddef.h"
4
5 typedef enum _CMD_TYPE
6 {
7     BSL_PKT_TYPE_MIN = 0,                       /* the bottom of the DL packet type range */
8     BSL_CMD_TYPE_MIN = BSL_PKT_TYPE_MIN,        /* 0x0 */
9
10     /* Link Control */
11     BSL_CMD_CONNECT = BSL_CMD_TYPE_MIN,         /* 0x0 */
12     /* Data Download */
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_MCP_TYPE=0xD,                 /* 0xD */
29     BSL_CMD_READ_FLASH_START =0x10,/*0x10*/
30     BSL_CMD_READ_FLASH_MIDST,           /*0x11*/
31     BSL_CMD_READ_FLASH_END,             /*0x12*/
32     BSL_CMD_OFF_CHG = 0x13,                     /* 0x13*/
33     BSL_CMD_TYPE_MAX,
34
35     /* Start of the Command can be transmited by phone*/
36     BSL_REP_TYPE_MIN = 0x80,
37
38     /* The operation acknowledge */
39     BSL_REP_ACK = BSL_REP_TYPE_MIN,         /* 0x80 */
40     BSL_REP_VER,                            /* 0x81 */
41
42     /* the operation not acknowledge */
43     /* system  */
44     BSL_REP_INVALID_CMD,                    /* 0x82 */
45     BSL_REP_UNKNOW_CMD,                     /* 0x83 */
46     BSL_REP_OPERATION_FAILED,               /* 0x84 */
47
48     /* Link Control*/
49     BSL_REP_NOT_SUPPORT_BAUDRATE,           /* 0x85 */
50
51     /* Data Download */
52     BSL_REP_DOWN_NOT_START,                 /* 0x86 */
53     BSL_REP_DOWN_MULTI_START,               /* 0x87 */
54     BSL_REP_DOWN_EARLY_END,                 /* 0x88 */
55     BSL_REP_DOWN_DEST_ERROR,                /* 0x89 */
56     BSL_REP_DOWN_SIZE_ERROR,                /* 0x8A */
57     BSL_REP_VERIFY_ERROR,                   /* 0x8B */
58     BSL_REP_NOT_VERIFY,                     /* 0x8C */
59
60     /* Phone Internal Error */
61     BSL_PHONE_NOT_ENOUGH_MEMORY,            /* 0x8D */
62     BSL_PHONE_WAIT_INPUT_TIMEOUT,           /* 0x8E */
63
64     /* Phone Internal return value */
65     BSL_PHONE_SUCCEED,                      /* 0x8F */
66     BSL_PHONE_VALID_BAUDRATE,               /* 0x90 */
67     BSL_PHONE_REPEAT_CONTINUE,              /* 0x91 */
68     BSL_PHONE_REPEAT_BREAK,                 /* 0x92 */
69
70     BSL_REP_READ_FLASH,                     /* 0x93 */
71     BSL_REP_READ_CHIP_TYPE,                 /* 0x94 */
72     BSL_REP_LOOKUP_NVITEM,                  /* 0x95 */
73
74     BSL_INCOMPATIBLE_PARTITION,             /* 0x96 */
75     BSL_UNKNOWN_DEVICE,                     /* 0x97 */
76     BSL_INVALID_DEVICE_SIZE,                /* 0x98 */
77
78     BSL_ILLEGAL_SDRAM,                      /* 0x99 */
79     BSL_WRONG_SDRAM_PARAMETER,              /* 0x9a */
80     BSL_REP_READ_MCP_TYPE,                  /* 0x9b*/
81     BSL_EEROR_CHECKSUM = 0xA0,
82     BSL_CHECKSUM_DIFF,
83     BSL_WRITE_ERROR,
84     BSL_PKT_TYPE_MAX
85 } CMD_TYPE;
86
87 typedef CMD_TYPE DLSTATUS;
88
89 typedef CMD_TYPE cmd_pkt_type;
90 typedef cmd_pkt_type ret_status;
91
92
93 /**---------------------------------------------------------------------------*
94  ** The Follow defines the packet processed result table                      *
95  ** packet_protocol:                                                          *
96  ** HDLC_FLAG   PKT_TYPE     DATALENGHT    [DATA]    CRC       HDLC_FLAG      *
97  **   0x7E      MAX:255      MAX:65536      ...      ...          0x7E        *
98  **    1           2             2           0        2             1         *
99  ** response_packet:                                                          *
100  **   0x7E      MAX:255          0           --      ...          0x7E        *
101  **    1           2             2           --       2             1         *
102  ** response packet length: 8 bytes                                           *
103  **---------------------------------------------------------------------------*/
104
105 typedef struct _PKT_HEADER
106 {
107     unsigned short type;
108     unsigned short size;
109 } PKT_HEADER, *PPKT_HEADER;
110
111 typedef struct pkt_header_tag
112 {
113     unsigned short pkt_type;
114     unsigned short pkt_size;
115 } pkt_header, *pkt_header_ptr;
116
117 #define PKT_FLAG_SIZE              1
118 #define PKT_CRC_SIZE               2
119 #define PKT_TYPE_SIZE              1
120 #define PKT_LEN_SIZE               2
121
122 #define PKT_HEADER_SIZE            sizeof(PKT_HEADER)
123 #define DATA_ADDR                  PKT_HEADER_SIZE
124
125
126 #define SEND_ERROR_RSP(x)         \
127     {                       \
128         FDL_SendAckPacket(x);        \
129         while(1);           \
130     }
131 #endif /* CMD_DEFINE_H */