diff mbox

[U-Boot,1/9] i.MX25: esdhc: Add mxc_get_clock infrastructure

Message ID 1334735852-23415-2-git-send-email-timo@exertus.fi
State Accepted
Headers show

Commit Message

Timo Ketola April 18, 2012, 7:57 a.m. UTC
Defining CONFIG_FSL_ESDHC brings in a call to get_clocks, so let's implement get_clocks function. This is how it seems to be implemented elsewhere.

Signed-off-by: Timo Ketola <timo@exertus.fi>
---
 arch/arm/cpu/arm926ejs/mx25/generic.c  |   27 +++++++++++++++++++++++++++
 arch/arm/include/asm/arch-mx25/clock.h |   23 +++++++++++++++++++++++
 2 files changed, 50 insertions(+), 0 deletions(-)

Comments

Wolfgang Denk April 18, 2012, 9:23 a.m. UTC | #1
Dear "Timo Ketola",

In message <1334735852-23415-2-git-send-email-timo@exertus.fi> you wrote:
> Defining CONFIG_FSL_ESDHC brings in a call to get_clocks, so let's implement get_clocks function. This is how it seems to be implemented elsewhere.
> 
> Signed-off-by: Timo Ketola <timo@exertus.fi>
> ---
>  arch/arm/cpu/arm926ejs/mx25/generic.c  |   27 +++++++++++++++++++++++++++
>  arch/arm/include/asm/arch-mx25/clock.h |   23 +++++++++++++++++++++++
>  2 files changed, 50 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm926ejs/mx25/generic.c b/arch/arm/cpu/arm926ejs/mx25/generic.c
...

I understand this is a (eventually modified ?) reposting of patches
you posted before.  in this case it is mandatory not only to mark this
in the Subject, but also to provide a detailled change log (below the
"---" line); see
http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions


I'm not going to try to find out which review comments you have
included, and what you changed to do so; sorry, but I don;t have that
much time.

Please consider the whole patch series ignored.

Best regards,

Wolfgang Denk
Timo Ketola April 18, 2012, 10:42 a.m. UTC | #2
On 18.04.2012 12:23, Wolfgang Denk wrote:
> Dear "Timo Ketola",
>
> In message<1334735852-23415-2-git-send-email-timo@exertus.fi>  you wrote:
>> Defining CONFIG_FSL_ESDHC brings in a call to get_clocks, so let's
>> implement get_clocks function. This is how it seems to be implemented
>> elsewhere. ...
> ...
>
> I understand this is a (eventually modified ?) reposting of patches you
> posted before.

Yes

> in this case it is mandatory not only to mark this in the Subject,

Ok, how to do that I learned just now.

> but also to provide a detailled change log (below the "---" line); see
> http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions

I tried to provide that in the 0/x message but do you mean that I should 
provide it separately for every single patch? I see that your reference asks 
just that.

I was in impression that 'git send-email' (alone) would do the right thing but
it doesn't give me opportunity to edit actual patch messages, only the cover
letter. And I saw many examples of people putting the log in the cover letter.
So how do people do that? 'git format-patch' then manually edit patch files,
then send them with 'git send-email'?

> I'm not going to try to find out which review comments you have included,
> and what you changed to do so; sorry, but I don;t have that much time.

So do I have to reference review comments somehow?

> Please consider the whole patch series ignored.

Ok

--

Timo
diff mbox

Patch

diff --git a/arch/arm/cpu/arm926ejs/mx25/generic.c b/arch/arm/cpu/arm926ejs/mx25/generic.c
index 9cadb7c..8b07dae 100644
--- a/arch/arm/cpu/arm926ejs/mx25/generic.c
+++ b/arch/arm/cpu/arm926ejs/mx25/generic.c
@@ -28,10 +28,15 @@ 
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/imx25-pinmux.h>
+#include <asm/arch/clock.h>
 #ifdef CONFIG_MXC_MMC
 #include <asm/arch/mxcmmc.h>
 #endif
 
+#ifdef CONFIG_FSL_ESDHC
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 /*
  *  get the system pll clock in Hz
  *
@@ -105,6 +110,20 @@  ulong imx_get_perclk(int clk)
 	return lldiv(fref, div);
 }
 
+unsigned int mxc_get_clock(enum mxc_clock clk)
+{
+	if (clk >= MXC_CLK_NUM)
+		return -1;
+	switch (clk) {
+	case MXC_ARM_CLK:
+		return imx_get_armclk();
+	case MXC_FEC_CLK:
+		return imx_get_ahbclk();
+	default:
+		return imx_get_perclk(clk);
+	}
+}
+
 u32 get_cpu_rev(void)
 {
 	u32 srev;
@@ -182,6 +201,14 @@  int cpu_eth_init(bd_t *bis)
 #endif
 }
 
+int get_clocks(void)
+{
+#ifdef CONFIG_FSL_ESDHC
+	gd->sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
+#endif
+	return 0;
+}
+
 /*
  * Initializes on-chip MMC controllers.
  * to override, implement board_mmc_init()
diff --git a/arch/arm/include/asm/arch-mx25/clock.h b/arch/arm/include/asm/arch-mx25/clock.h
index c59f588..0f47eaf 100644
--- a/arch/arm/include/asm/arch-mx25/clock.h
+++ b/arch/arm/include/asm/arch-mx25/clock.h
@@ -26,11 +26,34 @@ 
 #ifndef __ASM_ARCH_CLOCK_H
 #define __ASM_ARCH_CLOCK_H
 
+enum mxc_clock {
+	MXC_CSI_CLK,
+	MXC_EPIT_CLK,
+	MXC_ESAI_CLK,
+	MXC_ESDHC1_CLK,
+	MXC_ESDHC2_CLK,
+	MXC_GPT_CLK,
+	MXC_I2C_CLK,
+	MXC_LCDC_CLK,
+	MXC_NFC_CLK,
+	MXC_OWIRE_CLK,
+	MXC_PWM_CLK,
+	MXC_SIM1_CLK,
+	MXC_SIM2_CLK,
+	MXC_SSI1_CLK,
+	MXC_SSI2_CLK,
+	MXC_UART_CLK,
+	MXC_ARM_CLK,
+	MXC_FEC_CLK,
+	MXC_CLK_NUM
+};
+
 ulong imx_get_perclk(int clk);
 ulong imx_get_ahbclk(void);
 
 #define imx_get_uartclk() imx_get_perclk(15)
 #define imx_get_fecclk() (imx_get_ahbclk()/2)
 
+unsigned int mxc_get_clock(enum mxc_clock clk);
 
 #endif /* __ASM_ARCH_CLOCK_H */