timer.h 608 B

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