]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Merge branch 'misc' of git://git.denx.de/u-boot-blackfin
authorWolfgang Denk <wd@denx.de>
Wed, 20 Apr 2011 20:57:35 +0000 (22:57 +0200)
committerWolfgang Denk <wd@denx.de>
Wed, 20 Apr 2011 20:57:35 +0000 (22:57 +0200)
184 files changed:
MAINTAINERS
MAKEALL
Makefile
README
arch/powerpc/config.mk
arch/powerpc/cpu/74xx_7xx/start.S
arch/powerpc/cpu/mpc512x/start.S
arch/powerpc/cpu/mpc5xx/start.S
arch/powerpc/cpu/mpc5xxx/start.S
arch/powerpc/cpu/mpc8220/start.S
arch/powerpc/cpu/mpc824x/start.S
arch/powerpc/cpu/mpc8260/start.S
arch/powerpc/cpu/mpc83xx/start.S
arch/powerpc/cpu/mpc85xx/start.S
arch/powerpc/cpu/mpc86xx/start.S
arch/powerpc/cpu/mpc8xx/start.S
arch/powerpc/cpu/ppc4xx/start.S
arch/x86/config.mk [moved from arch/i386/config.mk with 100% similarity]
arch/x86/cpu/Makefile [moved from arch/i386/cpu/Makefile with 100% similarity]
arch/x86/cpu/config.mk [moved from arch/i386/cpu/config.mk with 94% similarity]
arch/x86/cpu/cpu.c [moved from arch/i386/cpu/cpu.c with 89% similarity]
arch/x86/cpu/interrupts.c [moved from arch/i386/cpu/interrupts.c with 99% similarity]
arch/x86/cpu/resetvec.S [moved from arch/i386/cpu/resetvec.S with 89% similarity]
arch/x86/cpu/sc520/Makefile [moved from arch/i386/cpu/sc520/Makefile with 96% similarity]
arch/x86/cpu/sc520/sc520.c [moved from arch/i386/cpu/sc520/sc520.c with 82% similarity]
arch/x86/cpu/sc520/sc520_car.S [moved from arch/i386/cpu/sc520/sc520_car.S with 97% similarity]
arch/x86/cpu/sc520/sc520_pci.c [moved from arch/i386/cpu/sc520/sc520_pci.c with 94% similarity]
arch/x86/cpu/sc520/sc520_reset.c [new file with mode: 0644]
arch/x86/cpu/sc520/sc520_sdram.c [moved from arch/i386/cpu/sc520/sc520_sdram.c with 99% similarity]
arch/x86/cpu/sc520/sc520_ssi.c [moved from arch/i386/cpu/sc520/sc520_ssi.c with 94% similarity]
arch/x86/cpu/sc520/sc520_timer.c [moved from arch/i386/cpu/sc520/sc520_timer.c with 94% similarity]
arch/x86/cpu/start.S [moved from arch/i386/cpu/start.S with 84% similarity]
arch/x86/cpu/start16.S [moved from arch/i386/cpu/start16.S with 93% similarity]
arch/x86/cpu/u-boot.lds [moved from arch/i386/cpu/u-boot.lds with 90% similarity]
arch/x86/include/asm/bitops.h [moved from arch/i386/include/asm/bitops.h with 100% similarity]
arch/x86/include/asm/bootparam.h [moved from arch/i386/include/asm/bootparam.h with 100% similarity]
arch/x86/include/asm/byteorder.h [moved from arch/i386/include/asm/byteorder.h with 100% similarity]
arch/x86/include/asm/config.h [moved from arch/i386/include/asm/config.h with 100% similarity]
arch/x86/include/asm/e820.h [moved from arch/i386/include/asm/e820.h with 100% similarity]
arch/x86/include/asm/errno.h [moved from arch/i386/include/asm/errno.h with 100% similarity]
arch/x86/include/asm/global_data.h [moved from arch/i386/include/asm/global_data.h with 100% similarity]
arch/x86/include/asm/i8254.h [moved from arch/i386/include/asm/i8254.h with 100% similarity]
arch/x86/include/asm/i8259.h [moved from arch/i386/include/asm/i8259.h with 100% similarity]
arch/x86/include/asm/ibmpc.h [moved from arch/i386/include/asm/ibmpc.h with 100% similarity]
arch/x86/include/asm/ic/pci.h [moved from arch/i386/include/asm/ic/pci.h with 100% similarity]
arch/x86/include/asm/ic/sc520.h [moved from arch/i386/include/asm/ic/sc520.h with 100% similarity]
arch/x86/include/asm/ic/ssi.h [moved from arch/i386/include/asm/ic/ssi.h with 100% similarity]
arch/x86/include/asm/interrupt.h [moved from arch/i386/include/asm/interrupt.h with 95% similarity]
arch/x86/include/asm/io.h [moved from arch/i386/include/asm/io.h with 100% similarity]
arch/x86/include/asm/ioctl.h [moved from arch/i386/include/asm/ioctl.h with 100% similarity]
arch/x86/include/asm/ist.h [moved from arch/i386/include/asm/ist.h with 100% similarity]
arch/x86/include/asm/pci.h [moved from arch/i386/include/asm/pci.h with 100% similarity]
arch/x86/include/asm/posix_types.h [moved from arch/i386/include/asm/posix_types.h with 100% similarity]
arch/x86/include/asm/processor-flags.h [moved from arch/i386/include/asm/processor-flags.h with 100% similarity]
arch/x86/include/asm/processor.h [moved from arch/i386/include/asm/processor.h with 100% similarity]
arch/x86/include/asm/ptrace.h [moved from arch/i386/include/asm/ptrace.h with 100% similarity]
arch/x86/include/asm/realmode.h [moved from arch/i386/include/asm/realmode.h with 100% similarity]
arch/x86/include/asm/string.h [moved from arch/i386/include/asm/string.h with 100% similarity]
arch/x86/include/asm/types.h [moved from arch/i386/include/asm/types.h with 100% similarity]
arch/x86/include/asm/u-boot-x86.h [moved from arch/i386/include/asm/u-boot-i386.h with 93% similarity]
arch/x86/include/asm/u-boot.h [moved from arch/i386/include/asm/u-boot.h with 100% similarity]
arch/x86/include/asm/unaligned.h [moved from arch/i386/include/asm/unaligned.h with 100% similarity]
arch/x86/include/asm/video/edid.h [moved from arch/i386/include/asm/video/edid.h with 100% similarity]
arch/x86/include/asm/zimage.h [moved from arch/i386/include/asm/zimage.h with 100% similarity]
arch/x86/lib/Makefile [moved from arch/i386/lib/Makefile with 100% similarity]
arch/x86/lib/bios.S [moved from arch/i386/lib/bios.S with 99% similarity]
arch/x86/lib/bios.h [moved from arch/i386/lib/bios.h with 81% similarity]
arch/x86/lib/bios_pci.S [moved from arch/i386/lib/bios_pci.S with 100% similarity]
arch/x86/lib/bios_setup.c [moved from arch/i386/lib/bios_setup.c with 99% similarity]
arch/x86/lib/board.c [moved from arch/i386/lib/board.c with 95% similarity]
arch/x86/lib/bootm.c [moved from arch/i386/lib/bootm.c with 86% similarity]
arch/x86/lib/interrupts.c [moved from arch/i386/lib/interrupts.c with 88% similarity]
arch/x86/lib/pcat_interrupts.c [moved from arch/i386/lib/pcat_interrupts.c with 96% similarity]
arch/x86/lib/pcat_timer.c [moved from arch/i386/lib/pcat_timer.c with 97% similarity]
arch/x86/lib/pci.c [moved from arch/i386/lib/pci.c with 94% similarity]
arch/x86/lib/pci_type1.c [moved from arch/i386/lib/pci_type1.c with 61% similarity]
arch/x86/lib/realmode.c [moved from arch/i386/lib/realmode.c with 95% similarity]
arch/x86/lib/realmode_switch.S [moved from arch/i386/lib/realmode_switch.S with 99% similarity]
arch/x86/lib/timer.c [moved from arch/i386/lib/timer.c with 94% similarity]
arch/x86/lib/video.c [moved from arch/i386/lib/video.c with 86% similarity]
arch/x86/lib/video_bios.c [moved from arch/i386/lib/video_bios.c with 99% similarity]
arch/x86/lib/zimage.c [moved from arch/i386/lib/zimage.c with 98% similarity]
board/LEOX/elpt860/u-boot.lds
board/RPXClassic/u-boot.lds
board/RPXlite/u-boot.lds
board/RPXlite_dw/u-boot.lds
board/RRvision/u-boot.lds
board/adder/u-boot.lds
board/amirix/ap1000/u-boot.lds
board/c2mon/u-boot.lds
board/cogent/u-boot.lds
board/dave/PPChameleonEVB/u-boot.lds
board/eNET/config.mk [deleted file]
board/eNET/eNET.c
board/eNET/eNET_pci.c
board/eltec/mhpc/u-boot.lds
board/emk/top860/u-boot.lds
board/ep88x/u-boot.lds
board/esd/dasa_sim/u-boot.lds
board/esteem192e/u-boot.lds
board/etx094/u-boot.lds
board/evb64260/u-boot.lds
board/fads/u-boot.lds
board/flagadm/u-boot.lds
board/gen860t/u-boot.lds
board/genietv/u-boot.lds
board/hermes/u-boot.lds
board/hymod/u-boot.lds
board/icu862/u-boot.lds
board/ip860/u-boot.lds
board/ivm/u-boot.lds
board/kup/kup4k/u-boot.lds
board/kup/kup4x/u-boot.lds
board/lantec/u-boot.lds
board/lwmon/u-boot.lds
board/manroland/uc100/u-boot.lds
board/matrix_vision/mvsmr/u-boot.lds
board/mbx8xx/u-boot.lds
board/ml2/u-boot.lds
board/mousse/u-boot.lds
board/mvblue/u-boot.lds
board/netphone/u-boot.lds
board/netta/u-boot.lds
board/netta2/u-boot.lds
board/netvia/u-boot.lds
board/nx823/u-boot.lds
board/quantum/u-boot.lds
board/r360mpi/u-boot.lds
board/rbc823/u-boot.lds
board/rmu/u-boot.lds
board/rsdproto/u-boot.lds
board/sandpoint/u-boot.lds
board/sc3/u-boot.lds
board/siemens/IAD210/u-boot.lds
board/sixnet/u-boot.lds
board/snmc/qs850/u-boot.lds
board/snmc/qs860t/u-boot.lds
board/spc1920/u-boot.lds
board/spd8xx/u-boot.lds
board/stx/stxxtc/u-boot.lds
board/svm_sc8xx/u-boot.lds
board/tqc/tqm8xx/u-boot.lds
board/v37/u-boot.lds
board/westel/amx860/u-boot.lds
boards.cfg
common/Makefile
common/cmd_mmc.c
common/cmd_mmc_spi.c [new file with mode: 0644]
common/cmd_sf.c
common/exports.c
common/fdt_support.c
doc/README-i386 [deleted file]
doc/TODO-i386 [deleted file]
drivers/i2c/omap24xx_i2c.c
drivers/mmc/Makefile
drivers/mmc/fsl_esdhc.c
drivers/mmc/mmc.c
drivers/mmc/mmc_spi.c [new file with mode: 0644]
drivers/mtd/cfi_flash.c
drivers/mtd/nand/nand_base.c
drivers/mtd/spi/atmel.c
drivers/mtd/spi/eon.c
drivers/mtd/spi/macronix.c
drivers/mtd/spi/ramtron.c
drivers/mtd/spi/spansion.c
drivers/mtd/spi/spi_flash.c
drivers/mtd/spi/spi_flash_internal.h
drivers/mtd/spi/sst.c
drivers/mtd/spi/stmicro.c
drivers/mtd/spi/winbond.c
drivers/spi/cf_spi.c
examples/standalone/stubs.c
include/common.h
include/configs/eNET.h
include/exports.h
include/mmc.h
include/spi_flash.h
nand_spl/board/freescale/mpc8536ds/Makefile
nand_spl/board/freescale/mpc8569mds/Makefile
nand_spl/board/freescale/mpc8572ds/Makefile
nand_spl/board/freescale/p1_p2_rdb/Makefile
nand_spl/nand_boot.c
nand_spl/nand_boot_fsl_elbc.c
net/bootp.c

index 8af9b090ce265e95bb390d520aa9ba58abae8caf..1299cbba8ed631f150f5ed3d59e52ed1b6d90ea7 100644 (file)
@@ -624,7 +624,7 @@ Kristoffer Ericson <kristoffer.ericson@gmail.com>
 
        jornada SA1110
 
-Fabio Estevam <Fabio.Estevam@freescale.com>
+Fabio Estevam <fabio.estevam@freescale.com>
 
        mx31pdk         i.MX31
 
@@ -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:                                                                #
diff --git a/MAKEALL b/MAKEALL
index e1b928fdb579484484cc933e91bd2e420bbfc840..6acece7cad8c24bad46bfcd645efcccf721fac45 100755 (executable)
--- a/MAKEALL
+++ b/MAKEALL
@@ -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
index 1d571347a2737504a00c2f9c31231da97b5d91b9..713dba1d5f34f5ff6516e02936d3e857fa062b9f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/README b/README
index b25814c638df292553da2dcb10a7510cb3dffedb..beb1cbb1bc65948cfd946a217a5b3dd76d9f3443 100644 (file)
--- a/README
+++ b/README
@@ -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
index 3afc439e58c575d1d92da994badcbbd1da8dbbc2..e682071bd73f477f957d9863627cf03c7150839b 100644 (file)
@@ -26,8 +26,6 @@ CROSS_COMPILE ?= ppc_8xx-
 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,)
-PLATFORM_RELFLAGS += $(call cc-option,-fno-jump-tables,)
 PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__
 PLATFORM_LDFLAGS  += -n
 
index ab9412ad9e2a1b2d48c096e62c6f4f272fa5898d..f6011fcaa8c1e654ac13edafa012bc8e2296b072 100644 (file)
@@ -274,11 +274,7 @@ in_flash:
        stwu    r0, -4(r1)      /* stack backtraces terminate cleanly   */
 
        GET_GOT                 /* initialize GOT access        */
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
+
        /* run low-level CPU init code     (from Flash) */
        bl      cpu_init_f
        sync
@@ -592,11 +588,6 @@ relocate_code:
        mr      r10, r5         /* Save copy of Destination Address     */
 
        GET_GOT
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
        mr      r3,  r5                         /* Destination Address  */
        lis     r4, CONFIG_SYS_MONITOR_BASE@h           /* Source      Address  */
        ori     r4, r4, CONFIG_SYS_MONITOR_BASE@l
index 632f9674c8e5b00cada62f17a765b3d595de52a4..9c2e4885dedbfdb89ab2515952bda60c1f217cf7 100644 (file)
@@ -255,11 +255,7 @@ in_flash:
        /*------------------------------------------------------*/
 
        GET_GOT                 /* initialize GOT access        */
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
+
        /* r3: IMMR */
        lis     r3, CONFIG_SYS_IMMR@h
        /* run low-level CPU init code (in Flash) */
