mpc834x_itx.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. * arch/powerpc/platforms/83xx/mpc834x_itx.c
  3. *
  4. * MPC834x ITX board specific routines
  5. *
  6. * Maintainer: Kumar Gala <galak@kernel.crashing.org>
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2 of the License, or (at your
  11. * option) any later version.
  12. */
  13. #include <linux/stddef.h>
  14. #include <linux/kernel.h>
  15. #include <linux/init.h>
  16. #include <linux/errno.h>
  17. #include <linux/reboot.h>
  18. #include <linux/pci.h>
  19. #include <linux/kdev_t.h>
  20. #include <linux/major.h>
  21. #include <linux/console.h>
  22. #include <linux/delay.h>
  23. #include <linux/seq_file.h>
  24. #include <linux/root_dev.h>
  25. #include <asm/system.h>
  26. #include <asm/atomic.h>
  27. #include <asm/time.h>
  28. #include <asm/io.h>
  29. #include <asm/machdep.h>
  30. #include <asm/ipic.h>
  31. #include <asm/bootinfo.h>
  32. #include <asm/irq.h>
  33. #include <asm/prom.h>
  34. #include <asm/udbg.h>
  35. #include <sysdev/fsl_soc.h>
  36. #include "mpc83xx.h"
  37. #include <platforms/83xx/mpc834x_sys.h>
  38. #ifndef CONFIG_PCI
  39. unsigned long isa_io_base = 0;
  40. unsigned long isa_mem_base = 0;
  41. #endif
  42. /* ************************************************************************
  43. *
  44. * Setup the architecture
  45. *
  46. */
  47. static void __init mpc834x_itx_setup_arch(void)
  48. {
  49. struct device_node *np;
  50. if (ppc_md.progress)
  51. ppc_md.progress("mpc834x_itx_setup_arch()", 0);
  52. np = of_find_node_by_type(NULL, "cpu");
  53. if (np != 0) {
  54. const unsigned int *fp =
  55. get_property(np, "clock-frequency", NULL);
  56. if (fp != 0)
  57. loops_per_jiffy = *fp / HZ;
  58. else
  59. loops_per_jiffy = 50000000 / HZ;
  60. of_node_put(np);
  61. }
  62. #ifdef CONFIG_PCI
  63. for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
  64. add_bridge(np);
  65. ppc_md.pci_exclude_device = mpc83xx_exclude_device;
  66. #endif
  67. #ifdef CONFIG_ROOT_NFS
  68. ROOT_DEV = Root_NFS;
  69. #else
  70. ROOT_DEV = Root_HDA1;
  71. #endif
  72. }
  73. void __init mpc834x_itx_init_IRQ(void)
  74. {
  75. struct device_node *np;
  76. np = of_find_node_by_type(NULL, "ipic");
  77. if (!np)
  78. return;
  79. ipic_init(np, 0);
  80. /* Initialize the default interrupt mapping priorities,
  81. * in case the boot rom changed something on us.
  82. */
  83. ipic_set_default_priority();
  84. }
  85. /*
  86. * Called very early, MMU is off, device-tree isn't unflattened
  87. */
  88. static int __init mpc834x_itx_probe(void)
  89. {
  90. /* We always match for now, eventually we should look at the flat
  91. dev tree to ensure this is the board we are suppose to run on
  92. */
  93. return 1;
  94. }
  95. #ifdef CONFIG_RTC_CLASS
  96. late_initcall(rtc_class_hookup);
  97. #endif
  98. define_machine(mpc834x_itx) {
  99. .name = "MPC834x ITX",
  100. .probe = mpc834x_itx_probe,
  101. .setup_arch = mpc834x_itx_setup_arch,
  102. .init_IRQ = mpc834x_itx_init_IRQ,
  103. .get_irq = ipic_get_irq,
  104. .restart = mpc83xx_restart,
  105. .time_init = mpc83xx_time_init,
  106. .calibrate_decr = generic_calibrate_decr,
  107. .progress = udbg_progress,
  108. #ifdef CONFIG_PCI
  109. .pcibios_fixup = mpc83xx_pcibios_fixup,
  110. #endif
  111. };