Merge branch 'master' of git://git.denx.de/u-boot-mips
authorWolfgang Denk <wd@denx.de>
Tue, 10 May 2011 20:34:24 +0000 (22:34 +0200)
committerWolfgang Denk <wd@denx.de>
Tue, 10 May 2011 20:34:24 +0000 (22:34 +0200)
15 files changed:
arch/mips/config.mk
arch/mips/cpu/mips32/Makefile
arch/mips/cpu/mips32/cache.S
arch/mips/cpu/mips32/start.S
arch/mips/cpu/mips32/time.c [new file with mode: 0644]
arch/mips/lib/Makefile
arch/mips/lib/time.c [deleted file]
board/dbau1x00/u-boot.lds
board/gth2/u-boot.lds
board/incaip/u-boot.lds
board/micronas/vct/u-boot.lds
board/pb1x00/u-boot.lds
board/qemu-mips/u-boot.lds
board/tb0229/u-boot.lds
examples/standalone/mips.lds

index 318d34b1e6887198bea8d15ff9df09b28a2ded8a..6ab8acdb17b4cef1affce9760f6329b0c83b6cd5 100644 (file)
@@ -50,3 +50,5 @@ PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__
 PLATFORM_CPPFLAGS              += -G 0 -mabicalls -fpic
 PLATFORM_CPPFLAGS              += -msoft-float
 PLATFORM_LDFLAGS               += -G 0 -static -n -nostdlib
+PLATFORM_RELFLAGS              += -ffunction-sections -fdata-sections
+LDFLAGS_FINAL                  += --gc-sections
index e315c1bb8cf7a876a8281aa1596273283a4a221c..eb8e00544db79685b2620cc1d0893927a51a57e9 100644 (file)
@@ -27,7 +27,7 @@ LIB   = $(obj)lib$(CPU).o
 
 START  = start.o
 SOBJS-y        = cache.o
-COBJS-y        = cpu.o interrupts.o
+COBJS-y        = cpu.o interrupts.o time.o
 
 SRCS   := $(START:.o=.S) $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
index 296593805a7334a333321a73d1cb051c909d88d7..5ce0ec45fc3509fa81a27e0a5e7ea342d3ad1048 100644 (file)
        .set    pop
        .endm
 
-/*
- * cacheop macro to automate cache operations
- * first some helpers...
- */
-#define _mincache(size, maxsize) \
-   bltu  size,maxsize,9f ; \
-   move  size,maxsize ;    \
-9:
-
-#define _align(minaddr, maxaddr, linesize) \
-   .set noat ; \
-   subu  AT,linesize,1 ;   \
-   not   AT ;        \
-   and   minaddr,AT ;      \
-   addu  maxaddr,-1 ;      \
-   and   maxaddr,AT ;      \
-   .set at
-
-/* general operations */
-#define doop1(op1) \
-   cache op1,0(a0)
-#define doop2(op1, op2) \
-   cache op1,0(a0) ;    \
-   nop ;          \
-   cache op2,0(a0)
-
-/* specials for cache initialisation */
-#define doop1lw(op1) \
-   lw zero,0(a0)
-#define doop1lw1(op1) \
-   cache op1,0(a0) ;    \
-   lw zero,0(a0) ;      \
-   cache op1,0(a0)
-#define doop121(op1,op2) \
-   cache op1,0(a0) ;    \
-   nop;           \
-   cache op2,0(a0) ;    \
-   nop;           \
-   cache op1,0(a0)
-
-#define _oploopn(minaddr, maxaddr, linesize, tag, ops) \
-   .set  noreorder ;    \
-10:   doop##tag##ops ;  \
-   bne     minaddr,maxaddr,10b ; \
-   add      minaddr,linesize ;   \
-   .set  reorder
-
-/* finally the cache operation macros */
-#define vcacheopn(kva, n, cacheSize, cacheLineSize, tag, ops) \
-   blez  n,11f ;        \
-   addu  n,kva ;        \
-   _align(kva, n, cacheLineSize) ; \
-   _oploopn(kva, n, cacheLineSize, tag, ops) ; \
-11:
-
-#define icacheopn(kva, n, cacheSize, cacheLineSize, tag, ops) \
-   _mincache(n, cacheSize);   \
-   blez  n,11f ;        \
-   addu  n,kva ;        \
-   _align(kva, n, cacheLineSize) ; \
-   _oploopn(kva, n, cacheLineSize, tag, ops) ; \
-11:
-
-#define vcacheop(kva, n, cacheSize, cacheLineSize, op) \
-   vcacheopn(kva, n, cacheSize, cacheLineSize, 1, (op))
-
-#define icacheop(kva, n, cacheSize, cacheLineSize, op) \
-   icacheopn(kva, n, cacheSize, cacheLineSize, 1, (op))
-
        .macro  f_fill64 dst, offset, val
        LONG_S  \val, (\offset +  0 * LONGSIZE)(\dst)
        LONG_S  \val, (\offset +  1 * LONGSIZE)(\dst)
  * mips_init_icache(uint PRId, ulong icache_size, unchar icache_linesz)
  */
 LEAF(mips_init_icache)
