i.MX7 M4 application stops when Linux boots

Older eCSPI driver, perhaps in kernel 4.x, wasn’t switching eCSPI and all unused parent clocks while idle. Recent eCSPI driver does it. eCSPI and require parent clocks are enabled only during SPI transfer. Clocks are switched off immediately after transfer is complete.

Yes, I meant this variable. Try setting it to
fdt addr ${fdt_addr_r} && fdt rm spi0 && fdt rm spi1 && fdt rm spi2 && fdt rm spi3

spiN here are eCSPI aliases in DT.

I’m not sure regarding your CCM_xxx() calls, hope they are fine. Did you check clk_summary, did M4 parent clock change to 270m or not?

Edward

Small update and some good news @Edward!

As I said changing the clocks in the call to CCM_ControlGate() did not change anything.
But I realised that I probably had to do some more.
So I added

CCM_SetRootMux(CCM, ccmRootM4, ccmRootmuxM4SysPllPfd2);

And nowthe M4 continues to run even when Linux has booted and I log into it.

So, the change of clock source did the trick.
In board.c, BOARD_ClockInit(). I replaced two lines with three new ones:

// CCM_ControlGate( CCM, ccmPllGateSys, ccmClockNeededRun);
// CCM_ControlGate( CCM, ccmPllGateSysDiv2, ccmClockNeededRun);
CCM_SetRootMux(CCM, ccmRootM4, ccmRootmuxM4SysPllPfd2);
CCM_ControlGate( CCM, ccmPllGatePfd2, ccmClockNeededRun);
CCM_ControlGate( CCM, ccmPllGatePfd2Div2, ccmClockNeededRun);

For now, I think this issue is closed. Although I’m not sure that I understand everything that has been discussed in this rather ling thread…

Thanks for all the support, especially from @Edward !

Jeroen