Skip to content

Commit 41ab686

Browse files
yhuynhxwaescolar
authored andcommitted
soc: renesas: rx: Init RX clocks in soc_early_init_hook
The clock initialization for RX devices is not appropriate when it is placed under the root clock node. Without an external fixed clock on the board, the clock is never initialized. Therefore, the clock setup must be handled inside soc_early_init_hook. Signed-off-by: Y Huynh <y.huynh.xw@renesas.com>
1 parent eff76ca commit 41ab686

5 files changed

Lines changed: 5 additions & 11 deletions

File tree

drivers/clock_control/clock_control_renesas_rx_root_cgc.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,6 @@ static int clock_control_renesas_rx_root_get_rate(const struct device *dev,
3737
return 0;
3838
}
3939

40-
static int clock_control_rx_init(const struct device *dev)
41-
{
42-
ARG_UNUSED(dev);
43-
#if CONFIG_HAS_RENESAS_RX_RDP
44-
/* Call to HAL layer to initialize system clock and peripheral clock */
45-
mcu_clock_setup();
46-
#endif
47-
return 0;
48-
}
49-
5040
static DEVICE_API(clock_control, clock_control_renesas_rx_root_api) = {
5141
.on = clock_control_renesas_rx_root_on,
5242
.off = clock_control_renesas_rx_root_off,
@@ -57,7 +47,7 @@ static DEVICE_API(clock_control, clock_control_renesas_rx_root_api) = {
5747
static const struct clock_control_rx_root_cfg clock_control_rx_root_cfg##idx = { \
5848
.rate = DT_INST_PROP(idx, clock_frequency), \
5949
}; \
60-
DEVICE_DT_INST_DEFINE(idx, &clock_control_rx_init, NULL, NULL, \
50+
DEVICE_DT_INST_DEFINE(idx, NULL, NULL, NULL, \
6151
&clock_control_rx_root_cfg##idx, PRE_KERNEL_1, \
6252
CONFIG_CLOCK_CONTROL_INIT_PRIORITY, \
6353
&clock_control_renesas_rx_root_api);

soc/renesas/rx/rx130/soc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ void soc_early_init_hook(void)
3030
bsp_ram_initialize();
3131
bsp_interrupt_open();
3232
bsp_register_protect_open();
33+
mcu_clock_setup();
3334
#if CONFIG_RENESAS_NONE_USED_PORT_INIT == 1
3435
/*
3536
* This is the function that initializes the unused port.

soc/renesas/rx/rx140/soc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ void soc_early_init_hook(void)
2323
bsp_ram_initialize();
2424
bsp_interrupt_open();
2525
bsp_register_protect_open();
26+
mcu_clock_setup();
2627
#if CONFIG_RENESAS_NONE_USED_PORT_INIT == 1
2728
/*
2829
* This is the function that initializes the unused port.

soc/renesas/rx/rx261/soc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ void soc_early_init_hook(void)
3131
bsp_ram_initialize();
3232
bsp_interrupt_open();
3333
bsp_register_protect_open();
34+
mcu_clock_setup();
3435
#ifdef CONFIG_RENESAS_NONE_USED_PORT_INIT
3536
/*
3637
* This is the function that initializes the unused port.

soc/renesas/rx/rx26t/soc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ void soc_early_init_hook(void)
3131
bsp_ram_initialize();
3232
bsp_interrupt_open();
3333
bsp_register_protect_open();
34+
mcu_clock_setup();
3435
#if CONFIG_RENESAS_NONE_USED_PORT_INIT == 1
3536
/*
3637
* This is the function that initializes the unused port.

0 commit comments

Comments
 (0)