1 /*
2  * Renesas SCP/MCP Software
3  * Copyright (c) 2020-2021, Renesas Electronics Corporation. All rights
4  * reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  */
8 
9 #ifndef SYSTEM_CLOCK_H
10 #define SYSTEM_CLOCK_H
11 
12 #include <fwk_macros.h>
13 
14 /*!
15  * \brief Calculates the necessary divider for obtaining a target frequency
16  *      from a given clock.
17  *
18  * \param CLOCK_RATE The tick rate of the clock to be divided.
19  *
20  * \param TARGET_FREQ The target frequency to be obtained by the division.
21  *
22  * \return The divider needed to obtain TARGET_FREQ from CLOCK_RATE.
23  */
24 #define DIV_FROM_CLOCK(CLOCK_RATE, TARGET_FREQ) ((CLOCK_RATE) / (TARGET_FREQ))
25 
26 #define CLOCK_RATE_REFCLK (50UL * FWK_MHZ)
27 #define CLOCK_RATE_SYSPLLCLK (2000UL * FWK_MHZ)
28 
29 #endif /* SYSTEM_CLOCK_H */
30