timer.h 609 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * (C) Copyright 2012,2015 Stephen Warren
  4. */
  5. #ifndef _BCM2835_TIMER_H
  6. #define _BCM2835_TIMER_H
  7. #ifndef CONFIG_BCM2835
  8. #define BCM2835_TIMER_PHYSADDR 0x3f003000
  9. #else
  10. #define BCM2835_TIMER_PHYSADDR 0x20003000
  11. #endif
  12. #define BCM2835_TIMER_CS_M3 (1 << 3)
  13. #define BCM2835_TIMER_CS_M2 (1 << 2)
  14. #define BCM2835_TIMER_CS_M1 (1 << 1)
  15. #define BCM2835_TIMER_CS_M0 (1 << 0)
  16. #ifndef __ASSEMBLY__
  17. #include <linux/types.h>
  18. struct bcm2835_timer_regs {
  19. u32 cs;
  20. u32 clo;
  21. u32 chi;
  22. u32 c0;
  23. u32 c1;
  24. u32 c2;
  25. u32 c3;
  26. };
  27. extern ulong get_timer_us(ulong base);
  28. #endif
  29. #endif