ppa8548.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * ppa8548 setup and early boot code.
  4. *
  5. * Copyright 2009 Prodrive B.V..
  6. *
  7. * By Stef van Os (see MAINTAINERS for contact information)
  8. *
  9. * Based on the SBC8548 support - Copyright 2007 Wind River Systems Inc.
  10. * Based on the MPC8548CDS support - Copyright 2005 Freescale Inc.
  11. */
  12. #include <linux/stddef.h>
  13. #include <linux/kernel.h>
  14. #include <linux/init.h>
  15. #include <linux/reboot.h>
  16. #include <linux/seq_file.h>
  17. #include <linux/of_fdt.h>
  18. #include <linux/of_platform.h>
  19. #include <asm/machdep.h>
  20. #include <asm/udbg.h>
  21. #include <asm/mpic.h>
  22. #include <sysdev/fsl_soc.h>
  23. static void __init ppa8548_pic_init(void)
  24. {
  25. struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN,
  26. 0, 256, " OpenPIC ");
  27. BUG_ON(mpic == NULL);
  28. mpic_init(mpic);
  29. }
  30. /*
  31. * Setup the architecture
  32. */
  33. static void __init ppa8548_setup_arch(void)
  34. {
  35. if (ppc_md.progress)
  36. ppc_md.progress("ppa8548_setup_arch()", 0);
  37. }
  38. static void ppa8548_show_cpuinfo(struct seq_file *m)
  39. {
  40. uint32_t svid, phid1;
  41. svid = mfspr(SPRN_SVR);
  42. seq_printf(m, "Vendor\t\t: Prodrive B.V.\n");
  43. seq_printf(m, "SVR\t\t: 0x%x\n", svid);
  44. /* Display cpu Pll setting */
  45. phid1 = mfspr(SPRN_HID1);
  46. seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
  47. }
  48. static const struct of_device_id of_bus_ids[] __initconst = {
  49. { .name = "soc", },
  50. { .type = "soc", },
  51. { .compatible = "simple-bus", },
  52. { .compatible = "gianfar", },
  53. { .compatible = "fsl,srio", },
  54. {},
  55. };
  56. static int __init declare_of_platform_devices(void)
  57. {
  58. of_platform_bus_probe(NULL, of_bus_ids, NULL);
  59. return 0;
  60. }
  61. machine_device_initcall(ppa8548, declare_of_platform_devices);
  62. /*
  63. * Called very early, device-tree isn't unflattened
  64. */
  65. static int __init ppa8548_probe(void)
  66. {
  67. return of_machine_is_compatible("ppa8548");
  68. }
  69. define_machine(ppa8548) {
  70. .name = "ppa8548",
  71. .probe = ppa8548_probe,
  72. .setup_arch = ppa8548_setup_arch,
  73. .init_IRQ = ppa8548_pic_init,
  74. .show_cpuinfo = ppa8548_show_cpuinfo,
  75. .get_irq = mpic_get_irq,
  76. .calibrate_decr = generic_calibrate_decr,
  77. .progress = udbg_progress,
  78. };