All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joonyoung Shim <jy0922.shim@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/4] Exynos5: Use clock_get_periph_rate generic API
Date: Thu, 15 Jan 2015 10:29:42 +0900	[thread overview]
Message-ID: <54B71806.20102@samsung.com> (raw)
In-Reply-To: <1421242536-4209-4-git-send-email-akshay.s@samsung.com>

Hi,

On 01/14/2015 10:35 PM, Akshay Saraswat wrote:
> Replacing SoC and peripheral specific function calls with generic
> clock_get_periph_rate calls to get the peripheral clocks.
> 
> Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
> ---
>  arch/arm/cpu/armv7/exynos/clock.c | 60 +++++++++++++++++++++++++++++++--------
>  1 file changed, 48 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv7/exynos/clock.c b/arch/arm/cpu/armv7/exynos/clock.c
> index 9ac4579..9c719aa 100644
> --- a/arch/arm/cpu/armv7/exynos/clock.c
> +++ b/arch/arm/cpu/armv7/exynos/clock.c
> @@ -406,10 +406,13 @@ static unsigned long exynos5_get_periph_rate(int peripheral)
>  		break;
>  	case PERIPH_ID_SDMMC0:
>  	case PERIPH_ID_SDMMC1:
> +		src = readl(&clk->src_fsys);
> +		div = readl(&clk->div_fsys1);
> +		break;
>  	case PERIPH_ID_SDMMC2:
>  	case PERIPH_ID_SDMMC3:
>  		src = readl(&clk->src_fsys);
> -		div = readl(&clk->div_fsys1);
> +		div = readl(&clk->div_fsys2);
>  		break;
>  	case PERIPH_ID_I2C0:
>  	case PERIPH_ID_I2C1:
> @@ -450,8 +453,7 @@ static unsigned long exynos5_get_periph_rate(int peripheral)
>  	sub_div = (div >> bit_info->div_bit) & 0xf;
>  	sub_clk = sclk / (sub_div + 1);
>  
> -	/* Pre-ratio clock division for SDMMC0 and 2 */
> -	if (peripheral == PERIPH_ID_SDMMC0 || peripheral == PERIPH_ID_SDMMC2) {
> +	if (bit_info->prediv_bit >= 0) {
>  		div = (div >> bit_info->prediv_bit) & 0xff;
>  		return sub_clk / (div + 1);
>  	}

Above changes seem to just fix, please make separate patch.

Thanks.

  reply	other threads:[~2015-01-15  1:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-14 13:35 [U-Boot] [PATCH 0/4] Exynos5: Fix warnings and enrich clock_get_periph_rate Akshay Saraswat
2015-01-14 13:35 ` [U-Boot] [PATCH 1/4] Exynos5: Fix compiler warnings due to clock_get_periph_rate Akshay Saraswat
2015-01-15  0:59   ` Joonyoung Shim
2015-01-14 13:35 ` [U-Boot] [PATCH 2/4] Exynos542x: Add and enable get_periph_rate support Akshay Saraswat
2015-01-15  1:26   ` Joonyoung Shim
2015-01-14 13:35 ` [U-Boot] [PATCH 3/4] Exynos5: Use clock_get_periph_rate generic API Akshay Saraswat
2015-01-15  1:29   ` Joonyoung Shim [this message]
2015-01-14 13:35 ` [U-Boot] [PATCH 4/4] Exynos5: Remove dead code for fetching clocks Akshay Saraswat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54B71806.20102@samsung.com \
    --to=jy0922.shim@samsung.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.