Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * MPC8536 DS Board Setup
0004  *
0005  * Copyright 2008 Freescale Semiconductor, Inc.
0006  */
0007 
0008 #include <linux/stddef.h>
0009 #include <linux/kernel.h>
0010 #include <linux/pci.h>
0011 #include <linux/kdev_t.h>
0012 #include <linux/delay.h>
0013 #include <linux/seq_file.h>
0014 #include <linux/interrupt.h>
0015 #include <linux/of_platform.h>
0016 
0017 #include <asm/time.h>
0018 #include <asm/machdep.h>
0019 #include <asm/pci-bridge.h>
0020 #include <mm/mmu_decl.h>
0021 #include <asm/udbg.h>
0022 #include <asm/mpic.h>
0023 #include <asm/swiotlb.h>
0024 
0025 #include <sysdev/fsl_soc.h>
0026 #include <sysdev/fsl_pci.h>
0027 
0028 #include "mpc85xx.h"
0029 
0030 void __init mpc8536_ds_pic_init(void)
0031 {
0032     struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN,
0033             0, 256, " OpenPIC  ");
0034     BUG_ON(mpic == NULL);
0035     mpic_init(mpic);
0036 }
0037 
0038 /*
0039  * Setup the architecture
0040  */
0041 static void __init mpc8536_ds_setup_arch(void)
0042 {
0043     if (ppc_md.progress)
0044         ppc_md.progress("mpc8536_ds_setup_arch()", 0);
0045 
0046     fsl_pci_assign_primary();
0047 
0048     swiotlb_detect_4g();
0049 
0050     printk("MPC8536 DS board from Freescale Semiconductor\n");
0051 }
0052 
0053 machine_arch_initcall(mpc8536_ds, mpc85xx_common_publish_devices);
0054 
0055 /*
0056  * Called very early, device-tree isn't unflattened
0057  */
0058 static int __init mpc8536_ds_probe(void)
0059 {
0060     return of_machine_is_compatible("fsl,mpc8536ds");
0061 }
0062 
0063 define_machine(mpc8536_ds) {
0064     .name           = "MPC8536 DS",
0065     .probe          = mpc8536_ds_probe,
0066     .setup_arch     = mpc8536_ds_setup_arch,
0067     .init_IRQ       = mpc8536_ds_pic_init,
0068 #ifdef CONFIG_PCI
0069     .pcibios_fixup_bus  = fsl_pcibios_fixup_bus,
0070     .pcibios_fixup_phb      = fsl_pcibios_fixup_phb,
0071 #endif
0072     .get_irq        = mpic_get_irq,
0073     .calibrate_decr     = generic_calibrate_decr,
0074     .progress       = udbg_progress,
0075 };