mpc836x_rdk.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 "mpc83xx.h"
  26. static struct of_device_id __initdata mpc836x_rdk_ids[] = {
  27. { .compatible = "simple-bus", },
  28. {},
  29. };
  30. static int __init mpc836x_rdk_declare_of_platform_devices(void)
  31. {
  32. return of_platform_bus_probe(NULL, mpc836x_rdk_ids, NULL);
  33. }
  34. machine_device_initcall(mpc836x_rdk, mpc836x_rdk_declare_of_platform_devices);
  35. static void __init mpc836x_rdk_setup_arch(void)
  36. {
  37. #ifdef CONFIG_PCI
  38. struct device_node *np;
  39. #endif
  40. if (ppc_md.progress)
  41. ppc_md.progress("mpc836x_rdk_setup_arch()", 0);
  42. #ifdef CONFIG_PCI
  43. for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
  44. mpc83xx_add_bridge(np);
  45. #endif
  46. qe_reset();
  47. }
  48. static void __init mpc836x_rdk_init_IRQ(void)
  49. {
  50. struct device_node *np;
  51. np = of_find_compatible_node(NULL, NULL, "fsl,ipic");
  52. if (!np)
  53. return;
  54. ipic_init(np, 0);
  55. /*
  56. * Initialize the default interrupt mapping priorities,
  57. * in case the boot rom changed something on us.
  58. */
  59. ipic_set_default_priority();
  60. of_node_put(np);
  61. np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
  62. if (!np)
  63. return;
  64. qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
  65. of_node_put(np);
  66. }
  67. /*
  68. * Called very early, MMU is off, device-tree isn't unflattened.
  69. */
  70. static int __init mpc836x_rdk_probe(void)
  71. {
  72. unsigned long root = of_get_flat_dt_root();
  73. return of_flat_dt_is_compatible(root, "fsl,mpc8360rdk");
  74. }
  75. define_machine(mpc836x_rdk) {
  76. .name = "MPC836x RDK",
  77. .probe = mpc836x_rdk_probe,
  78. .setup_arch = mpc836x_rdk_setup_arch,
  79. .init_IRQ = mpc836x_rdk_init_IRQ,
  80. .get_irq = ipic_get_irq,
  81. .restart = mpc83xx_restart,
  82. .time_init = mpc83xx_time_init,
  83. .calibrate_decr = generic_calibrate_decr,
  84. .progress = udbg_progress,
  85. };