diff options
| -rw-r--r-- | MAINTAINERS | 4 | ||||
| -rwxr-xr-x | MAKEALL | 4 | ||||
| -rw-r--r-- | Makefile | 12 | ||||
| -rw-r--r-- | README | 10 | ||||
| -rw-r--r-- | arch/arm/config.mk | 8 | ||||
| -rw-r--r-- | arch/arm/cpu/arm920t/at91rm9200/ether.c | 2 | ||||
| -rw-r--r-- | arch/avr32/config.mk | 2 | ||||
| -rw-r--r-- | arch/blackfin/config.mk | 2 | ||||
| -rw-r--r-- | arch/m68k/config.mk | 2 | ||||
| -rw-r--r-- | arch/microblaze/config.mk | 2 | ||||
| -rw-r--r-- | arch/mips/config.mk | 2 | ||||
| -rw-r--r-- | arch/powerpc/config.mk | 2 | ||||
| -rw-r--r-- | arch/sh/config.mk | 4 | ||||
| -rw-r--r-- | arch/sparc/config.mk | 2 | ||||
| -rw-r--r-- | arch/sparc/cpu/leon2/cpu_init.c | 4 | ||||
| -rw-r--r-- | arch/sparc/cpu/leon3/cpu_init.c | 4 | ||||
| -rw-r--r-- | arch/x86/config.mk (renamed from arch/i386/config.mk) | 2 | ||||
| -rw-r--r-- | arch/x86/cpu/Makefile (renamed from arch/i386/cpu/Makefile) | 0 | ||||
| -rw-r--r-- | arch/x86/cpu/config.mk (renamed from arch/i386/cpu/config.mk) | 2 | ||||
| -rw-r--r-- | arch/x86/cpu/cpu.c (renamed from arch/i386/cpu/cpu.c) | 33 | ||||
| -rw-r--r-- | arch/x86/cpu/interrupts.c (renamed from arch/i386/cpu/interrupts.c) | 8 | ||||
| -rw-r--r-- | arch/x86/cpu/resetvec.S (renamed from arch/i386/cpu/resetvec.S) | 5 | ||||
| -rw-r--r-- | arch/x86/cpu/sc520/Makefile (renamed from arch/i386/cpu/sc520/Makefile) | 1 | ||||
| -rw-r--r-- | arch/x86/cpu/sc520/sc520.c (renamed from arch/i386/cpu/sc520/sc520.c) | 18 | ||||
| -rw-r--r-- | arch/x86/cpu/sc520/sc520_car.S (renamed from arch/i386/cpu/sc520/sc520_car.S) | 5 | ||||
| -rw-r--r-- | arch/x86/cpu/sc520/sc520_pci.c (renamed from arch/i386/cpu/sc520/sc520_pci.c) | 14 | ||||
| -rw-r--r-- | arch/x86/cpu/sc520/sc520_reset.c | 40 | ||||
| -rw-r--r-- | arch/x86/cpu/sc520/sc520_sdram.c (renamed from arch/i386/cpu/sc520/sc520_sdram.c) | 4 | ||||
| -rw-r--r-- | arch/x86/cpu/sc520/sc520_ssi.c (renamed from arch/i386/cpu/sc520/sc520_ssi.c) | 5 | ||||
| -rw-r--r-- | arch/x86/cpu/sc520/sc520_timer.c (renamed from arch/i386/cpu/sc520/sc520_timer.c) | 7 | ||||
| -rw-r--r-- | arch/x86/cpu/start.S (renamed from arch/i386/cpu/start.S) | 34 | ||||
| -rw-r--r-- | arch/x86/cpu/start16.S (renamed from arch/i386/cpu/start16.S) | 8 | ||||
| -rw-r--r-- | arch/x86/cpu/u-boot.lds (renamed from arch/i386/cpu/u-boot.lds) | 5 | ||||
| -rw-r--r-- | arch/x86/include/asm/bitops.h (renamed from arch/i386/include/asm/bitops.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/bootparam.h (renamed from arch/i386/include/asm/bootparam.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/byteorder.h (renamed from arch/i386/include/asm/byteorder.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/config.h (renamed from arch/i386/include/asm/config.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/e820.h (renamed from arch/i386/include/asm/e820.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/errno.h (renamed from arch/i386/include/asm/errno.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/global_data.h (renamed from arch/i386/include/asm/global_data.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/i8254.h (renamed from arch/i386/include/asm/i8254.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/i8259.h (renamed from arch/i386/include/asm/i8259.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/ibmpc.h (renamed from arch/i386/include/asm/ibmpc.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/ic/pci.h (renamed from arch/i386/include/asm/ic/pci.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/ic/sc520.h (renamed from arch/i386/include/asm/ic/sc520.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/ic/ssi.h (renamed from arch/i386/include/asm/ic/ssi.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/interrupt.h (renamed from arch/i386/include/asm/interrupt.h) | 4 | ||||
| -rw-r--r-- | arch/x86/include/asm/io.h (renamed from arch/i386/include/asm/io.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/ioctl.h (renamed from arch/i386/include/asm/ioctl.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/ist.h (renamed from arch/i386/include/asm/ist.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/pci.h (renamed from arch/i386/include/asm/pci.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/posix_types.h (renamed from arch/i386/include/asm/posix_types.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/processor-flags.h (renamed from arch/i386/include/asm/processor-flags.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/processor.h (renamed from arch/i386/include/asm/processor.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/ptrace.h (renamed from arch/i386/include/asm/ptrace.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/realmode.h (renamed from arch/i386/include/asm/realmode.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/string.h (renamed from arch/i386/include/asm/string.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/types.h (renamed from arch/i386/include/asm/types.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/u-boot-x86.h (renamed from arch/i386/include/asm/u-boot-i386.h) | 4 | ||||
| -rw-r--r-- | arch/x86/include/asm/u-boot.h (renamed from arch/i386/include/asm/u-boot.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/unaligned.h (renamed from arch/i386/include/asm/unaligned.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/video/edid.h (renamed from arch/i386/include/asm/video/edid.h) | 0 | ||||
| -rw-r--r-- | arch/x86/include/asm/zimage.h (renamed from arch/i386/include/asm/zimage.h) | 0 | ||||
| -rw-r--r-- | arch/x86/lib/Makefile (renamed from arch/i386/lib/Makefile) | 0 | ||||
| -rw-r--r-- | arch/x86/lib/bios.S (renamed from arch/i386/lib/bios.S) | 3 | ||||
| -rw-r--r-- | arch/x86/lib/bios.h (renamed from arch/i386/lib/bios.h) | 44 | ||||
| -rw-r--r-- | arch/x86/lib/bios_pci.S (renamed from arch/i386/lib/bios_pci.S) | 0 | ||||
| -rw-r--r-- | arch/x86/lib/bios_setup.c (renamed from arch/i386/lib/bios_setup.c) | 3 | ||||
| -rw-r--r-- | arch/x86/lib/board.c (renamed from arch/i386/lib/board.c) | 23 | ||||
| -rw-r--r-- | arch/x86/lib/bootm.c (renamed from arch/i386/lib/bootm.c) | 15 | ||||
| -rw-r--r-- | arch/x86/lib/interrupts.c (renamed from arch/i386/lib/interrupts.c) | 16 | ||||
| -rw-r--r-- | arch/x86/lib/pcat_interrupts.c (renamed from arch/i386/lib/pcat_interrupts.c) | 4 | ||||
| -rw-r--r-- | arch/x86/lib/pcat_timer.c (renamed from arch/i386/lib/pcat_timer.c) | 2 | ||||
| -rw-r--r-- | arch/x86/lib/pci.c (renamed from arch/i386/lib/pci.c) | 18 | ||||
| -rw-r--r-- | arch/x86/lib/pci_type1.c (renamed from arch/i386/lib/pci_type1.c) | 27 | ||||
| -rw-r--r-- | arch/x86/lib/realmode.c (renamed from arch/i386/lib/realmode.c) | 10 | ||||
| -rw-r--r-- | arch/x86/lib/realmode_switch.S (renamed from arch/i386/lib/realmode_switch.S) | 1 | ||||
| -rw-r--r-- | arch/x86/lib/timer.c (renamed from arch/i386/lib/timer.c) | 5 | ||||
| -rw-r--r-- | arch/x86/lib/video.c (renamed from arch/i386/lib/video.c) | 48 | ||||
| -rw-r--r-- | arch/x86/lib/video_bios.c (renamed from arch/i386/lib/video_bios.c) | 2 | ||||
| -rw-r--r-- | arch/x86/lib/zimage.c (renamed from arch/i386/lib/zimage.c) | 4 | ||||
| -rw-r--r-- | board/eNET/config.mk | 24 | ||||
| -rw-r--r-- | board/eNET/eNET.c | 2 | ||||
| -rw-r--r-- | board/eNET/eNET_pci.c | 7 | ||||
| -rw-r--r-- | boards.cfg | 4 | ||||
| -rw-r--r-- | common/cmd_bdinfo.c | 2 | ||||
| -rw-r--r-- | common/cmd_nvedit.c | 4 | ||||
| -rw-r--r-- | common/cmd_usb.c | 2 | ||||
| -rw-r--r-- | common/exports.c | 2 | ||||
| -rw-r--r-- | common/usb_storage.c | 2 | ||||
| -rw-r--r-- | disk/part.c | 2 | ||||
| -rw-r--r-- | doc/README-i386 | 74 | ||||
| -rw-r--r-- | doc/TODO-i386 | 29 | ||||
| -rw-r--r-- | drivers/mtd/cfi_flash.c | 14 | ||||
| -rw-r--r-- | drivers/net/at91_emac.c | 2 | ||||
| -rw-r--r-- | drivers/watchdog/ftwdt010_wdt.c | 12 | ||||
| -rw-r--r-- | examples/standalone/Makefile | 2 | ||||
| -rw-r--r-- | examples/standalone/stubs.c | 4 | ||||
| -rw-r--r-- | fs/jffs2/jffs2_1pass.c | 2 | ||||
| -rw-r--r-- | fs/jffs2/jffs2_nand_1pass.c | 2 | ||||
| -rw-r--r-- | include/common.h | 12 | ||||
| -rw-r--r-- | include/configs/eNET.h | 24 | ||||
| -rw-r--r-- | include/configs/omap2420h4.h | 2 | ||||
| -rw-r--r-- | include/exports.h | 2 | ||||
| -rw-r--r-- | include/faraday/ftwdt010_wdt.h (renamed from drivers/watchdog/ftwdt010_wdt.h) | 3 | ||||
| -rw-r--r-- | lib/gunzip.c | 16 | ||||
| -rw-r--r-- | tools/env/fw_env.c | 72 | ||||
| -rw-r--r-- | tools/env/fw_env.config | 10 | ||||
| -rw-r--r-- | tools/env/fw_env.h | 2 | ||||
| -rw-r--r-- | tools/imximage.h | 2 | ||||
| -rw-r--r-- | tools/mkimage.c | 6 | 
111 files changed, 399 insertions, 434 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 8af9b090c..7a015a5e8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -905,9 +905,9 @@ Unknown / orphaned boards:  #	Board		CPU						#  ######################################################################### -Daniel Engström <daniel@omicron.se> +Graeme Russ <graeme.russ@gmail.com> -	sc520_cdp	x86 +	eNET		AMD SC520  #########################################################################  # MIPS Systems:								# @@ -544,10 +544,10 @@ LIST_mips_el="			\  "  ######################################################################### -## i386 Systems +## x86 Systems  ######################################################################### -LIST_x86="$(boards_by_arch i386)" +LIST_x86="$(boards_by_arch x86)"  #########################################################################  ## Nios-II Systems @@ -34,7 +34,7 @@ TIMESTAMP_FILE = $(obj)include/timestamp_autogenerated.h  VERSION_FILE = $(obj)include/version_autogenerated.h  HOSTARCH := $(shell uname -m | \ -	sed -e s/i.86/i386/ \ +	sed -e s/i.86/x86/ \  	    -e s/sun4u/sparc64/ \  	    -e s/arm.*/arm/ \  	    -e s/sa110/arm/ \ @@ -167,7 +167,7 @@ include $(TOPDIR)/config.mk  # U-Boot objects....order is important (i.e. start must be first)  OBJS  = $(CPUDIR)/start.o -ifeq ($(CPU),i386) +ifeq ($(CPU),x86)  OBJS += $(CPUDIR)/start16.o  OBJS += $(CPUDIR)/resetvec.o  endif @@ -413,8 +413,12 @@ $(obj)u-boot-onenand.bin:	onenand_ipl $(obj)u-boot.bin  		cat $(ONENAND_BIN) $(obj)u-boot.bin > $(obj)u-boot-onenand.bin  $(VERSION_FILE): -		@( printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' "$(U_BOOT_VERSION)" \ -		 '$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ) > $@.tmp +		@( localvers='$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ; \ +		   printf '#define PLAIN_VERSION "%s%s"\n' \ +			"$(U_BOOT_VERSION)" "$${localvers}" ; \ +		   printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' \ +			"$(U_BOOT_VERSION)" "$${localvers}" ; \ +		) > $@.tmp  		@( printf '#define CC_VERSION_STRING "%s"\n' \  		 '$(shell $(CC) --version | head -n 1)' )>>  $@.tmp  		@( printf '#define LD_VERSION_STRING "%s"\n' \ @@ -164,7 +164,7 @@ Directory Hierarchy:    /blackfin		Files generic to Analog Devices Blackfin architecture      /cpu		CPU specific files      /lib		Architecture specific library files -  /i386			Files generic to i386 architecture +  /x86			Files generic to x86 architecture      /cpu		CPU specific files      /lib		Architecture specific library files    /m68k			Files generic to m68k architecture @@ -1997,6 +1997,14 @@ The following options need to be configured:  		example, some LED's) on your board. At the moment,  		the following checkpoints are implemented: +- Standalone program support: +		CONFIG_STANDALONE_LOAD_ADDR + +		This option allows to define board specific values +		for the address where standalone program gets loaded, +		thus overwriting the architecutre dependent default +		settings. +  Legacy uImage format:    Arg	Where			When diff --git a/arch/arm/config.mk b/arch/arm/config.mk index a6a474245..fcc26a2f3 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -23,13 +23,11 @@  CROSS_COMPILE ?= arm-linux- -ifeq ($(BOARD),omap2420h4) -STANDALONE_LOAD_ADDR = 0x80300000 -else +ifndef CONFIG_STANDALONE_LOAD_ADDR  ifeq ($(SOC),omap3) -STANDALONE_LOAD_ADDR = 0x80300000 +CONFIG_STANDALONE_LOAD_ADDR = 0x80300000  else -STANDALONE_LOAD_ADDR = 0xc100000 +CONFIG_STANDALONE_LOAD_ADDR = 0xc100000  endif  endif diff --git a/arch/arm/cpu/arm920t/at91rm9200/ether.c b/arch/arm/cpu/arm920t/at91rm9200/ether.c index e1cdebab9..d7135c57d 100644 --- a/arch/arm/cpu/arm920t/at91rm9200/ether.c +++ b/arch/arm/cpu/arm920t/at91rm9200/ether.c @@ -39,7 +39,7 @@ typedef struct {  #define RBF_MULTICAST (1<<30)  #define RBF_UNICAST   (1<<29)  #define RBF_EXTERNAL  (1<<28) -#define RBF_UNKOWN    (1<<27) +#define RBF_UNKNOWN   (1<<27)  #define RBF_SIZE      0x07ff  #define RBF_LOCAL4    (1<<26)  #define RBF_LOCAL3    (1<<25) diff --git a/arch/avr32/config.mk b/arch/avr32/config.mk index 1121ca1cc..9488c4913 100644 --- a/arch/avr32/config.mk +++ b/arch/avr32/config.mk @@ -23,7 +23,7 @@  CROSS_COMPILE ?= avr32-linux- -STANDALONE_LOAD_ADDR = 0x00000000 +CONFIG_STANDALONE_LOAD_ADDR ?= 0x00000000  PLATFORM_RELFLAGS	+= -ffixed-r5 -fPIC -mno-init-got -mrelax  PLATFORM_LDFLAGS	+= --relax diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk index 95cf7db2b..f0909e95d 100644 --- a/arch/blackfin/config.mk +++ b/arch/blackfin/config.mk @@ -23,7 +23,7 @@  CROSS_COMPILE ?= bfin-uclinux- -STANDALONE_LOAD_ADDR = 0x1000 -m elf32bfin +CONFIG_STANDALONE_LOAD_ADDR ?= 0x1000 -m elf32bfin  ifeq ($(CONFIG_BFIN_CPU),)  CONFIG_BFIN_CPU := \ diff --git a/arch/m68k/config.mk b/arch/m68k/config.mk index 749c38968..863f3ddbc 100644 --- a/arch/m68k/config.mk +++ b/arch/m68k/config.mk @@ -24,7 +24,7 @@  CROSS_COMPILE ?= m68k-elf-  clibdir = $(shell dirname `$(CC) $(CFLAGS) -print-file-name=libc.a`) -STANDALONE_LOAD_ADDR = 0x20000 -L $(clibdir) +CONFIG_STANDALONE_LOAD_ADDR ?= 0x20000 -L $(clibdir)  PLATFORM_CPPFLAGS += -DCONFIG_M68K -D__M68K__  PLATFORM_LDFLAGS  += -n diff --git a/arch/microblaze/config.mk b/arch/microblaze/config.mk index c3c9f958c..abea70bb0 100644 --- a/arch/microblaze/config.mk +++ b/arch/microblaze/config.mk @@ -26,6 +26,6 @@  CROSS_COMPILE ?= mb- -STANDALONE_LOAD_ADDR = 0x80F00000 +CONFIG_STANDALONE_LOAD_ADDR ?= 0x80F00000  PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__ diff --git a/arch/mips/config.mk b/arch/mips/config.mk index aa06761ae..318d34b1e 100644 --- a/arch/mips/config.mk +++ b/arch/mips/config.mk @@ -23,7 +23,7 @@  CROSS_COMPILE ?= mips_4KC- -STANDALONE_LOAD_ADDR = 0x80200000 -T mips.lds +CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 -T mips.lds  PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__ diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk index 8d72fbd7e..3afc439e5 100644 --- a/arch/powerpc/config.mk +++ b/arch/powerpc/config.mk @@ -23,7 +23,7 @@  CROSS_COMPILE ?= ppc_8xx- -STANDALONE_LOAD_ADDR = 0x40000 +CONFIG_STANDALONE_LOAD_ADDR ?= 0x40000  LDFLAGS_FINAL += --gc-sections  PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections  PLATFORM_RELFLAGS += $(call cc-option,-msingle-pic-base,) diff --git a/arch/sh/config.mk b/arch/sh/config.mk index cd851f59c..af5730757 100644 --- a/arch/sh/config.mk +++ b/arch/sh/config.mk @@ -23,9 +23,9 @@  CROSS_COMPILE ?= sh4-linux- -STANDALONE_LOAD_ADDR = 0x8C000000 +CONFIG_STANDALONE_LOAD_ADDR ?= 0x8C000000  ifeq ($(CPU),sh2) -STANDALONE_LOAD_ADDR += -EB +CONFIG_STANDALONE_LOAD_ADDR += -EB  endif  PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__ diff --git a/arch/sparc/config.mk b/arch/sparc/config.mk index 4de6515ef..cae7478e2 100644 --- a/arch/sparc/config.mk +++ b/arch/sparc/config.mk @@ -23,6 +23,6 @@  CROSS_COMPILE ?= sparc-elf- -STANDALONE_LOAD_ADDR = 0x00000000 -L $(gcclibdir) -T sparc.lds +CONFIG_STANDALONE_LOAD_ADDR ?= 0x00000000 -L $(gcclibdir) -T sparc.lds  PLATFORM_CPPFLAGS += -DCONFIG_SPARC -D__sparc__ diff --git a/arch/sparc/cpu/leon2/cpu_init.c b/arch/sparc/cpu/leon2/cpu_init.c index a24f778c6..795c7d7a7 100644 --- a/arch/sparc/cpu/leon2/cpu_init.c +++ b/arch/sparc/cpu/leon2/cpu_init.c @@ -47,9 +47,9 @@ struct {   * initialize a bunch of registers.   *   * Run from FLASH/PROM: - *  - until memory controller is set up, only registers avaiable + *  - until memory controller is set up, only registers available   *  - no global variables available for writing - *  - constants avaiable + *  - constants available   */  void cpu_init_f(void) diff --git a/arch/sparc/cpu/leon3/cpu_init.c b/arch/sparc/cpu/leon3/cpu_init.c index be22ec26a..cba9d0eb4 100644 --- a/arch/sparc/cpu/leon3/cpu_init.c +++ b/arch/sparc/cpu/leon3/cpu_init.c @@ -57,9 +57,9 @@ struct {   * initialize a bunch of registers.   *   * Run from FLASH/PROM: - *  - until memory controller is set up, only registers avaiable + *  - until memory controller is set up, only registers available   *  - no global variables available for writing - *  - constants avaiable + *  - constants available   */  void cpu_init_f(void) diff --git a/arch/i386/config.mk b/arch/x86/config.mk index 47e0fb4c7..e9452012a 100644 --- a/arch/i386/config.mk +++ b/arch/x86/config.mk @@ -21,7 +21,7 @@  # MA 02111-1307 USA  # -STANDALONE_LOAD_ADDR = 0x40000 +CONFIG_STANDALONE_LOAD_ADDR ?= 0x40000  PLATFORM_CPPFLAGS += -fno-strict-aliasing  PLATFORM_CPPFLAGS += -Wstrict-prototypes diff --git a/arch/i386/cpu/Makefile b/arch/x86/cpu/Makefile index ddde83c91..ddde83c91 100644 --- a/arch/i386/cpu/Makefile +++ b/arch/x86/cpu/Makefile diff --git a/arch/i386/cpu/config.mk b/arch/x86/cpu/config.mk index 9b2e2c9fe..d1b528a43 100644 --- a/arch/i386/cpu/config.mk +++ b/arch/x86/cpu/config.mk @@ -23,7 +23,7 @@  CROSS_COMPILE ?= i386-linux- -PLATFORM_CPPFLAGS += -DCONFIG_I386 -D__I386__ -march=i386 -Werror +PLATFORM_CPPFLAGS += -DCONFIG_X86 -D__I386__ -march=i386 -Werror  # DO NOT MODIFY THE FOLLOWING UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!  LDPPFLAGS += -DRESET_SEG_START=0xffff0000 diff --git a/arch/i386/cpu/cpu.c b/arch/x86/cpu/cpu.c index 2339cd41b..0c5d7c3d5 100644 --- a/arch/i386/cpu/cpu.c +++ b/arch/x86/cpu/cpu.c @@ -1,6 +1,9 @@  /* + * (C) Copyright 2008-2011 + * Graeme Russ, <graeme.russ@gmail.com> + *   * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB, daniel@omicron.se. + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * (C) Copyright 2002   * Sysgo Real-Time Solutions, GmbH <www.elinos.com> @@ -29,18 +32,16 @@   * MA 02111-1307 USA   */ -/* - * CPU specific code - */ -  #include <common.h>  #include <command.h>  #include <asm/processor.h>  #include <asm/processor-flags.h>  #include <asm/interrupt.h> -/* Constructor for a conventional segment GDT (or LDT) entry */ -/* This is a macro so it can be used in initializers */ +/* + * Constructor for a conventional segment GDT (or LDT) entry + * This is a macro so it can be used in initialisers + */  #define GDT_ENTRY(flags, base, limit)			\  	((((base)  & 0xff000000ULL) << (56-24)) |	\  	 (((flags) & 0x0000f0ffULL) << 40) |		\ @@ -48,10 +49,6 @@  	 (((base)  & 0x00ffffffULL) << 16) |		\  	 (((limit) & 0x0000ffffULL))) -/* - * Set up the GDT - */ -  struct gdt_ptr {  	u16 len;  	u32 ptr; @@ -59,8 +56,10 @@ struct gdt_ptr {  static void reload_gdt(void)  { -	/* There are machines which are known to not boot with the GDT -	   being 8-byte unaligned.  Intel recommends 16 byte alignment. */ +	/* +	 * There are machines which are known to not boot with the GDT +	 * being 8-byte unaligned.  Intel recommends 16 byte alignment +	 */  	static const u64 boot_gdt[] __attribute__((aligned(16))) = {  		/* CS: code, read/execute, 4 GB, base 0 */  		[GDT_ENTRY_32BIT_CS] = GDT_ENTRY(0xc09b, 0, 0xfffff), @@ -86,7 +85,6 @@ static void reload_gdt(void)  		     : : "m" (gdt) : "ecx");  } -  int x86_cpu_init_f(void)  {  	const u32 em_rst = ~X86_CR0_EM; @@ -125,7 +123,9 @@ int cpu_init_r(void) __attribute__((weak, alias("x86_cpu_init_r")));  int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])  {  	printf ("resetting ...\n"); -	udelay(50000);				/* wait 50 ms */ + +	/* wait 50 ms */ +	udelay(50000);  	disable_interrupts();  	reset_cpu(0); @@ -136,7 +136,6 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])  void  flush_cache (unsigned long dummy1, unsigned long dummy2)  {  	asm("wbinvd\n"); -	return;  }  void __attribute__ ((regparm(0))) generate_gpf(void); @@ -150,7 +149,7 @@ asm(".globl generate_gpf\n"  void __reset_cpu(ulong addr)  { -	printf("Resetting using i386 Triple Fault\n"); +	printf("Resetting using x86 Triple Fault\n");  	set_vector(13, generate_gpf);  /* general protection fault handler */  	set_vector(8, generate_gpf);   /* double fault handler */  	generate_gpf();                /* start the show */ diff --git a/arch/i386/cpu/interrupts.c b/arch/x86/cpu/interrupts.c index 1cefe02c8..62bcadc48 100644 --- a/arch/i386/cpu/interrupts.c +++ b/arch/x86/cpu/interrupts.c @@ -1,9 +1,9 @@  /* - * (C) Copyright 2008 - * Graeme Russ, graeme.russ@gmail.com. + * (C) Copyright 2008-2011 + * Graeme Russ, <graeme.russ@gmail.com>   *   * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB, daniel@omicron.se. + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * Portions of this file are derived from the Linux kernel source   *  Copyright (C) 1991, 1992  Linus Torvalds @@ -45,7 +45,7 @@   * read/write functions for the control registers and messing everything up.   * A memory clobber would solve the problem, but would prevent reordering of   * all loads stores around it, which can hurt performance. Solution is to - * use a variable and mimic reads and writes to it to enforce serialization + * use a variable and mimic reads and writes to it to enforce serialisation   */  static unsigned long __force_order; diff --git a/arch/i386/cpu/resetvec.S b/arch/x86/cpu/resetvec.S index d9222dd2f..c690d2516 100644 --- a/arch/i386/cpu/resetvec.S +++ b/arch/x86/cpu/resetvec.S @@ -1,7 +1,8 @@  /* - *  U-boot - i386 Startup Code + *  U-boot - x86 Startup Code   * - *  Copyright (c) 2002	Omicron Ceti AB, Daniel Engström <denaiel@omicron.se> + * (C) Copyright 2002 + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * See file CREDITS for list of people who contributed to this   * project. diff --git a/arch/i386/cpu/sc520/Makefile b/arch/x86/cpu/sc520/Makefile index 54260b610..694b61ee4 100644 --- a/arch/i386/cpu/sc520/Makefile +++ b/arch/x86/cpu/sc520/Makefile @@ -33,6 +33,7 @@ LIB	:= $(obj)lib$(SOC).o  COBJS-$(CONFIG_SYS_SC520) += sc520.o  COBJS-$(CONFIG_PCI) += sc520_pci.o +COBJS-$(CONFIG_SYS_SC520_RESET) += sc520_reset.o  COBJS-$(CONFIG_SYS_SC520) += sc520_sdram.o  COBJS-$(CONFIG_SYS_SC520_SSI) += sc520_ssi.o  COBJS-$(CONFIG_SYS_SC520_TIMER) += sc520_timer.o diff --git a/arch/i386/cpu/sc520/sc520.c b/arch/x86/cpu/sc520/sc520.c index d0c313b91..8c410a233 100644 --- a/arch/i386/cpu/sc520/sc520.c +++ b/arch/x86/cpu/sc520/sc520.c @@ -1,6 +1,9 @@  /* + * (C) Copyright 2008-2011 + * Graeme Russ, <graeme.russ@gmail.com> + *   * (C) Copyright 2002 - * Daniel Engstr�m, Omicron Ceti AB <daniel@omicron.se>. + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * See file CREDITS for list of people who contributed to this   * project. @@ -21,9 +24,6 @@   * MA 02111-1307 USA   */ -/* stuff specific for the sc520, - * but idependent of implementation */ -  #include <common.h>  #include <asm/io.h>  #include <asm/processor-flags.h> @@ -65,13 +65,3 @@ int cpu_init_r(void)  	return x86_cpu_init_r();  } -#ifdef CONFIG_SYS_SC520_RESET -void reset_cpu(ulong addr) -{ -	printf("Resetting using SC520 MMCR\n"); -	/* Write a '1' to the SYS_RST of the RESCFG MMCR */ -	writeb(0x01, &sc520_mmcr->rescfg); - -	/* NOTREACHED */ -} -#endif diff --git a/arch/i386/cpu/sc520/sc520_car.S b/arch/x86/cpu/sc520/sc520_car.S index 22f522531..a33f94f49 100644 --- a/arch/i386/cpu/sc520/sc520_car.S +++ b/arch/x86/cpu/sc520/sc520_car.S @@ -1,6 +1,6 @@  /* - * (C) Copyright 2010 - * Graeme Russ <graeme.russ@gmail.com>. + * (C) Copyright 2010-2011 + * Graeme Russ, <graeme.russ@gmail.com>   *   * See file CREDITS for list of people who contributed to this   * project. @@ -21,7 +21,6 @@   * MA 02111-1307 USA   */ -  #include <config.h>  #include <asm/processor-flags.h>  #include <asm/ic/sc520.h> diff --git a/arch/i386/cpu/sc520/sc520_pci.c b/arch/x86/cpu/sc520/sc520_pci.c index b91773435..8cd7ffecd 100644 --- a/arch/i386/cpu/sc520/sc520_pci.c +++ b/arch/x86/cpu/sc520/sc520_pci.c @@ -1,6 +1,9 @@  /* + * (C) Copyright 2008-2011 + * Graeme Russ, <graeme.russ@gmail.com> + *   * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB <daniel@omicron.se>. + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * See file CREDITS for list of people who contributed to this   * project. @@ -21,8 +24,6 @@   * MA 02111-1307 USA   */ -/* stuff specific for the sc520, but independent of implementation */ -  #include <common.h>  #include <pci.h>  #include <asm/io.h> @@ -54,7 +55,6 @@ static struct {  	{ SC520_IRQ15, 1, 0x80 }  }; -  /* The interrupt used for PCI INTA-INTD  */  int sc520_pci_ints[15] = {  	-1, -1, -1, -1, -1, -1, -1, -1, @@ -68,9 +68,8 @@ int pci_sc520_set_irq(int pci_pin, int irq)  	u8 tmpb;  	u16 tmpw; -# if 1 -	printf("set_irq(): map INT%c to IRQ%d\n", pci_pin + 'A', irq); -#endif +	debug("set_irq(): map INT%c to IRQ%d\n", pci_pin + 'A', irq); +  	if (irq < 0 || irq > 15) {  		return -1; /* illegal irq */  	} @@ -138,5 +137,4 @@ void pci_sc520_init(struct pci_controller *hose)  	/* enable target memory acceses on host brige */  	pci_write_config_word(0, PCI_COMMAND,  			      PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER); -  } diff --git a/arch/x86/cpu/sc520/sc520_reset.c b/arch/x86/cpu/sc520/sc520_reset.c new file mode 100644 index 000000000..79ef97683 --- /dev/null +++ b/arch/x86/cpu/sc520/sc520_reset.c @@ -0,0 +1,40 @@ +/* + * (C) Copyright 2011 + * Graeme Russ, <graeme.russ@gmail.com> + * + * (C) Copyright 2002 + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se> + * + * 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 + */ + +#include <common.h> +#include <asm/io.h> +#include <asm/ic/sc520.h> + +DECLARE_GLOBAL_DATA_PTR; + +void reset_cpu(ulong addr) +{ +	printf("Resetting using SC520 MMCR\n"); +	/* Write a '1' to the SYS_RST of the RESCFG MMCR */ +	writeb(0x01, &sc520_mmcr->rescfg); + +	/* NOTREACHED */ +} diff --git a/arch/i386/cpu/sc520/sc520_sdram.c b/arch/x86/cpu/sc520/sc520_sdram.c index d5ab55df0..f3623f53f 100644 --- a/arch/i386/cpu/sc520/sc520_sdram.c +++ b/arch/x86/cpu/sc520/sc520_sdram.c @@ -1,6 +1,6 @@  /* - * (C) Copyright 2010 - * Graeme Russ <graeme.russ@gmail.com>. + * (C) Copyright 2010,2011 + * Graeme Russ, <graeme.russ@gmail.com>   *   * See file CREDITS for list of people who contributed to this   * project. diff --git a/arch/i386/cpu/sc520/sc520_ssi.c b/arch/x86/cpu/sc520/sc520_ssi.c index 6e5e34630..ac58d2597 100644 --- a/arch/i386/cpu/sc520/sc520_ssi.c +++ b/arch/x86/cpu/sc520/sc520_ssi.c @@ -1,6 +1,6 @@  /*   * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB <daniel@omicron.se>. + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * See file CREDITS for list of people who contributed to this   * project. @@ -21,8 +21,6 @@   * MA 02111-1307 USA   */ -/* stuff specific for the sc520, but independent of implementation */ -  #include <common.h>  #include <asm/io.h>  #include <asm/ic/ssi.h> @@ -77,7 +75,6 @@ u8 ssi_txrx_byte(u8 data)  	return readb(&sc520_mmcr->ssircv);  } -  void ssi_tx_byte(u8 data)  {  	writeb(data, &sc520_mmcr->ssixmit); diff --git a/arch/i386/cpu/sc520/sc520_timer.c b/arch/x86/cpu/sc520/sc520_timer.c index d5617e91f..1bcfe67c9 100644 --- a/arch/i386/cpu/sc520/sc520_timer.c +++ b/arch/x86/cpu/sc520/sc520_timer.c @@ -1,6 +1,9 @@  /* + * (C) Copyright 2008-2011 + * Graeme Russ, <graeme.russ@gmail.com> + *   * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB <daniel@omicron.se>. + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * See file CREDITS for list of people who contributed to this   * project. @@ -21,8 +24,6 @@   * MA 02111-1307 USA   */ -/* stuff specific for the sc520, but independent of implementation */ -  #include <common.h>  #include <asm/io.h>  #include <asm/interrupt.h> diff --git a/arch/i386/cpu/start.S b/arch/x86/cpu/start.S index 00313897c..7ccc076fe 100644 --- a/arch/i386/cpu/start.S +++ b/arch/x86/cpu/start.S @@ -1,7 +1,11 @@  /* - *  U-boot - i386 Startup Code + *  U-boot - x86 Startup Code   * - *  Copyright (c) 2002	Omicron Ceti AB, Daniel Engström <denaiel@omicron.se> + * (C) Copyright 2008-2011 + * Graeme Russ, <graeme.russ@gmail.com> + * + * (C) Copyright 2002 + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * See file CREDITS for list of people who contributed to this   * project. @@ -22,19 +26,17 @@   * MA 02111-1307 USA   */ -  #include <config.h>  #include <version.h>  #include <asm/global_data.h>  #include <asm/processor-flags.h> -  .section .text  .code32  .globl _start  .type _start, @function -.globl _i386boot_start -_i386boot_start: +.globl _x86boot_start +_x86boot_start:  	/*  	 * This is the fail safe 32-bit bootstrap entry point. The  	 * following code is not executed from a cold-reset (actually, a @@ -56,8 +58,8 @@ _i386boot_start:  _start:  	/* This is the 32-bit cold-reset entry point */ -	movl	$0x18, %eax	/* Load our segement registes, the -				 * gdt have already been loaded by start16.S */ +	/* Load the segement registes to match the gdt loaded in start16.S */ +	movl	$0x18, %eax  	movw	%ax, %fs  	movw	%ax, %ds  	movw	%ax, %gs @@ -82,21 +84,13 @@ car_init_ret:  	 * starting at CONFIG_SYS_CAR_ADDR to be used as a temporary stack  	 */  	movl	$CONFIG_SYS_INIT_SP_ADDR, %esp -	movl	$CONFIG_SYS_INIT_GD_ADDR, %ebp - -	/* Set Boot Flags in Global Data */ -	movl	%ebx, (GD_FLAGS * 4)(%ebp) - -	/* Determine our load offset (and put in Global Data) */ -	call	1f -1:	popl	%ecx -	subl	$1b, %ecx -	movl	%ecx, (GD_LOAD_OFF * 4)(%ebp)  	/* Set parameter to board_init_f() to boot flags */ -	movl	(GD_FLAGS * 4)(%ebp), %eax +	xorl	%eax, %eax +	movw	%bx, %ax -	call	board_init_f	/* Enter, U-boot! */ +	/* Enter, U-boot! */ +	call	board_init_f  	/* indicate (lack of) progress */  	movw	$0x85, %ax diff --git a/arch/i386/cpu/start16.S b/arch/x86/cpu/start16.S index 7dc535836..f1b9d0a0c 100644 --- a/arch/i386/cpu/start16.S +++ b/arch/x86/cpu/start16.S @@ -1,7 +1,11 @@  /* - *  U-boot - i386 Startup Code + *  U-boot - x86 Startup Code   * - *  Copyright (c) 2002, 2003 Omicron Ceti AB, Daniel Engström <denaiel@omicron.se> + * (C) Copyright 2008-2011 + * Graeme Russ, <graeme.russ@gmail.com> + * + * (C) Copyright 2002,2003 + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * See file CREDITS for list of people who contributed to this   * project. diff --git a/arch/i386/cpu/u-boot.lds b/arch/x86/cpu/u-boot.lds index 98a548d62..55974228b 100644 --- a/arch/i386/cpu/u-boot.lds +++ b/arch/x86/cpu/u-boot.lds @@ -21,6 +21,7 @@   * MA 02111-1307 USA   */ +#include <config.h>  OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")  OUTPUT_ARCH(i386)  ENTRY(_start) @@ -89,8 +90,8 @@ SECTIONS  	 * Reset Vector at the end of the Flash ROM  	 */  	. = START_16; -	.start16 : AT (CONFIG_SYS_TEXT_BASE + (FLASH_SIZE - RESET_SEG_SIZE + START_16)) { KEEP(*(.start16)); } +	.start16 : AT (CONFIG_SYS_TEXT_BASE + (CONFIG_SYS_MONITOR_LEN - RESET_SEG_SIZE + START_16)) { KEEP(*(.start16)); }  	. = RESET_VEC_LOC; -	.resetvec : AT (CONFIG_SYS_TEXT_BASE + (FLASH_SIZE - RESET_SEG_SIZE + RESET_VEC_LOC)) { KEEP(*(.resetvec)); } +	.resetvec : AT (CONFIG_SYS_TEXT_BASE + (CONFIG_SYS_MONITOR_LEN - RESET_SEG_SIZE + RESET_VEC_LOC)) { KEEP(*(.resetvec)); }  } diff --git a/arch/i386/include/asm/bitops.h b/arch/x86/include/asm/bitops.h index c7a38f237..c7a38f237 100644 --- a/arch/i386/include/asm/bitops.h +++ b/arch/x86/include/asm/bitops.h diff --git a/arch/i386/include/asm/bootparam.h b/arch/x86/include/asm/bootparam.h index 140095117..140095117 100644 --- a/arch/i386/include/asm/bootparam.h +++ b/arch/x86/include/asm/bootparam.h diff --git a/arch/i386/include/asm/byteorder.h b/arch/x86/include/asm/byteorder.h index 7dfeb8bbe..7dfeb8bbe 100644 --- a/arch/i386/include/asm/byteorder.h +++ b/arch/x86/include/asm/byteorder.h diff --git a/arch/i386/include/asm/config.h b/arch/x86/include/asm/config.h index 049c44eaf..049c44eaf 100644 --- a/arch/i386/include/asm/config.h +++ b/arch/x86/include/asm/config.h diff --git a/arch/i386/include/asm/e820.h b/arch/x86/include/asm/e820.h index d155ce9ce..d155ce9ce 100644 --- a/arch/i386/include/asm/e820.h +++ b/arch/x86/include/asm/e820.h diff --git a/arch/i386/include/asm/errno.h b/arch/x86/include/asm/errno.h index 4c82b503d..4c82b503d 100644 --- a/arch/i386/include/asm/errno.h +++ b/arch/x86/include/asm/errno.h diff --git a/arch/i386/include/asm/global_data.h b/arch/x86/include/asm/global_data.h index f8a16d646..f8a16d646 100644 --- a/arch/i386/include/asm/global_data.h +++ b/arch/x86/include/asm/global_data.h diff --git a/arch/i386/include/asm/i8254.h b/arch/x86/include/asm/i8254.h index aafdfb806..aafdfb806 100644 --- a/arch/i386/include/asm/i8254.h +++ b/arch/x86/include/asm/i8254.h diff --git a/arch/i386/include/asm/i8259.h b/arch/x86/include/asm/i8259.h index 774d7a31e..774d7a31e 100644 --- a/arch/i386/include/asm/i8259.h +++ b/arch/x86/include/asm/i8259.h diff --git a/arch/i386/include/asm/ibmpc.h b/arch/x86/include/asm/ibmpc.h index e35cbd887..e35cbd887 100644 --- a/arch/i386/include/asm/ibmpc.h +++ b/arch/x86/include/asm/ibmpc.h diff --git a/arch/i386/include/asm/ic/pci.h b/arch/x86/include/asm/ic/pci.h index 2e4376b9b..2e4376b9b 100644 --- a/arch/i386/include/asm/ic/pci.h +++ b/arch/x86/include/asm/ic/pci.h diff --git a/arch/i386/include/asm/ic/sc520.h b/arch/x86/include/asm/ic/sc520.h index 956c1c263..956c1c263 100644 --- a/arch/i386/include/asm/ic/sc520.h +++ b/arch/x86/include/asm/ic/sc520.h diff --git a/arch/i386/include/asm/ic/ssi.h b/arch/x86/include/asm/ic/ssi.h index bd48eab16..bd48eab16 100644 --- a/arch/i386/include/asm/ic/ssi.h +++ b/arch/x86/include/asm/ic/ssi.h diff --git a/arch/i386/include/asm/interrupt.h b/arch/x86/include/asm/interrupt.h index d32ef8b19..be52fe40d 100644 --- a/arch/i386/include/asm/interrupt.h +++ b/arch/x86/include/asm/interrupt.h @@ -29,10 +29,10 @@  #include <asm/types.h> -/* arch/i386/cpu/interrupts.c */ +/* arch/x86/cpu/interrupts.c */  void set_vector(u8 intnum, void *routine); -/* arch/i386/lib/interupts.c */ +/* arch/x86/lib/interupts.c */  void disable_irq(int irq);  void enable_irq(int irq); diff --git a/arch/i386/include/asm/io.h b/arch/x86/include/asm/io.h index 9b757d489..9b757d489 100644 --- a/arch/i386/include/asm/io.h +++ b/arch/x86/include/asm/io.h diff --git a/arch/i386/include/asm/ioctl.h b/arch/x86/include/asm/ioctl.h index b279fe06d..b279fe06d 100644 --- a/arch/i386/include/asm/ioctl.h +++ b/arch/x86/include/asm/ioctl.h diff --git a/arch/i386/include/asm/ist.h b/arch/x86/include/asm/ist.h index 7e5dff1de..7e5dff1de 100644 --- a/arch/i386/include/asm/ist.h +++ b/arch/x86/include/asm/ist.h diff --git a/arch/i386/include/asm/pci.h b/arch/x86/include/asm/pci.h index 050a2bb86..050a2bb86 100644 --- a/arch/i386/include/asm/pci.h +++ b/arch/x86/include/asm/pci.h diff --git a/arch/i386/include/asm/posix_types.h b/arch/x86/include/asm/posix_types.h index 5529f3270..5529f3270 100644 --- a/arch/i386/include/asm/posix_types.h +++ b/arch/x86/include/asm/posix_types.h diff --git a/arch/i386/include/asm/processor-flags.h b/arch/x86/include/asm/processor-flags.h index 7a3e836eb..7a3e836eb 100644 --- a/arch/i386/include/asm/processor-flags.h +++ b/arch/x86/include/asm/processor-flags.h diff --git a/arch/i386/include/asm/processor.h b/arch/x86/include/asm/processor.h index 22a129813..22a129813 100644 --- a/arch/i386/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h diff --git a/arch/i386/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h index a727dbfb0..a727dbfb0 100644 --- a/arch/i386/include/asm/ptrace.h +++ b/arch/x86/include/asm/ptrace.h diff --git a/arch/i386/include/asm/realmode.h b/arch/x86/include/asm/realmode.h index 9177e4ec0..9177e4ec0 100644 --- a/arch/i386/include/asm/realmode.h +++ b/arch/x86/include/asm/realmode.h diff --git a/arch/i386/include/asm/string.h b/arch/x86/include/asm/string.h index 3643a79fd..3643a79fd 100644 --- a/arch/i386/include/asm/string.h +++ b/arch/x86/include/asm/string.h diff --git a/arch/i386/include/asm/types.h b/arch/x86/include/asm/types.h index 9a40e383e..9a40e383e 100644 --- a/arch/i386/include/asm/types.h +++ b/arch/x86/include/asm/types.h diff --git a/arch/i386/include/asm/u-boot-i386.h b/arch/x86/include/asm/u-boot-x86.h index 7b39bd2ae..944e1a200 100644 --- a/arch/i386/include/asm/u-boot-i386.h +++ b/arch/x86/include/asm/u-boot-x86.h @@ -35,7 +35,7 @@ void timer_isr(void *);  typedef void (timer_fnc_t) (void);  int register_timer_isr (timer_fnc_t *isr_func); -/* Architecture specific - can be in arch/i386/cpu/, arch/i386/lib/, or $(BOARD)/ */ +/* Architecture specific - can be in arch/x86/cpu/, arch/x86/lib/, or $(BOARD)/ */  int timer_init(void);  int dram_init_f(void); @@ -51,7 +51,7 @@ void setup_pcat_compatibility(void);  void isa_unmap_rom(u32 addr);  u32 isa_map_rom(u32 bus_addr, int size); -/* arch/i386/lib/... */ +/* arch/x86/lib/... */  int video_bios_init(void);  int video_init(void); diff --git a/arch/i386/include/asm/u-boot.h b/arch/x86/include/asm/u-boot.h index a43b3aade..a43b3aade 100644 --- a/arch/i386/include/asm/u-boot.h +++ b/arch/x86/include/asm/u-boot.h diff --git a/arch/i386/include/asm/unaligned.h b/arch/x86/include/asm/unaligned.h index 6cecbbb21..6cecbbb21 100644 --- a/arch/i386/include/asm/unaligned.h +++ b/arch/x86/include/asm/unaligned.h diff --git a/arch/i386/include/asm/video/edid.h b/arch/x86/include/asm/video/edid.h index 928c342b3..928c342b3 100644 --- a/arch/i386/include/asm/video/edid.h +++ b/arch/x86/include/asm/video/edid.h diff --git a/arch/i386/include/asm/zimage.h b/arch/x86/include/asm/zimage.h index b6266e456..b6266e456 100644 --- a/arch/i386/include/asm/zimage.h +++ b/arch/x86/include/asm/zimage.h diff --git a/arch/i386/lib/Makefile b/arch/x86/lib/Makefile index 71e94f76f..71e94f76f 100644 --- a/arch/i386/lib/Makefile +++ b/arch/x86/lib/Makefile diff --git a/arch/i386/lib/bios.S b/arch/x86/lib/bios.S index 48f1b8112..660a24439 100644 --- a/arch/i386/lib/bios.S +++ b/arch/x86/lib/bios.S @@ -1,6 +1,6 @@  /*   * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB, daniel@omicron.se + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * See file CREDITS for list of people who contributed to this   * project. @@ -42,7 +42,6 @@   * a general purpose replacement for a real BIOS !!   */ -  .section .bios, "ax"  .code16  .org 0 diff --git a/arch/i386/lib/bios.h b/arch/x86/lib/bios.h index 4901f8917..3c8d61a6f 100644 --- a/arch/i386/lib/bios.h +++ b/arch/x86/lib/bios.h @@ -1,6 +1,6 @@  /*   * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB, daniel@omicron.se + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * See file CREDITS for list of people who contributed to this   * project. @@ -57,7 +57,7 @@  #define OFFS_FLAGS   44    /* 16bit */  #define SEGMENT      0x40 -#define STACK	     0x800			/* stack at 0x40:0x800 -> 0x800 */ +#define STACK	     0x800	/* stack at 0x40:0x800 -> 0x800 */  /* save general registers */  /* save some segments     */ @@ -67,28 +67,26 @@  	/* setup BIOS stackpointer */  #define MAKE_BIOS_STACK \ -	pushal		; \ -	pushw	%ds	; \ -	pushw	%gs	; \ -	pushw	%es	; \ -	pushw	%ss	; \ -	popw	%gs	; \ -	movw	$SEGMENT,%ax ; \ -	movw	%ax,%ds	; \ -	movw	%ax,%es	; \ -	movw	%ax,%ss	; \ -	movw	%sp,%bp	; \ -	movw	$STACK,%sp +	pushal; \ +	pushw	%ds; \ +	pushw	%gs; \ +	pushw	%es; \ +	pushw	%ss; \ +	popw	%gs; \ +	movw	$SEGMENT, %ax; \ +	movw	%ax, %ds; \ +	movw	%ax, %es; \ +	movw	%ax, %ss; \ +	movw	%sp, %bp; \ +	movw	$STACK, %sp  #define RESTORE_CALLERS_STACK \ -	pushw	%gs     ;			/* restore callers stack segment */ \ -	popw	%ss     ; \ -	movw	%bp,%sp	;			/* restore stackpointer */ \ -		\ -	popw	%es	;			/* restore segment selectors */ \ -	popw	%gs     ; \ -	popw	%ds     ; \ -		\ -	popal					/* restore GP registers */ +	pushw	%gs;		/* restore callers stack segment */ \ +	popw	%ss; \ +	movw	%bp, %sp;	/* restore stackpointer */ \ +	popw	%es;		/* restore segment selectors */ \ +	popw	%gs; \ +	popw	%ds; \ +	popal			/* restore GP registers */  #endif diff --git a/arch/i386/lib/bios_pci.S b/arch/x86/lib/bios_pci.S index 9e412e5e4..9e412e5e4 100644 --- a/arch/i386/lib/bios_pci.S +++ b/arch/x86/lib/bios_pci.S diff --git a/arch/i386/lib/bios_setup.c b/arch/x86/lib/bios_setup.c index 75407c173..6949b3506 100644 --- a/arch/i386/lib/bios_setup.c +++ b/arch/x86/lib/bios_setup.c @@ -1,6 +1,6 @@  /*   * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB, daniel@omicron.se + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * See file CREDITS for list of people who contributed to this   * project. @@ -21,7 +21,6 @@   * MA 02111-1307 USA   */ -  /*   * Partly based on msbios.c from rolo 1.6:   *---------------------------------------------------------------------- diff --git a/arch/i386/lib/board.c b/arch/x86/lib/board.c index e0f9803e5..df5422221 100644 --- a/arch/i386/lib/board.c +++ b/arch/x86/lib/board.c @@ -1,9 +1,12 @@  /* + * (C) Copyright 2008-2011 + * Graeme Russ, <graeme.russ@gmail.com> + *   * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB, daniel@omicron.se + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * (C) Copyright 2002 - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>   *   * (C) Copyright 2002   * Sysgo Real-Time Solutions, GmbH <www.elinos.com> @@ -38,7 +41,7 @@  #include <net.h>  #include <ide.h>  #include <serial.h> -#include <asm/u-boot-i386.h> +#include <asm/u-boot-x86.h>  #include <elf.h>  #ifdef CONFIG_BITBANGMII @@ -103,13 +106,6 @@ static int display_banner (void)  	return (0);  } -/* - * WARNING: this code looks "cleaner" than the PowerPC version, but - * has the disadvantage that you either get nothing, or everything. - * On PowerPC, you might see "DRAM: " before the system hangs - which - * gives a simple yet clear indication which part of the - * initialization if failing. - */  static int display_dram_config (void)  {  	int i; @@ -141,7 +137,6 @@ static void display_flash_config (ulong size)   * can relocate the monitor code to RAM.   */ -  /*   * All attempts to come up with a "common" initialization sequence   * that works for all boards and architectures failed: some of the @@ -251,13 +246,13 @@ static int do_elf_reloc_fixups(void)  	return 0;  } -/* - * Load U-Boot into RAM, initialize BSS, perform relocation adjustments - */ +/* Load U-Boot into RAM, initialize BSS, perform relocation adjustments */  void board_init_f(ulong boot_flags)  {  	init_fnc_t **init_fnc_ptr; +	gd->flags = boot_flags; +  	for (init_fnc_ptr = init_sequence_f; *init_fnc_ptr; ++init_fnc_ptr) {  		if ((*init_fnc_ptr)() != 0)  			hang(); diff --git a/arch/i386/lib/bootm.c b/arch/x86/lib/bootm.c index b36e58d9e..a21a21f1f 100644 --- a/arch/i386/lib/bootm.c +++ b/arch/x86/lib/bootm.c @@ -5,10 +5,13 @@   *   * Copyright (C) 2001  Erik Mouw (J.A.K.Mouw@its.tudelft.nl)   * - * 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. + * 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 @@ -17,8 +20,8 @@   *   * 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 - * + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA   */  #include <common.h> diff --git a/arch/i386/lib/interrupts.c b/arch/x86/lib/interrupts.c index 5a2827828..a2c598f9a 100644 --- a/arch/i386/lib/interrupts.c +++ b/arch/x86/lib/interrupts.c @@ -1,21 +1,21 @@  /*   * (C) Copyright 2009 - * Graeme Russ, graeme.russ@gmail.com + * Graeme Russ, <graeme.russ@gmail.com>   *   * (C) Copyright 2007 - * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com + * Daniel Hellstrom, Gaisler Research, <daniel@gaisler.com>   *   * (C) Copyright 2006 - * Detlev Zundel, DENX Software Engineering, dzu@denx.de + * Detlev Zundel, DENX Software Engineering, <dzu@denx.de>   *   * (C) Copyright -2003 - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>   *   * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB, daniel@omicron.se + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * (C) Copyright 2001 - * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc. + * Josh Huber, Mission Critical Linux, Inc, <huber@mclx.com>   *   * See file CREDITS for list of people who contributed to this   * project. @@ -38,11 +38,11 @@  /*   * This file contains the high-level API for the interrupt sub-system - * of the i386 port of U-Boot. Most of the functionality has been + * of the x86 port of U-Boot. Most of the functionality has been   * shamelessly stolen from the leon2 / leon3 ports of U-Boot.   * Daniel Hellstrom, Detlev Zundel, Wolfgang Denk and Josh Huber are   * credited for the corresponding work on those ports. The original - * interrupt handling routines for the i386 port were written by + * interrupt handling routines for the x86 port were written by   * Daniel Engström   */ diff --git a/arch/i386/lib/pcat_interrupts.c b/arch/x86/lib/pcat_interrupts.c index 67e6e97e3..364c43583 100644 --- a/arch/i386/lib/pcat_interrupts.c +++ b/arch/x86/lib/pcat_interrupts.c @@ -1,9 +1,9 @@  /*   * (C) Copyright 2009 - * Graeme Russ, graeme.russ@gmail.com + * Graeme Russ, <graeme.russ@gmail.com>   *   * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB, daniel@omicron.se. + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * See file CREDITS for list of people who contributed to this   * project. diff --git a/arch/i386/lib/pcat_timer.c b/arch/x86/lib/pcat_timer.c index 1373fd125..1911c6c19 100644 --- a/arch/i386/lib/pcat_timer.c +++ b/arch/x86/lib/pcat_timer.c @@ -1,6 +1,6 @@  /*   * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB, daniel@omicron.se. + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * See file CREDITS for list of people who contributed to this   * project. diff --git a/arch/i386/lib/pci.c b/arch/x86/lib/pci.c index 9020e7ce7..e791e88bd 100644 --- a/arch/i386/lib/pci.c +++ b/arch/x86/lib/pci.c @@ -1,6 +1,6 @@  /*   * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB, daniel@omicron.se + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * See file CREDITS for list of people who contributed to this   * project. @@ -54,10 +54,9 @@ int pci_shadow_rom(pci_dev_t dev, unsigned char *dest)  	class_code &= 0xffffff00;  	class_code >>= 8; -#if 0 -	printf("PCI Header Vendor %04x device %04x class %06x\n", +	debug("PCI Header Vendor %04x device %04x class %06x\n",  	       vendor, device, class_code); -#endif +  	/* Enable the rom addess decoder */  	pci_write_config_dword(dev, PCI_ROM_ADDRESS, (u32)PCI_ROM_ADDRESS_MASK);  	pci_read_config_dword(dev, PCI_ROM_ADDRESS, &addr_reg); @@ -70,13 +69,12 @@ int pci_shadow_rom(pci_dev_t dev, unsigned char *dest)  	size = (~(addr_reg&PCI_ROM_ADDRESS_MASK))+1; -#if 0 -	printf("ROM is %d bytes\n", size); -#endif +	debug("ROM is %d bytes\n", size); +  	rom_addr = pci_get_rom_window(hose, size); -#if 0 -	printf("ROM mapped at %x \n", rom_addr); -#endif + +	debug("ROM mapped at %x\n", rom_addr); +  	pci_write_config_dword(dev, PCI_ROM_ADDRESS,  			       pci_phys_to_mem(dev, rom_addr)  			       |PCI_ROM_ADDRESS_ENABLE); diff --git a/arch/i386/lib/pci_type1.c b/arch/x86/lib/pci_type1.c index 225ae4a99..8ce5b33e3 100644 --- a/arch/i386/lib/pci_type1.c +++ b/arch/x86/lib/pci_type1.c @@ -1,15 +1,30 @@  /* - * Support for type PCI configuration cycles. - * based on pci_indirect.c + * (C) Copyright 2002 + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   * - * Copyright (C) 2002 Daniel Engström, Omicron Ceti AB, daniel@omicron.se. + * 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. + * 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   */ +/* + * Support for type PCI configuration cycles. + * based on pci_indirect.c + */  #include <common.h>  #include <asm/io.h>  #include <pci.h> diff --git a/arch/i386/lib/realmode.c b/arch/x86/lib/realmode.c index 2dda95b06..5be827c66 100644 --- a/arch/i386/lib/realmode.c +++ b/arch/x86/lib/realmode.c @@ -1,6 +1,6 @@  /*   * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB, daniel@omicron.se + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * See file CREDITS for list of people who contributed to this   * project. @@ -26,10 +26,8 @@  #include <asm/ptrace.h>  #include <asm/realmode.h> -  #define REALMODE_MAILBOX ((char*)0xe00) -  extern ulong __realmode_start;  extern ulong __realmode_size;  extern char realmode_enter; @@ -57,13 +55,11 @@ int enter_realmode(u16 seg, u16 off, struct pt_regs *in, struct pt_regs *out)  {  	/* setup out thin bios emulation */ -	if (bios_setup()) { +	if (bios_setup())  		return -1; -	} -	if (realmode_setup()) { +	if (realmode_setup())  		return -1; -	}  	in->eip = off;  	in->xcs = seg; diff --git a/arch/i386/lib/realmode_switch.S b/arch/x86/lib/realmode_switch.S index d6c74ecd7..fce4eccab 100644 --- a/arch/i386/lib/realmode_switch.S +++ b/arch/x86/lib/realmode_switch.S @@ -21,7 +21,6 @@   * MA 02111-1307 USA   */ -  /* 32bit -> 16bit -> 32bit mode switch code */  /* diff --git a/arch/i386/lib/timer.c b/arch/x86/lib/timer.c index 5cb1f54fb..8fc68cdcb 100644 --- a/arch/i386/lib/timer.c +++ b/arch/x86/lib/timer.c @@ -1,6 +1,9 @@  /* + * (C) Copyright 2008,2009 + * Graeme Russ, <graeme.russ@gmail.com> + *   * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB, daniel@omicron.se. + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * See file CREDITS for list of people who contributed to this   * project. diff --git a/arch/i386/lib/video.c b/arch/x86/lib/video.c index c58ed104c..b29075c49 100644 --- a/arch/i386/lib/video.c +++ b/arch/x86/lib/video.c @@ -1,6 +1,6 @@  /*   * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB, daniel@omicron.se + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * See file CREDITS for list of people who contributed to this   * project. @@ -30,7 +30,6 @@  #include <asm/io.h>  #include <asm/pci.h> -  /* basic textmode I/O from linux kernel */  static char *vidmem = (char *)0xb8000;  static int vidport; @@ -42,9 +41,9 @@ static void beep(int dur)  	int i;  	outb_p(3, 0x61); -	for (i=0;i<10*dur;i++) { +	for (i = 0; i < 10*dur; i++)  		udelay(1000); -	} +  	outb_p(0, 0x61);  } @@ -52,8 +51,8 @@ static void scroll(void)  {  	int i; -	memcpy ( vidmem, vidmem + cols * 2, ( lines - 1 ) * cols * 2 ); -	for ( i = ( lines - 1 ) * cols * 2; i < lines * cols * 2; i += 2 ) +	memcpy(vidmem, vidmem + cols * 2, (lines - 1) * cols * 2); +	for (i = (lines - 1) * cols * 2; i < lines * cols * 2; i += 2)  		vidmem[i] = ' ';  } @@ -61,14 +60,14 @@ static void __video_putc(const char c, int *x, int *y)  {  	if (c == '\n') {  		(*x) = 0; -		if ( ++(*y) >= lines ) { +		if (++(*y) >= lines) {  			scroll();  			(*y)--;  		}  	} else if (c == '\b') {  		if ((*x) != 0) {  			--(*x); -			vidmem [ ( (*x) + cols * (*y) ) * 2 ] = ' '; +			vidmem[((*x) + cols * (*y)) * 2] = ' ';  		}  	} else if (c == '\r') {  		(*x) = 0; @@ -106,16 +105,15 @@ static void __video_putc(const char c, int *x, int *y)  		}  	} else if (c == '\f') {  		int i; -		for (i=0;i<lines*cols*2;i+=2) { +		for (i = 0; i < lines * cols * 2; i += 2)  			vidmem[i] = 0; -		}  		(*x) = 0;  		(*y) = 0;  	} else { -		vidmem [ ( (*x) + cols * (*y) ) * 2 ] = c; -		if ( ++(*x) >= cols ) { +		vidmem[((*x) + cols * (*y)) * 2] = c; +		if (++(*x) >= cols) {  			(*x) = 0; -			if ( ++(*y) >= lines ) { +			if (++(*y) >= lines) {  				scroll();  				(*y)--;  			} @@ -150,9 +148,8 @@ static void video_puts(const char *s)  	x = orig_x;  	y = orig_y; -	while ( ( c = *s++ ) != '\0' ) { +	while ((c = *s++) != '\0')  		__video_putc(c, &x, &y); -	}  	orig_x = x;  	orig_y = y; @@ -189,10 +186,8 @@ int video_init(void)  #if 0  	printf("pos %x %d %d\n", pos, orig_x, orig_y);  #endif -	if (orig_y > lines) { +	if (orig_y > lines)  		orig_x = orig_y =0; -	} -  	memset(&vga_dev, 0, sizeof(vga_dev));  	strcpy(vga_dev.name, "vga"); @@ -203,13 +198,11 @@ int video_init(void)  	vga_dev.tstc  = NULL;              /* 'tstc' function */  	vga_dev.getc  = NULL;              /* 'getc' function */ -	if (stdio_register(&vga_dev) == 0) { -	    return 1; -	} +	if (stdio_register(&vga_dev) == 0) +		return 1; -	if (i8042_kbd_init()) { +	if (i8042_kbd_init())  		return 1; -	}  	memset(&kbd_dev, 0, sizeof(kbd_dev));  	strcpy(kbd_dev.name, "kbd"); @@ -220,18 +213,17 @@ int video_init(void)  	kbd_dev.tstc  = i8042_tstc;  /* 'tstc' function */  	kbd_dev.getc  = i8042_getc;  /* 'getc' function */ -	if (stdio_register(&kbd_dev) == 0) { -	    return 1; -	} +	if (stdio_register(&kbd_dev) == 0) +		return 1; +  	return 0;  }  int drv_video_init(void)  { -	if (video_bios_init()) { +	if (video_bios_init())  		return 1; -	}  	return video_init();  } diff --git a/arch/i386/lib/video_bios.c b/arch/x86/lib/video_bios.c index c8060e60a..6bc433574 100644 --- a/arch/i386/lib/video_bios.c +++ b/arch/x86/lib/video_bios.c @@ -1,6 +1,6 @@  /*   * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB, daniel@omicron.se + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * See file CREDITS for list of people who contributed to this   * project. diff --git a/arch/i386/lib/zimage.c b/arch/x86/lib/zimage.c index 0c4207269..cc4b40e64 100644 --- a/arch/i386/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -1,6 +1,6 @@  /*   * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB, daniel@omicron.se + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * See file CREDITS for list of people who contributed to this   * project. @@ -22,7 +22,7 @@   */  /* - * Linux i386 zImage and bzImage loading + * Linux x86 zImage and bzImage loading   *   * based on the procdure described in   * linux/Documentation/i386/boot.txt diff --git a/board/eNET/config.mk b/board/eNET/config.mk deleted file mode 100644 index 9d2dfa535..000000000 --- a/board/eNET/config.mk +++ /dev/null @@ -1,24 +0,0 @@ -# -# (C) Copyright 2002 -# Daniel Engström, Omicron Ceti AB, daniel@omicron.se. -# -# 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 -# - -LDPPFLAGS += -DFLASH_SIZE=0x40000 diff --git a/board/eNET/eNET.c b/board/eNET/eNET.c index dd0ce5451..2a5636c07 100644 --- a/board/eNET/eNET.c +++ b/board/eNET/eNET.c @@ -35,6 +35,8 @@  DECLARE_GLOBAL_DATA_PTR; +unsigned long monitor_flash_len = CONFIG_SYS_MONITOR_LEN; +  static void enet_timer_isr(void);  static void enet_toggle_run_led(void);  static void enet_setup_pars(void); diff --git a/board/eNET/eNET_pci.c b/board/eNET/eNET_pci.c index fefb1a4fb..a03090e54 100644 --- a/board/eNET/eNET_pci.c +++ b/board/eNET/eNET_pci.c @@ -1,9 +1,9 @@  /* - * (C) Copyright 2008 - * Graeme Russ, graeme.russ@gmail.com. + * (C) Copyright 2008,2009 + * Graeme Russ, <graeme.russ@gmail.com>   *   * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB <daniel@omicron.se>. + * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>   *   * See file CREDITS for list of people who contributed to this   * project. @@ -23,6 +23,7 @@   * Foundation, Inc., 59 Temple Place, Suite 330, Boston,   * MA 02111-1307 USA   */ +  #include <common.h>  #include <pci.h>  #include <asm/pci.h> diff --git a/boards.cfg b/boards.cfg index a45bd83a1..554e06c12 100644 --- a/boards.cfg +++ b/boards.cfg @@ -205,8 +205,8 @@ ibf-dsp561                   blackfin    blackfin  ip04                         blackfin    blackfin  tcm-bf518                    blackfin    blackfin  tcm-bf537                    blackfin    blackfin -eNET                         i386        i386        eNET                -              sc520       eNET:SYS_TEXT_BASE=0x38040000 -eNET_SRAM                    i386        i386        eNET                -              sc520       eNET:SYS_TEXT_BASE=0x19000000 +eNET                         x86         x86        eNET                -              sc520       eNET:SYS_TEXT_BASE=0x38040000 +eNET_SRAM                    x86         x86        eNET                -              sc520       eNET:SYS_TEXT_BASE=0x19000000  idmr                         m68k        mcf52x2  TASREG                       m68k        mcf52x2     tasreg              esd  M5208EVBE                    m68k        mcf52x2     m5208evbe           freescale diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index bba737460..1d76ffaa2 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -304,7 +304,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])  #elif defined(CONFIG_AVR32) -int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])  {  	bd_t *bd = gd->bd; diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index fb69c242f..6d8512aec 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -659,7 +659,7 @@ static int do_env_export(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv  				errno);  			return 1;  		} -		sprintf(buf, "%zX", len); +		sprintf(buf, "%zX", (size_t)len);  		setenv("filesize", buf);  		return 0; @@ -685,7 +685,7 @@ static int do_env_export(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv  		envp->flags = ACTIVE_FLAG;  #endif  	} -	sprintf(buf, "%zX", len + offsetof(env_t,data)); +	sprintf(buf, "%zX", (size_t)(len + offsetof(env_t,data)));  	setenv("filesize", buf);  	return 0; diff --git a/common/cmd_usb.c b/common/cmd_usb.c index b5731a7bb..3ba6fff4f 100644 --- a/common/cmd_usb.c +++ b/common/cmd_usb.c @@ -588,7 +588,7 @@ int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])  					break;  			}  			if (dev == NULL) { -				printf("*** NO Device avaiable ***\n"); +				printf("*** No device available ***\n");  				return 0;  			} else {  				usb_display_desc(dev); diff --git a/common/exports.c b/common/exports.c index 3dff7351b..717e4afe6 100644 --- a/common/exports.c +++ b/common/exports.c @@ -15,7 +15,7 @@ unsigned long get_version(void)  /* Reuse _exports.h with a little trickery to avoid bitrot */  #define EXPORT_FUNC(sym) gd->jt[XF_##sym] = (void *)sym; -#if !defined(CONFIG_I386) && !defined(CONFIG_PPC) +#if !defined(CONFIG_X86) && !defined(CONFIG_PPC)  # define install_hdlr      dummy  # define free_hdlr         dummy  #else /* kludge for non-standard function naming */ diff --git a/common/usb_storage.c b/common/usb_storage.c index 6963e6dcc..9ecf165d1 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -254,7 +254,7 @@ int usb_stor_scan(int mode)  		dev = usb_get_dev_index(i); /* get device */  		USB_STOR_PRINTF("i=%d\n", i);  		if (dev == NULL) -			break; /* no more devices avaiable */ +			break; /* no more devices available */  		if (usb_storage_probe(dev, 0, &usb_stor[usb_max_devs])) {  			/* OK, it's a storage device.  Iterate over its LUNs diff --git a/disk/part.c b/disk/part.c index 13723f23b..f07a17feb 100644 --- a/disk/part.c +++ b/disk/part.c @@ -84,7 +84,7 @@ block_dev_desc_t *get_dev(char* ifname, int dev)  #ifdef CONFIG_NEEDS_MANUAL_RELOC  	name += gd->reloc_off;  #endif -	while (name) { +	while (drvr->name) {  		name = drvr->name;  		reloc_get_dev = drvr->get_dev;  #ifdef CONFIG_NEEDS_MANUAL_RELOC diff --git a/doc/README-i386 b/doc/README-i386 deleted file mode 100644 index c560d22f4..000000000 --- a/doc/README-i386 +++ /dev/null @@ -1,74 +0,0 @@ -This is my attempt to port U-Boot to the i386 platform. This -work was sponsored by my emplyer, Omicron Ceti AB. http://www.omicron.se - -It is currently capable of booting a linux bzImage from flash on -the AMD SC520 CDP platform. - -It was originally based on PPCBoot taken from the CVS October 28 2002. - -To compile: - -1) Unpack the source tree, either from the complete tarball or -   from the virgin snapshot + the patch - -2) Configure the source -   $ make sc520_cdp_comfig -   $ make - -To use this code on the CDP: -1) Make a suitable kernel, I used 2.4.19 with the mtd-support updated -   from the MTD CVS and a patch to allow root=/dev/mtdblock1 which I -   included at the end of this file. -   The following options in the MTD section might be useful: - -   CONFIG_MTD_PHYSMAP=y -   CONFIG_MTD_PHYSMAP_START=38100000 -   CONFIG_MTD_PHYSMAP_LEN=7a0000 -   CONFIG_MTD_PHYSMAP_BUSWIDTH=2 - - -2) Program it in to the CDP flashbank with remon -   u-boot.bin should be programmed att offset 0x7e000 and the kernel at -   offset 0. If you want to use a jffs2 root file system (not included here), -   it should be  programmed to offset 0x100000. - -   remon> z -   remon> yi -   remon> ns u-boot.bin 7e0000 -   remon> ns bzImage 0 -   remon> ns image.jffs2 100000 - -3) Connect a terminal to the 25pin serial port at 9600bps, and start the CDP. - -   remon> z -   remon> g - -4) U-Boot should output some message and a prompt on the terminal, to -   start the kernel issue the following command: - -   BOOT> bootm - -5) The kernel should boot, and mount the root filesystem if present. - -We hope you find this stuff useful -Daniel Engström, Omicron Ceti AB, daniel@omicron.se - - ---- linux-2.4.19-orig/init/do_mounts.c	Sat Aug  3 02:39:46 2002 -+++ linux-2.4.19/init/do_mounts.c	Mon Sep 23 16:21:33 2002 -@@ -224,6 +224,14 @@ -	{ "ftlc", 0x2c10 }, -	{ "ftld", 0x2c18 }, -	{ "mtdblock", 0x1f00 }, -+	{ "mtdblock0", 0x1f00 }, -+	{ "mtdblock1", 0x1f01 }, -+	{ "mtdblock2", 0x1f02 }, -+	{ "mtdblock3", 0x1f03 }, -+	{ "mtdblock4", 0x1f04 }, -+	{ "mtdblock5", 0x1f05 }, -+	{ "mtdblock6", 0x1f06 }, -+	{ "mtdblock7", 0x1f07 }, -	{ NULL, 0 } - }; - -------------------- diff --git a/doc/TODO-i386 b/doc/TODO-i386 deleted file mode 100644 index 9b6c5d41a..000000000 --- a/doc/TODO-i386 +++ /dev/null @@ -1,29 +0,0 @@ -i386 port missing features: -* i386 cleaness (wbinvld is 486+ ... ) -* Pentium TSC timer/udelay -* setup the BIOS data area and BIOS equipment word to reflect machine config.  -* Make reset work (from Linux and from the boot prompt) -* DMA, FDC, RTC, KBC initialization -* split of part of arch/i386/cpu/interrupt.c to cpu/i385/entry.c? -* re-entry of protected mode from real mode, should be added to realmode_switch.S  -  (and used by INT 10h and INT 16h handlers for console I/O during early -   linux boot...)  -* missing functions in arch/i386/lib and arch/i386/cpu -* speaker beep interface - - -SC520 missing features: -* Watchdog -* SC520 timer/udelay -* SC520 3rd PIC -* SC520 ICE serial -* SC520 MMCR reset  - -SC520 CDP board support missing features: -* environment in sram - -SC520 CDP board support bugs: -* SPI EEPROM support does not work -* 0x680 LEDS dos not work for me -* is it possible to make both the internal serial ports and the  -  ports on the sio work at the same time? diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 5788328ef..91ddcb467 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -2089,6 +2089,14 @@ static void cfi_flash_set_config_reg(u32 base, u16 val)  void flash_protect_default(void)  { +#if defined(CONFIG_SYS_FLASH_AUTOPROTECT_LIST) +	int i; +	struct apl_s { +		ulong start; +		ulong size; +	} apl[] = CONFIG_SYS_FLASH_AUTOPROTECT_LIST; +#endif +  	/* Monitor protection ON by default */  #if (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE) && \  	(!defined(CONFIG_MONITOR_IS_IN_RAM)) @@ -2130,12 +2138,6 @@ unsigned long flash_init (void)  {  	unsigned long size = 0;  	int i; -#if defined(CONFIG_SYS_FLASH_AUTOPROTECT_LIST) -	struct apl_s { -		ulong start; -		ulong size; -	} apl[] = CONFIG_SYS_FLASH_AUTOPROTECT_LIST; -#endif  #ifdef CONFIG_SYS_FLASH_PROTECTION  	/* read environment from EEPROM */ diff --git a/drivers/net/at91_emac.c b/drivers/net/at91_emac.c index 4e5685c0c..90eb51524 100644 --- a/drivers/net/at91_emac.c +++ b/drivers/net/at91_emac.c @@ -93,7 +93,7 @@  #define RBF_MULTICAST (1<<30)  #define RBF_UNICAST   (1<<29)  #define RBF_EXTERNAL  (1<<28) -#define RBF_UNKOWN    (1<<27) +#define RBF_UNKNOWN   (1<<27)  #define RBF_SIZE      0x07ff  #define RBF_LOCAL4    (1<<26)  #define RBF_LOCAL3    (1<<25) diff --git a/drivers/watchdog/ftwdt010_wdt.c b/drivers/watchdog/ftwdt010_wdt.c index 6e0617b6a..c9cb53ed4 100644 --- a/drivers/watchdog/ftwdt010_wdt.c +++ b/drivers/watchdog/ftwdt010_wdt.c @@ -29,13 +29,13 @@  #include <common.h>  #include <watchdog.h>  #include <asm/io.h> -#include "ftwdt010_wdt.h" +#include <faraday/ftwdt010_wdt.h>  /*   * Set the watchdog time interval.   * Counter is 32 bit.   */ -static int ftwdt010_wdt_settimeout(unsigned int timeout) +int ftwdt010_wdt_settimeout(unsigned int timeout)  {  	unsigned int reg; @@ -61,7 +61,7 @@ static int ftwdt010_wdt_settimeout(unsigned int timeout)  	return 0;  } -void ftwdt010_wdt_reset() +void ftwdt010_wdt_reset(void)  {  	struct ftwdt010_wdt *wd = (struct ftwdt010_wdt *)CONFIG_FTWDT010_BASE; @@ -75,7 +75,7 @@ void ftwdt010_wdt_reset()  	writel((FTWDT010_WDCR_RST | FTWDT010_WDCR_ENABLE), &wd->wdcr);  } -void ftwdt010_wdt_disable() +void ftwdt010_wdt_disable(void)  {  	struct ftwdt010_wdt *wd = (struct ftwdt010_wdt *)CONFIG_FTWDT010_BASE; @@ -90,7 +90,8 @@ void ftwdt010_wdt_disable()  	writel(0, &wd->wdcr);  } -void hw_watchdog_reset() +#if defined(CONFIG_HW_WATCHDOG) +void hw_watchdog_reset(void)  {  	ftwdt010_wdt_reset();  } @@ -100,3 +101,4 @@ void hw_watchdog_init(void)  	/* set timer in ms */  	ftwdt010_wdt_settimeout(CONFIG_FTWDT010_HW_TIMEOUT * 1000);  } +#endif diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile index c1dfdce58..66b5d24f0 100644 --- a/examples/standalone/Makefile +++ b/examples/standalone/Makefile @@ -95,7 +95,7 @@ $(LIB):	$(obj).depend $(LIBOBJS)  $(ELF):  $(obj)%:	$(obj)%.o $(LIB) -		$(LD) -g -Ttext $(STANDALONE_LOAD_ADDR) \ +		$(LD) -g -Ttext $(CONFIG_STANDALONE_LOAD_ADDR) \  			-o $@ -e $(SYM_PREFIX)$(notdir $(<:.o=)) $< $(LIB) \  			-L$(gcclibdir) -lgcc diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c index 2d2e7098b..507d38cea 100644 --- a/examples/standalone/stubs.c +++ b/examples/standalone/stubs.c @@ -4,7 +4,7 @@  #define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)  #endif /* GCC_VERSION */ -#if defined(CONFIG_I386) +#if defined(CONFIG_X86)  /*   * x86 does not have a dedicated register to store the pointer to   * the global_data. Thus the jump table address is stored in a @@ -198,7 +198,7 @@ void app_startup(char * const *argv)  		*cp++ = 0;  	} -#if defined(CONFIG_I386) +#if defined(CONFIG_X86)  	/* x86 does not have a dedicated register for passing global_data */  	global_data = (gd_t *)argv[-1];  	jt = global_data->jt; diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c index c4f744522..5ddc2b937 100644 --- a/fs/jffs2/jffs2_1pass.c +++ b/fs/jffs2/jffs2_1pass.c @@ -794,7 +794,7 @@ jffs2_1pass_read_inode(struct b_lists *pL, u32 inode, char *dest)  #endif  				default:  					/* unknown */ -					putLabeledWord("UNKOWN COMPRESSION METHOD = ", jNode->compr); +					putLabeledWord("UNKNOWN COMPRESSION METHOD = ", jNode->compr);  					put_fl_mem(jNode, pL->readbuf);  					return -1;  					break; diff --git a/fs/jffs2/jffs2_nand_1pass.c b/fs/jffs2/jffs2_nand_1pass.c index 3982003a4..740f787dd 100644 --- a/fs/jffs2/jffs2_nand_1pass.c +++ b/fs/jffs2/jffs2_nand_1pass.c @@ -350,7 +350,7 @@ jffs2_1pass_read_inode(struct b_lists *pL, u32 ino, char *dest,  #endif  			default:  				/* unknown */ -				putLabeledWord("UNKOWN COMPRESSION METHOD = ", inode->compr); +				putLabeledWord("UNKNOWN COMPRESSION METHOD = ", inode->compr);  				return -1;  			}  		} diff --git a/include/common.h b/include/common.h index 54503ed3e..21c05db3f 100644 --- a/include/common.h +++ b/include/common.h @@ -180,11 +180,13 @@ typedef void (interrupt_handler_t)(void *);   * General Purpose Utilities   */  #define min(X, Y)				\ -	({ typeof (X) __x = (X), __y = (Y);	\ +	({ typeof (X) __x = (X);		\ +		typeof (Y) __y = (Y);		\  		(__x < __y) ? __x : __y; })  #define max(X, Y)				\ -	({ typeof (X) __x = (X), __y = (Y);	\ +	({ typeof (X) __x = (X);		\ +		typeof (Y) __y = (Y);		\  		(__x > __y) ? __x : __y; })  #define MIN(x, y)  min(x, y) @@ -270,9 +272,9 @@ int	setenv	     (char *, char *);  # include <asm/setup.h>  # include <asm/u-boot-arm.h>	/* ARM version to be fixed! */  #endif /* CONFIG_ARM */ -#ifdef CONFIG_I386		/* x86 version to be fixed! */ -# include <asm/u-boot-i386.h> -#endif /* CONFIG_I386 */ +#ifdef CONFIG_X86		/* x86 version to be fixed! */ +# include <asm/u-boot-x86.h> +#endif /* CONFIG_X86 */  #ifdef CONFIG_AUTO_COMPLETE  int env_complete(char *var, int maxv, char *cmdv[], int maxsz, char *buf); diff --git a/include/configs/eNET.h b/include/configs/eNET.h index 34a9d6866..548d52c6a 100644 --- a/include/configs/eNET.h +++ b/include/configs/eNET.h @@ -33,7 +33,6 @@   * High Level Configuration Options   * (easy to change)   */ -#define CONFIG_X86  #define CONFIG_SYS_SC520  #define CONFIG_SYS_SC520_SSI  #define CONFIG_SHOW_BOOT_PROGRESS @@ -158,16 +157,19 @@  /*-----------------------------------------------------------------------   * Memory organization:   * 32kB Stack + * 16kB Cache-As-RAM @ 0x19200000   * 256kB Monitor + * (128kB + Environment Sector Size) malloc pool   */ -#define CONFIG_SYS_STACK_SIZE			0x8000 +#define CONFIG_SYS_STACK_SIZE			(32 * 1024)  #define CONFIG_SYS_CAR_ADDR			0x19200000 -#define CONFIG_SYS_CAR_SIZE			0x00004000 +#define CONFIG_SYS_CAR_SIZE			(16 * 1024)  #define CONFIG_SYS_INIT_SP_ADDR			(CONFIG_SYS_CAR_ADDR + \  						 CONFIG_SYS_CAR_SIZE)  #define CONFIG_SYS_MONITOR_BASE			CONFIG_SYS_TEXT_BASE  #define CONFIG_SYS_MONITOR_LEN			(256 * 1024) -#define CONFIG_SYS_MALLOC_LEN			(CONFIG_ENV_SIZE + 128*1024) +#define CONFIG_SYS_MALLOC_LEN			(CONFIG_ENV_SECT_SIZE + \ +						 128*1024)  /* Address of temporary Global Data */  #define CONFIG_SYS_INIT_GD_ADDR			CONFIG_SYS_CAR_ADDR @@ -198,17 +200,25 @@  #define CONFIG_SYS_FLASH_LEGACY_512Kx8  #define CONFIG_SYS_FLASH_ERASE_TOUT		2000	/* ms */  #define CONFIG_SYS_FLASH_WRITE_TOUT		2000	/* ms */ +  /*-----------------------------------------------------------------------   * Environment configuration + * - Boot flash is 512kB with 64kB sectors + * - StrataFlash is 32MB with 128kB sectors + * - Redundant embedded environment is 25% of the Boot flash + * - Redundant StrataFlash environment is <1% of the StrataFlash + * - Environment is therefore located in StrataFlash + * - Primary copy is located in first sector of first flash + * - Redundant copy is located in second sector of first flash + * - Stack is only 32kB, so environment size is limited to 4kB   */  #define CONFIG_ENV_IS_IN_FLASH  #define CONFIG_ENV_SECT_SIZE			0x20000 -#define CONFIG_ENV_SIZE				CONFIG_ENV_SECT_SIZE +#define CONFIG_ENV_SIZE				0x01000  #define CONFIG_ENV_ADDR				CONFIG_SYS_FLASH_BASE_1 -/* Redundant Copy */  #define CONFIG_ENV_ADDR_REDUND			(CONFIG_SYS_FLASH_BASE_1 + \  						 CONFIG_ENV_SECT_SIZE) -#define CONFIG_ENV_SIZE_REDUND			CONFIG_ENV_SECT_SIZE +#define CONFIG_ENV_SIZE_REDUND			CONFIG_ENV_SIZE  /*-----------------------------------------------------------------------   * PCI configuration diff --git a/include/configs/omap2420h4.h b/include/configs/omap2420h4.h index 7161ab18c..2888c7bfb 100644 --- a/include/configs/omap2420h4.h +++ b/include/configs/omap2420h4.h @@ -38,6 +38,8 @@  /*#define CONFIG_APTIX           1    #* define if on APTIX test chip */  /*#define CONFIG_VIRTIO          1    #* Using Virtio simulator */ +#define CONFIG_STANDALONE_LOAD_ADDR	0x80300000 +  /* Clock config to target*/  #define PRCM_CONFIG_II	1  /* #define PRCM_CONFIG_III		1 */ diff --git a/include/exports.h b/include/exports.h index 638231166..ddd1bf494 100644 --- a/include/exports.h +++ b/include/exports.h @@ -45,7 +45,7 @@ enum {  #define XF_VERSION	6 -#if defined(CONFIG_I386) +#if defined(CONFIG_X86)  extern gd_t *global_data;  #endif diff --git a/drivers/watchdog/ftwdt010_wdt.h b/include/faraday/ftwdt010_wdt.h index 8f4fd68bd..31ca76811 100644 --- a/drivers/watchdog/ftwdt010_wdt.h +++ b/include/faraday/ftwdt010_wdt.h @@ -100,4 +100,7 @@ struct ftwdt010_wdt {   */  #define FTWDT010_TIMEOUT_FACTOR		(CONFIG_SYS_CLK_FREQ / 1000) /* 1 ms */ +void ftwdt010_wdt_reset(void); +void ftwdt010_wdt_disable(void); +  #endif /* __FTWDT010_H */ diff --git a/lib/gunzip.c b/lib/gunzip.c index 482a4768a..8b16b2495 100644 --- a/lib/gunzip.c +++ b/lib/gunzip.c @@ -106,12 +106,16 @@ int zunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp,  	s.avail_in = *lenp - offset;  	s.next_out = dst;  	s.avail_out = dstlen; -	r = inflate(&s, Z_FINISH); -	if ((r != Z_STREAM_END) && (stoponerr==1)) { -		printf ("Error: inflate() returned %d\n", r); -		inflateEnd(&s); -		return (-1); -	} +	do { +		r = inflate(&s, Z_FINISH); +		if (r != Z_STREAM_END && r != Z_BUF_ERROR && stoponerr == 1) { +			printf("Error: inflate() returned %d\n", r); +			inflateEnd(&s); +			return -1; +		} +		s.avail_in = *lenp - offset - (int)(s.next_out - (unsigned char*)dst); +		s.avail_out = dstlen; +	} while (r == Z_BUF_ERROR);  	*lenp = s.next_out - (unsigned char *) dst;  	inflateEnd(&s); diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 8ff705224..e0f46bcd1 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -674,11 +674,7 @@ static int flash_read_buf (int dev, int fd, void *buf, size_t count,  				   MEMGETBADBLOCK needs 64 bits */  	int rc; -	/* -	 * Start of the first block to be read, relies on the fact, that -	 * erase sector size is always a power of 2 -	 */ -	blockstart = offset & ~(DEVESIZE (dev) - 1); +	blockstart = (offset / DEVESIZE (dev)) * DEVESIZE (dev);  	/* Offset inside a block */  	block_seek = offset - blockstart; @@ -694,8 +690,8 @@ static int flash_read_buf (int dev, int fd, void *buf, size_t count,  		 * To calculate the top of the range, we have to use the  		 * global DEVOFFSET (dev), which can be different from offset  		 */ -		top_of_range = (DEVOFFSET (dev) & ~(blocklen - 1)) + -			ENVSECTORS (dev) * blocklen; +		top_of_range = ((DEVOFFSET(dev) / blocklen) + +				ENVSECTORS (dev)) * blocklen;  		/* Limit to one block for the first read */  		if (readlen > blocklen - block_seek) @@ -749,9 +745,9 @@ static int flash_read_buf (int dev, int fd, void *buf, size_t count,  }  /* - * Write count bytes at offset, but stay within ENVSETCORS (dev) sectors of - * DEVOFFSET (dev). Similar to the read case above, on NOR we erase and write - * the whole data at once. + * Write count bytes at offset, but stay within ENVSECTORS (dev) sectors of + * DEVOFFSET (dev). Similar to the read case above, on NOR and dataflash we + * erase and write the whole data at once.   */  static int flash_write_buf (int dev, int fd, void *buf, size_t count,  			    off_t offset, uint8_t mtd_type) @@ -764,7 +760,7 @@ static int flash_write_buf (int dev, int fd, void *buf, size_t count,  	size_t erasesize;	/* erase / write length - one block on NAND,  				   whole area on NOR */  	size_t processed = 0;	/* progress counter */ -	size_t write_total;	/* total size to actually write - excludinig +	size_t write_total;	/* total size to actually write - excluding  				   bad blocks */  	off_t erase_offset;	/* offset to the first erase block (aligned)  				   below offset */ @@ -777,11 +773,10 @@ static int flash_write_buf (int dev, int fd, void *buf, size_t count,  	blocklen = DEVESIZE (dev); -	/* Erase sector size is always a power of 2 */ -	top_of_range = (DEVOFFSET (dev) & ~(blocklen - 1)) + -		ENVSECTORS (dev) * blocklen; +	top_of_range = ((DEVOFFSET(dev) / blocklen) + +					ENVSECTORS (dev)) * blocklen; -	erase_offset = offset & ~(blocklen - 1); +	erase_offset = (offset / blocklen) * blocklen;  	/* Maximum area we may use */  	erase_len = top_of_range - erase_offset; @@ -795,7 +790,8 @@ static int flash_write_buf (int dev, int fd, void *buf, size_t count,  	 * to the start of the data, then count bytes of data, and to the  	 * end of the block  	 */ -	write_total = (block_seek + count + blocklen - 1) & ~(blocklen - 1); +	write_total = ((block_seek + count + blocklen - 1) / +						blocklen) * blocklen;  	/*  	 * Support data anywhere within erase sectors: read out the complete @@ -838,7 +834,7 @@ static int flash_write_buf (int dev, int fd, void *buf, size_t count,  	erase.length = erasesize; -	/* This only runs once on NOR flash */ +	/* This only runs once on NOR flash and SPI-dataflash */  	while (processed < write_total) {  		rc = flash_bad_block (fd, mtd_type, &blockstart);  		if (rc < 0)		/* block test failed */ @@ -857,12 +853,14 @@ static int flash_write_buf (int dev, int fd, void *buf, size_t count,  		erase.start = blockstart;  		ioctl (fd, MEMUNLOCK, &erase); -		if (ioctl (fd, MEMERASE, &erase) != 0) { -			fprintf (stderr, "MTD erase error on %s: %s\n", -				 DEVNAME (dev), -				 strerror (errno)); -			return -1; -		} +		/* Dataflash does not need an explicit erase cycle */ +		if (mtd_type != MTD_DATAFLASH) +			if (ioctl (fd, MEMERASE, &erase) != 0) { +				fprintf (stderr, "MTD erase error on %s: %s\n", +					 DEVNAME (dev), +					 strerror (errno)); +				return -1; +			}  		if (lseek (fd, blockstart, SEEK_SET) == -1) {  			fprintf (stderr, @@ -973,7 +971,9 @@ static int flash_read (int fd)  		return -1;  	} -	if (mtdinfo.type != MTD_NORFLASH && mtdinfo.type != MTD_NANDFLASH) { +	if (mtdinfo.type != MTD_NORFLASH && +	    mtdinfo.type != MTD_NANDFLASH && +	    mtdinfo.type != MTD_DATAFLASH) {  		fprintf (stderr, "Unsupported flash type %u\n", mtdinfo.type);  		return -1;  	} @@ -1143,6 +1143,9 @@ int fw_env_open(void)  		} else if (DEVTYPE(dev_current) == MTD_NANDFLASH &&  			   DEVTYPE(!dev_current) == MTD_NANDFLASH) {  			environment.flag_scheme = FLAG_INCREMENTAL; +		} else if (DEVTYPE(dev_current) == MTD_DATAFLASH && +			   DEVTYPE(!dev_current) == MTD_DATAFLASH) { +			environment.flag_scheme = FLAG_BOOLEAN;  		} else {  			fprintf (stderr, "Incompatible flash types!\n");  			return -1; @@ -1234,14 +1237,29 @@ static int parse_config ()  	strcpy (DEVNAME (0), DEVICE1_NAME);  	DEVOFFSET (0) = DEVICE1_OFFSET;  	ENVSIZE (0) = ENV1_SIZE; +	/* Default values are: erase-size=env-size, #sectors=1 */ +	DEVESIZE (0) = ENVSIZE (0); +	ENVSECTORS (0) = 1; +#ifdef DEVICE1_ESIZE  	DEVESIZE (0) = DEVICE1_ESIZE; +#endif +#ifdef DEVICE1_ENVSECTORS  	ENVSECTORS (0) = DEVICE1_ENVSECTORS; +#endif +  #ifdef HAVE_REDUND  	strcpy (DEVNAME (1), DEVICE2_NAME);  	DEVOFFSET (1) = DEVICE2_OFFSET;  	ENVSIZE (1) = ENV2_SIZE; +	/* Default values are: erase-size=env-size, #sectors=1 */ +	DEVESIZE (1) = ENVSIZE (1); +	ENVSECTORS (1) = 1; +#ifdef DEVICE2_ESIZE  	DEVESIZE (1) = DEVICE2_ESIZE; +#endif +#ifdef DEVICE2_ENVSECTORS  	ENVSECTORS (1) = DEVICE2_ENVSECTORS; +#endif  	HaveRedundEnv = 1;  #endif  #endif @@ -1285,9 +1303,13 @@ static int get_config (char *fname)  			     &DEVESIZE (i),  			     &ENVSECTORS (i)); -		if (rc < 4) +		if (rc < 3)  			continue; +		if (rc < 4) +			/* Assume the erase size is the same as the env-size */ +			DEVESIZE(i) = ENVSIZE(i); +  		if (rc < 5)  			/* Default - 1 sector */  			ENVSECTORS (i) = 1; diff --git a/tools/env/fw_env.config b/tools/env/fw_env.config index c8f12cf0a..8e21d5a5a 100644 --- a/tools/env/fw_env.config +++ b/tools/env/fw_env.config @@ -1,11 +1,19 @@  # Configuration file for fw_(printenv/saveenv) utility.  # Up to two entries are valid, in this case the redundant  # environment sector is assumed present. -# Notice, that the "Number of sectors" is ignored on NOR. +# Notice, that the "Number of sectors" is ignored on NOR and SPI-dataflash. +# Futhermore, if the Flash sector size is ommitted, this value is assumed to +# be the same as the Environment size, which is valid for NOR and SPI-dataflash +# NOR example  # MTD device name	Device offset	Env. size	Flash sector size	Number of sectors  /dev/mtd1		0x0000		0x4000		0x4000  /dev/mtd2		0x0000		0x4000		0x4000 +# MTD SPI-dataflash example +# MTD device name	Device offset	Env. size	Flash sector size	Number of sectors +#/dev/mtd5		0x4200		0x4200 +#/dev/mtd6		0x4200		0x4200 +  # NAND example  #/dev/mtd0		0x4000		0x4000		0x20000			2 diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h index 8130fa150..c83d6089b 100644 --- a/tools/env/fw_env.h +++ b/tools/env/fw_env.h @@ -34,10 +34,8 @@  #define DEVICE2_NAME      "/dev/mtd2"  #define DEVICE1_OFFSET    0x0000  #define ENV1_SIZE         0x4000 -#define DEVICE1_ESIZE     0x4000  #define DEVICE2_OFFSET    0x0000  #define ENV2_SIZE         0x4000 -#define DEVICE2_ESIZE     0x4000  #define CONFIG_BAUDRATE		115200  #define CONFIG_BOOTDELAY	5	/* autoboot after 5 seconds	*/ diff --git a/tools/imximage.h b/tools/imximage.h index 38ca6be1f..d126a46a7 100644 --- a/tools/imximage.h +++ b/tools/imximage.h @@ -24,8 +24,6 @@  #ifndef _IMXIMAGE_H_  #define _IMXIMAGE_H_ -#include <config.h> -  #define MAX_HW_CFG_SIZE_V2 121 /* Max number of registers imx can set for v2 */  #define MAX_HW_CFG_SIZE_V1 60  /* Max number of registers imx can set for v1 */  #define APP_CODE_BARKER	0xB1 diff --git a/tools/mkimage.c b/tools/mkimage.c index f5859d776..60f726303 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -23,6 +23,7 @@  #include "mkimage.h"  #include <image.h> +#include <version.h>  static void copy_file(int, const char *, int);  static void usage(void); @@ -246,6 +247,9 @@ main (int argc, char **argv)  			case 'v':  				params.vflag++;  				break; +			case 'V': +				printf("mkimage version %s\n", PLAIN_VERSION); +				exit(EXIT_SUCCESS);  			case 'x':  				params.xflag++;  				break; @@ -590,6 +594,8 @@ usage ()  		params.cmdname);  	fprintf (stderr, "       %s [-D dtc_options] -f fit-image.its fit-image\n",  		params.cmdname); +	fprintf (stderr, "       %s -V ==> print version information and exit\n", +		params.cmdname);  	exit (EXIT_FAILURE);  }  |