aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/mach-migor
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-12-11 20:12:17 -0500
committerDavid S. Miller <davem@davemloft.net>2009-12-11 20:12:17 -0500
commit501706565b2d4d2d40d0d301d5411ede099b8a6f (patch)
tree142a18bf1f1e74a09dbfa27540b893ade0fd797d /arch/sh/boards/mach-migor
parente93737b0f0159a61772894943199fd3b6f315641 (diff)
parent2fe77b81c77eed92c4c0439f74c8148a295b4a86 (diff)
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts: include/net/tcp.h
Diffstat (limited to 'arch/sh/boards/mach-migor')
-rw-r--r--arch/sh/boards/mach-migor/Makefile2
-rw-r--r--arch/sh/boards/mach-migor/sdram.S69
-rw-r--r--arch/sh/boards/mach-migor/setup.c65
3 files changed, 110 insertions, 26 deletions
diff --git a/arch/sh/boards/mach-migor/Makefile b/arch/sh/boards/mach-migor/Makefile
index 5f231dd25c0e..4601a89e5ac7 100644
--- a/arch/sh/boards/mach-migor/Makefile
+++ b/arch/sh/boards/mach-migor/Makefile
@@ -1,2 +1,2 @@
1obj-y := setup.o 1obj-y := setup.o sdram.o
2obj-$(CONFIG_SH_MIGOR_QVGA) += lcd_qvga.o 2obj-$(CONFIG_SH_MIGOR_QVGA) += lcd_qvga.o
diff --git a/arch/sh/boards/mach-migor/sdram.S b/arch/sh/boards/mach-migor/sdram.S
new file mode 100644
index 000000000000..614aa3a1398c
--- /dev/null
+++ b/arch/sh/boards/mach-migor/sdram.S
@@ -0,0 +1,69 @@
1/*
2 * Migo-R sdram self/auto-refresh setup code
3 *
4 * Copyright (C) 2009 Magnus Damm
5 *
6 * 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 * for more details.
9 */
10
11#include <linux/sys.h>
12#include <linux/errno.h>
13#include <linux/linkage.h>
14#include <asm/asm-offsets.h>
15#include <asm/suspend.h>
16#include <asm/romimage-macros.h>
17
18/* code to enter and leave self-refresh. must be self-contained.
19 * this code will be copied to on-chip memory and executed from there.
20 */
21 .balign 4
22ENTRY(migor_sdram_enter_start)
23
24 /* SBSC: disable power down and put in self-refresh mode */
25 mov.l 1f, r4
26 mov.l 2f, r1
27 mov.l @r4, r2
28 or r1, r2
29 mov.l 3f, r3
30 and r3, r2
31 mov.l r2, @r4
32
33 rts
34 nop
35
36 .balign 4
371: .long 0xfe400008 /* SDCR0 */
382: .long 0x00000400
393: .long 0xffff7fff
40ENTRY(migor_sdram_enter_end)
41
42 .balign 4
43ENTRY(migor_sdram_leave_start)
44
45 /* SBSC: set auto-refresh mode */
46 mov.l 1f, r4
47 mov.l @r4, r0
48 mov.l 4f, r1
49 and r1, r0
50 mov.l r0, @r4
51 mov.l 6f, r4
52 mov.l 8f, r0
53 mov.l @r4, r1
54 mov #-1, r4
55 add r4, r1
56 or r1, r0
57 mov.l 7f, r1
58 mov.l r0, @r1
59
60 rts
61 nop
62
63 .balign 4
641: .long 0xfe400008 /* SDCR0 */
654: .long 0xfffffbff
666: .long 0xfe40001c /* RTCOR */
677: .long 0xfe400018 /* RTCNT */
688: .long 0xa55a0000
69ENTRY(migor_sdram_leave_end)
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
index 6ed1fd32369e..9099b6da9957 100644
--- a/arch/sh/boards/mach-migor/setup.c
+++ b/arch/sh/boards/mach-migor/setup.c
@@ -11,6 +11,7 @@
11#include <linux/platform_device.h> 11#include <linux/platform_device.h>
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13#include <linux/input.h> 13#include <linux/input.h>
14#include <linux/input/sh_keysc.h>
14#include <linux/mtd/physmap.h> 15#include <linux/mtd/physmap.h>
15#include <linux/mtd/nand.h> 16#include <linux/mtd/nand.h>
16#include <linux/i2c.h> 17#include <linux/i2c.h>
@@ -18,8 +19,6 @@
18#include <linux/delay.h> 19#include <linux/delay.h>
19#include <linux/clk.h> 20#include <linux/clk.h>
20#include <linux/gpio.h> 21#include <linux/gpio.h>
21#include <linux/spi/spi.h>
22#include <linux/spi/spi_gpio.h>
23#include <video/sh_mobile_lcdc.h> 22#include <video/sh_mobile_lcdc.h>
24#include <media/sh_mobile_ceu.h> 23#include <media/sh_mobile_ceu.h>
25#include <media/ov772x.h> 24#include <media/ov772x.h>
@@ -27,7 +26,7 @@
27#include <asm/clock.h> 26#include <asm/clock.h>
28#include <asm/machvec.h> 27#include <asm/machvec.h>
29#include <asm/io.h> 28#include <asm/io.h>
30#include <asm/sh_keysc.h> 29#include <asm/suspend.h>
31#include <mach/migor.h> 30#include <mach/migor.h>
32#include <cpu/sh7722.h> 31#include <cpu/sh7722.h>
33 32
@@ -390,17 +389,25 @@ static struct platform_device migor_ceu_device = {
390 }, 389 },
391}; 390};
392 391
393struct spi_gpio_platform_data sdcard_cn9_platform_data = { 392static struct resource sdhi_cn9_resources[] = {
394 .sck = GPIO_PTD0, 393 [0] = {
395 .mosi = GPIO_PTD1, 394 .name = "SDHI",
396 .miso = GPIO_PTD2, 395 .start = 0x04ce0000,
397 .num_chipselect = 1, 396 .end = 0x04ce01ff,
397 .flags = IORESOURCE_MEM,
398 },
399 [1] = {
400 .start = 101,
401 .flags = IORESOURCE_IRQ,
402 },
398}; 403};
399 404
400static struct platform_device sdcard_cn9_device = { 405static struct platform_device sdhi_cn9_device = {
401 .name = "spi_gpio", 406 .name = "sh_mobile_sdhi",
402 .dev = { 407 .num_resources = ARRAY_SIZE(sdhi_cn9_resources),
403 .platform_data = &sdcard_cn9_platform_data, 408 .resource = sdhi_cn9_resources,
409 .archdata = {
410 .hwblk_id = HWBLK_SDHI,
404 }, 411 },
405}; 412};
406 413
@@ -467,23 +474,24 @@ static struct platform_device *migor_devices[] __initdata = {
467 &migor_ceu_device, 474 &migor_ceu_device,
468 &migor_nor_flash_device, 475 &migor_nor_flash_device,
469 &migor_nand_flash_device, 476 &migor_nand_flash_device,
470 &sdcard_cn9_device, 477 &sdhi_cn9_device,
471 &migor_camera[0], 478 &migor_camera[0],
472 &migor_camera[1], 479 &migor_camera[1],
473}; 480};
474 481
475static struct spi_board_info migor_spi_devices[] = { 482extern char migor_sdram_enter_start;
476 { 483extern char migor_sdram_enter_end;
477 .modalias = "mmc_spi", 484extern char migor_sdram_leave_start;
478 .max_speed_hz = 5000000, 485extern char migor_sdram_leave_end;
479 .chip_select = 0,
480 .controller_data = (void *) GPIO_PTD5,
481 },
482};
483 486
484static int __init migor_devices_setup(void) 487static int __init migor_devices_setup(void)
485{ 488{
486 489 /* register board specific self-refresh code */
490 sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF,
491 &migor_sdram_enter_start,
492 &migor_sdram_enter_end,
493 &migor_sdram_leave_start,
494 &migor_sdram_leave_end);
487#ifdef CONFIG_PM 495#ifdef CONFIG_PM
488 /* Let D11 LED show STATUS0 */ 496 /* Let D11 LED show STATUS0 */
489 gpio_request(GPIO_FN_STATUS0, NULL); 497 gpio_request(GPIO_FN_STATUS0, NULL);
@@ -525,6 +533,16 @@ static int __init migor_devices_setup(void)
525 gpio_request(GPIO_PTA1, NULL); 533 gpio_request(GPIO_PTA1, NULL);
526 gpio_direction_input(GPIO_PTA1); 534 gpio_direction_input(GPIO_PTA1);
527 535
536 /* SDHI */
537 gpio_request(GPIO_FN_SDHICD, NULL);
538 gpio_request(GPIO_FN_SDHIWP, NULL);
539 gpio_request(GPIO_FN_SDHID3, NULL);
540 gpio_request(GPIO_FN_SDHID2, NULL);
541 gpio_request(GPIO_FN_SDHID1, NULL);
542 gpio_request(GPIO_FN_SDHID0, NULL);
543 gpio_request(GPIO_FN_SDHICMD, NULL);
544 gpio_request(GPIO_FN_SDHICLK, NULL);
545
528 /* Touch Panel */ 546 /* Touch Panel */
529 gpio_request(GPIO_FN_IRQ6, NULL); 547 gpio_request(GPIO_FN_IRQ6, NULL);
530 548
@@ -612,9 +630,6 @@ static int __init migor_devices_setup(void)
612 i2c_register_board_info(0, migor_i2c_devices, 630 i2c_register_board_info(0, migor_i2c_devices,
613 ARRAY_SIZE(migor_i2c_devices)); 631 ARRAY_SIZE(migor_i2c_devices));
614 632
615 spi_register_board_info(migor_spi_devices,
616 ARRAY_SIZE(migor_spi_devices));
617
618 return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices)); 633 return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices));
619} 634}
620arch_initcall(migor_devices_setup); 635arch_initcall(migor_devices_setup);