blob: a9062435d7b4de3ec4c04c50a279b1779aef800a [file] [log] [blame]
wdenkec0852c2002-10-07 22:11:42 +00001/*
2 * (C) Copyright 2001
3 * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
wdenkec0852c2002-10-07 22:11:42 +00006 */
7
8/*
9 * interrupts.c - just enough support for the decrementer/timer
10 */
11
12#include <common.h>
13#include <mpc8xx.h>
14#include <mpc8xx_irq.h>
15#include <asm/processor.h>
16#include <commproc.h>
17#include <command.h>
18
wdenkc0aa5c52003-12-06 19:49:23 +000019int interrupt_init_cpu (unsigned *decrementer_count)
wdenkec0852c2002-10-07 22:11:42 +000020{
Wolfgang Denkb0b104a2010-06-13 18:28:54 +020021 debug("interrupt_init: GT main cause reg: %08x:%08x\n",
wdenkec0852c2002-10-07 22:11:42 +000022 GTREGREAD(LOW_INTERRUPT_CAUSE_REGISTER),
23 GTREGREAD(HIGH_INTERRUPT_CAUSE_REGISTER));
Wolfgang Denkb0b104a2010-06-13 18:28:54 +020024 debug("interrupt_init: ethernet cause regs: %08x %08x %08x\n",
wdenkec0852c2002-10-07 22:11:42 +000025 GTREGREAD(ETHERNET0_INTERRUPT_CAUSE_REGISTER),
26 GTREGREAD(ETHERNET1_INTERRUPT_CAUSE_REGISTER),
27 GTREGREAD(ETHERNET2_INTERRUPT_CAUSE_REGISTER));
Wolfgang Denkb0b104a2010-06-13 18:28:54 +020028 debug("interrupt_init: ethernet mask regs: %08x %08x %08x\n",
wdenkec0852c2002-10-07 22:11:42 +000029 GTREGREAD(ETHERNET0_INTERRUPT_MASK_REGISTER),
30 GTREGREAD(ETHERNET1_INTERRUPT_MASK_REGISTER),
31 GTREGREAD(ETHERNET2_INTERRUPT_MASK_REGISTER));
Wolfgang Denkb0b104a2010-06-13 18:28:54 +020032 debug("interrupt_init: setting decrementer_count\n");
33
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020034 *decrementer_count = get_tbclk() / CONFIG_SYS_HZ;
wdenkec0852c2002-10-07 22:11:42 +000035
wdenkec0852c2002-10-07 22:11:42 +000036 return (0);
37}
38
39/****************************************************************************/
40
41/*
42 * Handle external interrupts
43 */
44void
45external_interrupt(struct pt_regs *regs)
46{
47 puts("external_interrupt (oops!)\n");
48}
49
50volatile ulong timestamp = 0;
51
52/*
53 * timer_interrupt - gets called when the decrementer overflows,
54 * with interrupts disabled.
55 * Trivial implementation - no need to be really accurate.
56 */
57void
wdenkc0aa5c52003-12-06 19:49:23 +000058timer_interrupt_cpu (struct pt_regs *regs)
wdenkec0852c2002-10-07 22:11:42 +000059{
wdenkc0aa5c52003-12-06 19:49:23 +000060 /* nothing to do here */
61 return;
wdenkec0852c2002-10-07 22:11:42 +000062}
63
64/****************************************************************************/
65
66/*
67 * Install and free a interrupt handler.
68 */
69
70void
71irq_install_handler(int vec, interrupt_handler_t *handler, void *arg)
72{
73
74}
75
76void
77irq_free_handler(int vec)
78{
79
80}
81
82/****************************************************************************/
83
84void
Wolfgang Denk6262d0212010-06-28 22:00:46 +020085do_irqinfo(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char * const argv[])
wdenkec0852c2002-10-07 22:11:42 +000086{
87 puts("IRQ related functions are unimplemented currently.\n");
88}