All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomasz Figa <t.figa@samsung.com>
To: Thomas Abraham <thomas.abraham@linaro.org>
Cc: Tomasz Figa <tomasz.figa@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org, mturquette@ti.com,
	mturquette@linaro.org, kgene.kim@samsung.com,
	sylvester.nawrocki@gmail.com
Subject: Re: [PATCH v3 04/11] ARM: Exynos4: Migrate clock support to common clock framework
Date: Thu, 15 Nov 2012 11:42:05 +0100	[thread overview]
Message-ID: <3127900.LhP4Lj0re4@amdc1227> (raw)
In-Reply-To: <CAJuYYwQaPXueu6aVoaNQE3BD1gVRRh2pC0LWfjVC71M7QHMYDQ@mail.gmail.com>

On Thursday 15 of November 2012 14:43:21 Thomas Abraham wrote:
> On 15 November 2012 05:01, Tomasz Figa <tomasz.figa@gmail.com> wrote:
> > On Thursday 15 of November 2012 03:37:26 Thomas Abraham wrote:
> >> Remove Samsung specific clock support in Exynos4 and migrate to use
> >> common clock framework.
> >> 
> >> Cc: Kukjin Kim <kgene.kim@samsung.com>
> >> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> >> ---
> >> 
> >>  arch/arm/mach-exynos/Kconfig               |    1 +
> >>  arch/arm/mach-exynos/Makefile              |    3 -
> >>  arch/arm/mach-exynos/clock-exynos4.c       | 1602
> >> 
> >> ---------------------------- arch/arm/mach-exynos/clock-exynos4.h
> >> 
> >> |   35 -
> >>  
> >>  arch/arm/mach-exynos/clock-exynos4210.c    |  188 ----
> >>  arch/arm/mach-exynos/clock-exynos4212.c    |  192 ----
> >>  arch/arm/mach-exynos/common.c              |   22 +-
> >>  arch/arm/mach-exynos/common.h              |    3 +
> >>  arch/arm/mach-exynos/mach-armlex4210.c     |    1 -
> >>  arch/arm/mach-exynos/mach-exynos4-dt.c     |    1 -
> >>  arch/arm/mach-exynos/mach-nuri.c           |    1 -
> >>  arch/arm/mach-exynos/mach-origen.c         |    1 -
> >>  arch/arm/mach-exynos/mach-smdk4x12.c       |    1 -
> >>  arch/arm/mach-exynos/mach-smdkv310.c       |    1 -
> >>  arch/arm/mach-exynos/mach-universal_c210.c |    1 -
> >>  arch/arm/mach-exynos/mct.c                 |   19 +
> >>  arch/arm/plat-samsung/Kconfig              |    4 +-
> >>  17 files changed, 27 insertions(+), 2049 deletions(-)
> >>  delete mode 100644 arch/arm/mach-exynos/clock-exynos4.c
> >>  delete mode 100644 arch/arm/mach-exynos/clock-exynos4.h
> >>  delete mode 100644 arch/arm/mach-exynos/clock-exynos4210.c
> >>  delete mode 100644 arch/arm/mach-exynos/clock-exynos4212.c
> > 
> > [snip]
> > 
> >> diff --git a/arch/arm/mach-exynos/mct.c b/arch/arm/mach-exynos/mct.c
> >> index f7792b8..c2e806c 100644
> >> --- a/arch/arm/mach-exynos/mct.c
> >> +++ b/arch/arm/mach-exynos/mct.c
> >> @@ -31,6 +31,7 @@
> >> 
> >>  #include <mach/map.h>
> >>  #include <mach/irqs.h>
> >>  #include <asm/mach/time.h>
> >> 
> >> +#include "common.h"
> >> 
> >>  #define EXYNOS4_MCTREG(x)            (x)
> >>  #define EXYNOS4_MCT_G_CNT_L          EXYNOS4_MCTREG(0x100)
> >> 
> >> @@ -517,6 +518,24 @@ static void __init exynos4_timer_init(void)
> >> 
> >>       struct device_node *np;
> >>       u32 nr_irqs, i;
> >> 
> >> +#ifdef CONFIG_COMMON_CLK
> >> +     /*
> >> +      * Clock lookup should be functional now since the MCT
> >> controller
> >> driver +       * looks up clocks. So the clock initialization is
> >> initiated here. +        */
> >> +     if (of_have_populated_dt()) {
> >> +             if (of_machine_is_compatible("samsung,exynos4210") ||
> >> +                      of_machine_is_compatible("samsung,exynos4212")
> >> || +                     
> >> of_machine_is_compatible("samsung,exynos4412")) +                   
> >>  exynos4_clk_init();
> >> +     } else {
> >> +             if (soc_is_exynos4210() || soc_is_exynos4212() ||
> >> +                             soc_is_exynos4412()) {
> >> +                     exynos4_clk_init();
> >> +             }
> >> +     }
> >> +#endif
> >> +
> > 
> > I don't like the idea of initializing the clocks from timer
> > initialization. What about some platforms where MCT isn't used? It is
> > also far from being elegant.
> 
> Very true, I did also prefer not do this. But, clock lookup should be
> functional atleast by the time mct initialization begins. So I tried
> few options such as adding .early_init_call callback in MACHINE_DESC
> which then can call exynos4_clk_init, but that did not help since
> mem_init isn't complete by then and memory allocation failed during
> clock registration. Other methods also did not help much. If you know
> of a solution to get around this, could you please let me know.

