From: Gavin Shan <shangw@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Gavin Shan <shangw@linux.vnet.ibm.com>
Subject: [PATCH 19/22] powerpc/eeh: Initialization for PowerNV
Date: Wed, 15 May 2013 11:34:55 +0800 [thread overview]
Message-ID: <1368588898-16224-20-git-send-email-shangw@linux.vnet.ibm.com> (raw)
In-Reply-To: <1368588898-16224-1-git-send-email-shangw@linux.vnet.ibm.com>
The patch initializes EEH for PowerNV platform. Because the OPAL
APIs requires HUB ID, we need trace that through struct pnv_phb.
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
---
arch/powerpc/platforms/powernv/pci-ioda.c | 17 ++++++++++++++---
arch/powerpc/platforms/powernv/pci-p5ioc2.c | 6 ++++--
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 1da578b..4dc4027 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -978,6 +978,11 @@ static void pnv_pci_ioda_fixup(void)
pnv_pci_ioda_setup_PEs();
pnv_pci_ioda_setup_seg();
pnv_pci_ioda_setup_DMA();
+
+#ifdef CONFIG_EEH
+ eeh_addr_cache_build();
+ eeh_init();
+#endif
}
/*
@@ -1048,7 +1053,9 @@ static u32 pnv_ioda_bdfn_to_pe(struct pnv_phb *phb, struct pci_bus *bus,
return phb->ioda.pe_rmap[(bus->number << 8) | devfn];
}
-void __init pnv_pci_init_ioda_phb(struct device_node *np, int ioda_type)
+void __init pnv_pci_init_ioda_phb(struct device_node *np,
+ u64 hub_id,
+ int ioda_type)
{
struct pci_controller *hose;
static int primary = 1;
@@ -1086,6 +1093,7 @@ void __init pnv_pci_init_ioda_phb(struct device_node *np, int ioda_type)
hose->first_busno = 0;
hose->last_busno = 0xff;
hose->private_data = phb;
+ phb->hub_id = hub_id;
phb->opal_id = phb_id;
phb->type = ioda_type;
@@ -1171,6 +1179,9 @@ void __init pnv_pci_init_ioda_phb(struct device_node *np, int ioda_type)
phb->ioda.io_size, phb->ioda.io_segsize);
phb->hose->ops = &pnv_pci_ops;
+#ifdef CONFIG_EEH
+ phb->eeh_ops = &ioda_eeh_ops;
+#endif
/* Setup RID -> PE mapping function */
phb->bdfn_to_pe = pnv_ioda_bdfn_to_pe;
@@ -1208,7 +1219,7 @@ void __init pnv_pci_init_ioda_phb(struct device_node *np, int ioda_type)
void pnv_pci_init_ioda2_phb(struct device_node *np)
{
- pnv_pci_init_ioda_phb(np, PNV_PHB_IODA2);
+ pnv_pci_init_ioda_phb(np, 0, PNV_PHB_IODA2);
}
void __init pnv_pci_init_ioda_hub(struct device_node *np)
@@ -1231,6 +1242,6 @@ void __init pnv_pci_init_ioda_hub(struct device_node *np)
for_each_child_of_node(np, phbn) {
/* Look for IODA1 PHBs */
if (of_device_is_compatible(phbn, "ibm,ioda-phb"))
- pnv_pci_init_ioda_phb(phbn, PNV_PHB_IODA1);
+ pnv_pci_init_ioda_phb(phbn, hub_id, PNV_PHB_IODA1);
}
}
diff --git a/arch/powerpc/platforms/powernv/pci-p5ioc2.c b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
index 92b37a0..ae72616 100644
--- a/arch/powerpc/platforms/powernv/pci-p5ioc2.c
+++ b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
@@ -92,7 +92,7 @@ static void pnv_pci_p5ioc2_dma_dev_setup(struct pnv_phb *phb,
set_iommu_table_base(&pdev->dev, &phb->p5ioc2.iommu_table);
}
-static void __init pnv_pci_init_p5ioc2_phb(struct device_node *np,
+static void __init pnv_pci_init_p5ioc2_phb(struct device_node *np, u64 hub_id,
void *tce_mem, u64 tce_size)
{
struct pnv_phb *phb;
@@ -133,6 +133,7 @@ static void __init pnv_pci_init_p5ioc2_phb(struct device_node *np,
phb->hose->first_busno = 0;
phb->hose->last_busno = 0xff;
phb->hose->private_data = phb;
+ phb->hub_id = hub_id;
phb->opal_id = phb_id;
phb->type = PNV_PHB_P5IOC2;
phb->model = PNV_PHB_MODEL_P5IOC2;
@@ -226,7 +227,8 @@ void __init pnv_pci_init_p5ioc2_hub(struct device_node *np)
for_each_child_of_node(np, phbn) {
if (of_device_is_compatible(phbn, "ibm,p5ioc2-pcix") ||
of_device_is_compatible(phbn, "ibm,p5ioc2-pciex")) {
- pnv_pci_init_p5ioc2_phb(phbn, tce_mem, tce_per_phb);
+ pnv_pci_init_p5ioc2_phb(phbn, hub_id,
+ tce_mem, tce_per_phb);
tce_mem += tce_per_phb;
}
}
--
1.7.5.4
next prev parent reply other threads:[~2013-05-15 3:35 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-15 3:34 [PATCH v1 00/22] powerpc/eeh: Enhance converting EEH dev Gavin Shan
2013-05-15 3:34 ` [PATCH 01/22] " Gavin Shan
2013-05-15 3:34 ` [PATCH 02/22] powerpc/eeh: Function to tranverse PCI devices Gavin Shan
2013-05-15 3:34 ` [PATCH 03/22] powerpc/eeh: Make eeh_phb_pe_get() public Gavin Shan
2013-05-15 3:34 ` [PATCH 04/22] powerpc/eeh: Make eeh_pe_get() public Gavin Shan
2013-05-15 3:34 ` [PATCH 05/22] powerpc/eeh: Trace PCI bus from PE Gavin Shan
2013-05-15 3:34 ` [PATCH 06/22] powerpc/eeh: Make eeh_init() public Gavin Shan
2013-05-15 3:34 ` [PATCH 07/22] powerpc/eeh: EEH post initialization operation Gavin Shan
2013-05-15 3:34 ` [PATCH 08/22] powerpc/eeh: Refactor eeh_reset_pe_once() Gavin Shan
2013-05-15 3:34 ` [PATCH 09/22] powerpc/eeh: Delay EEH probe during hotplug Gavin Shan
2013-05-15 3:34 ` [PATCH 10/22] powerpc/eeh: Differentiate EEH events Gavin Shan
2013-05-15 3:34 ` [PATCH 11/22] powerpc/eeh: Sync OPAL API with firmware Gavin Shan
2013-05-15 3:34 ` [PATCH 12/22] powerpc/eeh: EEH backend for P7IOC Gavin Shan
2013-05-15 3:34 ` [PATCH 13/22] powerpc/eeh: I/O chip post initialization Gavin Shan
2013-05-15 3:34 ` [PATCH 14/22] powerpc/eeh: I/O chip EEH enable option Gavin Shan
2013-05-15 3:34 ` [PATCH 15/22] powerpc/eeh: I/O chip EEH state retrieval Gavin Shan
2013-05-15 3:34 ` [PATCH 16/22] powerpc/eeh: I/O chip PE reset Gavin Shan
2013-05-15 3:34 ` [PATCH 17/22] powerpc/eeh: I/O chip PE log and bridge setup Gavin Shan
2013-05-15 3:34 ` [PATCH 18/22] powerpc/eeh: PowerNV EEH backends Gavin Shan
2013-05-15 3:34 ` Gavin Shan [this message]
2013-05-15 3:34 ` [PATCH 20/22] powerpc/eeh: Enable EEH check for config access Gavin Shan
2013-05-15 3:34 ` [PATCH 21/22] powerpc/eeh: Process interrupts caused by EEH Gavin Shan
2013-05-15 3:34 ` [PATCH 22/22] powerpc/eeh: Connect EEH error interrupt handle Gavin Shan
2013-05-15 3:57 ` [PATCH v1 00/22] powerpc/eeh: Enhance converting EEH dev Benjamin Herrenschmidt
2013-05-15 5:30 ` Gavin Shan
2013-05-15 5:58 ` Benjamin Herrenschmidt
2013-05-15 8:47 ` Gavin Shan
2013-05-15 9:48 ` Benjamin Herrenschmidt
2013-05-16 2:44 ` Gavin Shan
-- strict thread matches above, loose matches on Subject: below --
2013-03-01 14:16 [PATCH v1 0/22] EEH support for PowerNV platform Gavin Shan
2013-03-01 14:17 ` [PATCH 19/22] powerpc/eeh: Initialization for PowerNV Gavin Shan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1368588898-16224-20-git-send-email-shangw@linux.vnet.ibm.com \
--to=shangw@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).