Patch "soc: imx8m: Enable OCOTP clock for imx8mm before reading registers" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    soc: imx8m: Enable OCOTP clock for imx8mm before reading registers

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     soc-imx8m-enable-ocotp-clock-for-imx8mm-before-readi.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit aca301d37651d02db85d5a7d02b98b95113a05e5
Author: Nathan Rossi <nathan.rossi@xxxxxxxx>
Date:   Mon Aug 14 01:57:00 2023 +0000

    soc: imx8m: Enable OCOTP clock for imx8mm before reading registers
    
    [ Upstream commit 9d1e8275a28f51599d754ce661c91e0a689c0234 ]
    
    Commit 836fb30949d9 ("soc: imx8m: Enable OCOTP clock before reading the
    register") added configuration to enable the OCOTP clock before
    attempting to read from the associated registers.
    
    This same kexec issue is present with the imx8m SoCs that use the
    imx8mm_soc_uid function (e.g. imx8mp). This requires the imx8mm_soc_uid
    function to configure the OCOTP clock before accessing the associated
    registers. This change implements the same clock enable functionality
    that is present in the imx8mq_soc_revision function for the
    imx8mm_soc_uid function.
    
    Signed-off-by: Nathan Rossi <nathan.rossi@xxxxxxxx>
    Reviewed-by: Fabio Estevam <festevam@xxxxxxxxx>
    Fixes: 836fb30949d9 ("soc: imx8m: Enable OCOTP clock before reading the register")
    Signed-off-by: Shawn Guo <shawnguo@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/soc/imx/soc-imx8m.c b/drivers/soc/imx/soc-imx8m.c
index 32ed9dc88e455..08197b03955dd 100644
--- a/drivers/soc/imx/soc-imx8m.c
+++ b/drivers/soc/imx/soc-imx8m.c
@@ -100,6 +100,7 @@ static void __init imx8mm_soc_uid(void)
 {
 	void __iomem *ocotp_base;
 	struct device_node *np;
+	struct clk *clk;
 	u32 offset = of_machine_is_compatible("fsl,imx8mp") ?
 		     IMX8MP_OCOTP_UID_OFFSET : 0;
 
@@ -109,11 +110,20 @@ static void __init imx8mm_soc_uid(void)
 
 	ocotp_base = of_iomap(np, 0);
 	WARN_ON(!ocotp_base);
+	clk = of_clk_get_by_name(np, NULL);
+	if (IS_ERR(clk)) {
+		WARN_ON(IS_ERR(clk));
+		return;
+	}
+
+	clk_prepare_enable(clk);
 
 	soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH + offset);
 	soc_uid <<= 32;
 	soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW + offset);
 
+	clk_disable_unprepare(clk);
+	clk_put(clk);
 	iounmap(ocotp_base);
 	of_node_put(np);
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux