1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-11-22 12:54:59 +02:00

remove duplicate code

This commit is contained in:
Xiangfu Liu 2011-03-07 11:11:38 +08:00
parent 9b840cda9a
commit 7597779cae
10 changed files with 24 additions and 41 deletions

View File

@ -29,6 +29,7 @@
#include "cmd.h" #include "cmd.h"
#include "ingenic_cfg.h" #include "ingenic_cfg.h"
#include "ingenic_usb.h" #include "ingenic_usb.h"
#include "ingenic_request.h"
#include "usb_boot_defines.h" #include "usb_boot_defines.h"
extern int com_argc; extern int com_argc;

View File

@ -19,7 +19,6 @@
#ifndef __COMMAND_LINE_H__ #ifndef __COMMAND_LINE_H__
#define __COMMAND_LINE_H__ #define __COMMAND_LINE_H__
int command_input(char *buf);
int command_handle(char *buf); int command_handle(char *buf);
#endif /* __COMMAND_LINE_H__ */ #endif /* __COMMAND_LINE_H__ */

View File

@ -0,0 +1,16 @@
#ifndef __INGENIC_REQUEST_H__
#define __INGENIC_REQUEST_H__
#define VR_GET_CPU_INFO (0x00)
#define VR_SET_DATA_ADDRESS (0x01)
#define VR_SET_DATA_LENGTH (0x02)
#define VR_FLUSH_CACHES (0x03)
#define VR_PROGRAM_START1 (0x04)
#define VR_PROGRAM_START2 (0x05)
#define VR_NOR_OPS (0x06)
#define VR_NAND_OPS (0x07)
#define VR_SDRAM_OPS (0x08)
#define VR_CONFIGRATION (0x09)
#define VR_RESET (0x0a)
#endif

View File

@ -22,6 +22,7 @@
#include <usb.h> #include <usb.h>
#include "usb_boot_defines.h" #include "usb_boot_defines.h"
#include "ingenic_usb.h" #include "ingenic_usb.h"
#include "ingenic_request.h"
extern unsigned int total_size; extern unsigned int total_size;

View File

@ -25,18 +25,6 @@
#define INGENIC_OUT_ENDPOINT 0x01 #define INGENIC_OUT_ENDPOINT 0x01
#define INGENIC_IN_ENDPOINT 0x81 #define INGENIC_IN_ENDPOINT 0x81
#define VR_GET_CPU_INFO 0x00
#define VR_SET_DATA_ADDRESS 0x01
#define VR_SET_DATA_LENGTH 0x02
#define VR_FLUSH_CACHES 0x03
#define VR_PROGRAM_START1 0x04
#define VR_PROGRAM_START2 0x05
#define VR_NOR_OPS 0x06
#define VR_NAND_OPS 0x07
#define VR_SDRAM_OPS 0x08
#define VR_CONFIGRATION 0x09
#define VR_RESET 0x0a
#define JZ4740V1 1 #define JZ4740V1 1
#define JZ4750V1 2 #define JZ4750V1 2
#define JZ4760V1 3 #define JZ4760V1 3

View File

@ -31,7 +31,6 @@ int nand_init_4740(int bus_width, int row_cycle, int page_size, int page_per_blo
int,int,int,int); int,int,int,int);
int nand_fini_4740(void); int nand_fini_4740(void);
u32 nand_program_4740(void *context, int spage, int pages, int option); u32 nand_program_4740(void *context, int spage, int pages, int option);
//int nand_program_oob_4740(void *context, int spage, int pages, void (*notify)(int));
u32 nand_erase_4740(int blk_num, int sblk, int force); u32 nand_erase_4740(int blk_num, int sblk, int force);
u32 nand_read_4740(void *buf, u32 startpage, u32 pagenum,int option); u32 nand_read_4740(void *buf, u32 startpage, u32 pagenum,int option);
u32 nand_read_oob_4740(void *buf, u32 startpage, u32 pagenum); u32 nand_read_oob_4740(void *buf, u32 startpage, u32 pagenum);
@ -42,21 +41,15 @@ void nand_disable_4740(u32 csn);
/* Jz4760 nandflash interface */ /* Jz4760 nandflash interface */
unsigned int nand_query_4760(u8 *); unsigned int nand_query_4760(u8 *);
//int nand_init_4760(int bus_width, int row_cycle, int page_size, int page_per_block,
// int,int,int,int);
int nand_init_4760(int bus_width, int row_cycle, int page_size, int page_per_block, int nand_init_4760(int bus_width, int row_cycle, int page_size, int page_per_block,
int bch_bit, int ecc_pos, int bad_pos, int bad_page, int force); int bch_bit, int ecc_pos, int bad_pos, int bad_page, int force);
int nand_fini_4760(void); int nand_fini_4760(void);
u32 nand_program_4760(void *context, int spage, int pages, int option); u32 nand_program_4760(void *context, int spage, int pages, int option);
//int nand_program_oob_4740(void *context, int spage, int pages, void (*notify)(int));
u32 nand_erase_4760(int blk_num, int sblk, int force); u32 nand_erase_4760(int blk_num, int sblk, int force);
u32 nand_read_4760(void *buf, u32 startpage, u32 pagenum,int option); u32 nand_read_4760(void *buf, u32 startpage, u32 pagenum,int option);
u32 nand_read_oob_4760(void *buf, u32 startpage, u32 pagenum); u32 nand_read_oob_4760(void *buf, u32 startpage, u32 pagenum);
u32 nand_read_raw_4760(void *buf, u32 startpage, u32 pagenum,int); u32 nand_read_raw_4760(void *buf, u32 startpage, u32 pagenum,int);
u32 nand_mark_bad_4760(int bad); u32 nand_mark_bad_4760(int bad);
void nand_enable_4760(u32 csn); void nand_enable_4760(u32 csn);
void nand_disable_4760(u32 csn); void nand_disable_4760(u32 csn);

