2 * USB Downloader for SAMSUNG Platform
4 * Copyright (C) 2007-2009 Samsung Electronics
5 * Minkyu Kang <mk7.kang@samsung.com>
8 #define msleep(a) udelay(a * 1000)
13 #define PRINTF(fmt, args...) printf(fmt, ##args)
15 #define PRINTF(fmt, args...)
18 /* partition info for partition sync - typically not use */
32 /* image type definition */
41 /* Download command definition */
42 #define COMMAND_DOWNLOAD_IMAGE 200
43 #define COMMAND_WRITE_PART_0 201
44 #define COMMAND_WRITE_PART_1 202
45 #define COMMAND_WRITE_PART_2 203
46 #define COMMAND_WRITE_PART_3 204
47 #define COMMAND_WRITE_PART_4 205
48 #define COMMAND_WRITE_PART_5 206
49 #define COMMAND_WRITE_PART_6 207
50 #define COMMAND_WRITE_PART_7 208
51 #define COMMAND_WRITE_PART_8 209
52 #define COMMAND_WRITE_PART_9 210
53 #define COMMAND_WRITE_UBI_INFO 211
54 #define COMMAND_PARTITION_SYNC 212
55 #define COMMAND_ERASE_PARAMETER 213
56 #define COMMAND_RESET_PDA 214
57 #define COMMAND_RESET_USB 215
58 #define COMMAND_RAM_BOOT 216
59 #define COMMAND_RAMDISK_MODE 217
60 #ifdef CONFIG_DOWN_PHONE
61 #define COMMAND_DOWN_PHONE 220
62 #define COMMAND_CHANGE_USB 221
64 #define COMMAND_CSA_CLEAR 222
65 #define COMMAND_PROGRESS 230
67 /* status definition */
74 /* download mode definition */
81 * USB Downloader Operations
82 * All functions and valuable are mandatory
84 * usb_init : initialize the USB Controller and check the connection
85 * usb_stop : stop and release USB
86 * send_data : send the data (BULK ONLY!!)
87 * recv_data : receive the data and returns received size (BULK ONLY!!)
88 * recv_setup : setup download address, length and DMA setting for receive
89 * tx_data : send data address
90 * rx_data : receive data address
91 * tx_len : size of send data
92 * rx_len : size of receive data
93 * ram_addr : address of will be stored data on RAM
95 * mmc_dev : device number of mmc
96 * mmc_max : number of max blocks
97 * mmc_blk : mmc block size
98 * mmc_total : mmc total blocks
101 int (*usb_init)(void);
102 void (*usb_stop)(void);
103 void (*send_data)(char *, int);
104 int (*recv_data)(void);
105 void (*recv_setup)(char *, int);
112 /* mmc device info */
118 void (*set_progress)(int);
119 void (*cpu_reset)(void);
120 void (*down_start)(void);
121 void (*down_cancel)(void);
124 /* This function is interfaced between USB Device Controller and USB Downloader
125 * Must Implementation this function at USB Controller!! */
126 struct usbd_ops *usbd_set_interface(struct usbd_ops *);