@@ -490,11 +486,6 @@ relocate_code:
        mr      r10, r5         /* Save copy of Destination Address */
 
        GET_GOT
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
        mr      r3,  r5                         /* Destination Address */
        lis     r4, CONFIG_SYS_MONITOR_BASE@h           /* Source      Address */
        ori     r4, r4, CONFIG_SYS_MONITOR_BASE@l
index 4fb2047da47fec33f7eb8e35dfedf078e6bddabe..cc11c8fc528537a1b4f39dd3d20e7e3f5aca92a3 100644 (file)
@@ -174,11 +174,7 @@ in_flash:
        /*----------------------------------------------------------------------*/
 
        GET_GOT                 /* initialize GOT access                        */
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
+
        /* r3: IMMR */
        bl      cpu_init_f      /* run low-level CPU init code     (from Flash) */
 
@@ -367,11 +363,6 @@ relocate_code:
        mr      r10, r5         /* Save copy of monitor destination Address in SRAM */
 
        GET_GOT
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
        mr      r3,  r5                         /* Destination Address  */
        lis     r4, CONFIG_SYS_MONITOR_BASE@h           /* Source      Address  */
        ori     r4, r4, CONFIG_SYS_MONITOR_BASE@l
index 0a0536119a6428faf418cdf13baa82afe2e8a7e1..192aa506a8883d9c2f7ba117370e245d875fa9b2 100644 (file)
@@ -160,11 +160,7 @@ lowboot_reentry:
        /*--------------------------------------------------------------*/
 
        GET_GOT                 /* initialize GOT access                */
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
+
        /* r3: IMMR */
        bl      cpu_init_f      /* run low-level CPU init code (in Flash)*/
 
@@ -553,11 +549,6 @@ relocate_code:
        mr      r10, r5         /* Save copy of Destination Address     */
 
        GET_GOT
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
        mr      r3,  r5                         /* Destination Address  */
        lis     r4, CONFIG_SYS_MONITOR_BASE@h           /* Source      Address  */
        ori     r4, r4, CONFIG_SYS_MONITOR_BASE@l
index 1df87a6afd4325c46a29350ba83f19ec7ef226e8..300b35c0c4f55c0a9830132e7281194f31f002e0 100644 (file)
@@ -129,11 +129,7 @@ _start:
        /*--------------------------------------------------------------*/
 
        GET_GOT                 /* initialize GOT access                */
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
+
        /* r3: IMMR */
        bl      cpu_init_f      /* run low-level CPU init code (in Flash)*/
 
@@ -526,11 +522,6 @@ relocate_code:
        mr      r10, r5     /* Save copy of Destination Address */
 
        GET_GOT
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
        mr      r3,  r5     /* Destination Address              */
        lis     r4, CONFIG_SYS_MONITOR_BASE@h   /* Source Address       */
        ori     r4, r4, CONFIG_SYS_MONITOR_BASE@l
index cc988759e0ae02b2c35eebded59db08a9a24e39c..fc4e922d633d15d2f09626223265189fe62cbc24 100644 (file)
@@ -183,11 +183,7 @@ in_flash:
        /*----------------------------------------------------------------------*/
 
        GET_GOT                 /* initialize GOT access                        */
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
+
        /* r3: IMMR */
        bl      cpu_init_f      /* run low-level CPU init code     (from Flash) */
 
@@ -456,11 +452,6 @@ relocate_code:
        mr      r10, r5         /* Save copy of Destination Address     */
 
        GET_GOT
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
        mr      r3,  r5                         /* Destination Address  */
 #ifdef CONFIG_SYS_RAMBOOT
        lis     r4, CONFIG_SYS_SDRAM_BASE@h             /* Source      Address  */
index 23151cdadf7c975fd71ab4faf228c259cf88dc02..702546eec5c566593f784ca6b3e5c38d6b9f1552 100644 (file)
@@ -236,11 +236,7 @@ in_flash:
        /*--------------------------------------------------------------*/
 
        GET_GOT                 /* initialize GOT access                */
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
+
        /* r3: IMMR */
        bl      cpu_init_f      /* run low-level CPU init code (in Flash)*/
 
index a9acb83f0b1cdd4fb55a5375ca6f3b06a6e5f60f..7e60315c3f446fb40f59ac1e2f96fe990de3210b 100644 (file)
@@ -285,11 +285,7 @@ in_flash:
        /*------------------------------------------------------*/
 
        GET_GOT                 /* initialize GOT access        */
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
+
        /* r3: IMMR */
        lis     r3, CONFIG_SYS_IMMR@h
        /* run low-level CPU init code (in Flash)*/
@@ -826,11 +822,6 @@ relocate_code:
        mr      r10, r5         /* Save copy of Destination Address */
 
        GET_GOT
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
        mr      r3,  r5                         /* Destination Address */
        lis     r4, CONFIG_SYS_MONITOR_BASE@h           /* Source      Address */
        ori     r4, r4, CONFIG_SYS_MONITOR_BASE@l
index 36233578f73629094574d925ce79d7e498966861..57774933a3dbe5819d0118336444551aa5c15173 100644 (file)
@@ -421,11 +421,6 @@ _start_cont:
        stw     r0,+12(r1)              /* Save return addr (underflow vect) */
 
        GET_GOT
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
        bl      cpu_init_early_f
 
        /* switch back to AS = 0 */
@@ -926,11 +921,6 @@ relocate_code:
        mr      r10,r5          /* Save copy of Destination Address     */
 
        GET_GOT
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
        mr      r3,r5                           /* Destination Address  */
        lis     r4,CONFIG_SYS_MONITOR_BASE@h            /* Source      Address  */
        ori     r4,r4,CONFIG_SYS_MONITOR_BASE@l
index 2ec7fd46b00cb5a064b2d044aff247b6eb5f8162..3e3c21eefd2d16561bee9308f1cd4e85e940a0ab 100644 (file)
@@ -255,11 +255,7 @@ addr_trans_enabled:
        stwu    r0, -4(r1)      /* stack backtraces terminate cleanly   */
 
        GET_GOT                 /* initialize GOT access        */
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
+
        /* run low-level CPU init code     (from Flash) */
        bl      cpu_init_f
        sync
@@ -624,11 +620,6 @@ relocate_code:
        mr      r10, r5         /* Save copy of Destination Address     */
 
        GET_GOT
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
        mr      r3,  r5                         /* Destination Address  */
        lis     r4, CONFIG_SYS_MONITOR_BASE@h           /* Source      Address  */
        ori     r4, r4, CONFIG_SYS_MONITOR_BASE@l
index f8256bff995683e235e8f4273330878c2db3eb37..fe3daa2b9f79a8e0c62347aec7b59edba7f641ca 100644 (file)
@@ -188,11 +188,7 @@ in_flash:
        /*----------------------------------------------------------------------*/
 
        GET_GOT                 /* initialize GOT access                        */
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
+
        /* r3: IMMR */
        bl      cpu_init_f      /* run low-level CPU init code     (from Flash) */
 
@@ -477,11 +473,6 @@ relocate_code:
        mr      r10, r5         /* Save copy of Destination Address     */
 
        GET_GOT
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
        mr      r3,  r5                         /* Destination Address  */
        lis     r4, CONFIG_SYS_MONITOR_BASE@h           /* Source      Address  */
        ori     r4, r4, CONFIG_SYS_MONITOR_BASE@l
index aa03d9a770c17513170e32e81f8c655dd2b9c2a3..b43e22c8f04d772f52e9d99123b0258828cd5cbf 100644 (file)
        bl      reconfig_tlb0
 #endif
        GET_GOT
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
        bl      cpu_init_f      /* run low-level CPU init code     (from Flash) */
        bl      board_init_f
        /* NOTREACHED - board_init_f() does not return */
@@ -804,11 +799,7 @@ _start:
        ori     r0,r0, RESET_VECTOR@l
        stwu    r1,-8(r1)               /* Save back chain and move SP */
        stw     r0,+12(r1)              /* Save return addr (underflow vect) */
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
+
 #ifdef CONFIG_NAND_SPL
        bl      nand_boot_common        /* will not return */
 #else
@@ -923,11 +914,7 @@ _start:
        stwu    r0, -4(r1)              /* stack backtraces terminate cleanly   */
 
        GET_GOT                 /* initialize GOT access                        */
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
+
        bl      board_init_f    /* run first part of init code (from Flash)     */
        /* NOTREACHED - board_init_f() does not return */
 
@@ -1192,11 +1179,6 @@ _start:
        stw     r0, +12(r1)             /* Save return addr (underflow vect) */
 #endif /* CONFIG_SYS_INIT_DCACHE_CS */
 
-#if defined(__pic__) && __pic__ == 1
-       /* Needed for upcoming -msingle-pic-base */
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r30
-#endif
 #ifdef CONFIG_NAND_SPL
        bl      nand_boot_common        /* will not return */
 #else
similarity index 100%
rename from arch/i386/config.mk
rename to arch/x86/config.mk
similarity index 100%
rename from arch/i386/cpu/Makefile
rename to arch/x86/cpu/Makefile
similarity index 94%
rename from arch/i386/cpu/config.mk
rename to arch/x86/cpu/config.mk
index 9b2e2c9fe1191153045208b5dcb3ce7b024a1e60..d1b528a43797122908c730ef5a0a0309241158f9 100644 (file)
@@ -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
similarity index 89%
rename from arch/i386/cpu/cpu.c
rename to arch/x86/cpu/cpu.c
index 2339cd41bbe71d037bc7900dd1222b83b8194528..0c5d7c3d53a437a3a8f7ead925fe9862ff52658b 100644 (file)
@@ -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>
  * 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) |            \
         (((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 */
similarity index 99%
rename from arch/i386/cpu/interrupts.c
rename to arch/x86/cpu/interrupts.c
index 1cefe02c86546baab4d8847ae7dfc2472123ac0d..62bcadc486a5671edc1fc99d41c4cea476de8c2f 100644 (file)
@@ -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;
 
similarity index 89%
rename from arch/i386/cpu/resetvec.S
rename to arch/x86/cpu/resetvec.S
index d9222dd2fc63934b1a1e52ced447c0d986560b54..c690d2516e7b1a2857643898577b06a29e149017 100644 (file)
@@ -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.
similarity index 96%
rename from arch/i386/cpu/sc520/Makefile
rename to arch/x86/cpu/sc520/Makefile
index 54260b610763c4223ca5de4413c8804217b5fbf2..694b61ee423e3f18c188f0d7c6e52174fa61f9a6 100644 (file)
@@ -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
similarity index 82%
rename from arch/i386/cpu/sc520/sc520.c
rename to arch/x86/cpu/sc520/sc520.c
index d0c313b91a9aa7ce64aef0d8c759bfb61637a0e2..8c410a2337d46b720421fc2926be473e3f62c8de 100644 (file)
@@ -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
similarity index 97%
rename from arch/i386/cpu/sc520/sc520_car.S
rename to arch/x86/cpu/sc520/sc520_car.S
index 22f5225311c6afb2c2cb65f1e83208bd749eb720..a33f94f4919a5d5cc448cd91747eb72f04120702 100644 (file)
@@ -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>
similarity index 94%
rename from arch/i386/cpu/sc520/sc520_pci.c
rename to arch/x86/cpu/sc520/sc520_pci.c
index b91773435e9a8b23ee7e2d6ccc2af4e861e0a7a3..8cd7ffecdb692634bf923e6595a6342ff493e982 100644 (file)
@@ -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 (file)
index 0000000..79ef976
--- /dev/null
@@ -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 */
+}
similarity index 99%
rename from arch/i386/cpu/sc520/sc520_sdram.c
rename to arch/x86/cpu/sc520/sc520_sdram.c
index d5ab55df069d931b3c61f9bfac6eb180d429f25c..f3623f53f2580ec5efcf1feb9d6550bade277137 100644 (file)
@@ -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.
similarity index 94%
rename from arch/i386/cpu/sc520/sc520_ssi.c
rename to arch/x86/cpu/sc520/sc520_ssi.c
index 6e5e346303304ef930d676f3635fa28d190d31b8..ac58d259705e24e96983376fd32b593397754422 100644 (file)
@@ -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);
similarity index 94%
rename from arch/i386/cpu/sc520/sc520_timer.c
rename to arch/x86/cpu/sc520/sc520_timer.c
index d5617e91f6e154a1360f2a6a850e022a8df0aa66..1bcfe67c947e28c70d5188e5ab251f4b2365689f 100644 (file)
@@ -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>
similarity index 84%
rename from arch/i386/cpu/start.S
rename to arch/x86/cpu/start.S
index 00313897ce8517da4288e2870a4c97593ed48adb..7ccc076fec04b9f9cda074a11412ec645e1ed62a 100644 (file)
@@ -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.
  * 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
similarity index 93%
rename from arch/i386/cpu/start16.S
rename to arch/x86/cpu/start16.S
index 7dc53583662509b5a63704e7089f488709e3638d..f1b9d0a0c9719f0c9946bc4243c43802a529323d 100644 (file)
@@ -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.
similarity index 90%
rename from arch/i386/cpu/u-boot.lds
rename to arch/x86/cpu/u-boot.lds
index 98a548d62eb630e179e9598fee1cbf0f0ce2201a..55974228b50b257817ef4863fc5d75f8abad2c22 100644 (file)
@@ -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)); }
 }
similarity index 95%
rename from arch/i386/include/asm/interrupt.h
rename to arch/x86/include/asm/interrupt.h
index d32ef8b190ef22c606e7fa951ef3cd21393dc780..be52fe40d0716f841b25892903124edeae466e19 100644 (file)
 
 #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);
 
similarity index 93%
rename from arch/i386/include/asm/u-boot-i386.h
rename to arch/x86/include/asm/u-boot-x86.h
index 7b39bd2ae01acd679a1ec11702819f1df4810606..944e1a20057a7b80c9e7757670e90aff5ea2691c 100644 (file)
@@ -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);
 
