public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V3 5/9] EXYNOS5: DWMMC: API to set mmc clock divisor
Date: Thu, 03 Jan 2013 15:45:38 +0900	[thread overview]
Message-ID: <50E52912.1010409@samsung.com> (raw)
In-Reply-To: <CAPbRUmk6rNuTkWjf2fv=DoTqGdo+XXHDeBF-pC=rJU7qROoKbg@mail.gmail.com>

Hi Amar,

..snip..
>> I didn't understand this function(exynos5_mmc_set_clk_div?).
>> What purpose? I think good that proper to use the "div" as argument.
>> void exynos5_mmc_set_clk(int dev_id, unsigned int div).
> 
> 
> For fixing dwmmc driver, I referred to working code from
> "chromiumos/src/third_party/u-boot".
> In chromium uboot, during mhci init, the function "clock_set_mshci()" is
> called which is in "arch/arm/cpu/armv7/exynos5/clock.c"
> 
> Our function "*exynos5_mmc_set_clk_div()"* is same as "*clock_set_mshci()".*
> 
> Now coming to 'div' as argument .... we have the below scenarios / questions
> 1-> What is the value of 'div' to be passed from calling function ?
It will be the pre_ratio's value for FSYSx register.

> 2-> The value of 'div' needs to be computed in calling function.
It will be computed before called this function. For example, in dw_mmc.c or exynos_dw_mc.c

> 3-> As per my understanding, 'div' value depends on values of MPLL clock
> and FSYS1/2.
Right..but it will be changed the source clock. MMC/SD can use the every source clock.

> 4-> *Question:* Is it OK to put the piece of code which accesses MPLL,
> FSYS1, FSYS2 in drivers/mmc/exynos_dw_mmc.c. ?
Sure..we can use the get_mmc_clk/set_mmc_clk. then we can get source clock value.
and compute the div value for request clock.

> 5-> If we compute 'div' value in "drivers/mmc/exynos_dw_mmc.c", then
> there will be duplication of code (Read of FSYS1/2).
What code is duplication? Could you explain to me more?
Only need to compute the div value in exynos_dw_mmc.c.
why need to compute into here?

Best Regards,
Jaehoon Chung
> 
> Please comment on the above.
> 
>> +
>>  /* get_lcd_clk: return lcd clock frequency */
>>  static unsigned long exynos4_get_lcd_clk(void)
>>  {
>> diff --git a/arch/arm/include/asm/arch-exynos/clk.h
> b/arch/arm/include/asm/arch-exynos/clk.h
>> index 1935b0b..2fd7c3e 100644
>> --- a/arch/arm/include/asm/arch-exynos/clk.h
>> +++ b/arch/arm/include/asm/arch-exynos/clk.h
>> @@ -29,6 +29,9 @@
>>  #define VPLL 4
>>  #define BPLL 5
>>
>> +#define FSYS1_MMC0_DIV_MASK  0xff0f
>> +#define FSYS1_MMC0_DIV_VAL   0x0701
>> +
>>  unsigned long get_pll_clk(int pllreg);
>>  unsigned long get_arm_clk(void);
>>  unsigned long get_i2c_clk(void);
>> @@ -36,6 +39,7 @@ unsigned long get_pwm_clk(void);
>>  unsigned long get_uart_clk(int dev_index);
>>  unsigned long get_mmc_clk(int dev_index);
>>  void set_mmc_clk(int dev_index, unsigned int div);
>> +int exynos5_mmc_set_clk_div(int dev_index);
>>  unsigned long get_lcd_clk(void);
>>  void set_lcd_clk(void);
>>  void set_mipi_clk(void);
>>
> 
>  _______________________________________________
>> U-Boot mailing list
>> U-Boot at lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
>>
> 
> 
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
> 

  reply	other threads:[~2013-01-03  6:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-31 10:58 [U-Boot] [PATCH V3 0/9] EXYNOS5: Enable DWMMC, add FDT support for DWMMC and Amar
2012-12-31 10:58 ` [U-Boot] [PATCH V3 1/9] FDT: Add compatible string for DWMMC Amar
2012-12-31 12:35   ` Kyungmin Park
2012-12-31 10:58 ` [U-Boot] [PATCH V3 2/9] EXYNOS5: FDT: Add DWMMC device node data Amar
2012-12-31 10:58 ` [U-Boot] [PATCH V3 3/9] DWMMC: Initialise dwmci and resolve EMMC read write issues Amar
2013-01-02  5:12   ` Jaehoon Chung
2013-01-03  7:45     ` Amarendra Reddy
2012-12-31 10:58 ` [U-Boot] [PATCH V3 4/9] EXYNOS5: DWMMC: Added FDT support for DWMMC Amar
2013-01-02  5:20   ` Jaehoon Chung
2013-01-03  4:32     ` Amarendra Reddy
2013-01-03  6:48       ` Jaehoon Chung
2012-12-31 10:58 ` [U-Boot] [PATCH V3 5/9] EXYNOS5: DWMMC: API to set mmc clock divisor Amar
2013-01-02  3:31   ` Jaehoon Chung
2013-01-03  6:24     ` Amarendra Reddy
2013-01-03  6:45       ` Jaehoon Chung [this message]
2013-01-03 11:16         ` Amarendra Reddy
2013-01-03 14:34           ` Amarendra Reddy
2012-12-31 10:58 ` [U-Boot] [PATCH V3 6/9] SMDK5250: Initialise and Enable DWMMC, support FDT and non-FDT Amar
2012-12-31 10:58 ` [U-Boot] [PATCH V3 7/9] MMC: APIs to support resize of EMMC boot partition Amar
2012-12-31 10:58 ` [U-Boot] [PATCH V3 8/9] SMDK5250: Enable EMMC booting Amar
2012-12-31 10:58 ` [U-Boot] [PATCH V3 9/9] COMMON: MMC: Command to support EMMC booting and to Amar

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=50E52912.1010409@samsung.com \
    --to=jh80.chung@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox