2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
Added M5329AFEE and M5329BFEE Platforms
Added board/freescale/m5329evb, cpu/mcf532x, drivers/net,
drivers/serial, immap_5329.h, m5329.h, mcfrtc.h,
include/configs/M5329EVB.h, lib_m68k/interrupts.c, and
rtc/mcfrtc.c
Modified CREDITS, MAKEFILE, Makefile, README, common/cmd_bdinfo.c,
common/cmd_mii.c, include/asm-m68k/byteorder.h, include/asm-m68k/fec.h,
include/asm-m68k/io.h, include/asm-m68k/mcftimer.h,
include/asm-m68k/mcfuart.h, include/asm-m68k/ptrace.h,
include/asm-m68k/u-boot.h, lib_m68k/Makefile, lib_m68k/board.c,
lib_m68k/time.c, net/eth.c and rtc/Makefile
Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
2007-06-18 18:50:13 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2000-2004
|
|
|
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
*
|
2007-07-06 04:27:40 +00:00
|
|
|
* (C) Copyright 2007 Freescale Semiconductor Inc
|
Added M5329AFEE and M5329BFEE Platforms
Added board/freescale/m5329evb, cpu/mcf532x, drivers/net,
drivers/serial, immap_5329.h, m5329.h, mcfrtc.h,
include/configs/M5329EVB.h, lib_m68k/interrupts.c, and
rtc/mcfrtc.c
Modified CREDITS, MAKEFILE, Makefile, README, common/cmd_bdinfo.c,
common/cmd_mii.c, include/asm-m68k/byteorder.h, include/asm-m68k/fec.h,
include/asm-m68k/io.h, include/asm-m68k/mcftimer.h,
include/asm-m68k/mcfuart.h, include/asm-m68k/ptrace.h,
include/asm-m68k/u-boot.h, lib_m68k/Makefile, lib_m68k/board.c,
lib_m68k/time.c, net/eth.c and rtc/Makefile
Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
2007-06-18 18:50:13 +00:00
|
|
|
* TsiChung Liew (Tsi-Chung.Liew@freescale.com)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <watchdog.h>
|
|
|
|
#include <asm/processor.h>
|
2007-07-06 04:27:40 +00:00
|
|
|
#include <asm/immap.h>
|
Added M5329AFEE and M5329BFEE Platforms
Added board/freescale/m5329evb, cpu/mcf532x, drivers/net,
drivers/serial, immap_5329.h, m5329.h, mcfrtc.h,
include/configs/M5329EVB.h, lib_m68k/interrupts.c, and
rtc/mcfrtc.c
Modified CREDITS, MAKEFILE, Makefile, README, common/cmd_bdinfo.c,
common/cmd_mii.c, include/asm-m68k/byteorder.h, include/asm-m68k/fec.h,
include/asm-m68k/io.h, include/asm-m68k/mcftimer.h,
include/asm-m68k/mcfuart.h, include/asm-m68k/ptrace.h,
include/asm-m68k/u-boot.h, lib_m68k/Makefile, lib_m68k/board.c,
lib_m68k/time.c, net/eth.c and rtc/Makefile
Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
2007-06-18 18:50:13 +00:00
|
|
|
|
2008-10-16 13:01:15 +00:00
|
|
|
#define NR_IRQS (CONFIG_SYS_NUM_IRQS)
|
Added M5329AFEE and M5329BFEE Platforms
Added board/freescale/m5329evb, cpu/mcf532x, drivers/net,
drivers/serial, immap_5329.h, m5329.h, mcfrtc.h,
include/configs/M5329EVB.h, lib_m68k/interrupts.c, and
rtc/mcfrtc.c
Modified CREDITS, MAKEFILE, Makefile, README, common/cmd_bdinfo.c,
common/cmd_mii.c, include/asm-m68k/byteorder.h, include/asm-m68k/fec.h,
include/asm-m68k/io.h, include/asm-m68k/mcftimer.h,
include/asm-m68k/mcfuart.h, include/asm-m68k/ptrace.h,
include/asm-m68k/u-boot.h, lib_m68k/Makefile, lib_m68k/board.c,
lib_m68k/time.c, net/eth.c and rtc/Makefile
Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
2007-06-18 18:50:13 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Interrupt vector functions.
|
|
|
|
*/
|
|
|
|
struct interrupt_action {
|
|
|
|
interrupt_handler_t *handler;
|
|
|
|
void *arg;
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct interrupt_action irq_vecs[NR_IRQS];
|
|
|
|
|
|
|
|
static __inline__ unsigned short get_sr (void)
|
|
|
|
{
|
|
|
|
unsigned short sr;
|
|
|
|
|
|
|
|
asm volatile ("move.w %%sr,%0":"=r" (sr):);
|
|
|
|
|
|
|
|
return sr;
|
|
|
|
}
|
|
|
|
|
|
|
|
static __inline__ void set_sr (unsigned short sr)
|
|
|
|
{
|
|
|
|
asm volatile ("move.w %0,%%sr"::"r" (sr));
|
|
|
|
}
|
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
/*
|
|
|
|
* Install and free an interrupt handler
|
|
|
|
*/
|
|
|
|
void irq_install_handler (int vec, interrupt_handler_t * handler, void *arg)
|
|
|
|
{
|
2008-12-08 09:04:51 +00:00
|
|
|
if ((vec < 0) || (vec >= NR_IRQS)) {
|
Added M5329AFEE and M5329BFEE Platforms
Added board/freescale/m5329evb, cpu/mcf532x, drivers/net,
drivers/serial, immap_5329.h, m5329.h, mcfrtc.h,
include/configs/M5329EVB.h, lib_m68k/interrupts.c, and
rtc/mcfrtc.c
Modified CREDITS, MAKEFILE, Makefile, README, common/cmd_bdinfo.c,
common/cmd_mii.c, include/asm-m68k/byteorder.h, include/asm-m68k/fec.h,
include/asm-m68k/io.h, include/asm-m68k/mcftimer.h,
include/asm-m68k/mcfuart.h, include/asm-m68k/ptrace.h,
include/asm-m68k/u-boot.h, lib_m68k/Makefile, lib_m68k/board.c,
lib_m68k/time.c, net/eth.c and rtc/Makefile
Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
2007-06-18 18:50:13 +00:00
|
|
|
printf ("irq_install_handler: wrong interrupt vector %d\n",
|
|
|
|
vec);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
irq_vecs[vec].handler = handler;
|
|
|
|
irq_vecs[vec].arg = arg;
|
|
|
|
}
|
|
|
|
|
|
|
|
void irq_free_handler (int vec)
|
|
|
|
{
|
2008-12-08 09:04:51 +00:00
|
|
|
if ((vec < 0) || (vec >= NR_IRQS)) {
|
Added M5329AFEE and M5329BFEE Platforms
Added board/freescale/m5329evb, cpu/mcf532x, drivers/net,
drivers/serial, immap_5329.h, m5329.h, mcfrtc.h,
include/configs/M5329EVB.h, lib_m68k/interrupts.c, and
rtc/mcfrtc.c
Modified CREDITS, MAKEFILE, Makefile, README, common/cmd_bdinfo.c,
common/cmd_mii.c, include/asm-m68k/byteorder.h, include/asm-m68k/fec.h,
include/asm-m68k/io.h, include/asm-m68k/mcftimer.h,
include/asm-m68k/mcfuart.h, include/asm-m68k/ptrace.h,
include/asm-m68k/u-boot.h, lib_m68k/Makefile, lib_m68k/board.c,
lib_m68k/time.c, net/eth.c and rtc/Makefile
Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
2007-06-18 18:50:13 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
irq_vecs[vec].handler = NULL;
|
|
|
|
irq_vecs[vec].arg = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void enable_interrupts (void)
|
|
|
|
{
|
|
|
|
unsigned short sr;
|
|
|
|
|
|
|
|
sr = get_sr ();
|
|
|
|
set_sr (sr & ~0x0700);
|
|
|
|
}
|
|
|
|
|
|
|
|
int disable_interrupts (void)
|
|
|
|
{
|
|
|
|
unsigned short sr;
|
|
|
|
|
|
|
|
sr = get_sr ();
|
|
|
|
set_sr (sr | 0x0700);
|
|
|
|
|
2013-04-01 18:29:11 +00:00
|
|
|
return ((sr & 0x0700) == 0); /* return true, if interrupts were enabled before */
|
Added M5329AFEE and M5329BFEE Platforms
Added board/freescale/m5329evb, cpu/mcf532x, drivers/net,
drivers/serial, immap_5329.h, m5329.h, mcfrtc.h,
include/configs/M5329EVB.h, lib_m68k/interrupts.c, and
rtc/mcfrtc.c
Modified CREDITS, MAKEFILE, Makefile, README, common/cmd_bdinfo.c,
common/cmd_mii.c, include/asm-m68k/byteorder.h, include/asm-m68k/fec.h,
include/asm-m68k/io.h, include/asm-m68k/mcftimer.h,
include/asm-m68k/mcfuart.h, include/asm-m68k/ptrace.h,
include/asm-m68k/u-boot.h, lib_m68k/Makefile, lib_m68k/board.c,
lib_m68k/time.c, net/eth.c and rtc/Makefile
Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
2007-06-18 18:50:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void int_handler (struct pt_regs *fp)
|
|
|
|
{
|
|
|
|
int vec;
|
|
|
|
|
|
|
|
vec = (fp->vector >> 2) & 0xff;
|
|
|
|
if (vec > 0x40)
|
|
|
|
vec -= 0x40;
|
|
|
|
|
|
|
|
if (irq_vecs[vec].handler != NULL) {
|
|
|
|
irq_vecs[vec].handler (irq_vecs[vec].arg);
|
|
|
|
} else {
|
|
|
|
printf ("\nBogus External Interrupt Vector %d\n", vec);
|
|
|
|
}
|
|
|
|
}
|