Skip to content

Commit c990081

Browse files
tsbogendralfbaechle
authored andcommitted
[MIPS] Fix IP32 breakage
- suppress master aborts during config read - set io_map_base - only fixup end of iomem resource to avoid failing request_resource in serial driver - killed useless setting of crime_int bit, which caused wrong interrupts - use physcial address for serial port platform device and let 8250 driver do the ioremap Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 9cfacb7 commit c990081

4 files changed

Lines changed: 19 additions & 13 deletions

File tree

‎arch/mips/pci/ops-mace.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ static int
4242
mace_pci_read_config(struct pci_bus *bus, unsigned int devfn,
4343
int reg, int size, u32 *val)
4444
{
45+
u32 control = mace->pci.control;
46+
47+
/* disable master aborts interrupts during config read */
48+
mace->pci.control = control & ~MACEPCI_CONTROL_MAR_INT;
4549
mace->pci.config_addr = mkaddr(bus, devfn, reg);
4650
switch (size) {
4751
case 1:
@@ -54,6 +58,9 @@ mace_pci_read_config(struct pci_bus *bus, unsigned int devfn,
5458
*val = mace->pci.config_data.l;
5559
break;
5660
}
61+
/* ack possible master abort */
62+
mace->pci.error &= ~MACEPCI_ERROR_MASTER_ABORT;
63+
mace->pci.control = control;
5764

5865
DPRINTK("read%d: reg=%08x,val=%02x\n", size * 8, reg, *val);
5966

‎arch/mips/pci/pci-ip32.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ static struct pci_controller mace_pci_controller = {
119119
.iommu = 0,
120120
.mem_offset = MACE_PCI_MEM_OFFSET,
121121
.io_offset = 0,
122+
.io_map_base = CKSEG1ADDR(MACEPCI_LOW_IO),
122123
};
123124

124125
static int __init mace_init(void)
@@ -135,7 +136,8 @@ static int __init mace_init(void)
135136
BUG_ON(request_irq(MACE_PCI_BRIDGE_IRQ, macepci_error, 0,
136137
"MACE PCI error", NULL));
137138

138-
iomem_resource = mace_pci_mem_resource;
139+
/* extend memory resources */
140+
iomem_resource.end = mace_pci_mem_resource.end;
139141
ioport_resource = mace_pci_io_resource;
140142

141143
register_pci_controller(&mace_pci_controller);

‎arch/mips/sgi-ip32/ip32-irq.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,6 @@ static void ip32_irq0(void)
426426

427427
crime_int = crime->istat & crime_mask;
428428
irq = MACE_VID_IN1_IRQ + __ffs(crime_int);
429-
crime_int = 1 << irq;
430429

431430
if (crime_int & CRIME_MACEISA_INT_MASK) {
432431
unsigned long mace_int = mace->perif.ctrl.istat;

‎arch/mips/sgi-ip32/ip32-platform.c‎

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,22 @@
1313
#include <asm/ip32/mace.h>
1414
#include <asm/ip32/ip32_ints.h>
1515

16-
/*
17-
* .iobase isn't a constant (in the sense of C) so we fill it in at runtime.
18-
*/
19-
#define MACE_PORT(int) \
16+
#define MACEISA_SERIAL1_OFFS offsetof(struct sgi_mace, isa.serial1)
17+
#define MACEISA_SERIAL2_OFFS offsetof(struct sgi_mace, isa.serial2)
18+
19+
#define MACE_PORT(offset,_irq) \
2020
{ \
21-
.irq = int, \
21+
.mapbase = MACE_BASE + offset, \
22+
.irq = _irq, \
2223
.uartclk = 1843200, \
2324
.iotype = UPIO_MEM, \
24-
.flags = UPF_SKIP_TEST, \
25+
.flags = UPF_SKIP_TEST|UPF_IOREMAP, \
2526
.regshift = 8, \
2627
}
2728

2829
static struct plat_serial8250_port uart8250_data[] = {
29-
MACE_PORT(MACEISA_SERIAL1_IRQ),
30-
MACE_PORT(MACEISA_SERIAL2_IRQ),
30+
MACE_PORT(MACEISA_SERIAL1_OFFS, MACEISA_SERIAL1_IRQ),
31+
MACE_PORT(MACEISA_SERIAL2_OFFS, MACEISA_SERIAL2_IRQ),
3132
{ },
3233
};
3334

@@ -41,9 +42,6 @@ static struct platform_device uart8250_device = {
4142

4243
static int __init uart8250_init(void)
4344
{
44-
uart8250_data[0].membase = (void __iomem *) &mace->isa.serial1;
45-
uart8250_data[1].membase = (void __iomem *) &mace->isa.serial2;
46-
4745
return platform_device_register(&uart8250_device);
4846
}
4947

0 commit comments

Comments
 (0)