13#ifndef ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_RENESAS_RX_CGC_H_
14#define ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_RENESAS_RX_CGC_H_
31#define RX_CGC_PROP_HAS_STATUS_OKAY_OR(node_id, prop, default_value) \
32 COND_CODE_1(DT_NODE_HAS_STATUS(node_id, okay), (DT_PROP(node_id, prop)), \
41#ifdef CONFIG_HAS_RENESAS_RX_FSP
42#define RX_CGC_CLK_SRC(node_id) \
43 COND_CODE_1(DT_NODE_HAS_STATUS(node_id, okay), \
44 (UTIL_CAT(BSP_CLOCKS_SOURCE_, DT_NODE_FULL_NAME_UPPER_TOKEN(node_id))), \
45 (BSP_CLOCKS_CLOCK_DISABLED))
47#define RX_CGC_CLK_DIV(clk, prop, default_value) \
48 UTIL_CAT(RX_CGC_DIV_, DT_NODE_FULL_NAME_UPPER_TOKEN(clk)) \
49 (RX_CGC_PROP_HAS_STATUS_OKAY_OR(clk, prop, default_value))
52#define RX_CGC_CLK_SRC(node_id) \
53 COND_CODE_1(DT_NODE_HAS_STATUS(node_id, okay), \
54 (UTIL_CAT(RX_CLOCKS_SOURCE_, DT_NODE_FULL_NAME_UPPER_TOKEN(node_id))), \
55 (RX_CLOCKS_CLOCK_DISABLED))
58#ifdef CONFIG_HAS_RENESAS_RX_FSP
59#define RX_CGC_DIV_CPUCLK(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
60#define RX_CGC_DIV_MRICLK(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
61#define RX_CGC_DIV_ICLK(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
62#define RX_CGC_DIV_PCLKA(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
63#define RX_CGC_DIV_PCLKB(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
64#define RX_CGC_DIV_PCLKC(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
65#define RX_CGC_DIV_PCLKD(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
66#define RX_CGC_DIV_PCLKE(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
67#define RX_CGC_DIV_BCLK(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
68#define RX_CGC_DIV_BCLKA(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
69#define RX_CGC_DIV_MRPCLK(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
70#define RX_CGC_DIV_CLKOUT(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n)
71#define RX_CGC_DIV_SCICLK(n) UTIL_CAT(BSP_CLOCKS_SCI_CLOCK_DIV_, n)
72#define RX_CGC_DIV_SPICLK(n) UTIL_CAT(BSP_CLOCKS_SPI_CLOCK_DIV_, n)
73#define RX_CGC_DIV_CANFDCLK(n) UTIL_CAT(BSP_CLOCKS_CANFD_CLOCK_DIV_, n)
74#define RX_CGC_DIV_GPTCLK(n) UTIL_CAT(BSP_CLOCKS_GPT_CLOCK_DIV_, n)
75#define RX_CGC_DIV_I3CCLK(n) UTIL_CAT(BSP_CLOCKS_I3C_CLOCK_DIV_, n)
76#define RX_CGC_DIV_UCLK(n) UTIL_CAT(BSP_CLOCKS_USB_CLOCK_DIV_, n)
77#define RX_CGC_DIV_USB60CLK(n) UTIL_CAT(BSP_CLOCKS_USB60_CLOCK_DIV_, n)
78#define RX_CGC_DIV_OCTASPICLK(n) UTIL_CAT(BSP_CLOCKS_OCTA_CLOCK_DIV_, n)
79#define RX_CGC_DIV_PLL(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n)
80#define RX_CGC_DIV_PLLP(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n)
81#define RX_CGC_DIV_PLLQ(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n)
82#define RX_CGC_DIV_PLLR(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n)
83#define RX_CGC_DIV_PLL2(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n)
84#define RX_CGC_DIV_PLL2P(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n)
85#define RX_CGC_DIV_PLL2Q(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n)
86#define RX_CGC_DIV_PLL2R(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n)
87#define RX_CGC_DIV_ADCCLK(n) UTIL_CAT(BSP_CLOCKS_ADC_CLOCK_DIV_, n)
88#define RX_CGC_DIV_ESWCLK(n) UTIL_CAT(BSP_CLOCKS_ESW_CLOCK_DIV_, n)
89#define RX_CGC_DIV_ESWPHYCLK(n) UTIL_CAT(BSP_CLOCKS_ESWPHY_CLOCK_DIV_, n)
90#define RX_CGC_DIV_ETHPHYCLK(n) UTIL_CAT(BSP_CLOCKS_ETHPHY_CLOCK_DIV_, n)
91#define RX_CGC_DIV_ESCCLK(n) UTIL_CAT(BSP_CLOCKS_ESC_CLOCK_DIV_, n)
92#define RX_CGC_DIV_DSMIFCLK(n) UTIL_CAT(BSP_CLOCKS_DSMIF_CLOCK_DIV_, n)
94#define BSP_CLOCKS_SOURCE_PLL BSP_CLOCKS_SOURCE_CLOCK_PLL
95#define BSP_CLOCKS_SOURCE_PLLP BSP_CLOCKS_SOURCE_CLOCK_PLL
96#define BSP_CLOCKS_SOURCE_PLLQ BSP_CLOCKS_SOURCE_CLOCK_PLL1Q
97#define BSP_CLOCKS_SOURCE_PLLR BSP_CLOCKS_SOURCE_CLOCK_PLL1R
99#define BSP_CLOCKS_SOURCE_PLL2 BSP_CLOCKS_SOURCE_CLOCK_PLL2
100#define BSP_CLOCKS_SOURCE_PLL2P BSP_CLOCKS_SOURCE_CLOCK_PLL2
101#define BSP_CLOCKS_SOURCE_PLL2Q BSP_CLOCKS_SOURCE_CLOCK_PLL2Q
102#define BSP_CLOCKS_SOURCE_PLL2R BSP_CLOCKS_SOURCE_CLOCK_PLL2R
112#define RX_IF_CLK_SRC(node_id) \
113 COND_CODE_1(DT_NODE_HAS_STATUS(node_id, okay),\
114 (UTIL_CAT(RX_IF_CLOCKS_SOURCE_, DT_NODE_FULL_NAME_UPPER_TOKEN(node_id))),\
115 (RX_CLOCKS_CLOCK_DISABLED))
123#define RX_LPT_CLK_SRC(node_id) \
124 COND_CODE_1(DT_NODE_HAS_STATUS(node_id, okay),\
125 (UTIL_CAT(RX_LPT_CLOCKS_SOURCE_, DT_NODE_FULL_NAME_UPPER_TOKEN(node_id))),\
126 (RX_LPT_CLOCKS_NON_USE))
134#define RX_CGC_PLL_CLK_SRC(node_id) \
135 COND_CODE_1(DT_NODE_HAS_STATUS(node_id, okay), \
136 (UTIL_CAT(RX_PLL_CLOCKS_SOURCE_, DT_NODE_FULL_NAME_UPPER_TOKEN(node_id))), \
137 (RX_CLOCKS_CLOCK_DISABLED))
Main header file for clock control driver API.
Renesas RX Clock Generator Circuit (CGC) definitions for Zephyr.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Peripheral clock configuration (PCLK).
Definition renesas_rx_cgc.h:142
const struct device * clock_src_dev
Clock source.
Definition renesas_rx_cgc.h:143
uint32_t clk_div
Divider configuration.
Definition renesas_rx_cgc.h:144
PLL configuration structure.
Definition renesas_rx_cgc.h:158
const struct device * clock_dev
Device providing PLL source.
Definition renesas_rx_cgc.h:159
PLL control parameters.
Definition renesas_rx_cgc.h:165
uint32_t pll_div
PLL divider.
Definition renesas_rx_cgc.h:166
uint32_t pll_mul
PLL multiplier.
Definition renesas_rx_cgc.h:167
Root clock configuration.
Definition renesas_rx_cgc.h:173
uint32_t rate
Target clock rate in Hz.
Definition renesas_rx_cgc.h:174
Subsystem clock control configuration.
Definition renesas_rx_cgc.h:150
uint32_t stop_bit
Clock stop bit.
Definition renesas_rx_cgc.h:152
uint32_t mstp
MSTP register index.
Definition renesas_rx_cgc.h:151
Runtime device structure (in ROM) per driver instance.
Definition device.h:543