p1010rdb.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. if (ppc_md.progress)
  41. ppc_md.progress("p1010_rdb_setup_arch()", 0);
  42. fsl_pci_assign_primary();
  43. printk(KERN_INFO "P1010 RDB board from Freescale Semiconductor\n");
  44. }
  45. machine_arch_initcall(p1010_rdb, mpc85xx_common_publish_devices);
  46. machine_arch_initcall(p1010_rdb, swiotlb_setup_bus_notifier);
  47. /*
  48. * Called very early, device-tree isn't unflattened
  49. */
  50. static int __init p1010_rdb_probe(void)
  51. {
  52. unsigned long root = of_get_flat_dt_root();
  53. if (of_flat_dt_is_compatible(root, "fsl,P1010RDB"))
  54. return 1;
  55. if (of_flat_dt_is_compatible(root, "fsl,P1010RDB-PB"))
  56. return 1;
  57. return 0;
  58. }
  59. define_machine(p1010_rdb) {
  60. .name = "P1010 RDB",
  61. .probe = p1010_rdb_probe,
  62. .setup_arch = p1010_rdb_setup_arch,
  63. .init_IRQ = p1010_rdb_pic_init,
  64. #ifdef CONFIG_PCI
  65. .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
  66. .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
  67. #endif
  68. .get_irq = mpic_get_irq,
  69. .restart = fsl_rstcr_restart,
  70. .calibrate_decr = generic_calibrate_decr,
  71. .progress = udbg_progress,
  72. };