diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-01-19 06:09:28 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-01-19 06:09:28 -0500 |
commit | dea3cf1c3935047a5b0d21b21d26718e09135f97 (patch) | |
tree | dc3a68c98304a54b77330d4be2a8d06fa0e09ecb /arch/sh/boards | |
parent | c8098218271d19e7123d8b9137b9a4b87e5ffec0 (diff) |
sh: urquell: Handle EXTAL configuration here, too.
urquell happens to use the same mode pins and EXTAL configuration as
SDK7786, so just copy it over.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards')
-rw-r--r-- | arch/sh/boards/board-urquell.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/arch/sh/boards/board-urquell.c b/arch/sh/boards/board-urquell.c index 268f09e46568..8aeac64810dc 100644 --- a/arch/sh/boards/board-urquell.c +++ b/arch/sh/boards/board-urquell.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * Renesas Technology Corp. SH7786 Urquell Support. | 2 | * Renesas Technology Corp. SH7786 Urquell Support. |
3 | * | 3 | * |
4 | * Copyright (C) 2008 Kuninori Morimoto <morimoto.kuninori@renesas.com> | 4 | * Copyright (C) 2008 Kuninori Morimoto <morimoto.kuninori@renesas.com> |
5 | * Copyright (C) 2009 Paul Mundt | 5 | * Copyright (C) 2009, 2010 Paul Mundt |
6 | * | 6 | * |
7 | * Based on board-sh7785lcr.c | 7 | * Based on board-sh7785lcr.c |
8 | * Copyright (C) 2008 Yoshihiro Shimoda | 8 | * Copyright (C) 2008 Yoshihiro Shimoda |
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
20 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
21 | #include <linux/irq.h> | 21 | #include <linux/irq.h> |
22 | #include <linux/clk.h> | ||
22 | #include <mach/urquell.h> | 23 | #include <mach/urquell.h> |
23 | #include <cpu/sh7786.h> | 24 | #include <cpu/sh7786.h> |
24 | #include <asm/heartbeat.h> | 25 | #include <asm/heartbeat.h> |
@@ -175,6 +176,27 @@ static int urquell_mode_pins(void) | |||
175 | return __raw_readw(UBOARDREG(MDSWMR)); | 176 | return __raw_readw(UBOARDREG(MDSWMR)); |
176 | } | 177 | } |
177 | 178 | ||
179 | static int urquell_clk_init(void) | ||
180 | { | ||
181 | struct clk *clk; | ||
182 | int ret; | ||
183 | |||
184 | /* | ||
185 | * Only handle the EXTAL case, anyone interfacing a crystal | ||
186 | * resonator will need to provide their own input clock. | ||
187 | */ | ||
188 | if (test_mode_pin(MODE_PIN9)) | ||
189 | return -EINVAL; | ||
190 | |||
191 | clk = clk_get(NULL, "extal"); | ||
192 | if (!clk || IS_ERR(clk)) | ||
193 | return PTR_ERR(clk); | ||
194 | ret = clk_set_rate(clk, 33333333); | ||
195 | clk_put(clk); | ||
196 | |||
197 | return ret; | ||
198 | } | ||
199 | |||
178 | /* Initialize the board */ | 200 | /* Initialize the board */ |
179 | static void __init urquell_setup(char **cmdline_p) | 201 | static void __init urquell_setup(char **cmdline_p) |
180 | { | 202 | { |
@@ -191,4 +213,5 @@ static struct sh_machine_vector mv_urquell __initmv = { | |||
191 | .mv_setup = urquell_setup, | 213 | .mv_setup = urquell_setup, |
192 | .mv_init_irq = urquell_init_irq, | 214 | .mv_init_irq = urquell_init_irq, |
193 | .mv_mode_pins = urquell_mode_pins, | 215 | .mv_mode_pins = urquell_mode_pins, |
216 | .mv_clk_init = urquell_clk_init, | ||
194 | }; | 217 | }; |