Skip to content

Commit 305a7e6

Browse files
decsnydanieldegrasse
authored andcommitted
soc: nxp: imxrt: Remove ifdef around DCDC
The DCDC should be on all the platforms and the functions and structs should therefore be defined on all the platforms. So the ifdef is not needed, we can remove it to increase code compilation coverage unity across configurations slightly. Compiler should optimize out the block when IS_ENABLED is false statically. Signed-off-by: Declan Snyder <[email protected]>
1 parent 16e74b9 commit 305a7e6

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

soc/nxp/imxrt/imxrt10xx/soc.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ __weak void clock_init(void)
114114
/* Set PERIPH_CLK MUX to PERIPH_CLK2 */
115115
CLOCK_SetMux(kCLOCK_PeriphMux, 0x1);
116116

117-
#if CONFIG_ADJUST_DCDC
118-
/* Setting the VDD_SOC value */
119-
DCDC->REG3 = (DCDC->REG3 & (~DCDC_REG3_TRG_MASK)) | DCDC_REG3_TRG(CONFIG_DCDC_VALUE);
120-
/* Waiting for DCDC_STS_DC_OK bit is asserted */
121-
while (DCDC_REG0_STS_DC_OK_MASK !=
122-
(DCDC_REG0_STS_DC_OK_MASK & DCDC->REG0)) {
123-
;
117+
if (IS_ENABLED(CONFIG_ADJUST_DCDC)) {
118+
/* Setting the VDD_SOC value */
119+
DCDC->REG3 = (DCDC->REG3 & (~DCDC_REG3_TRG_MASK)) |
120+
DCDC_REG3_TRG(CONFIG_DCDC_VALUE);
121+
/* Waiting for DCDC_STS_DC_OK bit is asserted */
122+
while (DCDC_REG0_STS_DC_OK_MASK != (DCDC_REG0_STS_DC_OK_MASK & DCDC->REG0)) {
123+
;
124+
}
124125
}
125-
#endif
126126

127127
#ifdef CONFIG_INIT_ARM_PLL
128128
/* ARM PLL configuration for RUN mode */

soc/nxp/imxrt/imxrt11xx/soc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ __weak void clock_init(void)
133133
{
134134
clock_root_config_t rootCfg = {0};
135135

136-
#if CONFIG_ADJUST_DCDC
137-
DCDC_SetVDD1P0BuckModeTargetVoltage(DCDC, kDCDC_1P0BuckTarget1P15V);
138-
#endif
136+
if (IS_ENABLED(CONFIG_ADJUST_DCDC)) {
137+
DCDC_SetVDD1P0BuckModeTargetVoltage(DCDC, kDCDC_1P0BuckTarget1P15V);
138+
}
139139

140140
/* RT1160 does not have Forward Body Biasing on the CM7 core */
141141
#if defined(CONFIG_SOC_MIMXRT1176_CM4) || defined(CONFIG_SOC_MIMXRT1176_CM7)

0 commit comments

Comments
 (0)