Skip to content
Permalink
Browse files

soc: arm: nxp: ke1xf: add FlexTimer (FTM) module support

Add support for the FlexTimer (FTM) modules present in the NXP Kinetis
KE1xF Soc series.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
  • Loading branch information...
henrikbrixandersen authored and MaureenHelm committed May 19, 2019
1 parent 84c7499 commit 67126be662de135419eb075aed07d444eac70cf0
@@ -33,6 +33,10 @@
adc-0 = &adc0;
adc-1 = &adc1;
adc-2 = &adc2;
ftm-0 = &ftm0;
ftm-1 = &ftm1;
ftm-2 = &ftm2;
ftm-3 = &ftm3;
};

cpus {
@@ -332,6 +336,46 @@
clk-divider = <1>;
status = "disabled";
};

ftm0: pwm@40038000 {
compatible = "nxp,kinetis-ftm";
reg = <0x40038000 0x1000>;
interrupts = <42 0>;
clocks = <&pcc 0xe0>;
label = "FTM_0";
#pwm-cells = <2>;
status = "disabled";
};

ftm1: pwm@40039000 {
compatible = "nxp,kinetis-ftm";
reg = <0x40039000 0x1000>;
interrupts = <43 0>;
clocks = <&pcc 0xe4>;
label = "FTM_1";
#pwm-cells = <2>;
status = "disabled";
};

ftm2: pwm@4003a000 {
compatible = "nxp,kinetis-ftm";
reg = <0x4003a000 0x1000>;
interrupts = <44 0>;
clocks = <&pcc 0xe8>;
label = "FTM_2";
#pwm-cells = <2>;
status = "disabled";
};

ftm3: pwm@40026000 {
compatible = "nxp,kinetis-ftm";
reg = <0x40026000 0x1000>;
interrupts = <71 0>;
clocks = <&pcc 0x98>;
label = "FTM_3";
#pwm-cells = <2>;
status = "disabled";
};
};
};

@@ -49,6 +49,13 @@ config COUNTER_MCUX_RTC

endif # COUNTER

if PWM

config PWM_MCUX_FTM
default y

endif # PWM

if PINMUX

config PINMUX_MCUX
@@ -24,5 +24,6 @@ config SOC_SERIES_KINETIS_KE1XF
select HAS_MCUX_ADC12
select HAS_MCUX_SCG
select HAS_MCUX_WDOG32
select HAS_MCUX_FTM
help
Enable support for Kinetis KE1xF MCU series
@@ -96,3 +96,33 @@

#define DT_CAN_0_NAME DT_NXP_KINETIS_FLEXCAN_40024000_LABEL
#define DT_CAN_1_NAME DT_NXP_KINETIS_FLEXCAN_40025000_LABEL

#define DT_FTM_0_NAME DT_NXP_KINETIS_FTM_40038000_LABEL
#define DT_FTM_0_BASE_ADDRESS DT_NXP_KINETIS_FTM_40038000_BASE_ADDRESS
#define DT_FTM_0_IRQ DT_NXP_KINETIS_FTM_40038000_IRQ_0
#define DT_FTM_0_IRQ_PRI DT_NXP_KINETIS_FTM_40038000_IRQ_0_PRIORITY
#define DT_FTM_0_CLOCK_NAME DT_NXP_KINETIS_FTM_40038000_CLOCK_CONTROLLER
#define DT_FTM_0_CLOCK_SUBSYS DT_NXP_KINETIS_FTM_40038000_CLOCK_NAME

#define DT_FTM_1_NAME DT_NXP_KINETIS_FTM_40039000_LABEL
#define DT_FTM_1_BASE_ADDRESS DT_NXP_KINETIS_FTM_40039000_BASE_ADDRESS
#define DT_FTM_1_IRQ DT_NXP_KINETIS_FTM_40039000_IRQ_0
#define DT_FTM_1_IRQ_PRI DT_NXP_KINETIS_FTM_40039000_IRQ_0_PRIORITY
#define DT_FTM_1_CLOCK_NAME DT_NXP_KINETIS_FTM_40039000_CLOCK_CONTROLLER
#define DT_FTM_1_CLOCK_SUBSYS DT_NXP_KINETIS_FTM_40039000_CLOCK_NAME

#define DT_FTM_2_NAME DT_NXP_KINETIS_FTM_4003A000_LABEL
#define DT_FTM_2_BASE_ADDRESS DT_NXP_KINETIS_FTM_4003A000_BASE_ADDRESS
#define DT_FTM_2_IRQ DT_NXP_KINETIS_FTM_4003A000_IRQ_0
#define DT_FTM_2_IRQ_PRI DT_NXP_KINETIS_FTM_4003A000_IRQ_0_PRIORITY
#define DT_FTM_2_CLOCK_NAME DT_NXP_KINETIS_FTM_4003A000_CLOCK_CONTROLLER
#define DT_FTM_2_CLOCK_SUBSYS DT_NXP_KINETIS_FTM_4003A000_CLOCK_NAME

#define DT_FTM_3_NAME DT_NXP_KINETIS_FTM_40026000_LABEL
#define DT_FTM_3_BASE_ADDRESS DT_NXP_KINETIS_FTM_40026000_BASE_ADDRESS
#define DT_FTM_3_IRQ DT_NXP_KINETIS_FTM_40026000_IRQ_0
#define DT_FTM_3_IRQ_PRI DT_NXP_KINETIS_FTM_40026000_IRQ_0_PRIORITY
#define DT_FTM_3_CLOCK_NAME DT_NXP_KINETIS_FTM_40026000_CLOCK_CONTROLLER
#define DT_FTM_3_CLOCK_SUBSYS DT_NXP_KINETIS_FTM_40026000_CLOCK_NAME


@@ -223,6 +223,18 @@ static ALWAYS_INLINE void clk_init(void)
#ifdef CONFIG_ADC_2
CLOCK_SetIpSrc(kCLOCK_Adc2, kCLOCK_IpSrcFircAsync);
#endif
#ifdef CONFIG_PWM_0
CLOCK_SetIpSrc(kCLOCK_Ftm0, kCLOCK_IpSrcFircAsync);
#endif
#ifdef CONFIG_PWM_1
CLOCK_SetIpSrc(kCLOCK_Ftm1, kCLOCK_IpSrcFircAsync);
#endif
#ifdef CONFIG_PWM_2
CLOCK_SetIpSrc(kCLOCK_Ftm2, kCLOCK_IpSrcFircAsync);
#endif
#ifdef CONFIG_PWM_3
CLOCK_SetIpSrc(kCLOCK_Ftm3, kCLOCK_IpSrcFircAsync);
#endif
}

static int ke1xf_init(struct device *arg)

0 comments on commit 67126be

Please sign in to comment.
You can’t perform that action at this time.