Josh Boyer | 775d5a1 | 2008-08-19 11:25:15 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Generic PowerPC 44x 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 | |
| 27 | static __initdata struct of_device_id ppc44x_of_bus[] = { |
| 28 | { .compatible = "ibm,plb4", }, |
| 29 | { .compatible = "ibm,opb", }, |
| 30 | { .compatible = "ibm,ebc", }, |
| 31 | { .compatible = "simple-bus", }, |
| 32 | {}, |
| 33 | }; |
| 34 | |
| 35 | static int __init ppc44x_device_probe(void) |
| 36 | { |
| 37 | of_platform_bus_probe(NULL, ppc44x_of_bus, NULL); |
| 38 | |
| 39 | return 0; |
| 40 | } |
| 41 | machine_device_initcall(ppc44x_simple, ppc44x_device_probe); |
| 42 | |
| 43 | /* This is the list of boards that can be supported by this simple |
| 44 | * platform code. This does _not_ mean the boards are compatible, |
| 45 | * as they most certainly are not from a device tree perspective. |
| 46 | * However, their differences are handled by the device tree and the |
| 47 | * drivers and therefore they don't need custom board support files. |
| 48 | * |
| 49 | * Again, if your board needs to do things differently then create a |
| 50 | * board.c file for it rather than adding it to this list. |
| 51 | */ |
| 52 | static char *board[] __initdata = { |
Victor Gallardo | e00de30 | 2008-10-01 23:29:06 -0700 | [diff] [blame] | 53 | "amcc,arches", |
Josh Boyer | 775d5a1 | 2008-08-19 11:25:15 -0400 | [diff] [blame] | 54 | "amcc,bamboo", |
Vinh Nguyen Huu Tuong | 7c80116 | 2011-12-20 02:43:34 +0000 | [diff] [blame] | 55 | "apm,bluestone", |
Josh Boyer | ded563c | 2008-08-19 11:27:01 -0400 | [diff] [blame] | 56 | "amcc,glacier", |
Josh Boyer | 775d5a1 | 2008-08-19 11:25:15 -0400 | [diff] [blame] | 57 | "ibm,ebony", |
fkan@amcc.com | c9f7509 | 2009-08-12 14:38:47 +0000 | [diff] [blame] | 58 | "amcc,eiger", |
Josh Boyer | 775d5a1 | 2008-08-19 11:25:15 -0400 | [diff] [blame] | 59 | "amcc,katmai", |
| 60 | "amcc,rainier", |
Madhulika Madishetty | 6c71209 | 2009-02-05 13:31:36 +0000 | [diff] [blame] | 61 | "amcc,redwood", |
Josh Boyer | 775d5a1 | 2008-08-19 11:25:15 -0400 | [diff] [blame] | 62 | "amcc,sequoia", |
Josh Boyer | 38d56f1 | 2008-08-19 11:27:05 -0400 | [diff] [blame] | 63 | "amcc,taishan", |
Stefan Roese | a89eda2 | 2010-05-11 03:55:34 +0000 | [diff] [blame] | 64 | "amcc,yosemite", |
| 65 | "mosaixtech,icon" |
Josh Boyer | 775d5a1 | 2008-08-19 11:25:15 -0400 | [diff] [blame] | 66 | }; |
| 67 | |
| 68 | static int __init ppc44x_probe(void) |
| 69 | { |
| 70 | unsigned long root = of_get_flat_dt_root(); |
| 71 | int i = 0; |
| 72 | |
| 73 | for (i = 0; i < ARRAY_SIZE(board); i++) { |
| 74 | if (of_flat_dt_is_compatible(root, board[i])) { |
Rob Herring | 0e47ff1 | 2011-07-12 09:25:51 -0500 | [diff] [blame] | 75 | pci_set_flags(PCI_REASSIGN_ALL_RSRC); |
Josh Boyer | 775d5a1 | 2008-08-19 11:25:15 -0400 | [diff] [blame] | 76 | return 1; |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | return 0; |
| 81 | } |
| 82 | |
| 83 | define_machine(ppc44x_simple) { |
| 84 | .name = "PowerPC 44x Platform", |
| 85 | .probe = ppc44x_probe, |
| 86 | .progress = udbg_progress, |
| 87 | .init_IRQ = uic_init_tree, |
| 88 | .get_irq = uic_get_irq, |
| 89 | .restart = ppc4xx_reset_system, |
| 90 | .calibrate_decr = generic_calibrate_decr, |
| 91 | }; |