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
 
        /* wait for DQS logic to relock */
        for (i = 0; i < 0x200; i++) ;
+#endif /* !defined(CONFIG_MONITOR_IS_IN_RAM) */
 
        return fout;
 }
 
        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.
 .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
 
        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