usbboot/src/ingenic_request.h |
| 1 | #ifndef __INGENIC_REQUEST_H__ |
| 2 | #define __INGENIC_REQUEST_H__ |
| 3 | |
| 4 | #define VR_GET_CPU_INFO (0x00) |
| 5 | #define VR_SET_DATA_ADDRESS (0x01) |
| 6 | #define VR_SET_DATA_LENGTH (0x02) |
| 7 | #define VR_FLUSH_CACHES (0x03) |
| 8 | #define VR_PROGRAM_START1 (0x04) |
| 9 | #define VR_PROGRAM_START2 (0x05) |
| 10 | #define VR_NOR_OPS (0x06) |
| 11 | #define VR_NAND_OPS (0x07) |
| 12 | #define VR_SDRAM_OPS (0x08) |
| 13 | #define VR_CONFIGRATION (0x09) |
| 14 | #define VR_RESET (0x0a) |
| 15 | |
| 16 | #endif |
usbboot/src/ingenic_usb.h |
25 | 25 | #define INGENIC_OUT_ENDPOINT 0x01 |
26 | 26 | #define INGENIC_IN_ENDPOINT 0x81 |
27 | 27 | |
28 | | #define VR_GET_CPU_INFO 0x00 |
29 | | #define VR_SET_DATA_ADDRESS 0x01 |
30 | | #define VR_SET_DATA_LENGTH 0x02 |
31 | | #define VR_FLUSH_CACHES 0x03 |
32 | | #define VR_PROGRAM_START1 0x04 |
33 | | #define VR_PROGRAM_START2 0x05 |
34 | | #define VR_NOR_OPS 0x06 |
35 | | #define VR_NAND_OPS 0x07 |
36 | | #define VR_SDRAM_OPS 0x08 |
37 | | #define VR_CONFIGRATION 0x09 |
38 | | #define VR_RESET 0x0a |
39 | | |
40 | 28 | #define JZ4740V1 1 |
41 | 29 | #define JZ4750V1 2 |
42 | 30 | #define JZ4760V1 3 |
usbboot/xburst_include/target/nandflash.h |
31 | 31 | int,int,int,int); |
32 | 32 | int nand_fini_4740(void); |
33 | 33 | u32 nand_program_4740(void *context, int spage, int pages, int option); |
34 | | //int nand_program_oob_4740(void *context, int spage, int pages, void (*notify)(int)); |
35 | 34 | u32 nand_erase_4740(int blk_num, int sblk, int force); |
36 | 35 | u32 nand_read_4740(void *buf, u32 startpage, u32 pagenum,int option); |
37 | 36 | u32 nand_read_oob_4740(void *buf, u32 startpage, u32 pagenum); |
... | ... | |
42 | 41 | |
43 | 42 | /* Jz4760 nandflash interface */ |
44 | 43 | unsigned int nand_query_4760(u8 *); |
45 | | //int nand_init_4760(int bus_width, int row_cycle, int page_size, int page_per_block, |
46 | | // int,int,int,int); |
47 | | |
48 | 44 | int nand_init_4760(int bus_width, int row_cycle, int page_size, int page_per_block, |
49 | 45 | int bch_bit, int ecc_pos, int bad_pos, int bad_page, int force); |
50 | | |
51 | 46 | int nand_fini_4760(void); |
52 | 47 | u32 nand_program_4760(void *context, int spage, int pages, int option); |
53 | | //int nand_program_oob_4740(void *context, int spage, int pages, void (*notify)(int)); |
54 | 48 | u32 nand_erase_4760(int blk_num, int sblk, int force); |
55 | 49 | u32 nand_read_4760(void *buf, u32 startpage, u32 pagenum,int option); |
56 | 50 | u32 nand_read_oob_4760(void *buf, u32 startpage, u32 pagenum); |
57 | 51 | u32 nand_read_raw_4760(void *buf, u32 startpage, u32 pagenum,int); |
58 | 52 | u32 nand_mark_bad_4760(int bad); |
59 | | |
60 | 53 | void nand_enable_4760(u32 csn); |
61 | 54 | void nand_disable_4760(u32 csn); |
62 | 55 | |
usbboot/xburst_stage2/Makefile |
8 | 8 | # 2 of the License, or (at your option) any later version. |
9 | 9 | # |
10 | 10 | |
11 | | INFLASH_SRC_PATH = ../src |
12 | | XBURST_INCLUDE_PATH = ../xburst_include |
| 11 | XBURST_INCLUDE_PATH = -I../xburst_include -I../src |
13 | 12 | |
14 | 13 | ifeq ($(CROSS_COMPILE),) |
15 | 14 | $(error CROSS_COMPILE variable not set, should point to .../mipsel-openwrt-linux-) |
... | ... | |
31 | 30 | # is to disable this optimization right now. |
32 | 31 | CFLAGS = -mips32 -O2 -fno-exceptions -fno-zero-initialized-in-bss \ |
33 | 32 | -ffunction-sections -fomit-frame-pointer -msoft-float -G 0 -fpie \ |
34 | | -I$(XBURST_INCLUDE_PATH) -I$(INFLASH_SRC_PATH) -D$(DEVICE) |
| 33 | $(XBURST_INCLUDE_PATH) -D$(DEVICE) |
35 | 34 | LDFLAGS = -nostdlib -T target.ld $(CFLAGS) |
36 | 35 | |
37 | 36 | OBJS = main.o udc.o cache.o serial.o boothandler.o nandflash_4740.o nandflash_4760.o |
usbboot/xburst_stage2/udc.c |
20 | 20 | #include "usb/udc.h" |
21 | 21 | #include "target/usb_boot.h" |
22 | 22 | #include "target/xburst_types.h" |
| 23 | #include "ingenic_request.h" |
23 | 24 | |
24 | 25 | #if defined(NANONOTE) |
25 | 26 | #include "target/jz4740.h" |
... | ... | |
382 | 383 | int ret_state; |
383 | 384 | USB_DeviceRequest *dreq = (USB_DeviceRequest *)buf; |
384 | 385 | switch (dreq->bRequest) { |
385 | | case VR_GET_CUP_INFO: |
| 386 | case VR_GET_CPU_INFO: |
386 | 387 | ret_state = GET_CUP_INFO_Handle(); |
387 | 388 | break; |
388 | | case VR_SET_DATA_ADDERSS: |
| 389 | case VR_SET_DATA_ADDRESS: |
389 | 390 | ret_state = SET_DATA_ADDERSS_Handle(buf); |
390 | 391 | break; |
391 | 392 | case VR_SET_DATA_LENGTH: |