blob: fad103fc6b3d39304c8213fa389803e953a78ca3 [file] [log] [blame]
wdenk4a9cbbe2002-08-27 09:48:53 +00001/*
2 * (C) Copyright 2000-2002
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 * Rob Taylor, Flying Pig Systems. robt@flyingpig.com
5 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
wdenk4a9cbbe2002-08-27 09:48:53 +00007 */
8
9#include <common.h>
10#include <mpc824x.h>
11#include <asm/processor.h>
12#include <asm/pci_io.h>
13#include <commproc.h>
14#include "drivers/epic.h"
15
wdenka8c7c702003-12-06 19:49:23 +000016int interrupt_init_cpu (unsigned *decrementer_count)
wdenk4a9cbbe2002-08-27 09:48:53 +000017{
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020018 *decrementer_count = (get_bus_freq (0) / 4) / CONFIG_SYS_HZ;
wdenk4a9cbbe2002-08-27 09:48:53 +000019
wdenk8bde7f72003-06-27 21:31:46 +000020 /*
21 * It's all broken at the moment and I currently don't need
22 * interrupts. If you want to fix it, have a look at the epic
23 * drivers in dink32 v12. They do everthing and Motorola said
24 * I could use the dink source in this project as long as
25 * copyright notices remain intact.
wdenk4a9cbbe2002-08-27 09:48:53 +000026 */
27
28 epicInit (EPIC_DIRECT_IRQ, 0);
wdenk7c7a23b2002-12-07 00:20:59 +000029 /* EPIC won't generate INT unless Current Task Pri < 15 */
30 epicCurTaskPrioSet(0);
wdenk4a9cbbe2002-08-27 09:48:53 +000031
wdenk4a9cbbe2002-08-27 09:48:53 +000032 return (0);
33}
34
35/****************************************************************************/
36
37/*
38 * Handle external interrupts
39 */
40void external_interrupt (struct pt_regs *regs)
41{
42 register unsigned long temp;
43
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020044 pci_readl (CONFIG_SYS_EUMB_ADDR + EPIC_PROC_INT_ACK_REG, temp);
wdenk4a9cbbe2002-08-27 09:48:53 +000045 sync (); /* i'm not convinced this is needed, but dink source has it */
46 temp &= 0xff; /*get vector */
47
48 /*TODO: handle them -... */
49 epicEOI ();
50}
51
52/****************************************************************************/
53
54/*
55 * blank int handlers.
56 */
57
58void
59irq_install_handler (int vec, interrupt_handler_t * handler, void *arg)
60{
61}
62
63void irq_free_handler (int vec)
64{
65
66}
67
68/*TODO: some handlers for winbond and 87308 interrupts
69 and what about generic pci inteerupts?
70 vga?
71 */
72
Guennadi Liakhovetski59543fe2007-10-23 14:35:05 +020073void timer_interrupt_cpu (struct pt_regs *regs)
wdenk4a9cbbe2002-08-27 09:48:53 +000074{
wdenka8c7c702003-12-06 19:49:23 +000075 /* nothing to do here */
76 return;
wdenk4a9cbbe2002-08-27 09:48:53 +000077}