John Rigby | e177edc | 2008-01-29 04:28:53 +1100 | [diff] [blame] | 1 | /* |
John Rigby | fb18032 | 2008-07-09 14:54:03 -0600 | [diff] [blame] | 2 | * Copyright (C) 2007, 2008 Freescale Semiconductor, Inc. All rights reserved. |
John Rigby | e177edc | 2008-01-29 04:28:53 +1100 | [diff] [blame] | 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> |
John Rigby | e177edc | 2008-01-29 04:28:53 +1100 | [diff] [blame] | 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 | |
John Rigby | 3522580 | 2008-10-07 15:13:18 -0600 | [diff] [blame] | 25 | #include <sysdev/fsl_pci.h> |
| 26 | |
John Rigby | fb18032 | 2008-07-09 14:54:03 -0600 | [diff] [blame] | 27 | #include "mpc512x.h" |
John Rigby | 1879f71 | 2008-07-09 14:54:04 -0600 | [diff] [blame] | 28 | #include "mpc5121_ads.h" |
| 29 | |
| 30 | static void __init mpc5121_ads_setup_arch(void) |
| 31 | { |
John Rigby | 3522580 | 2008-10-07 15:13:18 -0600 | [diff] [blame] | 32 | #ifdef CONFIG_PCI |
| 33 | struct device_node *np; |
| 34 | #endif |
John Rigby | 1879f71 | 2008-07-09 14:54:04 -0600 | [diff] [blame] | 35 | printk(KERN_INFO "MPC5121 ADS board from Freescale Semiconductor\n"); |
| 36 | /* |
| 37 | * cpld regs are needed early |
| 38 | */ |
| 39 | mpc5121_ads_cpld_map(); |
John Rigby | 3522580 | 2008-10-07 15:13:18 -0600 | [diff] [blame] | 40 | |
| 41 | #ifdef CONFIG_PCI |
| 42 | for_each_compatible_node(np, "pci", "fsl,mpc5121-pci") |
| 43 | mpc83xx_add_bridge(np); |
| 44 | #endif |
Anatolij Gustschin | 4b5006e | 2010-07-23 04:00:37 +0000 | [diff] [blame] | 45 | mpc512x_setup_diu(); |
John Rigby | 1879f71 | 2008-07-09 14:54:04 -0600 | [diff] [blame] | 46 | } |
John Rigby | e177edc | 2008-01-29 04:28:53 +1100 | [diff] [blame] | 47 | |
| 48 | static void __init mpc5121_ads_init_IRQ(void) |
| 49 | { |
John Rigby | fb18032 | 2008-07-09 14:54:03 -0600 | [diff] [blame] | 50 | mpc512x_init_IRQ(); |
John Rigby | 1879f71 | 2008-07-09 14:54:04 -0600 | [diff] [blame] | 51 | mpc5121_ads_cpld_pic_init(); |
John Rigby | e177edc | 2008-01-29 04:28:53 +1100 | [diff] [blame] | 52 | } |
| 53 | |
| 54 | /* |
| 55 | * Called very early, MMU is off, device-tree isn't unflattened |
| 56 | */ |
| 57 | static int __init mpc5121_ads_probe(void) |
| 58 | { |
| 59 | unsigned long root = of_get_flat_dt_root(); |
| 60 | |
| 61 | return of_flat_dt_is_compatible(root, "fsl,mpc5121ads"); |
| 62 | } |
| 63 | |
| 64 | define_machine(mpc5121_ads) { |
| 65 | .name = "MPC5121 ADS", |
| 66 | .probe = mpc5121_ads_probe, |
John Rigby | fb18032 | 2008-07-09 14:54:03 -0600 | [diff] [blame] | 67 | .setup_arch = mpc5121_ads_setup_arch, |
Anatolij Gustschin | 284ed66 | 2010-02-16 10:35:13 -0700 | [diff] [blame] | 68 | .init = mpc512x_init, |
Anatolij Gustschin | 4b5006e | 2010-07-23 04:00:37 +0000 | [diff] [blame] | 69 | .init_early = mpc512x_init_diu, |
John Rigby | e177edc | 2008-01-29 04:28:53 +1100 | [diff] [blame] | 70 | .init_IRQ = mpc5121_ads_init_IRQ, |
| 71 | .get_irq = ipic_get_irq, |
| 72 | .calibrate_decr = generic_calibrate_decr, |
Anatolij Gustschin | a8dbceb7 | 2010-02-16 10:36:26 -0700 | [diff] [blame] | 73 | .restart = mpc512x_restart, |
John Rigby | e177edc | 2008-01-29 04:28:53 +1100 | [diff] [blame] | 74 | }; |