wdenk | ec0852c | 2002-10-07 22:11:42 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2001 |
| 3 | * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc. |
| 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | ec0852c | 2002-10-07 22:11:42 +0000 | [diff] [blame] | 6 | */ |
| 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 | |
wdenk | a8c7c70 | 2003-12-06 19:49:23 +0000 | [diff] [blame] | 19 | int interrupt_init_cpu (unsigned *decrementer_count) |
wdenk | ec0852c | 2002-10-07 22:11:42 +0000 | [diff] [blame] | 20 | { |
Wolfgang Denk | 953b7e6 | 2010-06-13 18:28:54 +0200 | [diff] [blame] | 21 | debug("interrupt_init: GT main cause reg: %08x:%08x\n", |
wdenk | ec0852c | 2002-10-07 22:11:42 +0000 | [diff] [blame] | 22 | GTREGREAD(LOW_INTERRUPT_CAUSE_REGISTER), |
| 23 | GTREGREAD(HIGH_INTERRUPT_CAUSE_REGISTER)); |
Wolfgang Denk | 953b7e6 | 2010-06-13 18:28:54 +0200 | [diff] [blame] | 24 | debug("interrupt_init: ethernet cause regs: %08x %08x %08x\n", |
wdenk | ec0852c | 2002-10-07 22:11:42 +0000 | [diff] [blame] | 25 | GTREGREAD(ETHERNET0_INTERRUPT_CAUSE_REGISTER), |
| 26 | GTREGREAD(ETHERNET1_INTERRUPT_CAUSE_REGISTER), |
| 27 | GTREGREAD(ETHERNET2_INTERRUPT_CAUSE_REGISTER)); |
Wolfgang Denk | 953b7e6 | 2010-06-13 18:28:54 +0200 | [diff] [blame] | 28 | debug("interrupt_init: ethernet mask regs: %08x %08x %08x\n", |
wdenk | ec0852c | 2002-10-07 22:11:42 +0000 | [diff] [blame] | 29 | GTREGREAD(ETHERNET0_INTERRUPT_MASK_REGISTER), |
| 30 | GTREGREAD(ETHERNET1_INTERRUPT_MASK_REGISTER), |
| 31 | GTREGREAD(ETHERNET2_INTERRUPT_MASK_REGISTER)); |
Wolfgang Denk | 953b7e6 | 2010-06-13 18:28:54 +0200 | [diff] [blame] | 32 | debug("interrupt_init: setting decrementer_count\n"); |
| 33 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 34 | *decrementer_count = get_tbclk() / CONFIG_SYS_HZ; |
wdenk | ec0852c | 2002-10-07 22:11:42 +0000 | [diff] [blame] | 35 | |
wdenk | ec0852c | 2002-10-07 22:11:42 +0000 | [diff] [blame] | 36 | return (0); |
| 37 | } |
| 38 | |
| 39 | /****************************************************************************/ |
| 40 | |
| 41 | /* |
| 42 | * Handle external interrupts |
| 43 | */ |
| 44 | void |
| 45 | external_interrupt(struct pt_regs *regs) |
| 46 | { |
| 47 | puts("external_interrupt (oops!)\n"); |
| 48 | } |
| 49 | |
| 50 | volatile 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 | */ |
| 57 | void |
wdenk | a8c7c70 | 2003-12-06 19:49:23 +0000 | [diff] [blame] | 58 | timer_interrupt_cpu (struct pt_regs *regs) |
wdenk | ec0852c | 2002-10-07 22:11:42 +0000 | [diff] [blame] | 59 | { |
wdenk | a8c7c70 | 2003-12-06 19:49:23 +0000 | [diff] [blame] | 60 | /* nothing to do here */ |
| 61 | return; |
wdenk | ec0852c | 2002-10-07 22:11:42 +0000 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | /****************************************************************************/ |
| 65 | |
| 66 | /* |
| 67 | * Install and free a interrupt handler. |
| 68 | */ |
| 69 | |
| 70 | void |
| 71 | irq_install_handler(int vec, interrupt_handler_t *handler, void *arg) |
| 72 | { |
| 73 | |
| 74 | } |
| 75 | |
| 76 | void |
| 77 | irq_free_handler(int vec) |
| 78 | { |
| 79 | |
| 80 | } |
| 81 | |
| 82 | /****************************************************************************/ |
| 83 | |
| 84 | void |
Wolfgang Denk | 54841ab | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 85 | do_irqinfo(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char * const argv[]) |
wdenk | ec0852c | 2002-10-07 22:11:42 +0000 | [diff] [blame] | 86 | { |
| 87 | puts("IRQ related functions are unimplemented currently.\n"); |
| 88 | } |