mpc832x_rdb.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. struct device_node *np;
  42. if (ppc_md.progress)
  43. ppc_md.progress("mpc832x_rdb_setup_arch()", 0);
  44. #ifdef CONFIG_PCI
  45. for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
  46. add_bridge(np);
  47. ppc_md.pci_exclude_device = mpc83xx_exclude_device;
  48. #endif
  49. #ifdef CONFIG_QUICC_ENGINE
  50. qe_reset();
  51. if ((np = of_find_node_by_name(np, "par_io")) != NULL) {
  52. par_io_init(np);
  53. of_node_put(np);
  54. for (np = NULL; (np = of_find_node_by_name(np, "ucc")) != NULL;)
  55. par_io_of_config(np);
  56. }
  57. #endif /* CONFIG_QUICC_ENGINE */
  58. }
  59. static struct of_device_id mpc832x_ids[] = {
  60. { .type = "soc", },
  61. { .compatible = "soc", },
  62. { .type = "qe", },
  63. { .type = "mdio", },
  64. {},
  65. };
  66. static int __init mpc832x_declare_of_platform_devices(void)
  67. {
  68. if (!machine_is(mpc832x_rdb))
  69. return 0;
  70. /* Publish the QE devices */
  71. of_platform_bus_probe(NULL, mpc832x_ids, NULL);
  72. return 0;
  73. }
  74. device_initcall(mpc832x_declare_of_platform_devices);
  75. void __init mpc832x_rdb_init_IRQ(void)
  76. {
  77. struct device_node *np;
  78. np = of_find_node_by_type(NULL, "ipic");
  79. if (!np)
  80. return;
  81. ipic_init(np, 0);
  82. /* Initialize the default interrupt mapping priorities,
  83. * in case the boot rom changed something on us.
  84. */
  85. ipic_set_default_priority();
  86. of_node_put(np);
  87. #ifdef CONFIG_QUICC_ENGINE
  88. np = of_find_node_by_type(NULL, "qeic");
  89. if (!np)
  90. return;
  91. qe_ic_init(np, 0);
  92. of_node_put(np);
  93. #endif /* CONFIG_QUICC_ENGINE */
  94. }
  95. /*
  96. * Called very early, MMU is off, device-tree isn't unflattened
  97. */
  98. static int __init mpc832x_rdb_probe(void)
  99. {
  100. unsigned long root = of_get_flat_dt_root();
  101. return of_flat_dt_is_compatible(root, "MPC832xRDB");
  102. }
  103. define_machine(mpc832x_rdb) {
  104. .name = "MPC832x RDB",
  105. .probe = mpc832x_rdb_probe,
  106. .setup_arch = mpc832x_rdb_setup_arch,
  107. .init_IRQ = mpc832x_rdb_init_IRQ,
  108. .get_irq = ipic_get_irq,
  109. .restart = mpc83xx_restart,
  110. .time_init = mpc83xx_time_init,
  111. .calibrate_decr = generic_calibrate_decr,
  112. .progress = udbg_progress,
  113. };