mpc832x_rdb.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /*
  2. * arch/powerpc/platforms/83xx/mpc832x_rdb.c
  3. *
  4. * Copyright (C) Freescale Semiconductor, Inc. 2007. All rights reserved.
  5. *
  6. * Description:
  7. * MPC832x RDB board specific routines.
  8. * This file is based on mpc832x_mds.c and mpc8313_rdb.c
  9. * Author: Michael Barkowski <michael.barkowski@freescale.com>
  10. *
  11. * This program is free software; you can redistribute it and/or modify it
  12. * under the terms of the GNU General Public License as published by the
  13. * Free Software Foundation; either version 2 of the License, or (at your
  14. * option) any later version.
  15. */
  16. #include <linux/pci.h>
  17. #include <asm/of_platform.h>
  18. #include <asm/time.h>
  19. #include <asm/ipic.h>
  20. #include <asm/udbg.h>
  21. #include <asm/qe.h>
  22. #include <asm/qe_ic.h>
  23. #include "mpc83xx.h"
  24. #undef DEBUG
  25. #ifdef DEBUG
  26. #define DBG(fmt...) udbg_printf(fmt)
  27. #else
  28. #define DBG(fmt...)
  29. #endif
  30. #ifndef CONFIG_PCI
  31. unsigned long isa_io_base = 0;
  32. unsigned long isa_mem_base = 0;
  33. #endif
  34. /* ************************************************************************
  35. *
  36. * Setup the architecture
  37. *
  38. */
  39. static void __init mpc832x_rdb_setup_arch(void)
  40. {
  41. #if defined(CONFIG_PCI) || defined(CONFIG_QUICC_ENGINE)
  42. struct device_node *np;
  43. #endif
  44. if (ppc_md.progress)
  45. ppc_md.progress("mpc832x_rdb_setup_arch()", 0);
  46. #ifdef CONFIG_PCI
  47. for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
  48. add_bridge(np);
  49. ppc_md.pci_exclude_device = mpc83xx_exclude_device;
  50. #endif
  51. #ifdef CONFIG_QUICC_ENGINE
  52. qe_reset();
  53. if ((np = of_find_node_by_name(np, "par_io")) != NULL) {
  54. par_io_init(np);
  55. of_node_put(np);
  56. for (np = NULL; (np = of_find_node_by_name(np, "ucc")) != NULL;)
  57. par_io_of_config(np);
  58. }
  59. #endif /* CONFIG_QUICC_ENGINE */
  60. }
  61. static struct of_device_id mpc832x_ids[] = {
  62. { .type = "soc", },
  63. { .compatible = "soc", },
  64. { .type = "qe", },
  65. { .type = "mdio", },
  66. {},
  67. };
  68. static int __init mpc832x_declare_of_platform_devices(void)
  69. {
  70. if (!machine_is(mpc832x_rdb))
  71. return 0;
  72. /* Publish the QE devices */
  73. of_platform_bus_probe(NULL, mpc832x_ids, NULL);
  74. return 0;
  75. }
  76. device_initcall(mpc832x_declare_of_platform_devices);
  77. void __init mpc832x_rdb_init_IRQ(void)
  78. {
  79. struct device_node *np;
  80. np = of_find_node_by_type(NULL, "ipic");
  81. if (!np)
  82. return;
  83. ipic_init(np, 0);
  84. /* Initialize the default interrupt mapping priorities,
  85. * in case the boot rom changed something on us.
  86. */
  87. ipic_set_default_priority();
  88. of_node_put(np);
  89. #ifdef CONFIG_QUICC_ENGINE
  90. np = of_find_node_by_type(NULL, "qeic");
  91. if (!np)
  92. return;
  93. qe_ic_init(np, 0);
  94. of_node_put(np);
  95. #endif /* CONFIG_QUICC_ENGINE */
  96. }
  97. /*
  98. * Called very early, MMU is off, device-tree isn't unflattened
  99. */
  100. static int __init mpc832x_rdb_probe(void)
  101. {
  102. unsigned long root = of_get_flat_dt_root();
  103. return of_flat_dt_is_compatible(root, "MPC832xRDB");
  104. }
  105. define_machine(mpc832x_rdb) {
  106. .name = "MPC832x RDB",
  107. .probe = mpc832x_rdb_probe,
  108. .setup_arch = mpc832x_rdb_setup_arch,
  109. .init_IRQ = mpc832x_rdb_init_IRQ,
  110. .get_irq = ipic_get_irq,
  111. .restart = mpc83xx_restart,
  112. .time_init = mpc83xx_time_init,
  113. .calibrate_decr = generic_calibrate_decr,
  114. .progress = udbg_progress,
  115. };