Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 2 | /* |
3 | * (C) Copyright 2000-2002 | ||||
4 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | ||||
5 | * | ||||
6 | * Copyright 2004 Freescale Semiconductor, Inc. | ||||
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 7 | */ |
8 | |||||
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 9 | #include <command.h> |
Simon Glass | 9b61c7c | 2019-11-14 12:57:41 -0700 | [diff] [blame] | 10 | #include <irq_func.h> |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 11 | #include <mpc83xx.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 12 | #include <asm/global_data.h> |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 13 | #include <asm/processor.h> |
Simon Glass | 6b9f010 | 2020-05-10 11:40:06 -0600 | [diff] [blame] | 14 | #include <asm/ptrace.h> |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 15 | |
Wolfgang Denk | 6405a15 | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 16 | DECLARE_GLOBAL_DATA_PTR; |
17 | |||||
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 18 | struct irq_action { |
19 | interrupt_handler_t *handler; | ||||
20 | void *arg; | ||||
21 | ulong count; | ||||
22 | }; | ||||
23 | |||||
Tom Rini | ce10398 | 2017-08-13 22:44:37 -0400 | [diff] [blame] | 24 | void interrupt_init_cpu (unsigned *decrementer_count) |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 25 | { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 26 | volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR; |
Kumar Gala | 3b16c28 | 2006-01-11 11:19:12 -0600 | [diff] [blame] | 27 | |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 28 | *decrementer_count = (gd->bus_clk / 4) / CONFIG_SYS_HZ; |
Kumar Gala | 3b16c28 | 2006-01-11 11:19:12 -0600 | [diff] [blame] | 29 | |
30 | /* Enable e300 time base */ | ||||
31 | |||||
32 | immr->sysconf.spcr |= 0x00400000; | ||||
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 33 | } |
34 | |||||
35 | |||||
36 | /* | ||||
37 | * Handle external interrupts | ||||
38 | */ | ||||
39 | |||||
Simon Glass | f87959b | 2019-11-14 12:57:40 -0700 | [diff] [blame] | 40 | void external_interrupt(struct pt_regs *regs) |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 41 | { |
42 | } | ||||
43 | |||||
44 | |||||
45 | /* | ||||
46 | * Install and free an interrupt handler. | ||||
47 | */ | ||||
48 | |||||
49 | void | ||||
Simon Glass | f87959b | 2019-11-14 12:57:40 -0700 | [diff] [blame] | 50 | irq_install_handler(int irq, interrupt_handler_t * handler, void *arg) |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 51 | { |
52 | } | ||||
53 | |||||
54 | |||||
Simon Glass | f87959b | 2019-11-14 12:57:40 -0700 | [diff] [blame] | 55 | void irq_free_handler(int irq) |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 56 | { |
57 | } | ||||
58 | |||||
59 | |||||
60 | void timer_interrupt_cpu (struct pt_regs *regs) | ||||
61 | { | ||||
62 | /* nothing to do here */ | ||||
63 | return; | ||||
64 | } | ||||
65 | |||||
66 | |||||
Jon Loeliger | 526e5ce | 2007-07-09 19:06:00 -0500 | [diff] [blame] | 67 | #if defined(CONFIG_CMD_IRQ) |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 68 | |
69 | /* ripped this out of ppc4xx/interrupts.c */ | ||||
70 | |||||
71 | /* | ||||
72 | * irqinfo - print information about PCI devices | ||||
73 | */ | ||||
74 | |||||
Masahiro Yamada | f7ed78b | 2020-06-26 15:13:33 +0900 | [diff] [blame] | 75 | void do_irqinfo(struct cmd_tbl *cmdtp, struct bd_info *bd, int flag, int argc, |
Simon Glass | ed38aef | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 76 | char *const argv[]) |
Eran Liberty | 9095d4a | 2005-07-28 10:08:46 -0500 | [diff] [blame] | 77 | { |
78 | } | ||||
79 | |||||
Jon Loeliger | 526e5ce | 2007-07-09 19:06:00 -0500 | [diff] [blame] | 80 | #endif |