2 * linux/arch/sh/boards/se/7722/setup.c
4 * Copyright (C) 2007 Nobuhiro Iwamatsu
6 * Hitachi UL SolutionEngine 7722 Support.
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
13 #include <linux/init.h>
14 #include <linux/platform_device.h>
15 #include <linux/ata_platform.h>
16 #include <asm/machvec.h>
17 #include <asm/se7722.h>
19 #include <asm/heartbeat.h>
22 static struct heartbeat_data heartbeat_data
= {
26 static struct resource heartbeat_resources
[] = {
30 .flags
= IORESOURCE_MEM
,
34 static struct platform_device heartbeat_device
= {
38 .platform_data
= &heartbeat_data
,
40 .num_resources
= ARRAY_SIZE(heartbeat_resources
),
41 .resource
= heartbeat_resources
,
45 static struct resource smc91x_eth_resources
[] = {
47 .name
= "smc91x-regs" ,
48 .start
= PA_LAN
+ 0x300,
49 .end
= PA_LAN
+ 0x300 + 0x10 ,
50 .flags
= IORESOURCE_MEM
,
55 .flags
= IORESOURCE_IRQ
,
59 static struct platform_device smc91x_eth_device
= {
63 .dma_mask
= NULL
, /* don't use dma */
64 .coherent_dma_mask
= 0xffffffff,
66 .num_resources
= ARRAY_SIZE(smc91x_eth_resources
),
67 .resource
= smc91x_eth_resources
,
70 static struct resource cf_ide_resources
[] = {
72 .start
= PA_MRSHPC_IO
+ 0x1f0,
73 .end
= PA_MRSHPC_IO
+ 0x1f0 + 8 ,
74 .flags
= IORESOURCE_IO
,
77 .start
= PA_MRSHPC_IO
+ 0x1f0 + 0x206,
78 .end
= PA_MRSHPC_IO
+ 0x1f0 +8 + 0x206 + 8,
79 .flags
= IORESOURCE_IO
,
84 .flags
= IORESOURCE_IRQ
,
88 static struct platform_device cf_ide_device
= {
89 .name
= "pata_platform",
91 .num_resources
= ARRAY_SIZE(cf_ide_resources
),
92 .resource
= cf_ide_resources
,
95 static struct platform_device
*se7722_devices
[] __initdata
= {
101 static int __init
se7722_devices_setup(void)
103 return platform_add_devices(se7722_devices
,
104 ARRAY_SIZE(se7722_devices
));
106 device_initcall(se7722_devices_setup
);
108 static void __init
se7722_setup(char **cmdline_p
)
110 ctrl_outw(0x010D, FPGA_OUT
); /* FPGA */
112 ctrl_outl(0x00051001, MSTPCR0
);
113 ctrl_outl(0x00000000, MSTPCR1
);
114 /* KEYSC, VOU, BEU, CEU, VEU, VPU, LCDC, USB */
115 ctrl_outl(0xffffb7c0, MSTPCR2
);
117 ctrl_outw(0x0000, PORT_PECR
); /* PORT E 1 = IRQ5 ,E 0 = BS */
118 ctrl_outw(0x1000, PORT_PJCR
); /* PORT J 1 = IRQ1,J 0 =IRQ0 */
121 ctrl_outw(0x0020, PORT_PSELD
);
124 ctrl_outw(0x0003, PORT_PSELB
);
125 ctrl_outw(0xe000, PORT_PSELC
);
126 ctrl_outw(0x0000, PORT_PKCR
);
129 ctrl_outw(0x4020, PORT_PHCR
);
130 ctrl_outw(0x0000, PORT_PLCR
);
131 ctrl_outw(0x0000, PORT_PMCR
);
132 ctrl_outw(0x0002, PORT_PRCR
);
133 ctrl_outw(0x0000, PORT_PXCR
); /* LCDC,CS6A */
136 ctrl_outw(0x0A10, PORT_PSELA
); /* BS,SHHID2 */
137 ctrl_outw(0x0000, PORT_PYCR
);
138 ctrl_outw(0x0000, PORT_PZCR
);
144 static struct sh_machine_vector mv_se7722 __initmv
= {
145 .mv_name
= "Solution Engine 7722" ,
146 .mv_setup
= se7722_setup
,
147 .mv_nr_irqs
= SE7722_FPGA_IRQ_BASE
+ SE7722_FPGA_IRQ_NR
,
148 .mv_init_irq
= init_se7722_IRQ
,