Skip to content

Commit 5076c15

Browse files
Helge DellerKyle McMartin
authored andcommitted
[PARISC] I/O-Space must be ioremap_nocache()'d
Addresses in F-space must be accessed uncached on most parisc machines. Signed-off-by: Helge Deller <deller@parisc-linux.org> Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
1 parent 94c3e87 commit 5076c15

13 files changed

Lines changed: 48 additions & 54 deletions

File tree

‎arch/parisc/kernel/perf.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ static int perf_write_image(uint64_t *memaddr)
805805
return -1;
806806
}
807807

808-
runway = ioremap(cpu_device->hpa.start, 4096);
808+
runway = ioremap_nocache(cpu_device->hpa.start, 4096);
809809

810810
/* Merge intrigue bits into Runway STATUS 0 */
811811
tmp64 = __raw_readq(runway + RUNWAY_STATUS) & 0xffecfffffffffffful;

‎drivers/input/serio/gscps2.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* drivers/input/serio/gscps2.c
33
*
4-
* Copyright (c) 2004 Helge Deller <deller@gmx.de>
4+
* Copyright (c) 2004-2006 Helge Deller <deller@gmx.de>
55
* Copyright (c) 2002 Laurent Canet <canetl@esiee.fr>
66
* Copyright (c) 2002 Thibaut Varene <varenet@parisc-linux.org>
77
*
@@ -354,7 +354,7 @@ static int __init gscps2_probe(struct parisc_device *dev)
354354
memset(serio, 0, sizeof(struct serio));
355355
ps2port->port = serio;
356356
ps2port->padev = dev;
357-
ps2port->addr = ioremap(hpa, GSC_STATUS + 4);
357+
ps2port->addr = ioremap_nocache(hpa, GSC_STATUS + 4);
358358
spin_lock_init(&ps2port->lock);
359359

360360
gscps2_reset(ps2port);

‎drivers/parisc/ccio-dma.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1560,7 +1560,7 @@ static int ccio_probe(struct parisc_device *dev)
15601560
*ioc_p = ioc;
15611561

15621562
ioc->hw_path = dev->hw_path;
1563-
ioc->ioc_regs = ioremap(dev->hpa.start, 4096);
1563+
ioc->ioc_regs = ioremap_nocache(dev->hpa.start, 4096);
15641564
ccio_ioc_init(ioc);
15651565
ccio_init_resources(ioc);
15661566
hppa_dma_ops = &ccio_ops;

‎drivers/parisc/dino.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
** (c) Copyright 1999 SuSE GmbH
66
** (c) Copyright 1999,2000 Hewlett-Packard Company
77
** (c) Copyright 2000 Grant Grundler
8+
** (c) Copyright 2006 Helge Deller
89
**
910
** This program is free software; you can redistribute it and/or modify
1011
** it under the terms of the GNU General Public License as published by
@@ -785,7 +786,7 @@ dino_bridge_init(struct dino_device *dino_dev, const char *name)
785786
if((io_addr & (1 << i)) == 0)
786787
continue;
787788

788-
start = (unsigned long)(signed int)(0xf0000000 | (i << 23));
789+
start = F_EXTEND(0xf0000000UL) | (i << 23);
789790
end = start + 8 * 1024 * 1024 - 1;
790791

791792
DBG("DINO RANGE %d is at 0x%lx-0x%lx\n", count,
@@ -996,7 +997,7 @@ static int __init dino_probe(struct parisc_device *dev)
996997
}
997998

998999
dino_dev->hba.dev = dev;
999-
dino_dev->hba.base_addr = ioremap(hpa, 4096);
1000+
dino_dev->hba.base_addr = ioremap_nocache(hpa, 4096);
10001001
dino_dev->hba.lmmio_space_offset = 0; /* CPU addrs == bus addrs */
10011002
spin_lock_init(&dino_dev->dinosaur_pen);
10021003
dino_dev->hba.iommu = ccio_get_iommu(dev);

