[PATCH 4/7] firmware: imx: ele: simplify SoC device registration
Pankaj Gupta
pankaj.gupta at nxp.com
Sun May 24 23:36:22 PDT 2026
> -----Original Message-----
> From: Peng Fan (OSS) <peng.fan at oss.nxp.com>
> Sent: 25 May 2026 11:09
> To: Frank Li <frank.li at nxp.com>; Sascha Hauer <s.hauer at pengutronix.de>;
> Pengutronix Kernel Team <kernel at pengutronix.de>; Fabio Estevam
> <festevam at gmail.com>; Frieder Schrempf <frieder.schrempf at kontron.de>;
> Pankaj Gupta <pankaj.gupta at nxp.com>
> Cc: imx at lists.linux.dev; linux-arm-kernel at lists.infradead.org; linux-
> kernel at vger.kernel.org; Peng Fan <peng.fan at nxp.com>
> Subject: [PATCH 4/7] firmware: imx: ele: simplify SoC device registration
>
> From: Peng Fan <peng.fan at nxp.com>
>
> 'soc_register' is used as a flag to control whether a SoC device should be
> registered. However, only i.MX8ULP requires this, while i.MX9 is handled
> separately in soc-imx9.c.
>
> Replace the boolean 'soc_register' with a 'soc_name' string and use its
> presence as the condition for registration to remove the switch and
> i.MX93 case.
>
> Signed-off-by: Peng Fan <peng.fan at nxp.com>
> ---
> drivers/firmware/imx/se_ctrl.c | 15 ++++-----------
> 1 file changed, 4 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/firmware/imx/se_ctrl.c b/drivers/firmware/imx/se_ctrl.c
> index
> 9327d47e4312e7f39a5f4fc24dd73566af240a9f..30e97a604eca137f45de6c
> 329081fba234642732 100644
> --- a/drivers/firmware/imx/se_ctrl.c
> +++ b/drivers/firmware/imx/se_ctrl.c
> @@ -56,7 +56,7 @@ struct se_var_info {
> /* contains fixed information */
> struct se_soc_info {
> const u16 soc_id;
> - const bool soc_register;
> + const char *soc_name;
> const struct se_fw_img_name se_fw_img_nm; };
>
> @@ -72,7 +72,7 @@ static struct se_var_info var_se_info;
>
> static struct se_soc_info se_imx8ulp_info = {
> .soc_id = SOC_ID_OF_IMX8ULP,
> - .soc_register = true,
> + .soc_name = "i.MX8ULP",
> .se_fw_img_nm = {
> .prim_fw_nm_in_rfs = IMX_ELE_FW_DIR
> "mx8ulpa2-ahab-container.img",
> @@ -163,7 +163,7 @@ static int get_se_soc_info(struct se_if_priv *priv,
> const struct se_soc_info *se
> var_se_info.soc_rev = s_info->d_info.soc_rev;
> load_fw->imem.state = s_info->d_addn_info.imem_state;
>
> - if (!se_info->soc_register)
> + if (!se_info->soc_name)
> return 0;
Remove the soc_register, all together.
Replace the check with "se_info->soc_id != SOC_ID_OF_IMX8ULP"
>
> attr = devm_kzalloc(priv->dev, sizeof(*attr), GFP_KERNEL); @@ -
> 181,14 +181,7 @@ static int get_se_soc_info(struct se_if_priv *priv, const
> struct se_soc_info *se
>
> FIELD_GET(DEV_GETINFO_MAJ_VER_MASK,
>
> var_se_info.soc_rev));
>
> - switch (se_info->soc_id) {
> - case SOC_ID_OF_IMX8ULP:
> - attr->soc_id = "i.MX8ULP";
> - break;
> - case SOC_ID_OF_IMX93:
> - attr->soc_id = "i.MX93";
> - break;
> - }
> + attr->soc_id = se_info->soc_name;
>
> err = of_property_read_string(of_root, "model", &attr->machine);
> if (err)
>
> --
> 2.37.1
More information about the linux-arm-kernel
mailing list