common.c 781 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Routines common to most mpc86xx-based boards.
  4. */
  5. #include <linux/of_platform.h>
  6. #include <asm/synch.h>
  7. #include "mpc86xx.h"
  8. static const struct of_device_id mpc86xx_common_ids[] __initconst = {
  9. { .type = "soc", },
  10. { .compatible = "soc", },
  11. { .compatible = "simple-bus", },
  12. { .name = "localbus", },
  13. { .compatible = "gianfar", },
  14. { .compatible = "fsl,mpc8641-pcie", },
  15. {},
  16. };
  17. int __init mpc86xx_common_publish_devices(void)
  18. {
  19. return of_platform_bus_probe(NULL, mpc86xx_common_ids, NULL);
  20. }
  21. long __init mpc86xx_time_init(void)
  22. {
  23. unsigned int temp;
  24. /* Set the time base to zero */
  25. mtspr(SPRN_TBWL, 0);
  26. mtspr(SPRN_TBWU, 0);
  27. temp = mfspr(SPRN_HID0);
  28. temp |= HID0_TBEN;
  29. mtspr(SPRN_HID0, temp);
  30. isync();
  31. return 0;
  32. }