socrates.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Copyright (c) 2008 Emcraft Systems
  3. * Sergei Poselenov <sposelenov@emcraft.com>
  4. *
  5. * Based on MPC8560 ADS and arch/ppc tqm85xx ports
  6. *
  7. * Maintained by Kumar Gala (see MAINTAINERS for contact information)
  8. *
  9. * Copyright 2008 Freescale Semiconductor Inc.
  10. *
  11. * Copyright (c) 2005-2006 DENX Software Engineering
  12. * Stefan Roese <sr@denx.de>
  13. *
  14. * Based on original work by
  15. * Kumar Gala <kumar.gala@freescale.com>
  16. * Copyright 2004 Freescale Semiconductor Inc.
  17. *
  18. * This program is free software; you can redistribute it and/or modify it
  19. * under the terms of the GNU General Public License as published by the
  20. * Free Software Foundation; either version 2 of the License, or (at your
  21. * option) any later version.
  22. */
  23. #include <linux/stddef.h>
  24. #include <linux/kernel.h>
  25. #include <linux/pci.h>
  26. #include <linux/kdev_t.h>
  27. #include <linux/delay.h>
  28. #include <linux/seq_file.h>
  29. #include <linux/of_platform.h>
  30. #include <asm/time.h>
  31. #include <asm/machdep.h>
  32. #include <asm/pci-bridge.h>
  33. #include <asm/mpic.h>
  34. #include <asm/prom.h>
  35. #include <mm/mmu_decl.h>
  36. #include <asm/udbg.h>
  37. #include <sysdev/fsl_soc.h>
  38. #include <sysdev/fsl_pci.h>
  39. #include "mpc85xx.h"
  40. #include "socrates_fpga_pic.h"
  41. static void __init socrates_pic_init(void)
  42. {
  43. struct device_node *np;
  44. struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN,
  45. 0, 256, " OpenPIC ");
  46. BUG_ON(mpic == NULL);
  47. mpic_init(mpic);
  48. np = of_find_compatible_node(NULL, NULL, "abb,socrates-fpga-pic");
  49. if (!np) {
  50. printk(KERN_ERR "Could not find socrates-fpga-pic node\n");
  51. return;
  52. }
  53. socrates_fpga_pic_init(np);
  54. of_node_put(np);
  55. }
  56. /*
  57. * Setup the architecture
  58. */
  59. static void __init socrates_setup_arch(void)
  60. {
  61. if (ppc_md.progress)
  62. ppc_md.progress("socrates_setup_arch()", 0);
  63. fsl_pci_assign_primary();
  64. }
  65. machine_arch_initcall(socrates, mpc85xx_common_publish_devices);
  66. /*
  67. * Called very early, device-tree isn't unflattened
  68. */
  69. static int __init socrates_probe(void)
  70. {
  71. if (of_machine_is_compatible("abb,socrates"))
  72. return 1;
  73. return 0;
  74. }
  75. define_machine(socrates) {
  76. .name = "Socrates",
  77. .probe = socrates_probe,
  78. .setup_arch = socrates_setup_arch,
  79. .init_IRQ = socrates_pic_init,
  80. .get_irq = mpic_get_irq,
  81. .calibrate_decr = generic_calibrate_decr,
  82. .progress = udbg_progress,
  83. };