Grant Likely | 486ba7e | 2007-10-02 12:15:29 +1000 | [diff] [blame] | 1 | /* |
| 2 | * Xilinx Virtex (IIpro & 4FX) based board support |
| 3 | * |
| 4 | * Copyright 2007 Secret Lab Technologies Ltd. |
| 5 | * |
| 6 | * This file is licensed under the terms of the GNU General Public License |
| 7 | * version 2. This program is licensed "as is" without any warranty of any |
| 8 | * kind, whether express or implied. |
| 9 | */ |
| 10 | |
| 11 | #include <linux/init.h> |
| 12 | #include <linux/of_platform.h> |
| 13 | #include <asm/machdep.h> |
| 14 | #include <asm/prom.h> |
| 15 | #include <asm/time.h> |
| 16 | #include <asm/xilinx_intc.h> |
Roderick Colenbrander | 64f1650 | 2009-06-06 10:14:22 -0600 | [diff] [blame] | 17 | #include <asm/xilinx_pci.h> |
Stefan Roese | 93173ce | 2008-03-28 01:43:31 +1100 | [diff] [blame] | 18 | #include <asm/ppc4xx.h> |
Grant Likely | 486ba7e | 2007-10-02 12:15:29 +1000 | [diff] [blame] | 19 | |
Uwe Kleine-König | ce6d73c | 2014-09-10 21:56:38 +0200 | [diff] [blame] | 20 | static const struct of_device_id xilinx_of_bus_ids[] __initconst = { |
Stephen Neuendorffer | faa6511 | 2008-01-09 06:35:06 +1100 | [diff] [blame] | 21 | { .compatible = "xlnx,plb-v46-1.00.a", }, |
| 22 | { .compatible = "xlnx,plb-v34-1.01.a", }, |
| 23 | { .compatible = "xlnx,plb-v34-1.02.a", }, |
| 24 | { .compatible = "xlnx,opb-v20-1.10.c", }, |
| 25 | { .compatible = "xlnx,dcr-v29-1.00.a", }, |
| 26 | { .compatible = "xlnx,compound", }, |
| 27 | {} |
| 28 | }; |
| 29 | |
Grant Likely | 486ba7e | 2007-10-02 12:15:29 +1000 | [diff] [blame] | 30 | static int __init virtex_device_probe(void) |
| 31 | { |
Stephen Neuendorffer | faa6511 | 2008-01-09 06:35:06 +1100 | [diff] [blame] | 32 | of_platform_bus_probe(NULL, xilinx_of_bus_ids, NULL); |
Grant Likely | 486ba7e | 2007-10-02 12:15:29 +1000 | [diff] [blame] | 33 | |
| 34 | return 0; |
| 35 | } |
Josh Boyer | 3f8c5c3 | 2007-12-24 10:42:02 -0600 | [diff] [blame] | 36 | machine_device_initcall(virtex, virtex_device_probe); |
Grant Likely | 486ba7e | 2007-10-02 12:15:29 +1000 | [diff] [blame] | 37 | |
| 38 | static int __init virtex_probe(void) |
| 39 | { |
| 40 | unsigned long root = of_get_flat_dt_root(); |
| 41 | |
Stephen Neuendorffer | 0e349b0 | 2008-01-09 06:35:05 +1100 | [diff] [blame] | 42 | if (!of_flat_dt_is_compatible(root, "xlnx,virtex")) |
Grant Likely | 486ba7e | 2007-10-02 12:15:29 +1000 | [diff] [blame] | 43 | return 0; |
| 44 | |
| 45 | return 1; |
| 46 | } |
| 47 | |
Grant Likely | 486ba7e | 2007-10-02 12:15:29 +1000 | [diff] [blame] | 48 | define_machine(virtex) { |
| 49 | .name = "Xilinx Virtex", |
| 50 | .probe = virtex_probe, |
Roderick Colenbrander | 64f1650 | 2009-06-06 10:14:22 -0600 | [diff] [blame] | 51 | .setup_arch = xilinx_pci_init, |
Grant Likely | 486ba7e | 2007-10-02 12:15:29 +1000 | [diff] [blame] | 52 | .init_IRQ = xilinx_intc_init_tree, |
| 53 | .get_irq = xilinx_intc_get_irq, |
Stefan Roese | 93173ce | 2008-03-28 01:43:31 +1100 | [diff] [blame] | 54 | .restart = ppc4xx_reset_system, |
Grant Likely | 486ba7e | 2007-10-02 12:15:29 +1000 | [diff] [blame] | 55 | .calibrate_decr = generic_calibrate_decr, |
| 56 | }; |