blob: c31e5b534f0aab0304a9d8dee70b5730dd8e5f81 [file] [log] [blame]
Marian Balakowicz5b5820d2007-11-15 22:40:21 +11001/*
2 * Support for 'mpc5200-simple-platform' compatible boards.
3 *
4 * Written by Marian Balakowicz <m8@semihalf.com>
5 * Copyright (C) 2007 Semihalf
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * Description:
13 * This code implements support for a simple MPC52xx based boards which
14 * do not need a custom platform specific setup. Such boards are
15 * supported assuming the following:
16 *
17 * - GPIO pins are configured by the firmware,
18 * - CDM configuration (clocking) is setup correctly by firmware,
19 * - if the 'fsl,has-wdt' property is present in one of the
20 * gpt nodes, then it is safe to use such gpt to reset the board,
21 * - PCI is supported if enabled in the kernel configuration
22 * and if there is a PCI bus node defined in the device tree.
23 *
24 * Boards that are compatible with this generic platform support
25 * are listed in a 'board' table.
26 */
27
28#undef DEBUG
29#include <asm/time.h>
30#include <asm/prom.h>
31#include <asm/machdep.h>
32#include <asm/mpc52xx.h>
33
34/*
35 * Setup the architecture
36 */
37static void __init mpc5200_simple_setup_arch(void)
38{
39 if (ppc_md.progress)
40 ppc_md.progress("mpc5200_simple_setup_arch()", 0);
41
Grant Likelyc8004a22008-01-24 22:25:31 -070042 /* Map important registers from the internal memory map */
43 mpc52xx_map_common_devices();
44
Marian Balakowicz5b5820d2007-11-15 22:40:21 +110045 /* Some mpc5200 & mpc5200b related configuration */
46 mpc5200_setup_xlb_arbiter();
47
Marian Balakowicz5b5820d2007-11-15 22:40:21 +110048 mpc52xx_setup_pci();
49}
50
51/* list of the supported boards */
52static char *board[] __initdata = {
Grzegorz Bernackibdad0542009-02-04 13:39:17 -070053 "intercontrol,digsy-mtc",
s.hauer@pengutronix.de106757b2008-04-25 23:48:05 +100054 "phytec,pcm030",
Wolfram Sang10b9dc62009-03-11 09:36:26 -060055 "phytec,pcm032",
56 "promess,motionpro",
Marian Balakowicz5b5820d2007-11-15 22:40:21 +110057 "schindler,cm5200",
58 "tqc,tqm5200",
59 NULL
60};
61
62/*
63 * Called very early, MMU is off, device-tree isn't unflattened
64 */
65static int __init mpc5200_simple_probe(void)
66{
67 unsigned long node = of_get_flat_dt_root();
68 int i = 0;
69
70 while (board[i]) {
71 if (of_flat_dt_is_compatible(node, board[i]))
72 break;
73 i++;
74 }
75
76 return (board[i] != NULL);
77}
78
79define_machine(mpc5200_simple_platform) {
80 .name = "mpc5200-simple-platform",
81 .probe = mpc5200_simple_probe,
82 .setup_arch = mpc5200_simple_setup_arch,
83 .init = mpc52xx_declare_of_platform_devices,
84 .init_IRQ = mpc52xx_init_irq,
85 .get_irq = mpc52xx_get_irq,
86 .restart = mpc52xx_restart,
87 .calibrate_decr = generic_calibrate_decr,
88};