Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * Support for 'mpc5200-simple-platform' compatible boards.
0004  *
0005  * Written by Marian Balakowicz <m8@semihalf.com>
0006  * Copyright (C) 2007 Semihalf
0007  *
0008  * Description:
0009  * This code implements support for a simple MPC52xx based boards which
0010  * do not need a custom platform specific setup. Such boards are
0011  * supported assuming the following:
0012  *
0013  * - GPIO pins are configured by the firmware,
0014  * - CDM configuration (clocking) is setup correctly by firmware,
0015  * - if the 'fsl,has-wdt' property is present in one of the
0016  *   gpt nodes, then it is safe to use such gpt to reset the board,
0017  * - PCI is supported if enabled in the kernel configuration
0018  *   and if there is a PCI bus node defined in the device tree.
0019  *
0020  * Boards that are compatible with this generic platform support
0021  * are listed in a 'board' table.
0022  */
0023 
0024 #undef DEBUG
0025 #include <linux/of.h>
0026 #include <asm/time.h>
0027 #include <asm/machdep.h>
0028 #include <asm/mpc52xx.h>
0029 
0030 /*
0031  * Setup the architecture
0032  */
0033 static void __init mpc5200_simple_setup_arch(void)
0034 {
0035     if (ppc_md.progress)
0036         ppc_md.progress("mpc5200_simple_setup_arch()", 0);
0037 
0038     /* Map important registers from the internal memory map */
0039     mpc52xx_map_common_devices();
0040 
0041     /* Some mpc5200 & mpc5200b related configuration */
0042     mpc5200_setup_xlb_arbiter();
0043 }
0044 
0045 /* list of the supported boards */
0046 static const char *board[] __initdata = {
0047     "anonymous,a3m071",
0048     "anonymous,a4m072",
0049     "anon,charon",
0050     "ifm,o2d",
0051     "intercontrol,digsy-mtc",
0052     "manroland,mucmc52",
0053     "manroland,uc101",
0054     "phytec,pcm030",
0055     "phytec,pcm032",
0056     "promess,motionpro",
0057     "schindler,cm5200",
0058     "tqc,tqm5200",
0059     NULL
0060 };
0061 
0062 /*
0063  * Called very early, MMU is off, device-tree isn't unflattened
0064  */
0065 static int __init mpc5200_simple_probe(void)
0066 {
0067     return of_device_compatible_match(of_root, board);
0068 }
0069 
0070 define_machine(mpc5200_simple_platform) {
0071     .name       = "mpc5200-simple-platform",
0072     .probe      = mpc5200_simple_probe,
0073     .setup_arch = mpc5200_simple_setup_arch,
0074     .discover_phbs  = mpc52xx_setup_pci,
0075     .init       = mpc52xx_declare_of_platform_devices,
0076     .init_IRQ   = mpc52xx_init_irq,
0077     .get_irq    = mpc52xx_get_irq,
0078     .restart    = mpc52xx_restart,
0079     .calibrate_decr = generic_calibrate_decr,
0080 };