mpc8313_rdb.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
  40. mpc83xx_add_bridge(np);
  41. ppc_md.pci_exclude_device = mpc83xx_exclude_device;
  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. define_machine(mpc8313_rdb) {
  66. .name = "MPC8313 RDB",
  67. .probe = mpc8313_rdb_probe,
  68. .setup_arch = mpc8313_rdb_setup_arch,
  69. .init_IRQ = mpc8313_rdb_init_IRQ,
  70. .get_irq = ipic_get_irq,
  71. .restart = mpc83xx_restart,
  72. .time_init = mpc83xx_time_init,
  73. .calibrate_decr = generic_calibrate_decr,
  74. .progress = udbg_progress,
  75. };