-       blez    a1, 9f
-       mtc0    zero, CP0_TAGLO
+       blez            a1, 9f
+       mtc0            zero, CP0_TAGLO
        /* clear tag to invalidate */
        PTR_LI          t0, INDEX_BASE
        PTR_ADDU        t1, t0, a1
@@ -163,15 +94,15 @@ LEAF(mips_init_icache)
 1:     cache_op        Index_Store_Tag_I t0
        PTR_ADDU        t0, a2
        bne             t0, t1, 1b
-9:     jr      ra
+9:     jr              ra
        END(mips_init_icache)
 
 /*
  * mips_init_dcache(uint PRId, ulong dcache_size, unchar dcache_linesz)
  */
 LEAF(mips_init_dcache)
-       blez    a1, 9f
-       mtc0    zero, CP0_TAGLO
+       blez            a1, 9f
+       mtc0            zero, CP0_TAGLO
        /* clear all tags */
        PTR_LI          t0, INDEX_BASE
        PTR_ADDU        t1, t0, a1
@@ -188,25 +119,23 @@ LEAF(mips_init_dcache)
 1:     cache_op        Index_Store_Tag_D t0
        PTR_ADDU        t0, a2
        bne             t0, t1, 1b
-9:     jr      ra
+9:     jr              ra
        END(mips_init_dcache)
 
-/*******************************************************************************
-*
-* mips_cache_reset - low level initialisation of the primary caches
-*
-* This routine initialises the primary caches to ensure that they
-* have good parity.  It must be called by the ROM before any cached locations
-* are used to prevent the possibility of data with bad parity being written to
-* memory.
-* To initialise the instruction cache it is essential that a source of data
-* with good parity is available. This routine
-* will initialise an area of memory starting at location zero to be used as
-* a source of parity.
-*
-* RETURNS: N/A
-*
-*/
+/*
+ * mips_cache_reset - low level initialisation of the primary caches
+ *
+ * This routine initialises the primary caches to ensure that they have good
+ * parity.  It must be called by the ROM before any cached locations are used
+ * to prevent the possibility of data with bad parity being written to memory.
+ *
+ * To initialise the instruction cache it is essential that a source of data
+ * with good parity is available. This routine will initialise an area of
+ * memory starting at location zero to be used as a source of parity.
+ *
+ * RETURNS: N/A
+ *
+ */
 NESTED(mips_cache_reset, 0, ra)
        move    RA, ra
        li      t2, CONFIG_SYS_ICACHE_SIZE
@@ -254,13 +183,12 @@ NESTED(mips_cache_reset, 0, ra)
        jr      RA
        END(mips_cache_reset)
 
-/*******************************************************************************
-*
-* dcache_status - get cache status
-*
-* RETURNS: 0 - cache disabled; 1 - cache enabled
-*
-*/
+/*
+ * dcache_status - get cache status
+ *
+ * RETURNS: 0 - cache disabled; 1 - cache enabled
+ *
+ */
 LEAF(dcache_status)
        mfc0    t0, CP0_CONFIG
        li      t1, CONF_CM_UNCACHED
@@ -271,13 +199,12 @@ LEAF(dcache_status)
 2:     jr      ra
        END(dcache_status)
 
-/*******************************************************************************
-*
-* dcache_disable - disable cache
-*
-* RETURNS: N/A
-*
-*/
+/*
+ * dcache_disable - disable cache
+ *
+ * RETURNS: N/A
+ *
+ */
 LEAF(dcache_disable)
        mfc0    t0, CP0_CONFIG
        li      t1, -8
@@ -287,13 +214,12 @@ LEAF(dcache_disable)
        jr      ra
        END(dcache_disable)
 