‎drivers/parisc/eisa.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ static int __devinit eisa_probe(struct parisc_device *dev)
366366
eisa_dev.eeprom_addr = MIRAGE_EEPROM_BASE_ADDR;
367367
}
368368
}
369-
eisa_eeprom_addr = ioremap(eisa_dev.eeprom_addr, HPEE_MAX_LENGTH);
369+
eisa_eeprom_addr = ioremap_nocache(eisa_dev.eeprom_addr, HPEE_MAX_LENGTH);
370370
result = eisa_enumerator(eisa_dev.eeprom_addr, &eisa_dev.hba.io_space,
371371
&eisa_dev.hba.lmmio_space);
372372
init_eisa_pic();

‎drivers/parisc/iosapic.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ void *iosapic_register(unsigned long hpa)
879879
return NULL;
880880
}
881881

882-
isi->addr = ioremap(hpa, 4096);
882+
isi->addr = ioremap_nocache(hpa, 4096);
883883
isi->isi_hpa = hpa;
884884
isi->isi_version = iosapic_rd_version(isi);
885885
isi->isi_num_vectors = IOSAPIC_IRDT_MAX_ENTRY(isi->isi_version) + 1;

‎drivers/parisc/lba_pci.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
12131213
** Postable I/O port space is per PCI host adapter.
12141214
** base of 64MB PIOP region
12151215
*/
1216-
lba_dev->iop_base = ioremap(p->start, 64 * 1024 * 1024);
1216+
lba_dev->iop_base = ioremap_nocache(p->start, 64 * 1024 * 1024);
12171217

12181218
sprintf(lba_dev->hba.io_name, "PCI%02lx Ports",
12191219
lba_dev->hba.bus_num.start);
@@ -1525,7 +1525,7 @@ lba_driver_probe(struct parisc_device *dev)
15251525
u32 func_class;
15261526
void *tmp_obj;
15271527
char *version;
1528-
void __iomem *addr = ioremap(dev->hpa.start, 4096);
1528+
void __iomem *addr = ioremap_nocache(dev->hpa.start, 4096);
15291529

