Date:2011-03-07 04:11:38 (9 years 4 months ago)
Author:Xiangfu Liu
Commit:7597779cae112d54578ceeb2dadd2a8d5f7a81cc
Message:remove duplicate code

Files: usbboot/src/cmd.c (1 diff)
usbboot/src/command_line.h (1 diff)
usbboot/src/ingenic_request.h (1 diff)
usbboot/src/ingenic_usb.c (1 diff)
usbboot/src/ingenic_usb.h (1 diff)
usbboot/xburst_include/target/nandflash.h (2 diffs)
usbboot/xburst_include/target/usb_boot.h (1 diff)
usbboot/xburst_stage2/Makefile (2 diffs)
usbboot/xburst_stage2/main.c (1 diff)
usbboot/xburst_stage2/udc.c (2 diffs)

Change Details

usbboot/src/cmd.c
2929#include "cmd.h"
3030#include "ingenic_cfg.h"
3131#include "ingenic_usb.h"
32#include "ingenic_request.h"
3233#include "usb_boot_defines.h"
3334
3435extern int com_argc;
usbboot/src/command_line.h
1919#ifndef __COMMAND_LINE_H__
2020#define __COMMAND_LINE_H__
2121
22int command_input(char *buf);
2322int command_handle(char *buf);
2423
2524#endif /* __COMMAND_LINE_H__ */
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.c
2222#include <usb.h>
2323#include "usb_boot_defines.h"
2424#include "ingenic_usb.h"
25#include "ingenic_request.h"
2526
2627extern unsigned int total_size;
2728
usbboot/src/ingenic_usb.h
2525#define INGENIC_OUT_ENDPOINT 0x01
2626#define INGENIC_IN_ENDPOINT 0x81
2727
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
4028#define JZ4740V1 1
4129#define JZ4750V1 2
4230#define JZ4760V1 3
usbboot/xburst_include/target/nandflash.h
3131           int,int,int,int);
3232int nand_fini_4740(void);
3333u32 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));
3534u32 nand_erase_4740(int blk_num, int sblk, int force);
3635u32 nand_read_4740(void *buf, u32 startpage, u32 pagenum,int option);
3736u32 nand_read_oob_4740(void *buf, u32 startpage, u32 pagenum);
...... 
4241
4342/* Jz4760 nandflash interface */
4443unsigned 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
4844int nand_init_4760(int bus_width, int row_cycle, int page_size, int page_per_block,
4945           int bch_bit, int ecc_pos, int bad_pos, int bad_page, int force);
50
5146int nand_fini_4760(void);
5247u32 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));
5448u32 nand_erase_4760(int blk_num, int sblk, int force);
5549u32 nand_read_4760(void *buf, u32 startpage, u32 pagenum,int option);
5650u32 nand_read_oob_4760(void *buf, u32 startpage, u32 pagenum);
5751u32 nand_read_raw_4760(void *buf, u32 startpage, u32 pagenum,int);
5852u32 nand_mark_bad_4760(int bad);
59
6053void nand_enable_4760(u32 csn);
6154void nand_disable_4760(u32 csn);
6255
usbboot/xburst_include/target/usb_boot.h
3232    BULK_OUT
3333};
3434
35enum USB_JZ4740_REQUEST /* add for USB_BOOT */
36{
37    VR_GET_CUP_INFO = 0,
38    VR_SET_DATA_ADDERSS,
39    VR_SET_DATA_LENGTH,
40    VR_FLUSH_CACHES,
41    VR_PROGRAM_START1,
42    VR_PROGRAM_START2,
43    VR_NOR_OPS,
44    VR_NAND_OPS,
45    VR_SDRAM_OPS,
46    VR_CONFIGRATION,
47    VR_RESET
48};
49
5035#endif /* __USB_BOOT_H__ */
usbboot/xburst_stage2/Makefile
88# 2 of the License, or (at your option) any later version.
99#
1010
11INFLASH_SRC_PATH = ../src
12XBURST_INCLUDE_PATH = ../xburst_include
11XBURST_INCLUDE_PATH = -I../xburst_include -I../src
1312
1413ifeq ($(CROSS_COMPILE),)
1514$(error CROSS_COMPILE variable not set, should point to .../mipsel-openwrt-linux-)
...... 
3130# is to disable this optimization right now.
3231CFLAGS = -mips32 -O2 -fno-exceptions -fno-zero-initialized-in-bss \
3332    -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)
3534LDFLAGS = -nostdlib -T target.ld $(CFLAGS)
3635
3736OBJS = main.o udc.o cache.o serial.o boothandler.o nandflash_4740.o nandflash_4760.o
usbboot/xburst_stage2/main.c
2121extern void usb_main();
2222extern unsigned int UART_BASE;
2323struct fw_args *fw_args;
24unsigned int start_addr,got_start,got_end;
24unsigned int start_addr, got_start, got_end;
2525
2626void c_main(void)
2727{
usbboot/xburst_stage2/udc.c
2020#include "usb/udc.h"
2121#include "target/usb_boot.h"
2222#include "target/xburst_types.h"
23#include "ingenic_request.h"
2324
2425#if defined(NANONOTE)
2526#include "target/jz4740.h"
...... 
382383    int ret_state;
383384    USB_DeviceRequest *dreq = (USB_DeviceRequest *)buf;
384385    switch (dreq->bRequest) {
385    case VR_GET_CUP_INFO:
386    case VR_GET_CPU_INFO:
386387        ret_state = GET_CUP_INFO_Handle();
387388        break;
388    case VR_SET_DATA_ADDERSS:
389    case VR_SET_DATA_ADDRESS:
389390        ret_state = SET_DATA_ADDERSS_Handle(buf);
390391        break;
391392    case VR_SET_DATA_LENGTH:

Archive Download the corresponding diff file



interactive