]>
Commit | Line | Data |
---|---|---|
4a9cbbe8 WD |
1 | /* |
2 | * (C) Copyright 2000-2002 | |
3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | |
4 | * Rob Taylor, Flying Pig Systems. robt@flyingpig.com | |
5 | * | |
1a459660 | 6 | * SPDX-License-Identifier: GPL-2.0+ |
4a9cbbe8 WD |
7 | */ |
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 | ||
a8c7c708 | 16 | int interrupt_init_cpu (unsigned *decrementer_count) |
4a9cbbe8 | 17 | { |
6d0f6bcf | 18 | *decrementer_count = (get_bus_freq (0) / 4) / CONFIG_SYS_HZ; |
4a9cbbe8 | 19 | |
8bde7f77 WD |
20 | /* |
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. | |
4a9cbbe8 WD |
26 | */ |
27 | ||
28 | epicInit (EPIC_DIRECT_IRQ, 0); | |
7c7a23bd WD |
29 | /* EPIC won't generate INT unless Current Task Pri < 15 */ |
30 | epicCurTaskPrioSet(0); | |
4a9cbbe8 | 31 | |
4a9cbbe8 WD |
32 | return (0); |
33 | } | |
34 | ||
35 | /****************************************************************************/ | |
36 | ||
37 | /* | |
38 | * Handle external interrupts | |
39 | */ | |
40 | void external_interrupt (struct pt_regs *regs) | |
41 | { | |
42 | register unsigned long temp; | |
43 | ||
6d0f6bcf | 44 | pci_readl (CONFIG_SYS_EUMB_ADDR + EPIC_PROC_INT_ACK_REG, temp); |
4a9cbbe8 WD |
45 | 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 | ||
58 | void | |
59 | irq_install_handler (int vec, interrupt_handler_t * handler, void *arg) | |
60 | { | |
61 | } | |
62 | ||
63 | void 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 | ||
59543fe0 | 73 | void timer_interrupt_cpu (struct pt_regs *regs) |
4a9cbbe8 | 74 | { |
a8c7c708 WD |
75 | /* nothing to do here */ |
76 | return; | |
4a9cbbe8 | 77 | } |