12#ifndef ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_RENESAS_RA_CGC_H_
13#define ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_RENESAS_RA_CGC_H_
30#define RA_CGC_PROP_HAS_STATUS_OKAY_OR(node_id, prop, default_value) \
31 COND_CODE_1(DT_NODE_HAS_STATUS(node_id, okay), \
32 (DT_PROP(node_id, prop)), (default_value))
40#define RA_CGC_CLK_SRC(node_id) \
41 COND_CODE_1(DT_NODE_HAS_STATUS(node_id, okay), \
42 (UTIL_CAT(BSP_CLOCKS_SOURCE_, DT_NODE_FULL_NAME_UPPER_TOKEN(node_id))), \
43 (BSP_CLOCKS_CLOCK_DISABLED))
50#define RA_CGC_CLK_DIV(clk, prop, default_value) \
51 UTIL_CAT(RA_CGC_DIV_, DT_NODE_FULL_NAME_UPPER_TOKEN(clk)) \
52 (RA_CGC_PROP_HAS_STATUS_OKAY_OR(clk, prop, default_value))
60#define RA_CGC_DIV_BCLK(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
61#define RA_CGC_DIV_CANFDCLK(n) UTIL_CAT(BSP_CLOCKS_CANFD_CLOCK_DIV_, n)
62#define RA_CGC_DIV_CECCLK(n) UTIL_CAT(BSP_CLOCKS_CEC_CLOCK_DIV_, n)
63#define RA_CGC_DIV_CLKOUT(n) UTIL_CAT(BSP_CLOCKS_CLKOUT_DIV_, n)
64#define RA_CGC_DIV_CPUCLK0(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
65#define RA_CGC_DIV_CPUCLK1(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
66#define RA_CGC_DIV_MRPCLK(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
67#define RA_CGC_DIV_CPUCLK(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
68#define RA_CGC_DIV_FCLK(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
69#define RA_CGC_DIV_I3CCLK(n) UTIL_CAT(BSP_CLOCKS_I3C_CLOCK_DIV_, n)
70#define RA_CGC_DIV_ICLK(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
71#define RA_CGC_DIV_LCDCLK(n) UTIL_CAT(BSP_CLOCKS_LCD_CLOCK_DIV_, n)
72#define RA_CGC_DIV_OCTASPICLK(n) UTIL_CAT(BSP_CLOCKS_OCTA_CLOCK_DIV_, n)
73#define RA_CGC_DIV_PCLKA(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
74#define RA_CGC_DIV_PCLKB(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
75#define RA_CGC_DIV_PCLKC(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
76#define RA_CGC_DIV_PCLKD(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
77#define RA_CGC_DIV_PCLKE(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
78#define RA_CGC_DIV_PLL(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n)
79#define RA_CGC_DIV_PLLP(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n)
80#define RA_CGC_DIV_PLLQ(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n)
81#define RA_CGC_DIV_PLLR(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n)
82#define RA_CGC_DIV_PLL2(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n)
83#define RA_CGC_DIV_PLL2P(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n)
84#define RA_CGC_DIV_PLL2Q(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n)
85#define RA_CGC_DIV_PLL2R(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n)
86#define RA_CGC_DIV_SCICLK(n) UTIL_CAT(BSP_CLOCKS_SCI_CLOCK_DIV_, n)
87#define RA_CGC_DIV_SPICLK(n) UTIL_CAT(BSP_CLOCKS_SPI_CLOCK_DIV_, n)
88#define RA_CGC_DIV_U60CLK(n) UTIL_CAT(BSP_CLOCKS_USB60_CLOCK_DIV_, n)
89#define RA_CGC_DIV_UCLK(n) UTIL_CAT(BSP_CLOCKS_USB_CLOCK_DIV_, n)
90#define RA_CGC_DIV_SCISPICLK(n) UTIL_CAT(BSP_CLOCKS_SCISPI_CLOCK_DIV_, n)
91#define RA_CGC_DIV_GPTCLK(n) UTIL_CAT(BSP_CLOCKS_GPT_CLOCK_DIV_, n)
92#define RA_CGC_DIV_IICCLK(n) UTIL_CAT(BSP_CLOCKS_IIC_CLOCK_DIV_, n)
93#define RA_CGC_DIV_ADCCLK(n) UTIL_CAT(BSP_CLOCKS_ADC_CLOCK_DIV_, n)
94#define RA_CGC_DIV_MRICLK(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
95#define RA_CGC_DIV_NPUCLK(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
96#define RA_CGC_DIV_BCLKA(n) UTIL_CAT(BSP_CLOCKS_BCLKA_CLOCK_DIV_, n)
97#define RA_CGC_DIV_ESWCLK(n) UTIL_CAT(BSP_CLOCKS_ESW_CLOCK_DIV_, n)
98#define RA_CGC_DIV_ESWPHYCLK(n) \
99 UTIL_CAT(BSP_CLOCKS_ESWPHY_CLOCK_DIV_, n)
100#define RA_CGC_DIV_ETHPHYCLK(n) UTIL_CAT(BSP_CLOCKS_ETHPHY_CLOCK_DIV_, n)
101#define RA_CGC_DIV_ESCCLK(n) UTIL_CAT(BSP_CLOCKS_ESC_CLOCK_DIV_, n)
102#define RA_CGC_DIV_DSMIFCLK(n) UTIL_CAT(BSP_CLOCKS_DSMIF_CLOCK_DIV_, n)
111#define BSP_CLOCKS_SOURCE_PLL BSP_CLOCKS_SOURCE_CLOCK_PLL
112#define BSP_CLOCKS_SOURCE_PLLP BSP_CLOCKS_SOURCE_CLOCK_PLL
113#define BSP_CLOCKS_SOURCE_PLLQ BSP_CLOCKS_SOURCE_CLOCK_PLL1Q
114#define BSP_CLOCKS_SOURCE_PLLR BSP_CLOCKS_SOURCE_CLOCK_PLL1R
115#define BSP_CLOCKS_SOURCE_PLL2 BSP_CLOCKS_SOURCE_CLOCK_PLL2
116#define BSP_CLOCKS_SOURCE_PLL2P BSP_CLOCKS_SOURCE_CLOCK_PLL2
117#define BSP_CLOCKS_SOURCE_PLL2Q BSP_CLOCKS_SOURCE_CLOCK_PLL2Q
118#define BSP_CLOCKS_SOURCE_PLL2R BSP_CLOCKS_SOURCE_CLOCK_PLL2R
127#define BSP_CLOCKS_CLKOUT_DIV_1 (0)
128#define BSP_CLOCKS_CLKOUT_DIV_2 (1)
129#define BSP_CLOCKS_CLKOUT_DIV_4 (2)
130#define BSP_CLOCKS_CLKOUT_DIV_8 (3)
131#define BSP_CLOCKS_CLKOUT_DIV_16 (4)
132#define BSP_CLOCKS_CLKOUT_DIV_32 (5)
133#define BSP_CLOCKS_CLKOUT_DIV_64 (6)
134#define BSP_CLOCKS_CLKOUT_DIV_128 (7)
Main header file for clock control driver API.
Renesas RA Clock Generator Circuit (CGC) definitions for Zephyr.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Peripheral clock configuration.
Definition renesas_ra_cgc.h:140
uint32_t clk_div
Clock divider value.
Definition renesas_ra_cgc.h:142
uint32_t clk_src
Clock source selection.
Definition renesas_ra_cgc.h:141
Subsystem clock control configuration.
Definition renesas_ra_cgc.h:148
uint32_t mstp
MSTP register index.
Definition renesas_ra_cgc.h:149
uint32_t stop_bit
Clock stop bit.
Definition renesas_ra_cgc.h:150