* [PATCH 3/4 v2] ARM: shmobile: r8a7790: add div4 clocks
@ 2013-04-12 7:42 Kuninori Morimoto
2013-04-16 6:19 ` Simon Horman
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Kuninori Morimoto @ 2013-04-12 7:42 UTC (permalink / raw)
To: linux-sh
DIV4 clocks control SD* core clocks.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2
- no change
arch/arm/mach-shmobile/clock-r8a7790.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
index 850e47f..c85e643 100644
--- a/arch/arm/mach-shmobile/clock-r8a7790.c
+++ b/arch/arm/mach-shmobile/clock-r8a7790.c
@@ -51,6 +51,7 @@
#define SMSTPCR7 0xe615014c
#define MODEMR 0xE6160060
+#define SDCKCR 0xE6150074
static struct clk_mapping cpg_mapping = {
.phys = CPG_BASE,
@@ -131,6 +132,29 @@ static struct clk *main_clks[] = {
&cp_clk,
};
+/* SDHI (DIV4) clock */
+static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18, 24, 0, 36, 48, 10 };
+
+static struct clk_div_mult_table div4_div_mult_table = {
+ .divisors = divisors,
+ .nr_divisors = ARRAY_SIZE(divisors),
+};
+
+static struct clk_div4_table div4_table = {
+ .div_mult_table = &div4_div_mult_table,
+};
+
+enum {
+ DIV4_SDH, DIV4_SD0, DIV4_SD1, DIV4_NR
+};
+
+struct clk div4_clks[DIV4_NR] = {
+ [DIV4_SDH] = SH_CLK_DIV4(&pll1_clk, SDCKCR, 8, 0x0dff, CLK_ENABLE_ON_INIT),
+ [DIV4_SD0] = SH_CLK_DIV4(&pll1_clk, SDCKCR, 4, 0x1de0, CLK_ENABLE_ON_INIT),
+ [DIV4_SD1] = SH_CLK_DIV4(&pll1_clk, SDCKCR, 0, 0x1de0, CLK_ENABLE_ON_INIT),
+};
+
+/* MSTP */
enum { MSTP721, MSTP720,
MSTP216, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP_NR };
static struct clk mstp_clks[MSTP_NR] = {
@@ -173,6 +197,11 @@ static struct clk_lookup lookups[] = {
CLKDEV_CON_ID("qspi", &qspi_clk),
CLKDEV_CON_ID("cp", &cp_clk),
+ /* DIV4 */
+ CLKDEV_CON_ID("sdh", &div4_clks[DIV4_SDH]),
+ CLKDEV_CON_ID("sd0", &div4_clks[DIV4_SD0]),
+ CLKDEV_CON_ID("sd1", &div4_clks[DIV4_SD1]),
+
/* MSTP */
CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]),
CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]),
@@ -233,6 +262,9 @@ void __init r8a7790_clock_init(void)
ret = clk_register(main_clks[k]);
if (!ret)
+ ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
+
+ if (!ret)
ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
clkdev_add_table(lookups, ARRAY_SIZE(lookups));
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 3/4 v2] ARM: shmobile: r8a7790: add div4 clocks
2013-04-12 7:42 [PATCH 3/4 v2] ARM: shmobile: r8a7790: add div4 clocks Kuninori Morimoto
@ 2013-04-16 6:19 ` Simon Horman
2015-01-21 4:27 ` [PATCH 3/4 v2] ARM: shmobile: r8a7790: add SDHI DMA channels on DTSI Kuninori Morimoto
2015-01-21 10:12 ` Geert Uytterhoeven
2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2013-04-16 6:19 UTC (permalink / raw)
To: linux-sh
On Fri, Apr 12, 2013 at 12:42:52AM -0700, Kuninori Morimoto wrote:
> DIV4 clocks control SD* core clocks.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thanks, queued-up for v3.11 in the soc-r8a7790 branch.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 3/4 v2] ARM: shmobile: r8a7790: add SDHI DMA channels on DTSI
2013-04-12 7:42 [PATCH 3/4 v2] ARM: shmobile: r8a7790: add div4 clocks Kuninori Morimoto
2013-04-16 6:19 ` Simon Horman
@ 2015-01-21 4:27 ` Kuninori Morimoto
2015-01-21 10:12 ` Geert Uytterhoeven
2 siblings, 0 replies; 4+ messages in thread
From: Kuninori Morimoto @ 2015-01-21 4:27 UTC (permalink / raw)
To: linux-sh
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2
- no change
arch/arm/boot/dts/r8a7790.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 0010600..56847bf 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -496,6 +496,8 @@
reg = <0 0xee100000 0 0x328>;
interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&mstp3_clks R8A7790_CLK_SDHI0>;
+ dmas = <&dmac1 0xcd>, <&dmac1 0xce>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -504,6 +506,8 @@
reg = <0 0xee120000 0 0x328>;
interrupts = <0 166 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&mstp3_clks R8A7790_CLK_SDHI1>;
+ dmas = <&dmac1 0xc9>, <&dmac1 0xca>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -512,6 +516,8 @@
reg = <0 0xee140000 0 0x100>;
interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&mstp3_clks R8A7790_CLK_SDHI2>;
+ dmas = <&dmac1 0xc1>, <&dmac1 0xc2>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -520,6 +526,8 @@
reg = <0 0xee160000 0 0x100>;
interrupts = <0 168 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&mstp3_clks R8A7790_CLK_SDHI3>;
+ dmas = <&dmac1 0xd3>, <&dmac1 0xd4>;
+ dma-names = "tx", "rx";
status = "disabled";
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 3/4 v2] ARM: shmobile: r8a7790: add SDHI DMA channels on DTSI
2013-04-12 7:42 [PATCH 3/4 v2] ARM: shmobile: r8a7790: add div4 clocks Kuninori Morimoto
2013-04-16 6:19 ` Simon Horman
2015-01-21 4:27 ` [PATCH 3/4 v2] ARM: shmobile: r8a7790: add SDHI DMA channels on DTSI Kuninori Morimoto
@ 2015-01-21 10:12 ` Geert Uytterhoeven
2 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2015-01-21 10:12 UTC (permalink / raw)
To: linux-sh
On Wed, Jan 21, 2015 at 5:27 AM, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-01-21 10:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-12 7:42 [PATCH 3/4 v2] ARM: shmobile: r8a7790: add div4 clocks Kuninori Morimoto
2013-04-16 6:19 ` Simon Horman
2015-01-21 4:27 ` [PATCH 3/4 v2] ARM: shmobile: r8a7790: add SDHI DMA channels on DTSI Kuninori Morimoto
2015-01-21 10:12 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).