Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport v3.7.99-ncs1-branch] pm: bring policy latency API updates #2226

Merged
merged 8 commits into from
Nov 5, 2024
2 changes: 1 addition & 1 deletion arch/arm/core/cortex_m/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ static inline bool z_arm_is_pc_valid(uintptr_t pc)
return true;
}

#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_itcm), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_CHOSEN(zephyr_itcm))
/* Is it in the ITCM */
if ((((uintptr_t)&__itcm_start) <= pc) && (pc < ((uintptr_t)&__itcm_end))) {
return true;
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/v2m_musca_b1/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static void arm_musca_b1_pinmux_defaults(void)
scc[IOMUX_ALTF1_OUTSEL] = 0xffff;
scc[IOMUX_ALTF1_OENSEL] = 0xffff;

#if DT_NODE_HAS_STATUS(DT_NODELABEL(uart0), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(uart0))
/* clear bit 0/1 for GPIO0/1 to steer from ALTF1 */
scc[IOMUX_MAIN_INSEL] &= ~(BIT(0) | BIT(1));
scc[IOMUX_MAIN_OUTSEL] &= ~(BIT(0) | BIT(1));
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/v2m_musca_s1/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static void arm_musca_s1_pinmux_defaults(void)
scc[IOMUX_ALTF1_OUTSEL] = 0xffff;
scc[IOMUX_ALTF1_OENSEL] = 0xffff;

#if DT_NODE_HAS_STATUS(DT_NODELABEL(uart0), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(uart0))
/* clear bit 0/1 for GPIO0/1 to steer from ALTF1 */
scc[IOMUX_MAIN_INSEL] &= ~(BIT(0) | BIT(1));
scc[IOMUX_MAIN_OUTSEL] &= ~(BIT(0) | BIT(1));
Expand Down
4 changes: 2 additions & 2 deletions boards/digilent/arty_a7/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ LOG_MODULE_REGISTER(board, CONFIG_LOG_DEFAULT_LEVEL);

#define DAPLINK_QSPI_MUX_NODE DT_NODELABEL(daplink_qspi_mux)

#if DT_NODE_HAS_STATUS(DAPLINK_QSPI_MUX_NODE, okay)
#if DT_NODE_HAS_STATUS_OKAY(DAPLINK_QSPI_MUX_NODE)
int board_daplink_qspi_mux_select(enum board_daplink_qspi_mux_mode mode)
{
struct gpio_dt_spec mux = GPIO_DT_SPEC_GET(DAPLINK_QSPI_MUX_NODE, mux_gpios);
Expand Down Expand Up @@ -77,4 +77,4 @@ static int board_init(void)
}

SYS_INIT(board_init, POST_KERNEL, CONFIG_BOARD_INIT_PRIORITY);
#endif /* DT_NODE_HAS_STATUS(DAPLINK_QSPI_MUX_NODE, okay) */
#endif /* DT_NODE_HAS_STATUS_OKAY(DAPLINK_QSPI_MUX_NODE) */
4 changes: 2 additions & 2 deletions boards/nordic/nrf9160dk/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
GET_PORT(reset_input, gpios, 0) == 0 && \
GET_PIN(reset_input, gpios, 0) == 18)
#define USE_RESET_GPIO \
(DT_NODE_HAS_STATUS(DT_NODELABEL(reset_input), okay) && \
(DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(reset_input)) && \
!RESET_INPUT_IS_PINRESET)

Check notice on line 37 in boards/nordic/nrf9160dk/board.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

boards/nordic/nrf9160dk/board.c:37 -#define USE_RESET_GPIO \ - (DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(reset_input)) && \ - !RESET_INPUT_IS_PINRESET) +#define USE_RESET_GPIO \ + (DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(reset_input)) && !RESET_INPUT_IS_PINRESET)
struct switch_cfg {
const struct device *gpio;
gpio_pin_t pin;
Expand All @@ -47,7 +47,7 @@
#endif
};

#define ROUTING_ENABLED(_name) DT_NODE_HAS_STATUS(DT_NODELABEL(_name), okay)
#define ROUTING_ENABLED(_name) DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(_name))
#define SWITCH_CFG(_name, _idx) \
{ \
.gpio = GET_DEV(_name, control_gpios, _idx), \
Expand Down
4 changes: 2 additions & 2 deletions boards/nordic/nrf9160dk/nrf52840_reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#define RESET_NODE DT_NODELABEL(nrf52840_reset)

#if DT_NODE_HAS_STATUS(RESET_NODE, okay)
#if DT_NODE_HAS_STATUS_OKAY(RESET_NODE)

#define RESET_GPIO_CTRL DT_GPIO_CTLR(RESET_NODE, gpios)
#define RESET_GPIO_PIN DT_GPIO_PIN(RESET_NODE, gpios)
Expand Down Expand Up @@ -65,4 +65,4 @@ int bt_hci_transport_setup(const struct device *h4)
return 0;
}

#endif /* DT_NODE_HAS_STATUS(RESET_NODE, okay) */
#endif /* DT_NODE_HAS_STATUS_OKAY(RESET_NODE) */
22 changes: 11 additions & 11 deletions boards/nxp/frdm_mcxa156/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,52 +66,52 @@ static int frdm_mcxa156_init(void)
CLOCK_SetClockDiv(kCLOCK_DivAHBCLK, 1U); /* !< Set AHBCLKDIV divider to value 1 */
CLOCK_SetClockDiv(kCLOCK_DivFRO_HF_DIV, 1U); /* !< Set FROHFDIV divider to value 1 */

