mpc8313_rdb.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 <asm/time.h>
  17. #include <asm/ipic.h>
  18. #include <asm/udbg.h>
  19. #include "mpc83xx.h"
  20. #undef DEBUG
  21. #ifdef DEBUG
  22. #define DBG(fmt...) udbg_printf(fmt)
  23. #else
  24. #define DBG(fmt...)
  25. #endif
  26. /* ************************************************************************
  27. *
  28. * Setup the architecture
  29. *
  30. */
  31. static void __init mpc8313_rdb_setup_arch(void)
  32. {
  33. #ifdef CONFIG_PCI
  34. struct device_node *np;
  35. #endif
  36. if (ppc_md.progress)
  37. ppc_md.progress("mpc8313_rdb_setup_arch()", 0);
  38. #ifdef CONFIG_PCI
  39. for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
  40. mpc83xx_add_bridge(np);
  41. #endif
  42. mpc831x_usb_cfg();
  43. }
  44. void __init mpc8313_rdb_init_IRQ(void)
  45. {
  46. struct device_node *np;
  47. np = of_find_node_by_type(NULL, "ipic");
  48. if (!np)
  49. return;
  50. ipic_init(np, 0);
  51. /* Initialize the default interrupt mapping priorities,
  52. * in case the boot rom changed something on us.
  53. */
  54. ipic_set_default_priority();
  55. }
  56. /*
  57. * Called very early, MMU is off, device-tree isn't unflattened
  58. */
  59. static int __init mpc8313_rdb_probe(void)
  60. {
  61. unsigned long root = of_get_flat_dt_root();
  62. return of_flat_dt_is_compatible(root, "MPC8313ERDB");
  63. }
  64. define_machine(mpc8313_rdb) {
  65. .name = "MPC8313 RDB",
  66. .probe = mpc8313_rdb_probe,
  67. .setup_arch = mpc8313_rdb_setup_arch,
  68. .init_IRQ = mpc8313_rdb_init_IRQ,
  69. .get_irq = ipic_get_irq,
  70. .restart = mpc83xx_restart,
  71. .time_init = mpc83xx_time_init,
  72. .calibrate_decr = generic_calibrate_decr,
  73. .progress = udbg_progress,
  74. };