mpc837x_rdb.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * arch/powerpc/platforms/83xx/mpc837x_rdb.c
  3. *
  4. * Copyright (C) 2007 Freescale Semicondutor, Inc. All rights reserved.
  5. *
  6. * MPC837x RDB board specific routines
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2 of the License, or (at your
  11. * option) any later version.
  12. */
  13. #include <linux/pci.h>
  14. #include <linux/of_platform.h>
  15. #include <asm/time.h>
  16. #include <asm/ipic.h>
  17. #include <asm/udbg.h>
  18. #include <sysdev/fsl_pci.h>
  19. #include "mpc83xx.h"
  20. /* ************************************************************************
  21. *
  22. * Setup the architecture
  23. *
  24. */
  25. static void __init mpc837x_rdb_setup_arch(void)
  26. {
  27. #ifdef CONFIG_PCI
  28. struct device_node *np;
  29. #endif
  30. if (ppc_md.progress)
  31. ppc_md.progress("mpc837x_rdb_setup_arch()", 0);
  32. #ifdef CONFIG_PCI
  33. for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
  34. mpc83xx_add_bridge(np);
  35. for_each_compatible_node(np, "pci", "fsl,mpc8314-pcie")
  36. mpc83xx_add_bridge(np);
  37. #endif
  38. mpc837x_usb_cfg();
  39. }
  40. static struct of_device_id mpc837x_ids[] = {
  41. { .type = "soc", },
  42. { .compatible = "soc", },
  43. { .compatible = "simple-bus", },
  44. { .compatible = "gianfar", },
  45. {},
  46. };
  47. static int __init mpc837x_declare_of_platform_devices(void)
  48. {
  49. /* Publish of_device */
  50. of_platform_bus_probe(NULL, mpc837x_ids, NULL);
  51. return 0;
  52. }
  53. machine_device_initcall(mpc837x_rdb, mpc837x_declare_of_platform_devices);
  54. static void __init mpc837x_rdb_init_IRQ(void)
  55. {
  56. struct device_node *np;
  57. np = of_find_compatible_node(NULL, NULL, "fsl,ipic");
  58. if (!np)
  59. return;
  60. ipic_init(np, 0);
  61. /* Initialize the default interrupt mapping priorities,
  62. * in case the boot rom changed something on us.
  63. */
  64. ipic_set_default_priority();
  65. }
  66. /*
  67. * Called very early, MMU is off, device-tree isn't unflattened
  68. */
  69. static int __init mpc837x_rdb_probe(void)
  70. {
  71. unsigned long root = of_get_flat_dt_root();
  72. return of_flat_dt_is_compatible(root, "fsl,mpc8377rdb") ||
  73. of_flat_dt_is_compatible(root, "fsl,mpc8378rdb") ||
  74. of_flat_dt_is_compatible(root, "fsl,mpc8379rdb");
  75. }
  76. define_machine(mpc837x_rdb) {
  77. .name = "MPC837x RDB",
  78. .probe = mpc837x_rdb_probe,
  79. .setup_arch = mpc837x_rdb_setup_arch,
  80. .init_IRQ = mpc837x_rdb_init_IRQ,
  81. .get_irq = ipic_get_irq,
  82. .restart = mpc83xx_restart,
  83. .time_init = mpc83xx_time_init,
  84. .calibrate_decr = generic_calibrate_decr,
  85. .progress = udbg_progress,
  86. };