aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/se/7751
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-09-27 05:17:31 -0400
committerPaul Mundt <lethal@linux-sh.org>2006-09-27 05:17:31 -0400
commit2c7834a6f15fe6c50ed4766f1bb6f9183b9e2740 (patch)
tree2dee1fc4b2cd69d8e7f07e0462c57c98261a9fcf /arch/sh/boards/se/7751
parentbc8fb5d0471473f775378d09db712dcb8eeece75 (diff)
sh: machvec rework.
Some more machvec overhauling and setup code cleanup. Kill off get_system_type() and platform_setup(), we can do these both through the machvec. While we're add it, kill off more useless mach.c's and drop some legacy cruft from setup.c. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards/se/7751')
-rw-r--r--arch/sh/boards/se/7751/Makefile3
-rw-r--r--arch/sh/boards/se/7751/mach.c48
-rw-r--r--arch/sh/boards/se/7751/setup.c103
3 files changed, 39 insertions, 115 deletions
diff --git a/arch/sh/boards/se/7751/Makefile b/arch/sh/boards/se/7751/Makefile
index 07bf17a4a19b..188900c48321 100644
--- a/arch/sh/boards/se/7751/Makefile
+++ b/arch/sh/boards/se/7751/Makefile
@@ -2,8 +2,7 @@
2# Makefile for the 7751 SolutionEngine specific parts of the kernel 2# Makefile for the 7751 SolutionEngine specific parts of the kernel
3# 3#
4 4
5obj-y := mach.o setup.o io.o irq.o 5obj-y := setup.o io.o irq.o
6 6
7obj-$(CONFIG_PCI) += pci.o 7obj-$(CONFIG_PCI) += pci.o
8obj-$(CONFIG_HEARTBEAT) += led.o 8obj-$(CONFIG_HEARTBEAT) += led.o
9
diff --git a/arch/sh/boards/se/7751/mach.c b/arch/sh/boards/se/7751/mach.c
deleted file mode 100644
index 1bb9047d863b..000000000000
--- a/arch/sh/boards/se/7751/mach.c
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * linux/arch/sh/kernel/mach_7751se.c
3 *
4 * Minor tweak of mach_se.c file to reference 7751se-specific items.
5 *
6 * May be copied or modified under the terms of the GNU General Public
7 * License. See linux/COPYING for more information.
8 *
9 * Machine vector for the Hitachi 7751 SolutionEngine
10 */
11
12#include <linux/init.h>
13#include <asm/machvec.h>
14#include <asm/se7751.h>
15
16void heartbeat_7751se(void);
17void init_7751se_IRQ(void);
18
19/*
20 * The Machine Vector
21 */
22
23struct sh_machine_vector mv_7751se __initmv = {
24 .mv_nr_irqs = 72,
25
26 .mv_inb = sh7751se_inb,
27 .mv_inw = sh7751se_inw,
28 .mv_inl = sh7751se_inl,
29 .mv_outb = sh7751se_outb,
30 .mv_outw = sh7751se_outw,
31 .mv_outl = sh7751se_outl,
32
33 .mv_inb_p = sh7751se_inb_p,
34 .mv_inw_p = sh7751se_inw,
35 .mv_inl_p = sh7751se_inl,
36 .mv_outb_p = sh7751se_outb_p,
37 .mv_outw_p = sh7751se_outw,
38 .mv_outl_p = sh7751se_outl,
39
40 .mv_insl = sh7751se_insl,
41 .mv_outsl = sh7751se_outsl,
42
43 .mv_init_irq = init_7751se_IRQ,
44#ifdef CONFIG_HEARTBEAT
45 .mv_heartbeat = heartbeat_7751se,
46#endif
47};
48ALIAS_MV(7751se)
diff --git a/arch/sh/boards/se/7751/setup.c b/arch/sh/boards/se/7751/setup.c
index 8b693105893c..73e826310ba8 100644
--- a/arch/sh/boards/se/7751/setup.c
+++ b/arch/sh/boards/se/7751/setup.c
@@ -15,72 +15,11 @@
15#include <asm/io.h> 15#include <asm/io.h>
16#include <asm/se7751.h> 16#include <asm/se7751.h>
17 17
18#ifdef CONFIG_SH_KGDB 18void heartbeat_7751se(void);
19#include <asm/kgdb.h> 19void init_7751se_IRQ(void);
20#endif
21
22/*
23 * Configure the Super I/O chip
24 */
25#if 0
26/* Leftover code from regular Solution Engine, for reference. */
27/* The SH7751 Solution Engine has a different SuperIO. */
28static void __init smsc_config(int index, int data)
29{
30 outb_p(index, INDEX_PORT);
31 outb_p(data, DATA_PORT);
32}
33
34static void __init init_smsc(void)
35{
36 outb_p(CONFIG_ENTER, CONFIG_PORT);
37 outb_p(CONFIG_ENTER, CONFIG_PORT);
38
39 /* FDC */
40 smsc_config(CURRENT_LDN_INDEX, LDN_FDC);
41 smsc_config(ACTIVATE_INDEX, 0x01);
42 smsc_config(IRQ_SELECT_INDEX, 6); /* IRQ6 */
43
44 /* IDE1 */
45 smsc_config(CURRENT_LDN_INDEX, LDN_IDE1);
46 smsc_config(ACTIVATE_INDEX, 0x01);
47 smsc_config(IRQ_SELECT_INDEX, 14); /* IRQ14 */
48
49 /* AUXIO (GPIO): to use IDE1 */
50 smsc_config(CURRENT_LDN_INDEX, LDN_AUXIO);
51 smsc_config(GPIO46_INDEX, 0x00); /* nIOROP */
52 smsc_config(GPIO47_INDEX, 0x00); /* nIOWOP */
53
54 /* COM1 */
55 smsc_config(CURRENT_LDN_INDEX, LDN_COM1);
56 smsc_config(ACTIVATE_INDEX, 0x01);
57 smsc_config(IO_BASE_HI_INDEX, 0x03);
58 smsc_config(IO_BASE_LO_INDEX, 0xf8);
59 smsc_config(IRQ_SELECT_INDEX, 4); /* IRQ4 */
60
61 /* COM2 */
62 smsc_config(CURRENT_LDN_INDEX, LDN_COM2);
63 smsc_config(ACTIVATE_INDEX, 0x01);
64 smsc_config(IO_BASE_HI_INDEX, 0x02);
65 smsc_config(IO_BASE_LO_INDEX, 0xf8);
66 smsc_config(IRQ_SELECT_INDEX, 3); /* IRQ3 */
67
68 /* RTC */
69 smsc_config(CURRENT_LDN_INDEX, LDN_RTC);
70 smsc_config(ACTIVATE_INDEX, 0x01);
71 smsc_config(IRQ_SELECT_INDEX, 8); /* IRQ8 */
72
73 /* XXX: PARPORT, KBD, and MOUSE will come here... */
74 outb_p(CONFIG_EXIT, CONFIG_PORT);
75}
76#endif
77
78const char *get_system_type(void)
79{
80 return "7751 SolutionEngine";
81}
82 20
83#ifdef CONFIG_SH_KGDB 21#ifdef CONFIG_SH_KGDB
22#include <asm/kgdb.h>
84static int kgdb_uart_setup(void); 23static int kgdb_uart_setup(void);
85static struct kgdb_sermap kgdb_uart_sermap = 24static struct kgdb_sermap kgdb_uart_sermap =
86{ "ttyS", 0, kgdb_uart_setup, NULL }; 25{ "ttyS", 0, kgdb_uart_setup, NULL };
@@ -89,7 +28,7 @@ static struct kgdb_sermap kgdb_uart_sermap =
89/* 28/*
90 * Initialize the board 29 * Initialize the board
91 */ 30 */
92void __init platform_setup(void) 31static void __init sh7751se_setup(char **cmdline_p)
93{ 32{
94 /* Call init_smsc() replacement to set up SuperIO. */ 33 /* Call init_smsc() replacement to set up SuperIO. */
95 /* XXX: RTC setting comes here */ 34 /* XXX: RTC setting comes here */
@@ -223,3 +162,37 @@ static int kgdb_uart_setup(void)
223 return 0; 162 return 0;
224} 163}
225#endif /* CONFIG_SH_KGDB */ 164#endif /* CONFIG_SH_KGDB */
165
166
167/*
168 * The Machine Vector
169 */
170
171struct sh_machine_vector mv_7751se __initmv = {
172 .mv_name = "7751 SolutionEngine",
173 .mv_setup = sh7751se_setup,
174 .mv_nr_irqs = 72,
175
176 .mv_inb = sh7751se_inb,
177 .mv_inw = sh7751se_inw,
178 .mv_inl = sh7751se_inl,
179 .mv_outb = sh7751se_outb,
180 .mv_outw = sh7751se_outw,
181 .mv_outl = sh7751se_outl,
182
183 .mv_inb_p = sh7751se_inb_p,
184 .mv_inw_p = sh7751se_inw,
185 .mv_inl_p = sh7751se_inl,
186 .mv_outb_p = sh7751se_outb_p,
187 .mv_outw_p = sh7751se_outw,
188 .mv_outl_p = sh7751se_outl,
189
190 .mv_insl = sh7751se_insl,
191 .mv_outsl = sh7751se_outsl,
192
193 .mv_init_irq = init_7751se_IRQ,
194#ifdef CONFIG_HEARTBEAT
195 .mv_heartbeat = heartbeat_7751se,
196#endif
197};
198ALIAS_MV(7751se)