p1010rdb.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * P1010RDB Board Setup
  3. *
  4. * Copyright 2011 Freescale Semiconductor Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation; either version 2 of the License, or (at your
  9. * option) any later version.
  10. */
  11. #include <linux/stddef.h>
  12. #include <linux/kernel.h>
  13. #include <linux/pci.h>
  14. #include <linux/delay.h>
  15. #include <linux/interrupt.h>
  16. #include <linux/of_platform.h>
  17. #include <asm/time.h>
  18. #include <asm/machdep.h>
  19. #include <asm/pci-bridge.h>
  20. #include <mm/mmu_decl.h>
  21. #include <asm/prom.h>
  22. #include <asm/udbg.h>
  23. #include <asm/mpic.h>
  24. #include <sysdev/fsl_soc.h>
  25. #include <sysdev/fsl_pci.h>
  26. #include "mpc85xx.h"
  27. void __init p1010_rdb_pic_init(void)
  28. {
  29. struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN |
  30. MPIC_SINGLE_DEST_CPU,
  31. 0, 256, " OpenPIC ");
  32. BUG_ON(mpic == NULL);
  33. mpic_init(mpic);
  34. }
  35. /*
  36. * Setup the architecture
  37. */
  38. static void __init p1010_rdb_setup_arch(void)
  39. {
  40. #ifdef CONFIG_PCI
  41. struct device_node *np;
  42. #endif
  43. if (ppc_md.progress)
  44. ppc_md.progress("p1010_rdb_setup_arch()", 0);
  45. #ifdef CONFIG_PCI
  46. for_each_node_by_type(np, "pci") {
  47. if (of_device_is_compatible(np, "fsl,p1010-pcie"))
  48. fsl_add_bridge(np, 0);
  49. }
  50. #endif
  51. printk(KERN_INFO "P1010 RDB board from Freescale Semiconductor\n");
  52. }
  53. machine_device_initcall(p1010_rdb, mpc85xx_common_publish_devices);
  54. machine_arch_initcall(p1010_rdb, swiotlb_setup_bus_notifier);
  55. /*
  56. * Called very early, device-tree isn't unflattened
  57. */
  58. static int __init p1010_rdb_probe(void)
  59. {
  60. unsigned long root = of_get_flat_dt_root();
  61. if (of_flat_dt_is_compatible(root, "fsl,P1010RDB"))
  62. return 1;
  63. return 0;
  64. }
  65. define_machine(p1010_rdb) {
  66. .name = "P1010 RDB",
  67. .probe = p1010_rdb_probe,
  68. .setup_arch = p1010_rdb_setup_arch,
  69. .init_IRQ = p1010_rdb_pic_init,
  70. #ifdef CONFIG_PCI
  71. .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
  72. #endif
  73. .get_irq = mpic_get_irq,
  74. .restart = fsl_rstcr_restart,
  75. .calibrate_decr = generic_calibrate_decr,
  76. .progress = udbg_progress,
  77. };