imx: mx6ull: fix REFTOP_VBGADJ setting
Subsystems (3)
PATCH 1/2 imx: mx6ull: fix REFTOP_VBGADJ setting
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 <[email protected]>
---
arch/arm/mach-imx/mx6/soc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach-imx/mx6/soc.c +3 -1
@@ -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); } }
Signature · 1 line
2.32.0
PATCH 2/2 mx6: crm_regs: drop BM_ANADIG_ANA_MISC0_REFTOP_VBGADJ
Commit 97c16dc8bf098 ("imx: mx6ull: update the REFTOP_VBGADJ setting") made this macro unused. Then remove it.
Signed-off-by Dario Binacchi <[email protected]>
---
arch/arm/include/asm/arch-mx6/crm_regs.h | 1 - 1 file changed, 1 deletion(-)
arch/arm/include/asm/arch-mx6/crm_regs.h +0 -1
@@ -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)
Signature · 1 line
2.32.0