Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/293296/?format=api
{ "id": 293296, "url": "http://patchwork.ozlabs.org/api/patches/293296/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1385086116-10972-6-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-6-git-send-email-alistair@popple.id.au>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/1385086116-10972-6-git-send-email-alistair@popple.id.au/", "date": "2013-11-22T02:08:34", "name": "[6/8] IBM Currituck: Clean up board specific code before adding Akebono code", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "c20eed12925a82d80bb125bb9a36ea1e04d97d81", "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-6-git-send-email-alistair@popple.id.au/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/293296/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/293296/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 0BECD2C053E\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 22 Nov 2013 13:12:15 +1100 (EST)", "by ozlabs.org (Postfix)\n\tid CC4482C00C2; Fri, 22 Nov 2013 13:08:51 +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 A1CD02C0354\n\tfor <linuxppc-dev@ozlabs.org>; Fri, 22 Nov 2013 13:08:51 +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:50 +1030" ], "X-IronPort-Anti-Spam-Filtered": "true", "X-IronPort-Anti-Spam-Result": "AhsEANK7jlKl5H4JgWdsb2JhbABZhwq5P4E6DgEBFiYogiYBBSMECwFGEAgdAiYCAlcZiAGwApELF4EpjVgHgmuBRwOYEpN6gVIo", "From": "Alistair Popple <alistair@popple.id.au>", "To": "benh@kernel.crashing.org", "Subject": "=?UTF-8?q?=5BPATCH=206/8=5D=20IBM=20Currituck=3A=20Clean=20up=20board=20specific=20code=20before=20adding=20Akebono=20code?=", "Date": "Fri, 22 Nov 2013 13:08:34 +1100", "Message-Id": "<1385086116-10972-6-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 IBM Akebono code uses the same initialisation functions as the\nearlier Currituck board. Rather than create a copy of this code for\nAkebono we will instead integrate support for it into the same file as\nthe Currituck code.\n\nThis patch renames the board support file and updates the 476FPE PCI\ncode to use a more generic name.\n\nSigned-off-by: Alistair Popple <alistair@popple.id.au>\n---\n arch/powerpc/platforms/44x/Kconfig | 4 +-\n arch/powerpc/platforms/44x/Makefile | 2 +-\n arch/powerpc/platforms/44x/currituck.c | 233 --------------------------------\n arch/powerpc/platforms/44x/ppc476.c | 233 ++++++++++++++++++++++++++++++++\n arch/powerpc/sysdev/ppc4xx_pci.c | 20 +--\n arch/powerpc/sysdev/ppc4xx_pci.h | 4 +-\n 6 files changed, 248 insertions(+), 248 deletions(-)\n delete mode 100644 arch/powerpc/platforms/44x/currituck.c\n create mode 100644 arch/powerpc/platforms/44x/ppc476.c", "diff": "diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig\nindex d6c7506..156d474 100644\n--- a/arch/powerpc/platforms/44x/Kconfig\n+++ b/arch/powerpc/platforms/44x/Kconfig\n@@ -194,7 +194,7 @@ config CURRITUCK\n \tdepends on PPC_47x\n \tdefault n\n \tselect SWIOTLB\n-\tselect 476FPE\n+\tselect 476\n \tselect PPC4xx_PCI_EXPRESS\n \thelp\n \t This option enables support for the IBM Currituck (476fpe) evaluation board\n@@ -314,7 +314,7 @@ config 460SX\n \tselect IBM_EMAC_ZMII\n \tselect IBM_EMAC_TAH\n \n-config 476FPE\n+config 476\n \tbool\n \tselect PPC_FPU\n \ndiff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile\nindex d03833a..f896b89 100644\n--- a/arch/powerpc/platforms/44x/Makefile\n+++ b/arch/powerpc/platforms/44x/Makefile\n@@ -10,4 +10,4 @@ obj-$(CONFIG_XILINX_VIRTEX_5_FXT) += virtex.o\n obj-$(CONFIG_XILINX_ML510) += virtex_ml510.o\n obj-$(CONFIG_ISS4xx)\t+= iss4xx.o\n obj-$(CONFIG_CANYONLANDS)+= canyonlands.o\n-obj-$(CONFIG_CURRITUCK)\t+= currituck.o\n+obj-$(CONFIG_CURRITUCK)\t+= ppc476.o\ndiff --git a/arch/powerpc/platforms/44x/currituck.c b/arch/powerpc/platforms/44x/currituck.c\ndeleted file mode 100644\nindex 7f1b71a..0000000\n--- a/arch/powerpc/platforms/44x/currituck.c\n+++ /dev/null\n@@ -1,233 +0,0 @@\n-/*\n- * Currituck board specific routines\n- *\n- * Copyright © 2011 Tony Breeds IBM Corporation\n- *\n- * Based on earlier code:\n- * Matt Porter <mporter@kernel.crashing.org>\n- * Copyright 2002-2005 MontaVista Software Inc.\n- *\n- * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>\n- * Copyright (c) 2003-2005 Zultys Technologies\n- *\n- * Rewritten and ported to the merged powerpc tree:\n- * Copyright 2007 David Gibson <dwg@au1.ibm.com>, IBM Corporation.\n- * Copyright © 2011 David Kliekamp 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/init.h>\n-#include <linux/of.h>\n-#include <linux/of_platform.h>\n-#include <linux/rtc.h>\n-\n-#include <asm/machdep.h>\n-#include <asm/prom.h>\n-#include <asm/udbg.h>\n-#include <asm/time.h>\n-#include <asm/uic.h>\n-#include <asm/ppc4xx.h>\n-#include <asm/mpic.h>\n-#include <asm/mmu.h>\n-\n-#include <linux/pci.h>\n-\n-static __initdata struct of_device_id ppc47x_of_bus[] = {\n-\t{ .compatible = \"ibm,plb4\", },\n-\t{ .compatible = \"ibm,plb6\", },\n-\t{ .compatible = \"ibm,opb\", },\n-\t{ .compatible = \"ibm,ebc\", },\n-\t{},\n-};\n-\n-/* The EEPROM is missing and the default values are bogus. This forces USB in\n- * to EHCI mode */\n-static void quirk_ppc_currituck_usb_fixup(struct pci_dev *dev)\n-{\n-\tif (of_machine_is_compatible(\"ibm,currituck\")) {\n-\t\tpci_write_config_dword(dev, 0xe0, 0x0114231f);\n-\t\tpci_write_config_dword(dev, 0xe4, 0x00006c40);\n-\t}\n-}\n-DECLARE_PCI_FIXUP_HEADER(0x1033, 0x0035, quirk_ppc_currituck_usb_fixup);\n-\n-static int __init ppc47x_device_probe(void)\n-{\n-\tof_platform_bus_probe(NULL, ppc47x_of_bus, NULL);\n-\n-\treturn 0;\n-}\n-machine_device_initcall(ppc47x, ppc47x_device_probe);\n-\n-/* We can have either UICs or MPICs */\n-static void __init ppc47x_init_irq(void)\n-{\n-\tstruct device_node *np;\n-\n-\t/* Find top level interrupt controller */\n-\tfor_each_node_with_property(np, \"interrupt-controller\") {\n-\t\tif (of_get_property(np, \"interrupts\", NULL) == NULL)\n-\t\t\tbreak;\n-\t}\n-\tif (np == NULL)\n-\t\tpanic(\"Can't find top level interrupt controller\");\n-\n-\t/* Check type and do appropriate initialization */\n-\tif (of_device_is_compatible(np, \"chrp,open-pic\")) {\n-\t\t/* The MPIC driver will get everything it needs from the\n-\t\t * device-tree, just pass 0 to all arguments\n-\t\t */\n-\t\tstruct mpic *mpic =\n-\t\t\tmpic_alloc(np, 0, MPIC_NO_RESET, 0, 0, \" MPIC \");\n-\t\tBUG_ON(mpic == NULL);\n-\t\tmpic_init(mpic);\n-\t\tppc_md.get_irq = mpic_get_irq;\n-\t} else\n-\t\tpanic(\"Unrecognized top level interrupt controller\");\n-}\n-\n-#ifdef CONFIG_SMP\n-static void smp_ppc47x_setup_cpu(int cpu)\n-{\n-\tmpic_setup_this_cpu();\n-}\n-\n-static int smp_ppc47x_kick_cpu(int cpu)\n-{\n-\tstruct device_node *cpunode = of_get_cpu_node(cpu, NULL);\n-\tconst u64 *spin_table_addr_prop;\n-\tu32 *spin_table;\n-\textern void start_secondary_47x(void);\n-\n-\tBUG_ON(cpunode == NULL);\n-\n-\t/* Assume spin table. We could test for the enable-method in\n-\t * the device-tree but currently there's little point as it's\n-\t * our only supported method\n-\t */\n-\tspin_table_addr_prop =\n-\t\tof_get_property(cpunode, \"cpu-release-addr\", NULL);\n-\n-\tif (spin_table_addr_prop == NULL) {\n-\t\tpr_err(\"CPU%d: Can't start, missing cpu-release-addr !\\n\",\n-\t\t cpu);\n-\t\treturn 1;\n-\t}\n-\n-\t/* Assume it's mapped as part of the linear mapping. This is a bit\n-\t * fishy but will work fine for now\n-\t *\n-\t * XXX: Is there any reason to assume differently?\n-\t */\n-\tspin_table = (u32 *)__va(*spin_table_addr_prop);\n-\tpr_debug(\"CPU%d: Spin table mapped at %p\\n\", cpu, spin_table);\n-\n-\tspin_table[3] = cpu;\n-\tsmp_wmb();\n-\tspin_table[1] = __pa(start_secondary_47x);\n-\tmb();\n-\n-\treturn 0;\n-}\n-\n-static struct smp_ops_t ppc47x_smp_ops = {\n-\t.probe\t\t= smp_mpic_probe,\n-\t.message_pass\t= smp_mpic_message_pass,\n-\t.setup_cpu\t= smp_ppc47x_setup_cpu,\n-\t.kick_cpu\t= smp_ppc47x_kick_cpu,\n-\t.give_timebase\t= smp_generic_give_timebase,\n-\t.take_timebase\t= smp_generic_take_timebase,\n-};\n-\n-static void __init ppc47x_smp_init(void)\n-{\n-\tif (mmu_has_feature(MMU_FTR_TYPE_47x))\n-\t\tsmp_ops = &ppc47x_smp_ops;\n-}\n-\n-#else /* CONFIG_SMP */\n-static void __init ppc47x_smp_init(void) { }\n-#endif /* CONFIG_SMP */\n-\n-static void __init ppc47x_setup_arch(void)\n-{\n-\n-\t/* No need to check the DMA config as we /know/ our windows are all of\n- \t * RAM. Lets hope that doesn't change */\n-\tswiotlb_detect_4g();\n-\n-\tppc47x_smp_init();\n-}\n-\n-/*\n- * Called very early, MMU is off, device-tree isn't unflattened\n- */\n-static int __init ppc47x_probe(void)\n-{\n-\tunsigned long root = of_get_flat_dt_root();\n-\n-\tif (!of_flat_dt_is_compatible(root, \"ibm,currituck\"))\n-\t\treturn 0;\n-\n-\treturn 1;\n-}\n-\n-static int board_rev = -1;\n-static int __init ppc47x_get_board_rev(void)\n-{\n-\tu8 fpga_reg0;\n-\tvoid *fpga;\n-\tstruct device_node *np;\n-\n-\tnp = of_find_compatible_node(NULL, NULL, \"ibm,currituck-fpga\");\n-\tif (!np)\n-\t\tgoto fail;\n-\n-\tfpga = of_iomap(np, 0);\n-\tof_node_put(np);\n-\tif (!fpga)\n-\t\tgoto fail;\n-\n-\tfpga_reg0 = ioread8(fpga);\n-\tboard_rev = fpga_reg0 & 0x03;\n-\tpr_info(\"%s: Found board revision %d\\n\", __func__, board_rev);\n-\tiounmap(fpga);\n-\treturn 0;\n-\n-fail:\n-\tpr_info(\"%s: Unable to find board revision\\n\", __func__);\n-\treturn 0;\n-}\n-machine_arch_initcall(ppc47x, ppc47x_get_board_rev);\n-\n-/* Use USB controller should have been hardware swizzled but it wasn't :( */\n-static void ppc47x_pci_irq_fixup(struct pci_dev *dev)\n-{\n-\tif (dev->vendor == 0x1033 && (dev->device == 0x0035 ||\n-\t dev->device == 0x00e0)) {\n-\t\tif (board_rev == 0) {\n-\t\t\tdev->irq = irq_create_mapping(NULL, 47);\n-\t\t\tpr_info(\"%s: Mapping irq %d\\n\", __func__, dev->irq);\n-\t\t} else if (board_rev == 2) {\n-\t\t\tdev->irq = irq_create_mapping(NULL, 49);\n-\t\t\tpr_info(\"%s: Mapping irq %d\\n\", __func__, dev->irq);\n-\t\t} else {\n-\t\t\tpr_alert(\"%s: Unknown board revision\\n\", __func__);\n-\t\t}\n-\t}\n-}\n-\n-define_machine(ppc47x) {\n-\t.name\t\t\t= \"PowerPC 47x\",\n-\t.probe\t\t\t= ppc47x_probe,\n-\t.progress\t\t= udbg_progress,\n-\t.init_IRQ\t\t= ppc47x_init_irq,\n-\t.setup_arch\t\t= ppc47x_setup_arch,\n-\t.pci_irq_fixup\t\t= ppc47x_pci_irq_fixup,\n-\t.restart\t\t= ppc4xx_reset_system,\n-\t.calibrate_decr\t\t= generic_calibrate_decr,\n-};\ndiff --git a/arch/powerpc/platforms/44x/ppc476.c b/arch/powerpc/platforms/44x/ppc476.c\nnew file mode 100644\nindex 0000000..c6c5a6f\n--- /dev/null\n+++ b/arch/powerpc/platforms/44x/ppc476.c\n@@ -0,0 +1,233 @@\n+/*\n+ * PowerPC 476FPE board specific routines\n+ *\n+ * Copyright © 2011 Tony Breeds IBM Corporation\n+ *\n+ * Based on earlier code:\n+ * Matt Porter <mporter@kernel.crashing.org>\n+ * Copyright 2002-2005 MontaVista Software Inc.\n+ *\n+ * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>\n+ * Copyright (c) 2003-2005 Zultys Technologies\n+ *\n+ * Rewritten and ported to the merged powerpc tree:\n+ * Copyright 2007 David Gibson <dwg@au1.ibm.com>, IBM Corporation.\n+ * Copyright © 2011 David Kliekamp 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/init.h>\n+#include <linux/of.h>\n+#include <linux/of_platform.h>\n+#include <linux/rtc.h>\n+\n+#include <asm/machdep.h>\n+#include <asm/prom.h>\n+#include <asm/udbg.h>\n+#include <asm/time.h>\n+#include <asm/uic.h>\n+#include <asm/ppc4xx.h>\n+#include <asm/mpic.h>\n+#include <asm/mmu.h>\n+\n+#include <linux/pci.h>\n+\n+static struct of_device_id ppc47x_of_bus[] __initdata = {\n+\t{ .compatible = \"ibm,plb4\", },\n+\t{ .compatible = \"ibm,plb6\", },\n+\t{ .compatible = \"ibm,opb\", },\n+\t{ .compatible = \"ibm,ebc\", },\n+\t{},\n+};\n+\n+/* The EEPROM is missing and the default values are bogus. This forces USB in\n+ * to EHCI mode */\n+static void quirk_ppc_currituck_usb_fixup(struct pci_dev *dev)\n+{\n+\tif (of_machine_is_compatible(\"ibm,currituck\")) {\n+\t\tpci_write_config_dword(dev, 0xe0, 0x0114231f);\n+\t\tpci_write_config_dword(dev, 0xe4, 0x00006c40);\n+\t}\n+}\n+DECLARE_PCI_FIXUP_HEADER(0x1033, 0x0035, quirk_ppc_currituck_usb_fixup);\n+\n+static int __init ppc47x_device_probe(void)\n+{\n+\tof_platform_bus_probe(NULL, ppc47x_of_bus, NULL);\n+\n+\treturn 0;\n+}\n+machine_device_initcall(ppc47x, ppc47x_device_probe);\n+\n+/* We can have either UICs or MPICs */\n+static void __init ppc47x_init_irq(void)\n+{\n+\tstruct device_node *np;\n+\n+\t/* Find top level interrupt controller */\n+\tfor_each_node_with_property(np, \"interrupt-controller\") {\n+\t\tif (of_get_property(np, \"interrupts\", NULL) == NULL)\n+\t\t\tbreak;\n+\t}\n+\tif (np == NULL)\n+\t\tpanic(\"Can't find top level interrupt controller\");\n+\n+\t/* Check type and do appropriate initialization */\n+\tif (of_device_is_compatible(np, \"chrp,open-pic\")) {\n+\t\t/* The MPIC driver will get everything it needs from the\n+\t\t * device-tree, just pass 0 to all arguments\n+\t\t */\n+\t\tstruct mpic *mpic =\n+\t\t\tmpic_alloc(np, 0, MPIC_NO_RESET, 0, 0, \" MPIC \");\n+\t\tBUG_ON(mpic == NULL);\n+\t\tmpic_init(mpic);\n+\t\tppc_md.get_irq = mpic_get_irq;\n+\t} else\n+\t\tpanic(\"Unrecognized top level interrupt controller\");\n+}\n+\n+#ifdef CONFIG_SMP\n+static void smp_ppc47x_setup_cpu(int cpu)\n+{\n+\tmpic_setup_this_cpu();\n+}\n+\n+static int smp_ppc47x_kick_cpu(int cpu)\n+{\n+\tstruct device_node *cpunode = of_get_cpu_node(cpu, NULL);\n+\tconst u64 *spin_table_addr_prop;\n+\tu32 *spin_table;\n+\textern void start_secondary_47x(void);\n+\n+\tBUG_ON(cpunode == NULL);\n+\n+\t/* Assume spin table. We could test for the enable-method in\n+\t * the device-tree but currently there's little point as it's\n+\t * our only supported method\n+\t */\n+\tspin_table_addr_prop =\n+\t\tof_get_property(cpunode, \"cpu-release-addr\", NULL);\n+\n+\tif (spin_table_addr_prop == NULL) {\n+\t\tpr_err(\"CPU%d: Can't start, missing cpu-release-addr !\\n\",\n+\t\t cpu);\n+\t\treturn 1;\n+\t}\n+\n+\t/* Assume it's mapped as part of the linear mapping. This is a bit\n+\t * fishy but will work fine for now\n+\t *\n+\t * XXX: Is there any reason to assume differently?\n+\t */\n+\tspin_table = (u32 *)__va(*spin_table_addr_prop);\n+\tpr_debug(\"CPU%d: Spin table mapped at %p\\n\", cpu, spin_table);\n+\n+\tspin_table[3] = cpu;\n+\tsmp_wmb();\n+\tspin_table[1] = __pa(start_secondary_47x);\n+\tmb();\n+\n+\treturn 0;\n+}\n+\n+static struct smp_ops_t ppc47x_smp_ops = {\n+\t.probe\t\t= smp_mpic_probe,\n+\t.message_pass\t= smp_mpic_message_pass,\n+\t.setup_cpu\t= smp_ppc47x_setup_cpu,\n+\t.kick_cpu\t= smp_ppc47x_kick_cpu,\n+\t.give_timebase\t= smp_generic_give_timebase,\n+\t.take_timebase\t= smp_generic_take_timebase,\n+};\n+\n+static void __init ppc47x_smp_init(void)\n+{\n+\tif (mmu_has_feature(MMU_FTR_TYPE_47x))\n+\t\tsmp_ops = &ppc47x_smp_ops;\n+}\n+\n+#else /* CONFIG_SMP */\n+static void __init ppc47x_smp_init(void) { }\n+#endif /* CONFIG_SMP */\n+\n+static void __init ppc47x_setup_arch(void)\n+{\n+\n+\t/* No need to check the DMA config as we /know/ our windows are all of\n+\t * RAM. Lets hope that doesn't change */\n+\tswiotlb_detect_4g();\n+\n+\tppc47x_smp_init();\n+}\n+\n+/*\n+ * Called very early, MMU is off, device-tree isn't unflattened\n+ */\n+static int __init ppc47x_probe(void)\n+{\n+\tunsigned long root = of_get_flat_dt_root();\n+\n+\tif (!of_flat_dt_is_compatible(root, \"ibm,currituck\"))\n+\t\treturn 0;\n+\n+\treturn 1;\n+}\n+\n+static int board_rev = -1;\n+static int __init ppc47x_get_board_rev(void)\n+{\n+\tu8 fpga_reg0;\n+\tvoid *fpga;\n+\tstruct device_node *np;\n+\n+\tnp = of_find_compatible_node(NULL, NULL, \"ibm,currituck-fpga\");\n+\tif (!np)\n+\t\tgoto fail;\n+\n+\tfpga = of_iomap(np, 0);\n+\tof_node_put(np);\n+\tif (!fpga)\n+\t\tgoto fail;\n+\n+\tfpga_reg0 = ioread8(fpga);\n+\tboard_rev = fpga_reg0 & 0x03;\n+\tpr_info(\"%s: Found board revision %d\\n\", __func__, board_rev);\n+\tiounmap(fpga);\n+\treturn 0;\n+\n+fail:\n+\tpr_info(\"%s: Unable to find board revision\\n\", __func__);\n+\treturn 0;\n+}\n+machine_arch_initcall(ppc47x, ppc47x_get_board_rev);\n+\n+/* Use USB controller should have been hardware swizzled but it wasn't :( */\n+static void ppc47x_pci_irq_fixup(struct pci_dev *dev)\n+{\n+\tif (dev->vendor == 0x1033 && (dev->device == 0x0035 ||\n+\t\t\t\t dev->device == 0x00e0)) {\n+\t\tif (board_rev == 0) {\n+\t\t\tdev->irq = irq_create_mapping(NULL, 47);\n+\t\t\tpr_info(\"%s: Mapping irq %d\\n\", __func__, dev->irq);\n+\t\t} else if (board_rev == 2) {\n+\t\t\tdev->irq = irq_create_mapping(NULL, 49);\n+\t\t\tpr_info(\"%s: Mapping irq %d\\n\", __func__, dev->irq);\n+\t\t} else {\n+\t\t\tpr_alert(\"%s: Unknown board revision\\n\", __func__);\n+\t\t}\n+\t}\n+}\n+\n+define_machine(ppc47x) {\n+\t.name\t\t\t= \"PowerPC 47x\",\n+\t.probe\t\t\t= ppc47x_probe,\n+\t.progress\t\t= udbg_progress,\n+\t.init_IRQ\t\t= ppc47x_init_irq,\n+\t.setup_arch\t\t= ppc47x_setup_arch,\n+\t.pci_irq_fixup\t\t= ppc47x_pci_irq_fixup,\n+\t.restart\t\t= ppc4xx_reset_system,\n+\t.calibrate_decr\t\t= generic_calibrate_decr,\n+};\ndiff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c\nindex 64603a1..dba5e4d 100644\n--- a/arch/powerpc/sysdev/ppc4xx_pci.c\n+++ b/arch/powerpc/sysdev/ppc4xx_pci.c\n@@ -1366,13 +1366,13 @@ static struct ppc4xx_pciex_hwops ppc405ex_pcie_hwops __initdata =\n \n #endif /* CONFIG_40x */\n \n-#ifdef CONFIG_476FPE\n-static int __init ppc_476fpe_pciex_core_init(struct device_node *np)\n+#ifdef CONFIG_476\n+static int __init ppc476_pciex_core_init(struct device_node *np)\n {\n \treturn 4;\n }\n \n-static void __init ppc_476fpe_pciex_check_link(struct ppc4xx_pciex_port *port)\n+static void __init ppc476_pciex_check_link(struct ppc4xx_pciex_port *port)\n {\n \tu32 timeout_ms = 20;\n \tu32 val = 0, mask = (PECFG_TLDLP_LNKUP|PECFG_TLDLP_PRESENT);\n@@ -1405,12 +1405,12 @@ static void __init ppc_476fpe_pciex_check_link(struct ppc4xx_pciex_port *port)\n \treturn;\n }\n \n-static struct ppc4xx_pciex_hwops ppc_476fpe_pcie_hwops __initdata =\n+static struct ppc4xx_pciex_hwops ppc476_pcie_hwops __initdata =\n {\n-\t.core_init\t= ppc_476fpe_pciex_core_init,\n-\t.check_link\t= ppc_476fpe_pciex_check_link,\n+\t.core_init\t= ppc476_pciex_core_init,\n+\t.check_link\t= ppc476_pciex_check_link,\n };\n-#endif /* CONFIG_476FPE */\n+#endif /* CONFIG_476 */\n \n /* Check that the core has been initied and if not, do it */\n static int __init ppc4xx_pciex_check_core_init(struct device_node *np)\n@@ -1439,9 +1439,9 @@ static int __init ppc4xx_pciex_check_core_init(struct device_node *np)\n \tif (of_device_is_compatible(np, \"ibm,plb-pciex-405ex\"))\n \t\tppc4xx_pciex_hwops = &ppc405ex_pcie_hwops;\n #endif\n-#ifdef CONFIG_476FPE\n+#ifdef CONFIG_476\n \tif (of_device_is_compatible(np, \"ibm,plb-pciex-476fpe\"))\n-\t\tppc4xx_pciex_hwops = &ppc_476fpe_pcie_hwops;\n+\t\tppc4xx_pciex_hwops = &ppc476_pcie_hwops;\n #endif\n \tif (ppc4xx_pciex_hwops == NULL) {\n \t\tprintk(KERN_WARNING \"PCIE: unknown host type %s\\n\",\n@@ -1753,7 +1753,7 @@ static int __init ppc4xx_setup_one_pciex_POM(struct ppc4xx_pciex_port\t*port,\n \t\t\t\t\t| DCRO_PEGPL_OMRxMSKL_VAL);\n \t\telse if (of_device_is_compatible(port->node, \"ibm,plb-pciex-476fpe\"))\n \t\t\tdcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKL,\n-\t\t\t\tsa | DCRO_PEGPL_476FPE_OMR1MSKL_UOT\n+\t\t\t\tsa | DCRO_PEGPL_476_OMR1MSKL_UOT\n \t\t\t\t\t| DCRO_PEGPL_OMRxMSKL_VAL);\n \t\telse\n \t\t\tdcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKL,\ndiff --git a/arch/powerpc/sysdev/ppc4xx_pci.h b/arch/powerpc/sysdev/ppc4xx_pci.h\nindex bb48219..6412011 100644\n--- a/arch/powerpc/sysdev/ppc4xx_pci.h\n+++ b/arch/powerpc/sysdev/ppc4xx_pci.h\n@@ -476,12 +476,12 @@\n #define DCRO_PEGPL_OMR1MSKL_UOT\t 0x00000002\n #define DCRO_PEGPL_OMR3MSKL_IO\t 0x00000002\n \n-/* 476FPE */\n+/* PPC476 */\n #define PCCFG_LCPA\t\t\t0x270\n #define PECFG_TLDLP\t\t\t0x3F8\n #define PECFG_TLDLP_LNKUP\t\t0x00000008\n #define PECFG_TLDLP_PRESENT\t\t0x00000010\n-#define DCRO_PEGPL_476FPE_OMR1MSKL_UOT\t 0x00000004\n+#define DCRO_PEGPL_476_OMR1MSKL_UOT\t 0x00000004\n \n /* SDR Bit Mappings */\n #define PESDRx_RCSSET_HLDPLB\t0x10000000\n", "prefixes": [ "6/8" ] }