thor: fix invalid larger device descriptor than requested
[profile/mobile/platform/kernel/u-boot-tm1.git] / property / thor_mode.h
1 /*
2  * thor_mode.h - USB TIZEN THOR - internal gadget definitions
3  *
4  * Copyright (C) 2015 Samsung Electronics
5  * Inha Song  <ideal.song@samsung.com>
6  *
7  * SPDX-License-Identifier:     GPL-2.0+
8  */
9
10 #ifndef _THOR_MODE_H_
11 #define _THOR_MODE_H_
12
13 #include <asm/sizes.h>
14
15 #define ENOTSUPP                524     /* Operation is not supported */
16
17 #define F_NAME_BUF_SIZE                 32
18 #define THOR_PACKET_SIZE                SZ_1M   /* 1 MiB */
19 #define THOR_STORE_UNIT_SIZE    SZ_16M  /* 16 MiB */
20
21 /* same with fastboot buffer address */
22 #define CONFIG_THOR_TRANSFER_BUFFER             0x80100000
23
24 #define VER_PROTOCOL_MAJOR      4
25 #define VER_PROTOCOL_MINOR      0
26
27 enum rqt {
28         RQT_INFO = 200,
29         RQT_CMD,
30         RQT_DL,
31         RQT_UL,
32 };
33
34 enum rqt_data {
35         /* RQT_INFO */
36         RQT_INFO_VER_PROTOCOL = 1,
37         RQT_INIT_VER_HW,
38         RQT_INIT_VER_BOOT,
39         RQT_INIT_VER_KERNEL,
40         RQT_INIT_VER_PLATFORM,
41         RQT_INIT_VER_CSC,
42
43         /* RQT_CMD */
44         RQT_CMD_REBOOT = 1,
45         RQT_CMD_POWEROFF,
46         RQT_CMD_EFSCLEAR,
47
48         /* RQT_DL */
49         RQT_DL_INIT = 1,
50         RQT_DL_FILE_INFO,
51         RQT_DL_FILE_START,
52         RQT_DL_FILE_END,
53         RQT_DL_EXIT,
54
55         /* RQT_UL */
56         RQT_UL_INIT = 1,
57         RQT_UL_START,
58         RQT_UL_END,
59         RQT_UL_EXIT,
60 };
61
62 struct rqt_box {                                /* total: 256B */
63         signed int rqt;                         /* request id */
64         signed int rqt_data;            /* request data id */
65         signed int int_data[14];        /* int data */
66         char str_data[5][32];           /* string data */
67         char md5[32];                           /* md5 checksum */
68 } __attribute__ ((__packed__));
69
70 struct rsp_box {                                /* total: 128B */
71         signed int rsp;                         /* response id (= request id) */
72         signed int rsp_data;            /* response data id */
73         signed int ack;                         /* ack */
74         signed int int_data[5];         /* int data */
75         char str_data[3][32];           /* string data */
76 } __attribute__ ((__packed__));
77
78 struct data_rsp_box {                   /* total: 8B */
79         signed int ack;                         /* response id (= request id) */
80         signed int count;                       /* response data id */
81 } __attribute__ ((__packed__));
82
83 enum {
84         FILE_TYPE_NORMAL,
85         FILE_TYPE_PIT,
86 };
87
88 #endif /* _THOR_MODE_H_ */