stx_gp3.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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/time.h>
  30. #include <asm/machdep.h>
  31. #include <asm/pci-bridge.h>
  32. #include <asm/mpic.h>
  33. #include <asm/prom.h>
  34. #include <mm/mmu_decl.h>
  35. #include <asm/udbg.h>
  36. #include <sysdev/fsl_soc.h>
  37. #include <sysdev/fsl_pci.h>
  38. #include "mpc85xx.h"
  39. #ifdef CONFIG_CPM2
  40. #include <asm/cpm2.h>
  41. #endif /* CONFIG_CPM2 */
  42. static void __init stx_gp3_pic_init(void)
  43. {
  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. mpc85xx_cpm2_pic_init();
  49. }
  50. /*
  51. * Setup the architecture
  52. */
  53. static void __init stx_gp3_setup_arch(void)
  54. {
  55. if (ppc_md.progress)
  56. ppc_md.progress("stx_gp3_setup_arch()", 0);
  57. fsl_pci_assign_primary();
  58. #ifdef CONFIG_CPM2
  59. cpm2_reset();
  60. #endif
  61. }
  62. static void stx_gp3_show_cpuinfo(struct seq_file *m)
  63. {
  64. uint pvid, svid, phid1;
  65. pvid = mfspr(SPRN_PVR);
  66. svid = mfspr(SPRN_SVR);
  67. seq_printf(m, "Vendor\t\t: RPC Electronics STx\n");
  68. seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
  69. seq_printf(m, "SVR\t\t: 0x%x\n", svid);
  70. /* Display cpu Pll setting */
  71. phid1 = mfspr(SPRN_HID1);
  72. seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
  73. }
  74. machine_arch_initcall(stx_gp3, mpc85xx_common_publish_devices);
  75. /*
  76. * Called very early, device-tree isn't unflattened
  77. */
  78. static int __init stx_gp3_probe(void)
  79. {
  80. unsigned long root = of_get_flat_dt_root();
  81. return of_flat_dt_is_compatible(root, "stx,gp3-8560");
  82. }
  83. define_machine(stx_gp3) {
  84. .name = "STX GP3",
  85. .probe = stx_gp3_probe,
  86. .setup_arch = stx_gp3_setup_arch,
  87. .init_IRQ = stx_gp3_pic_init,
  88. .show_cpuinfo = stx_gp3_show_cpuinfo,
  89. .get_irq = mpic_get_irq,
  90. .restart = fsl_rstcr_restart,
  91. .calibrate_decr = generic_calibrate_decr,
  92. .progress = udbg_progress,
  93. };