-/*******************************************************************************
-*
-* dcache_enable - enable cache
-*
-* RETURNS: N/A
-*
-*/
+/*
+ * dcache_enable - enable cache
+ *
+ * RETURNS: N/A
+ *
+ */
 LEAF(dcache_enable)
        mfc0    t0, CP0_CONFIG
        ori     t0, CONF_CM_CMASK
@@ -302,27 +228,3 @@ LEAF(dcache_enable)
        mtc0    t0, CP0_CONFIG
        jr      ra
        END(dcache_enable)
-
-#ifdef CONFIG_SYS_INIT_RAM_LOCK_MIPS
-/*******************************************************************************
-*
-* mips_cache_lock - lock RAM area pointed to by a0 in cache.
-*
-* RETURNS: N/A
-*
-*/
-# define       CACHE_LOCK_SIZE (CONFIG_SYS_DCACHE_SIZE)
-       .globl  mips_cache_lock
-       .ent    mips_cache_lock
-mips_cache_lock:
-       li      a1, CKSEG0 - CACHE_LOCK_SIZE
-       addu    a0, a1
-       li      a2, CACHE_LOCK_SIZE
-       li      a3, CONFIG_SYS_CACHELINE_SIZE
-       move    a1, a2
-       icacheop(a0,a1,a2,a3,0x1d)
-
-       jr      ra
-
-       .end    mips_cache_lock
-#endif /* CONFIG_SYS_INIT_RAM_LOCK_MIPS */
index e661d4625fc5f0167c24159fe8028f4a5a2685f5..5d7467d02ad69b6285bba9d598eaf24879e1fe1a 100644 (file)
        .globl _start
        .text
 _start:
-       RVECENT(reset,0)        /* U-boot entry point */
-       RVECENT(reset,1)        /* software reboot */
-#if defined(CONFIG_INCA_IP)
-       .word INFINEON_EBU_BOOTCFG /* EBU init code, fetched during booting */
-       .word 0x00000000           /* phase of the flash                    */
+       RVECENT(reset,0)                        # U-boot entry point
+       RVECENT(reset,1)                        # software reboot
+#ifdef CONFIG_INCA_IP
+       .word INFINEON_EBU_BOOTCFG              # EBU init code, fetched during
+       .word 0x00000000                        # booting phase of the flash
 #else
        RVECENT(romReserved,2)
 #endif
@@ -131,7 +131,7 @@ _start:
        RVECENT(romReserved,61)
        RVECENT(romReserved,62)
        RVECENT(romReserved,63)
-       XVECENT(romExcHandle,0x200)     /* bfc00200: R4000 tlbmiss vector */
+       XVECENT(romExcHandle,0x200)     # bfc00200: R4000 tlbmiss vector
        RVECENT(romReserved,65)
        RVECENT(romReserved,66)
        RVECENT(romReserved,67)
@@ -147,7 +147,7 @@ _start:
        RVECENT(romReserved,77)
        RVECENT(romReserved,78)
        RVECENT(romReserved,79)
-       XVECENT(romExcHandle,0x280)     /* bfc00280: R4000 xtlbmiss vector */
+       XVECENT(romExcHandle,0x280)     # bfc00280: R4000 xtlbmiss vector
        RVECENT(romReserved,81)
        RVECENT(romReserved,82)
        RVECENT(romReserved,83)
@@ -163,7 +163,7 @@ _start:
        RVECENT(romReserved,93)
        RVECENT(romReserved,94)
        RVECENT(romReserved,95)
-       XVECENT(romExcHandle,0x300)     /* bfc00300: R4000 cache vector */
+       XVECENT(romExcHandle,0x300)     # bfc00300: R4000 cache vector
        RVECENT(romReserved,97)
        RVECENT(romReserved,98)
        RVECENT(romReserved,99)
@@ -179,7 +179,7 @@ _start:
        RVECENT(romReserved,109)
        RVECENT(romReserved,110)
        RVECENT(romReserved,111)
-       XVECENT(romExcHandle,0x380)     /* bfc00380: R4000 general vector */
+       XVECENT(romExcHandle,0x380)     # bfc00380: R4000 general vector
        RVECENT(romReserved,113)
        RVECENT(romReserved,114)
        RVECENT(romReserved,115)
@@ -196,19 +196,19 @@ _start:
        RVECENT(romReserved,126)
        RVECENT(romReserved,127)
 
-       /* We hope there are no more reserved vectors!
+       /*
+        * We hope there are no more reserved vectors!
         * 128 * 8 == 1024 == 0x400
         * so this is address R_VEC+0x400 == 0xbfc00400
         */
        .align 4
 reset:
 
