]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
allow MCF532x to use CONFIG_MONITOR_IS_IN_RAM
authorWolfgang Wegner <w.wegner@astro-kom.de>
Tue, 2 Mar 2010 09:59:20 +0000 (10:59 +0100)
committerTsiChung Liew <tsicliew@gmail.com>
Thu, 4 Mar 2010 07:46:53 +0000 (01:46 -0600)
CONFIG_MONITOR_IS_IN_RAM is broken for MCF532x. This patch fixes this
 by conditionally
- removing the vector table at the beginning of code
- not overwriting the vector base register
- removing the code to re-set the PLL, which effectively disables
  SDRAM access

Signed-off-by: Wolfgang Wegner <w.wegner@astro-kom.de>
cpu/mcf532x/speed.c
cpu/mcf532x/start.S

index 0d378e63d4f139d316c7e61ad1ffac82114cb1b9..67f08c7602803ae402fdff7d3485293eb997cbc6 100644 (file)
@@ -204,6 +204,8 @@ int clock_pll(int fsys, int flags)
        fout = ((fref * mfd) / (BUSDIV * 4));
 #endif
 
+/* must not tamper with SDRAMC if running from SDRAM */
+#if !defined(CONFIG_MONITOR_IS_IN_RAM)
        /*
         * Check to see if the SDRAM has already been initialized.
         * If it has then the SDRAM needs to be put into self refresh
@@ -254,6 +256,7 @@ int clock_pll(int fsys, int flags)
 
        /* wait for DQS logic to relock */
        for (i = 0; i < 0x200; i++) ;
+#endif /* !defined(CONFIG_MONITOR_IS_IN_RAM) */
 
        return fout;
 }
index ff13a9f2dde835c2992aed361e2a1fa88c6714a9..5b134aa47c2492022346847290b3156875891bb2 100644 (file)
@@ -45,6 +45,7 @@
        addl    #60,%sp;                /* space for 15 regs */ \
        rte;
 
+#if !defined(CONFIG_MONITOR_IS_IN_RAM)
 .text
 /*
  *     Vector table. This is used for initial platform startup.
@@ -121,6 +122,7 @@ vector192_255:
 .long  _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
 .long  _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
 .long  _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
+#endif /* !defined(CONFIG_MONITOR_IS_IN_RAM) */
 
        .text
 
@@ -130,9 +132,11 @@ _start:
        nop
        move.w #0x2700,%sr      /* Mask off Interrupt */
 
+#if !defined(CONFIG_MONITOR_IS_IN_RAM)
        /* Set vector base register at the beginning of the Flash */
        move.l  #CONFIG_SYS_FLASH_BASE, %d0
        movec   %d0, %VBR
+#endif
 
        move.l  #(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_CTRL), %d0
        movec   %d0, %RAMBAR1