mpc5121_ads.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright (C) 2007, 2008 Freescale Semiconductor, Inc. All rights reserved.
  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. #include <linux/kernel.h>
  16. #include <linux/io.h>
  17. #include <linux/of_platform.h>
  18. #include <asm/machdep.h>
  19. #include <asm/ipic.h>
  20. #include <asm/prom.h>
  21. #include <asm/time.h>
  22. #include <sysdev/fsl_pci.h>
  23. #include "mpc512x.h"
  24. #include "mpc5121_ads.h"
  25. static void __init mpc5121_ads_setup_arch(void)
  26. {
  27. #ifdef CONFIG_PCI
  28. struct device_node *np;
  29. #endif
  30. printk(KERN_INFO "MPC5121 ADS board from Freescale Semiconductor\n");
  31. /*
  32. * cpld regs are needed early
  33. */
  34. mpc5121_ads_cpld_map();
  35. #ifdef CONFIG_PCI
  36. for_each_compatible_node(np, "pci", "fsl,mpc5121-pci")
  37. mpc83xx_add_bridge(np);
  38. #endif
  39. mpc512x_setup_arch();
  40. }
  41. static void __init mpc5121_ads_init_IRQ(void)
  42. {
  43. mpc512x_init_IRQ();
  44. mpc5121_ads_cpld_pic_init();
  45. }
  46. /*
  47. * Called very early, MMU is off, device-tree isn't unflattened
  48. */
  49. static int __init mpc5121_ads_probe(void)
  50. {
  51. if (!of_machine_is_compatible("fsl,mpc5121ads"))
  52. return 0;
  53. mpc512x_init_early();
  54. return 1;
  55. }
  56. define_machine(mpc5121_ads) {
  57. .name = "MPC5121 ADS",
  58. .probe = mpc5121_ads_probe,
  59. .setup_arch = mpc5121_ads_setup_arch,
  60. .init = mpc512x_init,
  61. .init_IRQ = mpc5121_ads_init_IRQ,
  62. .get_irq = ipic_get_irq,
  63. .calibrate_decr = generic_calibrate_decr,
  64. .restart = mpc512x_restart,
  65. };