-       /* Clear watch registers.
-        */
+       /* Clear watch registers */
        mtc0    zero, CP0_WATCHLO
        mtc0    zero, CP0_WATCHHI
 
-       /* WP(Watch Pending), SW0/1 should be cleared. */
+       /* WP(Watch Pending), SW0/1 should be cleared */
        mtc0    zero, CP0_CAUSE
 
        setup_c0_status_reset
@@ -217,54 +217,42 @@ reset:
        mtc0    zero, CP0_COUNT
        mtc0    zero, CP0_COMPARE
 
-#if !defined(CONFIG_SKIP_LOWLEVEL_INIT)
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
        /* CONFIG0 register */
        li      t0, CONF_CM_UNCACHED
        mtc0    t0, CP0_CONFIG
-#endif /* !CONFIG_SKIP_LOWLEVEL_INIT */
+#endif
 
-       /* Initialize $gp.
-        */
+       /* Initialize $gp */
        bal     1f
-       nop
+        nop
        .word   _gp
 1:
        lw      gp, 0(ra)
 
-#if !defined(CONFIG_SKIP_LOWLEVEL_INIT)
-       /* Initialize any external memory.
-        */
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+       /* Initialize any external memory */
        la      t9, lowlevel_init
        jalr    t9
-       nop
+        nop
 
-       /* Initialize caches...
-        */
+       /* Initialize caches... */
        la      t9, mips_cache_reset
        jalr    t9
-       nop
+        nop
 
-       /* ... and enable them.
-        */
+       /* ... and enable them */
        li      t0, CONF_CM_CACHABLE_NONCOHERENT
        mtc0    t0, CP0_CONFIG
-#endif /* !CONFIG_SKIP_LOWLEVEL_INIT */
-
-       /* Set up temporary stack.
-        */
-#ifdef CONFIG_SYS_INIT_RAM_LOCK_MIPS
-       li      a0, CONFIG_SYS_INIT_SP_OFFSET
-       la      t9, mips_cache_lock
-       jalr    t9
-       nop
 #endif
 
+       /* Set up temporary stack */
        li      t0, CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_INIT_SP_OFFSET
        la      sp, 0(t0)
 
        la      t9, board_init_f
        jr      t9
-       nop
+        nop
 
 /*
  * void relocate_code (addr_sp, gd, addr_moni)
@@ -279,13 +267,13 @@ reset:
        .globl  relocate_code
        .ent    relocate_code
 relocate_code:
-       move    sp, a0          /* Set new stack pointer        */
+       move    sp, a0                  # set new stack pointer
 
        li      t0, CONFIG_SYS_MONITOR_BASE
        la      t3, in_ram
-       lw      t2, -12(t3)     /* t2 <-- uboot_end_data        */
+       lw      t2, -12(t3)             # t2 <-- uboot_end_data
        move    t1, a2
-       move    s2, a2          /* s2 <-- destination address   */
+       move    s2, a2                  # s2 <-- destination address
 
        /*
         * Fix $gp:
@@ -294,8 +282,8 @@ relocate_code:
         */
        move    t6, gp
        sub     gp, CONFIG_SYS_MONITOR_BASE
-       add     gp, a2          /* gp now adjusted              */
-       sub     s1, gp, t6      /* s1 <-- relocation offset     */
+       add     gp, a2                  # gp now adjusted
+       sub     s1, gp, t6              # s1 <-- relocation offset
 
        /*
         * t0 = source address
@@ -306,30 +294,28 @@ relocate_code:
        /*
         * Save destination address and size for later usage in flush_cache()
         */
-       move    s0, a1          /* save gd in s0                */
-       move    a0, t1          /* a0 <-- destination addr      */
-       sub     a1, t2, t0      /* a1 <-- size                  */
+       move    s0, a1                  # save gd in s0
+       move    a0, t1                  # a0 <-- destination addr
+       sub     a1, t2, t0              # a1 <-- size
 
 1:
        lw      t3, 0(t0)
        sw      t3, 0(t1)
        addu    t0, 4
        ble     t0, t2, 1b
-       addu    t1, 4           /* delay slot                   */
+        addu   t1, 4
 
-       /* If caches were enabled, we would have to flush them here.
-        */
+       /* If caches were enabled, we would have to flush them here. */
 
        /* a0 & a1 are already set up for flush_cache(start, size) */
        la      t9, flush_cache
        jalr    t9
-       nop
+        nop
 
-       /* Jump to where we've relocated ourselves.
-        */
+       /* Jump to where we've relocated ourselves */
        addi    t0, s2, in_ram - _start
        jr      t0
