]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | // SPDX-License-Identifier: GPL-2.0+ |
42d1f039 WD |
2 | /* |
3 | * (C) Copyright 2000-2002 | |
4 | * Wolfgang Denk, DENX Software Engineering, [email protected]. | |
5 | * | |
6 | * (C) Copyright 2002 (440 port) | |
7 | * Scott McNutt, Artesyn Communication Producs, [email protected] | |
8 | * | |
9 | * (C) Copyright 2003 Motorola Inc. (MPC85xx port) | |
10 | * Xianghua Xiao ([email protected]) | |
42d1f039 WD |
11 | */ |
12 | ||
13 | #include <common.h> | |
c30b7adb | 14 | #include <irq_func.h> |
049f8d6f | 15 | #include <time.h> |
42d1f039 WD |
16 | #include <watchdog.h> |
17 | #include <command.h> | |
18 | #include <asm/processor.h> | |
05f6f664 | 19 | #include <asm/io.h> |
cc1dd33f JS |
20 | #ifdef CONFIG_POST |
21 | #include <post.h> | |
22 | #endif | |
42d1f039 | 23 | |
deff9b1d | 24 | void interrupt_init_cpu(unsigned *decrementer_count) |
42d1f039 | 25 | { |
680c613a | 26 | ccsr_pic_t __iomem *pic = (void *)CONFIG_SYS_MPC8xxx_PIC_ADDR; |
343117bf | 27 | |
cc1dd33f JS |
28 | #ifdef CONFIG_POST |
29 | /* | |
30 | * The POST word is stored in the PIC's TFRR register which gets | |
31 | * cleared when the PIC is reset. Save it off so we can restore it | |
32 | * later. | |
33 | */ | |
34 | ulong post_word = post_word_load(); | |
35 | #endif | |
36 | ||
05f6f664 TT |
37 | out_be32(&pic->gcr, MPC85xx_PICGCR_RST); |
38 | while (in_be32(&pic->gcr) & MPC85xx_PICGCR_RST) | |
9cff4448 | 39 | ; |
05f6f664 TT |
40 | out_be32(&pic->gcr, MPC85xx_PICGCR_M); |
41 | in_be32(&pic->gcr); | |
9cff4448 | 42 | |
6d0f6bcf | 43 | *decrementer_count = get_tbclk() / CONFIG_SYS_HZ; |
9cff4448 KG |
44 | |
45 | /* PIE is same as DIE, dec interrupt enable */ | |
3345d18d | 46 | mtspr(SPRN_TCR, mfspr(SPRN_TCR) | TCR_PIE); |
61a21e98 AF |
47 | |
48 | #ifdef CONFIG_INTERRUPTS | |
534ea6b6 | 49 | pic->iivpr1 = 0x810001; /* 50220 enable ecm interrupts */ |
52514699 | 50 | debug("iivpr1@%x = %x\n", (uint)&pic->iivpr1, pic->iivpr1); |
61a21e98 AF |
51 | |
52 | pic->iivpr2 = 0x810002; /* 50240 enable ddr interrupts */ | |
52514699 | 53 | debug("iivpr2@%x = %x\n", (uint)&pic->iivpr2, pic->iivpr2); |
61a21e98 AF |
54 | |
55 | pic->iivpr3 = 0x810003; /* 50260 enable lbc interrupts */ | |
52514699 | 56 | debug("iivpr3@%x = %x\n", (uint)&pic->iivpr3, pic->iivpr3); |
61a21e98 AF |
57 | |
58 | #ifdef CONFIG_PCI1 | |
59 | pic->iivpr8 = 0x810008; /* enable pci1 interrupts */ | |
52514699 | 60 | debug("iivpr8@%x = %x\n", (uint)&pic->iivpr8, pic->iivpr8); |
61a21e98 AF |
61 | #endif |
62 | #if defined(CONFIG_PCI2) || defined(CONFIG_PCIE2) | |
63 | pic->iivpr9 = 0x810009; /* enable pci1 interrupts */ | |
52514699 | 64 | debug("iivpr9@%x = %x\n", (uint)&pic->iivpr9, pic->iivpr9); |
61a21e98 AF |
65 | #endif |
66 | #ifdef CONFIG_PCIE1 | |
67 | pic->iivpr10 = 0x81000a; /* enable pcie1 interrupts */ | |
52514699 | 68 | debug("iivpr10@%x = %x\n", (uint)&pic->iivpr10, pic->iivpr10); |
61a21e98 AF |
69 | #endif |
70 | #ifdef CONFIG_PCIE3 | |
71 | pic->iivpr11 = 0x81000b; /* enable pcie3 interrupts */ | |
52514699 | 72 | debug("iivpr11@%x = %x\n", (uint)&pic->iivpr11, pic->iivpr11); |
61a21e98 AF |
73 | #endif |
74 | ||
75 | pic->ctpr=0; /* 40080 clear current task priority register */ | |
76 | #endif | |
77 | ||
cc1dd33f JS |
78 | #ifdef CONFIG_POST |
79 | post_word_store(post_word); | |
80 | #endif | |
42d1f039 WD |
81 | } |
82 | ||
9cff4448 | 83 | /* Install and free a interrupt handler. Not implemented yet. */ |
42d1f039 WD |
84 | |
85 | void | |
86 | irq_install_handler(int vec, interrupt_handler_t *handler, void *arg) | |
87 | { | |
88 | return; | |
89 | } | |
90 | ||
91 | void | |
92 | irq_free_handler(int vec) | |
93 | { | |
94 | return; | |
95 | } | |
96 | ||
9cff4448 | 97 | void timer_interrupt_cpu(struct pt_regs *regs) |
42d1f039 | 98 | { |
9cff4448 | 99 | /* PIS is same as DIS, dec interrupt status */ |
343117bf | 100 | mtspr(SPRN_TSR, TSR_PIS); |
42d1f039 WD |
101 | } |
102 | ||
4431283c | 103 | #if defined(CONFIG_CMD_IRQ) |
9cff4448 | 104 | /* irqinfo - print information about PCI devices,not implemented. */ |
09140113 | 105 | int do_irqinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
42d1f039 | 106 | { |
42d1f039 WD |
107 | return 0; |
108 | } | |
4431283c | 109 | #endif |