aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-09-16 17:11:43 -0400
committerDavid S. Miller <davem@davemloft.net>2008-09-16 17:11:43 -0400
commit2e57572a50a4de41c6cbc879a4866a312d4cd316 (patch)
treec4f58ec96c06642c4b415b881d3f0a3b673d5b44 /arch/sparc64
parent9b2e43ae4e9609f80034dfe8de895045cac52d77 (diff)
parentf948cc6ab9e61a8e88d70ee9aafc690e6d26f92c (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Conflicts: arch/sparc64/kernel/pci_psycho.c
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/kernel/irq.c2
-rw-r--r--arch/sparc64/kernel/pci_psycho.c33
-rw-r--r--arch/sparc64/kernel/prom.c104
-rw-r--r--arch/sparc64/kernel/psycho_common.c8
-rw-r--r--arch/sparc64/kernel/psycho_common.h25
5 files changed, 41 insertions, 131 deletions
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index 2817a272b4cf..70fdb3bad3a5 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -791,6 +791,8 @@ void fixup_irqs(void)
791 } 791 }
792 spin_unlock_irqrestore(&irq_desc[irq].lock, flags); 792 spin_unlock_irqrestore(&irq_desc[irq].lock, flags);
793 } 793 }
794
795 tick_ops->disable_irq();
794} 796}
795#endif 797#endif
796 798
diff --git a/arch/sparc64/kernel/pci_psycho.c b/arch/sparc64/kernel/pci_psycho.c
index 897334680657..dfb3ec892987 100644
--- a/arch/sparc64/kernel/pci_psycho.c
+++ b/arch/sparc64/kernel/pci_psycho.c
@@ -52,33 +52,6 @@
52#define PSYCHO_PCICTRL_RESV4 0x00000000000000c0UL /* Reserved */ 52#define PSYCHO_PCICTRL_RESV4 0x00000000000000c0UL /* Reserved */
53#define PSYCHO_PCICTRL_AEN 0x000000000000003fUL /* PCI DVMA Arbitration Enable */ 53#define PSYCHO_PCICTRL_AEN 0x000000000000003fUL /* PCI DVMA Arbitration Enable */
54 54
55/* U2P Programmer's Manual, page 13-55, configuration space
56 * address format:
57 *
58 * 32 24 23 16 15 11 10 8 7 2 1 0
59 * ---------------------------------------------------------
60 * |0 0 0 0 0 0 0 0 1| bus | device | function | reg | 0 0 |
61 * ---------------------------------------------------------
62 */
63#define PSYCHO_CONFIG_BASE(PBM) \
64 ((PBM)->config_space | (1UL << 24))
65#define PSYCHO_CONFIG_ENCODE(BUS, DEVFN, REG) \
66 (((unsigned long)(BUS) << 16) | \
67 ((unsigned long)(DEVFN) << 8) | \
68 ((unsigned long)(REG)))
69
70static void *psycho_pci_config_mkaddr(struct pci_pbm_info *pbm,
71 unsigned char bus,
72 unsigned int devfn,
73 int where)
74{
75 if (!pbm)
76 return NULL;
77 return (void *)
78 (PSYCHO_CONFIG_BASE(pbm) |
79 PSYCHO_CONFIG_ENCODE(bus, devfn, where));
80}
81
82/* PSYCHO error handling support. */ 55/* PSYCHO error handling support. */
83 56
84/* Helper function of IOMMU error checking, which checks out 57/* Helper function of IOMMU error checking, which checks out
@@ -339,16 +312,16 @@ static void psycho_register_error_handlers(struct pci_pbm_info *pbm)
339 * the second will just error out since we do not pass in 312 * the second will just error out since we do not pass in
340 * IRQF_SHARED. 313 * IRQF_SHARED.
341 */ 314 */
342 err = request_irq(op->irqs[1], psycho_ue_intr, 0, 315 err = request_irq(op->irqs[1], psycho_ue_intr, IRQF_SHARED,
343 "PSYCHO_UE", pbm); 316 "PSYCHO_UE", pbm);
344 err = request_irq(op->irqs[2], psycho_ce_intr, 0, 317 err = request_irq(op->irqs[2], psycho_ce_intr, IRQF_SHARED,
345 "PSYCHO_CE", pbm); 318 "PSYCHO_CE", pbm);
346 319
347 /* This one, however, ought not to fail. We can just warn 320 /* This one, however, ought not to fail. We can just warn
348 * about it since the system can still operate properly even 321 * about it since the system can still operate properly even
349 * if this fails. 322 * if this fails.
350 */ 323 */
351 err = request_irq(op->irqs[0], psycho_pcierr_intr, 0, 324 err = request_irq(op->irqs[0], psycho_pcierr_intr, IRQF_SHARED,
352 "PSYCHO_PCIERR", pbm); 325 "PSYCHO_PCIERR", pbm);
353 if (err) 326 if (err)
354 printk(KERN_WARNING "%s: Could not register PCIERR, " 327 printk(KERN_WARNING "%s: Could not register PCIERR, "
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index 5f50e2b17a8f..dbba82f9b142 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -162,55 +162,11 @@ static unsigned long psycho_pcislot_imap_offset(unsigned long ino)
162 return PSYCHO_IMAP_B_SLOT0 + (slot * 8); 162 return PSYCHO_IMAP_B_SLOT0 + (slot * 8);
163} 163}
164 164
165#define PSYCHO_IMAP_SCSI 0x1000UL 165#define PSYCHO_OBIO_IMAP_BASE 0x1000UL
166#define PSYCHO_IMAP_ETH 0x1008UL 166
167#define PSYCHO_IMAP_BPP 0x1010UL
168#define PSYCHO_IMAP_AU_REC 0x1018UL
169#define PSYCHO_IMAP_AU_PLAY 0x1020UL
170#define PSYCHO_IMAP_PFAIL 0x1028UL
171#define PSYCHO_IMAP_KMS 0x1030UL
172#define PSYCHO_IMAP_FLPY 0x1038UL
173#define PSYCHO_IMAP_SHW 0x1040UL
174#define PSYCHO_IMAP_KBD 0x1048UL
175#define PSYCHO_IMAP_MS 0x1050UL
176#define PSYCHO_IMAP_SER 0x1058UL
177#define PSYCHO_IMAP_TIM0 0x1060UL
178#define PSYCHO_IMAP_TIM1 0x1068UL
179#define PSYCHO_IMAP_UE 0x1070UL
180#define PSYCHO_IMAP_CE 0x1078UL
181#define PSYCHO_IMAP_A_ERR 0x1080UL
182#define PSYCHO_IMAP_B_ERR 0x1088UL
183#define PSYCHO_IMAP_PMGMT 0x1090UL
184#define PSYCHO_IMAP_GFX 0x1098UL
185#define PSYCHO_IMAP_EUPA 0x10a0UL
186
187static unsigned long __psycho_onboard_imap_off[] = {
188/*0x20*/ PSYCHO_IMAP_SCSI,
189/*0x21*/ PSYCHO_IMAP_ETH,
190/*0x22*/ PSYCHO_IMAP_BPP,
191/*0x23*/ PSYCHO_IMAP_AU_REC,
192/*0x24*/ PSYCHO_IMAP_AU_PLAY,
193/*0x25*/ PSYCHO_IMAP_PFAIL,
194/*0x26*/ PSYCHO_IMAP_KMS,
195/*0x27*/ PSYCHO_IMAP_FLPY,
196/*0x28*/ PSYCHO_IMAP_SHW,
197/*0x29*/ PSYCHO_IMAP_KBD,
198/*0x2a*/ PSYCHO_IMAP_MS,
199/*0x2b*/ PSYCHO_IMAP_SER,
200/*0x2c*/ PSYCHO_IMAP_TIM0,
201/*0x2d*/ PSYCHO_IMAP_TIM1,
202/*0x2e*/ PSYCHO_IMAP_UE,
203/*0x2f*/ PSYCHO_IMAP_CE,
204/*0x30*/ PSYCHO_IMAP_A_ERR,
205/*0x31*/ PSYCHO_IMAP_B_ERR,
206/*0x32*/ PSYCHO_IMAP_PMGMT,
207/*0x33*/ PSYCHO_IMAP_GFX,
208/*0x34*/ PSYCHO_IMAP_EUPA,
209};
210#define PSYCHO_ONBOARD_IRQ_BASE 0x20 167#define PSYCHO_ONBOARD_IRQ_BASE 0x20
211#define PSYCHO_ONBOARD_IRQ_LAST 0x34
212#define psycho_onboard_imap_offset(__ino) \ 168#define psycho_onboard_imap_offset(__ino) \
213 __psycho_onboard_imap_off[(__ino) - PSYCHO_ONBOARD_IRQ_BASE] 169 (PSYCHO_OBIO_IMAP_BASE + (((__ino) & 0x1f) << 3))
214 170
215#define PSYCHO_ICLR_A_SLOT0 0x1400UL 171#define PSYCHO_ICLR_A_SLOT0 0x1400UL
216#define PSYCHO_ICLR_SCSI 0x1800UL 172#define PSYCHO_ICLR_SCSI 0x1800UL
@@ -234,10 +190,6 @@ static unsigned int psycho_irq_build(struct device_node *dp,
234 imap_off = psycho_pcislot_imap_offset(ino); 190 imap_off = psycho_pcislot_imap_offset(ino);
235 } else { 191 } else {
236 /* Onboard device */ 192 /* Onboard device */
237 if (ino > PSYCHO_ONBOARD_IRQ_LAST) {
238 prom_printf("psycho_irq_build: Wacky INO [%x]\n", ino);
239 prom_halt();
240 }
241 imap_off = psycho_onboard_imap_offset(ino); 193 imap_off = psycho_onboard_imap_offset(ino);
242 } 194 }
243 195
@@ -324,23 +276,6 @@ static void sabre_wsync_handler(unsigned int ino, void *_arg1, void *_arg2)
324 276
325#define SABRE_IMAP_A_SLOT0 0x0c00UL 277#define SABRE_IMAP_A_SLOT0 0x0c00UL
326#define SABRE_IMAP_B_SLOT0 0x0c20UL 278#define SABRE_IMAP_B_SLOT0 0x0c20UL
327#define SABRE_IMAP_SCSI 0x1000UL
328#define SABRE_IMAP_ETH 0x1008UL
329#define SABRE_IMAP_BPP 0x1010UL
330#define SABRE_IMAP_AU_REC 0x1018UL
331#define SABRE_IMAP_AU_PLAY 0x1020UL
332#define SABRE_IMAP_PFAIL 0x1028UL
333#define SABRE_IMAP_KMS 0x1030UL
334#define SABRE_IMAP_FLPY 0x1038UL
335#define SABRE_IMAP_SHW 0x1040UL
336#define SABRE_IMAP_KBD 0x1048UL
337#define SABRE_IMAP_MS 0x1050UL
338#define SABRE_IMAP_SER 0x1058UL
339#define SABRE_IMAP_UE 0x1070UL
340#define SABRE_IMAP_CE 0x1078UL
341#define SABRE_IMAP_PCIERR 0x1080UL
342#define SABRE_IMAP_GFX 0x1098UL
343#define SABRE_IMAP_EUPA 0x10a0UL
344#define SABRE_ICLR_A_SLOT0 0x1400UL 279#define SABRE_ICLR_A_SLOT0 0x1400UL
345#define SABRE_ICLR_B_SLOT0 0x1480UL 280#define SABRE_ICLR_B_SLOT0 0x1480UL
346#define SABRE_ICLR_SCSI 0x1800UL 281#define SABRE_ICLR_SCSI 0x1800UL
@@ -370,33 +305,10 @@ static unsigned long sabre_pcislot_imap_offset(unsigned long ino)
370 return SABRE_IMAP_B_SLOT0 + (slot * 8); 305 return SABRE_IMAP_B_SLOT0 + (slot * 8);
371} 306}
372 307
373static unsigned long __sabre_onboard_imap_off[] = { 308#define SABRE_OBIO_IMAP_BASE 0x1000UL
374/*0x20*/ SABRE_IMAP_SCSI, 309#define SABRE_ONBOARD_IRQ_BASE 0x20
375/*0x21*/ SABRE_IMAP_ETH,
376/*0x22*/ SABRE_IMAP_BPP,
377/*0x23*/ SABRE_IMAP_AU_REC,
378/*0x24*/ SABRE_IMAP_AU_PLAY,
379/*0x25*/ SABRE_IMAP_PFAIL,
380/*0x26*/ SABRE_IMAP_KMS,
381/*0x27*/ SABRE_IMAP_FLPY,
382/*0x28*/ SABRE_IMAP_SHW,
383/*0x29*/ SABRE_IMAP_KBD,
384/*0x2a*/ SABRE_IMAP_MS,
385/*0x2b*/ SABRE_IMAP_SER,
386/*0x2c*/ 0 /* reserved */,
387/*0x2d*/ 0 /* reserved */,
388/*0x2e*/ SABRE_IMAP_UE,
389/*0x2f*/ SABRE_IMAP_CE,
390/*0x30*/ SABRE_IMAP_PCIERR,
391/*0x31*/ 0 /* reserved */,
392/*0x32*/ 0 /* reserved */,
393/*0x33*/ SABRE_IMAP_GFX,
394/*0x34*/ SABRE_IMAP_EUPA,
395};
396#define SABRE_ONBOARD_IRQ_BASE 0x20
397#define SABRE_ONBOARD_IRQ_LAST 0x30
398#define sabre_onboard_imap_offset(__ino) \ 310#define sabre_onboard_imap_offset(__ino) \
399 __sabre_onboard_imap_off[(__ino) - SABRE_ONBOARD_IRQ_BASE] 311 (SABRE_OBIO_IMAP_BASE + (((__ino) & 0x1f) << 3))
400 312
401#define sabre_iclr_offset(ino) \ 313#define sabre_iclr_offset(ino) \
402 ((ino & 0x20) ? (SABRE_ICLR_SCSI + (((ino) & 0x1f) << 3)) : \ 314 ((ino & 0x20) ? (SABRE_ICLR_SCSI + (((ino) & 0x1f) << 3)) : \
@@ -459,10 +371,6 @@ static unsigned int sabre_irq_build(struct device_node *dp,
459 imap_off = sabre_pcislot_imap_offset(ino); 371 imap_off = sabre_pcislot_imap_offset(ino);
460 } else { 372 } else {
461 /* onboard device */ 373 /* onboard device */
462 if (ino > SABRE_ONBOARD_IRQ_LAST) {
463 prom_printf("sabre_irq_build: Wacky INO [%x]\n", ino);
464 prom_halt();
465 }
466 imap_off = sabre_onboard_imap_offset(ino); 374 imap_off = sabre_onboard_imap_offset(ino);
467 } 375 }
468 376
diff --git a/arch/sparc64/kernel/psycho_common.c b/arch/sparc64/kernel/psycho_common.c
index 6b188dfeeb9d..790996428c14 100644
--- a/arch/sparc64/kernel/psycho_common.c
+++ b/arch/sparc64/kernel/psycho_common.c
@@ -252,7 +252,7 @@ static irqreturn_t psycho_pcierr_intr_other(struct pci_pbm_info *pbm)
252{ 252{
253 irqreturn_t ret = IRQ_NONE; 253 irqreturn_t ret = IRQ_NONE;
254 u64 csr, csr_error_bits; 254 u64 csr, csr_error_bits;
255 u16 stat; 255 u16 stat, *addr;
256 256
257 csr = upa_readq(pbm->pci_csr); 257 csr = upa_readq(pbm->pci_csr);
258 csr_error_bits = csr & (PSYCHO_PCICTRL_SBH_ERR | PSYCHO_PCICTRL_SERR); 258 csr_error_bits = csr & (PSYCHO_PCICTRL_SBH_ERR | PSYCHO_PCICTRL_SERR);
@@ -269,7 +269,9 @@ static irqreturn_t psycho_pcierr_intr_other(struct pci_pbm_info *pbm)
269 pbm->name); 269 pbm->name);
270 ret = IRQ_HANDLED; 270 ret = IRQ_HANDLED;
271 } 271 }
272 pci_read_config_word(pbm->pci_bus->self, PCI_STATUS, &stat); 272 addr = psycho_pci_config_mkaddr(pbm, pbm->pci_first_busno,
273 0, PCI_STATUS);
274 pci_config_read16(addr, &stat);
273 if (stat & (PCI_STATUS_PARITY | 275 if (stat & (PCI_STATUS_PARITY |
274 PCI_STATUS_SIG_TARGET_ABORT | 276 PCI_STATUS_SIG_TARGET_ABORT |
275 PCI_STATUS_REC_TARGET_ABORT | 277 PCI_STATUS_REC_TARGET_ABORT |
@@ -277,7 +279,7 @@ static irqreturn_t psycho_pcierr_intr_other(struct pci_pbm_info *pbm)
277 PCI_STATUS_SIG_SYSTEM_ERROR)) { 279 PCI_STATUS_SIG_SYSTEM_ERROR)) {
278 printk(KERN_ERR "%s: PCI bus error, PCI_STATUS[%04x]\n", 280 printk(KERN_ERR "%s: PCI bus error, PCI_STATUS[%04x]\n",
279 pbm->name, stat); 281 pbm->name, stat);
280 pci_write_config_word(pbm->pci_bus->self, PCI_STATUS, 0xffff); 282 pci_config_write16(addr, 0xffff);
281 ret = IRQ_HANDLED; 283 ret = IRQ_HANDLED;
282 } 284 }
283 return ret; 285 return ret;
diff --git a/arch/sparc64/kernel/psycho_common.h b/arch/sparc64/kernel/psycho_common.h
index b53aa8dcad2c..092c278ef28d 100644
--- a/arch/sparc64/kernel/psycho_common.h
+++ b/arch/sparc64/kernel/psycho_common.h
@@ -1,6 +1,31 @@
1#ifndef _PSYCHO_COMMON_H 1#ifndef _PSYCHO_COMMON_H
2#define _PSYCHO_COMMON_H 2#define _PSYCHO_COMMON_H
3 3
4/* U2P Programmer's Manual, page 13-55, configuration space
5 * address format:
6 *
7 * 32 24 23 16 15 11 10 8 7 2 1 0
8 * ---------------------------------------------------------
9 * |0 0 0 0 0 0 0 0 1| bus | device | function | reg | 0 0 |
10 * ---------------------------------------------------------
11 */
12#define PSYCHO_CONFIG_BASE(PBM) \
13 ((PBM)->config_space | (1UL << 24))
14#define PSYCHO_CONFIG_ENCODE(BUS, DEVFN, REG) \
15 (((unsigned long)(BUS) << 16) | \
16 ((unsigned long)(DEVFN) << 8) | \
17 ((unsigned long)(REG)))
18
19static inline void *psycho_pci_config_mkaddr(struct pci_pbm_info *pbm,
20 unsigned char bus,
21 unsigned int devfn,
22 int where)
23{
24 return (void *)
25 (PSYCHO_CONFIG_BASE(pbm) |
26 PSYCHO_CONFIG_ENCODE(bus, devfn, where));
27}
28
4enum psycho_error_type { 29enum psycho_error_type {
5 UE_ERR, CE_ERR, PCI_ERR 30 UE_ERR, CE_ERR, PCI_ERR
6}; 31};