⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 u-boot-lfc.patch

📁 该源码是2410下的nandboot的源码
💻 PATCH
📖 第 1 页 / 共 5 页
字号:
+        printf ("nand device [dev] - show or set current device\n");+        printf ("nand read[.jffs2[s]]  addr off size\n");+        printf ("nand write[.jffs2] addr off size - read/write `size' bytes starting at offset `off' to/from memory address `addr'\n");+        printf ("nand erase [clean] [off size] - erase `size' bytes from offset `off' (entire device if not specified)\n");+        printf ("nand bad - show bad blocks\n");+        printf ("nand read.oob addr off size - read out-of-band data\n");+        printf ("nand write.oob addr off size - read out-of-band data\n");         	return 1;+     case 2: 	if (strcmp(argv[1],"info") == 0) { 		int i;@@ -503,6 +512,7 @@ 	} 	printf ("Usage:\n%s\n", cmdtp->usage); 	return 1;+     case 3: 	if (strcmp(argv[1],"device") == 0) { 		int dev = (int)simple_strtoul(argv[2], NULL, 10);@@ -525,7 +535,7 @@  		return 0; 	}-	else if (strcmp(argv[1],"erase") == 0 && strcmp(argv[2], "clean") == 0) {+	else if (strcmp(argv[1],"erase") == 0 && strcmp(argv[2], "clean") == 0)         { 		struct nand_chip* nand = &nand_dev_desc[curr_device]; 		ulong off = 0; 		ulong size = nand->totlen;@@ -756,6 +766,9 @@ 	"loadAddr dev\n" ); +++ #endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) */  #endif /* CFG_NAND_LEGACY */diff -ruN u-boot-20060523/common/console.c u-boot/common/console.c--- u-boot-20060523/common/console.c	2006-09-25 17:03:59.000000000 +0800+++ u-boot/common/console.c	2006-10-23 17:17:27.000000000 +0800@@ -415,7 +415,7 @@ 	stdoutname = getenv ("stdout"); 	stderrname = getenv ("stderr"); -	if (OVERWRITE_CONSOLE == 0) { 	/* if not overwritten by config switch */+	if (OVERWRITE_CONSOLE == 0) { /* if not overwritten by config switch */ 		inputdev  = search_device (DEV_FLAGS_INPUT,  stdinname); 		outputdev = search_device (DEV_FLAGS_OUTPUT, stdoutname); 		errdev    = search_device (DEV_FLAGS_OUTPUT, stderrname);diff -ruN u-boot-20060523/common/devices.c u-boot/common/devices.c--- u-boot-20060523/common/devices.c	2006-09-25 17:03:59.000000000 +0800+++ u-boot/common/devices.c	2006-10-23 17:04:41.000000000 +0800@@ -182,25 +182,33 @@ #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) 	i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE); #endif+ #ifdef CONFIG_LCD 	drv_lcd_init (); #endif+ #if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE) 	drv_video_init (); #endif+ #ifdef CONFIG_KEYBOARD 	drv_keyboard_init (); #endif+ #ifdef CONFIG_LOGBUFFER 	drv_logbuff_init (); #endif+ 	drv_system_init ();+ #ifdef CONFIG_SERIAL_MULTI 	serial_devices_init (); #endif+ #ifdef CONFIG_USB_TTY 	drv_usbtty_init (); #endif+ #ifdef CONFIG_NETCONSOLE 	drv_nc_init (); #endifdiff -ruN u-boot-20060523/common/env_nand.c u-boot/common/env_nand.c--- u-boot-20060523/common/env_nand.c	2006-09-25 17:04:03.000000000 +0800+++ u-boot/common/env_nand.c	2006-10-16 19:41:33.000000000 +0800@@ -32,7 +32,7 @@ #include <common.h>  #if defined(CFG_ENV_IS_IN_NAND) /* Environment is in Nand Flash */-+//#include <s3c2410.h> #include <command.h> #include <environment.h> #include <linux/stddef.h>@@ -53,13 +53,17 @@ #error CONFIG_INFERNO not supported yet #endif -int nand_legacy_rw (struct nand_chip* nand, int cmd,+extern int nand_legacy_rw (struct nand_chip* nand, int cmd, 	    size_t start, size_t len, 	    size_t * retlen, u_char * buf);+extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];+extern int nand_legacy_erase(struct nand_chip *nand, size_t ofs,+		                size_t len, int clean); -/* info for NAND chips, defined in drivers/nand/nand.c */-extern nand_info_t nand_info[]; +/* info for NAND chips, defined in drivers/nand/nand.c */+//extern nand_info_t nand_info[];+nand_info_t nand_info[CFG_MAX_NAND_DEVICE]; /* references to names in env_common.c */ extern uchar default_environment[]; extern int default_environment_size;@@ -94,6 +98,8 @@  */ int env_init(void) {+//	S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();+//	gpio->GPFDAT = (gpio->GPFDAT & ~(0xf<<4))|((~(0x3) & 0xf)<<4);	 	gd->env_addr  = (ulong)&default_environment[0]; 	gd->env_valid = 1; @@ -146,12 +152,18 @@ 	int ret = 0;  	puts ("Erasing Nand...");-	if (nand_erase(&nand_info[0], CFG_ENV_OFFSET, CFG_ENV_SIZE))+//	if (nand_erase(&nand_info[0], CFG_ENV_OFFSET, CFG_ENV_SIZE))+	if (nand_legacy_erase(nand_dev_desc + 0, CFG_ENV_OFFSET, CFG_ENV_SIZE, 0))+				 		return 1;  	puts ("Writing to Nand... "); 	total = CFG_ENV_SIZE;-	ret = nand_write(&nand_info[0], CFG_ENV_OFFSET, &total, (u_char*)env_ptr);+//	ret = nand_write(&nand_info[0], CFG_ENV_OFFSET, &total, (u_char*)env_ptr);+	ret = nand_legacy_rw(nand_dev_desc + 0,+			0x00 | 0x02, CFG_ENV_OFFSET, CFG_ENV_SIZE,+			&total, (u_char*)env_ptr);+	 	if (ret || total != CFG_ENV_SIZE) 		return 1; @@ -173,7 +185,6 @@  	tmp_env1 = (env_t *) malloc(CFG_ENV_SIZE); 	tmp_env2 = (env_t *) malloc(CFG_ENV_SIZE);- 	nand_read(&nand_info[0], CFG_ENV_OFFSET, &total, 		  (u_char*) tmp_env1); 	nand_read(&nand_info[0], CFG_ENV_OFFSET_REDUND, &total,@@ -226,7 +237,9 @@ 	int ret;  	total = CFG_ENV_SIZE;-	ret = nand_read(&nand_info[0], CFG_ENV_OFFSET, &total, (u_char*)env_ptr);+	//ret = nand_read(&nand_info[0], CFG_ENV_OFFSET, &total, (u_char*)env_ptr);+	ret = nand_legacy_rw(nand_dev_desc + 0, 0x01 | 0x02, CFG_ENV_OFFSET, CFG_ENV_SIZE, &total, (u_char*)env_ptr);+			   	if (ret || total != CFG_ENV_SIZE) 		return use_default(); diff -ruN u-boot-20060523/common/main.c u-boot/common/main.c--- u-boot-20060523/common/main.c	2006-09-25 17:04:03.000000000 +0800+++ u-boot/common/main.c	2006-10-23 18:43:41.000000000 +0800@@ -301,9 +301,11 @@ 	char *s; 	int bootdelay; #endif+ #ifdef CONFIG_PREBOOT 	char *p; #endif+ #ifdef CONFIG_BOOTCOUNT_LIMIT 	unsigned long bootcount = 0; 	unsigned long bootlimit = 0;diff -ruN u-boot-20060523/common/serial.c u-boot/common/serial.c--- u-boot-20060523/common/serial.c	2006-09-25 17:04:03.000000000 +0800+++ u-boot/common/serial.c	2006-10-22 18:30:06.000000000 +0800@@ -177,7 +177,7 @@ void serial_putc (const char c) { 	if (!(gd->flags & GD_FLG_RELOC) || !serial_current) {-		struct serial_device *dev = default_serial_console ();+		struct serial_device *dev = default_serial_console();  		dev->putc (c); 		return;diff -ruN u-boot-20060523/config.mk.orig u-boot/config.mk.orig--- u-boot-20060523/config.mk.orig	1970-01-01 08:00:00.000000000 +0800+++ u-boot/config.mk.orig	2006-10-16 19:39:29.000000000 +0800@@ -0,0 +1,194 @@+#+# (C) Copyright 2000+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.+#+# See file CREDITS for list of people who contributed to this+# project.+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License as+# published by the Free Software Foundation; either version 2 of+# the License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,+# MA 02111-1307 USA+#++#########################################################################++# clean the slate ...+PLATFORM_RELFLAGS =+PLATFORM_CPPFLAGS =+PLATFORM_LDFLAGS =++#+# When cross-compiling on NetBSD, we have to define __PPC__ or else we+# will pick up a va_list declaration that is incompatible with the+# actual argument lists emitted by the compiler.+#+# [Tested on NetBSD/i386 1.5 + cross-powerpc-netbsd-1.3]++ifeq ($(ARCH),ppc)+ifeq ($(CROSS_COMPILE),powerpc-netbsd-)+PLATFORM_CPPFLAGS+= -D__PPC__+endif+ifeq ($(CROSS_COMPILE),powerpc-openbsd-)+PLATFORM_CPPFLAGS+= -D__PPC__+endif+endif++ifeq ($(ARCH),arm)+ifeq ($(CROSS_COMPILE),powerpc-netbsd-)+PLATFORM_CPPFLAGS+= -D__ARM__+endif+ifeq ($(CROSS_COMPILE),powerpc-openbsd-)+PLATFORM_CPPFLAGS+= -D__ARM__+endif+endif++ifeq ($(ARCH),blackfin)+PLATFORM_CPPFLAGS+= -D__BLACKFIN__ -mno-underscore+endif++ifdef	ARCH+sinclude $(TOPDIR)/$(ARCH)_config.mk	# include architecture dependend rules+endif+ifdef	CPU+sinclude $(TOPDIR)/cpu/$(CPU)/config.mk	# include  CPU	specific rules+endif+ifdef	SOC+sinclude $(TOPDIR)/cpu/$(CPU)/$(SOC)/config.mk	# include  SoC	specific rules+endif+ifdef	VENDOR+BOARDDIR = $(VENDOR)/$(BOARD)+else+BOARDDIR = $(BOARD)+endif+ifdef	BOARD+sinclude $(TOPDIR)/board/$(BOARDDIR)/config.mk	# include board specific rules+endif++#########################################################################++CONFIG_SHELL	:= $(shell if [ -x "$$BASH" ]; then echo $$BASH; \+		    else if [ -x /bin/bash ]; then echo /bin/bash; \+		    else echo sh; fi ; fi)++ifeq ($(HOSTOS)-$(HOSTARCH),darwin-ppc)+HOSTCC		= cc+else+HOSTCC		= gcc+endif+HOSTCFLAGS	= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer+HOSTSTRIP	= strip++#########################################################################+#+# Option checker (courtesy linux kernel) to ensure+# only supported compiler options are used+#+cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \+		> /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)++#+# Include the make variables (CC, etc...)+#+AS	= $(CROSS_COMPILE)as+LD	= $(CROSS_COMPILE)ld+CC	= $(CROSS_COMPILE)gcc+CPP	= $(CC) -E+AR	= $(CROSS_COMPILE)ar+NM	= $(CROSS_COMPILE)nm+STRIP	= $(CROSS_COMPILE)strip+OBJCOPY = $(CROSS_COMPILE)objcopy+OBJDUMP = $(CROSS_COMPILE)objdump+RANLIB	= $(CROSS_COMPILE)RANLIB++RELFLAGS= $(PLATFORM_RELFLAGS)+DBGFLAGS= -g #-DDEBUG+OPTFLAGS= -Os #-fomit-frame-pointer+ifndef LDSCRIPT+#LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug+LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds+endif+OBJCFLAGS += --gap-fill=0xff++gccincdir := $(shell $(CC) -print-file-name=include)++CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS)		\+	-D__KERNEL__ -DTEXT_BASE=$(TEXT_BASE)		\+	-I$(TOPDIR)/include				\+	-fno-builtin -ffreestanding -nostdinc -isystem	\+	$(gccincdir) -pipe $(PLATFORM_CPPFLAGS)++ifdef BUILD_TAG+CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes \+	-DBUILD_TAG='"$(BUILD_TAG)"'+else+CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes+endif++# avoid trigraph warnings while parsing pci.h (produced by NIOS gcc-2.9)+# this option have to be placed behind -Wall -- that's why it is here+ifeq ($(ARCH),nios)+ifeq ($(findstring 2.9,$(shell $(CC) --version)),2.9)+CFLAGS := $(CPPFLAGS) -Wall -Wno-trigraphs+endif+endif++AFLAGS_DEBUG := -Wa,-gstabs+AFLAGS := $(AFLAGS_DEBUG) -D__ASSEMBLY__ $(CPPFLAGS)++LDFLAGS += -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)++# Location of a usable BFD library, where we define "usable" as+# "built for ${HOST}, supports ${TARGET}".  Sensible values are+# - When cross-compiling: the root of the cross-environment+# - Linux/ppc (native): /usr+# - NetBSD/ppc (native): you lose ... (must extract these from the+#   binutils build directory, plus the native and U-Boot include+#   files don't like each other)+#+# So far, this is used only by tools/gdb/Makefile.++ifeq ($(HOSTOS)-$(HOSTARCH),darwin-ppc)+BFD_ROOT_DIR =		/usr/local/tools+else+ifeq ($(HOSTARCH),$(ARCH))+# native+BFD_ROOT_DIR =		/usr+else+#BFD_ROOT_DIR =		/LinuxPPC/CDK		# Linux/i386+#BFD_ROOT_DIR =		/usr/pkg/cross		# NetBSD/i386+BFD_ROOT_DIR =		/opt/powerpc+endif+endif++ifeq ($(PCI_CLOCK),PCI_66M)+CFLAGS := $(CFLAGS) -DPCI_66M+endif++#########################################################################++export	CONFIG_SHELL HPATH HOSTCC HOSTCFLAGS CROSS_COMPILE \+	AS LD CC CPP AR NM STRIP OBJCOPY OBJDUMP \+	MAKE+export	TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS AFLAGS++#########################################################################++%.s:	%.S+	$(CPP) $(AFLAGS) -o $@ $(CURDIR)/$<+%.o:	%.S+	$(CC) $(AFLAGS) -c -o $@ $(CURDIR)/$<+%.o:	%.c+	$(CC) $(CFLAGS) -c -o $@ $<++#########################################################################diff -ruN u-boot-20060523/config.mk.rej u-boot/config.mk.rej--- u-boot-20060523/config.mk.rej	1970-01-01 08:00:00.000000000 +0800+++ u-boot/config.mk.rej	2006-10-16 19:41:33.000000000 +0800@@ -0,0 +1,32 @@+***************+*** 143,157 ****+  endif+  endif+  +- AFLAGS_DEBUG := -Wa,-gstabs+- +  # turn jbsr into jsr for m68k+  ifeq ($(ARCH),m68k)+  ifeq ($(findstring 3.4,$(shell $(CC) --version)),3.4)+  AFLAGS_DEBUG := -Wa,-gstabs,-S+  endif+  endif+- +  AFLAGS := $(AFLAGS_DEBUG) -D__ASSEMBLY__ $(CPPFLAGS)+  +  LDFLAGS += -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)+--- 143,156 ----+  endif+  endif+  +  # turn jbsr into jsr for m68k+  ifeq ($(ARCH),m68k)+  ifeq ($(findstring 3.4,$(shell $(CC) --version)),3.4)+  AFLAGS_DEBUG := -Wa,-gstabs,-S+  endif++ else++ AFLAGS_DEBUG := -Wa,-gstabs+  endif+  AFLAGS := $(AFLAGS_DEBUG) -D__ASSEMBLY__ $(CPPFLAGS)+  +  LDFLAGS += -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)diff -ruN u-boot-20060523/cpu/arm920t/s3c24x0/interrupts.c u-boot/cpu/arm920t/s3c24x0/interrupts.c--- u-boot-20060523/cpu/arm920t/s3c24x0/interrupts.c	2006-09-25 17:04:03.000000000 +0800+++ u-boot/cpu/arm920t/s3c24x0/interrupts.c	2006-10-23 12:54:20.000000000 +0800@@ -55,7 +55,7 @@ int interrupt_init (void) { 	S3C24X0_TIMERS * const timers = S3C24X0_GetBase_TIMERS();-+	S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO(); 	/* use PWM Timer 4 because it has no output */ 	/* prescaler for Timer 4 is 16 */ 	timers->TCFG0 = 0x0f00;@@ -76,6 +76,9 @@ 	timers->TCON = (timers->TCON & ~0x0700000) | 0x500000; 	timestamp = 0; +//	gpio->GPFDAT = (gpio->GPFDAT & ~(0xf<<4))|((~(0xe) & 0xf)<<4);+	+	 	return (0); } diff -ruN u-boot-20060523/cpu/arm920t/s3c24x0/serial.c u-boot/cpu/arm920t/s3c24x0/serial.c--- u-boot-20060523/cpu/arm920t/s3c24x0/serial.c	2006-09-25 17:04:03.000000000 +0800+++ u-boot/cpu/arm920t/s3c24x0/serial.c	2006-10-23 12:54:49.000000000 +0800@@ -51,6 +51,8 @@ void serial_setbrg (void) { 	S3C24X0_UART * const uart = S3C24X0_GetBase_UART(UART_NR);+

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -