summaryrefslogtreecommitdiff
path: root/drivers/soc
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2026-01-21 16:39:29 +0100
committerArnd Bergmann <arnd@arndb.de>2026-01-21 16:39:29 +0100
commit6d9e4c74372bd08c75d7c2dbdccc4d713caabbd9 (patch)
tree5507f0c9317fc4eb7317fb7192ac745cd0a69644 /drivers/soc
parent419a620dc452b9cd6aa684d99bcff352f7ab7f13 (diff)
parentf6ef3d9ff81240e9bcc030f2da132eb0f8a761d7 (diff)
Merge tag 'imx-drivers-6.20' of https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/drivers
i.MX drivers changes for 6.20: - A few changes from Peng Fan adding dump syslog support for i.MX System Manager firmware driver, cleaning up soc-imx9 driver, fixing error handling for soc-imx8m driver * tag 'imx-drivers-6.20' of https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: soc: imx8m: Fix error handling for clk_prepare_enable() soc: imx: Spport i.MX9[4,52] soc: imx: Use dev_err_probe() for i.MX9 soc: imx: Use device-managed APIs for i.MX9 firmware: imx: sm-misc: Dump syslog info firmware: arm_scmi: imx: Support getting syslog of MISC protocol Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/imx/soc-imx8m.c6
-rw-r--r--drivers/soc/imx/soc-imx9.c46
2 files changed, 21 insertions, 31 deletions
diff --git a/drivers/soc/imx/soc-imx8m.c b/drivers/soc/imx/soc-imx8m.c
index 04a1b60f2f2b..8e2322999f09 100644
--- a/drivers/soc/imx/soc-imx8m.c
+++ b/drivers/soc/imx/soc-imx8m.c
@@ -148,7 +148,11 @@ static int imx8m_soc_prepare(struct platform_device *pdev, const char *ocotp_com
goto err_clk;
}
- return clk_prepare_enable(drvdata->clk);
+ ret = clk_prepare_enable(drvdata->clk);
+ if (ret)
+ goto err_clk;
+
+ return 0;
err_clk:
iounmap(drvdata->ocotp_base);
diff --git a/drivers/soc/imx/soc-imx9.c b/drivers/soc/imx/soc-imx9.c
index b46d22cf0212..d67bc7402b10 100644
--- a/drivers/soc/imx/soc-imx9.c
+++ b/drivers/soc/imx/soc-imx9.c
@@ -12,12 +12,13 @@
#include <linux/sys_soc.h>
#define IMX_SIP_GET_SOC_INFO 0xc2000006
-#define SOC_ID(x) (((x) & 0xFFFF) >> 8)
+#define SOC_ID(x) (((x) & 0xFF) ? ((x) & 0xFFFF) >> 4 : ((x) & 0xFFFF) >> 8)
#define SOC_REV_MAJOR(x) ((((x) >> 28) & 0xF) - 0x9)
#define SOC_REV_MINOR(x) (((x) >> 24) & 0xF)
static int imx9_soc_probe(struct platform_device *pdev)
{
+ struct device *dev = &pdev->dev;
struct soc_device_attribute *attr;
struct arm_smccc_res res;
struct soc_device *sdev;
@@ -25,17 +26,15 @@ static int imx9_soc_probe(struct platform_device *pdev)
u64 uid127_64, uid63_0;
int err;
- attr = kzalloc(sizeof(*attr), GFP_KERNEL);
+ attr = devm_kzalloc(dev, sizeof(*attr), GFP_KERNEL);
if (!attr)
return -ENOMEM;
err = of_property_read_string(of_root, "model", &attr->machine);
- if (err) {
- pr_err("%s: missing model property: %d\n", __func__, err);
- goto attr;
- }
+ if (err)
+ return dev_err_probe(dev, err, "%s: missing model property\n", __func__);
- attr->family = kasprintf(GFP_KERNEL, "Freescale i.MX");
+ attr->family = devm_kasprintf(dev, GFP_KERNEL, "Freescale i.MX");
/*
* Retrieve the soc id, rev & uid info:
@@ -45,46 +44,33 @@ static int imx9_soc_probe(struct platform_device *pdev)
* res.a3: uid[63:0];
*/
arm_smccc_smc(IMX_SIP_GET_SOC_INFO, 0, 0, 0, 0, 0, 0, 0, &res);
- if (res.a0 != SMCCC_RET_SUCCESS) {
- pr_err("%s: SMC failed: 0x%lx\n", __func__, res.a0);
- err = -EINVAL;
- goto family;
- }
+ if (res.a0 != SMCCC_RET_SUCCESS)
+ return dev_err_probe(dev, -EINVAL, "%s: SMC failed: 0x%lx\n", __func__, res.a0);
soc_id = SOC_ID(res.a1);
rev_major = SOC_REV_MAJOR(res.a1);
rev_minor = SOC_REV_MINOR(res.a1);
- attr->soc_id = kasprintf(GFP_KERNEL, "i.MX%2x", soc_id);
- attr->revision = kasprintf(GFP_KERNEL, "%d.%d", rev_major, rev_minor);
+ attr->soc_id = devm_kasprintf(dev, GFP_KERNEL, "i.MX%2x", soc_id);
+ attr->revision = devm_kasprintf(dev, GFP_KERNEL, "%d.%d", rev_major, rev_minor);
uid127_64 = res.a2;
uid63_0 = res.a3;
- attr->serial_number = kasprintf(GFP_KERNEL, "%016llx%016llx", uid127_64, uid63_0);
+ attr->serial_number = devm_kasprintf(dev, GFP_KERNEL, "%016llx%016llx", uid127_64, uid63_0);
sdev = soc_device_register(attr);
- if (IS_ERR(sdev)) {
- err = PTR_ERR(sdev);
- pr_err("%s failed to register SoC as a device: %d\n", __func__, err);
- goto serial_number;
- }
+ if (IS_ERR(sdev))
+ return dev_err_probe(dev, PTR_ERR(sdev),
+ "%s failed to register SoC as a device\n", __func__);
return 0;
-
-serial_number:
- kfree(attr->serial_number);
- kfree(attr->revision);
- kfree(attr->soc_id);
-family:
- kfree(attr->family);
-attr:
- kfree(attr);
- return err;
}
static __maybe_unused const struct of_device_id imx9_soc_match[] = {
{ .compatible = "fsl,imx93", },
+ { .compatible = "fsl,imx94", },
{ .compatible = "fsl,imx95", },
+ { .compatible = "fsl,imx952", },
{ }
};