mpc834x_itx.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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/config.h>
  14. #include <linux/stddef.h>
  15. #include <linux/kernel.h>
  16. #include <linux/init.h>
  17. #include <linux/errno.h>
  18. #include <linux/reboot.h>
  19. #include <linux/pci.h>
  20. #include <linux/kdev_t.h>
  21. #include <linux/major.h>
  22. #include <linux/console.h>
  23. #include <linux/delay.h>
  24. #include <linux/seq_file.h>
  25. #include <linux/root_dev.h>
  26. #include <asm/system.h>
  27. #include <asm/atomic.h>
  28. #include <asm/time.h>
  29. #include <asm/io.h>
  30. #include <asm/machdep.h>
  31. #include <asm/ipic.h>
  32. #include <asm/bootinfo.h>
  33. #include <asm/irq.h>
  34. #include <asm/prom.h>
  35. #include <asm/udbg.h>
  36. #include <sysdev/fsl_soc.h>
  37. #include "mpc83xx.h"
  38. #include <platforms/83xx/mpc834x_sys.h>
  39. #ifndef CONFIG_PCI
  40. unsigned long isa_io_base = 0;
  41. unsigned long isa_mem_base = 0;
  42. #endif
  43. /* ************************************************************************
  44. *
  45. * Setup the architecture
  46. *
  47. */
  48. static void __init mpc834x_itx_setup_arch(void)
  49. {
  50. struct device_node *np;
  51. if (ppc_md.progress)
  52. ppc_md.progress("mpc834x_itx_setup_arch()", 0);
  53. np = of_find_node_by_type(NULL, "cpu");
  54. if (np != 0) {
  55. const unsigned int *fp =
  56. get_property(np, "clock-frequency", NULL);
  57. if (fp != 0)
  58. loops_per_jiffy = *fp / HZ;
  59. else
  60. loops_per_jiffy = 50000000 / HZ;
  61. of_node_put(np);
  62. }
  63. #ifdef CONFIG_PCI
  64. for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
  65. add_bridge(np);
  66. ppc_md.pci_exclude_device = mpc83xx_exclude_device;
  67. #endif
  68. #ifdef CONFIG_ROOT_NFS
  69. ROOT_DEV = Root_NFS;
  70. #else
  71. ROOT_DEV = Root_HDA1;
  72. #endif
  73. }
  74. void __init mpc834x_itx_init_IRQ(void)
  75. {
  76. struct device_node *np;
  77. np = of_find_node_by_type(NULL, "ipic");
  78. if (!np)
  79. return;
  80. ipic_init(np, 0);
  81. /* Initialize the default interrupt mapping priorities,
  82. * in case the boot rom changed something on us.
  83. */
  84. ipic_set_default_priority();
  85. }
  86. /*
  87. * Called very early, MMU is off, device-tree isn't unflattened
  88. */
  89. static int __init mpc834x_itx_probe(void)
  90. {
  91. /* We always match for now, eventually we should look at the flat
  92. dev tree to ensure this is the board we are suppose to run on
  93. */
  94. return 1;
  95. }
  96. define_machine(mpc834x_itx) {
  97. .name = "MPC834x ITX",
  98. .probe = mpc834x_itx_probe,
  99. .setup_arch = mpc834x_itx_setup_arch,
  100. .init_IRQ = mpc834x_itx_init_IRQ,
  101. .get_irq = ipic_get_irq,
  102. .restart = mpc83xx_restart,
  103. .time_init = mpc83xx_time_init,
  104. .calibrate_decr = generic_calibrate_decr,
  105. .progress = udbg_progress,
  106. #ifdef CONFIG_PCI
  107. .pcibios_fixup = mpc83xx_pcibios_fixup,
  108. #endif
  109. };