diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-09 22:03:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-09 22:03:16 -0500 |
commit | 3a43aaa31790c36b69ebf8a6396f37fade86b531 (patch) | |
tree | 7c7f8da6219d546f2b44534cb7be1fb5591d6ac4 /arch/sh/boards/mach-se/7724 | |
parent | aed886ce777590eac87f7ce2897d9f8357754331 (diff) | |
parent | 6a5a0b9139b19dd1a107870269a35bc9cf18d2dc (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (137 commits)
sh: include empty zero page in romImage
sh: Make associative cache writes fatal on all SH-4A parts.
sh: Drop associative writes for SH-4 cache flushes.
sh: Partial revert of copy/clear_user_highpage() optimizations.
sh: Add default uImage rule for se7724, ap325rxa, and migor.
sh: allow runtime pm without suspend/resume callbacks
sh: mach-ecovec24: Remove un-defined settings for VPU
sh: mach-ecovec24: LCDC drive ability become high
sh: fix sh7724 VEU3F resource size
serial: sh-sci: Fix too early port disabling.
sh: pfc: pr_info() -> pr_debug() cleanups.
sh: pfc: Convert from ctrl_xxx() to __raw_xxx() I/O routines.
sh: Improve kfr2r09 serial port setup code
sh: Break out SuperH PFC code
sh: Move KEYSC header file
sh: convert /proc/cpu/aligmnent, /proc/cpu/kernel_alignment to seq_file
sh: Add CPG save/restore code for sh7724 R-standby
sh: Add SDHI power control support to Ecovec
mfd: Add power control platform data to SDHI driver
sh: mach-ecovec24: modify address map
...
Diffstat (limited to 'arch/sh/boards/mach-se/7724')
-rw-r--r-- | arch/sh/boards/mach-se/7724/Makefile | 2 | ||||
-rw-r--r-- | arch/sh/boards/mach-se/7724/sdram.S | 52 | ||||
-rw-r--r-- | arch/sh/boards/mach-se/7724/setup.c | 96 |
3 files changed, 138 insertions, 12 deletions
diff --git a/arch/sh/boards/mach-se/7724/Makefile b/arch/sh/boards/mach-se/7724/Makefile index 349cbd6ce82d..a08b36830f0e 100644 --- a/arch/sh/boards/mach-se/7724/Makefile +++ b/arch/sh/boards/mach-se/7724/Makefile | |||
@@ -7,4 +7,4 @@ | |||
7 | # | 7 | # |
8 | # | 8 | # |
9 | 9 | ||
10 | obj-y := setup.o irq.o \ No newline at end of file | 10 | obj-y := setup.o irq.o sdram.o |
diff --git a/arch/sh/boards/mach-se/7724/sdram.S b/arch/sh/boards/mach-se/7724/sdram.S new file mode 100644 index 000000000000..9040167d5022 --- /dev/null +++ b/arch/sh/boards/mach-se/7724/sdram.S | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * MS7724SE 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 | ||
22 | ENTRY(ms7724se_sdram_enter_start) | ||
23 | |||
24 | /* DBSC: put memory in self-refresh mode */ | ||
25 | |||
26 | ED 0xFD000010, 0x00000000 /* DBEN */ | ||
27 | ED 0xFD000040, 0x00000000 /* DBRFPDN0 */ | ||
28 | ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */ | ||
29 | ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */ | ||
30 | ED 0xFD000040, 0x00000001 /* DBRFPDN0 */ | ||
31 | |||
32 | rts | ||
33 | nop | ||
34 | |||
35 | ENTRY(ms7724se_sdram_enter_end) | ||
36 | |||
37 | .balign 4 | ||
38 | ENTRY(ms7724se_sdram_leave_start) | ||
39 | |||
40 | /* DBSC: put memory in auto-refresh mode */ | ||
41 | |||
42 | ED 0xFD000040, 0x00000000 /* DBRFPDN0 */ | ||
43 | WAIT 1 | ||
44 | ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */ | ||
45 | ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */ | ||
46 | ED 0xFD000010, 0x00000001 /* DBEN */ | ||
47 | ED 0xFD000040, 0x00010000 /* DBRFPDN0 */ | ||
48 | |||
49 | rts | ||
50 | nop | ||
51 | |||
52 | ENTRY(ms7724se_sdram_leave_end) | ||
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c index 0894bba9fade..4b0f0c0dc2b8 100644 --- a/arch/sh/boards/mach-se/7724/setup.c +++ b/arch/sh/boards/mach-se/7724/setup.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/smc91x.h> | 19 | #include <linux/smc91x.h> |
20 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
21 | #include <linux/input.h> | 21 | #include <linux/input.h> |
22 | #include <linux/input/sh_keysc.h> | ||
22 | #include <linux/usb/r8a66597.h> | 23 | #include <linux/usb/r8a66597.h> |
23 | #include <video/sh_mobile_lcdc.h> | 24 | #include <video/sh_mobile_lcdc.h> |
24 | #include <media/sh_mobile_ceu.h> | 25 | #include <media/sh_mobile_ceu.h> |
@@ -27,7 +28,7 @@ | |||
27 | #include <asm/heartbeat.h> | 28 | #include <asm/heartbeat.h> |
28 | #include <asm/sh_eth.h> | 29 | #include <asm/sh_eth.h> |
29 | #include <asm/clock.h> | 30 | #include <asm/clock.h> |
30 | #include <asm/sh_keysc.h> | 31 | #include <asm/suspend.h> |
31 | #include <cpu/sh7724.h> | 32 | #include <cpu/sh7724.h> |
32 | #include <mach-se/mach/se7724.h> | 33 | #include <mach-se/mach/se7724.h> |
33 | 34 | ||
@@ -451,6 +452,52 @@ static struct platform_device sh7724_usb1_gadget_device = { | |||
451 | .resource = sh7724_usb1_gadget_resources, | 452 | .resource = sh7724_usb1_gadget_resources, |
452 | }; | 453 | }; |
453 | 454 | ||
455 | static struct resource sdhi0_cn7_resources[] = { | ||
456 | [0] = { | ||
457 | .name = "SDHI0", | ||
458 | .start = 0x04ce0000, | ||
459 | .end = 0x04ce01ff, | ||
460 | .flags = IORESOURCE_MEM, | ||
461 | }, | ||
462 | [1] = { | ||
463 | .start = 101, | ||
464 | .flags = IORESOURCE_IRQ, | ||
465 | }, | ||
466 | }; | ||
467 | |||
468 | static struct platform_device sdhi0_cn7_device = { | ||
469 | .name = "sh_mobile_sdhi", | ||
470 | .id = 0, | ||
471 | .num_resources = ARRAY_SIZE(sdhi0_cn7_resources), | ||
472 | .resource = sdhi0_cn7_resources, | ||
473 | .archdata = { | ||
474 | .hwblk_id = HWBLK_SDHI0, | ||
475 | }, | ||
476 | }; | ||
477 | |||
478 | static struct resource sdhi1_cn8_resources[] = { | ||
479 | [0] = { | ||
480 | .name = "SDHI1", | ||
481 | .start = 0x04cf0000, | ||
482 | .end = 0x04cf01ff, | ||
483 | .flags = IORESOURCE_MEM, | ||
484 | }, | ||
485 | [1] = { | ||
486 | .start = 24, | ||
487 | .flags = IORESOURCE_IRQ, | ||
488 | }, | ||
489 | }; | ||
490 | |||
491 | static struct platform_device sdhi1_cn8_device = { | ||
492 | .name = "sh_mobile_sdhi", | ||
493 | .id = 1, | ||
494 | .num_resources = ARRAY_SIZE(sdhi1_cn8_resources), | ||
495 | .resource = sdhi1_cn8_resources, | ||
496 | .archdata = { | ||
497 | .hwblk_id = HWBLK_SDHI1, | ||
498 | }, | ||
499 | }; | ||
500 | |||
454 | static struct platform_device *ms7724se_devices[] __initdata = { | 501 | static struct platform_device *ms7724se_devices[] __initdata = { |
455 | &heartbeat_device, | 502 | &heartbeat_device, |
456 | &smc91x_eth_device, | 503 | &smc91x_eth_device, |
@@ -463,6 +510,8 @@ static struct platform_device *ms7724se_devices[] __initdata = { | |||
463 | &sh7724_usb0_host_device, | 510 | &sh7724_usb0_host_device, |
464 | &sh7724_usb1_gadget_device, | 511 | &sh7724_usb1_gadget_device, |
465 | &fsi_device, | 512 | &fsi_device, |
513 | &sdhi0_cn7_device, | ||
514 | &sdhi1_cn8_device, | ||
466 | }; | 515 | }; |
467 | 516 | ||
468 | #define EEPROM_OP 0xBA206000 | 517 | #define EEPROM_OP 0xBA206000 |
@@ -487,7 +536,7 @@ static int __init sh_eth_is_eeprom_ready(void) | |||
487 | static void __init sh_eth_init(void) | 536 | static void __init sh_eth_init(void) |
488 | { | 537 | { |
489 | int i; | 538 | int i; |
490 | u16 mac[3]; | 539 | u16 mac; |
491 | 540 | ||
492 | /* check EEPROM status */ | 541 | /* check EEPROM status */ |
493 | if (!sh_eth_is_eeprom_ready()) | 542 | if (!sh_eth_is_eeprom_ready()) |
@@ -501,16 +550,10 @@ static void __init sh_eth_init(void) | |||
501 | if (!sh_eth_is_eeprom_ready()) | 550 | if (!sh_eth_is_eeprom_ready()) |
502 | return; | 551 | return; |
503 | 552 | ||
504 | mac[i] = ctrl_inw(EEPROM_DATA); | 553 | mac = ctrl_inw(EEPROM_DATA); |
505 | mac[i] = ((mac[i] & 0xFF) << 8) | (mac[i] >> 8); /* swap */ | 554 | sh_eth_plat.mac_addr[i << 1] = mac & 0xff; |
555 | sh_eth_plat.mac_addr[(i << 1) + 1] = mac >> 8; | ||
506 | } | 556 | } |
507 | |||
508 | /* reset sh-eth */ | ||
509 | ctrl_outl(0x1, SH_ETH_ADDR + 0x0); | ||
510 | |||
511 | /* set MAC addr */ | ||
512 | ctrl_outl(((mac[0] << 16) | (mac[1])), SH_ETH_MAHR); | ||
513 | ctrl_outl((mac[2]), SH_ETH_MALR); | ||
514 | } | 557 | } |
515 | 558 | ||
516 | #define SW4140 0xBA201000 | 559 | #define SW4140 0xBA201000 |
@@ -527,11 +570,22 @@ static void __init sh_eth_init(void) | |||
527 | #define SW41_G 0x4000 | 570 | #define SW41_G 0x4000 |
528 | #define SW41_H 0x8000 | 571 | #define SW41_H 0x8000 |
529 | 572 | ||
573 | extern char ms7724se_sdram_enter_start; | ||
574 | extern char ms7724se_sdram_enter_end; | ||
575 | extern char ms7724se_sdram_leave_start; | ||
576 | extern char ms7724se_sdram_leave_end; | ||
577 | |||
530 | static int __init devices_setup(void) | 578 | static int __init devices_setup(void) |
531 | { | 579 | { |
532 | u16 sw = ctrl_inw(SW4140); /* select camera, monitor */ | 580 | u16 sw = ctrl_inw(SW4140); /* select camera, monitor */ |
533 | struct clk *fsia_clk; | 581 | struct clk *fsia_clk; |
534 | 582 | ||
583 | /* register board specific self-refresh code */ | ||
584 | sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF, | ||
585 | &ms7724se_sdram_enter_start, | ||
586 | &ms7724se_sdram_enter_end, | ||
587 | &ms7724se_sdram_leave_start, | ||
588 | &ms7724se_sdram_leave_end); | ||
535 | /* Reset Release */ | 589 | /* Reset Release */ |
536 | ctrl_outw(ctrl_inw(FPGA_OUT) & | 590 | ctrl_outw(ctrl_inw(FPGA_OUT) & |
537 | ~((1 << 1) | /* LAN */ | 591 | ~((1 << 1) | /* LAN */ |
@@ -701,6 +755,26 @@ static int __init devices_setup(void) | |||
701 | clk_set_rate(&fsimcka_clk, 11000); | 755 | clk_set_rate(&fsimcka_clk, 11000); |
702 | clk_put(fsia_clk); | 756 | clk_put(fsia_clk); |
703 | 757 | ||
758 | /* SDHI0 connected to cn7 */ | ||
759 | gpio_request(GPIO_FN_SDHI0CD, NULL); | ||
760 | gpio_request(GPIO_FN_SDHI0WP, NULL); | ||
761 | gpio_request(GPIO_FN_SDHI0D3, NULL); | ||
762 | gpio_request(GPIO_FN_SDHI0D2, NULL); | ||
763 | gpio_request(GPIO_FN_SDHI0D1, NULL); | ||
764 | gpio_request(GPIO_FN_SDHI0D0, NULL); | ||
765 | gpio_request(GPIO_FN_SDHI0CMD, NULL); | ||
766 | gpio_request(GPIO_FN_SDHI0CLK, NULL); | ||
767 | |||
768 | /* SDHI1 connected to cn8 */ | ||
769 | gpio_request(GPIO_FN_SDHI1CD, NULL); | ||
770 | gpio_request(GPIO_FN_SDHI1WP, NULL); | ||
771 | gpio_request(GPIO_FN_SDHI1D3, NULL); | ||
772 | gpio_request(GPIO_FN_SDHI1D2, NULL); | ||
773 | gpio_request(GPIO_FN_SDHI1D1, NULL); | ||
774 | gpio_request(GPIO_FN_SDHI1D0, NULL); | ||
775 | gpio_request(GPIO_FN_SDHI1CMD, NULL); | ||
776 | gpio_request(GPIO_FN_SDHI1CLK, NULL); | ||
777 | |||
704 | /* | 778 | /* |
705 | * enable SH-Eth | 779 | * enable SH-Eth |
706 | * | 780 | * |