similarity index 100%
rename from arch/i386/lib/Makefile
rename to arch/x86/lib/Makefile
similarity index 99%
rename from arch/i386/lib/bios.S
rename to arch/x86/lib/bios.S
index 48f1b81122272a5c92208629c49100b059e3db41..660a24439474463e08a2ac47c6e2ae6800cfadfe 100644 (file)
@@ -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
similarity index 81%
rename from arch/i386/lib/bios.h
rename to arch/x86/lib/bios.h
index 4901f8917a231c0af8a0ab5e1b059294b0e2a30f..3c8d61a6f4511cbad0eba6645b7262b2499ee7bf 100644 (file)
@@ -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     */
        /* 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
similarity index 99%
rename from arch/i386/lib/bios_setup.c
rename to arch/x86/lib/bios_setup.c
index 75407c173cf162cb8c42c443c5e6a4d29c23b8d0..6949b35069b9c8b2b5677903bff1d83473ede4e7 100644 (file)
@@ -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:
  *----------------------------------------------------------------------
similarity index 95%
rename from arch/i386/lib/board.c
rename to arch/x86/lib/board.c
index e0f9803e5e8d9badec62c6ce355f8111307b9ab8..df54222211ad1ad098e36a27a9a2ced78006c1ad 100644 (file)
@@ -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();
similarity index 86%
rename from arch/i386/lib/bootm.c
rename to arch/x86/lib/bootm.c
index b36e58d9ec679f6e30df50af3f6b9579678317d5..a21a21f1f7f9fb0c1106884e17d42121211090d0 100644 (file)
@@ -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>
similarity index 88%
rename from arch/i386/lib/interrupts.c
rename to arch/x86/lib/interrupts.c
index 5a282782809e4e53480747166a4ff226d38cd31b..a2c598f9a4f7d129257874abdf7973f546c833df 100644 (file)
@@ -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.
 
 /*
  * 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
  */
 
similarity index 96%
rename from arch/i386/lib/pcat_interrupts.c
rename to arch/x86/lib/pcat_interrupts.c
index 67e6e97e35eb77587df6817425daa7e5f4f97ab8..364c4358378cc3153777f4b2910f3a033f32bdad 100644 (file)
@@ -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.
similarity index 97%
rename from arch/i386/lib/pcat_timer.c
rename to arch/x86/lib/pcat_timer.c
index 1373fd125c81d1f792788ebf8ba837cf4dc9fee1..1911c6c19d24365393420b271d3a51e0b71adef3 100644 (file)
@@ -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.
similarity index 94%
rename from arch/i386/lib/pci.c
rename to arch/x86/lib/pci.c
index 9020e7ce7646df66ab777244cffb59f57ef9efb1..e791e88bd421107adbbd28112a5bb09c96f3d5f8 100644 (file)
@@ -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);
similarity index 61%
rename from arch/i386/lib/pci_type1.c
rename to arch/x86/lib/pci_type1.c
index 225ae4a990923b3dfa127ac34e34e41b0f70cf81..8ce5b33e3d235c115291634ea014a979445b8140 100644 (file)
@@ -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>
similarity index 95%
rename from arch/i386/lib/realmode.c
rename to arch/x86/lib/realmode.c
index 2dda95b064d38d693fd6233f684bd7b4e2805784..5be827c66b124d1d0520a747599a9b19b89d32c9 100644 (file)
@@ -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.
 #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;
similarity index 99%
rename from arch/i386/lib/realmode_switch.S
rename to arch/x86/lib/realmode_switch.S
index d6c74ecd79b4cea61a5e5b391441b6a11cf512f2..fce4eccab01e71671efc980a07f4b594fab1cf4d 100644 (file)
@@ -21,7 +21,6 @@
  * MA 02111-1307 USA
  */
 
-
 /* 32bit -> 16bit -> 32bit mode switch code */
 
 /*
similarity index 94%
rename from arch/i386/lib/timer.c
rename to arch/x86/lib/timer.c
index 5cb1f54fb5628616622a93f659992b5afeb6ae74..8fc68cdcb899a72b87e8b8aec4f26c1f92860a32 100644 (file)
@@ -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.
similarity index 86%
rename from arch/i386/lib/video.c
rename to arch/x86/lib/video.c
index c58ed104cc8a3129a083312b06c9528f96c9d09b..b29075c490a48ce14e3c3c485fdb21bbcc198172 100644 (file)
@@ -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();
 }
similarity index 99%
rename from arch/i386/lib/video_bios.c
rename to arch/x86/lib/video_bios.c
index c8060e60a7766e50b272d206afea7bbd7b418174..6bc4335743572f0bb11a1a5abb6fdcab59a2cd6a 100644 (file)
@@ -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.
similarity index 98%
rename from arch/i386/lib/zimage.c
rename to arch/x86/lib/zimage.c
index 0c420726912c120b5a263b7e3b3c165d5af601e6..cc4b40e64c9d2f836e8208336ec9a7fdd6a1ec9e 100644 (file)
@@ -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
index 45206ca3bd1de0f9acf20fc99592ebc92ff00700..5aaf6b309d8eda7be637e2b352af588d727418fa 100644 (file)
@@ -67,13 +67,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 3e7853a2a07a3a3f10536514826b8fe705381e27..838537375b3fefd55c8cb2359787b2553282d3fb 100644 (file)
@@ -52,13 +52,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 661a94ab153f951664682317e0305014399d3f18..a7627699e76f04cd15cf086b55b28b2aec0465e5 100644 (file)
@@ -43,13 +43,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
 
   .data    :
index 57fe1d9ce0861397db3d28672c0d1a8322316877..cd8f5cebab5a6b88a82ede61525587f24d9cadf3 100644 (file)
@@ -49,13 +49,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 524c36eb4b490d8f8d82e3d07a1284d7af384c3f..b9b8e3c727420129f506cac912430025c8f78756 100644 (file)
@@ -55,13 +55,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index e324f5c1e66ce12208383de78af0ce3157054140..2393d8d8af67d02e351d843cd2f31483048561d0 100644 (file)
@@ -51,13 +51,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 20c32b73e3cb6a8925a025a6bc7fd0aacd966889..3b1011435405e3ff2dfe96aa7912248349b6e91b 100644 (file)
@@ -55,9 +55,10 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
diff --git a/board/eNET/config.mk b/board/eNET/config.mk
deleted file mode 100644 (file)
index 9d2dfa5..0000000
+++ /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
index dd0ce545163ae33c7fea51009a4b9eae370cefa3..2a5636c0737360bbbac273b2e2a7c41057988202 100644 (file)
@@ -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);
index fefb1a4fbeb1efdbe4129f5e482c68d3b2f56165..a03090e54061ad15748cb4a0072fbbad5b5a933f 100644 (file)
@@ -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>
index 2fac727b84f6933997ccffe91eed55c185098cf6..fd4e8a50d543a62df0422cdb6c30af81e7cd8752 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 32dcbd3ef51304fa9b27f7f60c0a9f837c75c318..fb066486633a8b184ccd5a503ee19a64169e5d43 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index e2dd1c20f2c4242309993664e8cd8f62a516564f..332b35a57d68bba3be2dd450bac71168348813ed 100644 (file)
@@ -43,9 +43,10 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
index 2bf60f5804a0cb670d39652b11a7772f7187d1cf..b15948d34c7d3a58d469171ab17005efd3bf856f 100644 (file)
@@ -54,13 +54,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 8455f0b9f4098b252d8a01c8ac92cdfa51b092ff..163b83d8199d0fc4941407c2760b711a3f823dc1 100644 (file)
@@ -56,13 +56,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 04233d86a1d3d824e22fb83a6a3dc43c552e213c..b68d9eadcc4deb380b5b75767948ccc1765ec374 100644 (file)
@@ -56,13 +56,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 0648f62feb8be65ba6b6048ee5d0d38062f7a103..2d031efc4e93fde4868428ff775c7fba6f65a9cb 100644 (file)
@@ -51,13 +51,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 63d0ea112100736defc502caa41d27b4c74fac0a..9ea0674b887a40b588821eb4c8082984a986c164 100644 (file)
@@ -49,13 +49,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 2fac727b84f6933997ccffe91eed55c185098cf6..fd4e8a50d543a62df0422cdb6c30af81e7cd8752 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 8e854db22d81f3a62637cd1dbbc23e8a68421ee0..be99b512088fc0a84425efcb73e7894dc79731b3 100644 (file)
@@ -52,13 +52,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 3e396e4fae75a711135ad6f7a0155490de582563..1d66a9b2bda15f129b7480b5d3a121c12f72ec87 100644 (file)
@@ -61,13 +61,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index d50c5865b175959174fcf316a7424772c123bb9d..ca9711575d31af81e7d6a07533bac77b389d8045 100644 (file)
@@ -53,13 +53,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 1592f4f6e8ceeb6a9c2c1c82fb97794298e9106f..1efa8b3237d35b54a24db68d378b04bbd1446813 100644 (file)
@@ -93,7 +93,7 @@ SECTIONS
     _FIXUP_TABLE_ = .;
     *(.fixup)
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index cb5afc113b804418c42f01bc4201012b40193622..93c79a64b4eddb5d8ef1865ac40f4086f3cf01ab 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index ff7012afbc230d766971babdef87464afd9a8dd1..1e843eb24ed300f6845cc4410e73649a97cb5f97 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 25e7a4def20fda10e7a21748122e32d7214f5bd0..de0b355a6287a6ecb69c62a62ec4cf22a4215cf7 100644 (file)
@@ -56,13 +56,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index d02db17ccb50d6b9c474aee5bf41bb139b5381a6..8bf7324f37a240d4c111c2d8690e5c84ff97261c 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 344cbde3b0774f77b21a03a5c7b7506dcb47d643..731cec9af70bc3d67f1942c885656ac9a6299832 100644 (file)
@@ -50,13 +50,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index f3d01e73f0450ad798b882dd01115309f42d861d..bf2ed0485212642c7c4aa0976df677144c7216bc 100644 (file)
@@ -55,9 +55,10 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 0f2593de89096db713ec0e19d19a157d25c240cf..9f9ddb8bf0166c617603c9ae80e21e6c79a09913 100644 (file)
@@ -44,13 +44,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index ef73e2b53ababd90b3c797bcadea44b75b4d9db8..dae2cfc7dae8b6dbd11b88ca2e851b52c72a639c 100644 (file)
@@ -41,13 +41,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
 
   .data    :
index 03ba15578bdd40738bd4c97a2d4c740dba6346b9..11624d21f5412c85461bf2530488fa5fc5d81e50 100644 (file)
@@ -51,13 +51,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
 
   .data    :
index b7b6c1aa14aeb286ad40d92c46a264f40a1225f1..a949e4f59201a000a805c9ae0746ca767246344d 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index b7b6c1aa14aeb286ad40d92c46a264f40a1225f1..a949e4f59201a000a805c9ae0746ca767246344d 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index b7b6c1aa14aeb286ad40d92c46a264f40a1225f1..a949e4f59201a000a805c9ae0746ca767246344d 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index b7b6c1aa14aeb286ad40d92c46a264f40a1225f1..a949e4f59201a000a805c9ae0746ca767246344d 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 2fac727b84f6933997ccffe91eed55c185098cf6..fd4e8a50d543a62df0422cdb6c30af81e7cd8752 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 60b3cbfaca2fd37d93e894c7e9ae5a8933da61e7..2fa085a3d9bf90698167952f0c514d41c82d6be9 100644 (file)
@@ -49,13 +49,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 7b790ab9fd570d961ea0a5caf6eadcf4782e388a..d943fb6de73860b15070fcfa27b593e0f7770e39 100644 (file)
@@ -58,13 +58,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index b36047ad5e8a5d4f7a982337e6c85846cdbe4724..81728db25c3118ca13d48d5a46731c38fc9cd1f4 100644 (file)
@@ -80,7 +80,7 @@ SECTIONS
     _FIXUP_TABLE_ = .;
     *(.fixup)
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 841a29b60c85ee7ad4af1df52a01f30f34d623ea..e382fd1a1e667de44ba416e0f03337d6de51da74 100644 (file)
@@ -49,13 +49,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
 
   .data    :
index 2cbbca50e5c87a7a6b1010624904c8f9f9ed98ab..4db46cacf2a76e9173432fed1701266ca3fed44b 100644 (file)
@@ -96,13 +96,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    *(.got)
     _GOT2_TABLE_ = .;
     *(.got2)
+    *(.got)
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     *(.fixup)
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 725bef8293c1768643ee15c8bc09278513583da8..0e78e4fd477ce6ca1fb69f620b407a8b6776fc24 100644 (file)
@@ -56,13 +56,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 2711f2c4087d396b167e53008c0ecdcb0fc26a7e..02d198001fd5d368ee8bff736aa624fe99ced201 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 007ae00f46e89e9cf9caa579e428b3d03cac1763..9ab248a4e97f8ad12f2aefcb165360d217935c34 100644 (file)
@@ -50,13 +50,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 05cc2338ab609f92188159a24abab86513ba4c22..d0b60cf7c1079f4642fb63a032b0e40d9f9d34b3 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 796c283b344cc56441b8874f0a3e36c059132fc7..950e1e6e2cb8af441c37015cab6392fc794ef77d 100644 (file)
@@ -57,13 +57,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index b7b6c1aa14aeb286ad40d92c46a264f40a1225f1..a949e4f59201a000a805c9ae0746ca767246344d 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index c4ce968735c403dbd303e6288585c14a793d5b08..c65f0228c3fd6f8e86b5e4164ced2476a9383d59 100644 (file)
@@ -63,13 +63,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 83a09b047168fd007cbf4c82f4d641205673e13f..f625c3dbdf3dfd7200c87e440279c52bfcafe982 100644 (file)
@@ -63,13 +63,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 578a49b04bc640f7b094c462399c1b6ff3f46569..e62d53db54fa048d4c0966f06dde05b6bbfb29f5 100644 (file)
@@ -47,13 +47,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index 3514a66d6872fe5438db7c6d72f98eef5f0edff1..3470b437e82583a8e7b39f62451c357d488585d7 100644 (file)
@@ -56,13 +56,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_)>>2;
 
   .data    :
index a45bd83a1556745e8443ab82ccbb6094566d952a..554e06c1211850f3803967254e5db032e7e6cc9c 100644 (file)
@@ -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
index 432a9de42d18a298a45e0854dd5c0ce2afb334e3..4fb050eb58e235787a5f4fc6c741a51a456f153a 100644 (file)
@@ -120,6 +120,7 @@ COBJS-$(CONFIG_CMD_MII) += miiphyutil.o
 COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
 COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
 COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
+COBJS-$(CONFIG_CMD_MMC_SPI) += cmd_mmc_spi.o
 COBJS-$(CONFIG_MP) += cmd_mp.o
 COBJS-$(CONFIG_CMD_MTDPARTS) += cmd_mtdparts.o
 COBJS-$(CONFIG_CMD_NAND) += cmd_nand.o
index 4323f76b30549cb0a83b19c8c95b755259d2af14..6166749ad5a5c81d85585bae5976bcfdc97a6681 100644 (file)
@@ -104,7 +104,8 @@ static void print_mmcinfo(struct mmc *mmc)
                        (mmc->version >> 4) & 0xf, mmc->version & 0xf);
 
        printf("High Capacity: %s\n", mmc->high_capacity ? "Yes" : "No");
-       printf("Capacity: %lld\n", mmc->capacity);
+       puts("Capacity: ");
+       print_size(mmc->capacity, "\n");
 
        printf("Bus Width: %d-bit\n", mmc->bus_width);
 }
diff --git a/common/cmd_mmc_spi.c b/common/cmd_mmc_spi.c
new file mode 100644 (file)
index 0000000..63fe313
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * Command for mmc_spi setup.
+ *
+ * Copyright (C) 2010 Thomas Chou <thomas@wytron.com.tw>
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <common.h>
+#include <mmc.h>
+#include <spi.h>
+
+#ifndef CONFIG_MMC_SPI_BUS
+# define CONFIG_MMC_SPI_BUS 0
+#endif
+#ifndef CONFIG_MMC_SPI_CS
+# define CONFIG_MMC_SPI_CS 1
+#endif
+/* in SPI mode, MMC speed limit is 20MHz, while SD speed limit is 25MHz */
+#ifndef CONFIG_MMC_SPI_SPEED
+# define CONFIG_MMC_SPI_SPEED 25000000
+#endif
+/* MMC and SD specs only seem to care that sampling is on the
+ * rising edge ... meaning SPI modes 0 or 3.  So either SPI mode
+ * should be legit.  We'll use mode 0 since the steady state is 0,
+ * which is appropriate for hotplugging, unless the platform data
+ * specify mode 3 (if hardware is not compatible to mode 0).
+ */
+#ifndef CONFIG_MMC_SPI_MODE
+# define CONFIG_MMC_SPI_MODE SPI_MODE_0
+#endif
+
+static int do_mmc_spi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+       uint bus = CONFIG_MMC_SPI_BUS;
+       uint cs = CONFIG_MMC_SPI_CS;
+       uint speed = CONFIG_MMC_SPI_SPEED;
+       uint mode = CONFIG_MMC_SPI_MODE;
+       char *endp;
+       struct mmc *mmc;
+
+       if (argc < 2)
+               goto usage;
+
+       cs = simple_strtoul(argv[1], &endp, 0);
+       if (*argv[1] == 0 || (*endp != 0 && *endp != ':'))
+               goto usage;
+       if (*endp == ':') {
+               if (endp[1] == 0)
+                       goto usage;
+               bus = cs;
+               cs = simple_strtoul(endp + 1, &endp, 0);
+               if (*endp != 0)
+                       goto usage;
+       }
+       if (argc >= 3) {
+               speed = simple_strtoul(argv[2], &endp, 0);
+               if (*argv[2] == 0 || *endp != 0)
+                       goto usage;
+       }
+       if (argc >= 4) {
+               mode = simple_strtoul(argv[3], &endp, 16);
+               if (*argv[3] == 0 || *endp != 0)
+                       goto usage;
+       }
+       if (!spi_cs_is_valid(bus, cs)) {
+               printf("Invalid SPI bus %u cs %u\n", bus, cs);
+               return 1;
+       }
+
+       mmc = mmc_spi_init(bus, cs, speed, mode);
+       if (!mmc) {
+               printf("Failed to create MMC Device\n");
+               return 1;
+       }
+       printf("%s: %d at %u:%u hz %u mode %u\n", mmc->name, mmc->block_dev.dev,
+              bus, cs, speed, mode);
+       return 0;
+
+usage:
+       cmd_usage(cmdtp);
+       return 1;
+}
+
+U_BOOT_CMD(
+       mmc_spi,        4,      0,      do_mmc_spi,
+       "mmc_spi setup",
+       "[bus:]cs [hz] [mode]   - setup mmc_spi device"
+);
index 6e7be818ebe8cae981d2cfe2f68991dfac20603c..11a491df769fc81206d9dfe82584b443e468c029 100644 (file)
 
 static struct spi_flash *flash;
 
