linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3] soc: imx8m: Correct i.MX8MP UID fuse offset
@ 2020-06-10 10:03 Anson Huang
  2020-06-10 10:30 ` Iuliana Prodan
  2020-06-23 11:45 ` Shawn Guo
  0 siblings, 2 replies; 3+ messages in thread
From: Anson Huang @ 2020-06-10 10:03 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, leonard.crestez, abel.vesa,
	l.stach, peng.fan, linux-arm-kernel, linux-kernel
  Cc: Linux-imx

Correct i.MX8MP UID fuse offset according to fuse map:

UID_LOW: 0x420
UID_HIGH: 0x430

Fixes: fc40200ebf82 ("soc: imx: increase build coverage for imx8m soc driver")
Fixes: 18f662a73862 ("soc: imx: Add i.MX8MP SoC driver support")
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
Changes since V2:
	- add one more fix tag for original patch before file name is changed.
---
 drivers/soc/imx/soc-imx8m.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/imx/soc-imx8m.c b/drivers/soc/imx/soc-imx8m.c
index 7b0759a..0bc8314 100644
--- a/drivers/soc/imx/soc-imx8m.c
+++ b/drivers/soc/imx/soc-imx8m.c
@@ -22,6 +22,8 @@
 #define OCOTP_UID_LOW			0x410
 #define OCOTP_UID_HIGH			0x420
 
+#define IMX8MP_OCOTP_UID_OFFSET		0x10
+
 /* Same as ANADIG_DIGPROG_IMX7D */
 #define ANADIG_DIGPROG_IMX8MM	0x800
 
@@ -87,6 +89,8 @@ static void __init imx8mm_soc_uid(void)
 {
 	void __iomem *ocotp_base;
 	struct device_node *np;
+	u32 offset = of_machine_is_compatible("fsl,imx8mp") ?
+		     IMX8MP_OCOTP_UID_OFFSET : 0;
 
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx8mm-ocotp");
 	if (!np)
@@ -95,9 +99,9 @@ static void __init imx8mm_soc_uid(void)
 	ocotp_base = of_iomap(np, 0);
 	WARN_ON(!ocotp_base);
 
-	soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH);
+	soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH + offset);
 	soc_uid <<= 32;
-	soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW);
+	soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW + offset);
 
 	iounmap(ocotp_base);
 	of_node_put(np);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH V3] soc: imx8m: Correct i.MX8MP UID fuse offset
  2020-06-10 10:03 [PATCH V3] soc: imx8m: Correct i.MX8MP UID fuse offset Anson Huang
@ 2020-06-10 10:30 ` Iuliana Prodan
  2020-06-23 11:45 ` Shawn Guo
  1 sibling, 0 replies; 3+ messages in thread
From: Iuliana Prodan @ 2020-06-10 10:30 UTC (permalink / raw)
  To: Anson Huang, shawnguo, s.hauer, kernel, festevam,
	leonard.crestez, abel.vesa, l.stach, peng.fan, linux-arm-kernel,
	linux-kernel
  Cc: Linux-imx


On 6/10/2020 1:03 PM, Anson Huang wrote:
> Correct i.MX8MP UID fuse offset according to fuse map:
> 
> UID_LOW: 0x420
> UID_HIGH: 0x430
> 
> Fixes: fc40200ebf82 ("soc: imx: increase build coverage for imx8m soc driver")
> Fixes: 18f662a73862 ("soc: imx: Add i.MX8MP SoC driver support")
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>

> ---
> Changes since V2:
> 	- add one more fix tag for original patch before file name is changed.
> ---
>   drivers/soc/imx/soc-imx8m.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/soc/imx/soc-imx8m.c b/drivers/soc/imx/soc-imx8m.c
> index 7b0759a..0bc8314 100644
> --- a/drivers/soc/imx/soc-imx8m.c
> +++ b/drivers/soc/imx/soc-imx8m.c
> @@ -22,6 +22,8 @@
>   #define OCOTP_UID_LOW			0x410
>   #define OCOTP_UID_HIGH			0x420
>   
> +#define IMX8MP_OCOTP_UID_OFFSET		0x10
> +
>   /* Same as ANADIG_DIGPROG_IMX7D */
>   #define ANADIG_DIGPROG_IMX8MM	0x800
>   
> @@ -87,6 +89,8 @@ static void __init imx8mm_soc_uid(void)
>   {
>   	void __iomem *ocotp_base;
>   	struct device_node *np;
> +	u32 offset = of_machine_is_compatible("fsl,imx8mp") ?
> +		     IMX8MP_OCOTP_UID_OFFSET : 0;
>   
>   	np = of_find_compatible_node(NULL, NULL, "fsl,imx8mm-ocotp");
>   	if (!np)
> @@ -95,9 +99,9 @@ static void __init imx8mm_soc_uid(void)
>   	ocotp_base = of_iomap(np, 0);
>   	WARN_ON(!ocotp_base);
>   
> -	soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH);
> +	soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH + offset);
>   	soc_uid <<= 32;
> -	soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW);
> +	soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW + offset);
>   
>   	iounmap(ocotp_base);
>   	of_node_put(np);
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH V3] soc: imx8m: Correct i.MX8MP UID fuse offset
  2020-06-10 10:03 [PATCH V3] soc: imx8m: Correct i.MX8MP UID fuse offset Anson Huang
  2020-06-10 10:30 ` Iuliana Prodan
@ 2020-06-23 11:45 ` Shawn Guo
  1 sibling, 0 replies; 3+ messages in thread
From: Shawn Guo @ 2020-06-23 11:45 UTC (permalink / raw)
  To: Anson Huang
  Cc: s.hauer, kernel, festevam, leonard.crestez, abel.vesa, l.stach,
	peng.fan, linux-arm-kernel, linux-kernel, Linux-imx

On Wed, Jun 10, 2020 at 06:03:02PM +0800, Anson Huang wrote:
> Correct i.MX8MP UID fuse offset according to fuse map:
> 
> UID_LOW: 0x420
> UID_HIGH: 0x430
> 
> Fixes: fc40200ebf82 ("soc: imx: increase build coverage for imx8m soc driver")
> Fixes: 18f662a73862 ("soc: imx: Add i.MX8MP SoC driver support")
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-23 11:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-10 10:03 [PATCH V3] soc: imx8m: Correct i.MX8MP UID fuse offset Anson Huang
2020-06-10 10:30 ` Iuliana Prodan
2020-06-23 11:45 ` Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).