stx_gp3.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. * Based on MPC8560 ADS and arch/ppc stx_gp3 ports
  3. *
  4. * Maintained by Kumar Gala (see MAINTAINERS for contact information)
  5. *
  6. * Copyright 2008 Freescale Semiconductor Inc.
  7. *
  8. * Dan Malek <dan@embeddededge.com>
  9. * Copyright 2004 Embedded Edge, LLC
  10. *
  11. * Copied from mpc8560_ads.c
  12. * Copyright 2002, 2003 Motorola Inc.
  13. *
  14. * Ported to 2.6, Matt Porter <mporter@kernel.crashing.org>
  15. * Copyright 2004-2005 MontaVista Software, Inc.
  16. *
  17. * This program is free software; you can redistribute it and/or modify it
  18. * under the terms of the GNU General Public License as published by the
  19. * Free Software Foundation; either version 2 of the License, or (at your
  20. * option) any later version.
  21. */
  22. #include <linux/stddef.h>
  23. #include <linux/kernel.h>
  24. #include <linux/pci.h>
  25. #include <linux/kdev_t.h>
  26. #include <linux/delay.h>
  27. #include <linux/seq_file.h>
  28. #include <linux/of_platform.h>
  29. #include <asm/system.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. #ifdef CONFIG_CPM2
  41. #include <asm/cpm2.h>
  42. #endif /* CONFIG_CPM2 */
  43. static void __init stx_gp3_pic_init(void)
  44. {
  45. struct mpic *mpic = mpic_alloc(NULL, 0,
  46. MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
  47. 0, 256, " OpenPIC ");
  48. BUG_ON(mpic == NULL);
  49. mpic_init(mpic);
  50. mpc85xx_cpm2_pic_init();
  51. }
  52. /*
  53. * Setup the architecture
  54. */
  55. static void __init stx_gp3_setup_arch(void)
  56. {
  57. #ifdef CONFIG_PCI
  58. struct device_node *np;
  59. #endif
  60. if (ppc_md.progress)
  61. ppc_md.progress("stx_gp3_setup_arch()", 0);
  62. #ifdef CONFIG_CPM2
  63. cpm2_reset();
  64. #endif
  65. #ifdef CONFIG_PCI
  66. for_each_compatible_node(np, "pci", "fsl,mpc8540-pci")
  67. fsl_add_bridge(np, 1);
  68. #endif
  69. }
  70. static void stx_gp3_show_cpuinfo(struct seq_file *m)
  71. {
  72. uint pvid, svid, phid1;
  73. pvid = mfspr(SPRN_PVR);
  74. svid = mfspr(SPRN_SVR);
  75. seq_printf(m, "Vendor\t\t: RPC Electronics STx\n");
  76. seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
  77. seq_printf(m, "SVR\t\t: 0x%x\n", svid);
  78. /* Display cpu Pll setting */
  79. phid1 = mfspr(SPRN_HID1);
  80. seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
  81. }
  82. machine_device_initcall(stx_gp3, mpc85xx_common_publish_devices);
  83. /*
  84. * Called very early, device-tree isn't unflattened
  85. */
  86. static int __init stx_gp3_probe(void)
  87. {
  88. unsigned long root = of_get_flat_dt_root();
  89. return of_flat_dt_is_compatible(root, "stx,gp3-8560");
  90. }
  91. define_machine(stx_gp3) {
  92. .name = "STX GP3",
  93. .probe = stx_gp3_probe,
  94. .setup_arch = stx_gp3_setup_arch,
  95. .init_IRQ = stx_gp3_pic_init,
  96. .show_cpuinfo = stx_gp3_show_cpuinfo,
  97. .get_irq = mpic_get_irq,
  98. .restart = fsl_rstcr_restart,
  99. .calibrate_decr = generic_calibrate_decr,
  100. .progress = udbg_progress,
  101. };