diff --git a/inflash/xburst_include/jz4740.h b/inflash/xburst_include/jz4740.h index 0b6b96f..fbc26f3 100644 --- a/inflash/xburst_include/jz4740.h +++ b/inflash/xburst_include/jz4740.h @@ -22,6 +22,7 @@ #ifndef __JZ4740_H__ #define __JZ4740_H__ +typedef unsigned int size_t; typedef unsigned char u8; typedef unsigned short u16; typedef unsigned int u32; diff --git a/inflash/xburst_stage1/Makefile b/inflash/xburst_stage1/Makefile index dda543d..7238237 100644 --- a/inflash/xburst_stage1/Makefile +++ b/inflash/xburst_stage1/Makefile @@ -7,14 +7,14 @@ # 3 of the License, or (at your option) any later version. # -FLASH_TOOL_BIN_PATH = ../bin -FLASH_TOOL_SRC_PATH = ../src +INFLASH_SRC_PATH = ../src +XBURST_INCLUDE_PATH = ../xburst_include ifeq ($(CROSS_COMPILE),) $(error CROSS_COMPILE variable not set, should point to .../mipsel-openwrt-linux-) endif -CFLAGS := -O2 -mips32 -fno-pic -mno-abicalls -I$(FLASH_TOOL_SRC_PATH) +CFLAGS := -O2 -mips32 -fno-pic -mno-abicalls -I$(INFLASH_SRC_PATH) -I$(XBURST_INCLUDE_PATH) LDFLAGS := -nostdlib -EL -T target.ld OBJS = head.o main.o common.o board_4740.o board_4750.o debug.o diff --git a/inflash/xburst_stage2/Makefile b/inflash/xburst_stage2/Makefile index 3ad1d96..713a4b2 100644 --- a/inflash/xburst_stage2/Makefile +++ b/inflash/xburst_stage2/Makefile @@ -8,7 +8,8 @@ # 2 of the License, or (at your option) any later version. # -FLASH_TOOL_SRC_PATH = ../src +INFLASH_SRC_PATH = ../src +XBURST_INCLUDE_PATH = ../xburst_include ifeq ($(CROSS_COMPILE),) $(error CROSS_COMPILE variable not set, should point to .../mipsel-openwrt-linux-) @@ -22,14 +23,11 @@ NM := $(CROSS_COMPILE)nm OBJDUMP := $(CROSS_COMPILE)objdump CFLAGS := -mips32 -O2 -fno-exceptions -ffunction-sections \ - -fomit-frame-pointer -msoft-float -G 0 + -fomit-frame-pointer -msoft-float -G 0 \ + -I$(XBURST_INCLUDE_PATH) -I$(INFLASH_SRC_PATH) LDFLAGS := -nostdlib -T target.ld $(CFLAGS) LIBS := -lstdc++ -lc -lm -lgcc -USBBOOTDIR := . - -CFLAGS += -I$(USBBOOTDIR)/include -I$(FLASH_TOOL_SRC_PATH) - OBJS := main.o udc.o cache.o serial.o boothandler.o nandflash_4740.o nandflash_4750.o all: xburst_stage2.elf diff --git a/inflash/xburst_stage2/boothandler.c b/inflash/xburst_stage2/boothandler.c index a4fd622..88b0f01 100644 --- a/inflash/xburst_stage2/boothandler.c +++ b/inflash/xburst_stage2/boothandler.c @@ -19,7 +19,7 @@ * Boston, MA 02110-1301, USA */ -#include"jz4740.h" +#include "jz4740.h" #include "usb.h" #include "error.h" #include "usb_boot.h" @@ -46,8 +46,8 @@ extern u32 Bulk_out_buf[BULK_OUT_BUF_SIZE]; extern u32 Bulk_in_buf[BULK_IN_BUF_SIZE]; extern u16 handshake_PKT[4]; extern udc_state; -extern void *memset(void *, int , size_t); -extern void *memcpy(void *, const void *, size_t); +extern void *memset(void *s, int c, size_t count); +extern void *memcpy(void *dest, const void *src, size_t count); u32 ret_dat; u32 start_addr; //program operation start address or sector diff --git a/inflash/xburst_stage2/udc.c b/inflash/xburst_stage2/udc.c index a22baa5..12e3a69 100644 --- a/inflash/xburst_stage2/udc.c +++ b/inflash/xburst_stage2/udc.c @@ -44,7 +44,6 @@ static u32 fifosize[] = { MAX_EP0_SIZE, MAX_EP1_SIZE }; -#if 1 void *memset(void *s, int c, size_t count) { char *xs = s; @@ -63,7 +62,6 @@ void *memcpy(void *dest, const void *src, size_t count) *tmp++ = *s++; return dest; } -#endif static void udcReadFifo(u8 *ptr, int size) {