xref: /linux/arch/powerpc/platforms/85xx/p1010rdb.c (revision 905e75c46dba5f3061049277e4eb7110beedba43)
12d05c392SPrabhakar Kushwaha /*
22d05c392SPrabhakar Kushwaha  * P1010RDB Board Setup
32d05c392SPrabhakar Kushwaha  *
42d05c392SPrabhakar Kushwaha  * Copyright 2011 Freescale Semiconductor Inc.
52d05c392SPrabhakar Kushwaha  *
62d05c392SPrabhakar Kushwaha  * This program is free software; you can redistribute  it and/or modify it
72d05c392SPrabhakar Kushwaha  * under  the terms of  the GNU General  Public License as published by the
82d05c392SPrabhakar Kushwaha  * Free Software Foundation;  either version 2 of the  License, or (at your
92d05c392SPrabhakar Kushwaha  * option) any later version.
102d05c392SPrabhakar Kushwaha  */
112d05c392SPrabhakar Kushwaha 
122d05c392SPrabhakar Kushwaha #include <linux/stddef.h>
132d05c392SPrabhakar Kushwaha #include <linux/kernel.h>
142d05c392SPrabhakar Kushwaha #include <linux/pci.h>
152d05c392SPrabhakar Kushwaha #include <linux/delay.h>
162d05c392SPrabhakar Kushwaha #include <linux/interrupt.h>
172d05c392SPrabhakar Kushwaha #include <linux/of_platform.h>
182d05c392SPrabhakar Kushwaha 
192d05c392SPrabhakar Kushwaha #include <asm/time.h>
202d05c392SPrabhakar Kushwaha #include <asm/machdep.h>
212d05c392SPrabhakar Kushwaha #include <asm/pci-bridge.h>
222d05c392SPrabhakar Kushwaha #include <mm/mmu_decl.h>
232d05c392SPrabhakar Kushwaha #include <asm/prom.h>
242d05c392SPrabhakar Kushwaha #include <asm/udbg.h>
252d05c392SPrabhakar Kushwaha #include <asm/mpic.h>
262d05c392SPrabhakar Kushwaha 
272d05c392SPrabhakar Kushwaha #include <sysdev/fsl_soc.h>
282d05c392SPrabhakar Kushwaha #include <sysdev/fsl_pci.h>
292d05c392SPrabhakar Kushwaha 
30199bfbe6SKumar Gala #include "mpc85xx.h"
31199bfbe6SKumar Gala 
322d05c392SPrabhakar Kushwaha void __init p1010_rdb_pic_init(void)
332d05c392SPrabhakar Kushwaha {
34e55d7f73SKyle Moffett 	struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN |
355019609fSKyle Moffett 	  MPIC_SINGLE_DEST_CPU,
362d05c392SPrabhakar Kushwaha 	  0, 256, " OpenPIC  ");
372d05c392SPrabhakar Kushwaha 
382d05c392SPrabhakar Kushwaha 	BUG_ON(mpic == NULL);
392d05c392SPrabhakar Kushwaha 
402d05c392SPrabhakar Kushwaha 	mpic_init(mpic);
412d05c392SPrabhakar Kushwaha }
422d05c392SPrabhakar Kushwaha 
432d05c392SPrabhakar Kushwaha 
442d05c392SPrabhakar Kushwaha /*
452d05c392SPrabhakar Kushwaha  * Setup the architecture
462d05c392SPrabhakar Kushwaha  */
472d05c392SPrabhakar Kushwaha static void __init p1010_rdb_setup_arch(void)
482d05c392SPrabhakar Kushwaha {
492d05c392SPrabhakar Kushwaha 	if (ppc_md.progress)
502d05c392SPrabhakar Kushwaha 		ppc_md.progress("p1010_rdb_setup_arch()", 0);
512d05c392SPrabhakar Kushwaha 
52*905e75c4SJia Hongtao 	fsl_pci_assign_primary();
532d05c392SPrabhakar Kushwaha 
542d05c392SPrabhakar Kushwaha 	printk(KERN_INFO "P1010 RDB board from Freescale Semiconductor\n");
552d05c392SPrabhakar Kushwaha }
562d05c392SPrabhakar Kushwaha 
57*905e75c4SJia Hongtao machine_arch_initcall(p1010_rdb, mpc85xx_common_publish_devices);
582d05c392SPrabhakar Kushwaha machine_arch_initcall(p1010_rdb, swiotlb_setup_bus_notifier);
592d05c392SPrabhakar Kushwaha 
602d05c392SPrabhakar Kushwaha /*
612d05c392SPrabhakar Kushwaha  * Called very early, device-tree isn't unflattened
622d05c392SPrabhakar Kushwaha  */
632d05c392SPrabhakar Kushwaha static int __init p1010_rdb_probe(void)
642d05c392SPrabhakar Kushwaha {
652d05c392SPrabhakar Kushwaha 	unsigned long root = of_get_flat_dt_root();
662d05c392SPrabhakar Kushwaha 
672d05c392SPrabhakar Kushwaha 	if (of_flat_dt_is_compatible(root, "fsl,P1010RDB"))
682d05c392SPrabhakar Kushwaha 		return 1;
692d05c392SPrabhakar Kushwaha 	return 0;
702d05c392SPrabhakar Kushwaha }
712d05c392SPrabhakar Kushwaha 
722d05c392SPrabhakar Kushwaha define_machine(p1010_rdb) {
732d05c392SPrabhakar Kushwaha 	.name			= "P1010 RDB",
742d05c392SPrabhakar Kushwaha 	.probe			= p1010_rdb_probe,
752d05c392SPrabhakar Kushwaha 	.setup_arch		= p1010_rdb_setup_arch,
762d05c392SPrabhakar Kushwaha 	.init_IRQ		= p1010_rdb_pic_init,
772d05c392SPrabhakar Kushwaha #ifdef CONFIG_PCI
782d05c392SPrabhakar Kushwaha 	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
792d05c392SPrabhakar Kushwaha #endif
802d05c392SPrabhakar Kushwaha 	.get_irq		= mpic_get_irq,
812d05c392SPrabhakar Kushwaha 	.restart		= fsl_rstcr_restart,
822d05c392SPrabhakar Kushwaha 	.calibrate_decr		= generic_calibrate_decr,
832d05c392SPrabhakar Kushwaha 	.progress		= udbg_progress,
842d05c392SPrabhakar Kushwaha };
85