+
+/*
+ * This function computes the length argument for the erase command.
+ * The length on which the command is to operate can be given in two forms:
+ * 1. <cmd> offset len  - operate on <'offset',  'len')
+ * 2. <cmd> offset +len - operate on <'offset',  'round_up(len)')
+ * If the second form is used and the length doesn't fall on the
+ * sector boundary, than it will be adjusted to the next sector boundary.
+ * If it isn't in the flash, the function will fail (return -1).
+ * Input:
+ *    arg: length specification (i.e. both command arguments)
+ * Output:
+ *    len: computed length for operation
+ * Return:
+ *    1: success
+ *   -1: failure (bad format, bad address).
+ */
+static int sf_parse_len_arg(char *arg, ulong *len)
+{
+       char *ep;
+       char round_up_len; /* indicates if the "+length" form used */
+       ulong len_arg;
+
+       round_up_len = 0;
+       if (*arg == '+') {
+               round_up_len = 1;
+               ++arg;
+       }
+
+       len_arg = simple_strtoul(arg, &ep, 16);
+       if (ep == arg || *ep != '\0')
+               return -1;
+
+       if (round_up_len && flash->sector_size > 0)
+               *len = ROUND(len_arg - 1, flash->sector_size);
+       else
+               *len = len_arg;
+
+       return 1;
+}
+
 static int do_spi_flash_probe(int argc, char * const argv[])
 {
        unsigned int bus = 0;
@@ -29,30 +70,30 @@ static int do_spi_flash_probe(int argc, char * const argv[])
        struct spi_flash *new;
 
        if (argc < 2)
-               goto usage;
+               return -1;
 
        cs = simple_strtoul(argv[1], &endp, 0);
        if (*argv[1] == 0 || (*endp != 0 && *endp != ':'))
-               goto usage;
+               return -1;
        if (*endp == ':') {
                if (endp[1] == 0)
-                       goto usage;
+                       return -1;
 
                bus = cs;
                cs = simple_strtoul(endp + 1, &endp, 0);
                if (*endp != 0)
-                       goto usage;
+                       return -1;
        }
 
        if (argc >= 3) {
                speed = simple_strtoul(argv[2], &endp, 0);
                if (*argv[2] == 0 || *endp != 0)
-                       goto usage;
+                       return -1;
        }
        if (argc >= 4) {
                mode = simple_strtoul(argv[3], &endp, 16);
                if (*argv[3] == 0 || *endp != 0)
-                       goto usage;
+                       return -1;
        }
 
        new = spi_flash_probe(bus, cs, speed, mode);
@@ -65,14 +106,7 @@ static int do_spi_flash_probe(int argc, char * const argv[])
                spi_flash_free(flash);
        flash = new;
 
-       printf("%u KiB %s at %u:%u is now current device\n",
-                       flash->size >> 10, flash->name, bus, cs);
-
        return 0;
-
-usage:
-       puts("Usage: sf probe [bus:]cs [hz] [mode]\n");
-       return 1;
 }
 
 static int do_spi_flash_read_write(int argc, char * const argv[])
@@ -85,17 +119,17 @@ static int do_spi_flash_read_write(int argc, char * const argv[])
        int ret;
 
        if (argc < 4)
-               goto usage;
+               return -1;
 
        addr = simple_strtoul(argv[1], &endp, 16);
        if (*argv[1] == 0 || *endp != 0)
-               goto usage;
+               return -1;
        offset = simple_strtoul(argv[2], &endp, 16);
        if (*argv[2] == 0 || *endp != 0)
-               goto usage;
+               return -1;
        len = simple_strtoul(argv[3], &endp, 16);
        if (*argv[3] == 0 || *endp != 0)
-               goto usage;
+               return -1;
 
        buf = map_physmem(addr, len, MAP_WRBACK);
        if (!buf) {
@@ -116,10 +150,6 @@ static int do_spi_flash_read_write(int argc, char * const argv[])
        }
 
        return 0;
-
-usage:
-       printf("Usage: sf %s addr offset len\n", argv[0]);
-       return 1;
 }
 
 static int do_spi_flash_erase(int argc, char * const argv[])
@@ -130,14 +160,15 @@ static int do_spi_flash_erase(int argc, char * const argv[])
        int ret;
 
        if (argc < 3)
-               goto usage;
+               return -1;
 
        offset = simple_strtoul(argv[1], &endp, 16);
        if (*argv[1] == 0 || *endp != 0)
-               goto usage;
-       len = simple_strtoul(argv[2], &endp, 16);
-       if (*argv[2] == 0 || *endp != 0)
-               goto usage;
+               return -1;
+
+       ret = sf_parse_len_arg(argv[2], &len);
+       if (ret != 1)
+               return -1;
 
        ret = spi_flash_erase(flash, offset, len);
        if (ret) {
@@ -146,24 +177,25 @@ static int do_spi_flash_erase(int argc, char * const argv[])
        }
 
        return 0;
