Skip to content

Commit 523d684

Browse files
lucien-nxpkartben
authored andcommitted
dts: arm: nxp: add tpm instances for RT1180
add 6 tpm instances for RT1180 Enable clock for tpm Signed-off-by: Lucien Zhao <[email protected]>
1 parent 68864c6 commit 523d684

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed

dts/arm/nxp/nxp_rt118x.dtsi

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,60 @@
848848
status = "disabled";
849849
};
850850
};
851+
852+
tpm1: pwm@4310000 {
853+
compatible = "nxp,kinetis-tpm";
854+
reg = <0x4310000 0x88>;
855+
interrupts = <36 0>;
856+
clocks = <&ccm IMX_CCM_TPM1_CLK 0x3b 0>;
857+
status = "disabled";
858+
#pwm-cells = <3>;
859+
};
860+
861+
tpm2: pwm@4320000 {
862+
compatible = "nxp,kinetis-tpm";
863+
reg = <0x4320000 0x88>;
864+
interrupts = <37 0>;
865+
clocks = <&ccm IMX_CCM_TPM2_CLK 0x3c 0>;
866+
status = "disabled";
867+
#pwm-cells = <3>;
868+
};
869+
870+
tpm3: pwm@24E0000 {
871+
compatible = "nxp,kinetis-tpm";
872+
reg = <0x24E0000 0x88>;
873+
interrupts = <75 0>;
874+
clocks = <&ccm IMX_CCM_TPM3_CLK 0x3d 0>;
875+
status = "disabled";
876+
#pwm-cells = <3>;
877+
};
878+
879+
tpm4: pwm@24F0000 {
880+
compatible = "nxp,kinetis-tpm";
881+
reg = <0x24F0000 0x88>;
882+
interrupts = <76 0>;
883+
clocks = <&ccm IMX_CCM_TPM4_CLK 0x3e 0>;
884+
status = "disabled";
885+
#pwm-cells = <3>;
886+
};
887+
888+
tpm5: pwm@2500000 {
889+
compatible = "nxp,kinetis-tpm";
890+
reg = <0x2500000 0x88>;
891+
interrupts = <77 0>;
892+
clocks = <&ccm IMX_CCM_TPM5_CLK 0x3f 0>;
893+
status = "disabled";
894+
#pwm-cells = <3>;
895+
};
896+
897+
tpm6: pwm@42510000 {
898+
compatible = "nxp,kinetis-tpm";
899+
reg = <0x42510000 0x88>;
900+
interrupts = <78 0>;
901+
clocks = <&ccm IMX_CCM_TPM6_CLK 0x40 0>;
902+
status = "disabled";
903+
#pwm-cells = <3>;
904+
};
851905
};
852906

853907
&flexspi {

soc/nxp/imxrt/imxrt118x/soc.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,38 @@ static ALWAYS_INLINE void clock_init(void)
417417
CLOCK_SetRootClock(kCLOCK_Root_Flexspi1, &rootCfg);
418418
#endif
419419

420+
#ifdef CONFIG_HAS_MCUX_TPM
421+
422+
#if DT_NODE_HAS_STATUS(DT_NODELABEL(tpm2), okay)
423+
/* Configure TPM2 using SYS_PLL3_DIV2_CLK */
424+
rootCfg.mux = kCLOCK_TPM2_ClockRoot_MuxSysPll3Div2;
425+
rootCfg.div = 3;
426+
CLOCK_SetRootClock(kCLOCK_Root_Tpm2, &rootCfg);
427+
#endif
428+
429+
#if DT_NODE_HAS_STATUS(DT_NODELABEL(tpm4), okay)
430+
/* Configure TPM4 using SYS_PLL3_DIV2_CLK */
431+
rootCfg.mux = kCLOCK_TPM4_ClockRoot_MuxSysPll3Div2;
432+
rootCfg.div = 3;
433+
CLOCK_SetRootClock(kCLOCK_Root_Tpm4, &rootCfg);
434+
#endif
435+
436+
#if DT_NODE_HAS_STATUS(DT_NODELABEL(tpm5), okay)
437+
/* Configure TPM5 using SYS_PLL3_DIV2_CLK */
438+
rootCfg.mux = kCLOCK_TPM5_ClockRoot_MuxSysPll3Div2;
439+
rootCfg.div = 3;
440+
CLOCK_SetRootClock(kCLOCK_Root_Tpm5, &rootCfg);
441+
#endif
442+
443+
#if DT_NODE_HAS_STATUS(DT_NODELABEL(tpm6), okay)
444+
/* Configure TPM6 using SYS_PLL3_DIV2_CLK */
445+
rootCfg.mux = kCLOCK_TPM6_ClockRoot_MuxSysPll3Div2;
446+
rootCfg.div = 3;
447+
CLOCK_SetRootClock(kCLOCK_Root_Tpm6, &rootCfg);
448+
#endif
449+
450+
#endif /* CONFIG_HAS_MCUX_TPM */
451+
420452
/* Keep core clock ungated during WFI */
421453
CCM->LPCG[1].LPM0 = 0x33333333;
422454
CCM->LPCG[1].LPM1 = 0x33333333;

0 commit comments

Comments
 (0)