aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/platforms/40x/ppc40x_simple.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 08:28:25 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 08:28:25 -0700
commit9bf9b2f3ad6362cdc9ef79291d440a92960b8f51 (patch)
treec50a317a619096a6ec84c243fafef50388004df6 /arch/powerpc/platforms/40x/ppc40x_simple.c
parent9779a8325a9bbf4ccd3853e0e4064984cf9da9c9 (diff)
parent54622f10a6aabb8bb2bdacf3dd070046f03dc246 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (53 commits) powerpc: Support for relocatable kdump kernel powerpc: Don't use a 16G page if beyond mem= limits powerpc: Add del_node() for early boot code to prune inapplicable devices. powerpc: Further compile fixup for STRICT_MM_TYPECHECKS powerpc: Remove empty #else from signal_64.c powerpc: Move memory size print into common show_cpuinfo for 32-bit hvc_console: Remove __devexit annotation of hvc_remove() hvc_console: Add support for tty window resizing hvc_console: Fix loop if put_char() returns 0 hvc_console: Add tty driver flag TTY_DRIVER_RESET_TERMIOS hvc_console: Add a hangup notifier for backends powerpc/83xx: Add DS1339 RTC support for MPC8349E-mITX boards .dts powerpc/83xx: Add support for MCU microcontroller in .dts files powerpc/85xx: Move mpc8572ds.dts to address-cells/size-cells = <2> of/spi: Support specifying chip select as active high via device tree powerpc: Remove device_type = "board_control" properties in .dts files i2c-cpm: Suppress autoprobing for devices powerpc/85xx: Fix mpc8536ds dma interrupt numbers powerpc/85xx: Enable enhanced functions for 8536 TSEC powerpc: Delete unused prom_strtoul and prom_memparse ...
Diffstat (limited to 'arch/powerpc/platforms/40x/ppc40x_simple.c')
-rw-r--r--arch/powerpc/platforms/40x/ppc40x_simple.c80
1 files changed, 80 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/40x/ppc40x_simple.c b/arch/powerpc/platforms/40x/ppc40x_simple.c
new file mode 100644
index 00000000000..4498a86b46c
--- /dev/null
+++ b/arch/powerpc/platforms/40x/ppc40x_simple.c
@@ -0,0 +1,80 @@
+/*
+ * Generic PowerPC 40x platform support
+ *
+ * Copyright 2008 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; version 2 of the License.
+ *
+ * This implements simple platform support for PowerPC 44x chips. This is
+ * mostly used for eval boards or other simple and "generic" 44x boards. If
+ * your board has custom functions or hardware, then you will likely want to
+ * implement your own board.c file to accommodate it.
+ */
+
+#include <asm/machdep.h>
+#include <asm/pci-bridge.h>
+#include <asm/ppc4xx.h>
+#include <asm/prom.h>
+#include <asm/time.h>
+#include <asm/udbg.h>
+#include <asm/uic.h>
+
+#include <linux/init.h>
+#include <linux/of_platform.h>
+
+static __initdata struct of_device_id ppc40x_of_bus[] = {
+ { .compatible = "ibm,plb3", },
+ { .compatible = "ibm,plb4", },
+ { .compatible = "ibm,opb", },
+ { .compatible = "ibm,ebc", },
+ { .compatible = "simple-bus", },
+ {},
+};
+
+static int __init ppc40x_device_probe(void)
+{
+ of_platform_bus_probe(NULL, ppc40x_of_bus, NULL);
+
+ return 0;
+}
+machine_device_initcall(ppc40x_simple, ppc40x_device_probe);
+
+/* This is the list of boards that can be supported by this simple
+ * platform code. This does _not_ mean the boards are compatible,
+ * as they most certainly are not from a device tree perspective.
+ * However, their differences are handled by the device tree and the
+ * drivers and therefore they don't need custom board support files.
+ *
+ * Again, if your board needs to do things differently then create a
+ * board.c file for it rather than adding it to this list.
+ */
+static char *board[] __initdata = {
+ "amcc,acadia"
+};
+
+static int __init ppc40x_probe(void)
+{
+ unsigned long root = of_get_flat_dt_root();
+ int i = 0;
+
+ for (i = 0; i < ARRAY_SIZE(board); i++) {
+ if (of_flat_dt_is_compatible(root, board[i])) {
+ ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+define_machine(ppc40x_simple) {
+ .name = "PowerPC 40x Platform",
+ .probe = ppc40x_probe,
+ .progress = udbg_progress,
+ .init_IRQ = uic_init_tree,
+ .get_irq = uic_get_irq,
+ .restart = ppc4xx_reset_system,
+ .calibrate_decr = generic_calibrate_decr,
+};