-
-usage:
-       puts("Usage: sf erase offset len\n");
-       return 1;
 }
 
 static int do_spi_flash(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        const char *cmd;
+       int ret;
 
        /* need at least two arguments */
        if (argc < 2)
                goto usage;
 
        cmd = argv[1];
+       --argc;
+       ++argv;
 
-       if (strcmp(cmd, "probe") == 0)
-               return do_spi_flash_probe(argc - 1, argv + 1);
+       if (strcmp(cmd, "probe") == 0) {
+               ret = do_spi_flash_probe(argc, argv);
+               goto done;
+       }
 
        /* The remaining commands require a selected device */
        if (!flash) {
@@ -172,9 +204,15 @@ static int do_spi_flash(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[
        }
 
        if (strcmp(cmd, "read") == 0 || strcmp(cmd, "write") == 0)
-               return do_spi_flash_read_write(argc - 1, argv + 1);
-       if (strcmp(cmd, "erase") == 0)
-               return do_spi_flash_erase(argc - 1, argv + 1);
+               ret = do_spi_flash_read_write(argc, argv);
+       else if (strcmp(cmd, "erase") == 0)
+               ret = do_spi_flash_erase(argc, argv);
+       else
+               ret = -1;
+
+done:
+       if (ret != -1)
+               return ret;
 
 usage:
        return cmd_usage(cmdtp);
@@ -189,5 +227,6 @@ U_BOOT_CMD(
        "                                 `offset' to memory at `addr'\n"
        "sf write addr offset len       - write `len' bytes from memory\n"
        "                                 at `addr' to flash at `offset'\n"
-       "sf erase offset len            - erase `len' bytes from `offset'"
+       "sf erase offset [+]len         - erase `len' bytes from `offset'\n"
+       "                                 `+len' round up `len' to block size"
 );
index 3dff7351bc3d3a5204d4fde0cdeb5d16b28d4bc9..717e4afe6d877eca2f5c62e5bcd145cac97f9537 100644 (file)
@@ -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 */
index 6c98e5b07a47269789935160ff8912da21bd034c..edcf04a21b7353b494e418de0deadd1e54aeeb7e 100644 (file)
@@ -394,7 +394,7 @@ int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks)
 {
        int err, nodeoffset;
        int addr_cell_len, size_cell_len, len;
-       u8 tmp[banks * 8];
+       u8 tmp[banks * 16]; /* Up to 64-bit address + 64-bit size */
        int bank;
 
        err = fdt_check_header(blob);
diff --git a/doc/README-i386 b/doc/README-i386
deleted file mode 100644 (file)
index c560d22..0000000
+++ /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 (file)
index 9b6c5d4..0000000
+++ /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?
index 215be3419d1b58326ee5a38a16bb7261c76e2a88..71251d8007f6bb89e35be1ffdc92dc4ef8f87eb6 100644 (file)
@@ -321,43 +321,23 @@ int i2c_probe (uchar chip)
        /* wait until bus not busy */
        wait_for_bb ();
 
-       /* try to read one byte */
+       /* try to write one byte */
        writew (1, &i2c_base->cnt);
        /* set slave address */
        writew (chip, &i2c_base->sa);
        /* stop bit needed here */
-       writew (I2C_CON_EN | I2C_CON_MST | I2C_CON_STT | I2C_CON_STP, &i2c_base->con);
+       writew(I2C_CON_EN | I2C_CON_MST | I2C_CON_STT | I2C_CON_TRX |
+              I2C_CON_STP, &i2c_base->con);
 
-       while (1) {
-               status = wait_for_pin();
-               if (status == 0 || status & I2C_STAT_AL) {
-                       res = 1;
-                       goto probe_exit;
-               }
-               if (status & I2C_STAT_NACK) {
-                       res = 1;
-                       writew(0xff, &i2c_base->stat);
-                       writew (readw (&i2c_base->con) | I2C_CON_STP, &i2c_base->con);
-                       wait_for_bb ();
-                       break;
-               }
-               if (status & I2C_STAT_ARDY) {
-                       writew(I2C_STAT_ARDY, &i2c_base->stat);
-                       break;
-               }
-               if (status & I2C_STAT_RRDY) {
-                       res = 0;
-#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
-    defined(CONFIG_OMAP44XX)
-                       readb(&i2c_base->data);
-#else
-                       readw(&i2c_base->data);
-#endif
-                       writew(I2C_STAT_RRDY, &i2c_base->stat);
-               }
-       }
+       status = wait_for_pin();
+
+       /* check for ACK (!NAK) */
+       if (!(status & I2C_STAT_NACK))
+               res = 0;
+
+       /* abort transfer (force idle state) */
+       writew(0, &i2c_base->con);
 
-probe_exit:
        flush_fifo();
        writew (0, &i2c_base->cnt); /* don't allow any more data in...we don't want it.*/
        writew(0xFFFF, &i2c_base->stat);
index 3496f0aa0feea3bf649f3904d8ac52690fbcb3db..9aca3a2bd6c1fb319edc45b54e138c0d16e75942 100644 (file)
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_DAVINCI_MMC) += davinci_mmc.o
 COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o
 COBJS-$(CONFIG_GENERIC_MMC) += mmc.o
 COBJS-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o
+COBJS-$(CONFIG_MMC_SPI) += mmc_spi.o
 COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o
 COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o
 COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
index 4f1b5150c942b7d64d435c677a58aed75cfef051..2838795febf9111f92aed0b7b4b7224e5296a5bc 100644 (file)
@@ -332,11 +332,11 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
                do {
                        irqstat = esdhc_read32(&regs->irqstat);
 
-                       if (irqstat & DATA_ERR)
-                               return COMM_ERR;
-
                        if (irqstat & IRQSTAT_DTOE)
                                return TIMEOUT;
+
+                       if (irqstat & DATA_ERR)
+                               return COMM_ERR;
                } while (!(irqstat & IRQSTAT_TC) &&
                                (esdhc_read32(&regs->prsstat) & PRSSTAT_DLA));
 #endif
index 6805b33f7a13285256c3a71f363e08fdb03d0199..f27b7c79e50e310fc047fbcbf6e4bd19bb03698c 100644 (file)
 #include <part.h>
 #include <malloc.h>
 #include <linux/list.h>
-#include <mmc.h>
 #include <div64.h>
 
+/* Set block count limit because of 16 bit register limit on some hardware*/
+#ifndef CONFIG_SYS_MMC_MAX_BLK_COUNT
+#define CONFIG_SYS_MMC_MAX_BLK_COUNT 65535
+#endif
+
 static struct list_head mmc_devices;
 static int cur_dev_num = -1;
 
@@ -45,7 +49,100 @@ int board_mmc_getcd(u8 *cd, struct mmc *mmc)__attribute__((weak,
 
 int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
 {
+#ifdef CONFIG_MMC_TRACE
+       int ret;
+       int i;
+       u8 *ptr;
+
+       printf("CMD_SEND:%d\n", cmd->cmdidx);
+       printf("\t\tARG\t\t\t 0x%08X\n", cmd->cmdarg);
+       printf("\t\tFLAG\t\t\t %d\n", cmd->flags);
+       ret = mmc->send_cmd(mmc, cmd, data);
+       switch (cmd->resp_type) {
+               case MMC_RSP_NONE:
+                       printf("\t\tMMC_RSP_NONE\n");
+                       break;
+               case MMC_RSP_R1:
+                       printf("\t\tMMC_RSP_R1,5,6,7 \t 0x%08X \n",
+                               cmd->response[0]);
+                       break;
+               case MMC_RSP_R1b:
+                       printf("\t\tMMC_RSP_R1b\t\t 0x%08X \n",
+                               cmd->response[0]);
+                       break;
+               case MMC_RSP_R2:
+                       printf("\t\tMMC_RSP_R2\t\t 0x%08X \n",
+                               cmd->response[0]);
+                       printf("\t\t          \t\t 0x%08X \n",
+                               cmd->response[1]);
+                       printf("\t\t          \t\t 0x%08X \n",
+                               cmd->response[2]);
+                       printf("\t\t          \t\t 0x%08X \n",
+                               cmd->response[3]);
+                       printf("\n");
+                       printf("\t\t\t\t\tDUMPING DATA\n");
+                       for (i = 0; i < 4; i++) {
+                               int j;
+                               printf("\t\t\t\t\t%03d - ", i*4);
+                               ptr = &cmd->response[i];
+                               ptr += 3;
+                               for (j = 0; j < 4; j++)
+                                       printf("%02X ", *ptr--);
+                               printf("\n");
+                       }
+                       break;
+               case MMC_RSP_R3:
+                       printf("\t\tMMC_RSP_R3,4\t\t 0x%08X \n",
+                               cmd->response[0]);
+                       break;
+               default:
+                       printf("\t\tERROR MMC rsp not supported\n");
+                       break;
+       }
+       return ret;
+#else
        return mmc->send_cmd(mmc, cmd, data);
+#endif
+}
+
+int mmc_send_status(struct mmc *mmc, int timeout)
+{
+       struct mmc_cmd cmd;
+       int err;
+#ifdef CONFIG_MMC_TRACE
+       int status;
+#endif
+
+       cmd.cmdidx = MMC_CMD_SEND_STATUS;
+       cmd.resp_type = MMC_RSP_R1;
+       cmd.cmdarg = 0;
+       cmd.flags = 0;
+
+       do {
+               err = mmc_send_cmd(mmc, &cmd, NULL);
+               if (err)
+                       return err;
+               else if (cmd.response[0] & MMC_STATUS_RDY_FOR_DATA)
+                       break;
+
+               udelay(1000);
+
+               if (cmd.response[0] & MMC_STATUS_MASK) {
+                       printf("Status Error: 0x%08X\n", cmd.response[0]);
+                       return COMM_ERR;
+               }
+       } while (timeout--);
+
+#ifdef CONFIG_MMC_TRACE
+       status = (cmd.response[0] & MMC_STATUS_CURR_STATE) >> 9;
+       printf("CURR STATE:%d\n", status);
+#endif
+       if (!timeout) {
+               printf("Timeout waiting card ready\n");
+               return TIMEOUT;
+       }
+
+       return 0;
 }
 
 int mmc_set_blocklen(struct mmc *mmc, int len)
@@ -82,6 +179,7 @@ mmc_write_blocks(struct mmc *mmc, ulong start, lbaint_t blkcnt, const void*src)
 {
        struct mmc_cmd cmd;
        struct mmc_data data;
+       int timeout = 1000;
 
        if ((start + blkcnt) > mmc->block_dev.lba) {
                printf("MMC: block number 0x%lx exceeds max(0x%lx)\n",
@@ -112,7 +210,10 @@ mmc_write_blocks(struct mmc *mmc, ulong start, lbaint_t blkcnt, const void*src)
                return 0;
        }
 
-       if (blkcnt > 1) {
+       /* SPI multiblock writes terminate using a special
+        * token, not a STOP_TRANSMISSION request.
+        */
+       if (!mmc_host_is_spi(mmc) && blkcnt > 1) {
                cmd.cmdidx = MMC_CMD_STOP_TRANSMISSION;
                cmd.cmdarg = 0;
                cmd.resp_type = MMC_RSP_R1b;
@@ -121,6 +222,9 @@ mmc_write_blocks(struct mmc *mmc, ulong start, lbaint_t blkcnt, const void*src)
                        printf("mmc fail to send stop cmd\n");
                        return 0;
                }
+
+               /* Waiting for the ready status */
+               mmc_send_status(mmc, timeout);
        }
 
        return blkcnt;
@@ -139,11 +243,8 @@ mmc_bwrite(int dev_num, ulong start, lbaint_t blkcnt, const void*src)
                return 0;
 
        do {
-               /*
-                * The 65535 constraint comes from some hardware has
-                * only 16 bit width block number counter
-                */
-               cur = (blocks_todo > 65535) ? 65535 : blocks_todo;
+               cur = (blocks_todo > CONFIG_SYS_MMC_MAX_BLK_COUNT) ?
+                      CONFIG_SYS_MMC_MAX_BLK_COUNT : blocks_todo;
                if(mmc_write_blocks(mmc, start, cur, src) != cur)
                        return 0;
                blocks_todo -= cur;
@@ -158,6 +259,7 @@ int mmc_read_blocks(struct mmc *mmc, void *dst, ulong start, lbaint_t blkcnt)
 {
        struct mmc_cmd cmd;
        struct mmc_data data;
+       int timeout = 1000;
 
        if (blkcnt > 1)
                cmd.cmdidx = MMC_CMD_READ_MULTIPLE_BLOCK;
@@ -189,6 +291,9 @@ int mmc_read_blocks(struct mmc *mmc, void *dst, ulong start, lbaint_t blkcnt)
                        printf("mmc fail to send stop cmd\n");
                        return 0;
                }
+
+               /* Waiting for the ready status */
+               mmc_send_status(mmc, timeout);
        }
 
        return blkcnt;
@@ -215,11 +320,8 @@ static ulong mmc_bread(int dev_num, ulong start, lbaint_t blkcnt, void *dst)
                return 0;
 
        do {
-               /*
-                * The 65535 constraint comes from some hardware has
-                * only 16 bit width block number counter
-                */
-               cur = (blocks_todo > 65535) ? 65535 : blocks_todo;
+               cur = (blocks_todo > CONFIG_SYS_MMC_MAX_BLK_COUNT) ?
+                      CONFIG_SYS_MMC_MAX_BLK_COUNT : blocks_todo;
                if(mmc_read_blocks(mmc, dst, start, cur) != cur)
                        return 0;
                blocks_todo -= cur;
@@ -280,7 +382,8 @@ sd_send_op_cond(struct mmc *mmc)
                 * how to manage low voltages SD card is not yet
                 * specified.
                 */
-               cmd.cmdarg = mmc->voltages & 0xff8000;
+               cmd.cmdarg = mmc_host_is_spi(mmc) ? 0 :
+                       (mmc->voltages & 0xff8000);
 
                if (mmc->version == SD_VERSION_2)
                        cmd.cmdarg |= OCR_HCS;
@@ -299,6 +402,18 @@ sd_send_op_cond(struct mmc *mmc)
        if (mmc->version != SD_VERSION_2)
                mmc->version = SD_VERSION_1_0;
 
+       if (mmc_host_is_spi(mmc)) { /* read OCR for spi */
+               cmd.cmdidx = MMC_CMD_SPI_READ_OCR;
+               cmd.resp_type = MMC_RSP_R3;
+               cmd.cmdarg = 0;
+               cmd.flags = 0;
+
+               err = mmc_send_cmd(mmc, &cmd, NULL);
+
+               if (err)
+                       return err;
+       }
+
        mmc->ocr = cmd.response[0];
 
        mmc->high_capacity = ((mmc->ocr & OCR_HCS) == OCR_HCS);
@@ -309,17 +424,33 @@ sd_send_op_cond(struct mmc *mmc)
 
 int mmc_send_op_cond(struct mmc *mmc)
 {
-       int timeout = 1000;
+       int timeout = 10000;
        struct mmc_cmd cmd;
        int err;
 
        /* Some cards seem to need this */
        mmc_go_idle(mmc);
 
+       /* Asking to the card its capabilities */
+       cmd.cmdidx = MMC_CMD_SEND_OP_COND;
+       cmd.resp_type = MMC_RSP_R3;
+       cmd.cmdarg = 0;
+       cmd.flags = 0;
+       err = mmc_send_cmd(mmc, &cmd, NULL);
+       if (err)
+               return err;
+       udelay(1000);
        do {
                cmd.cmdidx = MMC_CMD_SEND_OP_COND;
                cmd.resp_type = MMC_RSP_R3;
-               cmd.cmdarg = OCR_HCS | mmc->voltages;
+               cmd.cmdarg = (mmc_host_is_spi(mmc) ? 0 :
+                               (mmc->voltages &
+                               (cmd.response[0] & OCR_VOLTAGE_MASK)) |
+                               (cmd.response[0] & OCR_ACCESS_MODE));
                cmd.flags = 0;
 
                err = mmc_send_cmd(mmc, &cmd, NULL);
@@ -333,6 +464,18 @@ int mmc_send_op_cond(struct mmc *mmc)
        if (timeout <= 0)
                return UNUSABLE_ERR;
 
+       if (mmc_host_is_spi(mmc)) { /* read OCR for spi */
+               cmd.cmdidx = MMC_CMD_SPI_READ_OCR;
+               cmd.resp_type = MMC_RSP_R3;
+               cmd.cmdarg = 0;
+               cmd.flags = 0;
+
+               err = mmc_send_cmd(mmc, &cmd, NULL);
+
+               if (err)
+                       return err;
+       }
+
        mmc->version = MMC_VERSION_UNKNOWN;
        mmc->ocr = cmd.response[0];
 
@@ -369,15 +512,23 @@ int mmc_send_ext_csd(struct mmc *mmc, char *ext_csd)
 int mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value)
 {
        struct mmc_cmd cmd;
+       int timeout = 1000;
+       int ret;
 
        cmd.cmdidx = MMC_CMD_SWITCH;
        cmd.resp_type = MMC_RSP_R1b;
        cmd.cmdarg = (MMC_SWITCH_MODE_WRITE_BYTE << 24) |
-               (index << 16) |
-               (value << 8);
+                                (index << 16) |
+                                (value << 8);
        cmd.flags = 0;
 
-       return mmc_send_cmd(mmc, &cmd, NULL);
+       ret = mmc_send_cmd(mmc, &cmd, NULL);
+
+       /* Waiting for the ready status */
+       mmc_send_status(mmc, timeout);
+
+       return ret;
+
 }
 
 int mmc_change_freq(struct mmc *mmc)
@@ -388,6 +539,9 @@ int mmc_change_freq(struct mmc *mmc)
 
        mmc->card_caps = 0;
 
+       if (mmc_host_is_spi(mmc))
+               return 0;
+
        /* Only version 4 supports high-speed */
        if (mmc->version < MMC_VERSION_4)
                return 0;
@@ -399,9 +553,6 @@ int mmc_change_freq(struct mmc *mmc)
        if (err)
                return err;
 
-       if (ext_csd[212] || ext_csd[213] || ext_csd[214] || ext_csd[215])
-               mmc->high_capacity = 1;
-
        cardtype = ext_csd[196] & 0xf;
 
        err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HS_TIMING, 1);
@@ -461,6 +612,9 @@ int sd_change_freq(struct mmc *mmc)
 
        mmc->card_caps = 0;
 
+       if (mmc_host_is_spi(mmc))
+               return 0;
+
        /* Read the SCR to find out if this card supports higher speeds */
        cmd.cmdidx = MMC_CMD_APP_CMD;
        cmd.resp_type = MMC_RSP_R1;
@@ -512,6 +666,9 @@ retry_scr:
                        break;
        }
 
+       if (mmc->scr[0] & SD_DATA_4BIT)
+               mmc->card_caps |= MMC_MODE_4BIT;
+
        /* Version 1.0 doesn't support switching */
        if (mmc->version == SD_VERSION_1_0)
                return 0;
@@ -529,9 +686,6 @@ retry_scr:
                        break;
        }
 
-       if (mmc->scr[0] & SD_DATA_4BIT)
-               mmc->card_caps |= MMC_MODE_4BIT;
-
        /* If high-speed isn't supported, we return */
        if (!(__be32_to_cpu(switch_status[3]) & SD_HIGHSPEED_SUPPORTED))
                return 0;
@@ -549,7 +703,7 @@ retry_scr:
 
 /* frequency bases */
 /* divided by 10 to be nice to platforms without floating point */
-int fbase[] = {
+static const int fbase[] = {
        10000,
        100000,
        1000000,
@@ -559,7 +713,7 @@ int fbase[] = {
 /* Multiplier values for TRAN_SPEED.  Multiplied by 10 to be nice
  * to platforms without floating point.
  */
-int multipliers[] = {
+static const int multipliers[] = {
        0,      /* reserved */
        10,
        12,
@@ -610,9 +764,24 @@ int mmc_startup(struct mmc *mmc)
        u64 cmult, csize;
        struct mmc_cmd cmd;
        char ext_csd[512];
+       int timeout = 1000;
+
+#ifdef CONFIG_MMC_SPI_CRC_ON
+       if (mmc_host_is_spi(mmc)) { /* enable CRC check for spi */
+               cmd.cmdidx = MMC_CMD_SPI_CRC_ON_OFF;
+               cmd.resp_type = MMC_RSP_R1;
+               cmd.cmdarg = 1;
+               cmd.flags = 0;
+               err = mmc_send_cmd(mmc, &cmd, NULL);
+
+               if (err)
+                       return err;
+       }
+#endif
 
        /* Put the Card in Identify Mode */
-       cmd.cmdidx = MMC_CMD_ALL_SEND_CID;
+       cmd.cmdidx = mmc_host_is_spi(mmc) ? MMC_CMD_SEND_CID :
+               MMC_CMD_ALL_SEND_CID; /* cmd not supported in spi */
        cmd.resp_type = MMC_RSP_R2;
        cmd.cmdarg = 0;
        cmd.flags = 0;
@@ -629,18 +798,20 @@ int mmc_startup(struct mmc *mmc)
         * For SD cards, get the Relatvie Address.
         * This also puts the cards into Standby State
         */
-       cmd.cmdidx = SD_CMD_SEND_RELATIVE_ADDR;
-       cmd.cmdarg = mmc->rca << 16;
-       cmd.resp_type = MMC_RSP_R6;
-       cmd.flags = 0;
+       if (!mmc_host_is_spi(mmc)) { /* cmd not supported in spi */
+               cmd.cmdidx = SD_CMD_SEND_RELATIVE_ADDR;
+               cmd.cmdarg = mmc->rca << 16;
+               cmd.resp_type = MMC_RSP_R6;
+               cmd.flags = 0;
 
-       err = mmc_send_cmd(mmc, &cmd, NULL);
+               err = mmc_send_cmd(mmc, &cmd, NULL);
 
-       if (err)
-               return err;
+               if (err)
+                       return err;
 
-       if (IS_SD(mmc))
-               mmc->rca = (cmd.response[0] >> 16) & 0xffff;
+               if (IS_SD(mmc))
+                       mmc->rca = (cmd.response[0] >> 16) & 0xffff;
+       }
 
        /* Get the Card-Specific Data */
        cmd.cmdidx = MMC_CMD_SEND_CSD;
@@ -650,6 +821,9 @@ int mmc_startup(struct mmc *mmc)
 
        err = mmc_send_cmd(mmc, &cmd, NULL);
 
+       /* Waiting for the ready status */
+       mmc_send_status(mmc, timeout);
+
        if (err)
                return err;
 
@@ -716,14 +890,16 @@ int mmc_startup(struct mmc *mmc)
                mmc->write_bl_len = 512;
 
        /* Select the card, and put it into Transfer Mode */
-       cmd.cmdidx = MMC_CMD_SELECT_CARD;
-       cmd.resp_type = MMC_RSP_R1b;
-       cmd.cmdarg = mmc->rca << 16;
-       cmd.flags = 0;
-       err = mmc_send_cmd(mmc, &cmd, NULL);
+       if (!mmc_host_is_spi(mmc)) { /* cmd not supported in spi */
+               cmd.cmdidx = MMC_CMD_SELECT_CARD;
+               cmd.resp_type = MMC_RSP_R1b;
+               cmd.cmdarg = mmc->rca << 16;
+               cmd.flags = 0;
+               err = mmc_send_cmd(mmc, &cmd, NULL);
 
-       if (err)
-               return err;
+               if (err)
+                       return err;
+       }
 
        if (!IS_SD(mmc) && (mmc->version >= MMC_VERSION_4)) {
                /* check  ext_csd version and capacity */
diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c
new file mode 100644 (file)
index 0000000..dc7574c
--- /dev/null
@@ -0,0 +1,280 @@
+/*
+ * generic mmc spi driver
+ *
+ * Copyright (C) 2010 Thomas Chou <thomas@wytron.com.tw>
+ * Licensed under the GPL-2 or later.
+ */
+#include <common.h>
+#include <malloc.h>
+#include <part.h>
+#include <mmc.h>
+#include <spi.h>
+#include <crc.h>
+#include <linux/crc7.h>
+#include <linux/byteorder/swab.h>
+
+/* MMC/SD in SPI mode reports R1 status always */
+#define R1_SPI_IDLE            (1 << 0)
+#define R1_SPI_ERASE_RESET     (1 << 1)
+#define R1_SPI_ILLEGAL_COMMAND (1 << 2)
+#define R1_SPI_COM_CRC         (1 << 3)
+#define R1_SPI_ERASE_SEQ       (1 << 4)
+#define R1_SPI_ADDRESS         (1 << 5)
+#define R1_SPI_PARAMETER       (1 << 6)
+/* R1 bit 7 is always zero, reuse this bit for error */
+#define R1_SPI_ERROR           (1 << 7)
+
+/* Response tokens used to ack each block written: */
+#define SPI_MMC_RESPONSE_CODE(x)       ((x) & 0x1f)
+#define SPI_RESPONSE_ACCEPTED          ((2 << 1)|1)
+#define SPI_RESPONSE_CRC_ERR           ((5 << 1)|1)
+#define SPI_RESPONSE_WRITE_ERR         ((6 << 1)|1)
+
+/* Read and write blocks start with these tokens and end with crc;
+ * on error, read tokens act like a subset of R2_SPI_* values.
+ */
+#define SPI_TOKEN_SINGLE       0xfe    /* single block r/w, multiblock read */
+#define SPI_TOKEN_MULTI_WRITE  0xfc    /* multiblock write */
+#define SPI_TOKEN_STOP_TRAN    0xfd    /* terminate multiblock write */
+
+/* MMC SPI commands start with a start bit "0" and a transmit bit "1" */
+#define MMC_SPI_CMD(x) (0x40 | (x & 0x3f))
+
+/* bus capability */
+#define MMC_SPI_VOLTAGE (MMC_VDD_32_33 | MMC_VDD_33_34)
+#define MMC_SPI_MIN_CLOCK 400000 /* 400KHz to meet MMC spec */
+
+/* timeout value */
+#define CTOUT 8
+#define RTOUT 3000000 /* 1 sec */
+#define WTOUT 3000000 /* 1 sec */
+
+static uint mmc_spi_sendcmd(struct mmc *mmc, ushort cmdidx, u32 cmdarg)
+{
+       struct spi_slave *spi = mmc->priv;
+       u8 cmdo[7];
+       u8 r1;
+       int i;
+       cmdo[0] = 0xff;
+       cmdo[1] = MMC_SPI_CMD(cmdidx);
+       cmdo[2] = cmdarg >> 24;
+       cmdo[3] = cmdarg >> 16;
+       cmdo[4] = cmdarg >> 8;
+       cmdo[5] = cmdarg;
+       cmdo[6] = (crc7(0, &cmdo[1], 5) << 1) | 0x01;
+       spi_xfer(spi, sizeof(cmdo) * 8, cmdo, NULL, 0);
+       for (i = 0; i < CTOUT; i++) {
+               spi_xfer(spi, 1 * 8, NULL, &r1, 0);
+               if (i && (r1 & 0x80) == 0) /* r1 response */
+                       break;
+       }
+       debug("%s:cmd%d resp%d %x\n", __func__, cmdidx, i, r1);
+       return r1;
+}
+
+static uint mmc_spi_readdata(struct mmc *mmc, void *xbuf,
+                               u32 bcnt, u32 bsize)
+{
+       struct spi_slave *spi = mmc->priv;
+       u8 *buf = xbuf;
+       u8 r1;
+       u16 crc;
+       int i;
+       while (bcnt--) {
+               for (i = 0; i < RTOUT; i++) {
+                       spi_xfer(spi, 1 * 8, NULL, &r1, 0);
+                       if (r1 != 0xff) /* data token */
+                               break;
+               }
+               debug("%s:tok%d %x\n", __func__, i, r1);
+               if (r1 == SPI_TOKEN_SINGLE) {
+                       spi_xfer(spi, bsize * 8, NULL, buf, 0);
+                       spi_xfer(spi, 2 * 8, NULL, &crc, 0);
+#ifdef CONFIG_MMC_SPI_CRC_ON
+                       if (swab16(cyg_crc16(buf, bsize)) != crc) {
+                               debug("%s: CRC error\n", mmc->name);
+                               r1 = R1_SPI_COM_CRC;
+                               break;
+                       }
+#endif
+                       r1 = 0;
+               } else {
+                       r1 = R1_SPI_ERROR;
+                       break;
+               }
+               buf += bsize;
+       }
+       return r1;
+}
+
+static uint mmc_spi_writedata(struct mmc *mmc, const void *xbuf,
+                             u32 bcnt, u32 bsize, int multi)
+{
+       struct spi_slave *spi = mmc->priv;
+       const u8 *buf = xbuf;
+       u8 r1;
+       u16 crc;
+       u8 tok[2];
+       int i;
+       tok[0] = 0xff;
+       tok[1] = multi ? SPI_TOKEN_MULTI_WRITE : SPI_TOKEN_SINGLE;
+       while (bcnt--) {
+#ifdef CONFIG_MMC_SPI_CRC_ON
+               crc = swab16(cyg_crc16((u8 *)buf, bsize));
+#endif
+               spi_xfer(spi, 2 * 8, tok, NULL, 0);
+               spi_xfer(spi, bsize * 8, buf, NULL, 0);
+               spi_xfer(spi, 2 * 8, &crc, NULL, 0);
+               for (i = 0; i < CTOUT; i++) {
+                       spi_xfer(spi, 1 * 8, NULL, &r1, 0);
+                       if ((r1 & 0x10) == 0) /* response token */
+                               break;
+               }
+               debug("%s:tok%d %x\n", __func__, i, r1);
+               if (SPI_MMC_RESPONSE_CODE(r1) == SPI_RESPONSE_ACCEPTED) {
+                       for (i = 0; i < WTOUT; i++) { /* wait busy */
+                               spi_xfer(spi, 1 * 8, NULL, &r1, 0);
+                               if (i && r1 == 0xff) {
+                                       r1 = 0;
+                                       break;
+                               }
+                       }
+                       if (i == WTOUT) {
+                               debug("%s:wtout %x\n", __func__, r1);
+                               r1 = R1_SPI_ERROR;
+                               break;
+                       }
+               } else {
+                       debug("%s: err %x\n", __func__, r1);
+                       r1 = R1_SPI_COM_CRC;
+                       break;
+               }
+               buf += bsize;
+       }
+       if (multi && bcnt == -1) { /* stop multi write */
+               tok[1] = SPI_TOKEN_STOP_TRAN;
+               spi_xfer(spi, 2 * 8, tok, NULL, 0);
+               for (i = 0; i < WTOUT; i++) { /* wait busy */
+                       spi_xfer(spi, 1 * 8, NULL, &r1, 0);
+                       if (i && r1 == 0xff) {
+                               r1 = 0;
+                               break;
+                       }
+               }
+               if (i == WTOUT) {
+                       debug("%s:wstop %x\n", __func__, r1);
+                       r1 = R1_SPI_ERROR;
+               }
+       }
+       return r1;
+}
+
+static int mmc_spi_request(struct mmc *mmc, struct mmc_cmd *cmd,
+               struct mmc_data *data)
+{
+       struct spi_slave *spi = mmc->priv;
+       u8 r1;
+       int i;
+       int ret = 0;
+       debug("%s:cmd%d %x %x %x\n", __func__,
+             cmd->cmdidx, cmd->resp_type, cmd->cmdarg, cmd->flags);
+       spi_claim_bus(spi);
+       spi_cs_activate(spi);
+       r1 = mmc_spi_sendcmd(mmc, cmd->cmdidx, cmd->cmdarg);
+       if (r1 == 0xff) { /* no response */
+               ret = NO_CARD_ERR;
+               goto done;
+       } else if (r1 & R1_SPI_COM_CRC) {
+               ret = COMM_ERR;
+               goto done;
+       } else if (r1 & ~R1_SPI_IDLE) { /* other errors */
+               ret = TIMEOUT;
+               goto done;
+       } else if (cmd->resp_type == MMC_RSP_R2) {
+               r1 = mmc_spi_readdata(mmc, cmd->response, 1, 16);
+               for (i = 0; i < 4; i++)
+                       cmd->response[i] = swab32(cmd->response[i]);
+               debug("r128 %x %x %x %x\n", cmd->response[0], cmd->response[1],
+                     cmd->response[2], cmd->response[3]);
+       } else if (!data) {
+               switch (cmd->cmdidx) {
+               case SD_CMD_APP_SEND_OP_COND:
+               case MMC_CMD_SEND_OP_COND:
+                       cmd->response[0] = (r1 & R1_SPI_IDLE) ? 0 : OCR_BUSY;
+                       break;
+               case SD_CMD_SEND_IF_COND:
+               case MMC_CMD_SPI_READ_OCR:
+                       spi_xfer(spi, 4 * 8, NULL, cmd->response, 0);
+                       cmd->response[0] = swab32(cmd->response[0]);
+                       debug("r32 %x\n", cmd->response[0]);
+                       break;
+               }
+       } else {
+               debug("%s:data %x %x %x\n", __func__,
+                     data->flags, data->blocks, data->blocksize);
+               if (data->flags == MMC_DATA_READ)
+                       r1 = mmc_spi_readdata(mmc, data->dest,
+                               data->blocks, data->blocksize);
+               else if  (data->flags == MMC_DATA_WRITE)
+                       r1 = mmc_spi_writedata(mmc, data->src,
+                               data->blocks, data->blocksize,
+                               (cmd->cmdidx == MMC_CMD_WRITE_MULTIPLE_BLOCK));
+               if (r1 & R1_SPI_COM_CRC)
+                       ret = COMM_ERR;
+               else if (r1) /* other errors */
+                       ret = TIMEOUT;
+       }
+done:
+       spi_cs_deactivate(spi);
+       spi_release_bus(spi);
+       return ret;
+}
+
+static void mmc_spi_set_ios(struct mmc *mmc)
+{
+       struct spi_slave *spi = mmc->priv;
+       debug("%s: clock %u\n", __func__, mmc->clock);
+       if (mmc->clock)
+               spi_set_speed(spi, mmc->clock);
+}
+
+static int mmc_spi_init_p(struct mmc *mmc)
+{
+       struct spi_slave *spi = mmc->priv;
+       mmc->clock = 0;
+       spi_set_speed(spi, MMC_SPI_MIN_CLOCK);
+       spi_claim_bus(spi);
+       /* cs deactivated for 100+ clock */
+       spi_xfer(spi, 18 * 8, NULL, NULL, 0);
+       spi_release_bus(spi);
+       return 0;
+}
+
+struct mmc *mmc_spi_init(uint bus, uint cs, uint speed, uint mode)
+{
+       struct mmc *mmc;
+
+       mmc = malloc(sizeof(*mmc));
+       if (!mmc)
+               return NULL;
+       memset(mmc, 0, sizeof(*mmc));
+       mmc->priv = spi_setup_slave(bus, cs, speed, mode);
+       if (!mmc->priv) {
+               free(mmc);
+               return NULL;
+       }
+       sprintf(mmc->name, "MMC_SPI");
+       mmc->send_cmd = mmc_spi_request;
+       mmc->set_ios = mmc_spi_set_ios;
+       mmc->init = mmc_spi_init_p;
+       mmc->host_caps = MMC_MODE_SPI;
+
+       mmc->voltages = MMC_SPI_VOLTAGE;
+       mmc->f_max = speed;
+       mmc->f_min = MMC_SPI_MIN_CLOCK;
+       mmc->block_dev.part_type = PART_TYPE_DOS;
+
+       mmc_register(mmc);
+
+       return mmc;
+}
index 5788328ef149c5bb50814ad8101261f11c2a2fb3..91ddcb467636325eec7d66e292403cc2827b1087 100644 (file)
@@ -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 */
index fa286a8d8101dee5d50f57637172459c27984169..52f8575aac67f0e1933dabb4c0ce4e304ef26618 100644 (file)
@@ -2461,20 +2461,24 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd,
 
        /* check version */
        val = le16_to_cpu(p->revision);
-       if (val == 1 || val > (1 << 4)) {
-               printk(KERN_INFO "%s: unsupported ONFI "
-                                       "version: %d\n", __func__, val);
-               return 0;
-       }
-
-       if (val & (1 << 4))
+       if (val & (1 << 5))
+               chip->onfi_version = 23;
+       else if (val & (1 << 4))
                chip->onfi_version = 22;
        else if (val & (1 << 3))
                chip->onfi_version = 21;
        else if (val & (1 << 2))
                chip->onfi_version = 20;
-       else
+       else if (val & (1 << 1))
                chip->onfi_version = 10;
+       else
+               chip->onfi_version = 0;
+
+       if (!chip->onfi_version) {
+               printk(KERN_INFO "%s: unsupported ONFI "
+                                       "version: %d\n", __func__, val);
+               return 0;
+       }
 
        if (!mtd->name)
                mtd->name = p->model;
@@ -2482,7 +2486,7 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd,
        mtd->writesize = le32_to_cpu(p->byte_per_page);
        mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize;
        mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page);
-       chip->chipsize = le32_to_cpu(p->blocks_per_lun) * mtd->erasesize;
+       chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize;
        *busw = 0;
        if (le16_to_cpu(p->features) & 1)
                *busw = NAND_BUSWIDTH_16;
index a9910b11b80dc3e1cd9a5137b3d5abaf25edb631..1ecece0d7808269f55f1f702f39fb1e45d070566 100644 (file)
@@ -113,8 +113,35 @@ static const struct atmel_spi_flash_params atmel_spi_flash_table[] = {
 
 static int at45_wait_ready(struct spi_flash *flash, unsigned long timeout)
 {
-       return spi_flash_cmd_poll_bit(flash, timeout,
-               CMD_AT45_READ_STATUS, AT45_STATUS_READY);
+       struct spi_slave *spi = flash->spi;
+       unsigned long timebase;
+       int ret;
+       u8 cmd = CMD_AT45_READ_STATUS;
+       u8 status;
+
+       timebase = get_timer(0);
+
+       ret = spi_xfer(spi, 8, &cmd, NULL, SPI_XFER_BEGIN);
+       if (ret)
+               return -1;
+
+       do {
+               ret = spi_xfer(spi, 8, NULL, &status, 0);
+               if (ret)
+                       return -1;
+
+               if (status & AT45_STATUS_READY)
+                       break;
+       } while (get_timer(timebase) < timeout);
+
+       /* Deactivate CS */
+       spi_xfer(spi, 0, NULL, NULL, SPI_XFER_END);
+
+       if (status & AT45_STATUS_READY)
+               return 0;
+
+       /* Timed out */
+       return -1;
 }
 
 /*
@@ -301,7 +328,7 @@ out:
 /*
  * TODO: the two erase funcs (_p2/_at45) should get unified ...
  */
-int dataflash_erase_p2(struct spi_flash *flash, u32 offset, size_t len)
+static int dataflash_erase_p2(struct spi_flash *flash, u32 offset, size_t len)
 {
        struct atmel_spi_flash *asf = to_atmel_spi_flash(flash);
        unsigned long page_size;
@@ -360,7 +387,7 @@ out:
        return ret;
 }
 
-int dataflash_erase_at45(struct spi_flash *flash, u32 offset, size_t len)
+static int dataflash_erase_at45(struct spi_flash *flash, u32 offset, size_t len)
 {
        struct atmel_spi_flash *asf = to_atmel_spi_flash(flash);
        unsigned long page_addr;
@@ -495,14 +522,11 @@ struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode)
                goto err;
        }
 
+       asf->flash.sector_size = page_size;
        asf->flash.size = page_size * params->pages_per_block
                                * params->blocks_per_sector
                                * params->nr_sectors;
 
-       printf("SF: Detected %s with page size %u, total ",
-              params->name, page_size);
-       print_size(asf->flash.size, "\n");
-
        return &asf->flash;
 
 err:
index 01caed5abe83b157afdb69c8daab32878edc2c67..e3de3aabbdff9d52868b4cc3796332cbecb6d388 100644 (file)
@@ -119,13 +119,9 @@ static int eon_write(struct spi_flash *flash,
        return ret;
 }
 
-int eon_erase(struct spi_flash *flash, u32 offset, size_t len)
+static int eon_erase(struct spi_flash *flash, u32 offset, size_t len)
 {
-       struct eon_spi_flash *eon = to_eon_spi_flash(flash);
-       return spi_flash_cmd_erase(flash, CMD_EN25Q128_BE,
-               eon->params->page_size * eon->params->pages_per_sector *
-                       eon->params->sectors_per_block;
-               offset, len);
+       return spi_flash_cmd_erase(flash, CMD_EN25Q128_BE, offset, len);
 }
 
 struct spi_flash *spi_flash_probe_eon(struct spi_slave *spi, u8 *idcode)
@@ -158,11 +154,10 @@ struct spi_flash *spi_flash_probe_eon(struct spi_slave *spi, u8 *idcode)
        eon->flash.write = eon_write;
        eon->flash.erase = eon_erase;
        eon->flash.read = spi_flash_cmd_read_fast;
+       eon->flash.sector_size = params->page_size * params->pages_per_sector
+           * params->sectors_per_block;
        eon->flash.size = params->page_size * params->pages_per_sector
            * params->nr_sectors;
 
-       debug("SF: Detected %s with page size %u, total %u bytes\n",
-             params->name, params->page_size, eon->flash.size);
-
        return &eon->flash;
 }
index 4155d4d9a4663b1868132a9132ed767f98d975bd..ff66f2aa35c03a522d91094b6d047b40ced13976 100644 (file)
@@ -175,13 +175,9 @@ static int macronix_write(struct spi_flash *flash,
        return ret;
 }
 
-int macronix_erase(struct spi_flash *flash, u32 offset, size_t len)
+static int macronix_erase(struct spi_flash *flash, u32 offset, size_t len)
 {
-       struct macronix_spi_flash *mcx = to_macronix_spi_flash(flash);
-       return spi_flash_cmd_erase(flash, CMD_MX25XX_BE,
-               mcx->params->page_size * mcx->params->pages_per_sector *
-                       mcx->params->sectors_per_block,
-               offset, len);
+       return spi_flash_cmd_erase(flash, CMD_MX25XX_BE, offset, len);
 }
 
 struct spi_flash *spi_flash_probe_macronix(struct spi_slave *spi, u8 *idcode)
@@ -215,12 +211,9 @@ struct spi_flash *spi_flash_probe_macronix(struct spi_slave *spi, u8 *idcode)
        mcx->flash.write = macronix_write;
        mcx->flash.erase = macronix_erase;
        mcx->flash.read = spi_flash_cmd_read_fast;
-       mcx->flash.size = params->page_size * params->pages_per_sector
-           * params->sectors_per_block * params->nr_blocks;
-
-       printf("SF: Detected %s with page size %u, total ",
-              params->name, params->page_size);
-       print_size(mcx->flash.size, "\n");
+       mcx->flash.sector_size = params->page_size * params->pages_per_sector
+               * params->sectors_per_block;
+       mcx->flash.size = mcx->flash.sector_size * params->nr_blocks;
 
        return &mcx->flash;
 }
index 171390d5c326ac3f57645e88df9eda13dc990c5b..078d16ce1bc6d5ec15ec1b15373c575ae51e2ac9 100644 (file)
@@ -233,7 +233,7 @@ static int ramtron_write(struct spi_flash *flash,
                CMD_RAMTRON_WRITE);
 }
 
-int ramtron_erase(struct spi_flash *flash, u32 offset, size_t len)
+static int ramtron_erase(struct spi_flash *flash, u32 offset, size_t len)
 {
        debug("SF: Erase of RAMTRON FRAMs is pointless\n");
        return -1;
@@ -312,8 +312,5 @@ found:
        sn->flash.erase = ramtron_erase;
        sn->flash.size = params->size;
 
-       printf("SF: Detected %s with size ", params->name);
-       print_size(sn->flash.size, "\n");
-
        return &sn->flash;
 }
index d54a5fad23adf06ba2cfda450bb113d1b1a30884..a3401b32e18570ed58ca19dc8ad440d834a30434 100644 (file)
@@ -196,12 +196,9 @@ static int spansion_write(struct spi_flash *flash,
        return ret;
 }
 
-int spansion_erase(struct spi_flash *flash, u32 offset, size_t len)
+static int spansion_erase(struct spi_flash *flash, u32 offset, size_t len)
 {
-       struct spansion_spi_flash *spsn = to_spansion_spi_flash(flash);
-       return spi_flash_cmd_erase(flash, CMD_S25FLXX_SE,
-               spsn->params->page_size * spsn->params->pages_per_sector,
-               offset, len);
+       return spi_flash_cmd_erase(flash, CMD_S25FLXX_SE, offset, len);
 }
 
 struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode)
@@ -240,12 +237,8 @@ struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode)
        spsn->flash.write = spansion_write;
        spsn->flash.erase = spansion_erase;
        spsn->flash.read = spi_flash_cmd_read_fast;
-       spsn->flash.size = params->page_size * params->pages_per_sector
-           * params->nr_sectors;
-
-       printf("SF: Detected %s with page size %u, total ",
-              params->name, params->page_size);
-       print_size(spsn->flash.size, "\n");
+       spsn->flash.sector_size = params->page_size * params->pages_per_sector;
+       spsn->flash.size = spsn->flash.sector_size * params->nr_sectors;
 
        return &spsn->flash;
 }
index 5c261f14a63b54c5d619dcc809f25e829e7c8faf..c75b716fd43b6f984769348e4d95873d36030c6d 100644 (file)
@@ -131,12 +131,13 @@ int spi_flash_cmd_wait_ready(struct spi_flash *flash, unsigned long timeout)
 }
 
 int spi_flash_cmd_erase(struct spi_flash *flash, u8 erase_cmd,
-                       u32 erase_size, u32 offset, size_t len)
+                       u32 offset, size_t len)
 {
-       u32 start, end;
+       u32 start, end, erase_size;
        int ret;
        u8 cmd[4];
 
+       erase_size = flash->sector_size;
        if (offset % erase_size || len % erase_size) {
                debug("SF: Erase offset/length not multiple of erase size\n");
                return -1;
@@ -296,6 +297,10 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
                goto err_manufacturer_probe;
        }
 
+       printf("SF: Detected %s with page size ", flash->name);
+       print_size(flash->sector_size, ", total ");
+       print_size(flash->size, "\n");
+
        spi_release_bus(spi);
 
        return flash;
index d7bcd6d6afdeee746954d33421d9ba3ac1152514..fc109cef53e73eb62914d48f2b6d357284b673e2 100644 (file)
@@ -64,7 +64,7 @@ int spi_flash_cmd_wait_ready(struct spi_flash *flash, unsigned long timeout);
 
 /* Erase sectors. */
 int spi_flash_cmd_erase(struct spi_flash *flash, u8 erase_cmd,
-                       u32 erase_size, u32 offset, size_t len);
+                       u32 offset, size_t len);
 
 /* Manufacturer-specific probe functions */
 struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode);
index 792d04dd2beae3256a6d3d247ae1ddac6df49b13..4dc2db2ba7b83e4aa269b42780fa939f109b8702 100644 (file)
@@ -70,6 +70,10 @@ static const struct sst_spi_flash_params sst_spi_flash_table[] = {
                .idcode1 = 0x4a,
                .nr_sectors = 1024,
                .name = "SST25VF032B",
+       },{
+               .idcode1 = 0x4b,
+               .nr_sectors = 2048,
+               .name = "SST25VF064C",
        },{
                .idcode1 = 0x01,
                .nr_sectors = 16,
@@ -199,10 +203,9 @@ sst_write(struct spi_flash *flash, u32 offset, size_t len, const void *buf)
        return ret;
 }
 
-int sst_erase(struct spi_flash *flash, u32 offset, size_t len)
+static int sst_erase(struct spi_flash *flash, u32 offset, size_t len)
 {
-       return spi_flash_cmd_erase(flash, CMD_SST_SE, SST_SECTOR_SIZE,
-               offset, len);
+       return spi_flash_cmd_erase(flash, CMD_SST_SE, offset, len);
 }
 
 static int
@@ -256,11 +259,9 @@ spi_flash_probe_sst(struct spi_slave *spi, u8 *idcode)
 
        stm->flash.write = sst_write;
        stm->flash.erase = sst_erase;
-       stm->flash.size = SST_SECTOR_SIZE * params->nr_sectors;
-
-       printf("SF: Detected %s with page size %u, total ",
-              params->name, SST_SECTOR_SIZE);
-       print_size(stm->flash.size, "\n");
+       stm->flash.read = spi_flash_cmd_read_fast;
+       stm->flash.sector_size = SST_SECTOR_SIZE;
+       stm->flash.size = stm->flash.sector_size * params->nr_sectors;
 
        /* Flash powers up read-only, so clear BP# bits */
        sst_unlock(&stm->flash);
index 7ef690d9bfd08a698ea1ee0a1c44220b103febec..a1959ca984019c9ebcf54752911a9d730ab6cb21 100644 (file)
@@ -197,12 +197,9 @@ static int stmicro_write(struct spi_flash *flash,
        return ret;
 }
 
-int stmicro_erase(struct spi_flash *flash, u32 offset, size_t len)
+static int stmicro_erase(struct spi_flash *flash, u32 offset, size_t len)
 {
-       struct stmicro_spi_flash *stm = to_stmicro_spi_flash(flash);
-       return spi_flash_cmd_erase(flash, CMD_M25PXX_SE,
-               stm->params->page_size * stm->params->pages_per_sector,
-               offset, len);
+       return spi_flash_cmd_erase(flash, CMD_M25PXX_SE, offset, len);
 }
 
 struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode)