This is somehow similar to the problem with mapping SYSRAM_NS for Exynos 
secure firmware. Currently it must be mapped statically using io_table, 
because ioremap does not work early enough. I guess this kind of approach 
might be also enough for clocks, until io mem mapping becomes accessible 
early enough, but someone else should also comment this.

Best regards,
-- 
Tomasz Figa
Samsung Poland R&D Center
SW Solution Development, Linux Platform

WARNING: multiple messages have this Message-ID (diff)
From: t.figa@samsung.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 04/11] ARM: Exynos4: Migrate clock support to common clock framework
Date: Thu, 15 Nov 2012 11:42:05 +0100	[thread overview]
Message-ID: <3127900.LhP4Lj0re4@amdc1227> (raw)
In-Reply-To: <CAJuYYwQaPXueu6aVoaNQE3BD1gVRRh2pC0LWfjVC71M7QHMYDQ@mail.gmail.com>

On Thursday 15 of November 2012 14:43:21 Thomas Abraham wrote:
> On 15 November 2012 05:01, Tomasz Figa <tomasz.figa@gmail.com> wrote:
> > On Thursday 15 of November 2012 03:37:26 Thomas Abraham wrote:
> >> Remove Samsung specific clock support in Exynos4 and migrate to use
> >> common clock framework.
> >> 
> >> Cc: Kukjin Kim <kgene.kim@samsung.com>
> >> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> >> ---
> >> 
> >>  arch/arm/mach-exynos/Kconfig               |    1 +
> >>  arch/arm/mach-exynos/Makefile              |    3 -
> >>  arch/arm/mach-exynos/clock-exynos4.c       | 1602
> >> 
> >> ---------------------------- arch/arm/mach-exynos/clock-exynos4.h
> >> 
> >> |   35 -
> >>  
> >>  arch/arm/mach-exynos/clock-exynos4210.c    |  188 ----
> >>  arch/arm/mach-exynos/clock-exynos4212.c    |  192 ----
> >>  arch/arm/mach-exynos/common.c              |   22 +-
> >>  arch/arm/mach-exynos/common.h              |    3 +
> >>  arch/arm/mach-exynos/mach-armlex4210.c     |    1 -
> >>  arch/arm/mach-exynos/mach-exynos4-dt.c     |    1 -
> >>  arch/arm/mach-exynos/mach-nuri.c           |    1 -
> >>  arch/arm/mach-exynos/mach-origen.c         |    1 -
> >>  arch/arm/mach-exynos/mach-smdk4x12.c       |    1 -
> >>  arch/arm/mach-exynos/mach-smdkv310.c       |    1 -
> >>  arch/arm/mach-exynos/mach-universal_c210.c |    1 -
> >>  arch/arm/mach-exynos/mct.c                 |   19 +
> >>  arch/arm/plat-samsung/Kconfig              |    4 +-
> >>  17 files changed, 27 insertions(+), 2049 deletions(-)
> >>  delete mode 100644 arch/arm/mach-exynos/clock-exynos4.c
> >>  delete mode 100644 arch/arm/mach-exynos/clock-exynos4.h
> >>  delete mode 100644 arch/arm/mach-exynos/clock-exynos4210.c
> >>  delete mode 100644 arch/arm/mach-exynos/clock-exynos4212.c
> > 
> > [snip]
> > 
> >> diff --git a/arch/arm/mach-exynos/mct.c b/arch/arm/mach-exynos/mct.c
> >> index f7792b8..c2e806c 100644
> >> --- a/arch/arm/mach-exynos/mct.c
> >> +++ b/arch/arm/mach-exynos/mct.c
> >> @@ -31,6 +31,7 @@
> >> 
> >>  #include <mach/map.h>
> >>  #include <mach/irqs.h>
> >>  #include <asm/mach/time.h>
> >> 
> >> +#include "common.h"
> >> 
> >>  #define EXYNOS4_MCTREG(x)            (x)
> >>  #define EXYNOS4_MCT_G_CNT_L          EXYNOS4_MCTREG(0x100)
> >> 
> >> @@ -517,6 +518,24 @@ static void __init exynos4_timer_init(void)
> >> 
> >>       struct device_node *np;
> >>       u32 nr_irqs, i;
> >> 
> >> +#ifdef CONFIG_COMMON_CLK
> >> +     /*
> >> +      * Clock lookup should be functional now since the MCT
> >> controller
> >> driver +       * looks up clocks. So the clock initialization is
> >> initiated here. +        */
> >> +     if (of_have_populated_dt()) {
> >> +             if (of_machine_is_compatible("samsung,exynos4210") ||
> >> +                      of_machine_is_compatible("samsung,exynos4212")
> >> || +                     
> >> of_machine_is_compatible("samsung,exynos4412")) +                   
> >>  exynos4_clk_init();
> >> +     } else {
> >> +             if (soc_is_exynos4210() || soc_is_exynos4212() ||
> >> +                             soc_is_exynos4412()) {
> >> +                     exynos4_clk_init();
> >> +             }
> >> +     }
> >> +#endif
> >> +
> > 
> > I don't like the idea of initializing the clocks from timer
> > initialization. What about some platforms where MCT isn't used? It is
> > also far from being elegant.
> 
> Very true, I did also prefer not do this. But, clock lookup should be
> functional atleast by the time mct initialization begins. So I tried
> few options such as adding .early_init_call callback in MACHINE_DESC
> which then can call exynos4_clk_init, but that did not help since
> mem_init isn't complete by then and memory allocation failed during
> clock registration. Other methods also did not help much. If you know
> of a solution to get around this, could you please let me know.

