wdenk | 4a9cbbe | 2002-08-27 09:48:53 +0000 | [diff] [blame] | 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 | * |
| 6 | * See file CREDITS for list of people who contributed to this |
| 7 | * project. |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU General Public License as |
| 11 | * published by the Free Software Foundation; either version 2 of |
| 12 | * the License, or (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 22 | * MA 02111-1307 USA |
| 23 | */ |
| 24 | |
| 25 | #include <common.h> |
| 26 | #include <mpc824x.h> |
| 27 | #include <asm/processor.h> |
| 28 | #include <asm/pci_io.h> |
| 29 | #include <commproc.h> |
| 30 | #include "drivers/epic.h" |
| 31 | |
wdenk | a8c7c70 | 2003-12-06 19:49:23 +0000 | [diff] [blame] | 32 | int interrupt_init_cpu (unsigned *decrementer_count) |
wdenk | 4a9cbbe | 2002-08-27 09:48:53 +0000 | [diff] [blame] | 33 | { |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 34 | *decrementer_count = (get_bus_freq (0) / 4) / CONFIG_SYS_HZ; |
wdenk | 4a9cbbe | 2002-08-27 09:48:53 +0000 | [diff] [blame] | 35 | |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 36 | /* |
| 37 | * It's all broken at the moment and I currently don't need |
| 38 | * interrupts. If you want to fix it, have a look at the epic |
| 39 | * drivers in dink32 v12. They do everthing and Motorola said |
| 40 | * I could use the dink source in this project as long as |
| 41 | * copyright notices remain intact. |
wdenk | 4a9cbbe | 2002-08-27 09:48:53 +0000 | [diff] [blame] | 42 | */ |
| 43 | |
| 44 | epicInit (EPIC_DIRECT_IRQ, 0); |
wdenk | 7c7a23b | 2002-12-07 00:20:59 +0000 | [diff] [blame] | 45 | /* EPIC won't generate INT unless Current Task Pri < 15 */ |
| 46 | epicCurTaskPrioSet(0); |
wdenk | 4a9cbbe | 2002-08-27 09:48:53 +0000 | [diff] [blame] | 47 | |
wdenk | 4a9cbbe | 2002-08-27 09:48:53 +0000 | [diff] [blame] | 48 | return (0); |
| 49 | } |
| 50 | |
| 51 | /****************************************************************************/ |
| 52 | |
| 53 | /* |
| 54 | * Handle external interrupts |
| 55 | */ |
| 56 | void external_interrupt (struct pt_regs *regs) |
| 57 | { |
| 58 | register unsigned long temp; |
| 59 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 60 | pci_readl (CONFIG_SYS_EUMB_ADDR + EPIC_PROC_INT_ACK_REG, temp); |
wdenk | 4a9cbbe | 2002-08-27 09:48:53 +0000 | [diff] [blame] | 61 | sync (); /* i'm not convinced this is needed, but dink source has it */ |
| 62 | temp &= 0xff; /*get vector */ |
| 63 | |
| 64 | /*TODO: handle them -... */ |
| 65 | epicEOI (); |
| 66 | } |
| 67 | |
| 68 | /****************************************************************************/ |
| 69 | |
| 70 | /* |
| 71 | * blank int handlers. |
| 72 | */ |
| 73 | |
| 74 | void |
| 75 | irq_install_handler (int vec, interrupt_handler_t * handler, void *arg) |
| 76 | { |
| 77 | } |
| 78 | |
| 79 | void irq_free_handler (int vec) |
| 80 | { |
| 81 | |
| 82 | } |
| 83 | |
| 84 | /*TODO: some handlers for winbond and 87308 interrupts |
| 85 | and what about generic pci inteerupts? |
| 86 | vga? |
| 87 | */ |
| 88 | |
Guennadi Liakhovetski | 59543fe | 2007-10-23 14:35:05 +0200 | [diff] [blame] | 89 | void timer_interrupt_cpu (struct pt_regs *regs) |
wdenk | 4a9cbbe | 2002-08-27 09:48:53 +0000 | [diff] [blame] | 90 | { |
wdenk | a8c7c70 | 2003-12-06 19:49:23 +0000 | [diff] [blame] | 91 | /* nothing to do here */ |
| 92 | return; |
wdenk | 4a9cbbe | 2002-08-27 09:48:53 +0000 | [diff] [blame] | 93 | } |