diff mbox

[U-Boot,v2,3/3] board: atmel: siemens: clean up PLLB code

Message ID 1453860255-29998-4-git-send-email-wenyou.yang@atmel.com
State Superseded
Delegated to: Andreas Bießmann
Headers show

Commit Message

Wenyou Yang Jan. 27, 2016, 2:04 a.m. UTC
Due to introducing the new PLLB clock handle functions,
use these functions to clean up the PLLB enable code.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
---

Changes in v2:
 - collect Reviewed-by from Andreas.

 board/siemens/smartweb/smartweb.c |    6 +-----
 board/siemens/taurus/taurus.c     |    6 +-----
 2 files changed, 2 insertions(+), 10 deletions(-)

Comments

Heiko Schocher Jan. 27, 2016, 6:31 a.m. UTC | #1
Hello Wenyou,

Am 27.01.2016 um 03:04 schrieb Wenyou Yang:
> Due to introducing the new PLLB clock handle functions,
> use these functions to clean up the PLLB enable code.
>
> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
> ---
>
> Changes in v2:
>   - collect Reviewed-by from Andreas.
>
>   board/siemens/smartweb/smartweb.c |    6 +-----
>   board/siemens/taurus/taurus.c     |    6 +-----
>   2 files changed, 2 insertions(+), 10 deletions(-)

Tested on the smartweb board, so:

Tested-by: Heiko Schocher <hs@denx.de>

bye,
Heiko

[1] testlog
http://xeidos.ddns.net/buildbot/builders/smartweb_dfu/builds/48/steps/shell/logs/tbotlog

>
> diff --git a/board/siemens/smartweb/smartweb.c b/board/siemens/smartweb/smartweb.c
> index e7ee65c..47a60a7 100644
> --- a/board/siemens/smartweb/smartweb.c
> +++ b/board/siemens/smartweb/smartweb.c
> @@ -115,12 +115,8 @@ static void smartweb_macb_hw_init(void)
>
>   void at91_udp_hw_init(void)
>   {
> -	at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
> -
>   	/* Enable PLLB */
> -	writel(get_pllb_init(), &pmc->pllbr);
> -	while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != AT91_PMC_LOCKB)
> -		;
> +	at91_pllb_clk_enable(get_pllb_init());
>
>   	/* Enable UDPCK clock, MCK is enabled in at91_clock_init() */
>   	at91_periph_clk_enable(ATMEL_ID_UDP);
> diff --git a/board/siemens/taurus/taurus.c b/board/siemens/taurus/taurus.c
> index 9374064..b0385d8 100644
> --- a/board/siemens/taurus/taurus.c
> +++ b/board/siemens/taurus/taurus.c
> @@ -289,12 +289,8 @@ void spi_cs_deactivate(struct spi_slave *slave)
>
>   void at91_udp_hw_init(void)
>   {
> -	at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
> -
>   	/* Enable PLLB */
> -	writel(get_pllb_init(), &pmc->pllbr);
> -	while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != AT91_PMC_LOCKB)
> -		;
> +	at91_pllb_clk_enable(get_pllb_init());
>
>   	/* Enable UDPCK clock, MCK is enabled in at91_clock_init() */
>   	at91_periph_clk_enable(ATMEL_ID_UDP);
>
diff mbox

Patch

diff --git a/board/siemens/smartweb/smartweb.c b/board/siemens/smartweb/smartweb.c
index e7ee65c..47a60a7 100644
--- a/board/siemens/smartweb/smartweb.c
+++ b/board/siemens/smartweb/smartweb.c
@@ -115,12 +115,8 @@  static void smartweb_macb_hw_init(void)
 
 void at91_udp_hw_init(void)
 {
-	at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
-
 	/* Enable PLLB */
-	writel(get_pllb_init(), &pmc->pllbr);
-	while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != AT91_PMC_LOCKB)
-		;
+	at91_pllb_clk_enable(get_pllb_init());
 
 	/* Enable UDPCK clock, MCK is enabled in at91_clock_init() */
 	at91_periph_clk_enable(ATMEL_ID_UDP);
diff --git a/board/siemens/taurus/taurus.c b/board/siemens/taurus/taurus.c
index 9374064..b0385d8 100644
--- a/board/siemens/taurus/taurus.c
+++ b/board/siemens/taurus/taurus.c
@@ -289,12 +289,8 @@  void spi_cs_deactivate(struct spi_slave *slave)
 
 void at91_udp_hw_init(void)
 {
-	at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
-
 	/* Enable PLLB */
-	writel(get_pllb_init(), &pmc->pllbr);
-	while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != AT91_PMC_LOCKB)
-		;
+	at91_pllb_clk_enable(get_pllb_init());
 
 	/* Enable UDPCK clock, MCK is enabled in at91_clock_init() */
 	at91_periph_clk_enable(ATMEL_ID_UDP);