This is somehow similar to the problem with mapping SYSRAM_NS for Exynos 
secure firmware. Currently it must be mapped statically using io_table, 
because ioremap does not work early enough. I guess this kind of approach 
might be also enough for clocks, until io mem mapping becomes accessible 
early enough, but someone else should also comment this.

Best regards,
-- 
Tomasz Figa
Samsung Poland R&D Center
SW Solution Development, Linux Platform

  reply	other threads:[~2012-11-15 10:42 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-14 22:07 [PATCH v3 00/11] clk: exynos4: migrate to common clock framework Thomas Abraham
2012-11-14 22:07 ` Thomas Abraham
2012-11-14 22:07 ` [PATCH v3 01/11] clk: samsung: add common clock framework helper functions for Samsung platforms Thomas Abraham
2012-11-14 22:07   ` Thomas Abraham
2012-11-14 23:12   ` Tomasz Figa
2012-11-14 23:12     ` Tomasz Figa
2012-11-15  8:33     ` Thomas Abraham
2012-11-15  8:33       ` Thomas Abraham
2012-11-15 10:25       ` Tomasz Figa
2012-11-15 10:25         ` Tomasz Figa
2012-11-14 22:07 ` [PATCH v3 02/11] clk: samsung: add pll clock registration helper functions Thomas Abraham
2012-11-14 22:07   ` Thomas Abraham
2012-11-14 22:07 ` [PATCH v3 03/11] clk: exynos4: register clocks using common clock framework Thomas Abraham
2012-11-14 22:07   ` Thomas Abraham
2012-11-14 23:24   ` Tomasz Figa
2012-11-14 23:24     ` Tomasz Figa
2012-11-15  8:38     ` Thomas Abraham
2012-11-15  8:38       ` Thomas Abraham
2012-11-14 22:07 ` [PATCH v3 04/11] ARM: Exynos4: Migrate clock support to " Thomas Abraham
2012-11-14 22:07   ` Thomas Abraham
2012-11-14 23:31   ` Tomasz Figa
2012-11-14 23:31     ` Tomasz Figa
2012-11-15  9:13     ` Thomas Abraham
2012-11-15  9:13       ` Thomas Abraham
2012-11-15 10:42       ` Tomasz Figa [this message]
2012-11-15 10:42         ` Tomasz Figa
2012-11-14 22:07 ` [PATCH v3 05/11] ARM: dts: add exynos4 clock controller nodes Thomas Abraham
2012-11-14 22:07   ` Thomas Abraham
2012-11-14 23:27   ` Tomasz Figa
2012-11-14 23:27     ` Tomasz Figa
2012-11-15  8:58     ` Thomas Abraham
2012-11-15  8:58       ` Thomas Abraham
2012-11-14 22:07 ` [PATCH v3 06/11] ARM: dts: add xxti and xusbxti fixed rate clock nodes for exynos4 based platforms Thomas Abraham
2012-11-14 22:07   ` Thomas Abraham
2012-11-14 22:07 ` [PATCH v3 07/11] ARM: Exynos4: allow legacy board support to specify xxti and xusbxti clock speed Thomas Abraham
2012-11-14 22:07   ` Thomas Abraham
2012-11-14 23:36   ` Tomasz Figa
2012-11-14 23:36     ` Tomasz Figa
2012-11-15  9:27     ` Thomas Abraham
2012-11-15  9:27       ` Thomas Abraham
2012-11-14 22:07 ` [PATCH v3 08/11] ARM: dts: add clock provider information for all controllers in Exynos4 SoC Thomas Abraham
2012-11-14 22:07   ` Thomas Abraham
2012-11-14 22:07 ` [PATCH v3 09/11] ARM: Exynos4: remove auxdata table from machine file Thomas Abraham
2012-11-14 22:07   ` Thomas Abraham
2012-11-14 22:07 ` [PATCH v3 10/11] ARM: Exynos: use fin_pll clock as the tick clock source for mct Thomas Abraham
2012-11-14 22:07   ` Thomas Abraham
2012-11-14 22:07 ` [PATCH v3 11/11] ARM: Exynos: add support for mct clock setup Thomas Abraham
2012-11-14 22:07   ` Thomas Abraham

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=3127900.LhP4Lj0re4@amdc1227 \
    --to=t.figa@samsung.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mturquette@linaro.org \
    --cc=mturquette@ti.com \
    --cc=sylvester.nawrocki@gmail.com \
    --cc=thomas.abraham@linaro.org \
    --cc=tomasz.figa@gmail.com \
    /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.