1 /* $Id: setup.c,v 1.1.2.4 2002/03/02 21:57:07 lethal Exp $
3 * linux/arch/sh/boards/se/770x/setup.c
5 * Copyright (C) 2000 Kazumoto Kojima
7 * Hitachi SolutionEngine Support.
10 #include <linux/init.h>
11 #include <linux/irq.h>
12 #include <linux/hdreg.h>
13 #include <linux/ide.h>
16 #include <asm/smc37c93x.h>
17 #include <asm/machvec.h>
19 void heartbeat_se(void);
20 void init_se_IRQ(void);
23 * Configure the Super I/O chip
25 static void __init smsc_config(int index, int data)
27 outb_p(index, INDEX_PORT);
28 outb_p(data, DATA_PORT);
31 /* XXX: Another candidate for a more generic cchip machine vector */
32 static void __init smsc_setup(char **cmdline_p)
34 outb_p(CONFIG_ENTER, CONFIG_PORT);
35 outb_p(CONFIG_ENTER, CONFIG_PORT);
38 smsc_config(CURRENT_LDN_INDEX, LDN_FDC);
39 smsc_config(ACTIVATE_INDEX, 0x01);
40 smsc_config(IRQ_SELECT_INDEX, 6); /* IRQ6 */
43 smsc_config(CURRENT_LDN_INDEX, LDN_IDE1);
44 smsc_config(ACTIVATE_INDEX, 0x01);
45 smsc_config(IRQ_SELECT_INDEX, 14); /* IRQ14 */
47 /* AUXIO (GPIO): to use IDE1 */
48 smsc_config(CURRENT_LDN_INDEX, LDN_AUXIO);
49 smsc_config(GPIO46_INDEX, 0x00); /* nIOROP */
50 smsc_config(GPIO47_INDEX, 0x00); /* nIOWOP */
53 smsc_config(CURRENT_LDN_INDEX, LDN_COM1);
54 smsc_config(ACTIVATE_INDEX, 0x01);
55 smsc_config(IO_BASE_HI_INDEX, 0x03);
56 smsc_config(IO_BASE_LO_INDEX, 0xf8);
57 smsc_config(IRQ_SELECT_INDEX, 4); /* IRQ4 */
60 smsc_config(CURRENT_LDN_INDEX, LDN_COM2);
61 smsc_config(ACTIVATE_INDEX, 0x01);
62 smsc_config(IO_BASE_HI_INDEX, 0x02);
63 smsc_config(IO_BASE_LO_INDEX, 0xf8);
64 smsc_config(IRQ_SELECT_INDEX, 3); /* IRQ3 */
67 smsc_config(CURRENT_LDN_INDEX, LDN_RTC);
68 smsc_config(ACTIVATE_INDEX, 0x01);
69 smsc_config(IRQ_SELECT_INDEX, 8); /* IRQ8 */
71 /* XXX: PARPORT, KBD, and MOUSE will come here... */
72 outb_p(CONFIG_EXIT, CONFIG_PORT);
78 struct sh_machine_vector mv_se __initmv = {
79 .mv_name = "SolutionEngine",
80 .mv_setup = smsc_setup,
81 #if defined(CONFIG_CPU_SH4)
83 #elif defined(CONFIG_CPU_SUBTYPE_SH7708)
85 #elif defined(CONFIG_CPU_SUBTYPE_SH7709)
87 #elif defined(CONFIG_CPU_SUBTYPE_SH7705)
101 .mv_outb_p = se_outb_p,
102 .mv_outw_p = se_outw,
103 .mv_outl_p = se_outl,
108 .mv_outsb = se_outsb,
109 .mv_outsw = se_outsw,
110 .mv_outsl = se_outsl,
112 .mv_init_irq = init_se_IRQ,
113 #ifdef CONFIG_HEARTBEAT
114 .mv_heartbeat = heartbeat_se,