IMX8MPQ PWM Problem

I am using the Toradex Verdin IMX8MPQ module and I need to generate a clock frequency of around 3MHz from the PWM output pin with 50% duty cycle

I can currently get it to aroud 500kHz but after that the PWM peripheral does not behave at all even though the correct numbers are being written to the period and duty cycle registers.

Why am I observing this behaviour? For example when I try to put duty cycle to 10 and period to 20 in the registers I suddenly get a period of around 20ms and not 1-2us.

My PWM has a source clock of 24MHz, how can I change the PWM clock frequency, the datasheet shows it supports a number of different input sources, but where can I edit this source in the device tree?

According to the reference manual for the IMX8MP page 242 i can select these with a max of 66MHz

000 - 24M_REF_CLK
010 - SYSTEM_PLL1_DIV5
110 - SYSTEM_PLL1_DIV10
011 - SYSTEM_PLL1_DIV20
001 - SYSTEM_PLL2_DIV10
100 - SYSTEM_PLL3_CLK
111 - VIDEO_PLL_CLK
101 - EXT_CLK_1

Could you please dump all PWM registers when you get 20ms period instead of 1-2us?

I’m an idiot, the sampling frequency of my logic analyser was set too low and I was getting an aliasing effect, I increased to 50MHz and the PWM is behaving now