All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lokesh Vutla <lokeshvutla@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 10/14] ARM: AM43xx: clocks: Update DPLL details for EPOS EVM
Date: Mon, 25 Nov 2013 10:38:04 +0530	[thread overview]
Message-ID: <5292DB34.7070000@ti.com> (raw)
In-Reply-To: <CANacCWzsH9PrunqT=Lb6btsmUfdxr-VPTRrawS8qCW-iT+ZxmA@mail.gmail.com>

On Friday 22 November 2013 02:07 AM, Vaibhav Bedia wrote:
> On Thu, Nov 21, 2013 at 1:18 AM, Lokesh Vutla <lokeshvutla@ti.com> wrote:
>> Updating the Multiplier and Dividers values for all DPLLs for EPOS EVM.
>> Following are the DPLL locking frequencies at OPP NOM:
>> MPU locks at 600MHz
>> Core locks at 1000MHz
>> Per locks at 960MHz
>> DDR locks at 266MHz
>>
> 
> As mentioned earlier, this hardcoded frequency approach is really not
> scalable when you have
> more device variants coming in. Just look at the AM335x changes on how
> this gets complicated.
We already had a discussion on this during V1 of this series.
Sekhar and Tom replied to you comments. What is the point in asking the same question again?

Since you are very concerned here. Why are you feeling it so complicated when new variants come?
We can always differentiate the new variant from the old ones and can pass dpll structure accordingly. It is just a matter a one if condition.
It ll be better to look at the current code and see how cleanly it is done.

Thanks
Lokesh