View File

@ -32,19 +32,4 @@ enum UDC_STATE
BULK_OUT BULK_OUT
}; };
enum USB_JZ4740_REQUEST /* add for USB_BOOT */
{
VR_GET_CUP_INFO = 0,
VR_SET_DATA_ADDERSS,
VR_SET_DATA_LENGTH,
VR_FLUSH_CACHES,
VR_PROGRAM_START1,
VR_PROGRAM_START2,
VR_NOR_OPS,
VR_NAND_OPS,
VR_SDRAM_OPS,
VR_CONFIGRATION,
VR_RESET
};
#endif /* __USB_BOOT_H__ */ #endif /* __USB_BOOT_H__ */

View File

@ -8,8 +8,7 @@
# 2 of the License, or (at your option) any later version. # 2 of the License, or (at your option) any later version.
# #
INFLASH_SRC_PATH = ../src XBURST_INCLUDE_PATH = -I../xburst_include -I../src
XBURST_INCLUDE_PATH = ../xburst_include
ifeq ($(CROSS_COMPILE),) ifeq ($(CROSS_COMPILE),)
$(error CROSS_COMPILE variable not set, should point to .../mipsel-openwrt-linux-) $(error CROSS_COMPILE variable not set, should point to .../mipsel-openwrt-linux-)
@ -31,7 +30,7 @@ DEBUG_CFLAGS = -g -Wa,-a=$(basename $@).lst
# is to disable this optimization right now. # is to disable this optimization right now.
CFLAGS = -mips32 -O2 -fno-exceptions -fno-zero-initialized-in-bss \ CFLAGS = -mips32 -O2 -fno-exceptions -fno-zero-initialized-in-bss \
-ffunction-sections -fomit-frame-pointer -msoft-float -G 0 -fpie \ -ffunction-sections -fomit-frame-pointer -msoft-float -G 0 -fpie \
-I$(XBURST_INCLUDE_PATH) -I$(INFLASH_SRC_PATH) -D$(DEVICE) $(XBURST_INCLUDE_PATH) -D$(DEVICE)
LDFLAGS = -nostdlib -T target.ld $(CFLAGS) LDFLAGS = -nostdlib -T target.ld $(CFLAGS)
OBJS = main.o udc.o cache.o serial.o boothandler.o nandflash_4740.o nandflash_4760.o OBJS = main.o udc.o cache.o serial.o boothandler.o nandflash_4740.o nandflash_4760.o

View File

@ -20,6 +20,7 @@
#include "usb/udc.h" #include "usb/udc.h"
#include "target/usb_boot.h" #include "target/usb_boot.h"
#include "target/xburst_types.h" #include "target/xburst_types.h"
#include "ingenic_request.h"
#if defined(NANONOTE) #if defined(NANONOTE)
#include "target/jz4740.h" #include "target/jz4740.h"
@ -382,10 +383,10 @@ void usbHandleVendorReq(u8 *buf)
int ret_state; int ret_state;
USB_DeviceRequest *dreq = (USB_DeviceRequest *)buf; USB_DeviceRequest *dreq = (USB_DeviceRequest *)buf;
switch (dreq->bRequest) { switch (dreq->bRequest) {
case VR_GET_CUP_INFO: case VR_GET_CPU_INFO:
ret_state = GET_CUP_INFO_Handle(); ret_state = GET_CUP_INFO_Handle();
break; break;
case VR_SET_DATA_ADDERSS: case VR_SET_DATA_ADDRESS:
ret_state = SET_DATA_ADDERSS_Handle(buf); ret_state = SET_DATA_ADDERSS_Handle(buf);
break; break;
case VR_SET_DATA_LENGTH: case VR_SET_DATA_LENGTH: