1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0-or-later
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun * Support for 'mpc5200-simple-platform' compatible boards.
4*4882a593Smuzhiyun *
5*4882a593Smuzhiyun * Written by Marian Balakowicz <m8@semihalf.com>
6*4882a593Smuzhiyun * Copyright (C) 2007 Semihalf
7*4882a593Smuzhiyun *
8*4882a593Smuzhiyun * Description:
9*4882a593Smuzhiyun * This code implements support for a simple MPC52xx based boards which
10*4882a593Smuzhiyun * do not need a custom platform specific setup. Such boards are
11*4882a593Smuzhiyun * supported assuming the following:
12*4882a593Smuzhiyun *
13*4882a593Smuzhiyun * - GPIO pins are configured by the firmware,
14*4882a593Smuzhiyun * - CDM configuration (clocking) is setup correctly by firmware,
15*4882a593Smuzhiyun * - if the 'fsl,has-wdt' property is present in one of the
16*4882a593Smuzhiyun * gpt nodes, then it is safe to use such gpt to reset the board,
17*4882a593Smuzhiyun * - PCI is supported if enabled in the kernel configuration
18*4882a593Smuzhiyun * and if there is a PCI bus node defined in the device tree.
19*4882a593Smuzhiyun *
20*4882a593Smuzhiyun * Boards that are compatible with this generic platform support
21*4882a593Smuzhiyun * are listed in a 'board' table.
22*4882a593Smuzhiyun */
23*4882a593Smuzhiyun
24*4882a593Smuzhiyun #undef DEBUG
25*4882a593Smuzhiyun #include <asm/time.h>
26*4882a593Smuzhiyun #include <asm/prom.h>
27*4882a593Smuzhiyun #include <asm/machdep.h>
28*4882a593Smuzhiyun #include <asm/mpc52xx.h>
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun /*
31*4882a593Smuzhiyun * Setup the architecture
32*4882a593Smuzhiyun */
mpc5200_simple_setup_arch(void)33*4882a593Smuzhiyun static void __init mpc5200_simple_setup_arch(void)
34*4882a593Smuzhiyun {
35*4882a593Smuzhiyun if (ppc_md.progress)
36*4882a593Smuzhiyun ppc_md.progress("mpc5200_simple_setup_arch()", 0);
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun /* Map important registers from the internal memory map */
39*4882a593Smuzhiyun mpc52xx_map_common_devices();
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun /* Some mpc5200 & mpc5200b related configuration */
42*4882a593Smuzhiyun mpc5200_setup_xlb_arbiter();
43*4882a593Smuzhiyun
44*4882a593Smuzhiyun mpc52xx_setup_pci();
45*4882a593Smuzhiyun }
46*4882a593Smuzhiyun
47*4882a593Smuzhiyun /* list of the supported boards */
48*4882a593Smuzhiyun static const char *board[] __initdata = {
49*4882a593Smuzhiyun "anonymous,a3m071",
50*4882a593Smuzhiyun "anonymous,a4m072",
51*4882a593Smuzhiyun "anon,charon",
52*4882a593Smuzhiyun "ifm,o2d",
53*4882a593Smuzhiyun "intercontrol,digsy-mtc",
54*4882a593Smuzhiyun "manroland,mucmc52",
55*4882a593Smuzhiyun "manroland,uc101",
56*4882a593Smuzhiyun "phytec,pcm030",
57*4882a593Smuzhiyun "phytec,pcm032",
58*4882a593Smuzhiyun "promess,motionpro",
59*4882a593Smuzhiyun "schindler,cm5200",
60*4882a593Smuzhiyun "tqc,tqm5200",
61*4882a593Smuzhiyun NULL
62*4882a593Smuzhiyun };
63*4882a593Smuzhiyun
64*4882a593Smuzhiyun /*
65*4882a593Smuzhiyun * Called very early, MMU is off, device-tree isn't unflattened
66*4882a593Smuzhiyun */
mpc5200_simple_probe(void)67*4882a593Smuzhiyun static int __init mpc5200_simple_probe(void)
68*4882a593Smuzhiyun {
69*4882a593Smuzhiyun return of_device_compatible_match(of_root, board);
70*4882a593Smuzhiyun }
71*4882a593Smuzhiyun
define_machine(mpc5200_simple_platform)72*4882a593Smuzhiyun define_machine(mpc5200_simple_platform) {
73*4882a593Smuzhiyun .name = "mpc5200-simple-platform",
74*4882a593Smuzhiyun .probe = mpc5200_simple_probe,
75*4882a593Smuzhiyun .setup_arch = mpc5200_simple_setup_arch,
76*4882a593Smuzhiyun .init = mpc52xx_declare_of_platform_devices,
77*4882a593Smuzhiyun .init_IRQ = mpc52xx_init_irq,
78*4882a593Smuzhiyun .get_irq = mpc52xx_get_irq,
79*4882a593Smuzhiyun .restart = mpc52xx_restart,
80*4882a593Smuzhiyun .calibrate_decr = generic_calibrate_decr,
81*4882a593Smuzhiyun };
82