powerpc/512x: don't compile any platform DIU code if the DIU is not enabled
[deliverable/linux.git] / arch / powerpc / platforms / 512x / mpc5121_ads.c
CommitLineData
e177edcd 1/*
fb180322 2 * Copyright (C) 2007, 2008 Freescale Semiconductor, Inc. All rights reserved.
e177edcd
JR
3 *
4 * Author: John Rigby, <jrigby@freescale.com>, Thur Mar 29 2007
5 *
6 * Description:
7 * MPC5121 ADS board setup
8 *
9 * This is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 */
15
16#include <linux/kernel.h>
17#include <linux/io.h>
e177edcd
JR
18#include <linux/of_platform.h>
19
20#include <asm/machdep.h>
21#include <asm/ipic.h>
22#include <asm/prom.h>
23#include <asm/time.h>
24
35225802
JR
25#include <sysdev/fsl_pci.h>
26
fb180322 27#include "mpc512x.h"
1879f711
JR
28#include "mpc5121_ads.h"
29
30static void __init mpc5121_ads_setup_arch(void)
31{
35225802
JR
32#ifdef CONFIG_PCI
33 struct device_node *np;
34#endif
1879f711
JR
35 printk(KERN_INFO "MPC5121 ADS board from Freescale Semiconductor\n");
36 /*
37 * cpld regs are needed early
38 */
39 mpc5121_ads_cpld_map();
35225802
JR
40
41#ifdef CONFIG_PCI
42 for_each_compatible_node(np, "pci", "fsl,mpc5121-pci")
43 mpc83xx_add_bridge(np);
44#endif
6baf1190
TT
45
46#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
4b5006ec 47 mpc512x_setup_diu();
6baf1190 48#endif
1879f711 49}
e177edcd
JR
50
51static void __init mpc5121_ads_init_IRQ(void)
52{
fb180322 53 mpc512x_init_IRQ();
1879f711 54 mpc5121_ads_cpld_pic_init();
e177edcd
JR
55}
56
57/*
58 * Called very early, MMU is off, device-tree isn't unflattened
59 */
60static int __init mpc5121_ads_probe(void)
61{
62 unsigned long root = of_get_flat_dt_root();
63
64 return of_flat_dt_is_compatible(root, "fsl,mpc5121ads");
65}
66
67define_machine(mpc5121_ads) {
68 .name = "MPC5121 ADS",
69 .probe = mpc5121_ads_probe,
fb180322 70 .setup_arch = mpc5121_ads_setup_arch,
284ed66f 71 .init = mpc512x_init,
4b5006ec 72 .init_early = mpc512x_init_diu,
e177edcd
JR
73 .init_IRQ = mpc5121_ads_init_IRQ,
74 .get_irq = ipic_get_irq,
75 .calibrate_decr = generic_calibrate_decr,
a8dbceb7 76 .restart = mpc512x_restart,
e177edcd 77};
This page took 1.017443 seconds and 5 git commands to generate.