]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
* Fix ICU862 environment problem
authorwdenk <wdenk>
Thu, 28 Aug 2003 09:41:22 +0000 (09:41 +0000)
committerwdenk <wdenk>
Thu, 28 Aug 2003 09:41:22 +0000 (09:41 +0000)
* Fix RAM size detection for RMU board

* Implement "reset" for MGT5100/MPC5200 systems

CHANGELOG
board/icecube/icecube.c
board/icu862/u-boot.lds
board/rmu/rmu.c
cpu/mpc5xxx/cpu.c
cpu/mpc8xx/start.S
include/configs/ICU862.h
include/configs/IceCube.h
include/configs/rmu.h
include/mpc5xxx.h
include/version.h

index f50831e2c453490c162badbb5cdcdff18442074d..f101143d3692dab81978a002377e23da09316c55 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,15 @@
 ======================================================================
-Changes for U-Boot 0.4.5:
+Changes for U-Boot 0.4.7:
+======================================================================
+
+* Fix ICU862 environment problem
+
+* Fix RAM size detection for RMU board
+
+* Implement "reset" for MGT5100/MPC5200 systems
+
+======================================================================
+Changes for U-Boot 0.4.6:
 ======================================================================
 
 * Make Ethernet autonegotiation on INCA-IP work for all clock rates;
@@ -14,6 +24,10 @@ Changes for U-Boot 0.4.5:
 * Patch by Richard Woodruff, 8 Aug 2003:
   Allow crc32 to be used at address 0x000 (crc32_no_comp, too).
 
+======================================================================
+Changes for U-Boot 0.4.5:
+======================================================================
+
 * Update for TQM board defaults:
   disable clocks_in_mhz, enable boot count limit
 
index 396ad2a4f297721fed6792ebc7b796c5046b69ee..f75e6751860988fd79fa262f32c167c7607df798 100644 (file)
@@ -25,6 +25,7 @@
 #include <mpc5xxx.h>
 #include <pci.h>
 
+#ifndef CFG_RAMBOOT
 static long int dram_size(long int *base, long int maxsize)
 {
        volatile long int *addr;
@@ -86,11 +87,14 @@ static void sdram_start (int hi_addr)
        /* normal operation */
        *(vu_long *)MPC5XXX_SDRAM_CTRL = 0x504f0000 | hi_addr_bit;
 }
+#endif
 
 long int initdram (int board_type)
 {
-       ulong test1, test2, dramsize = 0;
+       ulong dramsize = 0;
 #ifndef CFG_RAMBOOT
+       ulong test1, test2;
+
        /* configure SDRAM start/end */
 #if defined(CONFIG_MPC5200)
        *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x0000001e;/* 2G at 0x0 */
@@ -133,8 +137,11 @@ long int initdram (int board_type)
 #else
 #ifdef CONFIG_MGT5100
        *(vu_long *)MPC5XXX_ADDECR |= (1 << 22); /* Enable SDRAM */
+       dramsize = ((*(vu_long *)MPC5XXX_SDRAM_STOP + 1) << 15);
+#else
+       dramsize = ((1 << (*(vu_long *)MPC5XXX_SDRAM_CS0CFG - 0x13)) << 20);
 #endif
-#endif
+#endif /* CFG_RAMBOOT */
        /* return total ram size */
        return dramsize;
 }
index 496c5987ff1c4a27924f274a4dd77e3f041b2654..84e9cbf2e5d9aedeb0b9c57adea675765011b276 100644 (file)
@@ -136,11 +136,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  . = ALIGN(256 * 1024);
-  .ppcenv      :
-  {
-    common/environment.o (.ppcenv)
-  }
   _end = . ;
   PROVIDE (end = .);
 }
