]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - arch/sh/boards/se/770x/setup.c
Linux-2.6.12-rc2
[mirror_ubuntu-artful-kernel.git] / arch / sh / boards / se / 770x / setup.c
1 /* $Id: setup.c,v 1.1.2.4 2002/03/02 21:57:07 lethal Exp $
2 *
3 * linux/arch/sh/boards/se/770x/setup.c
4 *
5 * Copyright (C) 2000 Kazumoto Kojima
6 *
7 * Hitachi SolutionEngine Support.
8 *
9 */
10
11 #include <linux/config.h>
12 #include <linux/init.h>
13 #include <linux/irq.h>
14
15 #include <linux/hdreg.h>
16 #include <linux/ide.h>
17 #include <asm/io.h>
18 #include <asm/se/se.h>
19 #include <asm/se/smc37c93x.h>
20
21 /*
22 * Configure the Super I/O chip
23 */
24 static void __init smsc_config(int index, int data)
25 {
26 outb_p(index, INDEX_PORT);
27 outb_p(data, DATA_PORT);
28 }
29
30 static void __init init_smsc(void)
31 {
32 outb_p(CONFIG_ENTER, CONFIG_PORT);
33 outb_p(CONFIG_ENTER, CONFIG_PORT);
34
35 /* FDC */
36 smsc_config(CURRENT_LDN_INDEX, LDN_FDC);
37 smsc_config(ACTIVATE_INDEX, 0x01);
38 smsc_config(IRQ_SELECT_INDEX, 6); /* IRQ6 */
39
40 /* IDE1 */
41 smsc_config(CURRENT_LDN_INDEX, LDN_IDE1);
42 smsc_config(ACTIVATE_INDEX, 0x01);
43 smsc_config(IRQ_SELECT_INDEX, 14); /* IRQ14 */
44
45 /* AUXIO (GPIO): to use IDE1 */
46 smsc_config(CURRENT_LDN_INDEX, LDN_AUXIO);
47 smsc_config(GPIO46_INDEX, 0x00); /* nIOROP */
48 smsc_config(GPIO47_INDEX, 0x00); /* nIOWOP */
49
50 /* COM1 */
51 smsc_config(CURRENT_LDN_INDEX, LDN_COM1);
52 smsc_config(ACTIVATE_INDEX, 0x01);
53 smsc_config(IO_BASE_HI_INDEX, 0x03);
54 smsc_config(IO_BASE_LO_INDEX, 0xf8);
55 smsc_config(IRQ_SELECT_INDEX, 4); /* IRQ4 */
56
57 /* COM2 */
58 smsc_config(CURRENT_LDN_INDEX, LDN_COM2);
59 smsc_config(ACTIVATE_INDEX, 0x01);
60 smsc_config(IO_BASE_HI_INDEX, 0x02);
61 smsc_config(IO_BASE_LO_INDEX, 0xf8);
62 smsc_config(IRQ_SELECT_INDEX, 3); /* IRQ3 */
63
64 /* RTC */
65 smsc_config(CURRENT_LDN_INDEX, LDN_RTC);
66 smsc_config(ACTIVATE_INDEX, 0x01);
67 smsc_config(IRQ_SELECT_INDEX, 8); /* IRQ8 */
68
69 /* XXX: PARPORT, KBD, and MOUSE will come here... */
70 outb_p(CONFIG_EXIT, CONFIG_PORT);
71 }
72
73 const char *get_system_type(void)
74 {
75 return "SolutionEngine";
76 }
77
78 /*
79 * Initialize the board
80 */
81 void __init platform_setup(void)
82 {
83 init_smsc();
84 /* XXX: RTC setting comes here */
85 }