aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/mach-se/7724/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/boards/mach-se/7724/setup.c')
-rw-r--r--arch/sh/boards/mach-se/7724/setup.c96
1 files changed, 85 insertions, 11 deletions
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
455static 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
468static 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
478static 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
491static 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
454static struct platform_device *ms7724se_devices[] __initdata = { 501static 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)
487static void __init sh_eth_init(void) 536static 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
573extern char ms7724se_sdram_enter_start;
574extern char ms7724se_sdram_enter_end;
575extern char ms7724se_sdram_leave_start;
576extern char ms7724se_sdram_leave_end;
577
530static int __init devices_setup(void) 578static 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 *