diff options
Diffstat (limited to 'arch/sh/boards/board-sh7785lcr.c')
-rw-r--r-- | arch/sh/boards/board-sh7785lcr.c | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/arch/sh/boards/board-sh7785lcr.c b/arch/sh/boards/board-sh7785lcr.c index 6f94f17adc46..7be56fb06c1f 100644 --- a/arch/sh/boards/board-sh7785lcr.c +++ b/arch/sh/boards/board-sh7785lcr.c | |||
@@ -2,12 +2,12 @@ | |||
2 | * Renesas Technology Corp. R0P7785LC0011RL Support. | 2 | * Renesas Technology Corp. R0P7785LC0011RL Support. |
3 | * | 3 | * |
4 | * Copyright (C) 2008 Yoshihiro Shimoda | 4 | * Copyright (C) 2008 Yoshihiro Shimoda |
5 | * Copyright (C) 2009 Paul Mundt | ||
5 | * | 6 | * |
6 | * This file is subject to the terms and conditions of the GNU General Public | 7 | * This file is subject to the terms and conditions of the GNU General Public |
7 | * License. See the file "COPYING" in the main directory of this archive | 8 | * License. See the file "COPYING" in the main directory of this archive |
8 | * for more details. | 9 | * for more details. |
9 | */ | 10 | */ |
10 | |||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
13 | #include <linux/sm501.h> | 13 | #include <linux/sm501.h> |
@@ -19,8 +19,12 @@ | |||
19 | #include <linux/i2c-pca-platform.h> | 19 | #include <linux/i2c-pca-platform.h> |
20 | #include <linux/i2c-algo-pca.h> | 20 | #include <linux/i2c-algo-pca.h> |
21 | #include <linux/irq.h> | 21 | #include <linux/irq.h> |
22 | #include <asm/heartbeat.h> | 22 | #include <linux/clk.h> |
23 | #include <linux/errno.h> | ||
23 | #include <mach/sh7785lcr.h> | 24 | #include <mach/sh7785lcr.h> |
25 | #include <asm/heartbeat.h> | ||
26 | #include <asm/clock.h> | ||
27 | #include <cpu/sh7785.h> | ||
24 | 28 | ||
25 | /* | 29 | /* |
26 | * NOTE: This board has 2 physical memory maps. | 30 | * NOTE: This board has 2 physical memory maps. |
@@ -273,6 +277,20 @@ void __init init_sh7785lcr_IRQ(void) | |||
273 | plat_irq_setup_pins(IRQ_MODE_IRQ3210); | 277 | plat_irq_setup_pins(IRQ_MODE_IRQ3210); |
274 | } | 278 | } |
275 | 279 | ||
280 | static int sh7785lcr_clk_init(void) | ||
281 | { | ||
282 | struct clk *clk; | ||
283 | int ret; | ||
284 | |||
285 | clk = clk_get(NULL, "extal"); | ||
286 | if (!clk || IS_ERR(clk)) | ||
287 | return PTR_ERR(clk); | ||
288 | ret = clk_set_rate(clk, 33333333); | ||
289 | clk_put(clk); | ||
290 | |||
291 | return ret; | ||
292 | } | ||
293 | |||
276 | static void sh7785lcr_power_off(void) | 294 | static void sh7785lcr_power_off(void) |
277 | { | 295 | { |
278 | unsigned char *p; | 296 | unsigned char *p; |
@@ -303,12 +321,34 @@ static void __init sh7785lcr_setup(char **cmdline_p) | |||
303 | writel(0x000307c2, sm501_reg); | 321 | writel(0x000307c2, sm501_reg); |
304 | } | 322 | } |
305 | 323 | ||
324 | /* Return the board specific boot mode pin configuration */ | ||
325 | static int sh7785lcr_mode_pins(void) | ||
326 | { | ||
327 | int value = 0; | ||
328 | |||
329 | /* These are the factory default settings of S1 and S2. | ||
330 | * If you change these dip switches then you will need to | ||
331 | * adjust the values below as well. | ||
332 | */ | ||
333 | value |= MODE_PIN4; /* Clock Mode 16 */ | ||
334 | value |= MODE_PIN5; /* 32-bit Area0 bus width */ | ||
335 | value |= MODE_PIN6; /* 32-bit Area0 bus width */ | ||
336 | value |= MODE_PIN7; /* Area 0 SRAM interface [fixed] */ | ||
337 | value |= MODE_PIN8; /* Little Endian */ | ||
338 | value |= MODE_PIN9; /* Master Mode */ | ||
339 | value |= MODE_PIN14; /* No PLL step-up */ | ||
340 | |||
341 | return value; | ||
342 | } | ||
343 | |||
306 | /* | 344 | /* |
307 | * The Machine Vector | 345 | * The Machine Vector |
308 | */ | 346 | */ |
309 | static struct sh_machine_vector mv_sh7785lcr __initmv = { | 347 | static struct sh_machine_vector mv_sh7785lcr __initmv = { |
310 | .mv_name = "SH7785LCR", | 348 | .mv_name = "SH7785LCR", |
311 | .mv_setup = sh7785lcr_setup, | 349 | .mv_setup = sh7785lcr_setup, |
350 | .mv_clk_init = sh7785lcr_clk_init, | ||
312 | .mv_init_irq = init_sh7785lcr_IRQ, | 351 | .mv_init_irq = init_sh7785lcr_IRQ, |
352 | .mv_mode_pins = sh7785lcr_mode_pins, | ||
313 | }; | 353 | }; |
314 | 354 | ||