From: Hiago De Franco <hiago.fra...@toradex.com> For the i.MX8X and i.MX8 family SoCs, currently when the remotecore is started by the bootloader and the M core and A core are in the same partition, the driver is not capable to detect the remote core and report the correct state of it.
This series of patches implement an API call to the SCU which will return the power mode of a given resource (M core in this case) and if it is already powered on, the driver will attach to it. This SCU API was already being used inside pmdomain/imx/scu-pd.c driver, therefore it has been moved to firmware/imx/misc.c so it can be accessed by imx_rproc driver. Finally, the imx_rproc_clk_enable() function was also changed to make it return before dev_clk_get() is called, as it currently generates an SCU fault reset if the remote core is already running and the kernel tries to enable the clock again. These changes are a follow up from a v1 sent to imx_rproc [1] and from a reported regression [2]. [1] https://lore.kernel.org/lkml/20250423155131.101473-1-hiagofra...@gmail.com/ [2] https://lore.kernel.org/lkml/20250404141713.ac2ntcsjsf7epdfa@hiago-nb/ v2: - Order of commits changed, now "firmware: imx: move get power mode function from scu-pd.c to misc.c" comes at first. - Updated commit description of "remoteproc: imx_rproc: skip clock enable when M-core is managed by the SCU" as suggested by Peng. - Removed "imx_rproc_is_on" function and dropped unnecessary include as suggested by Peng. - Email corrected: peng....@oss.nxp.com -> peng....@nxp.com v1: - https://lore.kernel.org/lkml/20250505154849.64889-1-hiagofra...@gmail.com/ Hiago De Franco (3): firmware: imx: move get power mode function from scu-pd.c to misc.c remoteproc: imx_rproc: skip clock enable when M-core is managed by the SCU remoteproc: imx_rproc: add power mode check for remote core attachment drivers/firmware/imx/misc.c | 47 +++++++++++++++++++++++++++ drivers/pmdomain/imx/scu-pd.c | 29 ++++------------- drivers/remoteproc/imx_rproc.c | 17 ++++++++-- include/linux/firmware/imx/svc/misc.h | 8 +++++ 4 files changed, 77 insertions(+), 24 deletions(-) -- 2.39.5