common.c 922 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Routines common to most mpc86xx-based boards.
  3. *
  4. * This is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #include <linux/of_platform.h>
  9. #include <asm/synch.h>
  10. #include "mpc86xx.h"
  11. static const struct of_device_id mpc86xx_common_ids[] __initconst = {
  12. { .type = "soc", },
  13. { .compatible = "soc", },
  14. { .compatible = "simple-bus", },
  15. { .name = "localbus", },
  16. { .compatible = "gianfar", },
  17. { .compatible = "fsl,mpc8641-pcie", },
  18. {},
  19. };
  20. int __init mpc86xx_common_publish_devices(void)
  21. {
  22. return of_platform_bus_probe(NULL, mpc86xx_common_ids, NULL);
  23. }
  24. long __init mpc86xx_time_init(void)
  25. {
  26. unsigned int temp;
  27. /* Set the time base to zero */
  28. mtspr(SPRN_TBWL, 0);
  29. mtspr(SPRN_TBWU, 0);
  30. temp = mfspr(SPRN_HID0);
  31. temp |= HID0_TBEN;
  32. mtspr(SPRN_HID0, temp);
  33. isync();
  34. return 0;
  35. }