]> git.sur5r.net Git - u-boot/blobdiff - cpu/mpc85xx/traps.c
GCC-4.x fixes: clean up global data pointer initialization for all boards.
[u-boot] / cpu / mpc85xx / traps.c
index fd0b436cfa575a686cae35eb699c617a3e051fb9..904f0523396d631a0aa8de698da0b4b6d1ba0cfc 100644 (file)
@@ -22,7 +22,7 @@
  *
  * 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
+ * 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
@@ -39,6 +39,8 @@
 #include <command.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
 int (*debugger_exception_handler)(struct pt_regs *) = 0;
 #endif
@@ -46,9 +48,10 @@ int (*debugger_exception_handler)(struct pt_regs *) = 0;
 /* Returns 0 if exception not found and fixup otherwise.  */
 extern unsigned long search_exception_table(unsigned long);
 
-/* THIS NEEDS CHANGING to use the board info structure.
+/*
+ * End of memory as shown by board info and determined by DDR setup.
  */
-#define END_OF_MEM     (CFG_SDRAM_SIZE * 1024 * 1024)
+#define END_OF_MEM     (gd->bd->bi_memstart + gd->bd->bi_memsize)
 
 
 static __inline__ void set_tsr(unsigned long val)
@@ -164,19 +167,18 @@ MachineCheckException(struct pt_regs *regs)
        printf("Machine check in kernel mode.\n");
        printf("Caused by (from msr): ");
        printf("regs %p ",regs);
-       switch( regs->msr & 0x0000F000)
-       {
-       case (1<<12) :
+       switch( regs->msr & 0x000F0000) {
+       case (0x80000000>>12):
                printf("Machine check signal - probably due to mm fault\n"
                       "with mmu off\n");
                break;
-       case (1<<13) :
+       case (0x80000000>>13):
                printf("Transfer error ack signal\n");
                break;
-       case (1<<14) :
+       case (0x80000000>>14):
                printf("Data parity signal\n");
                break;
-       case (1<<15) :
+       case (0x80000000>>15):
                printf("Address parity signal\n");
                break;
        default:
@@ -262,7 +264,7 @@ DebugException(struct pt_regs *regs)
 #endif
 }
 
-/* Probe an address by reading.  If not present, return -1, otherwise
+/* Probe an address by reading.         If not present, return -1, otherwise
  * return 0.
  */
 int