@@ -249,12 +246,8 @@ struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode)
        stm->flash.write = stmicro_write;
        stm->flash.erase = stmicro_erase;
        stm->flash.read = spi_flash_cmd_read_fast;
-       stm->flash.size = params->page_size * params->pages_per_sector
-           * params->nr_sectors;
-
-       printf("SF: Detected %s with page size %u, total ",
-              params->name, params->page_size);
-       print_size(stm->flash.size, "\n");
+       stm->flash.sector_size = params->page_size * params->pages_per_sector;
+       stm->flash.size = stm->flash.sector_size * params->nr_sectors;
 
        return &stm->flash;
 }
index e88802f0e67bdf5a7d62420fcdfa8bbf2222d16f..e8d30ae2b9d02933a812621e0cdb47511c931bba 100644 (file)
@@ -170,12 +170,9 @@ out:
        return ret;
 }
 
-int winbond_erase(struct spi_flash *flash, u32 offset, size_t len)
+static int winbond_erase(struct spi_flash *flash, u32 offset, size_t len)
 {
-       struct winbond_spi_flash *stm = to_winbond_spi_flash(flash);
-       return spi_flash_cmd_erase(flash, CMD_W25_SE,
-               (1 << stm->params->l2_page_size) * stm->params->pages_per_sector,
-               offset, len);
+       return spi_flash_cmd_erase(flash, CMD_W25_SE, offset, len);
 }
 
 struct spi_flash *spi_flash_probe_winbond(struct spi_slave *spi, u8 *idcode)