index c9925d09a36e049bfe69d7e1674462cbf6578144..331fb9877a9627dca6f7996a04b0865fba562b79 100644 (file)
@@ -96,7 +96,7 @@ long int initdram (int board_type)
 {
     volatile immap_t     *immap  = (immap_t *)CFG_IMMR;
     volatile memctl8xx_t *memctl = &immap->im_memctl;
-    long int size10 ;
+    long int size9 ;
 
     upmconfig(UPMA, (uint *)sdram_table, sizeof(sdram_table)/sizeof(uint));
 
@@ -109,7 +109,7 @@ long int initdram (int board_type)
     memctl->memc_or1 = CFG_OR1_PRELIM;
     memctl->memc_br1 = CFG_BR1_PRELIM;
 
-    memctl->memc_mamr = CFG_MAMR_10COL & (~(MAMR_PTAE)); /* no refresh yet */
+    memctl->memc_mamr = CFG_MAMR_9COL & (~(MAMR_PTAE)); /* no refresh yet */
 
     udelay(200);
 
@@ -122,13 +122,20 @@ long int initdram (int board_type)
 
     udelay (1000);
 
-       /* Check Bank 0 Memory Size
-        * try 10 column mode
+       /* Check Bank 0 Memory Size,
+        * 9 column mode
         */
 
-       size10 = dram_size (CFG_MAMR_10COL, (ulong *)SDRAM_BASE_PRELIM, SDRAM_MAX_SIZE) ;
+       size9 = dram_size (CFG_MAMR_9COL, (ulong *)SDRAM_BASE_PRELIM, SDRAM_MAX_SIZE) ;
 
-    return (size10);
+       /*
+        * Final mapping:
+        */
+
+       memctl->memc_or1 = ((-size9) & 0xFFFF0000) | CFG_OR_TIMING_SDRAM;
+       udelay (1000);
+
+    return (size9);
 }
 
 /* ------------------------------------------------------------------------- */
index 7d95d2f9c3f1adbe3e4b46037b24112611b3c539..c481d187df9449594b02accc52f943e5a97e4fba 100644 (file)
@@ -54,31 +54,17 @@ int checkcpu (void)
 int
 do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
-       ulong msr, addr;
-
-       *(vu_long *)MPC5XXX_CDM_SRESET &= ~(1 << 16);   /* Checkstop Reset enable */
-
+       ulong msr;
        /* Interrupts and MMU off */
        __asm__ __volatile__ ("mfmsr    %0":"=r" (msr):);
 
        msr &= ~(MSR_ME | MSR_EE | MSR_IR | MSR_DR);
        __asm__ __volatile__ ("mtmsr    %0"::"r" (msr));
 
-       /*
-        * Trying to execute the next instruction at a non-existing address
-        * should cause a machine check, resulting in reset
-        */
-#ifdef CFG_RESET_ADDRESS
-       addr = CFG_RESET_ADDRESS;
-#else
-       /*
-        * note: when CFG_MONITOR_BASE points to a RAM address, CFG_MONITOR_BASE
-        * - sizeof (ulong) is usually a valid address. Better pick an address
-        * known to be invalid on your system and assign it to CFG_RESET_ADDRESS.
-        */
-       addr = CFG_MONITOR_BASE - sizeof (ulong);
-#endif
-       ((void (*)(void)) addr) ();
+       /* Charge the watchdog timer */
+       *(vu_long *)(MPC5XXX_GPT0_COUNTER) = 0xf;
+       *(vu_long *)(MPC5XXX_GPT0_ENABLE) = 0x9004; /* wden|ce|timer_ms */
+
        return 1;
 
 }
index cdd549fc74f2bb8a419186237758e0a8670a3f05..3ebcab46ae1a3af732a9ec7b288a9b616b6966a1 100644 (file)
@@ -76,9 +76,6 @@
        GOT_ENTRY(__init_end)
        GOT_ENTRY(_end)
        GOT_ENTRY(__bss_start)
-#if defined(CONFIG_ICU862)
-       GOT_ENTRY(environment)
-#endif
        END_GOT
 
 /*
@@ -617,16 +614,7 @@ clear_bss:
         * Now clear BSS segment
         */
        lwz     r3,GOT(__bss_start)
-#if defined(CONFIG_ICU862)
-       /*
-        * For the FADS - the environment is the very last item in flash.
-        * The real .bss stops just before environment starts, so only
-        * clear up to that point.
-        */
-       lwz     r4,GOT(environment)
-#else
        lwz     r4,GOT(_end)
-#endif
 
        cmplw   0, r3, r4
        beq     6f
index a7a11a6163ab1b26d71ba4311b7f9e945832132b..fea0fce256f83ee2341a7cadde2415c174ac9104 100644 (file)
 #define        CFG_MONITOR_LEN         (192 << 10)     /* Reserve 192 kB for Monitor   */
 #endif
 #else
