1# Copyright (c) 2021 TOKITA Hiroshi <tokita.hiroshi@gmail.com> 2# SPDX-License-Identifier: Apache-2.0 3 4description: | 5 Nuclei System Timer 6 7 The Nuclei system timer provides RISC-V privileged mtime and mtimecmp 8 registers. 9 10compatible: "nuclei,systimer" 11 12include: base.yaml 13 14properties: 15 reg: 16 required: true 17 18 interrupts: 19 required: true 20 21 clk-divider: 22 type: int 23 description: | 24 clk-divider specifies the division ratio to the CPU frequency that 25 clock used by the system timer. 26 This property supports the case that the system timer and CPU use 27 different clock sources. 28 This configuration is used sometimes for such as low power consumption. 29 30 For example, the CPU clock frequency is 108MHz, and the system timer 31 uses 27MHz, which is the CPU clock divided by 4. 32 In this case, the CPU clock frequency is defined in the CPU node 33 as follows 34 35 clock-frequency = <108000000>; 36 37 This property takes exponent of the power of 2. 38 The relationship with the frequency division ratio is as 39 following equation. 40 41 division_ratio = 2^n 42 n = log_2(division_ratio) 43 44 Setting clk-divider to 2 specifies the system timer uses the clock 45 that CPU clock frequency divided by (2^2=)4, or 27MHz. 46 47 Devision ratio constants can be found in the 48 dt-bindings/timer/nuclei-systimer.h header file. 49