aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/mpc1211/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/boards/mpc1211/setup.c')
-rw-r--r--arch/sh/boards/mpc1211/setup.c71
1 files changed, 19 insertions, 52 deletions
diff --git a/arch/sh/boards/mpc1211/setup.c b/arch/sh/boards/mpc1211/setup.c
index 2bfb221cc35..8eb5d430397 100644
--- a/arch/sh/boards/mpc1211/setup.c
+++ b/arch/sh/boards/mpc1211/setup.c
@@ -10,14 +10,12 @@
10#include <linux/hdreg.h> 10#include <linux/hdreg.h>
11#include <linux/ide.h> 11#include <linux/ide.h>
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13
14#include <asm/io.h> 13#include <asm/io.h>
15#include <asm/machvec.h> 14#include <asm/machvec.h>
16#include <asm/mpc1211/mpc1211.h> 15#include <asm/mpc1211/mpc1211.h>
17#include <asm/mpc1211/pci.h> 16#include <asm/mpc1211/pci.h>
18#include <asm/mpc1211/m1543c.h> 17#include <asm/mpc1211/m1543c.h>
19 18
20
21/* ALI15X3 SMBus address offsets */ 19/* ALI15X3 SMBus address offsets */
22#define SMBHSTSTS (0 + 0x3100) 20#define SMBHSTSTS (0 + 0x3100)
23#define SMBHSTCNT (1 + 0x3100) 21#define SMBHSTCNT (1 + 0x3100)
@@ -50,11 +48,6 @@
50#define ALI15X3_STS_TERM 0x80 /* terminated by abort */ 48#define ALI15X3_STS_TERM 0x80 /* terminated by abort */
51#define ALI15X3_STS_ERR 0xE0 /* all the bad error bits */ 49#define ALI15X3_STS_ERR 0xE0 /* all the bad error bits */
52 50
53const char *get_system_type(void)
54{
55 return "Interface MPC-1211(CTP/PCI/MPC-SH02)";
56}
57
58static void __init pci_write_config(unsigned long busNo, 51static void __init pci_write_config(unsigned long busNo,
59 unsigned long devNo, 52 unsigned long devNo,
60 unsigned long fncNo, 53 unsigned long fncNo,
@@ -80,9 +73,6 @@ volatile unsigned long irq_err_count;
80 73
81static void disable_mpc1211_irq(unsigned int irq) 74static void disable_mpc1211_irq(unsigned int irq)
82{ 75{
83 unsigned long flags;
84
85 save_and_cli(flags);
86 if( irq < 8) { 76 if( irq < 8) {
87 m_irq_mask |= (1 << irq); 77 m_irq_mask |= (1 << irq);
88 outb(m_irq_mask,I8259_M_MR); 78 outb(m_irq_mask,I8259_M_MR);
@@ -90,16 +80,11 @@ static void disable_mpc1211_irq(unsigned int irq)
90 s_irq_mask |= (1 << (irq - 8)); 80 s_irq_mask |= (1 << (irq - 8));
91 outb(s_irq_mask,I8259_S_MR); 81 outb(s_irq_mask,I8259_S_MR);
92 } 82 }
93 restore_flags(flags);
94 83
95} 84}
96 85
97static void enable_mpc1211_irq(unsigned int irq) 86static void enable_mpc1211_irq(unsigned int irq)
98{ 87{
99 unsigned long flags;
100
101 save_and_cli(flags);
102
103 if( irq < 8) { 88 if( irq < 8) {
104 m_irq_mask &= ~(1 << irq); 89 m_irq_mask &= ~(1 << irq);
105 outb(m_irq_mask,I8259_M_MR); 90 outb(m_irq_mask,I8259_M_MR);
@@ -107,7 +92,6 @@ static void enable_mpc1211_irq(unsigned int irq)
107 s_irq_mask &= ~(1 << (irq - 8)); 92 s_irq_mask &= ~(1 << (irq - 8));
108 outb(s_irq_mask,I8259_S_MR); 93 outb(s_irq_mask,I8259_S_MR);
109 } 94 }
110 restore_flags(flags);
111} 95}
112 96
113static inline int mpc1211_irq_real(unsigned int irq) 97static inline int mpc1211_irq_real(unsigned int irq)
@@ -131,10 +115,6 @@ static inline int mpc1211_irq_real(unsigned int irq)
131 115
132static void mask_and_ack_mpc1211(unsigned int irq) 116static void mask_and_ack_mpc1211(unsigned int irq)
133{ 117{
134 unsigned long flags;
135
136 save_and_cli(flags);
137
138 if(irq < 8) { 118 if(irq < 8) {
139 if(m_irq_mask & (1<<irq)){ 119 if(m_irq_mask & (1<<irq)){
140 if(!mpc1211_irq_real(irq)){ 120 if(!mpc1211_irq_real(irq)){
@@ -162,7 +142,6 @@ static void mask_and_ack_mpc1211(unsigned int irq)
162 outb(0x60+(irq-8),I8259_S_CR); /* EOI */ 142 outb(0x60+(irq-8),I8259_S_CR); /* EOI */
163 outb(0x60+2,I8259_M_CR); 143 outb(0x60+2,I8259_M_CR);
164 } 144 }
165 restore_flags(flags);
166} 145}
167 146
168static void end_mpc1211_irq(unsigned int irq) 147static void end_mpc1211_irq(unsigned int irq)
@@ -219,7 +198,7 @@ int mpc1211_irq_demux(int irq)
219 return irq; 198 return irq;
220} 199}
221 200
222void __init init_mpc1211_IRQ(void) 201static void __init init_mpc1211_IRQ(void)
223{ 202{
224 int i; 203 int i;
225 /* 204 /*
@@ -255,23 +234,12 @@ void __init init_mpc1211_IRQ(void)
255 } 234 }
256} 235}
257 236
258/* 237static void delay1000(void)
259 Initialize the board
260*/
261
262
263static void delay (void)
264{
265 volatile unsigned short tmp;
266 tmp = *(volatile unsigned short *) 0xa0000000;
267}
268
269static void delay1000 (void)
270{ 238{
271 int i; 239 int i;
272 240
273 for (i=0; i<1000; i++) 241 for (i=0; i<1000; i++)
274 delay (); 242 ctrl_delay();
275} 243}
276 244
277static int put_smb_blk(unsigned char *p, int address, int command, int no) 245static int put_smb_blk(unsigned char *p, int address, int command, int no)
@@ -314,26 +282,10 @@ static int put_smb_blk(unsigned char *p, int address, int command, int no)
314 return 0; 282 return 0;
315} 283}
316 284
317/*
318 * The Machine Vector
319 */
320
321struct sh_machine_vector mv_mpc1211 __initmv = {
322 .mv_nr_irqs = 48,
323 .mv_irq_demux = mpc1211_irq_demux,
324 .mv_init_irq = init_mpc1211_IRQ,
325
326#ifdef CONFIG_HEARTBEAT
327 .mv_heartbeat = heartbeat_mpc1211,
328#endif
329};
330
331ALIAS_MV(mpc1211)
332
333/* arch/sh/boards/mpc1211/rtc.c */ 285/* arch/sh/boards/mpc1211/rtc.c */
334void mpc1211_time_init(void); 286void mpc1211_time_init(void);
335 287
336int __init platform_setup(void) 288static void __init mpc1211_setup(char **cmdline_p)
337{ 289{
338 unsigned char spd_buf[128]; 290 unsigned char spd_buf[128];
339 291
@@ -357,3 +309,18 @@ int __init platform_setup(void)
357 return 0; 309 return 0;
358} 310}
359 311
312/*
313 * The Machine Vector
314 */
315struct sh_machine_vector mv_mpc1211 __initmv = {
316 .mv_name = "Interface MPC-1211(CTP/PCI/MPC-SH02)",
317 .mv_setup = mpc1211_setup,
318 .mv_nr_irqs = 48,
319 .mv_irq_demux = mpc1211_irq_demux,
320 .mv_init_irq = init_mpc1211_IRQ,
321
322#ifdef CONFIG_HEARTBEAT
323 .mv_heartbeat = heartbeat_mpc1211,
324#endif
325};
326ALIAS_MV(mpc1211)