-#define CFG_MONITOR_LEN (272 << 10) /* Reserve 272 kB for Monitor */
+#define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */
 #endif
 #define CFG_MONITOR_BASE       TEXT_BASE
 #define        CFG_MALLOC_LEN          (256 << 10)     /* Reserve 256 kB for malloc()  */
index 6a43441a36cd7243665bad6479c52bf5a76bfe8f..352beae607c1e377faf5b41da0da4beaf01298af 100644 (file)
  */
 #define CFG_MBAR               0xf0000000
 #define CFG_SDRAM_BASE         0x00000000
-#ifdef CONFIG_MPC5200
 #define CFG_DEFAULT_MBAR       0x80000000
-#endif
 
 /* Use SRAM until RAM will be available */
 #define CFG_INIT_RAM_ADDR      MPC5XXX_SRAM
index 0a94714f7beb268face1fdf7fef7a00e132827ff..7b33c7e1b1597bf281f3b343bb9cc44a916a6f8d 100644 (file)
  *
  */
 #define SDRAM_BASE_PRELIM      0x00000000      /* SDRAM base   */
-#define        SDRAM_MAX_SIZE          0x01000000      /* max 16 MB */
+#define        SDRAM_MAX_SIZE          0x08000000      /* max 128 MB */
 
 /* SDRAM timing: Multiplexed addresses, GPL5 output to GPL5_A (don't care)     */
 #define CFG_OR_TIMING_SDRAM    0x00000E00
 
-#define CFG_OR1_PRELIM (CFG_PRELIM_OR_AM | CFG_OR_TIMING_SDRAM )
+#define CFG_OR1_PRELIM (0xF0000000 | CFG_OR_TIMING_SDRAM ) /* map 256 MB */
 #define CFG_BR1_PRELIM ((SDRAM_BASE_PRELIM & BR_BA_MSK) | BR_MS_UPMA | BR_V )
 
 /* RPXLITE mem setting */
  * MAMR settings for SDRAM
  */
 
-/* 10 column SDRAM */
-#define CFG_MAMR_10COL ((CFG_MAMR_PTA << MAMR_PTA_SHIFT)  | MAMR_PTAE      |   \
+/* 9 column SDRAM */
+#define CFG_MAMR_9COL  ((CFG_MAMR_PTA << MAMR_PTA_SHIFT)  | MAMR_PTAE      |   \
                         MAMR_AMA_TYPE_1 | MAMR_DSA_1_CYCL | MAMR_G0CLA_A10 |   \
                         MAMR_RLFA_16X | MAMR_WLFA_16X | MAMR_TLFA_16X)
 
index b803d03df41748768f9d755a445d7a2c7ef174ea..4218b050fc739326f000109adb4088583115aba4 100644 (file)
@@ -78,6 +78,7 @@
 #define MPC5XXX_CDM            (CFG_MBAR + 0x0200)
 #define MPC5XXX_LPB            (CFG_MBAR + 0x0300)
 #define MPC5XXX_ICTL           (CFG_MBAR + 0x0500)
+#define MPC5XXX_GPT            (CFG_MBAR + 0x0600)
 #define MPC5XXX_GPIO           (CFG_MBAR + 0x0b00)
 #define MPC5XXX_PCI            (CFG_MBAR + 0x0d00)
 #define MPC5XXX_SDMA           (CFG_MBAR + 0x1200)
 #define MPC5XXX_ICTL_PER_STS   (MPC5XXX_ICTL + 0x0030)
 #define MPC5XXX_ICTL_BUS_STS   (MPC5XXX_ICTL + 0x0038)
 
+/* General Purpose Timers registers */
+#define MPC5XXX_GPT0_ENABLE            (MPC5XXX_GPT + 0x0)
+#define MPC5XXX_GPT0_COUNTER           (MPC5XXX_GPT + 0x4)
+
 /* Programmable Serial Controller (PSC) status register bits */
 #define PSC_SR_CDE             0x0080
 #define PSC_SR_RXRDY           0x0100
index 5ba84884c2b161ca1413f7ac0829fc748a588c1d..d295c2a3c7933e0663ba551a5a204ba53cace4b0 100644 (file)
@@ -24,6 +24,6 @@
 #ifndef        __VERSION_H__
 #define        __VERSION_H__
 
-#define        U_BOOT_VERSION  "U-Boot 0.4.6"
+#define        U_BOOT_VERSION  "U-Boot 0.4.7"
 
 #endif /* __VERSION_H__ */