eeh-ioda.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. #include <linux/bootmem.h>
  14. #include <linux/delay.h>
  15. #include <linux/init.h>
  16. #include <linux/io.h>
  17. #include <linux/irq.h>
  18. #include <linux/kernel.h>
  19. #include <linux/msi.h>
  20. #include <linux/pci.h>
  21. #include <linux/string.h>
  22. #include <asm/eeh.h>
  23. #include <asm/eeh_event.h>
  24. #include <asm/io.h>
  25. #include <asm/iommu.h>
  26. #include <asm/msi_bitmap.h>
  27. #include <asm/opal.h>
  28. #include <asm/pci-bridge.h>
  29. #include <asm/ppc-pci.h>
  30. #include <asm/tce.h>
  31. #include "powernv.h"
  32. #include "pci.h"
  33. /**
  34. * ioda_eeh_post_init - Chip dependent post initialization
  35. * @hose: PCI controller
  36. *
  37. * The function will be called after eeh PEs and devices
  38. * have been built. That means the EEH is ready to supply
  39. * service with I/O cache.
  40. */
  41. static int ioda_eeh_post_init(struct pci_controller *hose)
  42. {
  43. struct pnv_phb *phb = hose->private_data;
  44. /* FIXME: Enable it for PHB3 later */
  45. if (phb->type == PNV_PHB_IODA1)
  46. phb->eeh_enabled = 1;
  47. return 0;
  48. }
  49. struct pnv_eeh_ops ioda_eeh_ops = {
  50. .post_init = ioda_eeh_post_init,
  51. .set_option = NULL,
  52. .get_state = NULL,
  53. .reset = NULL,
  54. .get_log = NULL,
  55. .configure_bridge = NULL,
  56. .next_error = NULL
  57. };