Kumar Gala | 2f3804e | 2008-07-02 01:36:15 -0500 | [diff] [blame] | 1 | /* |
| 2 | * MPC8536 DS Board Setup |
| 3 | * |
| 4 | * Copyright 2008 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/kdev_t.h> |
| 16 | #include <linux/delay.h> |
| 17 | #include <linux/seq_file.h> |
| 18 | #include <linux/interrupt.h> |
| 19 | #include <linux/of_platform.h> |
| 20 | |
Kumar Gala | 2f3804e | 2008-07-02 01:36:15 -0500 | [diff] [blame] | 21 | #include <asm/time.h> |
| 22 | #include <asm/machdep.h> |
| 23 | #include <asm/pci-bridge.h> |
| 24 | #include <mm/mmu_decl.h> |
| 25 | #include <asm/prom.h> |
| 26 | #include <asm/udbg.h> |
| 27 | #include <asm/mpic.h> |
Kumar Gala | 152d018 | 2009-05-15 00:37:35 -0500 | [diff] [blame] | 28 | #include <asm/swiotlb.h> |
Kumar Gala | 2f3804e | 2008-07-02 01:36:15 -0500 | [diff] [blame] | 29 | |
| 30 | #include <sysdev/fsl_soc.h> |
| 31 | #include <sysdev/fsl_pci.h> |
| 32 | |
Dmitry Eremin-Solenikov | 543a07b | 2011-11-17 21:56:16 +0400 | [diff] [blame] | 33 | #include "mpc85xx.h" |
| 34 | |
Kumar Gala | 2f3804e | 2008-07-02 01:36:15 -0500 | [diff] [blame] | 35 | void __init mpc8536_ds_pic_init(void) |
| 36 | { |
Kyle Moffett | e55d7f7 | 2011-12-22 10:19:14 +0000 | [diff] [blame] | 37 | struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN, |
Kumar Gala | 2f3804e | 2008-07-02 01:36:15 -0500 | [diff] [blame] | 38 | 0, 256, " OpenPIC "); |
| 39 | BUG_ON(mpic == NULL); |
Kumar Gala | 2f3804e | 2008-07-02 01:36:15 -0500 | [diff] [blame] | 40 | mpic_init(mpic); |
| 41 | } |
| 42 | |
| 43 | /* |
| 44 | * Setup the architecture |
| 45 | */ |
| 46 | static void __init mpc8536_ds_setup_arch(void) |
| 47 | { |
Kumar Gala | 2f3804e | 2008-07-02 01:36:15 -0500 | [diff] [blame] | 48 | if (ppc_md.progress) |
| 49 | ppc_md.progress("mpc8536_ds_setup_arch()", 0); |
| 50 | |
Jia Hongtao | 905e75c | 2012-08-28 15:44:08 +0800 | [diff] [blame] | 51 | fsl_pci_assign_primary(); |
Kumar Gala | 152d018 | 2009-05-15 00:37:35 -0500 | [diff] [blame] | 52 | |
Jia Hongtao | 905e75c | 2012-08-28 15:44:08 +0800 | [diff] [blame] | 53 | swiotlb_detect_4g(); |
Kumar Gala | 152d018 | 2009-05-15 00:37:35 -0500 | [diff] [blame] | 54 | |
Kumar Gala | 2f3804e | 2008-07-02 01:36:15 -0500 | [diff] [blame] | 55 | printk("MPC8536 DS board from Freescale Semiconductor\n"); |
| 56 | } |
| 57 | |
Jia Hongtao | 905e75c | 2012-08-28 15:44:08 +0800 | [diff] [blame] | 58 | machine_arch_initcall(mpc8536_ds, mpc85xx_common_publish_devices); |
Kumar Gala | 2f3804e | 2008-07-02 01:36:15 -0500 | [diff] [blame] | 59 | |
Kumar Gala | 152d018 | 2009-05-15 00:37:35 -0500 | [diff] [blame] | 60 | machine_arch_initcall(mpc8536_ds, swiotlb_setup_bus_notifier); |
| 61 | |
Kumar Gala | 2f3804e | 2008-07-02 01:36:15 -0500 | [diff] [blame] | 62 | /* |
| 63 | * Called very early, device-tree isn't unflattened |
| 64 | */ |
| 65 | static int __init mpc8536_ds_probe(void) |
| 66 | { |
Benjamin Herrenschmidt | 5657138 | 2016-07-05 15:04:05 +1000 | [diff] [blame^] | 67 | return of_machine_is_compatible("fsl,mpc8536ds"); |
Kumar Gala | 2f3804e | 2008-07-02 01:36:15 -0500 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | define_machine(mpc8536_ds) { |
| 71 | .name = "MPC8536 DS", |
| 72 | .probe = mpc8536_ds_probe, |
| 73 | .setup_arch = mpc8536_ds_setup_arch, |
| 74 | .init_IRQ = mpc8536_ds_pic_init, |
| 75 | #ifdef CONFIG_PCI |
| 76 | .pcibios_fixup_bus = fsl_pcibios_fixup_bus, |
Wang Dongsheng | 48b1618 | 2014-03-20 11:19:37 +0800 | [diff] [blame] | 77 | .pcibios_fixup_phb = fsl_pcibios_fixup_phb, |
Kumar Gala | 2f3804e | 2008-07-02 01:36:15 -0500 | [diff] [blame] | 78 | #endif |
| 79 | .get_irq = mpic_get_irq, |
| 80 | .restart = fsl_rstcr_restart, |
| 81 | .calibrate_decr = generic_calibrate_decr, |
| 82 | .progress = udbg_progress, |
| 83 | }; |