-       nop
+        nop
 
        .word   _gp
        .word   _GLOBAL_OFFSET_TABLE_
@@ -344,45 +330,43 @@ in_ram:
         * GOT[0] is reserved. GOT[1] is also reserved for the dynamic object
         * generated by GNU ld. Skip these reserved entries from relocation.
         */
-       lw      t3, -4(t0)      /* t3 <-- num_got_entries       */
-       lw      t4, -16(t0)     /* t4 <-- _GLOBAL_OFFSET_TABLE_ */
-       lw      t5, -20(t0)     /* t5 <-- _gp   */
-       sub     t4, t5          /* compute offset*/
-       add     t4, t4, gp      /* t4 now holds relocated _GLOBAL_OFFSET_TABLE_ */
-       addi    t4, t4, 8       /* Skipping first two entries.  */
+       lw      t3, -4(t0)              # t3 <-- num_got_entries
+       lw      t4, -16(t0)             # t4 <-- _GLOBAL_OFFSET_TABLE_
+       lw      t5, -20(t0)             # t5 <-- _gp
+       sub     t4, t5                  # compute offset
+       add     t4, t4, gp              # t4 now holds relocated _G_O_T_
+       addi    t4, t4, 8               # skipping first two entries
        li      t2, 2
 1:
        lw      t1, 0(t4)
        beqz    t1, 2f
-       add     t1, s1
+        add    t1, s1
        sw      t1, 0(t4)
 2:
        addi    t2, 1
        blt     t2, t3, 1b
-       addi    t4, 4           /* delay slot                   */
+        addi   t4, 4
 
-       /* Clear BSS.
-        */
-       lw      t1, -12(t0)     /* t1 <-- uboot_end_data        */
-       lw      t2, -8(t0)      /* t2 <-- uboot_end             */
-       add     t1, s1          /* adjust pointers              */
+       /* Clear BSS */
+       lw      t1, -12(t0)             # t1 <-- uboot_end_data
+       lw      t2, -8(t0)              # t2 <-- uboot_end
+       add     t1, s1                  # adjust pointers
        add     t2, s1
 
        sub     t1, 4
 1:
        addi    t1, 4
        bltl    t1, t2, 1b
-       sw      zero, 0(t1)     /* delay slot                   */
+        sw     zero, 0(t1)
 
-       move    a0, s0          /* a0 <-- gd                    */
+       move    a0, s0                  # a0 <-- gd
        la      t9, board_init_r
        jr      t9
-       move    a1, s2          /* delay slot                   */
+        move   a1, s2
 
        .end    relocate_code
 
-       /* Exception handlers.
-        */
+       /* Exception handlers */
 romReserved:
        b       romReserved
 
diff --git a/arch/mips/cpu/mips32/time.c b/arch/mips/cpu/mips32/time.c
new file mode 100644 (file)
index 0000000..0e66441
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * (C) Copyright 2003
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/mipsregs.h>
+
+static unsigned long timestamp;
+
+/* how many counter cycles in a jiffy */
+#define CYCLES_PER_JIFFY       (CONFIG_SYS_MIPS_TIMER_FREQ + CONFIG_SYS_HZ / 2) / CONFIG_SYS_HZ
+
+/*
+ * timer without interrupts
+ */
+
+int timer_init(void)
+{
+       /* Set up the timer for the first expiration. */
+       timestamp = 0;
+       write_c0_compare(read_c0_count() + CYCLES_PER_JIFFY);
+
+       return 0;
+}
+
+void reset_timer(void)
+{
+       timestamp = 0;
+       write_c0_compare(read_c0_count() + CYCLES_PER_JIFFY);
+}
+
+ulong get_timer(ulong base)
+{
+       unsigned int count;
+       unsigned int expirelo = read_c0_compare();
+
+       /* Check to see if we have missed any timestamps. */
+       count = read_c0_count();
+       while ((count - expirelo) < 0x7fffffff) {
+               expirelo += CYCLES_PER_JIFFY;
+               timestamp++;
+       }
+       write_c0_compare(expirelo);
+
+       return (timestamp - base);
+}
+
+void set_timer(ulong t)
+{
+       timestamp = t;
+       write_c0_compare(read_c0_count() + CYCLES_PER_JIFFY);
+}
+
+void __udelay(unsigned long usec)
+{
+       unsigned int tmo;
+
+       tmo = read_c0_count() + (usec * (CONFIG_SYS_MIPS_TIMER_FREQ / 1000000));
+       while ((tmo - read_c0_count()) < 0x7fffffff)
+               /*NOP*/;
+}
+
+/*
+ * This function is derived from PowerPC code (read timebase as long long).
+ * On MIPS it just returns the timer value.
+ */
+unsigned long long get_ticks(void)
+{
+       return get_timer(0);
+}
+
+/*
+ * This function is derived from PowerPC code (timebase clock frequency).
+ * On MIPS it returns the number of timer ticks per second.
+ */
+ulong get_tbclk(void)
+{
+       return CONFIG_SYS_HZ;
+}
index 4e90704425aadb30b463dcce6420662007bd865e..9244f3151a76fa243e672f6b15be7809b45e8172 100644 (file)
@@ -33,7 +33,6 @@ COBJS-y       += bootm_qemu_mips.o
 else
 COBJS-y        += bootm.o
 endif
