[linux-yocto] [PATCH 28/70] powerpc/47x: add acpx1 board support
Paul Butler
butler.paul at gmail.com
Mon Jun 10 18:45:51 PDT 2013
From: Jiang Lu <lu.jiang at windriver.com>
Add acpx1 board support. The main features of this board include:
* ACP3488 device with four powerpc 476 cores
* 4GB of system memory
* One channel 10 GbE XAUI
* Eight SFP modules
* Cabled PCIe/sRIO to support connectivity to external host
Signed-off-by: Jiang Lu <lu.jiang at windriver.com>
---
arch/powerpc/platforms/44x/Kconfig | 18 ++++
arch/powerpc/platforms/44x/Makefile | 1 +
arch/powerpc/platforms/44x/acpx1.c | 174 ++++++++++++++++++++++++++++++++++++
3 files changed, 193 insertions(+)
create mode 100644 arch/powerpc/platforms/44x/acpx1.c
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 2e4e64a..e3ff769 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -197,6 +197,14 @@ config CURRITUCK
help
This option enables support for the IBM Currituck (476fpe) evaluation board
+config ELPASO
+ bool "Support for LSI's ACP ElPaso Evaluation board"
+ depends on (44x || 40x)
+ default n
+ select ACP
+ select PPC_CLOCK
+ select DEFAULT_UIMAGE
+
config ICON
bool "Icon"
depends on 44x
@@ -208,6 +216,16 @@ config ICON
help
This option enables support for the AMCC PPC440SPe evaluation board.
+config ACP
+ bool "Support for LSI's ACP Platform"
+ depends on (44x || 40x)
+ select PPC4xx_PCI_EXPRESS
+ default n
+ select 440GP
+ select PPC_FPU
+ select HAS_RAPIDIO
+ select PPC_CLOCK
+
config XILINX_VIRTEX440_GENERIC_BOARD
bool "Generic Xilinx Virtex 5 FXT board support"
depends on 44x
diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
index d03833a..a527e89 100644
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -11,3 +11,4 @@ obj-$(CONFIG_XILINX_ML510) += virtex_ml510.o
obj-$(CONFIG_ISS4xx) += iss4xx.o
obj-$(CONFIG_CANYONLANDS)+= canyonlands.o
obj-$(CONFIG_CURRITUCK) += currituck.o
+obj-$(CONFIG_ACP) += acpx1.o acpclock.o
\ No newline at end of file
diff --git a/arch/powerpc/platforms/44x/acpx1.c b/arch/powerpc/platforms/44x/acpx1.c
new file mode 100644
index 0000000..2dce7ad
--- /dev/null
+++ b/arch/powerpc/platforms/44x/acpx1.c
@@ -0,0 +1,174 @@
+/*
+ * PPC476 board specific routines
+ *
+ * - add udbg and clock support
+ *
+ * Copyright 2009 Torez Smith, IBM Corporation.
+ *
+ * Based on earlier code:
+ * Matt Porter <mporter at kernel.crashing.org>
+ * Copyright 2002-2005 MontaVista Software Inc.
+ *
+ * Eugene Surovegin <eugene.surovegin at zultys.com> or <ebs at ebshome.net>
+ * Copyright (c) 2003-2005 Zultys Technologies
+ *
+ * Rewritten and ported to the merged powerpc tree:
+ * Copyright 2007 David Gibson <dwg at au1.ibm.com>, IBM Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * These patches add ACP3400 support signed-off-by: john.jacques at lsi.com
+ */
+
+#include <linux/init.h>
+#include <linux/of_platform.h>
+#include <linux/rtc.h>
+
+#include <asm/machdep.h>
+#include <asm/prom.h>
+#include <asm/udbg.h>
+#include <asm/time.h>
+#include <asm/uic.h>
+#include <asm/ppc4xx.h>
+#include <asm/mpic.h>
+#include <asm/mmu.h>
+
+#include "acpclock.h"
+
+static __initdata struct of_device_id acpx14xx_of_bus[] = {
+ { .compatible = "ibm,plb4", },
+ { .compatible = "ibm,plb6", },
+ { .compatible = "ibm,opb", },
+ { .compatible = "ibm,ebc", },
+ { .compatible = "acp,rapidio-delta", },
+ {},
+};
+
+static int __init acpx14xx_device_probe(void)
+{
+ acp_clk_init();
+
+ of_platform_bus_probe(NULL, acpx14xx_of_bus, NULL);
+
+ return 0;
+}
+machine_device_initcall(acpx14xx, acpx14xx_device_probe);
+
+/* We can have either UICs or MPICs */
+static void __init acpx14xx_init_irq(void)
+{
+ struct device_node *np;
+
+ /* Find top level interrupt controller */
+ for_each_node_with_property(np, "interrupt-controller") {
+ if (of_get_property(np, "interrupts", NULL) == NULL)
+ break;
+ }
+ if (np == NULL)
+ panic("Can't find top level interrupt controller");
+
+ /* Check type and do appropriate initialization */
+ if (of_device_is_compatible(np, "chrp,open-pic")) {
+ /* The MPIC driver will get everything it needs from the
+ * device-tree, just pass 0 to all arguments
+ */
+ struct mpic *mpic =
+ mpic_alloc(np, 0, 0, 0, 0, " MPIC ");
+ BUG_ON(mpic == NULL);
+ mpic_init(mpic);
+ ppc_md.get_irq = mpic_get_irq;
+ } else
+ panic("Unrecognized top level interrupt controller");
+}
+
+#ifdef CONFIG_SMP
+static void __cpuinit smp_acpx14xx_setup_cpu(int cpu)
+{
+ mpic_setup_this_cpu();
+}
+
+static int __cpuinit smp_acpx14xx_kick_cpu(int cpu)
+{
+ struct device_node *cpunode = of_get_cpu_node(cpu, NULL);
+ const u64 *spin_table_addr_prop;
+ u32 *spin_table;
+ extern void __cpuinit start_secondary_47x(void);
+
+ BUG_ON(cpunode == NULL);
+
+ /* Assume spin table. We could test for the enable-method in
+ * the device-tree but currently there's little point as it's
+ * our only supported method
+ */
+ spin_table_addr_prop =
+ of_get_property(cpunode, "cpu-release-addr", NULL);
+
+ if (spin_table_addr_prop == NULL) {
+ pr_err("CPU%d: Can't start, macpx1ing cpu-release-addr !\n",
+ cpu);
+ return -1;
+ }
+
+ /* Assume it's mapped as part of the linear mapping. This is a bit
+ * fishy but will work fine for now
+ */
+ spin_table = (u32 *)__va(*spin_table_addr_prop);
+ pr_debug("CPU%d: Spin table mapped at %p\n", cpu, spin_table);
+
+ spin_table[3] = cpu;
+ smp_wmb();
+ spin_table[1] = __pa(start_secondary_47x);
+ mb();
+
+ return 0;
+}
+
+static struct smp_ops_t acpx1_smp_ops = {
+ .probe = smp_mpic_probe,
+ .message_pass = smp_mpic_message_pass,
+ .setup_cpu = smp_acpx14xx_setup_cpu,
+ .kick_cpu = smp_acpx14xx_kick_cpu,
+ .give_timebase = smp_generic_give_timebase,
+ .take_timebase = smp_generic_take_timebase,
+};
+
+static void __init acpx14xx_smp_init(void)
+{
+ if (mmu_has_feature(MMU_FTR_TYPE_47x))
+ smp_ops = &acpx1_smp_ops;
+}
+
+#else /* CONFIG_SMP */
+static void __init acpx14xx_smp_init(void) { }
+#endif /* CONFIG_SMP */
+
+static void __init acpx14xx_setup_arch(void)
+{
+ acpx14xx_smp_init();
+}
+
+/*
+ * Called very early, MMU is off, device-tree isn't unflattened
+ */
+static int __init acpx14xx_probe(void)
+{
+ unsigned long root = of_get_flat_dt_root();
+
+ if (!of_flat_dt_is_compatible(root, "ibm,acpx1-4xx"))
+ return 0;
+
+ return 1;
+}
+
+define_machine(acpx14xx) {
+ .name = "ACPX1",
+ .probe = acpx14xx_probe,
+ .progress = udbg_progress,
+ .init_IRQ = acpx14xx_init_irq,
+ .setup_arch = acpx14xx_setup_arch,
+ .restart = ppc4xx_reset_system,
+ .calibrate_decr = generic_calibrate_decr,
+};
--
1.8.3
More information about the linux-yocto
mailing list