mpc836x_rdk.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * MPC8360E-RDK board file.
  3. *
  4. * Copyright (c) 2006 Freescale Semicondutor, Inc.
  5. * Copyright (c) 2007-2008 MontaVista Software, Inc.
  6. *
  7. * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the
  11. * Free Software Foundation; either version 2 of the License, or (at your
  12. * option) any later version.
  13. */
  14. #include <linux/kernel.h>
  15. #include <linux/pci.h>
  16. #include <linux/of_platform.h>
  17. #include <linux/io.h>
  18. #include <asm/prom.h>
  19. #include <asm/time.h>
  20. #include <asm/ipic.h>
  21. #include <asm/udbg.h>
  22. #include <asm/qe.h>
  23. #include <asm/qe_ic.h>
  24. #include <sysdev/fsl_soc.h>
  25. #include <sysdev/fsl_pci.h>
  26. #include "mpc83xx.h"
  27. static struct of_device_id __initdata mpc836x_rdk_ids[] = {
  28. { .compatible = "simple-bus", },
  29. {},
  30. };
  31. static int __init mpc836x_rdk_declare_of_platform_devices(void)
  32. {
  33. return of_platform_bus_probe(NULL, mpc836x_rdk_ids, NULL);
  34. }
  35. machine_device_initcall(mpc836x_rdk, mpc836x_rdk_declare_of_platform_devices);
  36. static void __init mpc836x_rdk_setup_arch(void)
  37. {
  38. #ifdef CONFIG_PCI
  39. struct device_node *np;
  40. #endif
  41. if (ppc_md.progress)
  42. ppc_md.progress("mpc836x_rdk_setup_arch()", 0);
  43. #ifdef CONFIG_PCI
  44. for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
  45. mpc83xx_add_bridge(np);
  46. #endif
  47. #ifdef CONFIG_QUICC_ENGINE
  48. qe_reset();
  49. #endif
  50. }
  51. static void __init mpc836x_rdk_init_IRQ(void)
  52. {
  53. struct device_node *np;
  54. np = of_find_compatible_node(NULL, NULL, "fsl,ipic");
  55. if (!np)
  56. return;
  57. ipic_init(np, 0);
  58. /*
  59. * Initialize the default interrupt mapping priorities,
  60. * in case the boot rom changed something on us.
  61. */
  62. ipic_set_default_priority();
  63. of_node_put(np);
  64. #ifdef CONFIG_QUICC_ENGINE
  65. np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
  66. if (!np)
  67. return;
  68. qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
  69. of_node_put(np);
  70. #endif
  71. }
  72. /*
  73. * Called very early, MMU is off, device-tree isn't unflattened.
  74. */
  75. static int __init mpc836x_rdk_probe(void)
  76. {
  77. unsigned long root = of_get_flat_dt_root();
  78. return of_flat_dt_is_compatible(root, "fsl,mpc8360rdk");
  79. }
  80. define_machine(mpc836x_rdk) {
  81. .name = "MPC836x RDK",
  82. .probe = mpc836x_rdk_probe,
  83. .setup_arch = mpc836x_rdk_setup_arch,
  84. .init_IRQ = mpc836x_rdk_init_IRQ,
  85. .get_irq = ipic_get_irq,
  86. .restart = mpc83xx_restart,
  87. .time_init = mpc83xx_time_init,
  88. .calibrate_decr = generic_calibrate_decr,
  89. .progress = udbg_progress,
  90. };