aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@linux-m68k.org>2014-02-04 10:24:00 -0500
committerSimon Horman <horms+renesas@verge.net.au>2014-02-23 18:54:42 -0500
commitd2eec3d5251216942e1d425300686f1a18bc615d (patch)
tree70b845160161efe0bbde8927235cb94b3e5da233 /arch
parent3fc3e908d25ad04de1a01b3f659ecabefcca74c5 (diff)
ARM: shmobile: r8a7791 clock: add QSPI clocks
The QSPI clock divider value depends on the MD1, MD2, and MD3 mode switches. Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Magnus Damm <damm@opensource.se> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7791.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/clock-r8a7791.c b/arch/arm/mach-shmobile/clock-r8a7791.c
index e4e4dfac85e9..c8227b334e61 100644
--- a/arch/arm/mach-shmobile/clock-r8a7791.c
+++ b/arch/arm/mach-shmobile/clock-r8a7791.c
@@ -101,6 +101,7 @@ static struct clk main_clk = {
101 */ 101 */
102SH_FIXED_RATIO_CLK_SET(pll1_clk, main_clk, 1, 1); 102SH_FIXED_RATIO_CLK_SET(pll1_clk, main_clk, 1, 1);
103SH_FIXED_RATIO_CLK_SET(pll3_clk, main_clk, 1, 1); 103SH_FIXED_RATIO_CLK_SET(pll3_clk, main_clk, 1, 1);
104SH_FIXED_RATIO_CLK_SET(qspi_clk, pll1_clk, 1, 1);
104 105
105/* fixed ratio clock */ 106/* fixed ratio clock */
106SH_FIXED_RATIO_CLK_SET(extal_div2_clk, extal_clk, 1, 2); 107SH_FIXED_RATIO_CLK_SET(extal_div2_clk, extal_clk, 1, 2);
@@ -124,6 +125,7 @@ static struct clk *main_clks[] = {
124 &pll3_clk, 125 &pll3_clk,
125 &hp_clk, 126 &hp_clk,
126 &p_clk, 127 &p_clk,
128 &qspi_clk,
127 &rclk_clk, 129 &rclk_clk,
128 &mp_clk, 130 &mp_clk,
129 &cp_clk, 131 &cp_clk,
@@ -135,6 +137,7 @@ static struct clk *main_clks[] = {
135/* MSTP */ 137/* MSTP */
136enum { 138enum {
137 MSTP931, MSTP930, MSTP929, MSTP928, MSTP927, MSTP925, 139 MSTP931, MSTP930, MSTP929, MSTP928, MSTP927, MSTP925,
140 MSTP917,
138 MSTP815, MSTP814, 141 MSTP815, MSTP814,
139 MSTP813, 142 MSTP813,
140 MSTP811, MSTP810, MSTP809, 143 MSTP811, MSTP810, MSTP809,
@@ -154,6 +157,7 @@ static struct clk mstp_clks[MSTP_NR] = {
154 [MSTP928] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 28, MSTPSR9, 0), /* I2C3 */ 157 [MSTP928] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 28, MSTPSR9, 0), /* I2C3 */
155 [MSTP927] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 27, MSTPSR9, 0), /* I2C4 */ 158 [MSTP927] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 27, MSTPSR9, 0), /* I2C4 */
156 [MSTP925] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 25, MSTPSR9, 0), /* I2C5 */ 159 [MSTP925] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 25, MSTPSR9, 0), /* I2C5 */
160 [MSTP917] = SH_CLK_MSTP32_STS(&qspi_clk, SMSTPCR9, 17, MSTPSR9, 0), /* QSPI */
157 [MSTP815] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 15, MSTPSR8, 0), /* SATA0 */ 161 [MSTP815] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 15, MSTPSR8, 0), /* SATA0 */
158 [MSTP814] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 14, MSTPSR8, 0), /* SATA1 */ 162 [MSTP814] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 14, MSTPSR8, 0), /* SATA1 */
159 [MSTP813] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR8, 13, MSTPSR8, 0), /* Ether */ 163 [MSTP813] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR8, 13, MSTPSR8, 0), /* Ether */
@@ -195,6 +199,7 @@ static struct clk_lookup lookups[] = {
195 CLKDEV_CON_ID("zs", &zs_clk), 199 CLKDEV_CON_ID("zs", &zs_clk),
196 CLKDEV_CON_ID("hp", &hp_clk), 200 CLKDEV_CON_ID("hp", &hp_clk),
197 CLKDEV_CON_ID("p", &p_clk), 201 CLKDEV_CON_ID("p", &p_clk),
202 CLKDEV_CON_ID("qspi", &qspi_clk),
198 CLKDEV_CON_ID("rclk", &rclk_clk), 203 CLKDEV_CON_ID("rclk", &rclk_clk),
199 CLKDEV_CON_ID("mp", &mp_clk), 204 CLKDEV_CON_ID("mp", &mp_clk),
200 CLKDEV_CON_ID("cp", &cp_clk), 205 CLKDEV_CON_ID("cp", &cp_clk),
@@ -220,6 +225,7 @@ static struct clk_lookup lookups[] = {
220 CLKDEV_DEV_ID("sh-sci.13", &mstp_clks[MSTP1106]), /* SCIFA4 */ 225 CLKDEV_DEV_ID("sh-sci.13", &mstp_clks[MSTP1106]), /* SCIFA4 */
221 CLKDEV_DEV_ID("sh-sci.14", &mstp_clks[MSTP1107]), /* SCIFA5 */ 226 CLKDEV_DEV_ID("sh-sci.14", &mstp_clks[MSTP1107]), /* SCIFA5 */
222 CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]), 227 CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]),
228 CLKDEV_DEV_ID("qspi.0", &mstp_clks[MSTP917]),
223 CLKDEV_DEV_ID("e61f0000.thermal", &mstp_clks[MSTP522]), 229 CLKDEV_DEV_ID("e61f0000.thermal", &mstp_clks[MSTP522]),
224 CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]), 230 CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]),
225 CLKDEV_DEV_ID("i2c-rcar_gen2.0", &mstp_clks[MSTP931]), 231 CLKDEV_DEV_ID("i2c-rcar_gen2.0", &mstp_clks[MSTP931]),
@@ -271,6 +277,11 @@ void __init r8a7791_clock_init(void)
271 break; 277 break;
272 } 278 }
273 279
280 if ((mode & (MD(3) | MD(2) | MD(1))) == MD(2))
281 SH_CLK_SET_RATIO(&qspi_clk_ratio, 1, 16);
282 else
283 SH_CLK_SET_RATIO(&qspi_clk_ratio, 1, 20);
284
274 for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++) 285 for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
275 ret = clk_register(main_clks[k]); 286 ret = clk_register(main_clks[k]);
276 287