diff options
author | LiGang <b41990@freescale.com> | 2012-12-27 13:27:34 +0800 |
---|---|---|
committer | LiGang <b41990@freescale.com> | 2012-12-27 14:52:50 +0800 |
commit | 0e7ae7d5470d784a447bc94704ff1e8db5aca7de (patch) | |
tree | d5f85f277730f93b5b2f5994aae3875c195018fc /include | |
parent | b07b53788a970985363f6daee88e0ead9aff05b7 (diff) | |
download | u-boot-imx-0e7ae7d5470d784a447bc94704ff1e8db5aca7de.zip u-boot-imx-0e7ae7d5470d784a447bc94704ff1e8db5aca7de.tar.gz u-boot-imx-0e7ae7d5470d784a447bc94704ff1e8db5aca7de.tar.bz2 |
ENGR00238300: enhance the download speed for fastboot
1. the new fastboot is an add-on feature, the original fastboot is reserved
2. the new fastboot is a subset of original fastboot, only support "download"
and "flash" command
3. type "fastboot" in uboot to launch the original fastboot utility,
type "fastboot q" in uboot to launch the new fastboot utility
Signed-off-by: LiGang <b41990@freescale.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/fastboot.h | 24 | ||||
-rw-r--r-- | include/usb/imx_udc.h | 53 |
2 files changed, 77 insertions, 0 deletions
diff --git a/include/fastboot.h b/include/fastboot.h index f0ed108..e10c9af 100644 --- a/include/fastboot.h +++ b/include/fastboot.h @@ -331,6 +331,19 @@ int fastboot_check_and_clean_flag(void); int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); void check_fastboot_mode(void); + +void fastboot_quick(u8 debug); +void *fastboot_get_string_table(void); +int fastboot_write_mmc(u8 *partition_name, u32 write_len); +void fastboot_dump_memory(u32 *ptr, u32 lEN); +void fastboot_get_ep_num(u8 *in, u8 *out); +extern u8 fastboot_debug_level; +#define DBG_ALWS(x...) printf(x) +#define DBG_ERR(x...) printf(x) +#define DBG_DEBUG(x...) if (fastboot_debug_level >= 1) printf(x) +#define DBG_INFO(x...) if (fastboot_debug_level >= 2) printf(x) + + #else /* Stubs for when CONFIG_FASTBOOT is not defined */ @@ -356,5 +369,16 @@ void check_fastboot_mode(void); #define fastboot_flash_write(a, b, c, d) 0 #define do_fastboot(a, b, c, d) 0 + +#define fastboot_quick(a) 0 +#define fastboot_get_ep_num(a, b) 0 +#define fastboot_get_string_table() 1 +#define fastboot_dump_memory(a, b) 0 +#define DBG_ALWS(x...) +#define DBG_ERR(x...) +#define DBG_DEBUG(x...) +#define DBG_INFO(x...) + + #endif /* CONFIG_FASTBOOT */ #endif /* FASTBOOT_H */ diff --git a/include/usb/imx_udc.h b/include/usb/imx_udc.h index 3809640..da3bcd6 100644 --- a/include/usb/imx_udc.h +++ b/include/usb/imx_udc.h @@ -493,4 +493,57 @@ void enable_usb_phy1_clk(unsigned char enable); void enable_usboh3_clk(unsigned char enable); void udc_pins_setting(void); +#ifdef CONFIG_FASTBOOT + +#define EP0_OUT_INDEX 0 +#define EP0_IN_INDEX 16 +#define EP1_OUT_INDEX 1 +#define EP1_IN_INDEX 17 +#define EP2_OUT_INDEX 2 +#define EP2_IN_INDEX 18 +#define EP3_OUT_INDEX 3 +#define EP3_IN_INDEX 19 +#define EP4_OUT_INDEX 4 +#define EP4_IN_INDEX 20 +#define EP5_OUT_INDEX 5 +#define EP5_IN_INDEX 21 +#define EP6_OUT_INDEX 6 +#define EP6_IN_INDEX 22 +#define EP7_OUT_INDEX 7 +#define EP7_IN_INDEX 23 +#define EP8_OUT_INDEX 8 +#define EP8_IN_INDEX 24 +#define EP9_OUT_INDEX 9 +#define EP9_IN_INDEX 25 +#define EP10_OUT_INDEX 10 +#define EP10_IN_INDEX 26 +#define EP11_OUT_INDEX 11 +#define EP11_IN_INDEX 27 +#define EP12_OUT_INDEX 12 +#define EP12_IN_INDEX 28 +#define EP13_OUT_INDEX 13 +#define EP13_IN_INDEX 29 +#define EP14_OUT_INDEX 14 +#define EP14_IN_INDEX 30 +#define EP15_OUT_INDEX 15 +#define EP15_IN_INDEX 31 + +#define MAX_PAKET_LEN 512 +typedef void (*EP_HANDLER_P)(u32 index, u8 *buf); + +int udc_irq_handler(void); +void udc_hal_data_init(void); +void udc_wait_connect(void); +void udc_run(void); +int udc_recv_data(u32 index, u8 *recvbuf, u32 recvlen, EP_HANDLER_P cb); +int udc_send_data(u32 index, u8 *buf, u32 sendlen, EP_HANDLER_P cb); +void udc_qh_dtd_init(u32 index); +void udc_dtd_setup(u32 index, u8 ep_type); +void udc_qh_setup(u32 index, u8 ep_type, u32 max_pkt_len, u32 zlt, u8 mult); +u8 *udc_get_descriptor(u8 type, u8 *plen); +void udc_set_addr(u8 addr); +void udc_set_configure(u8 config); + +#endif /* CONFIG_FASTBOOT */ + #endif |