diff options
author | Gavin Shan <shangw@linux.vnet.ibm.com> | 2013-06-20 01:21:06 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-06-20 03:06:20 -0400 |
commit | 8747f36324bbe7f762bd9744d2dd20ebda021547 (patch) | |
tree | b7f124fdd12fa156d88ca7955a438c5948fa0c8c /arch/powerpc | |
parent | 23773230c823cf79415a436aa26009025008fef5 (diff) |
powerpc/eeh: EEH backend for P7IOC
For EEH on PowerNV platform, the overall architecture is different
from that on pSeries platform. In order to support multiple I/O chips
in future, we split EEH to 3 layers for PowerNV platform: EEH core,
platform layer, I/O layer. It would give EEH implementation on PowerNV
platform much more flexibility in future.
The patch adds the EEH backend for P7IOC.
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/platforms/powernv/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/eeh-ioda.c | 45 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/pci.h | 23 |
3 files changed, 69 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/Makefile b/arch/powerpc/platforms/powernv/Makefile index bcc3cb48a44e..09bd0cbb7c4f 100644 --- a/arch/powerpc/platforms/powernv/Makefile +++ b/arch/powerpc/platforms/powernv/Makefile | |||
@@ -3,3 +3,4 @@ obj-y += opal-rtc.o opal-nvram.o | |||
3 | 3 | ||
4 | obj-$(CONFIG_SMP) += smp.o | 4 | obj-$(CONFIG_SMP) += smp.o |
5 | obj-$(CONFIG_PCI) += pci.o pci-p5ioc2.o pci-ioda.o | 5 | obj-$(CONFIG_PCI) += pci.o pci-p5ioc2.o pci-ioda.o |
6 | obj-$(CONFIG_EEH) += eeh-ioda.o | ||
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c new file mode 100644 index 000000000000..f12e8887b144 --- /dev/null +++ b/arch/powerpc/platforms/powernv/eeh-ioda.c | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * The file intends to implement the functions needed by EEH, which is | ||
3 | * built on IODA compliant chip. Actually, lots of functions related | ||
4 | * to EEH would be built based on the OPAL APIs. | ||
5 | * | ||
6 | * Copyright Benjamin Herrenschmidt & Gavin Shan, IBM Corporation 2013. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | */ | ||
13 | |||
14 | #include <linux/bootmem.h> | ||
15 | #include <linux/delay.h> | ||
16 | #include <linux/init.h> | ||
17 | #include <linux/io.h> | ||
18 | #include <linux/irq.h> | ||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/msi.h> | ||
21 | #include <linux/pci.h> | ||
22 | #include <linux/string.h> | ||
23 | |||
24 | #include <asm/eeh.h> | ||
25 | #include <asm/eeh_event.h> | ||
26 | #include <asm/io.h> | ||
27 | #include <asm/iommu.h> | ||
28 | #include <asm/msi_bitmap.h> | ||
29 | #include <asm/opal.h> | ||
30 | #include <asm/pci-bridge.h> | ||
31 | #include <asm/ppc-pci.h> | ||
32 | #include <asm/tce.h> | ||
33 | |||
34 | #include "powernv.h" | ||
35 | #include "pci.h" | ||
36 | |||
37 | struct pnv_eeh_ops ioda_eeh_ops = { | ||
38 | .post_init = NULL, | ||
39 | .set_option = NULL, | ||
40 | .get_state = NULL, | ||
41 | .reset = NULL, | ||
42 | .get_log = NULL, | ||
43 | .configure_bridge = NULL, | ||
44 | .next_error = NULL | ||
45 | }; | ||
diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h index 25d76c4df50b..336c9dc1b314 100644 --- a/arch/powerpc/platforms/powernv/pci.h +++ b/arch/powerpc/platforms/powernv/pci.h | |||
@@ -66,15 +66,35 @@ struct pnv_ioda_pe { | |||
66 | struct list_head list; | 66 | struct list_head list; |
67 | }; | 67 | }; |
68 | 68 | ||
69 | /* IOC dependent EEH operations */ | ||
70 | #ifdef CONFIG_EEH | ||
71 | struct pnv_eeh_ops { | ||
72 | int (*post_init)(struct pci_controller *hose); | ||
73 | int (*set_option)(struct eeh_pe *pe, int option); | ||
74 | int (*get_state)(struct eeh_pe *pe); | ||
75 | int (*reset)(struct eeh_pe *pe, int option); | ||
76 | int (*get_log)(struct eeh_pe *pe, int severity, | ||
77 | char *drv_log, unsigned long len); | ||
78 | int (*configure_bridge)(struct eeh_pe *pe); | ||
79 | int (*next_error)(struct eeh_pe **pe); | ||
80 | }; | ||
81 | #endif /* CONFIG_EEH */ | ||
82 | |||
69 | struct pnv_phb { | 83 | struct pnv_phb { |
70 | struct pci_controller *hose; | 84 | struct pci_controller *hose; |
71 | enum pnv_phb_type type; | 85 | enum pnv_phb_type type; |
72 | enum pnv_phb_model model; | 86 | enum pnv_phb_model model; |
87 | u64 hub_id; | ||
73 | u64 opal_id; | 88 | u64 opal_id; |
74 | void __iomem *regs; | 89 | void __iomem *regs; |
75 | int initialized; | 90 | int initialized; |
76 | spinlock_t lock; | 91 | spinlock_t lock; |
77 | 92 | ||
93 | #ifdef CONFIG_EEH | ||
94 | struct pnv_eeh_ops *eeh_ops; | ||
95 | int eeh_enabled; | ||
96 | #endif | ||
97 | |||
78 | #ifdef CONFIG_PCI_MSI | 98 | #ifdef CONFIG_PCI_MSI |
79 | unsigned int msi_base; | 99 | unsigned int msi_base; |
80 | unsigned int msi32_support; | 100 | unsigned int msi32_support; |
@@ -150,6 +170,9 @@ struct pnv_phb { | |||
150 | }; | 170 | }; |
151 | 171 | ||
152 | extern struct pci_ops pnv_pci_ops; | 172 | extern struct pci_ops pnv_pci_ops; |
173 | #ifdef CONFIG_EEH | ||
174 | extern struct pnv_eeh_ops ioda_eeh_ops; | ||
175 | #endif | ||
153 | 176 | ||
154 | extern void pnv_pci_setup_iommu_table(struct iommu_table *tbl, | 177 | extern void pnv_pci_setup_iommu_table(struct iommu_table *tbl, |
155 | void *tce_mem, u64 tce_size, | 178 | void *tce_mem, u64 tce_size, |