u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH 1/2] imx: mx6ull: fix REFTOP_VBGADJ setting
@ 2022-01-31  7:50 Dario Binacchi
  2022-01-31  7:50 ` [RESEND PATCH 2/2] mx6: crm_regs: drop BM_ANADIG_ANA_MISC0_REFTOP_VBGADJ Dario Binacchi
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dario Binacchi @ 2022-01-31  7:50 UTC (permalink / raw)
  To: u-boot
  Cc: Michael Trimarchi, Dario Binacchi, Bai Ping, Fabio Estevam,
	NXP i.MX U-Boot Team, Peng Fan, Sean Anderson, Stefano Babic

The previous code wrote the contents of the fuse as is in the
REFTOP_VBGADJ[2:0], but this was wrong if you consider the contents of
the table in the code comment. This table is also different from the
table in the commit description. But then, which of the two is correct?
If it is assumed that an unprogrammed fuse has a value of 0 then for
backward compatibility of the code REFTOP_VBGADJ[2:0] must be set to
6 (b'110). Therefore, the table in the code comment can be considered
correct as well as this patch.

Fixes: 97c16dc8bf098 ("imx: mx6ull: update the REFTOP_VBGADJ setting")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---

 arch/arm/mach-imx/mx6/soc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c
index aacfc854a2f8..099cb5b12d77 100644
--- a/arch/arm/mach-imx/mx6/soc.c
+++ b/arch/arm/mach-imx/mx6/soc.c
@@ -366,11 +366,13 @@ static void init_bandgap(void)
 	 *	111 - set REFTOP_VBGADJ[2:0] to 3b'111,
 	 */
 	if (is_mx6ull()) {
+		static const u32 map[] = {6, 1, 2, 3, 4, 5, 0, 7};
+
 		val = readl(&fuse->mem0);
 		val >>= OCOTP_MEM0_REFTOP_TRIM_SHIFT;
 		val &= 0x7;
 
-		writel(val << BM_ANADIG_ANA_MISC0_REFTOP_VBGADJ_SHIFT,
+		writel(map[val] << BM_ANADIG_ANA_MISC0_REFTOP_VBGADJ_SHIFT,
 		       &anatop->ana_misc0_set);
 	}
 }
-- 
2.32.0


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

* [RESEND PATCH 2/2] mx6: crm_regs: drop BM_ANADIG_ANA_MISC0_REFTOP_VBGADJ
  2022-01-31  7:50 [RESEND PATCH 1/2] imx: mx6ull: fix REFTOP_VBGADJ setting Dario Binacchi
@ 2022-01-31  7:50 ` Dario Binacchi
  2022-01-31 13:05   ` Fabio Estevam
  2022-02-05 16:41   ` sbabic
  2022-01-31 10:57 ` [RESEND PATCH 1/2] imx: mx6ull: fix REFTOP_VBGADJ setting Fabio Estevam
  2022-02-05 16:41 ` sbabic
  2 siblings, 2 replies; 6+ messages in thread
From: Dario Binacchi @ 2022-01-31  7:50 UTC (permalink / raw)
  To: u-boot
  Cc: Michael Trimarchi, Dario Binacchi, Fabio Estevam,
	NXP i.MX U-Boot Team, Stefano Babic

Commit 97c16dc8bf098 ("imx: mx6ull: update the REFTOP_VBGADJ setting")
made this macro unused. Then remove it.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---

 arch/arm/include/asm/arch-mx6/crm_regs.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/include/asm/arch-mx6/crm_regs.h b/arch/arm/include/asm/arch-mx6/crm_regs.h
