2 * linux/arch/sh/boards/se/770x/setup.c
4 * Copyright (C) 2000 Kazumoto Kojima
6 * Hitachi SolutionEngine Support.
9 #include <linux/init.h>
10 #include <linux/platform_device.h>
11 #include <mach-se/mach/se.h>
12 #include <mach-se/mach/mrshpc.h>
13 #include <asm/machvec.h>
15 #include <asm/smc37c93x.h>
16 #include <asm/heartbeat.h>
19 * Configure the Super I/O chip
21 static void __init
smsc_config(int index
, int data
)
23 outb_p(index
, INDEX_PORT
);
24 outb_p(data
, DATA_PORT
);
27 /* XXX: Another candidate for a more generic cchip machine vector */
28 static void __init
smsc_setup(char **cmdline_p
)
30 outb_p(CONFIG_ENTER
, CONFIG_PORT
);
31 outb_p(CONFIG_ENTER
, CONFIG_PORT
);
34 smsc_config(CURRENT_LDN_INDEX
, LDN_FDC
);
35 smsc_config(ACTIVATE_INDEX
, 0x01);
36 smsc_config(IRQ_SELECT_INDEX
, 6); /* IRQ6 */
38 /* AUXIO (GPIO): to use IDE1 */
39 smsc_config(CURRENT_LDN_INDEX
, LDN_AUXIO
);
40 smsc_config(GPIO46_INDEX
, 0x00); /* nIOROP */
41 smsc_config(GPIO47_INDEX
, 0x00); /* nIOWOP */
44 smsc_config(CURRENT_LDN_INDEX
, LDN_COM1
);
45 smsc_config(ACTIVATE_INDEX
, 0x01);
46 smsc_config(IO_BASE_HI_INDEX
, 0x03);
47 smsc_config(IO_BASE_LO_INDEX
, 0xf8);
48 smsc_config(IRQ_SELECT_INDEX
, 4); /* IRQ4 */
51 smsc_config(CURRENT_LDN_INDEX
, LDN_COM2
);
52 smsc_config(ACTIVATE_INDEX
, 0x01);
53 smsc_config(IO_BASE_HI_INDEX
, 0x02);
54 smsc_config(IO_BASE_LO_INDEX
, 0xf8);
55 smsc_config(IRQ_SELECT_INDEX
, 3); /* IRQ3 */
58 smsc_config(CURRENT_LDN_INDEX
, LDN_RTC
);
59 smsc_config(ACTIVATE_INDEX
, 0x01);
60 smsc_config(IRQ_SELECT_INDEX
, 8); /* IRQ8 */
62 /* XXX: PARPORT, KBD, and MOUSE will come here... */
63 outb_p(CONFIG_EXIT
, CONFIG_PORT
);
67 static struct resource cf_ide_resources
[] = {
69 .start
= PA_MRSHPC_IO
+ 0x1f0,
70 .end
= PA_MRSHPC_IO
+ 0x1f0 + 8,
71 .flags
= IORESOURCE_MEM
,
74 .start
= PA_MRSHPC_IO
+ 0x1f0 + 0x206,
75 .end
= PA_MRSHPC_IO
+ 0x1f0 + 8 + 0x206 + 8,
76 .flags
= IORESOURCE_MEM
,
80 .flags
= IORESOURCE_IRQ
,
84 static struct platform_device cf_ide_device
= {
85 .name
= "pata_platform",
87 .num_resources
= ARRAY_SIZE(cf_ide_resources
),
88 .resource
= cf_ide_resources
,
91 static unsigned char heartbeat_bit_pos
[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
93 static struct heartbeat_data heartbeat_data
= {
94 .bit_pos
= heartbeat_bit_pos
,
95 .nr_bits
= ARRAY_SIZE(heartbeat_bit_pos
),
98 static struct resource heartbeat_resource
= {
101 .flags
= IORESOURCE_MEM
| IORESOURCE_MEM_16BIT
,
104 static struct platform_device heartbeat_device
= {
108 .platform_data
= &heartbeat_data
,
111 .resource
= &heartbeat_resource
,
114 #if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\
115 defined(CONFIG_CPU_SUBTYPE_SH7712)
116 /* SH771X Ethernet driver */
117 static struct resource sh_eth0_resources
[] = {
119 .start
= SH_ETH0_BASE
,
120 .end
= SH_ETH0_BASE
+ 0x1B8,
121 .flags
= IORESOURCE_MEM
,
124 .start
= SH_ETH0_IRQ
,
126 .flags
= IORESOURCE_IRQ
,
130 static struct platform_device sh_eth0_device
= {
131 .name
= "sh771x-ether",
134 .platform_data
= PHY_ID
,
136 .num_resources
= ARRAY_SIZE(sh_eth0_resources
),
137 .resource
= sh_eth0_resources
,
140 static struct resource sh_eth1_resources
[] = {
142 .start
= SH_ETH1_BASE
,
143 .end
= SH_ETH1_BASE
+ 0x1B8,
144 .flags
= IORESOURCE_MEM
,
147 .start
= SH_ETH1_IRQ
,
149 .flags
= IORESOURCE_IRQ
,
153 static struct platform_device sh_eth1_device
= {
154 .name
= "sh771x-ether",
157 .platform_data
= PHY_ID
,
159 .num_resources
= ARRAY_SIZE(sh_eth1_resources
),
160 .resource
= sh_eth1_resources
,
164 static struct platform_device
*se_devices
[] __initdata
= {
167 #if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\
168 defined(CONFIG_CPU_SUBTYPE_SH7712)
174 static int __init
se_devices_setup(void)
176 mrshpc_setup_windows();
177 return platform_add_devices(se_devices
, ARRAY_SIZE(se_devices
));
179 device_initcall(se_devices_setup
);
184 static struct sh_machine_vector mv_se __initmv
= {
185 .mv_name
= "SolutionEngine",
186 .mv_setup
= smsc_setup
,
187 .mv_init_irq
= init_se_IRQ
,