xref: /linux/arch/powerpc/platforms/85xx/mpc85xx_ds.c (revision a1c613ae4c322ddd58d5a8539dbfba2a0380a8c0)
12874c5fdSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-or-later
216d24060SKumar Gala /*
37f50382dSKumar Gala  * MPC85xx DS Board Setup
416d24060SKumar Gala  *
516d24060SKumar Gala  * Author Xianghua Xiao (x.xiao@freescale.com)
616d24060SKumar Gala  * Roy Zang <tie-fei.zang@freescale.com>
716d24060SKumar Gala  * 	- Add PCI/PCI Exprees support
816d24060SKumar Gala  * Copyright 2007 Freescale Semiconductor Inc.
916d24060SKumar Gala  */
1016d24060SKumar Gala 
1116d24060SKumar Gala #include <linux/stddef.h>
1216d24060SKumar Gala #include <linux/kernel.h>
1316d24060SKumar Gala #include <linux/pci.h>
1416d24060SKumar Gala #include <linux/kdev_t.h>
1516d24060SKumar Gala #include <linux/delay.h>
1616d24060SKumar Gala #include <linux/seq_file.h>
1716d24060SKumar Gala #include <linux/interrupt.h>
18*81d7cac4SRob Herring #include <linux/of.h>
19e6f6390aSChristophe Leroy #include <linux/of_irq.h>
2016d24060SKumar Gala 
2116d24060SKumar Gala #include <asm/time.h>
2216d24060SKumar Gala #include <asm/machdep.h>
2316d24060SKumar Gala #include <asm/pci-bridge.h>
2416d24060SKumar Gala #include <mm/mmu_decl.h>
2516d24060SKumar Gala #include <asm/udbg.h>
2616d24060SKumar Gala #include <asm/mpic.h>
2716d24060SKumar Gala #include <asm/i8259.h>
28152d0182SKumar Gala #include <asm/swiotlb.h>
29821b3a47SChristophe Leroy #include <asm/ppc-pci.h>
3016d24060SKumar Gala 
3116d24060SKumar Gala #include <sysdev/fsl_soc.h>
3216d24060SKumar Gala #include <sysdev/fsl_pci.h>
33582d3e09SKyle Moffett #include "smp.h"
3416d24060SKumar Gala 
35543a07b1SDmitry Eremin-Solenikov #include "mpc85xx.h"
36543a07b1SDmitry Eremin-Solenikov 
mpc85xx_ds_pic_init(void)377d8ae6e0SPali Rohár static void __init mpc85xx_ds_pic_init(void)
38f435f670SChristophe Leroy {
39f435f670SChristophe Leroy 	struct mpic *mpic;
40f435f670SChristophe Leroy 	int flags = MPIC_BIG_ENDIAN | MPIC_SINGLE_DEST_CPU;
41f435f670SChristophe Leroy 
42f435f670SChristophe Leroy 	if (of_machine_is_compatible("fsl,MPC8572DS-CAMP"))
43f435f670SChristophe Leroy 		flags |= MPIC_NO_RESET;
44f435f670SChristophe Leroy 
45f435f670SChristophe Leroy 	mpic = mpic_alloc(NULL, 0, flags, 0, 256, " OpenPIC  ");
46f435f670SChristophe Leroy 
47f435f670SChristophe Leroy 	if (WARN_ON(!mpic))
48f435f670SChristophe Leroy 		return;
49f435f670SChristophe Leroy 
50f435f670SChristophe Leroy 	mpic_init(mpic);
51f435f670SChristophe Leroy 
52f435f670SChristophe Leroy 	mpc85xx_8259_init();
5316d24060SKumar Gala }
5416d24060SKumar Gala 
5516d24060SKumar Gala /*
5616d24060SKumar Gala  * Setup the architecture
5716d24060SKumar Gala  */
mpc85xx_ds_setup_arch(void)587d8ae6e0SPali Rohár static void __init mpc85xx_ds_setup_arch(void)
5916d24060SKumar Gala {
6016d24060SKumar Gala 	if (ppc_md.progress)
617f50382dSKumar Gala 		ppc_md.progress("mpc85xx_ds_setup_arch()", 0);
6216d24060SKumar Gala 
63688ba1dbSJia Hongtao 	swiotlb_detect_4g();
64905e75c4SJia Hongtao 	fsl_pci_assign_primary();
65c4f6d866SPali Rohár 	uli_init();
668bd3947aSKumar Gala 	mpc85xx_smp_init();
678bd3947aSKumar Gala 
6815c6ba79SChristophe Leroy 	pr_info("MPC85xx DS board from Freescale Semiconductor\n");
6916d24060SKumar Gala }
7016d24060SKumar Gala 
71905e75c4SJia Hongtao machine_arch_initcall(mpc8544_ds, mpc85xx_common_publish_devices);
72905e75c4SJia Hongtao machine_arch_initcall(mpc8572_ds, mpc85xx_common_publish_devices);
731028d4f1SSebastian Siewior 
define_machine(mpc8544_ds)7416d24060SKumar Gala define_machine(mpc8544_ds) {
7516d24060SKumar Gala 	.name			= "MPC8544 DS",
761c96fcdeSChristophe Leroy 	.compatible		= "MPC8544DS",
777f50382dSKumar Gala 	.setup_arch		= mpc85xx_ds_setup_arch,
787f50382dSKumar Gala 	.init_IRQ		= mpc85xx_ds_pic_init,
7916d24060SKumar Gala #ifdef CONFIG_PCI
8016d24060SKumar Gala 	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
8148b16180SWang Dongsheng 	.pcibios_fixup_phb      = fsl_pcibios_fixup_phb,
8216d24060SKumar Gala #endif
8316d24060SKumar Gala 	.get_irq		= mpic_get_irq,
8416d24060SKumar Gala 	.progress		= udbg_progress,
8516d24060SKumar Gala };
865d54ddcbSKumar Gala 
define_machine(mpc8572_ds)875d54ddcbSKumar Gala define_machine(mpc8572_ds) {
885d54ddcbSKumar Gala 	.name			= "MPC8572 DS",
891c96fcdeSChristophe Leroy 	.compatible		= "fsl,MPC8572DS",
905d54ddcbSKumar Gala 	.setup_arch		= mpc85xx_ds_setup_arch,
915d54ddcbSKumar Gala 	.init_IRQ		= mpc85xx_ds_pic_init,
925d54ddcbSKumar Gala #ifdef CONFIG_PCI
935d54ddcbSKumar Gala 	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
9448b16180SWang Dongsheng 	.pcibios_fixup_phb      = fsl_pcibios_fixup_phb,
955d54ddcbSKumar Gala #endif
965d54ddcbSKumar Gala 	.get_irq		= mpic_get_irq,
975d54ddcbSKumar Gala 	.progress		= udbg_progress,
985d54ddcbSKumar Gala };
99