Patchwork [U-Boot,2/3,RESEND] MX51EVK: Use SWx macros in PMIC init

login
register
mail settings
Submitter Marek Vasut
Date Jan. 18, 2011, 11:19 p.m.
Message ID <1295392747-26643-2-git-send-email-marek.vasut@gmail.com>
Download mbox | patch
Permalink /patch/79372/
State Superseded
Delegated to: Stefano Babic
Headers show

Comments

Marek Vasut - Jan. 18, 2011, 11:19 p.m.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 board/freescale/mx51evk/mx51evk.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
Sergei Shtylyov - Jan. 19, 2011, 11:15 a.m.
On 19-01-2011 2:19, Marek Vasut wrote:

> Signed-off-by: Marek Vasut<marek.vasut@gmail.com>
[...]

> diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c
> index 2160d5a..bcf1934 100644
> --- a/board/freescale/mx51evk/mx51evk.c
> +++ b/board/freescale/mx51evk/mx51evk.c
> @@ -198,17 +198,18 @@ static void power_init(void)
>
>   	/* Set core voltage to 1.1V */
>   	val = pmic_reg_read(REG_SW_0);
> -	val = (val&  (~0x1F)) | 0x14;
> +	val = (val&  (~SWx_VOLT_MASK)) | SWx_1_100V;
>   	pmic_reg_write(REG_SW_0, val);
>
>   	/* Setup VCC (SW2) to 1.25 */
>   	val = pmic_reg_read(REG_SW_1);
> -	val = (val&  (~0x1F)) | 0x1A;
> +	val = (val&  (~SWx_VOLT_MASK)) | SWx_1_250V;
> +

    Stray newline?

WBR, Sergei
Marek Vasut - Jan. 19, 2011, 2:25 p.m.
On Wednesday 19 January 2011 12:15:33 Sergei Shtylyov wrote:
> On 19-01-2011 2:19, Marek Vasut wrote:
> > Signed-off-by: Marek Vasut<marek.vasut@gmail.com>
> 
> [...]
> 
> > diff --git a/board/freescale/mx51evk/mx51evk.c
> > b/board/freescale/mx51evk/mx51evk.c index 2160d5a..bcf1934 100644
> > --- a/board/freescale/mx51evk/mx51evk.c
> > +++ b/board/freescale/mx51evk/mx51evk.c
> > @@ -198,17 +198,18 @@ static void power_init(void)
> > 
> >   	/* Set core voltage to 1.1V */
> >   	val = pmic_reg_read(REG_SW_0);
> > 
> > -	val = (val&  (~0x1F)) | 0x14;
> > +	val = (val&  (~SWx_VOLT_MASK)) | SWx_1_100V;
> > 
> >   	pmic_reg_write(REG_SW_0, val);
> >   	
> >   	/* Setup VCC (SW2) to 1.25 */
> >   	val = pmic_reg_read(REG_SW_1);
> > 
> > -	val = (val&  (~0x1F)) | 0x1A;
> > +	val = (val&  (~SWx_VOLT_MASK)) | SWx_1_250V;
> > +
> 
>     Stray newline?

Nice catch, thanks
> 
> WBR, Sergei

Patch

diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c
index 2160d5a..bcf1934 100644
--- a/board/freescale/mx51evk/mx51evk.c
+++ b/board/freescale/mx51evk/mx51evk.c
@@ -198,17 +198,18 @@  static void power_init(void)
 
 	/* Set core voltage to 1.1V */
 	val = pmic_reg_read(REG_SW_0);
-	val = (val & (~0x1F)) | 0x14;
+	val = (val & (~SWx_VOLT_MASK)) | SWx_1_100V;
 	pmic_reg_write(REG_SW_0, val);
 
 	/* Setup VCC (SW2) to 1.25 */
 	val = pmic_reg_read(REG_SW_1);
-	val = (val & (~0x1F)) | 0x1A;
+	val = (val & (~SWx_VOLT_MASK)) | SWx_1_250V;
+
 	pmic_reg_write(REG_SW_1, val);
 
 	/* Setup 1V2_DIG1 (SW3) to 1.25 */
 	val = pmic_reg_read(REG_SW_2);
-	val = (val & (~0x1F)) | 0x1A;
+	val = (val & (~SWx_VOLT_MASK)) | SWx_1_250V;
 	pmic_reg_write(REG_SW_2, val);
 	udelay(50);