15301530
/* Read HW Rev First */
15311531
func_class = READ_REG32(addr + LBA_FCLASS);
@@ -1619,7 +1619,7 @@ lba_driver_probe(struct parisc_device *dev)
16191619
} else {
16201620
if (!astro_iop_base) {
16211621
/* Sprockets PDC uses NPIOP region */
1622-
astro_iop_base = ioremap(LBA_PORT_BASE, 64 * 1024);
1622+
astro_iop_base = ioremap_nocache(LBA_PORT_BASE, 64 * 1024);
16231623
pci_port = &lba_astro_port_ops;
16241624
}
16251625

@@ -1700,7 +1700,7 @@ void __init lba_init(void)
17001700
*/
17011701
void lba_set_iregs(struct parisc_device *lba, u32 ibase, u32 imask)
17021702
{
1703-
void __iomem * base_addr = ioremap(lba->hpa.start, 4096);
1703+
void __iomem * base_addr = ioremap_nocache(lba->hpa.start, 4096);
17041704

17051705
imask <<= 2; /* adjust for hints - 2 more bits */
17061706

‎drivers/parisc/sba_iommu.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,9 +1642,9 @@ sba_ioc_init(struct parisc_device *sba, struct ioc *ioc, int ioc_num)
16421642
**
16431643
**************************************************************************/
16441644

1645-
static void __iomem *ioc_remap(struct sba_device *sba_dev, int offset)
1645+
static void __iomem *ioc_remap(struct sba_device *sba_dev, unsigned int offset)
16461646
{
1647-
return ioremap(sba_dev->dev->hpa.start + offset, SBA_FUNC_SIZE);
1647+
return ioremap_nocache(sba_dev->dev->hpa.start + offset, SBA_FUNC_SIZE);
16481648
}
16491649

16501650
static void sba_hw_init(struct sba_device *sba_dev)
@@ -2040,7 +2040,7 @@ sba_driver_callback(struct parisc_device *dev)
20402040
u32 func_class;
20412041
int i;
20422042
char *version;
2043-
void __iomem *sba_addr = ioremap(dev->hpa.start, SBA_FUNC_SIZE);
2043+
void __iomem *sba_addr = ioremap_nocache(dev->hpa.start, SBA_FUNC_SIZE);
20442044
struct proc_dir_entry *info_entry, *bitmap_entry, *root;
20452045

20462046
sba_dump_ranges(sba_addr);

‎drivers/parisc/superio.c‎

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* (C) Copyright 2001 John Marvin <jsm fc hp com>
1313
* (C) Copyright 2003 Grant Grundler <grundler parisc-linux org>
1414
* (C) Copyright 2005 Kyle McMartin <kyle@parisc-linux.org>
15+
* (C) Copyright 2006 Helge Deller <deller@gmx.de>
1516
*
1617
* This program is free software; you can redistribute it and/or
1718
* modify it under the terms of the GNU General Public License as
@@ -388,43 +389,34 @@ int superio_fixup_irq(struct pci_dev *pcidev)
388389
return local_irq;
389390
}
390391

391-
static struct uart_port serial[] = {
392-
{
393-
.iotype = UPIO_PORT,
394-
.line = 0,
395-
.type = PORT_16550A,
396-
.uartclk = 115200*16,
397-
.fifosize = 16,
398-
},
399-
{
400-
.iotype = UPIO_PORT,
401-
.line = 1,
402-
.type = PORT_16550A,
403-
.uartclk = 115200*16,
404-
.fifosize = 16,
405-
}
406-
};
407-
408392
static void __devinit superio_serial_init(void)
409393
{
410394
#ifdef CONFIG_SERIAL_8250
411395
int retval;
412-
413-
serial[0].iobase = sio_dev.sp1_base;
414-
serial[0].irq = SP1_IRQ;
415-
spin_lock_init(&serial[0].lock);
416-
417-
retval = early_serial_setup(&serial[0]);
396+
struct uart_port serial_port;
397+
398+
memset(&serial_port, 0, sizeof(serial_port));
399+
serial_port.iotype = UPIO_PORT;
400+
serial_port.type = PORT_16550A;
401+
serial_port.uartclk = 115200*16;
402+
serial_port.fifosize = 16;
403+
spin_lock_init(&serial_port.lock);
404+
405+
/* serial port #1 */
406+
serial_port.iobase = sio_dev.sp1_base;
407+
serial_port.irq = SP1_IRQ;
408+
serial_port.line = 0;
409+
retval = early_serial_setup(&serial_port);
418410
if (retval < 0) {
419411
printk(KERN_WARNING PFX "Register Serial #0 failed.\n");
420412
return;
421413
}
422414

423-
serial[1].iobase = sio_dev.sp2_base;
424-
serial[1].irq = SP2_IRQ;
425-
spin_lock_init(&serial[1].lock);
426-
retval = early_serial_setup(&serial[1]);
427-
415+
/* serial port #2 */
416+
serial_port.iobase = sio_dev.sp2_base;
417+
serial_port.irq = SP2_IRQ;
418+
serial_port.line = 1;
419+
retval = early_serial_setup(&serial_port);
428420
if (retval < 0)
429421
printk(KERN_WARNING PFX "Register Serial #1 failed.\n");
430422
#endif /* CONFIG_SERIAL_8250 */

‎drivers/scsi/lasi700.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ lasi700_probe(struct parisc_device *dev)
112112

113113
hostdata->dev = &dev->dev;
114114
dma_set_mask(&dev->dev, DMA_32BIT_MASK);
115-
hostdata->base = ioremap(base, 0x100);
115+
hostdata->base = ioremap_nocache(base, 0x100);
116116
hostdata->differential = 0;
117117

118118
if (dev->id.sversion == LASI_700_SVERSION) {

0 commit comments

Comments
 (0)