Josh Boyer | 8105fa8 | 2008-09-03 20:58:22 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Generic PowerPC 40x platform support |
| 3 | * |
| 4 | * Copyright 2008 IBM Corporation |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify it |
| 7 | * under the terms of the GNU General Public License as published by the |
| 8 | * Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This implements simple platform support for PowerPC 44x chips. This is |
| 11 | * mostly used for eval boards or other simple and "generic" 44x boards. If |
| 12 | * your board has custom functions or hardware, then you will likely want to |
| 13 | * implement your own board.c file to accommodate it. |
| 14 | */ |
| 15 | |
| 16 | #include <asm/machdep.h> |
| 17 | #include <asm/pci-bridge.h> |
| 18 | #include <asm/ppc4xx.h> |
| 19 | #include <asm/prom.h> |
| 20 | #include <asm/time.h> |
| 21 | #include <asm/udbg.h> |
| 22 | #include <asm/uic.h> |
| 23 | |
| 24 | #include <linux/init.h> |
| 25 | #include <linux/of_platform.h> |
| 26 | |
Uwe Kleine-König | ce6d73c | 2014-09-10 21:56:38 +0200 | [diff] [blame] | 27 | static const struct of_device_id ppc40x_of_bus[] __initconst = { |
Josh Boyer | 8105fa8 | 2008-09-03 20:58:22 -0400 | [diff] [blame] | 28 | { .compatible = "ibm,plb3", }, |
| 29 | { .compatible = "ibm,plb4", }, |
| 30 | { .compatible = "ibm,opb", }, |
| 31 | { .compatible = "ibm,ebc", }, |
| 32 | { .compatible = "simple-bus", }, |
| 33 | {}, |
| 34 | }; |
| 35 | |
| 36 | static int __init ppc40x_device_probe(void) |
| 37 | { |
| 38 | of_platform_bus_probe(NULL, ppc40x_of_bus, NULL); |
| 39 | |
| 40 | return 0; |
| 41 | } |
| 42 | machine_device_initcall(ppc40x_simple, ppc40x_device_probe); |
| 43 | |
| 44 | /* This is the list of boards that can be supported by this simple |
| 45 | * platform code. This does _not_ mean the boards are compatible, |
| 46 | * as they most certainly are not from a device tree perspective. |
| 47 | * However, their differences are handled by the device tree and the |
| 48 | * drivers and therefore they don't need custom board support files. |
| 49 | * |
| 50 | * Again, if your board needs to do things differently then create a |
| 51 | * board.c file for it rather than adding it to this list. |
| 52 | */ |
Andi Kleen | 9597abe | 2012-10-04 17:11:37 -0700 | [diff] [blame] | 53 | static const char * const board[] __initconst = { |
Josh Boyer | 194ff1c | 2009-06-03 05:24:12 +0000 | [diff] [blame] | 54 | "amcc,acadia", |
Josh Boyer | 336ff73 | 2009-06-03 05:28:03 +0000 | [diff] [blame] | 55 | "amcc,haleakala", |
| 56 | "amcc,kilauea", |
Solomon Peachy | 0cdf50a | 2009-08-20 10:19:47 +0000 | [diff] [blame] | 57 | "amcc,makalu", |
Tanmay Inamdar | d5b9ee7 | 2011-11-28 21:01:41 +0000 | [diff] [blame] | 58 | "apm,klondike", |
Benjamin Herrenschmidt | 11eab297 | 2011-12-01 19:35:08 +0000 | [diff] [blame] | 59 | "est,hotfoot", |
Gabor Juhos | e6449c9 | 2012-12-20 03:44:28 +0000 | [diff] [blame] | 60 | "plathome,obs600", |
| 61 | NULL |
Josh Boyer | 8105fa8 | 2008-09-03 20:58:22 -0400 | [diff] [blame] | 62 | }; |
| 63 | |
| 64 | static int __init ppc40x_probe(void) |
| 65 | { |
Grant Likely | a4f740c | 2010-10-30 11:49:09 -0400 | [diff] [blame] | 66 | if (of_flat_dt_match(of_get_flat_dt_root(), board)) { |
Rob Herring | 0e47ff1 | 2011-07-12 09:25:51 -0500 | [diff] [blame] | 67 | pci_set_flags(PCI_REASSIGN_ALL_RSRC); |
Grant Likely | a4f740c | 2010-10-30 11:49:09 -0400 | [diff] [blame] | 68 | return 1; |
Josh Boyer | 8105fa8 | 2008-09-03 20:58:22 -0400 | [diff] [blame] | 69 | } |
| 70 | |
| 71 | return 0; |
| 72 | } |
| 73 | |
| 74 | define_machine(ppc40x_simple) { |
| 75 | .name = "PowerPC 40x Platform", |
| 76 | .probe = ppc40x_probe, |
| 77 | .progress = udbg_progress, |
| 78 | .init_IRQ = uic_init_tree, |
| 79 | .get_irq = uic_get_irq, |
| 80 | .restart = ppc4xx_reset_system, |
| 81 | .calibrate_decr = generic_calibrate_decr, |
| 82 | }; |