sbc834x.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*
  2. * arch/powerpc/platforms/83xx/sbc834x.c
  3. *
  4. * Wind River SBC834x board specific routines
  5. *
  6. * By Paul Gortmaker (see MAINTAINERS for contact information)
  7. *
  8. * Based largely on the mpc834x_mds.c support by Kumar Gala.
  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/stddef.h>
  16. #include <linux/kernel.h>
  17. #include <linux/init.h>
  18. #include <linux/errno.h>
  19. #include <linux/reboot.h>
  20. #include <linux/pci.h>
  21. #include <linux/kdev_t.h>
  22. #include <linux/major.h>
  23. #include <linux/console.h>
  24. #include <linux/delay.h>
  25. #include <linux/seq_file.h>
  26. #include <linux/root_dev.h>
  27. #include <linux/of_platform.h>
  28. #include <asm/system.h>
  29. #include <asm/atomic.h>
  30. #include <asm/time.h>
  31. #include <asm/io.h>
  32. #include <asm/machdep.h>
  33. #include <asm/ipic.h>
  34. #include <asm/irq.h>
  35. #include <asm/prom.h>
  36. #include <asm/udbg.h>
  37. #include <sysdev/fsl_soc.h>
  38. #include <sysdev/fsl_pci.h>
  39. #include "mpc83xx.h"
  40. /* ************************************************************************
  41. *
  42. * Setup the architecture
  43. *
  44. */
  45. static void __init sbc834x_setup_arch(void)
  46. {
  47. #ifdef CONFIG_PCI
  48. struct device_node *np;
  49. #endif
  50. if (ppc_md.progress)
  51. ppc_md.progress("sbc834x_setup_arch()", 0);
  52. #ifdef CONFIG_PCI
  53. for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
  54. mpc83xx_add_bridge(np);
  55. #endif
  56. }
  57. static void __init sbc834x_init_IRQ(void)
  58. {
  59. struct device_node *np;
  60. np = of_find_node_by_type(NULL, "ipic");
  61. if (!np)
  62. return;
  63. ipic_init(np, 0);
  64. /* Initialize the default interrupt mapping priorities,
  65. * in case the boot rom changed something on us.
  66. */
  67. ipic_set_default_priority();
  68. of_node_put(np);
  69. }
  70. static struct __initdata of_device_id sbc834x_ids[] = {
  71. { .type = "soc", },
  72. { .compatible = "soc", },
  73. { .compatible = "simple-bus", },
  74. { .compatible = "gianfar", },
  75. {},
  76. };
  77. static int __init sbc834x_declare_of_platform_devices(void)
  78. {
  79. of_platform_bus_probe(NULL, sbc834x_ids, NULL);
  80. return 0;
  81. }
  82. machine_device_initcall(sbc834x, sbc834x_declare_of_platform_devices);
  83. /*
  84. * Called very early, MMU is off, device-tree isn't unflattened
  85. */
  86. static int __init sbc834x_probe(void)
  87. {
  88. unsigned long root = of_get_flat_dt_root();
  89. return of_flat_dt_is_compatible(root, "SBC834x");
  90. }
  91. define_machine(sbc834x) {
  92. .name = "SBC834x",
  93. .probe = sbc834x_probe,
  94. .setup_arch = sbc834x_setup_arch,
  95. .init_IRQ = sbc834x_init_IRQ,
  96. .get_irq = ipic_get_irq,
  97. .restart = mpc83xx_restart,
  98. .time_init = mpc83xx_time_init,
  99. .calibrate_decr = generic_calibrate_decr,
  100. .progress = udbg_progress,
  101. };