mpc8536_ds.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * MPC8536 DS Board Setup
  3. *
  4. * Copyright 2008 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/kdev_t.h>
  15. #include <linux/delay.h>
  16. #include <linux/seq_file.h>
  17. #include <linux/interrupt.h>
  18. #include <linux/of_platform.h>
  19. #include <asm/time.h>
  20. #include <asm/machdep.h>
  21. #include <asm/pci-bridge.h>
  22. #include <mm/mmu_decl.h>
  23. #include <asm/prom.h>
  24. #include <asm/udbg.h>
  25. #include <asm/mpic.h>
  26. #include <asm/swiotlb.h>
  27. #include <sysdev/fsl_soc.h>
  28. #include <sysdev/fsl_pci.h>
  29. #include "mpc85xx.h"
  30. void __init mpc8536_ds_pic_init(void)
  31. {
  32. struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN,
  33. 0, 256, " OpenPIC ");
  34. BUG_ON(mpic == NULL);
  35. mpic_init(mpic);
  36. }
  37. /*
  38. * Setup the architecture
  39. */
  40. static void __init mpc8536_ds_setup_arch(void)
  41. {
  42. if (ppc_md.progress)
  43. ppc_md.progress("mpc8536_ds_setup_arch()", 0);
  44. fsl_pci_assign_primary();
  45. swiotlb_detect_4g();
  46. printk("MPC8536 DS board from Freescale Semiconductor\n");
  47. }
  48. machine_arch_initcall(mpc8536_ds, mpc85xx_common_publish_devices);
  49. machine_arch_initcall(mpc8536_ds, swiotlb_setup_bus_notifier);
  50. /*
  51. * Called very early, device-tree isn't unflattened
  52. */
  53. static int __init mpc8536_ds_probe(void)
  54. {
  55. unsigned long root = of_get_flat_dt_root();
  56. return of_flat_dt_is_compatible(root, "fsl,mpc8536ds");
  57. }
  58. define_machine(mpc8536_ds) {
  59. .name = "MPC8536 DS",
  60. .probe = mpc8536_ds_probe,
  61. .setup_arch = mpc8536_ds_setup_arch,
  62. .init_IRQ = mpc8536_ds_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. .restart = fsl_rstcr_restart,
  69. .calibrate_decr = generic_calibrate_decr,
  70. .progress = udbg_progress,
  71. };