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