Gavin Shan | 8747f36 | 2013-06-20 13:21:06 +0800 | [diff] [blame] | 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 | |
Gavin Shan | 73370c6 | 2013-06-20 13:21:07 +0800 | [diff] [blame^] | 37 | /** |
| 38 | * ioda_eeh_post_init - Chip dependent post initialization |
| 39 | * @hose: PCI controller |
| 40 | * |
| 41 | * The function will be called after eeh PEs and devices |
| 42 | * have been built. That means the EEH is ready to supply |
| 43 | * service with I/O cache. |
| 44 | */ |
| 45 | static int ioda_eeh_post_init(struct pci_controller *hose) |
| 46 | { |
| 47 | struct pnv_phb *phb = hose->private_data; |
| 48 | |
| 49 | /* FIXME: Enable it for PHB3 later */ |
| 50 | if (phb->type == PNV_PHB_IODA1) |
| 51 | phb->eeh_enabled = 1; |
| 52 | |
| 53 | return 0; |
| 54 | } |
| 55 | |
Gavin Shan | 8747f36 | 2013-06-20 13:21:06 +0800 | [diff] [blame] | 56 | struct pnv_eeh_ops ioda_eeh_ops = { |
Gavin Shan | 73370c6 | 2013-06-20 13:21:07 +0800 | [diff] [blame^] | 57 | .post_init = ioda_eeh_post_init, |
Gavin Shan | 8747f36 | 2013-06-20 13:21:06 +0800 | [diff] [blame] | 58 | .set_option = NULL, |
| 59 | .get_state = NULL, |
| 60 | .reset = NULL, |
| 61 | .get_log = NULL, |
| 62 | .configure_bridge = NULL, |
| 63 | .next_error = NULL |
| 64 | }; |