Prabhakar Kushwaha | 2d05c39 | 2011-06-02 20:28:08 +0000 | [diff] [blame] | 1 | /* |
| 2 | * P1010RDB Board Setup |
| 3 | * |
| 4 | * Copyright 2011 Freescale Semiconductor Inc. |
| 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; either version 2 of the License, or (at your |
| 9 | * option) any later version. |
| 10 | */ |
| 11 | |
| 12 | #include <linux/stddef.h> |
| 13 | #include <linux/kernel.h> |
| 14 | #include <linux/pci.h> |
| 15 | #include <linux/delay.h> |
| 16 | #include <linux/interrupt.h> |
| 17 | #include <linux/of_platform.h> |
| 18 | |
Prabhakar Kushwaha | 2d05c39 | 2011-06-02 20:28:08 +0000 | [diff] [blame] | 19 | #include <asm/time.h> |
| 20 | #include <asm/machdep.h> |
| 21 | #include <asm/pci-bridge.h> |
| 22 | #include <mm/mmu_decl.h> |
| 23 | #include <asm/prom.h> |
| 24 | #include <asm/udbg.h> |
| 25 | #include <asm/mpic.h> |
| 26 | |
| 27 | #include <sysdev/fsl_soc.h> |
| 28 | #include <sysdev/fsl_pci.h> |
| 29 | |
Kumar Gala | 199bfbe | 2011-11-24 01:00:10 -0600 | [diff] [blame] | 30 | #include "mpc85xx.h" |
| 31 | |
Prabhakar Kushwaha | 2d05c39 | 2011-06-02 20:28:08 +0000 | [diff] [blame] | 32 | void __init p1010_rdb_pic_init(void) |
| 33 | { |
Kyle Moffett | e55d7f7 | 2011-12-22 10:19:14 +0000 | [diff] [blame] | 34 | struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN | |
Kyle Moffett | 5019609 | 2011-12-22 10:19:12 +0000 | [diff] [blame] | 35 | MPIC_SINGLE_DEST_CPU, |
Prabhakar Kushwaha | 2d05c39 | 2011-06-02 20:28:08 +0000 | [diff] [blame] | 36 | 0, 256, " OpenPIC "); |
| 37 | |
| 38 | BUG_ON(mpic == NULL); |
Prabhakar Kushwaha | 2d05c39 | 2011-06-02 20:28:08 +0000 | [diff] [blame] | 39 | |
| 40 | mpic_init(mpic); |
Prabhakar Kushwaha | 2d05c39 | 2011-06-02 20:28:08 +0000 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | |
| 44 | /* |
| 45 | * Setup the architecture |
| 46 | */ |
| 47 | static void __init p1010_rdb_setup_arch(void) |
| 48 | { |
Prabhakar Kushwaha | 2d05c39 | 2011-06-02 20:28:08 +0000 | [diff] [blame] | 49 | if (ppc_md.progress) |
| 50 | ppc_md.progress("p1010_rdb_setup_arch()", 0); |
| 51 | |
Jia Hongtao | 905e75c | 2012-08-28 15:44:08 +0800 | [diff] [blame] | 52 | fsl_pci_assign_primary(); |
Prabhakar Kushwaha | 2d05c39 | 2011-06-02 20:28:08 +0000 | [diff] [blame] | 53 | |
| 54 | printk(KERN_INFO "P1010 RDB board from Freescale Semiconductor\n"); |
| 55 | } |
| 56 | |
Jia Hongtao | 905e75c | 2012-08-28 15:44:08 +0800 | [diff] [blame] | 57 | machine_arch_initcall(p1010_rdb, mpc85xx_common_publish_devices); |
Prabhakar Kushwaha | 2d05c39 | 2011-06-02 20:28:08 +0000 | [diff] [blame] | 58 | machine_arch_initcall(p1010_rdb, swiotlb_setup_bus_notifier); |
| 59 | |
| 60 | /* |
| 61 | * Called very early, device-tree isn't unflattened |
| 62 | */ |
| 63 | static int __init p1010_rdb_probe(void) |
| 64 | { |
| 65 | unsigned long root = of_get_flat_dt_root(); |
| 66 | |
| 67 | if (of_flat_dt_is_compatible(root, "fsl,P1010RDB")) |
| 68 | return 1; |
Zhao Qiang | fd1348d | 2013-10-14 14:46:13 +0800 | [diff] [blame] | 69 | if (of_flat_dt_is_compatible(root, "fsl,P1010RDB-PB")) |
| 70 | return 1; |
Prabhakar Kushwaha | 2d05c39 | 2011-06-02 20:28:08 +0000 | [diff] [blame] | 71 | return 0; |
| 72 | } |
| 73 | |
| 74 | define_machine(p1010_rdb) { |
| 75 | .name = "P1010 RDB", |
| 76 | .probe = p1010_rdb_probe, |
| 77 | .setup_arch = p1010_rdb_setup_arch, |
| 78 | .init_IRQ = p1010_rdb_pic_init, |
| 79 | #ifdef CONFIG_PCI |
| 80 | .pcibios_fixup_bus = fsl_pcibios_fixup_bus, |
Wang Dongsheng | 48b1618 | 2014-03-20 11:19:37 +0800 | [diff] [blame] | 81 | .pcibios_fixup_phb = fsl_pcibios_fixup_phb, |
Prabhakar Kushwaha | 2d05c39 | 2011-06-02 20:28:08 +0000 | [diff] [blame] | 82 | #endif |
| 83 | .get_irq = mpic_get_irq, |
| 84 | .restart = fsl_rstcr_restart, |
| 85 | .calibrate_decr = generic_calibrate_decr, |
| 86 | .progress = udbg_progress, |
| 87 | }; |