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

Sergei Shtylyov sshtylyov at mvista.com
Wed Jan 19 11:46:13 CET 2011


Hello.

On 18-01-2011 22:30, Marek Vasut wrote:

> Signed-off-by: Marek Vasut<marek.vasut at 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;
> +
>   	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;

    Could drop the useless parens around ~x, while at it...

WBR, Sergei


More information about the U-Boot mailing list