diff options
| author | Tom Rini <[email protected]> | 2025-10-24 12:09:02 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-10-24 13:47:50 -0600 |
| commit | fd976ff3a233ae7c6a9f5bec790b02bbbf57bb24 (patch) | |
| tree | 1bffd9388bcc9856cb9451c2034ef18158f356b3 /include | |
| parent | fae6c54d238279bf79c66ca65330425dff2c952f (diff) | |
| parent | ac9b02dd1028d14b6326970c93dfc3c50daa16f1 (diff) | |
Merge patch series "firmware: scmi: Support SCMI LMM/CPU protocol for i.MX95"
Peng Fan (OSS) <[email protected]> says:
i.MX95 System Manager(SM) implements Logical Machine Management(LMM) and
CPU protocol to manage Logical Machine(LM) and CPUs(eg, M7).
To manage M7 in a separate LM or in same LM as U-Boot/Linux itself. LMM
APIs and CPU APIs are needed.
When M7 is in LM 'lm-m7', and this LM is managable by 'uboot-lm', U-Boot
could use LMM_BOOT, LMM_SHUTDOWN and etc to manage 'lm-m7'.
If in same LM, use CPU_START, CPU_STOP, CPU_RESET_VECTOR_SET and etc to
manage M7.
Both LMM/CPU APIs will be used by remoteproc driver.
The documentation could be found in Linux Kernel:
drivers/firmware/arm_scmi/vendors/imx/imx95.rst
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'include')
| -rw-r--r-- | include/scmi_agent-uclass.h | 16 | ||||
| -rw-r--r-- | include/scmi_nxp_protocols.h | 73 | ||||
| -rw-r--r-- | include/scmi_protocols.h | 3 |
3 files changed, 88 insertions, 4 deletions
diff --git a/include/scmi_agent-uclass.h b/include/scmi_agent-uclass.h index d6586eb3ff9..9b36d3ae67b 100644 --- a/include/scmi_agent-uclass.h +++ b/include/scmi_agent-uclass.h @@ -40,11 +40,27 @@ struct scmi_agent_priv { u8 *agent_name; u32 agent_id; struct udevice *base_dev; +#if IS_ENABLED(CONFIG_SCMI_POWER_DOMAIN) struct udevice *pwdom_dev; +#endif +#if IS_ENABLED(CONFIG_CLK_SCMI) struct udevice *clock_dev; +#endif +#if IS_ENABLED(CONFIG_RESET_SCMI) struct udevice *resetdom_dev; +#endif +#if IS_ENABLED(CONFIG_DM_REGULATOR_SCMI) struct udevice *voltagedom_dev; +#endif +#if IS_ENABLED(CONFIG_PINCTRL_IMX_SCMI) struct udevice *pinctrl_dev; +#endif +#if IS_ENABLED(CONFIG_SCMI_ID_VENDOR_80) + struct udevice *vendor_dev_80; +#endif +#if IS_ENABLED(CONFIG_SCMI_ID_VENDOR_82) + struct udevice *vendor_dev_82; +#endif }; static inline u32 scmi_version(struct udevice *dev) diff --git a/include/scmi_nxp_protocols.h b/include/scmi_nxp_protocols.h index fe6ecd6a7cf..c17f3663eba 100644 --- a/include/scmi_nxp_protocols.h +++ b/include/scmi_nxp_protocols.h @@ -9,9 +9,9 @@ #include <asm/types.h> #include <linux/bitops.h> -enum scmi_imx_protocol { - SCMI_IMX_PROTOCOL_ID_MISC = 0x84, -}; +#define SCMI_PROTOCOL_ID_IMX_LMM 0x80 +#define SCMI_PROTOCOL_ID_IMX_CPU 0x82 +#define SCMI_PROTOCOL_ID_IMX_MISC 0x84 #define SCMI_PAYLOAD_LEN 100 @@ -52,4 +52,71 @@ struct scmi_imx_misc_reset_reason_out { u32 extInfo[MISC_MAX_EXTINFO]; }; +#define LMM_ID_DISCOVER 0xFFFFFFFFU +#define LMM_MAX_NAME 16 + +enum scmi_imx_lmm_state { + LMM_STATE_LM_OFF, + LMM_STATE_LM_ON, + LMM_STATE_LM_SUSPEND, + LMM_STATE_LM_POWERED, +}; + +struct scmi_imx_lmm_info { + u32 lmid; + enum scmi_imx_lmm_state state; + u32 errstatus; + u8 name[LMM_MAX_NAME]; +}; + +#if IS_ENABLED(CONFIG_IMX_SM_LMM) +int scmi_imx_lmm_info(struct udevice *dev, u32 lmid, struct scmi_imx_lmm_info *info); +int scmi_imx_lmm_power_boot(struct udevice *dev, u32 lmid, bool boot); +int scmi_imx_lmm_reset_vector_set(struct udevice *dev, u32 lmid, u32 cpuid, u32 flags, u64 vector); +int scmi_imx_lmm_shutdown(struct udevice *dev, u32 lmid, bool flags); +#else +static inline int scmi_imx_lmm_info(struct udevice *dev, u32 lmid, struct scmi_imx_lmm_info *info) +{ + return -EOPNOTSUPP; +} + +static inline int scmi_imx_lmm_power_boot(struct udevice *dev, u32 lmid, bool boot) +{ + return -EOPNOTSUPP; +} + +static inline int +scmi_imx_lmm_reset_vector_set(struct udevice *dev, u32 lmid, u32 cpuid, u32 flags, u64 vector) +{ + return -EOPNOTSUPP; +} + +static inline int scmi_imx_lmm_shutdown(struct udevice *dev, u32 lmid, bool flags) +{ + return -EOPNOTSUPP; +} +#endif + +#if IS_ENABLED(CONFIG_IMX_SM_CPU) +int scmi_imx_cpu_started(struct udevice *dev, u32 cpuid, bool *started); +int scmi_imx_cpu_reset_vector_set(struct udevice *dev, u32 cpuid, u32 flags, u64 vector, + bool start, bool boot, bool resume); +int scmi_imx_cpu_start(struct udevice *dev, u32 cpuid, bool start); +#else +static inline int scmi_imx_cpu_started(struct udevice *dev, u32 cpuid, bool *started) +{ + return -EOPNOTSUPP; +} + +static inline int scmi_imx_cpu_reset_vector_set(struct udevice *dev, u32 cpuid, u32 flags, + u64 vector, bool start, bool boot, bool resume) +{ + return -EOPNOTSUPP; +} + +static inline int scmi_imx_cpu_start(struct udevice *dev, u32 cpuid, bool start) +{ + return -EOPNOTSUPP; +} +#endif #endif diff --git a/include/scmi_protocols.h b/include/scmi_protocols.h index 95e0c3cce3b..bb74a57f79a 100644 --- a/include/scmi_protocols.h +++ b/include/scmi_protocols.h @@ -25,7 +25,8 @@ enum scmi_std_protocol { SCMI_PROTOCOL_ID_RESET_DOMAIN = 0x16, SCMI_PROTOCOL_ID_VOLTAGE_DOMAIN = 0x17, SCMI_PROTOCOL_ID_PINCTRL = 0x19, - SCMI_PROTOCOL_ID_IMX_MISC = 0x84, + SCMI_PROTOCOL_ID_VENDOR_80 = 0x80, + SCMI_PROTOCOL_ID_VENDOR_82 = 0x82, }; enum scmi_status_code { |
