mpc83xx: don't hang if watchdog configured on 8360, 832x
[oweals/u-boot.git] / cpu / mpc83xx / interrupts.c
index 53474f60c91f2b159642fa55506cf7056595c802..bb1fe1af3f3bba3c3ca199f7a884a640b79efb87 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  * MA 02111-1307 USA
- *
- * Change log:
- *
- * Hacked for MPC8260 by Murray.Jensen@cmst.csiro.au, 22-Oct-00
- *
- * 20050101: Eran Liberty (liberty@freescale.com)
- *           Initial file creating (porting from 85XX & 8260)
  */
 
 #include <common.h>
@@ -35,6 +28,8 @@
 #include <mpc83xx.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 struct irq_action {
        interrupt_handler_t *handler;
        void *arg;
@@ -43,6 +38,14 @@ struct irq_action {
 
 int interrupt_init_cpu (unsigned *decrementer_count)
 {
+       volatile immap_t *immr = (immap_t *) CFG_IMMR;
+
+       *decrementer_count = (gd->bus_clk / 4) / CFG_HZ;
+
+       /* Enable e300 time base */
+
+       immr->sysconf.spcr |= 0x00400000;
+
        return 0;
 }