clint.h 797 B

1234567891011121314151617181920212223242526
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2020 Google, Inc
  4. */
  5. #ifndef _ASM_RISCV_CLINT_H
  6. #define _ASM_RISCV_CLINT_H
  7. #include <linux/types.h>
  8. #include <asm/mmio.h>
  9. #ifdef CONFIG_RISCV_M_MODE
  10. /*
  11. * This lives in the CLINT driver, but is accessed directly by timex.h to avoid
  12. * any overhead when accessing the MMIO timer.
  13. *
  14. * The ISA defines mtime as a 64-bit memory-mapped register that increments at
  15. * a constant frequency, but it doesn't define some other constraints we depend
  16. * on (most notably ordering constraints, but also some simpler stuff like the
  17. * memory layout). Thus, this is called "clint_time_val" instead of something
  18. * like "riscv_mtime", to signify that these non-ISA assumptions must hold.
  19. */
  20. extern u64 __iomem *clint_time_val;
  21. #endif
  22. #endif