index 4174f244afa1..2a2b8dd806b7 100644
--- a/arch/arm/include/asm/arch-mx6/crm_regs.h
+++ b/arch/arm/include/asm/arch-mx6/crm_regs.h
@@ -1291,7 +1291,6 @@ struct mxc_ccm_reg {
 	(((v) << 0) & BM_ANADIG_PFD_528_PFD0_FRAC)
 
 #define BM_ANADIG_ANA_MISC0_REFTOP_SELBIASOFF 0x00000008
-#define BM_ANADIG_ANA_MISC0_REFTOP_VBGADJ 0x60
 #define BM_ANADIG_ANA_MISC0_REFTOP_VBGADJ_SHIFT 4
 
 #define BM_PMU_MISC2_AUDIO_DIV_MSB (1 << 23)
-- 
2.32.0


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

* Re: [RESEND PATCH 1/2] imx: mx6ull: fix REFTOP_VBGADJ setting
  2022-01-31  7:50 [RESEND PATCH 1/2] imx: mx6ull: fix REFTOP_VBGADJ setting Dario Binacchi
  2022-01-31  7:50 ` [RESEND PATCH 2/2] mx6: crm_regs: drop BM_ANADIG_ANA_MISC0_REFTOP_VBGADJ Dario Binacchi
@ 2022-01-31 10:57 ` Fabio Estevam
  2022-02-05 16:41 ` sbabic
  2 siblings, 0 replies; 6+ messages in thread
From: Fabio Estevam @ 2022-01-31 10:57 UTC (permalink / raw)
  To: Dario Binacchi, Peng Fan, Bai Ping
  Cc: U-Boot-Denx, Michael Trimarchi, NXP i.MX U-Boot Team,
	Sean Anderson, Stefano Babic

Hi Peng and Jacky,

On Mon, Jan 31, 2022 at 4:50 AM Dario Binacchi
<dario.binacchi@amarulasolutions.com> wrote:
>
> The previous code wrote the contents of the fuse as is in the
> REFTOP_VBGADJ[2:0], but this was wrong if you consider the contents of
> the table in the code comment. This table is also different from the
> table in the commit description. But then, which of the two is correct?
> If it is assumed that an unprogrammed fuse has a value of 0 then for
> backward compatibility of the code REFTOP_VBGADJ[2:0] must be set to
> 6 (b'110). Therefore, the table in the code comment can be considered
> correct as well as this patch.
>
> Fixes: 97c16dc8bf098 ("imx: mx6ull: update the REFTOP_VBGADJ setting")
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

Could you please help review this series?

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

* Re: [RESEND PATCH 2/2] mx6: crm_regs: drop BM_ANADIG_ANA_MISC0_REFTOP_VBGADJ
  2022-01-31  7:50 ` [RESEND PATCH 2/2] mx6: crm_regs: drop BM_ANADIG_ANA_MISC0_REFTOP_VBGADJ Dario Binacchi
@ 2022-01-31 13:05   ` Fabio Estevam
  2022-02-05 16:41   ` sbabic
  1 sibling, 0 replies; 6+ messages in thread
From: Fabio Estevam @ 2022-01-31 13:05 UTC (permalink / raw)
  To: Dario Binacchi
  Cc: U-Boot-Denx, Michael Trimarchi, NXP i.MX U-Boot Team, Stefano Babic

On Mon, Jan 31, 2022 at 4:50 AM Dario Binacchi
<dario.binacchi@amarulasolutions.com> wrote:
>
> Commit 97c16dc8bf098 ("imx: mx6ull: update the REFTOP_VBGADJ setting")
> made this macro unused. Then remove it.
>
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

Reviewed-by: Fabio Estevam <festevam@gmail.com>

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

* [RESEND PATCH 2/2] mx6: crm_regs: drop BM_ANADIG_ANA_MISC0_REFTOP_VBGADJ
  2022-01-31  7:50 ` [RESEND PATCH 2/2] mx6: crm_regs: drop BM_ANADIG_ANA_MISC0_REFTOP_VBGADJ Dario Binacchi
  2022-01-31 13:05   ` Fabio Estevam
@ 2022-02-05 16:41   ` sbabic
  1 sibling, 0 replies; 6+ messages in thread
From: sbabic @ 2022-02-05 16:41 UTC (permalink / raw)
  To: Dario Binacchi, u-boot

> Commit 97c16dc8bf098 ("imx: mx6ull: update the REFTOP_VBGADJ setting")
> made this macro unused. Then remove it.
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> Reviewed-by: Fabio Estevam <festevam@gmail.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================

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

* [RESEND PATCH 1/2] imx: mx6ull: fix REFTOP_VBGADJ setting
  2022-01-31  7:50 [RESEND PATCH 1/2] imx: mx6ull: fix REFTOP_VBGADJ setting Dario Binacchi
  2022-01-31  7:50 ` [RESEND PATCH 2/2] mx6: crm_regs: drop BM_ANADIG_ANA_MISC0_REFTOP_VBGADJ Dario Binacchi
  2022-01-31 10:57 ` [RESEND PATCH 1/2] imx: mx6ull: fix REFTOP_VBGADJ setting Fabio Estevam
@ 2022-02-05 16:41 ` sbabic
  2 siblings, 0 replies; 6+ messages in thread
From: sbabic @ 2022-02-05 16:41 UTC (permalink / raw)
  To: Dario Binacchi, u-boot

> The previous code wrote the contents of the fuse as is in the
> REFTOP_VBGADJ[2:0], but this was wrong if you consider the contents of
> the table in the code comment. This table is also different from the
> table in the commit description. But then, which of the two is correct?
> If it is assumed that an unprogrammed fuse has a value of 0 then for
> backward compatibility of the code REFTOP_VBGADJ[2:0] must be set to
> 6 (b'110). Therefore, the table in the code comment can be considered
> correct as well as this patch.
> Fixes: 97c16dc8bf098 ("imx: mx6ull: update the REFTOP_VBGADJ setting")
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================

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

end of thread, other threads:[~2022-02-05 16:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-31  7:50 [RESEND PATCH 1/2] imx: mx6ull: fix REFTOP_VBGADJ setting Dario Binacchi
2022-01-31  7:50 ` [RESEND PATCH 2/2] mx6: crm_regs: drop BM_ANADIG_ANA_MISC0_REFTOP_VBGADJ Dario Binacchi
2022-01-31 13:05   ` Fabio Estevam
2022-02-05 16:41   ` sbabic
2022-01-31 10:57 ` [RESEND PATCH 1/2] imx: mx6ull: fix REFTOP_VBGADJ setting Fabio Estevam
2022-02-05 16:41 ` sbabic

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).