@@ -213,13 +210,11 @@ struct spi_flash *spi_flash_probe_winbond(struct spi_slave *spi, u8 *idcode)
        stm->flash.write = winbond_write;
        stm->flash.erase = winbond_erase;
        stm->flash.read = spi_flash_cmd_read_fast;
+       stm->flash.sector_size = (1 << stm->params->l2_page_size) *
+               stm->params->pages_per_sector;
        stm->flash.size = page_size * params->pages_per_sector
                                * params->sectors_per_block
                                * params->nr_blocks;
 
-       printf("SF: Detected %s with page size %u, total ",
-              params->name, page_size);
-       print_size(stm->flash.size, "\n");
-
        return &stm->flash;
 }
index 722aafc73c35ab1d733338aa3df548d374e50a7f..a883da93688a1bc056b569ab859bdb6dae263dfa 100644 (file)
@@ -49,6 +49,14 @@ extern void cfspi_release_bus(uint bus, uint cs);
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifndef CONFIG_SPI_IDLE_VAL
+#if defined(CONFIG_SPI_MMC)
+#define CONFIG_SPI_IDLE_VAL    0xFFFF
+#else
+#define CONFIG_SPI_IDLE_VAL    0x0
+#endif
+#endif
+
 #if defined(CONFIG_CF_DSPI)
 /* DSPI specific mode */
 #define SPI_MODE_MOD   0x00200000
