mpc8313_rdb.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. #ifndef CONFIG_PCI
  27. unsigned long isa_io_base = 0;
  28. unsigned long isa_mem_base = 0;
  29. #endif
  30. /* ************************************************************************
  31. *
  32. * Setup the architecture
  33. *
  34. */
  35. static void __init mpc8313_rdb_setup_arch(void)
  36. {
  37. #ifdef CONFIG_PCI
  38. struct device_node *np;
  39. #endif
  40. if (ppc_md.progress)
  41. ppc_md.progress("mpc8313_rdb_setup_arch()", 0);
  42. #ifdef CONFIG_PCI
  43. for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
  44. add_bridge(np);
  45. ppc_md.pci_exclude_device = mpc83xx_exclude_device;
  46. #endif
  47. }
  48. void __init mpc8313_rdb_init_IRQ(void)
  49. {
  50. struct device_node *np;
  51. np = of_find_node_by_type(NULL, "ipic");
  52. if (!np)
  53. return;
  54. ipic_init(np, 0);
  55. /* Initialize the default interrupt mapping priorities,
  56. * in case the boot rom changed something on us.
  57. */
  58. ipic_set_default_priority();
  59. }
  60. /*
  61. * Called very early, MMU is off, device-tree isn't unflattened
  62. */
  63. static int __init mpc8313_rdb_probe(void)
  64. {
  65. unsigned long root = of_get_flat_dt_root();
  66. return of_flat_dt_is_compatible(root, "MPC8313ERDB");
  67. }
  68. define_machine(mpc8313_rdb) {
  69. .name = "MPC8313 RDB",
  70. .probe = mpc8313_rdb_probe,
  71. .setup_arch = mpc8313_rdb_setup_arch,
  72. .init_IRQ = mpc8313_rdb_init_IRQ,
  73. .get_irq = ipic_get_irq,
  74. .restart = mpc83xx_restart,
  75. .time_init = mpc83xx_time_init,
  76. .calibrate_decr = generic_calibrate_decr,
  77. .progress = udbg_progress,
  78. };