p1010rdb.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. if (of_machine_is_compatible("fsl,P1010RDB"))
  53. return 1;
  54. if (of_machine_is_compatible("fsl,P1010RDB-PB"))
  55. return 1;
  56. return 0;
  57. }
  58. define_machine(p1010_rdb) {
  59. .name = "P1010 RDB",
  60. .probe = p1010_rdb_probe,
  61. .setup_arch = p1010_rdb_setup_arch,
  62. .init_IRQ = p1010_rdb_pic_init,
  63. #ifdef CONFIG_PCI
  64. .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
  65. .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
  66. #endif
  67. .get_irq = mpic_get_irq,
  68. .calibrate_decr = generic_calibrate_decr,
  69. .progress = udbg_progress,
  70. };