#if DT_NODE_HAS_STATUS(DT_NODELABEL(porta), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(porta))
RESET_ReleasePeripheralReset(kPORT0_RST_SHIFT_RSTn);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(portb), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(portb))
RESET_ReleasePeripheralReset(kPORT1_RST_SHIFT_RSTn);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(portc), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(portc))
RESET_ReleasePeripheralReset(kPORT2_RST_SHIFT_RSTn);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(portd), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(portd))
RESET_ReleasePeripheralReset(kPORT3_RST_SHIFT_RSTn);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(porte), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(porte))
RESET_ReleasePeripheralReset(kPORT4_RST_SHIFT_RSTn);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpio0), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio0))
RESET_ReleasePeripheralReset(kGPIO0_RST_SHIFT_RSTn);
CLOCK_EnableClock(kCLOCK_GateGPIO0);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpio1), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio1))
RESET_ReleasePeripheralReset(kGPIO1_RST_SHIFT_RSTn);
CLOCK_EnableClock(kCLOCK_GateGPIO1);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpio2), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio2))
RESET_ReleasePeripheralReset(kGPIO2_RST_SHIFT_RSTn);
CLOCK_EnableClock(kCLOCK_GateGPIO2);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpio3), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio3))
RESET_ReleasePeripheralReset(kGPIO3_RST_SHIFT_RSTn);
CLOCK_EnableClock(kCLOCK_GateGPIO3);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpio4), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio4))
RESET_ReleasePeripheralReset(kGPIO4_RST_SHIFT_RSTn);
CLOCK_EnableClock(kCLOCK_GateGPIO4);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(lpuart0), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpuart0))
CLOCK_SetClockDiv(kCLOCK_DivLPUART0, 1u);
CLOCK_AttachClk(kFRO12M_to_LPUART0);
#endif
Expand Down
36 changes: 18 additions & 18 deletions boards/nxp/frdm_mcxn236/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,84 +88,84 @@ static int frdm_mcxn236_init(void)
/* Set AHBCLKDIV divider to value 1 */
CLOCK_SetClkDiv(kCLOCK_DivAhbClk, 1U);

#if DT_NODE_HAS_STATUS(DT_NODELABEL(flexcomm1), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(flexcomm1))
CLOCK_SetClkDiv(kCLOCK_DivFlexcom1Clk, 1u);
CLOCK_AttachClk(kFRO12M_to_FLEXCOMM1);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(flexcomm2), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(flexcomm2))
CLOCK_SetClkDiv(kCLOCK_DivFlexcom2Clk, 1u);
CLOCK_AttachClk(kFRO12M_to_FLEXCOMM2);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(flexcomm3), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(flexcomm3))
CLOCK_SetClkDiv(kCLOCK_DivFlexcom3Clk, 1u);
CLOCK_AttachClk(kFRO12M_to_FLEXCOMM3);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(flexcomm4), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(flexcomm4))
CLOCK_SetClkDiv(kCLOCK_DivFlexcom4Clk, 1u);
CLOCK_AttachClk(kFRO12M_to_FLEXCOMM4);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(flexcomm5), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(flexcomm5))
CLOCK_SetClkDiv(kCLOCK_DivFlexcom5Clk, 1u);
CLOCK_AttachClk(kFRO12M_to_FLEXCOMM5);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(os_timer), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(os_timer))
CLOCK_AttachClk(kCLK_1M_to_OSTIMER);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpio0), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio0))
CLOCK_EnableClock(kCLOCK_Gpio0);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpio1), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio1))
CLOCK_EnableClock(kCLOCK_Gpio1);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpio2), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio2))
CLOCK_EnableClock(kCLOCK_Gpio2);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpio3), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio3))
CLOCK_EnableClock(kCLOCK_Gpio3);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpio4), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio4))
CLOCK_EnableClock(kCLOCK_Gpio4);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpio5), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio5))
CLOCK_EnableClock(kCLOCK_Gpio5);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(wwdt0), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(wwdt0))
CLOCK_SetClkDiv(kCLOCK_DivWdt0Clk, 1u);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(ctimer0), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(ctimer0))
CLOCK_SetClkDiv(kCLOCK_DivCtimer0Clk, 1U);
CLOCK_AttachClk(kPLL0_to_CTIMER0);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(ctimer1), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(ctimer1))
CLOCK_SetClkDiv(kCLOCK_DivCtimer1Clk, 1U);
CLOCK_AttachClk(kPLL0_to_CTIMER1);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(ctimer2), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(ctimer2))
CLOCK_SetClkDiv(kCLOCK_DivCtimer2Clk, 1U);
CLOCK_AttachClk(kPLL0_to_CTIMER2);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(ctimer3), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(ctimer3))
CLOCK_SetClkDiv(kCLOCK_DivCtimer3Clk, 1U);
CLOCK_AttachClk(kPLL0_to_CTIMER3);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(ctimer4), okay)
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(ctimer4))
CLOCK_SetClkDiv(kCLOCK_DivCtimer4Clk, 1U);
CLOCK_AttachClk(kPLL0_to_CTIMER4);
#endif
Expand Down
Loading
Loading