2 * Based on MPC8560 ADS and arch/ppc stx_gp3 ports
4 * Maintained by Kumar Gala (see MAINTAINERS for contact information)
6 * Copyright 2008 Freescale Semiconductor Inc.
8 * Dan Malek <dan@embeddededge.com>
9 * Copyright 2004 Embedded Edge, LLC
11 * Copied from mpc8560_ads.c
12 * Copyright 2002, 2003 Motorola Inc.
14 * Ported to 2.6, Matt Porter <mporter@kernel.crashing.org>
15 * Copyright 2004-2005 MontaVista Software, Inc.
17 * This program is free software; you can redistribute it and/or modify it
18 * under the terms of the GNU General Public License as published by the
19 * Free Software Foundation; either version 2 of the License, or (at your
20 * option) any later version.
23 #include <linux/stddef.h>
24 #include <linux/kernel.h>
25 #include <linux/pci.h>
26 #include <linux/kdev_t.h>
27 #include <linux/delay.h>
28 #include <linux/seq_file.h>
29 #include <linux/of_platform.h>
31 #include <asm/system.h>
33 #include <asm/machdep.h>
34 #include <asm/pci-bridge.h>
37 #include <mm/mmu_decl.h>
40 #include <sysdev/fsl_soc.h>
41 #include <sysdev/fsl_pci.h>
47 #endif /* CONFIG_CPM2 */
49 static void __init
stx_gp3_pic_init(void)
51 struct mpic
*mpic
= mpic_alloc(NULL
, 0,
52 MPIC_WANTS_RESET
| MPIC_BIG_ENDIAN
,
57 mpc85xx_cpm2_pic_init();
61 * Setup the architecture
63 static void __init
stx_gp3_setup_arch(void)
66 struct device_node
*np
;
70 ppc_md
.progress("stx_gp3_setup_arch()", 0);
77 for_each_compatible_node(np
, "pci", "fsl,mpc8540-pci")
78 fsl_add_bridge(np
, 1);
82 static void stx_gp3_show_cpuinfo(struct seq_file
*m
)
84 uint pvid
, svid
, phid1
;
86 pvid
= mfspr(SPRN_PVR
);
87 svid
= mfspr(SPRN_SVR
);
89 seq_printf(m
, "Vendor\t\t: RPC Electronics STx\n");
90 seq_printf(m
, "PVR\t\t: 0x%x\n", pvid
);
91 seq_printf(m
, "SVR\t\t: 0x%x\n", svid
);
93 /* Display cpu Pll setting */
94 phid1
= mfspr(SPRN_HID1
);
95 seq_printf(m
, "PLL setting\t: 0x%x\n", ((phid1
>> 24) & 0x3f));
98 machine_device_initcall(stx_gp3
, mpc85xx_common_publish_devices
);
101 * Called very early, device-tree isn't unflattened
103 static int __init
stx_gp3_probe(void)
105 unsigned long root
= of_get_flat_dt_root();
107 return of_flat_dt_is_compatible(root
, "stx,gp3-8560");
110 define_machine(stx_gp3
) {
112 .probe
= stx_gp3_probe
,
113 .setup_arch
= stx_gp3_setup_arch
,
114 .init_IRQ
= stx_gp3_pic_init
,
115 .show_cpuinfo
= stx_gp3_show_cpuinfo
,
116 .get_irq
= mpic_get_irq
,
117 .restart
= fsl_rstcr_restart
,
118 .calibrate_decr
= generic_calibrate_decr
,
119 .progress
= udbg_progress
,