Patchwork [U-Boot,v3,3/4] imx: mx5: lowlevel_init: Simplify code

login
register
mail settings
Submitter Benoît Thébaudeau
Date Feb. 5, 2013, 9:07 p.m.
Message ID <1360098435-26005-3-git-send-email-benoit.thebaudeau@advansee.com>
Download mbox | patch
Permalink /patch/218348/
State Changes Requested
Delegated to: Stefano Babic
Headers show

Comments

Benoît Thébaudeau - Feb. 5, 2013, 9:07 p.m.
Don't use several instructions to build constant values.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
---
Changes in v3:
 - New patch.

Changes in v2: None

 arch/arm/cpu/armv7/mx5/lowlevel_init.S |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
Stefano Babic - Feb. 6, 2013, 8:56 a.m.
On 05/02/2013 22:07, Benoît Thébaudeau wrote:
> Don't use several instructions to build constant values.
> 
> Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
> ---
> Changes in v3:
>  - New patch.
> 
> Changes in v2: None
> 
>  arch/arm/cpu/armv7/mx5/lowlevel_init.S |    8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv7/mx5/lowlevel_init.S b/arch/arm/cpu/armv7/mx5/lowlevel_init.S
> index 6d9396a..dfce0ca 100644
> --- a/arch/arm/cpu/armv7/mx5/lowlevel_init.S
> +++ b/arch/arm/cpu/armv7/mx5/lowlevel_init.S
> @@ -309,8 +309,7 @@ setup_pll_func:
>          ldr r0, =CCM_BASE_ADDR
>          ldr r1, =0x00015154
>          str r1, [r0, #CLKCTL_CBCMR]
> -        ldr r1, =0x02888945
> -        orr r1, r1, #(1 << 16)
> +        ldr r1, =0x02898945
>          str r1, [r0, #CLKCTL_CBCDR]
>          /* make sure change is effective */
>  1:      ldr r1, [r0, #CLKCTL_CDHIPR]
> @@ -321,10 +320,7 @@ setup_pll_func:
>  
>  	/* Switch peripheral to PLL2 */
>  	ldr r0, =CCM_BASE_ADDR
> -	ldr r1, =0x00808145
> -	orr r1, r1, #(2 << 10)
> -	orr r1, r1, #(0 << 16)
> -	orr r1, r1, #(1 << 19)
> +	ldr r1, =0x00888945
>  	str r1, [r0, #CLKCTL_CBCDR]
>  
>  	ldr r1, =0x00016154
> 

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic

Patch

diff --git a/arch/arm/cpu/armv7/mx5/lowlevel_init.S b/arch/arm/cpu/armv7/mx5/lowlevel_init.S
index 6d9396a..dfce0ca 100644
--- a/arch/arm/cpu/armv7/mx5/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/mx5/lowlevel_init.S
@@ -309,8 +309,7 @@  setup_pll_func:
         ldr r0, =CCM_BASE_ADDR
         ldr r1, =0x00015154
         str r1, [r0, #CLKCTL_CBCMR]
-        ldr r1, =0x02888945
-        orr r1, r1, #(1 << 16)
+        ldr r1, =0x02898945
         str r1, [r0, #CLKCTL_CBCDR]
         /* make sure change is effective */
 1:      ldr r1, [r0, #CLKCTL_CDHIPR]
@@ -321,10 +320,7 @@  setup_pll_func:
 
 	/* Switch peripheral to PLL2 */
 	ldr r0, =CCM_BASE_ADDR
-	ldr r1, =0x00808145
-	orr r1, r1, #(2 << 10)
-	orr r1, r1, #(0 << 16)
-	orr r1, r1, #(1 << 19)
+	ldr r1, =0x00888945
 	str r1, [r0, #CLKCTL_CBCDR]
 
 	ldr r1, =0x00016154