2004-02-12 00:47:09 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2000-2004
|
|
|
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
*
|
2012-03-26 21:49:04 +00:00
|
|
|
* Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc.
|
2007-08-16 18:20:50 +00:00
|
|
|
* TsiChung Liew (Tsi-Chung.Liew@freescale.com)
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2004-02-12 00:47:09 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <watchdog.h>
|
|
|
|
#include <asm/processor.h>
|
2007-08-16 00:21:21 +00:00
|
|
|
#include <asm/immap.h>
|
2012-03-26 21:49:04 +00:00
|
|
|
#include <asm/io.h>
|
2006-01-26 22:35:56 +00:00
|
|
|
|
2004-02-12 00:47:09 +00:00
|
|
|
#ifdef CONFIG_M5272
|
2007-08-16 00:21:21 +00:00
|
|
|
int interrupt_init(void)
|
2004-02-12 00:47:09 +00:00
|
|
|
{
|
2012-03-26 21:49:04 +00:00
|
|
|
intctrl_t *intp = (intctrl_t *) (MMAP_INTC);
|
2004-02-12 00:47:09 +00:00
|
|
|
|
2007-08-16 00:21:21 +00:00
|
|
|
/* disable all external interrupts */
|
2012-03-26 21:49:04 +00:00
|
|
|
out_be32(&intp->int_icr1, 0x88888888);
|
|
|
|
out_be32(&intp->int_icr2, 0x88888888);
|
|
|
|
out_be32(&intp->int_icr3, 0x88888888);
|
|
|
|
out_be32(&intp->int_icr4, 0x88888888);
|
|
|
|
out_be32(&intp->int_pitr, 0x00000000);
|
|
|
|
|
2007-08-16 00:21:21 +00:00
|
|
|
/* initialize vector register */
|
2012-03-26 21:49:04 +00:00
|
|
|
out_8(&intp->int_pivr, 0x40);
|
2004-02-12 00:47:09 +00:00
|
|
|
|
2007-08-16 00:21:21 +00:00
|
|
|
enable_interrupts();
|
2004-02-12 00:47:09 +00:00
|
|
|
|
2007-08-16 00:21:21 +00:00
|
|
|
return 0;
|
2004-02-12 00:47:09 +00:00
|
|
|
}
|
|
|
|
|
2007-08-16 00:21:21 +00:00
|
|
|
#if defined(CONFIG_MCFTMR)
|
|
|
|
void dtimer_intr_setup(void)
|
2004-02-12 00:47:09 +00:00
|
|
|
{
|
2012-03-26 21:49:04 +00:00
|
|
|
intctrl_t *intp = (intctrl_t *) (CONFIG_SYS_INTR_BASE);
|
2004-02-12 00:47:09 +00:00
|
|
|
|
2012-03-26 21:49:04 +00:00
|
|
|
clrbits_be32(&intp->int_icr1, INT_ICR1_TMR3MASK);
|
|
|
|
setbits_be32(&intp->int_icr1, CONFIG_SYS_TMRINTR_PRI);
|
2004-02-12 00:47:09 +00:00
|
|
|
}
|
2007-08-16 00:21:21 +00:00
|
|
|
#endif /* CONFIG_MCFTMR */
|
|
|
|
#endif /* CONFIG_M5272 */
|
2004-02-12 00:47:09 +00:00
|
|
|
|
2009-06-12 11:29:00 +00:00
|
|
|
#if defined(CONFIG_M5208) || defined(CONFIG_M5282) || \
|
|
|
|
defined(CONFIG_M5271) || defined(CONFIG_M5275)
|
2007-08-16 00:21:21 +00:00
|
|
|
int interrupt_init(void)
|
2004-02-12 00:47:09 +00:00
|
|
|
{
|
2012-03-26 21:49:04 +00:00
|
|
|
int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
|
2004-02-12 00:47:09 +00:00
|
|
|
|
2007-08-16 00:21:21 +00:00
|
|
|
/* Make sure all interrupts are disabled */
|
2009-06-12 11:29:00 +00:00
|
|
|
#if defined(CONFIG_M5208)
|
2012-03-26 21:49:04 +00:00
|
|
|
out_be32(&intp->imrl0, 0xffffffff);
|
|
|
|
out_be32(&intp->imrh0, 0xffffffff);
|
2009-06-12 11:29:00 +00:00
|
|
|
#else
|
2012-03-26 21:49:04 +00:00
|
|
|
setbits_be32(&intp->imrl0, 0x1);
|
2009-06-12 11:29:00 +00:00
|
|
|
#endif
|
2004-02-12 00:47:09 +00:00
|
|
|
|
2007-08-16 00:21:21 +00:00
|
|
|
enable_interrupts();
|
|
|
|
return 0;
|
2004-02-12 00:47:09 +00:00
|
|
|
}
|
|
|
|
|
2007-08-16 00:21:21 +00:00
|
|
|
#if defined(CONFIG_MCFTMR)
|
|
|
|
void dtimer_intr_setup(void)
|
2004-02-12 00:47:09 +00:00
|
|
|
{
|
2012-03-26 21:49:04 +00:00
|
|
|
int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
|
2004-02-12 00:47:09 +00:00
|
|
|
|
2012-03-26 21:49:04 +00:00
|
|
|
out_8(&intp->icr0[CONFIG_SYS_TMRINTR_NO], CONFIG_SYS_TMRINTR_PRI);
|
|
|
|
clrbits_be32(&intp->imrl0, 0x00000001);
|
|
|
|
clrbits_be32(&intp->imrl0, CONFIG_SYS_TMRINTR_MASK);
|
2004-02-12 00:47:09 +00:00
|
|
|
}
|
2007-08-16 00:21:21 +00:00
|
|
|
#endif /* CONFIG_MCFTMR */
|
2008-02-04 21:38:20 +00:00
|
|
|
#endif /* CONFIG_M5282 | CONFIG_M5271 | CONFIG_M5275 */
|
2004-02-12 00:47:09 +00:00
|
|
|
|
2007-08-16 18:20:50 +00:00
|
|
|
#if defined(CONFIG_M5249) || defined(CONFIG_M5253)
|
2007-08-16 00:21:21 +00:00
|
|
|
int interrupt_init(void)
|
2004-02-12 00:47:09 +00:00
|
|
|
{
|
2007-08-16 00:21:21 +00:00
|
|
|
enable_interrupts();
|
2004-02-12 00:47:09 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-08-16 00:21:21 +00:00
|
|
|
#if defined(CONFIG_MCFTMR)
|
|
|
|
void dtimer_intr_setup(void)
|
2004-12-16 18:09:49 +00:00
|
|
|
{
|
2007-08-16 00:21:21 +00:00
|
|
|
mbar_writeLong(MCFSIM_IMR, mbar_readLong(MCFSIM_IMR) & ~0x00000400);
|
2008-10-16 13:01:15 +00:00
|
|
|
mbar_writeByte(MCFSIM_TIMER2ICR, CONFIG_SYS_TMRINTR_PRI);
|
2004-12-16 18:09:49 +00:00
|
|
|
}
|
2007-08-16 00:21:21 +00:00
|
|
|
#endif /* CONFIG_MCFTMR */
|
2007-08-16 18:20:50 +00:00
|
|
|
#endif /* CONFIG_M5249 || CONFIG_M5253 */
|