Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/293301/?format=api
{ "id": 293301, "url": "http://patchwork.ozlabs.org/api/patches/293301/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1385086116-10972-8-git-send-email-alistair@popple.id.au/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<1385086116-10972-8-git-send-email-alistair@popple.id.au>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/1385086116-10972-8-git-send-email-alistair@popple.id.au/", "date": "2013-11-22T02:08:36", "name": "[8/8] powerpc: Added PCI MSI support using the HSTA module", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "000a18744a8e546c51eda66102a3754dc2fb0f78", "submitter": { "id": 24781, "url": "http://patchwork.ozlabs.org/api/people/24781/?format=api", "name": "Alistair Popple", "email": "alistair@popple.id.au" }, "delegate": { "id": 14, "url": "http://patchwork.ozlabs.org/api/users/14/?format=api", "username": "benh", "first_name": "Benjamin", "last_name": "Herrenschmidt", "email": "benh@kernel.crashing.org" }, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1385086116-10972-8-git-send-email-alistair@popple.id.au/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/293301/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/293301/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@ozlabs.org" ], "Received": [ "from ozlabs.org (localhost [IPv6:::1])\n\tby ozlabs.org (Postfix) with ESMTP id 593062C052F\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 22 Nov 2013 13:13:33 +1100 (EST)", "by ozlabs.org (Postfix)\n\tid A34D62C0126; Fri, 22 Nov 2013 13:08:54 +1100 (EST)", "from ipmail04.adl6.internode.on.net (ipmail04.adl6.internode.on.net\n\t[IPv6:2001:44b8:8060:ff02:300:1:6:4])\n\tby ozlabs.org (Postfix) with ESMTP id 859E72C0375\n\tfor <linuxppc-dev@ozlabs.org>; Fri, 22 Nov 2013 13:08:54 +1100 (EST)", "from ibmaus65.lnk.telstra.net (HELO localhost) ([165.228.126.9])\n\tby ipmail04.adl6.internode.on.net with ESMTP;\n\t22 Nov 2013 12:38:54 +1030" ], "X-IronPort-Anti-Spam-Filtered": "true", "X-IronPort-Anti-Spam-Result": "AhsEANK7jlKl5H4JgWdsb2JhbABZhwq5P4E6DgEBFiYogiYBBSMECwFGEAgdAiYCAlcQCYgBsAKRCxeBKY1YB4JrgUcDlDCDYpVMKA", "From": "Alistair Popple <alistair@popple.id.au>", "To": "benh@kernel.crashing.org", "Subject": "=?UTF-8?q?=5BPATCH=208/8=5D=20powerpc=3A=20Added=20PCI=20MSI=20support=20using=20the=20HSTA=20module?=", "Date": "Fri, 22 Nov 2013 13:08:36 +1100", "Message-Id": "<1385086116-10972-8-git-send-email-alistair@popple.id.au>", "X-Mailer": "git-send-email 1.7.10.4", "In-Reply-To": "<1385086057-10884-1-git-send-email-alistair@popple.id.au>", "References": "<1385086057-10884-1-git-send-email-alistair@popple.id.au>", "MIME-Version": "1.0", "Cc": "linuxppc-dev@ozlabs.org, Alistair Popple <alistair@popple.id.au>", "X-BeenThere": "linuxppc-dev@lists.ozlabs.org", "X-Mailman-Version": "2.1.16rc2", "Precedence": "list", "List-Id": "Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>", "List-Unsubscribe": "<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>", "List-Archive": "<http://lists.ozlabs.org/pipermail/linuxppc-dev/>", "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>", "List-Help": "<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>", "List-Subscribe": "<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org", "Sender": "\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>" }, "content": "The PPC476GTR SoC supports message signalled interrupts (MSI) by writing\nto special addresses within the High Speed Transfer Assist (HSTA) module.\n\nThis patch adds support for PCI MSI with a new system device. The DMA\nwindow is also updated to allow access to the entire 42-bit address range\nto allow PCI devices write access to the HSTA module.\n\nSigned-off-by: Alistair Popple <alistair@popple.id.au>\n---\n arch/powerpc/boot/dts/akebono.dts | 46 +++++-\n arch/powerpc/platforms/44x/Kconfig | 2 +\n arch/powerpc/sysdev/Kconfig | 6 +\n arch/powerpc/sysdev/Makefile | 1 +\n arch/powerpc/sysdev/ppc4xx_hsta_msi.c | 266 +++++++++++++++++++++++++++++++++\n arch/powerpc/sysdev/ppc4xx_pci.c | 8 +-\n 6 files changed, 319 insertions(+), 10 deletions(-)\n create mode 100644 arch/powerpc/sysdev/ppc4xx_hsta_msi.c", "diff": "diff --git a/arch/powerpc/boot/dts/akebono.dts b/arch/powerpc/boot/dts/akebono.dts\nindex 6dd47e9..4cb917f 100644\n--- a/arch/powerpc/boot/dts/akebono.dts\n+++ b/arch/powerpc/boot/dts/akebono.dts\n@@ -82,6 +82,28 @@\n \t\tranges;\n \t\tclock-frequency = <200000000>; // 200Mhz\n \n+\t\tHSTA0: hsta@310000e0000 {\n+\t\t\tcompatible = \"ibm,476gtr-hsta-msi\", \"ibm,hsta-msi\";\n+\t\t\treg = <0x310 0x000e0000 0x0 0xf0>;\n+\t\t\tinterrupt-parent = <&MPIC>;\n+\t\t\tinterrupts = <108 0\n+\t\t\t\t 109 0\n+\t\t\t\t 110 0\n+\t\t\t\t 111 0\n+\t\t\t\t 112 0\n+\t\t\t\t 113 0\n+\t\t\t\t 114 0\n+\t\t\t\t 115 0\n+\t\t\t\t 116 0\n+\t\t\t\t 117 0\n+\t\t\t\t 118 0\n+\t\t\t\t 119 0\n+\t\t\t\t 120 0\n+\t\t\t\t 121 0\n+\t\t\t\t 122 0\n+\t\t\t\t 123 0>;\n+\t\t};\n+\n \t\tMAL0: mcmal {\n \t\t\tcompatible = \"ibm,mcmal-476gtr\", \"ibm,mcmal2\";\n \t\t\tdcr-reg = <0xc0000000 0x062>;\n@@ -242,8 +264,10 @@\n \t\t\tranges = <0x02000000 0x00000000 0x80000000 0x00000110 0x80000000 0x0 0x80000000\n \t\t\t 0x01000000 0x0 0x0 0x00000140 0x0 0x0 0x00010000>;\n \n-\t\t\t/* Inbound starting at 0 to memsize filled in by zImage */\n-\t\t\tdma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x0>;\n+\t\t\t/* Inbound starting at 0x0 to 0x40000000000. In order to use MSI\n+\t\t\t * PCI devices must be able to write to the HSTA module.\n+\t\t\t */\n+\t\t\tdma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x400 0x0>;\n \n \t\t\t/* This drives busses 0 to 0xf */\n \t\t\tbus-range = <0x0 0xf>;\n@@ -280,8 +304,10 @@\n \t\t\tranges = <0x02000000 0x00000000 0x80000000 0x00000210 0x80000000 0x0 0x80000000\n \t\t\t 0x01000000 0x0 0x0 0x00000240 0x0 0x0 0x00010000>;\n \n-\t\t\t/* Inbound starting at 0 to memsize filled in by zImage */\n-\t\t\tdma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x0>;\n+\t\t\t/* Inbound starting at 0x0 to 0x40000000000. In order to use MSI\n+\t\t\t * PCI devices must be able to write to the HSTA module.\n+\t\t\t */\n+\t\t\tdma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x400 0x0>;\n \n \t\t\t/* This drives busses 0 to 0xf */\n \t\t\tbus-range = <0x0 0xf>;\n@@ -318,8 +344,10 @@\n \t\t\tranges = <0x02000000 0x00000000 0x80000000 0x00000190 0x80000000 0x0 0x80000000\n \t\t\t 0x01000000 0x0 0x0 0x000001c0 0x0 0x0 0x00010000>;\n \n-\t\t\t/* Inbound starting at 0 to memsize filled in by zImage */\n-\t\t\tdma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x0>;\n+\t\t\t/* Inbound starting at 0x0 to 0x40000000000. In order to use MSI\n+\t\t\t * PCI devices must be able to write to the HSTA module.\n+\t\t\t */\n+\t\t\tdma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x400 0x0>;\n \n \t\t\t/* This drives busses 0 to 0xf */\n \t\t\tbus-range = <0x0 0xf>;\n@@ -356,8 +384,10 @@\n \t\t\tranges = <0x02000000 0x00000000 0x80000000 0x00000290 0x80000000 0x0 0x80000000\n \t\t\t 0x01000000 0x0 0x0 0x000002c0 0x0 0x0 0x00010000>;\n \n-\t\t\t/* Inbound starting at 0 to memsize filled in by zImage */\n-\t\t\tdma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x0>;\n+\t\t\t/* Inbound starting at 0x0 to 0x40000000000. In order to use MSI\n+\t\t\t * PCI devices must be able to write to the HSTA module.\n+\t\t\t */\n+\t\t\tdma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x400 0x0>;\n \n \t\t\t/* This drives busses 0 to 0xf */\n \t\t\tbus-range = <0x0 0xf>;\ndiff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig\nindex 9d20800..7bc993e 100644\n--- a/arch/powerpc/platforms/44x/Kconfig\n+++ b/arch/powerpc/platforms/44x/Kconfig\n@@ -206,6 +206,8 @@ config AKEBONO\n \tselect SWIOTLB\n \tselect 476\n \tselect PPC4xx_PCI_EXPRESS\n+\tselect PCI_MSI\n+\tselect PPC4xx_HSTA_MSI\n \tselect I2C\n \tselect I2C_IBM_IIC\n \tselect NETDEVICES\ndiff --git a/arch/powerpc/sysdev/Kconfig b/arch/powerpc/sysdev/Kconfig\nindex ab4cb54..d3d91ca 100644\n--- a/arch/powerpc/sysdev/Kconfig\n+++ b/arch/powerpc/sysdev/Kconfig\n@@ -7,6 +7,12 @@ config PPC4xx_PCI_EXPRESS\n \tdepends on PCI && 4xx\n \tdefault n\n \n+config PPC4xx_HSTA_MSI\n+\tbool\n+\tdepends on PCI_MSI\n+\tdepends on PCI && 4xx\n+\tdefault n\n+\n config PPC4xx_MSI\n \tbool\n \tdepends on PCI_MSI\ndiff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile\nindex f67ac90..7657fb7 100644\n--- a/arch/powerpc/sysdev/Makefile\n+++ b/arch/powerpc/sysdev/Makefile\n@@ -46,6 +46,7 @@ obj-$(CONFIG_OF_RTC)\t\t+= of_rtc.o\n ifeq ($(CONFIG_PCI),y)\n obj-$(CONFIG_4xx)\t\t+= ppc4xx_pci.o\n endif\n+obj-$(CONFIG_PPC4xx_HSTA_MSI)\t+= ppc4xx_hsta_msi.o\n obj-$(CONFIG_PPC4xx_MSI)\t+= ppc4xx_msi.o\n obj-$(CONFIG_PPC4xx_CPM)\t+= ppc4xx_cpm.o\n obj-$(CONFIG_PPC4xx_GPIO)\t+= ppc4xx_gpio.o\ndiff --git a/arch/powerpc/sysdev/ppc4xx_hsta_msi.c b/arch/powerpc/sysdev/ppc4xx_hsta_msi.c\nnew file mode 100644\nindex 0000000..dac3f3b\n--- /dev/null\n+++ b/arch/powerpc/sysdev/ppc4xx_hsta_msi.c\n@@ -0,0 +1,266 @@\n+/*\n+ * MSI support for PPC4xx SoCs using High Speed Transfer Assist (HSTA) for\n+ * generation of the interrupt.\n+ *\n+ * Copyright © 2013 Alistair Popple <alistair@popple.id.au> IBM Corporation\n+ *\n+ * This program is free software; you can redistribute it and/or modify it\n+ * under the terms of the GNU General Public License as published by the\n+ * Free Software Foundation; either version 2 of the License, or (at your\n+ * option) any later version.\n+ */\n+\n+#include <linux/kernel.h>\n+#include <linux/interrupt.h>\n+#include <linux/msi.h>\n+#include <linux/of.h>\n+#include <linux/of_platform.h>\n+#include <linux/pci.h>\n+#include <linux/semaphore.h>\n+#include <asm/msi_bitmap.h>\n+\n+/*\n+ * If TEST_IRQ is defined the driver will test that all MSI interrupts\n+ * can be generated by writing to the HSTA module from the CPU before\n+ * allowing MSI to be used. This increases system boot time and is\n+ * only needed to test correct operation of the HSTA so it isn't\n+ * enabled by default.\n+ */\n+#undef TEST_IRQ\n+\n+struct ppc4xx_hsta_msi {\n+\tstruct device *dev;\n+\n+\t/* The ioremapped HSTA MSI IO space */\n+\tu32 __iomem *data;\n+\n+\t/* Physical address of HSTA MSI IO space */\n+\tu64 address;\n+\tstruct msi_bitmap bmp;\n+\n+\t/* An array mapping offsets to hardware IRQs */\n+\tint *irq_map;\n+\n+#ifdef TEST_IRQ\n+\tstruct semaphore sem;\n+#endif\n+};\n+static struct ppc4xx_hsta_msi ppc4xx_hsta_msi;\n+\n+#ifdef TEST_IRQ\n+static irqreturn_t hsta_test_msi_irq(int irq, void *data)\n+{\n+\tpr_debug(\"HSTA MSI: Got test irq %d\\n\", irq);\n+\tup(&ppc4xx_hsta_msi.sem);\n+\treturn IRQ_HANDLED;\n+}\n+#endif\n+\n+static int hsta_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)\n+{\n+\tstruct msi_msg msg;\n+\tstruct msi_desc *entry;\n+\tint irq, hwirq;\n+\tu64 addr;\n+\n+\tlist_for_each_entry(entry, &dev->msi_list, list) {\n+\t\tirq = msi_bitmap_alloc_hwirqs(&ppc4xx_hsta_msi.bmp, 1);\n+\t\tif (irq < 0) {\n+\t\t\tpr_debug(\"%s: Failed to allocate msi interrupt\\n\",\n+\t\t\t\t __func__);\n+\t\t\treturn irq;\n+\t\t}\n+\n+\t\thwirq = ppc4xx_hsta_msi.irq_map[irq];\n+\t\tif (hwirq == NO_IRQ) {\n+\t\t\tpr_err(\"%s: Failed mapping irq %d\\n\", __func__, irq);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\t/*\n+\t\t * HSTA generates interrupts on writes to 128-bit aligned\n+\t\t * addresses.\n+\t\t */\n+\t\taddr = ppc4xx_hsta_msi.address + irq*0x10;\n+\t\tmsg.address_hi = upper_32_bits(addr);\n+\t\tmsg.address_lo = lower_32_bits(addr);\n+\n+\t\t/* Data is not used by the HSTA. */\n+\t\tmsg.data = 0;\n+\n+\t\tpr_debug(\"%s: Setup irq %d (0x%0llx)\\n\", __func__, hwirq,\n+\t\t\t (((u64) msg.address_hi) << 32) | msg.address_lo);\n+\n+\t\tif (irq_set_msi_desc(hwirq, entry)) {\n+\t\t\tpr_err(\n+\t\t\t\"%s: Invalid hwirq %d specified in device tree\\n\",\n+\t\t\t__func__, hwirq);\n+\t\t\tmsi_bitmap_free_hwirqs(&ppc4xx_hsta_msi.bmp, irq, 1);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t\twrite_msi_msg(hwirq, &msg);\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int hsta_find_hwirq_offset(int hwirq)\n+{\n+\tint irq;\n+\n+\t/* Find the offset given the hwirq */\n+\tfor (irq = 0; ppc4xx_hsta_msi.irq_map[irq] != hwirq;\n+\t irq++)\n+\t\t;\n+\n+\tif (ppc4xx_hsta_msi.irq_map[irq] != hwirq)\n+\t\tirq = -EINVAL;\n+\n+\treturn irq;\n+}\n+\n+static void hsta_teardown_msi_irqs(struct pci_dev *dev)\n+{\n+\tstruct msi_desc *entry;\n+\tint irq;\n+\n+\tlist_for_each_entry(entry, &dev->msi_list, list) {\n+\t\tif (entry->irq == NO_IRQ)\n+\t\t\tcontinue;\n+\n+\t\tirq = hsta_find_hwirq_offset(entry->irq);\n+\n+\t\t/* entry->irq should always be in irq_map */\n+\t\tBUG_ON(irq < 0);\n+\t\tirq_set_msi_desc(entry->irq, NULL);\n+\t\tmsi_bitmap_free_hwirqs(&ppc4xx_hsta_msi.bmp, irq, 1);\n+\t\tpr_debug(\"%s: Teardown IRQ %u (index %u)\\n\", __func__,\n+\t\t\t entry->irq, irq);\n+\t}\n+}\n+\n+static int hsta_msi_check_device(struct pci_dev *pdev, int nvec, int type)\n+{\n+\t/* We don't support MSI-X */\n+\tif (type == PCI_CAP_ID_MSIX) {\n+\t\tpr_debug(\"%s: MSI-X not supported.\\n\", __func__);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int hsta_msi_probe(struct platform_device *pdev)\n+{\n+\tstruct device *dev = &pdev->dev;\n+\tstruct resource *mem;\n+\tint irq, ret, irq_count;\n+\n+\tmem = platform_get_resource(pdev, IORESOURCE_MEM, 0);\n+\tif (IS_ERR(mem)) {\n+\t\tdev_err(dev, \"Unable to get mmio space\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tirq_count = of_irq_count(dev->of_node);\n+\tif (!irq_count) {\n+\t\tdev_err(dev, \"Unable to find IRQ range\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tppc4xx_hsta_msi.dev = dev;\n+\tppc4xx_hsta_msi.address = mem->start;\n+\tppc4xx_hsta_msi.data = ioremap(mem->start, resource_size(mem));\n+\tif (IS_ERR(ppc4xx_hsta_msi.data)) {\n+\t\tdev_err(dev, \"Unable to map memory\\n\");\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\tret = msi_bitmap_alloc(&ppc4xx_hsta_msi.bmp, irq_count, dev->of_node);\n+\tif (ret)\n+\t\tgoto out;\n+\n+\tppc4xx_hsta_msi.irq_map = kmalloc(sizeof(int) * irq_count, GFP_KERNEL);\n+\tif (IS_ERR(ppc4xx_hsta_msi.irq_map)) {\n+\t\tret = -ENOMEM;\n+\t\tgoto out1;\n+\t}\n+\n+\t/* Setup a mapping from irq offsets to hardware irq numbers */\n+\tfor (irq = 0; irq < irq_count; irq++) {\n+\t\tppc4xx_hsta_msi.irq_map[irq] =\n+\t\t\tirq_of_parse_and_map(dev->of_node, irq);\n+\t\tif (ppc4xx_hsta_msi.irq_map[irq] == NO_IRQ) {\n+\t\t\tdev_err(dev, \"Unable to map IRQ\\n\");\n+\t\t\tret = -EINVAL;\n+\t\t\tgoto out2;\n+\t\t}\n+\t}\n+\n+#ifdef TEST_IRQ\n+\t/* Test generation of MSI interrupts */\n+\tsemaphore_init(&ppc4xx_hsta_msi.sem, 0);\n+\tpr_info(\"HSTA MSI: Testing irq generation.\\n\");\n+\tfor (irq = 0; irq < irq_count; irq++) {\n+\t\tint hwirq = ppc4xx_hsta_msi.irq_map[irq];\n+\t\tret = request_irq(hwirq, hsta_test_msi_irq, 0,\n+\t\t\t\t\"hsta-test-msi-irq\", NULL);\n+\t\tif (ret) {\n+\t\t\tpr_err(\"HSTA MSI: Can't get interrupt %d.\\n\", hwirq);\n+\t\t\tgoto out2;\n+\t\t}\n+\n+\t\t/*\n+\t\t * Interrupts are generated by writes to the HSTA memory space\n+\t\t * at 128-bit aligned offsets.\n+\t\t */\n+\t\tppc4xx_hsta_msi.data[irq*4] = 0x0;\n+\t\tif (down_timeout(&ppc4xx_hsta_msi.sem, 0.5 * HZ)) {\n+\t\t\tpr_err(\"HSTA MSI: Timeout waiting for interrupt %d.\\n\",\n+\t\t\t\thwirq);\n+\t\t\tret = -ETIME;\n+\t\t\tfree_irq(hwirq, NULL);\n+\t\t\tgoto out2;\n+\t\t}\n+\t\tfree_irq(hwirq, NULL);\n+\t}\n+\tpr_info(\"HSTA MSI: Irq test completed successfully.\\n\");\n+#endif\n+\n+\tppc_md.setup_msi_irqs = hsta_setup_msi_irqs;\n+\tppc_md.teardown_msi_irqs = hsta_teardown_msi_irqs;\n+\tppc_md.msi_check_device = hsta_msi_check_device;\n+\treturn 0;\n+\n+out2:\n+\tkfree(ppc4xx_hsta_msi.irq_map);\n+\n+out1:\n+\tmsi_bitmap_free(&ppc4xx_hsta_msi.bmp);\n+\n+out:\n+\tiounmap(ppc4xx_hsta_msi.data);\n+\treturn ret;\n+}\n+\n+static const struct of_device_id hsta_msi_ids[] = {\n+\t{\n+\t\t.compatible = \"ibm,hsta-msi\",\n+\t},\n+\t{}\n+};\n+\n+static struct platform_driver hsta_msi_driver = {\n+\t.probe = hsta_msi_probe,\n+\t.driver = {\n+\t\t.name = \"hsta-msi\",\n+\t\t.owner = THIS_MODULE,\n+\t\t.of_match_table = hsta_msi_ids,\n+\t},\n+};\n+\n+static int hsta_msi_init(void)\n+{\n+\treturn platform_driver_register(&hsta_msi_driver);\n+}\n+subsys_initcall(hsta_msi_init);\ndiff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c\nindex 771a0ba..fad9031 100644\n--- a/arch/powerpc/sysdev/ppc4xx_pci.c\n+++ b/arch/powerpc/sysdev/ppc4xx_pci.c\n@@ -176,8 +176,12 @@ static int __init ppc4xx_parse_dma_ranges(struct pci_controller *hose,\n \t\treturn -ENXIO;\n \t}\n \n-\t/* Check that we are fully contained within 32 bits space */\n-\tif (res->end > 0xffffffff) {\n+\t/* Check that we are fully contained within 32 bits space if we are not\n+\t * running on a 460sx or 476fpe which have 64 bit bus addresses.\n+\t */\n+\tif (res->end > 0xffffffff &&\n+\t !(of_device_is_compatible(hose->dn, \"ibm,plb-pciex-460sx\")\n+\t || of_device_is_compatible(hose->dn, \"ibm,plb-pciex-476fpe\"))) {\n \t\tprintk(KERN_ERR \"%s: dma-ranges outside of 32 bits space\\n\",\n \t\t hose->dn->full_name);\n \t\treturn -ENXIO;\n", "prefixes": [ "8/8" ] }