Hugh Blemings | 6bbc547 | 2007-12-21 15:39:28 +1100 | [diff] [blame] | 1 | /* |
| 2 | * Taishan board specific routines based off ebony.c code |
| 3 | * original copyrights below |
| 4 | * |
| 5 | * Matt Porter <mporter@kernel.crashing.org> |
| 6 | * Copyright 2002-2005 MontaVista Software Inc. |
| 7 | * |
| 8 | * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net> |
| 9 | * Copyright (c) 2003-2005 Zultys Technologies |
| 10 | * |
| 11 | * Rewritten and ported to the merged powerpc tree: |
| 12 | * Copyright 2007 David Gibson <dwg@au1.ibm.com>, IBM Corporation. |
| 13 | * |
| 14 | * Modified from ebony.c for taishan: |
| 15 | * Copyright 2007 Hugh Blemings <hugh@au.ibm.com>, IBM Corporation. |
| 16 | * |
| 17 | * This program is free software; you can redistribute it and/or modify it |
| 18 | * under the terms of the GNU General Public License as published by the |
| 19 | * Free Software Foundation; either version 2 of the License, or (at your |
| 20 | * option) any later version. |
| 21 | */ |
| 22 | |
| 23 | #include <linux/init.h> |
| 24 | #include <linux/of_platform.h> |
| 25 | |
| 26 | #include <asm/machdep.h> |
| 27 | #include <asm/prom.h> |
| 28 | #include <asm/udbg.h> |
| 29 | #include <asm/time.h> |
| 30 | #include <asm/uic.h> |
| 31 | #include <asm/pci-bridge.h> |
Stefan Roese | 93173ce | 2008-03-28 01:43:31 +1100 | [diff] [blame] | 32 | #include <asm/ppc4xx.h> |
Hugh Blemings | 6bbc547 | 2007-12-21 15:39:28 +1100 | [diff] [blame] | 33 | |
Josh Boyer | 8cb34d2 | 2007-12-24 08:40:31 -0600 | [diff] [blame] | 34 | static __initdata struct of_device_id taishan_of_bus[] = { |
Hugh Blemings | 6bbc547 | 2007-12-21 15:39:28 +1100 | [diff] [blame] | 35 | { .compatible = "ibm,plb4", }, |
| 36 | { .compatible = "ibm,opb", }, |
| 37 | { .compatible = "ibm,ebc", }, |
| 38 | {}, |
| 39 | }; |
| 40 | |
| 41 | static int __init taishan_device_probe(void) |
| 42 | { |
Hugh Blemings | 6bbc547 | 2007-12-21 15:39:28 +1100 | [diff] [blame] | 43 | of_platform_bus_probe(NULL, taishan_of_bus, NULL); |
| 44 | |
| 45 | return 0; |
| 46 | } |
Josh Boyer | 3f8c5c3 | 2007-12-24 10:42:02 -0600 | [diff] [blame] | 47 | machine_device_initcall(taishan, taishan_device_probe); |
Hugh Blemings | 6bbc547 | 2007-12-21 15:39:28 +1100 | [diff] [blame] | 48 | |
| 49 | /* |
| 50 | * Called very early, MMU is off, device-tree isn't unflattened |
| 51 | */ |
| 52 | static int __init taishan_probe(void) |
| 53 | { |
| 54 | unsigned long root = of_get_flat_dt_root(); |
| 55 | |
| 56 | if (!of_flat_dt_is_compatible(root, "amcc,taishan")) |
| 57 | return 0; |
| 58 | |
Benjamin Herrenschmidt | 25c24f3 | 2007-12-21 15:39:37 +1100 | [diff] [blame] | 59 | ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC; |
| 60 | |
Hugh Blemings | 6bbc547 | 2007-12-21 15:39:28 +1100 | [diff] [blame] | 61 | return 1; |
| 62 | } |
| 63 | |
| 64 | define_machine(taishan) { |
| 65 | .name = "Taishan", |
| 66 | .probe = taishan_probe, |
| 67 | .progress = udbg_progress, |
| 68 | .init_IRQ = uic_init_tree, |
| 69 | .get_irq = uic_get_irq, |
Stefan Roese | 93173ce | 2008-03-28 01:43:31 +1100 | [diff] [blame] | 70 | .restart = ppc4xx_reset_system, |
Hugh Blemings | 6bbc547 | 2007-12-21 15:39:28 +1100 | [diff] [blame] | 71 | .calibrate_decr = generic_calibrate_decr, |
| 72 | }; |