mpc8313_rdb.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * arch/powerpc/platforms/83xx/mpc8313_rdb.c
  3. *
  4. * Description: MPC8313x RDB board specific routines.
  5. * This file is based on mpc834x_sys.c
  6. * Author: Lo Wlison <r43300@freescale.com>
  7. *
  8. * Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the
  12. * Free Software Foundation; either version 2 of the License, or (at your
  13. * option) any later version.
  14. */
  15. #include <linux/pci.h>
  16. #include <linux/of_platform.h>
  17. #include <asm/time.h>
  18. #include <asm/ipic.h>
  19. #include <asm/udbg.h>
  20. #include "mpc83xx.h"
  21. #undef DEBUG
  22. #ifdef DEBUG
  23. #define DBG(fmt...) udbg_printf(fmt)
  24. #else
  25. #define DBG(fmt...)
  26. #endif
  27. /* ************************************************************************
  28. *
  29. * Setup the architecture
  30. *
  31. */
  32. static void __init mpc8313_rdb_setup_arch(void)
  33. {
  34. #ifdef CONFIG_PCI
  35. struct device_node *np;
  36. #endif
  37. if (ppc_md.progress)
  38. ppc_md.progress("mpc8313_rdb_setup_arch()", 0);
  39. #ifdef CONFIG_PCI
  40. for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
  41. mpc83xx_add_bridge(np);
  42. #endif
  43. mpc831x_usb_cfg();
  44. }
  45. void __init mpc8313_rdb_init_IRQ(void)
  46. {
  47. struct device_node *np;
  48. np = of_find_node_by_type(NULL, "ipic");
  49. if (!np)
  50. return;
  51. ipic_init(np, 0);
  52. /* Initialize the default interrupt mapping priorities,
  53. * in case the boot rom changed something on us.
  54. */
  55. ipic_set_default_priority();
  56. }
  57. /*
  58. * Called very early, MMU is off, device-tree isn't unflattened
  59. */
  60. static int __init mpc8313_rdb_probe(void)
  61. {
  62. unsigned long root = of_get_flat_dt_root();
  63. return of_flat_dt_is_compatible(root, "MPC8313ERDB");
  64. }
  65. static struct of_device_id __initdata of_bus_ids[] = {
  66. { .compatible = "simple-bus" },
  67. {},
  68. };
  69. static int __init declare_of_platform_devices(void)
  70. {
  71. of_platform_bus_probe(NULL, of_bus_ids, NULL);
  72. return 0;
  73. }
  74. machine_device_initcall(mpc8313_rdb, declare_of_platform_devices);
  75. define_machine(mpc8313_rdb) {
  76. .name = "MPC8313 RDB",
  77. .probe = mpc8313_rdb_probe,
  78. .setup_arch = mpc8313_rdb_setup_arch,
  79. .init_IRQ = mpc8313_rdb_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. };