-COBJS-y        += time.o
 
 SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
diff --git a/arch/mips/lib/time.c b/arch/mips/lib/time.c
deleted file mode 100644 (file)
index 0e66441..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <common.h>
-#include <asm/mipsregs.h>
-
-static unsigned long timestamp;
-
-/* how many counter cycles in a jiffy */
-#define CYCLES_PER_JIFFY       (CONFIG_SYS_MIPS_TIMER_FREQ + CONFIG_SYS_HZ / 2) / CONFIG_SYS_HZ
-
-/*
- * timer without interrupts
- */
-
-int timer_init(void)
-{
-       /* Set up the timer for the first expiration. */
-       timestamp = 0;
-       write_c0_compare(read_c0_count() + CYCLES_PER_JIFFY);
-
-       return 0;
-}
-
-void reset_timer(void)
-{
-       timestamp = 0;
-       write_c0_compare(read_c0_count() + CYCLES_PER_JIFFY);
-}
-
-ulong get_timer(ulong base)
-{
-       unsigned int count;
-       unsigned int expirelo = read_c0_compare();
-
-       /* Check to see if we have missed any timestamps. */
-       count = read_c0_count();
-       while ((count - expirelo) < 0x7fffffff) {
-               expirelo += CYCLES_PER_JIFFY;
-               timestamp++;
-       }
-       write_c0_compare(expirelo);
-
-       return (timestamp - base);
-}
-
-void set_timer(ulong t)
-{
-       timestamp = t;
-       write_c0_compare(read_c0_count() + CYCLES_PER_JIFFY);
-}
-
-void __udelay(unsigned long usec)
-{
-       unsigned int tmo;
-
-       tmo = read_c0_count() + (usec * (CONFIG_SYS_MIPS_TIMER_FREQ / 1000000));
-       while ((tmo - read_c0_count()) < 0x7fffffff)
-               /*NOP*/;
-}
-
-/*
- * This function is derived from PowerPC code (read timebase as long long).
- * On MIPS it just returns the timer value.
- */
-unsigned long long get_ticks(void)
-{
-       return get_timer(0);
-}
-
-/*
- * This function is derived from PowerPC code (timebase clock frequency).
- * On MIPS it returns the number of timer ticks per second.
- */
-ulong get_tbclk(void)
-{
-       return CONFIG_SYS_HZ;
-}
index 3c4fbe3ee96115954c3957892569526b934e77dd..4a59cea80f86aa0b7d1de31e28b7bf1cefd2939d 100644 (file)
@@ -34,14 +34,14 @@ SECTIONS
        . = ALIGN(4);
        .text       :
        {
-         *(.text)
+         *(.text*)
        }
 
        . = ALIGN(4);
        .rodata  : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
 
        . = ALIGN(4);
-       .data  : { *(.data) }
+       .data  : { *(.data*) }
 
        . = .;
        _gp = ALIGN(16) + 0x7ff0;
@@ -52,7 +52,7 @@ SECTIONS
          __got_end = .;
        }
 
-       .sdata  : { *(.sdata) }
+       .sdata  : { *(.sdata*) }
 
        .u_boot_cmd : {
          __u_boot_cmd_start = .;
@@ -64,7 +64,7 @@ SECTIONS
        num_got_entries = (__got_end - __got_start) >> 2;
 
        . = ALIGN(4);
-       .sbss (NOLOAD)  : { *(.sbss) }
-       .bss (NOLOAD)  : { *(.bss) . = ALIGN(4); }
+       .sbss (NOLOAD)  : { *(.sbss*) }
+       .bss (NOLOAD)  : { *(.bss*) . = ALIGN(4); }
        uboot_end = .;
 }