@@ -145,7 +153,7 @@ int cfspi_xfer(struct spi_slave *slave, uint bitlen, const void *dout,
                        }
 
                        if (din != NULL) {
-                               cfspi_tx(ctrl, 0);
+                               cfspi_tx(ctrl, CONFIG_SPI_IDLE_VAL);
                                if (cfslave->charbit == 16)
                                        *spi_rd16++ = cfspi_rx();
                                else
@@ -169,7 +177,7 @@ int cfspi_xfer(struct spi_slave *slave, uint bitlen, const void *dout,
                }
 
                if (din != NULL) {
-                       cfspi_tx(ctrl, 0);
+                       cfspi_tx(ctrl, CONFIG_SPI_IDLE_VAL);
                        if (cfslave->charbit == 16)
                                *spi_rd16 = cfspi_rx();
                        else
@@ -177,7 +185,7 @@ int cfspi_xfer(struct spi_slave *slave, uint bitlen, const void *dout,
                }
        } else {
                /* dummy read */
-               cfspi_tx(ctrl, 0);
+               cfspi_tx(ctrl, CONFIG_SPI_IDLE_VAL);
                cfspi_rx();
        }
 
index 2d2e7098b7b3cb701ea8de9460483afb66fa0230..507d38ceaf94b1d900f5c8e3e0b1ded5c47e907e 100644 (file)
@@ -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;
index 9ba16012fe4ae08c1dca605ff8e0c58aa99d21ae..21c05db3f47e110e3e2e93f807399016bc1fda76 100644 (file)
@@ -272,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);
index 34a9d6866ffaf0ae2508f57c41949d6cd9422984..548d52c6a00fa2141412c2d5c490c16ab1a8c0dc 100644 (file)
@@ -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
 /*-----------------------------------------------------------------------
  * 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
 
 #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
index 638231166277a65869b0af97b0d47d0d12fe2a11..ddd1bf494605d65f78224daa89684c56f62cf1c0 100644 (file)
@@ -45,7 +45,7 @@ enum {
 
 #define XF_VERSION     6
 
-#if defined(CONFIG_I386)
+#if defined(CONFIG_X86)
 extern gd_t *global_data;
 #endif
 
index fcd0fd1de572c2cf7a54fc0ad1a5414c38c0c549..e0a56d9d23b76501f1d378ce79ec9f2702762cfa 100644 (file)
@@ -44,6 +44,7 @@
 #define MMC_MODE_HS_52MHz      0x010
 #define MMC_MODE_4BIT          0x100
 #define MMC_MODE_8BIT          0x200
+#define MMC_MODE_SPI           0x400
 
 #define SD_DATA_4BIT   0x00040000
 
@@ -75,6 +76,8 @@
 #define MMC_CMD_WRITE_SINGLE_BLOCK     24
 #define MMC_CMD_WRITE_MULTIPLE_BLOCK   25
 #define MMC_CMD_APP_CMD                        55
+#define MMC_CMD_SPI_READ_OCR           58
+#define MMC_CMD_SPI_CRC_ON_OFF         59
 
 #define SD_CMD_SEND_RELATIVE_ADDR      3
 #define SD_CMD_SWITCH_FUNC             6
 
 #define OCR_BUSY       0x80000000
 #define OCR_HCS                0x40000000
+#define OCR_VOLTAGE_MASK       0x007FFF80
+#define OCR_ACCESS_MODE                0x60000000
+
+#define MMC_STATUS_MASK                (~0x0206BF7F)
+#define MMC_STATUS_RDY_FOR_DATA (1<<8)
+#define MMC_STATUS_CURR_STATE  (0xf<<9)
 
 #define MMC_VDD_165_195                0x00000080      /* VDD voltage 1.65 - 1.95 */
 #define MMC_VDD_20_21          0x00000100      /* VDD voltage 2.0 ~ 2.1 */
@@ -291,6 +300,8 @@ int board_mmc_getcd(u8 *cd, struct mmc *mmc);
 
 #ifdef CONFIG_GENERIC_MMC
 int atmel_mci_init(void *regs);
+#define mmc_host_is_spi(mmc)   ((mmc)->host_caps & MMC_MODE_SPI)
+struct mmc *mmc_spi_init(uint bus, uint cs, uint speed, uint mode);
 #else
 int mmc_legacy_init(int verbose);
 #endif
index 1f8ba2987ef00f10346b15f7cbfdb47fc9798567..a384071fbee4b908eff02cd86db82f15677e0d2d 100644 (file)
 #include <spi.h>
 #include <linux/types.h>
 
-struct spi_flash_region {
-       unsigned int    count;
-       unsigned int    size;
-};
-
 struct spi_flash {
        struct spi_slave *spi;
 
@@ -38,6 +33,8 @@ struct spi_flash {
 
        u32             size;
 
+       u32             sector_size;
+
        int             (*read)(struct spi_flash *flash, u32 offset,
                                size_t len, void *buf);
        int             (*write)(struct spi_flash *flash, u32 offset,
index a0e1455e3730569063186fce23cf5335c45fc724..43da3df15743902d15f3c17a6579bcb8558f294c 100644 (file)
@@ -2,7 +2,7 @@
 # (C) Copyright 2007
 # Stefan Roese, DENX Software Engineering, sr@denx.de.
 #
-# Copyright 2009 Freescale Semiconductor, Inc.
+# Copyright 2009-2011 Freescale Semiconductor, Inc.
 #
 # See file CREDITS for list of people who contributed to this
 # project.
@@ -32,8 +32,8 @@ include $(TOPDIR)/config.mk
 nandobj        := $(OBJTREE)/nand_spl/
 
 LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
-LDFLAGS := -T $(LDSCRIPT) -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) $(LDFLAGS) \
-          $(LDFLAGS_FINAL)
+LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
+               $(LDFLAGS) $(LDFLAGS_FINAL)
 AFLAGS += -DCONFIG_NAND_SPL
 CFLAGS += -DCONFIG_NAND_SPL
 
@@ -56,11 +56,14 @@ $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
 $(nandobj)u-boot-spl.bin:      $(nandobj)u-boot-spl
        $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
 
-$(nandobj)u-boot-spl:  $(OBJS)
+$(nandobj)u-boot-spl:  $(OBJS) $(nandobj)u-boot-nand_spl.lds
        cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
                -Map $(nandobj)u-boot-spl.map \
                -o $(nandobj)u-boot-spl
 
+$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
+       $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+
 # create symbolic links for common files
 
 $(obj)cache.c:
index a0e1455e3730569063186fce23cf5335c45fc724..43da3df15743902d15f3c17a6579bcb8558f294c 100644 (file)
@@ -2,7 +2,7 @@
 # (C) Copyright 2007
 # Stefan Roese, DENX Software Engineering, sr@denx.de.
 #
-# Copyright 2009 Freescale Semiconductor, Inc.
+# Copyright 2009-2011 Freescale Semiconductor, Inc.
 #
 # See file CREDITS for list of people who contributed to this
 # project.
@@ -32,8 +32,8 @@ include $(TOPDIR)/config.mk
 nandobj        := $(OBJTREE)/nand_spl/
 
 LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
-LDFLAGS := -T $(LDSCRIPT) -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) $(LDFLAGS) \
-          $(LDFLAGS_FINAL)
+LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
+               $(LDFLAGS) $(LDFLAGS_FINAL)
 AFLAGS += -DCONFIG_NAND_SPL
 CFLAGS += -DCONFIG_NAND_SPL
 
@@ -56,11 +56,14 @@ $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
 $(nandobj)u-boot-spl.bin:      $(nandobj)u-boot-spl
        $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
 
-$(nandobj)u-boot-spl:  $(OBJS)
+$(nandobj)u-boot-spl:  $(OBJS) $(nandobj)u-boot-nand_spl.lds
        cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
                -Map $(nandobj)u-boot-spl.map \
                -o $(nandobj)u-boot-spl
 
+$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
+       $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+
 # create symbolic links for common files
 
 $(obj)cache.c:
index 092ce143ef71d69d812a5f136f34c011f00fb7e8..43da3df15743902d15f3c17a6579bcb8558f294c 100644 (file)
@@ -2,7 +2,7 @@
 # (C) Copyright 2007
 # Stefan Roese, DENX Software Engineering, sr@denx.de.
 #
-# Copyright 2009-2010 Freescale Semiconductor, Inc.
+# Copyright 2009-2011 Freescale Semiconductor, Inc.
 #
 # See file CREDITS for list of people who contributed to this
 # project.
@@ -32,8 +32,8 @@ include $(TOPDIR)/config.mk
 nandobj        := $(OBJTREE)/nand_spl/
 
 LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
-LDFLAGS := -T $(LDSCRIPT) -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) $(LDFLAGS) \
-          $(LDFLAGS_FINAL)
+LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
+               $(LDFLAGS) $(LDFLAGS_FINAL)
 AFLAGS += -DCONFIG_NAND_SPL
 CFLAGS += -DCONFIG_NAND_SPL
 
@@ -56,11 +56,14 @@ $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
 $(nandobj)u-boot-spl.bin:      $(nandobj)u-boot-spl
        $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
 
-$(nandobj)u-boot-spl:  $(OBJS)
+$(nandobj)u-boot-spl:  $(OBJS) $(nandobj)u-boot-nand_spl.lds
        cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
                -Map $(nandobj)u-boot-spl.map \
                -o $(nandobj)u-boot-spl
 
+$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
+       $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+
 # create symbolic links for common files
 
 $(obj)cache.c:
index a0e1455e3730569063186fce23cf5335c45fc724..43da3df15743902d15f3c17a6579bcb8558f294c 100644 (file)
@@ -2,7 +2,7 @@
 # (C) Copyright 2007
 # Stefan Roese, DENX Software Engineering, sr@denx.de.
 #
-# Copyright 2009 Freescale Semiconductor, Inc.
+# Copyright 2009-2011 Freescale Semiconductor, Inc.
 #
 # See file CREDITS for list of people who contributed to this
 # project.
@@ -32,8 +32,8 @@ include $(TOPDIR)/config.mk
 nandobj        := $(OBJTREE)/nand_spl/
 
 LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
-LDFLAGS := -T $(LDSCRIPT) -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) $(LDFLAGS) \
-          $(LDFLAGS_FINAL)
+LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
+               $(LDFLAGS) $(LDFLAGS_FINAL)
 AFLAGS += -DCONFIG_NAND_SPL
 CFLAGS += -DCONFIG_NAND_SPL
 
@@ -56,11 +56,14 @@ $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
 $(nandobj)u-boot-spl.bin:      $(nandobj)u-boot-spl
        $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
 
-$(nandobj)u-boot-spl:  $(OBJS)
+$(nandobj)u-boot-spl:  $(OBJS) $(nandobj)u-boot-nand_spl.lds
        cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
                -Map $(nandobj)u-boot-spl.map \
                -o $(nandobj)u-boot-spl
 
+$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
+       $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+
 # create symbolic links for common files
 
 $(obj)cache.c:
index 76b8566fb2a95c45a2732f5bb88319efb52f338a..4a968784e757798992499f99387a04d11e36cf35 100644 (file)
@@ -90,6 +90,10 @@ static int nand_command(struct mtd_info *mtd, int block, int page, int offs, u8
                cmd = NAND_CMD_READ0;
        }
 
+       /* Shift the offset from byte addressing to word addressing. */
+       if (this->options & NAND_BUSWIDTH_16)
+               offs >>= 1;
+
        /* Begin command latch cycle */
        this->cmd_ctrl(mtd, cmd, NAND_CTRL_CLE | NAND_CTRL_CHANGE);
        /* Set ALE and clear CLE to start address cycle */
index 9547d44238885fbd36e23eda1403f5c79f5d6b79..502605b1d5cc00ddf13c6763282b83783cc47222 100644 (file)
@@ -51,11 +51,11 @@ static void nand_load(unsigned int offs, int uboot_size, uchar *dst)
 {
        fsl_lbc_t *regs = LBC_BASE_ADDR;
        uchar *buf = (uchar *)CONFIG_SYS_NAND_BASE;
-       int large = in_be32(&regs->bank[0].or) & OR_FCM_PGS;
-       int block_shift = large ? 17 : 14;
-       int block_size = 1 << block_shift;
-       int page_size = large ? 2048 : 512;
-       int bad_marker = large ? page_size + 0 : page_size + 5;
+       const int large = CONFIG_SYS_NAND_OR_PRELIM & OR_FCM_PGS;
+       const int block_shift = large ? 17 : 14;
+       const int block_size = 1 << block_shift;
+       const int page_size = large ? 2048 : 512;
+       const int bad_marker = large ? page_size + 0 : page_size + 5;
        int fmr = (15 << FMR_CWTO_SHIFT) | (2 << FMR_AL_SHIFT) | 2;
        int pos = 0;
 
index 1a717867d48885b479050909b43d1cba0b372fe7..87b027e8fa65b03e126992a3a44971e7842c24ba 100644 (file)
@@ -464,7 +464,7 @@ static int DhcpExtended (u8 * e, int message_type, IPaddr_t ServerID, IPaddr_t R
 
        /* Pad to minimal length */
 #ifdef CONFIG_DHCP_MIN_EXT_LEN
-       while ((e - start) <= CONFIG_DHCP_MIN_EXT_LEN)
+       while ((e - start) < CONFIG_DHCP_MIN_EXT_LEN)
                *e++ = 0;
 #endif