p1010rdb.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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/system.h>
  18. #include <asm/time.h>
  19. #include <asm/machdep.h>
  20. #include <asm/pci-bridge.h>
  21. #include <mm/mmu_decl.h>
  22. #include <asm/prom.h>
  23. #include <asm/udbg.h>
  24. #include <asm/mpic.h>
  25. #include <sysdev/fsl_soc.h>
  26. #include <sysdev/fsl_pci.h>
  27. #include "mpc85xx.h"
  28. void __init p1010_rdb_pic_init(void)
  29. {
  30. struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN |
  31. MPIC_SINGLE_DEST_CPU,
  32. 0, 256, " OpenPIC ");
  33. BUG_ON(mpic == NULL);
  34. mpic_init(mpic);
  35. }
  36. /*
  37. * Setup the architecture
  38. */
  39. static void __init p1010_rdb_setup_arch(void)
  40. {
  41. #ifdef CONFIG_PCI
  42. struct device_node *np;
  43. #endif
  44. if (ppc_md.progress)
  45. ppc_md.progress("p1010_rdb_setup_arch()", 0);
  46. #ifdef CONFIG_PCI
  47. for_each_node_by_type(np, "pci") {
  48. if (of_device_is_compatible(np, "fsl,p1010-pcie"))
  49. fsl_add_bridge(np, 0);
  50. }
  51. #endif
  52. printk(KERN_INFO "P1010 RDB board from Freescale Semiconductor\n");
  53. }
  54. machine_device_initcall(p1010_rdb, mpc85xx_common_publish_devices);
  55. machine_arch_initcall(p1010_rdb, swiotlb_setup_bus_notifier);
  56. /*
  57. * Called very early, device-tree isn't unflattened
  58. */
  59. static int __init p1010_rdb_probe(void)
  60. {
  61. unsigned long root = of_get_flat_dt_root();
  62. if (of_flat_dt_is_compatible(root, "fsl,P1010RDB"))
  63. return 1;
  64. return 0;
  65. }
  66. define_machine(p1010_rdb) {
  67. .name = "P1010 RDB",
  68. .probe = p1010_rdb_probe,
  69. .setup_arch = p1010_rdb_setup_arch,
  70. .init_IRQ = p1010_rdb_pic_init,
  71. #ifdef CONFIG_PCI
  72. .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
  73. #endif
  74. .get_irq = mpic_get_irq,
  75. .restart = fsl_rstcr_restart,
  76. .calibrate_decr = generic_calibrate_decr,
  77. .progress = udbg_progress,
  78. };