linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
To: bluesmoke-devel@lists.sourceforge.net,
	linuxppc-dev@lists.ozlabs.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>
Subject: [PATCH 1/2] ppc/85xx: create a platform node for PCI EDAC device
Date: Sat,  4 Jun 2011 14:42:03 +0400	[thread overview]
Message-ID: <1307184123-30977-1-git-send-email-dbaryshkov@gmail.com> (raw)
In-Reply-To: <20110602124823.3b814b3f@schlenkerla.am.freescale.net>

As a device for pci node isn't created, create a special platform_device
for PCI EDAC device on MPC85xx.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 arch/powerpc/sysdev/fsl_pci.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 68ca929..2498229 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -381,6 +381,34 @@ int __init fsl_add_bridge(struct device_node *dev, int is_primary)
 	return 0;
 }
 
+static int __init fsl_add_pci_err(void)
+{
+	struct device_node *np;
+
+	/* Only PCI, not PCI Express! */
+	for_each_compatible_node(np, "pci", "fsl,mpc8540-pci") {
+		struct resource r[2] = {};
+
+		if (of_address_to_resource(np, 0, &r[0])) {
+			printk(KERN_WARNING
+					"Can't get register base for PCI EDAC!\n");
+			continue;
+		}
+		r[0].start += 0xe00;
+
+		if (of_irq_to_resource(np, 0, &r[1]) == NO_IRQ) {
+			printk(KERN_WARNING
+					"Can't get irq for PCI EDAC!\n");
+			continue;
+		}
+		platform_device_register_simple("mpc85xx_pci_err", -1,
+				r, ARRAY_SIZE(r));
+	}
+
+	return 0;
+}
+device_initcall(fsl_add_pci_err);
+
 DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8548E, quirk_fsl_pcie_header);
 DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8548, quirk_fsl_pcie_header);
 DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8543E, quirk_fsl_pcie_header);
-- 
1.7.4.4

      reply	other threads:[~2011-06-04 10:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01 12:28 [PATCH 1/2] ppc/85xx: create a platform node for PCI EDAC device Dmitry Eremin-Solenikov
2011-06-01 12:28 ` [PATCH 2/2] mpc85xx_edac: adapt to ppc/85xx changes for mpc85xx_pci_err Dmitry Eremin-Solenikov
2011-06-01 13:25 ` [PATCH 1/2] ppc/85xx: create a platform node for PCI EDAC device Anton Vorontsov
2011-06-01 14:55   ` Dmitry Eremin-Solenikov
2011-06-01 14:59     ` Anton Vorontsov
2011-06-01 16:08       ` Dmitry Eremin-Solenikov
2011-06-01 16:48     ` Scott Wood
2011-06-02 12:25       ` Dmitry Eremin-Solenikov
2011-06-02 15:14         ` Anton Vorontsov
2011-06-02 15:15           ` David Laight
2011-06-02 17:48         ` Scott Wood
2011-06-04 10:42           ` Dmitry Eremin-Solenikov [this message]

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=1307184123-30977-1-git-send-email-dbaryshkov@gmail.com \
    --to=dbaryshkov@gmail.com \
    --cc=benh@kernel.crashing.org \
    --cc=bluesmoke-devel@lists.sourceforge.net \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.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).