> 
>> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
>> ---
>>  arch/arm/cpu/armv7/am33xx/clock.c        |   12 +++++++---
>>  arch/arm/cpu/armv7/am33xx/clock_am33xx.c |   15 ++++++++++++
>>  arch/arm/cpu/armv7/am33xx/clock_am43xx.c |    8 +------
>>  arch/arm/include/asm/arch-am33xx/clock.h |    7 +++---
>>  board/ti/am43xx/board.c                  |   38 +++++++++++++++++++++++++++---
>>  board/ti/am43xx/board.h                  |    1 +
>>  board/ti/am43xx/mux.c                    |    5 ++++
>>  7 files changed, 69 insertions(+), 17 deletions(-)
>>
>> diff --git a/arch/arm/cpu/armv7/am33xx/clock.c b/arch/arm/cpu/armv7/am33xx/clock.c
>> index 8e5f3c6..0672798 100644
>> --- a/arch/arm/cpu/armv7/am33xx/clock.c
>> +++ b/arch/arm/cpu/armv7/am33xx/clock.c
>> @@ -101,9 +101,15 @@ void do_setup_dpll(const struct dpll_regs *dpll_regs,
>>  static void setup_dplls(void)
>>  {
>>         const struct dpll_params *params;
>> -       do_setup_dpll(&dpll_core_regs, &dpll_core);
>> -       do_setup_dpll(&dpll_mpu_regs, &dpll_mpu);
>> -       do_setup_dpll(&dpll_per_regs, &dpll_per);
>> +
>> +       params = get_dpll_core_params();
>> +       do_setup_dpll(&dpll_core_regs, params);
>> +
>> +       params = get_dpll_mpu_params();
>> +       do_setup_dpll(&dpll_mpu_regs, params);
>> +
>> +       params = get_dpll_per_params();
>> +       do_setup_dpll(&dpll_per_regs, params);
>>         writel(0x300, &cmwkup->clkdcoldodpllper);
>>
>>         params = get_dpll_ddr_params();
>> diff --git a/arch/arm/cpu/armv7/am33xx/clock_am33xx.c b/arch/arm/cpu/armv7/am33xx/clock_am33xx.c
>> index fabe259..92142c8 100644
>> --- a/arch/arm/cpu/armv7/am33xx/clock_am33xx.c
>> +++ b/arch/arm/cpu/armv7/am33xx/clock_am33xx.c
>> @@ -62,6 +62,21 @@ const struct dpll_params dpll_core = {
>>  const struct dpll_params dpll_per = {
>>                 960, OSC-1, 5, -1, -1, -1, -1};
>>
>> +const struct dpll_params *get_dpll_mpu_params(void)
>> +{
>> +       return &dpll_mpu;
>> +}
>> +
>> +const struct dpll_params *get_dpll_core_params(void)
>> +{
>> +       return &dpll_core;
>> +}
>> +
>> +const struct dpll_params *get_dpll_per_params(void)
>> +{
>> +       return &dpll_per;
>> +}
>> +
>>  void setup_clocks_for_console(void)
>>  {
>>         clrsetbits_le32(&cmwkup->wkclkstctrl, CD_CLKCTRL_CLKTRCTRL_MASK,
>> diff --git a/arch/arm/cpu/armv7/am33xx/clock_am43xx.c b/arch/arm/cpu/armv7/am33xx/clock_am43xx.c
>> index 22963b7..97c00b4 100644
>> --- a/arch/arm/cpu/armv7/am33xx/clock_am43xx.c
>> +++ b/arch/arm/cpu/armv7/am33xx/clock_am43xx.c
>> @@ -48,15 +48,9 @@ const struct dpll_regs dpll_ddr_regs = {
>>         .cm_idlest_dpll         = CM_WKUP + 0x5A4,
>>         .cm_clksel_dpll         = CM_WKUP + 0x5AC,
>>         .cm_div_m2_dpll         = CM_WKUP + 0x5B0,
>> +       .cm_div_m4_dpll         = CM_WKUP + 0x5B8,
>>  };
>>
>> -const struct dpll_params dpll_mpu = {
>> -               -1, -1, -1, -1, -1, -1, -1};
>> -const struct dpll_params dpll_core = {
>> -               -1, -1, -1, -1, -1, -1, -1};
>> -const struct dpll_params dpll_per = {
>> -               -1, -1, -1, -1, -1, -1, -1};
>> -
>>  void setup_clocks_for_console(void)
>>  {
>>         /* Do not add any spl_debug prints in this function */
>> diff --git a/arch/arm/include/asm/arch-am33xx/clock.h b/arch/arm/include/asm/arch-am33xx/clock.h
>> index 519249e..7637457 100644
>> --- a/arch/arm/include/asm/arch-am33xx/clock.h
>> +++ b/arch/arm/include/asm/arch-am33xx/clock.h
>> @@ -98,13 +98,12 @@ extern const struct dpll_regs dpll_mpu_regs;
>>  extern const struct dpll_regs dpll_core_regs;
>>  extern const struct dpll_regs dpll_per_regs;
>>  extern const struct dpll_regs dpll_ddr_regs;
>> -extern const struct dpll_params dpll_mpu;
>> -extern const struct dpll_params dpll_core;
>> -extern const struct dpll_params dpll_per;
>> -extern const struct dpll_params dpll_ddr;
>>
>>  extern struct cm_wkuppll *const cmwkup;
>>
>> +const struct dpll_params *get_dpll_mpu_params(void);
>> +const struct dpll_params *get_dpll_core_params(void);
>> +const struct dpll_params *get_dpll_per_params(void);
>>  const struct dpll_params *get_dpll_ddr_params(void);
>>  void do_setup_dpll(const struct dpll_regs *, const struct dpll_params *);
>>  void prcm_init(void);
>> diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c
>> index 723d0ca..2d1b8f9 100644
>> --- a/board/ti/am43xx/board.c
>> +++ b/board/ti/am43xx/board.c
>> @@ -65,12 +65,44 @@ static int read_eeprom(struct am43xx_board_id *header)
>>
>>  #ifdef CONFIG_SPL_BUILD
>>
>> -const struct dpll_params dpll_ddr = {
>> -               -1, -1, -1, -1, -1, -1, -1};
>> +const struct dpll_params epos_evm_dpll_ddr = {
>> +               266, 24, 1, -1, 1, -1, -1};
>> +const struct dpll_params epos_evm_dpll_mpu = {
>> +               600, 24, 1, -1, -1, -1, -1};
>> +const struct dpll_params epos_evm_dpll_core = {
>> +               1000, 24, -1, -1, 10, 8, 4};
>> +const struct dpll_params epos_evm_dpll_per = {
>> +               960, 24, 5, -1, -1, -1, -1};
>>
>>  const struct dpll_params *get_dpll_ddr_params(void)
>>  {
>> -       return &dpll_ddr;
>> +       if (board_is_eposevm())
>> +               return &epos_evm_dpll_ddr;
>> +}
>> +
>> +const struct dpll_params *get_dpll_mpu_params(void)
>> +{
>> +       if (board_is_eposevm())
>> +               return &epos_evm_dpll_mpu;
>> +}
>> +
>> +const struct dpll_params *get_dpll_core_params(void)
>> +{
>> +       struct am43xx_board_id header;
>> +
>> +       enable_i2c0_pin_mux();
>> +       i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
>> +       if (read_eeprom(&header) < 0)
>> +               puts("Could not get board ID.\n");
>> +
> 
> Reading the EEPROM again? Why don't you just read it once and update some
> common structure?
> 
> Regards,
> Vaibhav
> 

  reply	other threads:[~2013-11-25  5:08 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-21  6:18 [U-Boot] [PATCH V2 00/14] ARM: AM43xx: Update support for AM4372 SoC Lokesh Vutla
2013-11-21  6:18 ` [U-Boot] [PATCH V2 01/14] ARM: AM43xx: Update the base addresses of modules Lokesh Vutla
2013-11-21 20:20   ` Vaibhav Bedia
2013-11-25  9:26     ` Lokesh Vutla
2013-11-21  6:18 ` [U-Boot] [PATCH V2 02/14] ARM: AM43xx: Adapt to ti_armv7_common.h config file Lokesh Vutla
2013-11-21  6:18 ` [U-Boot] [PATCH V2 03/14] ARM: AM43xx: Add L2 Support Lokesh Vutla
2013-11-21  6:18 ` [U-Boot] [PATCH V2 04/14] ARM: AM43xx: Add extra ENV settings Lokesh Vutla
2013-11-21  6:18 ` [U-Boot] [PATCH V2 05/14] ARM: AM43XX: board: add support for reading onboard EEPROM Lokesh Vutla
2013-11-21 20:26   ` Vaibhav Bedia
2013-11-25  4:46     ` Lokesh Vutla
2013-11-26 23:49       ` Vaibhav Bedia
2013-11-21  6:18 ` [U-Boot] [PATCH V2 06/14] ARM: AM43XX: Add CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG support Lokesh Vutla
2013-11-21 20:28   ` Vaibhav Bedia
2013-11-25  4:48     ` Lokesh Vutla
2013-11-26 23:51       ` Vaibhav Bedia
2013-11-21  6:18 ` [U-Boot] [PATCH V2 07/14] ARM: AM43xx: Select clk source for Timer2 Lokesh Vutla
2013-11-21 20:31   ` Vaibhav Bedia
2013-11-25  4:53     ` Lokesh Vutla
2013-11-26 23:56       ` Vaibhav Bedia
2013-11-21  6:18 ` [U-Boot] [PATCH V2 08/14] ARM: AM43xx: Update Current Booting devices list Lokesh Vutla
2013-11-21  6:18 ` [U-Boot] [PATCH V2 09/14] ARM: AM43xx: mux: Update mux data Lokesh Vutla
2013-11-21 20:34   ` Vaibhav Bedia
2013-11-25  4:59     ` Lokesh Vutla
2013-11-26 23:58       ` Vaibhav Bedia
2013-11-21  6:18 ` [U-Boot] [PATCH V2 10/14] ARM: AM43xx: clocks: Update DPLL details for EPOS EVM Lokesh Vutla
2013-11-21 20:37   ` Vaibhav Bedia
2013-11-25  5:08     ` Lokesh Vutla [this message]
2013-11-27  0:06       ` Vaibhav Bedia
2013-11-27  6:58         ` Lokesh Vutla
2013-11-27 22:48           ` Vaibhav Bedia
2013-12-02  3:53             ` Lokesh Vutla
2013-12-04  3:20               ` Vaibhav Bedia
2013-12-04 17:39                 ` Sekhar Nori
2013-11-21  6:18 ` [U-Boot] [PATCH V2 11/14] ARM: AM43xx: clocks: Add DPLL data for GP EVM Lokesh Vutla
2013-11-21  6:18 ` [U-Boot] [PATCH V2 12/14] ARM: AM43xx: EPOS_EVM: Add support for LPDDR2 Lokesh Vutla
2013-11-21 20:46   ` Vaibhav Bedia
2013-11-25  5:13     ` Lokesh Vutla
2013-11-27  0:12       ` Vaibhav Bedia
2013-11-27  4:48         ` Lokesh Vutla
2013-11-21  6:18 ` [U-Boot] [PATCH V2 13/14] ARM: AM43xx: GP_EVM: Add support for DDR3 Lokesh Vutla
2013-11-21 20:52   ` Vaibhav Bedia
2013-11-25  5:18     ` Lokesh Vutla
2013-11-27  0:17       ` Vaibhav Bedia
2013-11-27  9:34         ` Lokesh Vutla
2013-11-27 23:03           ` Vaibhav Bedia
2013-12-02  4:21             ` Lokesh Vutla
2013-12-04  3:24               ` Vaibhav Bedia
2013-11-21  6:18 ` [U-Boot] [PATCH V2 14/14] ARM: AM43xx: Add Maintainer Lokesh Vutla

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=5292DB34.7070000@ti.com \
    --to=lokeshvutla@ti.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.