index aeb0fcc004311046c20330d8d763b4182234420a..9fc417f3bca4994268541d729617779713f249e4 100644 (file)
@@ -34,14 +34,14 @@ SECTIONS
        . = ALIGN(4);
        .text       :
        {
-         *(.text)
+         *(.text*)
        }
 
        . = ALIGN(4);
        .rodata  : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
 
        . = ALIGN(4);
-       .data  : { *(.data) }
+       .data  : { *(.data*) }
 
        . = .;
        _gp = ALIGN(16) + 0x7ff0;
@@ -52,7 +52,7 @@ SECTIONS
          __got_end = .;
        }
 
-       .sdata  : { *(.sdata) }
+       .sdata  : { *(.sdata*) }
 
        .u_boot_cmd : {
          __u_boot_cmd_start = .;
@@ -64,7 +64,7 @@ SECTIONS
        num_got_entries = (__got_end - __got_start) >> 2;
 
        . = ALIGN(4);
-       .sbss (NOLOAD)  : { *(.sbss) }
-       .bss (NOLOAD)  : { *(.bss) . = ALIGN(4); }
+       .sbss (NOLOAD)  : { *(.sbss*) }
+       .bss (NOLOAD)  : { *(.bss*) . = ALIGN(4); }
        uboot_end = .;
 }
index 3c4fbe3ee96115954c3957892569526b934e77dd..4a59cea80f86aa0b7d1de31e28b7bf1cefd2939d 100644 (file)
@@ -34,14 +34,14 @@ SECTIONS
        . = ALIGN(4);
        .text       :
        {
-         *(.text)
+         *(.text*)
        }
 
        . = ALIGN(4);
        .rodata  : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
 
        . = ALIGN(4);
-       .data  : { *(.data) }
+       .data  : { *(.data*) }
 
        . = .;
        _gp = ALIGN(16) + 0x7ff0;
@@ -52,7 +52,7 @@ SECTIONS
          __got_end = .;
        }
 
-       .sdata  : { *(.sdata) }
+       .sdata  : { *(.sdata*) }
 
        .u_boot_cmd : {
          __u_boot_cmd_start = .;
@@ -64,7 +64,7 @@ SECTIONS
        num_got_entries = (__got_end - __got_start) >> 2;
 
        . = ALIGN(4);
-       .sbss (NOLOAD)  : { *(.sbss) }
-       .bss (NOLOAD)  : { *(.bss) . = ALIGN(4); }
+       .sbss (NOLOAD)  : { *(.sbss*) }
+       .bss (NOLOAD)  : { *(.bss*) . = ALIGN(4); }
        uboot_end = .;
 }
index b90b1864728d823aa52ea402b06d95465634fdf3..3a05ef90499cf0b4b1daf0fabe2b307b4eece051 100644 (file)
@@ -31,14 +31,14 @@ SECTIONS
        . = ALIGN(4);
        .text       :
        {
-         *(.text)
+         *(.text*)
        }
 
        . = ALIGN(4);
        .rodata  : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
 
        . = ALIGN(4);
-       .data  : { *(.data) }
+       .data  : { *(.data*) }
 
        . = .;
        _gp = ALIGN(16) + 0x7ff0;
@@ -50,7 +50,7 @@ SECTIONS
        }
 
        . = ALIGN(4);
-       .sdata  : { *(.sdata) }
+       .sdata  : { *(.sdata*) }
 
        . = ALIGN(4);
        .u_boot_cmd : {
@@ -64,8 +64,8 @@ SECTIONS
        num_got_entries = (__got_end - __got_start) >> 2;
 
        . = ALIGN(4);
-       .sbss (NOLOAD)  : { *(.sbss) }
+       .sbss (NOLOAD)  : { *(.sbss*) }
        . = ALIGN(4);
-       .bss (NOLOAD)  : { *(.bss) }
+       .bss (NOLOAD)  : { *(.bss*) }
        uboot_end = .;
 }
index 358cc54a8b985153f474a6b9b305b1f87b52ee80..bd0dee1efb9a8798d749332478fb6bb1ef49bcaa 100644 (file)
@@ -34,14 +34,14 @@ SECTIONS
        . = ALIGN(4);
        .text       :
        {
-         *(.text)
+         *(.text*)
        }
 
        . = ALIGN(4);
        .rodata  : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
 
        . = ALIGN(4);
-       .data  : { *(.data) }
+       .data  : { *(.data*) }
 
        . = .;
        _gp = ALIGN(16) + 0x7ff0;
@@ -52,7 +52,7 @@ SECTIONS
          __got_end = .;
        }
 
-       .sdata  : { *(.sdata) }
+       .sdata  : { *(.sdata*) }
 
        .u_boot_cmd : {
          __u_boot_cmd_start = .;
@@ -64,7 +64,7 @@ SECTIONS
        num_got_entries = (__got_end - __got_start) >> 2;
 
        . = ALIGN(4);
-       .sbss (NOLOAD)  : { *(.sbss) }
-       .bss (NOLOAD)  : { *(.bss) . = ALIGN(4); }
+       .sbss (NOLOAD)  : { *(.sbss*) }
+       .bss (NOLOAD)  : { *(.bss*) . = ALIGN(4); }
        uboot_end = .;
 }
index bd16786cbc6cbef33bbd2233185bb96d9605184d..9460b2010cc6f5643a336220bd42c9df3ac19f03 100644 (file)
@@ -34,14 +34,14 @@ SECTIONS
        . = ALIGN(4);
        .text       :
        {
-         *(.text)
+         *(.text*)
        }
 
        . = ALIGN(4);
        .rodata  : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
 
        . = ALIGN(4);
-       .data  : { *(.data) }
+       .data  : { *(.data*) }
 
        . = .;
        _gp = ALIGN(16) +0x7ff0;
@@ -53,7 +53,7 @@ SECTIONS
        }
 
        . = ALIGN(4);
-       .sdata  : { *(.sdata) }
+       .sdata  : { *(.sdata*) }
 
        . = .;
        .u_boot_cmd : {
@@ -66,7 +66,7 @@ SECTIONS
        num_got_entries = (__got_end - __got_start) >> 2;
 
        . = ALIGN(4);
-       .sbss  : { *(.sbss) }
-       .bss  : { *(.bss) . = ALIGN(4); }
+       .sbss  : { *(.sbss*) }
+       .bss  : { *(.bss*) . = ALIGN(4); }
        uboot_end = .;
 }
index 56d7c254487b4ea4a2d2e004d720d3acaf0030bd..5ea1094067214b62b9e0be84f3f5295b9a3fa2f4 100644 (file)
@@ -34,14 +34,14 @@ SECTIONS
        . = ALIGN(4);
        .text       :
        {
-         *(.text)
+         *(.text*)
        }
 
        . = ALIGN(4);
        .rodata  : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
 
        . = ALIGN(4);
-       .data  : { *(.data) }
+       .data  : { *(.data*) }
 
        . = .;
        _gp = ALIGN(16) + 0x7ff0;
@@ -52,7 +52,7 @@ SECTIONS
          __got_end = .;
        }
 
-       .sdata  : { *(.sdata) }
+       .sdata  : { *(.sdata*) }
 
        .u_boot_cmd : {
          __u_boot_cmd_start = .;
@@ -64,7 +64,7 @@ SECTIONS
        num_got_entries = (__got_end - __got_start) >> 2;
 
        . = ALIGN(4);
-       .sbss (NOLOAD)  : { *(.sbss) }
-       .bss (NOLOAD)  : { *(.bss) . = ALIGN(4); }
+       .sbss (NOLOAD)  : { *(.sbss*) }
+       .bss (NOLOAD)  : { *(.bss*) . = ALIGN(4); }
        uboot_end = .;
 }
index 63a1c92ab623be8b6daa28a2dd236518fc614f11..5f766ed37815c0d841de4ba216389d72f0a3f047 100644 (file)
@@ -30,14 +30,14 @@ SECTIONS
 {
        .text       :
        {
-         *(.text)
+         *(.text*)
        }
 
        . = ALIGN(4);
        .rodata  : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
 
        . = ALIGN(4);
-       .data  : { *(.data) }
+       .data  : { *(.data*) }
 
        . = .;
        _gp = ALIGN(16) + 0x7ff0;
@@ -48,12 +48,12 @@ SECTIONS
          __got_end = .;
        }
 
-       .sdata  : { *(.sdata) }
+       .sdata  : { *(.sdata*) }
 
        . = ALIGN(4);
        __bss_start = .;
-       .sbss (NOLOAD) : { *(.sbss) }
-       .bss (NOLOAD)  : { *(.bss) . = ALIGN(4); }
+       .sbss (NOLOAD) : { *(.sbss*) }
+       .bss (NOLOAD)  : { *(.bss*) . = ALIGN(4); }
 
        _end = .;
 }