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 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 6 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | 4a9cbbe | 2002-08-27 09:48:53 +0000 | [diff] [blame] | 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 | |
wdenk | a8c7c70 | 2003-12-06 19:49:23 +0000 | [diff] [blame] | 16 | int interrupt_init_cpu (unsigned *decrementer_count) |
wdenk | 4a9cbbe | 2002-08-27 09:48:53 +0000 | [diff] [blame] | 17 | { |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 18 | *decrementer_count = (get_bus_freq (0) / 4) / CONFIG_SYS_HZ; |
wdenk | 4a9cbbe | 2002-08-27 09:48:53 +0000 | [diff] [blame] | 19 | |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 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. |
wdenk | 4a9cbbe | 2002-08-27 09:48:53 +0000 | [diff] [blame] | 26 | */ |
| 27 | |
| 28 | epicInit (EPIC_DIRECT_IRQ, 0); |
wdenk | 7c7a23b | 2002-12-07 00:20:59 +0000 | [diff] [blame] | 29 | /* EPIC won't generate INT unless Current Task Pri < 15 */ |
| 30 | epicCurTaskPrioSet(0); |
wdenk | 4a9cbbe | 2002-08-27 09:48:53 +0000 | [diff] [blame] | 31 | |
wdenk | 4a9cbbe | 2002-08-27 09:48:53 +0000 | [diff] [blame] | 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 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 44 | pci_readl (CONFIG_SYS_EUMB_ADDR + EPIC_PROC_INT_ACK_REG, temp); |
wdenk | 4a9cbbe | 2002-08-27 09:48:53 +0000 | [diff] [blame] | 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 | |
Guennadi Liakhovetski | 59543fe | 2007-10-23 14:35:05 +0200 | [diff] [blame] | 73 | void timer_interrupt_cpu (struct pt_regs *regs) |
wdenk | 4a9cbbe | 2002-08-27 09:48:53 +0000 | [diff] [blame] | 74 | { |
wdenk | a8c7c70 | 2003-12-06 19:49:23 +0000 | [diff] [blame] | 75 | /* nothing to do here */ |
| 76 | return; |
wdenk | 4a9cbbe | 2002-08-27 09:48:53 +0000 | [diff] [blame] | 77 | } |