soc: mcxw71: Add TPM support
Add DT node and clocking of TPM peripherals, which are used for PWM. Also change the soc clock enable code to not use preprocessor conditionals. Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
This commit is contained in:
parent
bfa4a7b02b
commit
b74a7c4176
2 changed files with 33 additions and 6 deletions
|
@ -181,6 +181,24 @@
|
||||||
reg = <0x2b000 0x400>;
|
reg = <0x2b000 0x400>;
|
||||||
interrupts = <74 0>;
|
interrupts = <74 0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
tpm0: pwm@31000 {
|
||||||
|
compatible = "nxp,kinetis-tpm";
|
||||||
|
reg = <0x31000 0x100>;
|
||||||
|
interrupts = <37 0>;
|
||||||
|
clocks = <&scg SCG_K4_FIRC_CLK 0xc4>;
|
||||||
|
status = "disabled";
|
||||||
|
#pwm-cells = <3>;
|
||||||
|
};
|
||||||
|
|
||||||
|
tpm1: pwm@32000 {
|
||||||
|
compatible = "nxp,kinetis-tpm";
|
||||||
|
reg = <0x32000 0x100>;
|
||||||
|
interrupts = <38 0>;
|
||||||
|
clocks = <&scg SCG_K4_FIRC_CLK 0xc8>;
|
||||||
|
status = "disabled";
|
||||||
|
#pwm-cells = <3>;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
&fast_peripheral0 {
|
&fast_peripheral0 {
|
||||||
|
|
|
@ -121,12 +121,21 @@ static ALWAYS_INLINE void clock_init(void)
|
||||||
CLOCK_SetIpSrcDiv(kCLOCK_Lpi2c1, kSCG_SysClkDivBy16);
|
CLOCK_SetIpSrcDiv(kCLOCK_Lpi2c1, kSCG_SysClkDivBy16);
|
||||||
|
|
||||||
/* Ungate clocks if the peripheral is enabled in devicetree */
|
/* Ungate clocks if the peripheral is enabled in devicetree */
|
||||||
#if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(lpuart0), nxp_lpc_lpuart, okay))
|
if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(lpuart0), nxp_lpc_lpuart, okay)) {
|
||||||
CLOCK_EnableClock(kCLOCK_Lpuart0);
|
CLOCK_EnableClock(kCLOCK_Lpuart0);
|
||||||
#endif
|
}
|
||||||
#if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(lpuart1), nxp_lpc_lpuart, okay))
|
|
||||||
CLOCK_EnableClock(kCLOCK_Lpuart1);
|
if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(lpuart1), nxp_lpc_lpuart, okay)) {
|
||||||
#endif
|
CLOCK_EnableClock(kCLOCK_Lpuart1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(tpm0), nxp_kinetis_tpm, okay)) {
|
||||||
|
CLOCK_EnableClock(kCLOCK_Tpm0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(tpm1), nxp_kinetis_tpm, okay)) {
|
||||||
|
CLOCK_EnableClock(kCLOCK_Tpm1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vbat_init(void)
|
static void vbat_init(void)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue