Commit 5076c15862644edb91d2e3436b2fa3e07b28385d

Authored by Helge Deller
Committed by Kyle McMartin
1 parent 94c3e87a79

[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>

Showing 13 changed files with 48 additions and 54 deletions Side-by-side Diff

arch/parisc/kernel/perf.c
... ... @@ -805,7 +805,7 @@
805 805 return -1;
806 806 }
807 807  
808   - runway = ioremap(cpu_device->hpa.start, 4096);
  808 + runway = ioremap_nocache(cpu_device->hpa.start, 4096);
809 809  
810 810 /* Merge intrigue bits into Runway STATUS 0 */
811 811 tmp64 = __raw_readq(runway + RUNWAY_STATUS) & 0xffecfffffffffffful;
drivers/input/serio/gscps2.c
1 1 /*
2 2 * drivers/input/serio/gscps2.c
3 3 *
4   - * Copyright (c) 2004 Helge Deller <deller@gmx.de>
  4 + * Copyright (c) 2004-2006 Helge Deller <deller@gmx.de>
5 5 * Copyright (c) 2002 Laurent Canet <canetl@esiee.fr>
6 6 * Copyright (c) 2002 Thibaut Varene <varenet@parisc-linux.org>
7 7 *
... ... @@ -354,7 +354,7 @@
354 354 memset(serio, 0, sizeof(struct serio));
355 355 ps2port->port = serio;
356 356 ps2port->padev = dev;
357   - ps2port->addr = ioremap(hpa, GSC_STATUS + 4);
  357 + ps2port->addr = ioremap_nocache(hpa, GSC_STATUS + 4);
358 358 spin_lock_init(&ps2port->lock);
359 359  
360 360 gscps2_reset(ps2port);
drivers/parisc/ccio-dma.c
... ... @@ -1560,7 +1560,7 @@
1560 1560 *ioc_p = ioc;
1561 1561  
1562 1562 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);
1564 1564 ccio_ioc_init(ioc);
1565 1565 ccio_init_resources(ioc);
1566 1566 hppa_dma_ops = &ccio_ops;
drivers/parisc/dino.c
... ... @@ -5,6 +5,7 @@
5 5 ** (c) Copyright 1999 SuSE GmbH
6 6 ** (c) Copyright 1999,2000 Hewlett-Packard Company
7 7 ** (c) Copyright 2000 Grant Grundler
  8 +** (c) Copyright 2006 Helge Deller
8 9 **
9 10 ** This program is free software; you can redistribute it and/or modify
10 11 ** it under the terms of the GNU General Public License as published by
... ... @@ -785,7 +786,7 @@
785 786 if((io_addr & (1 << i)) == 0)
786 787 continue;
787 788  
788   - start = (unsigned long)(signed int)(0xf0000000 | (i << 23));
  789 + start = F_EXTEND(0xf0000000UL) | (i << 23);
789 790 end = start + 8 * 1024 * 1024 - 1;
790 791  
791 792 DBG("DINO RANGE %d is at 0x%lx-0x%lx\n", count,
... ... @@ -996,7 +997,7 @@
996 997 }
997 998  
998 999 dino_dev->hba.dev = dev;
999   - dino_dev->hba.base_addr = ioremap(hpa, 4096);
  1000 + dino_dev->hba.base_addr = ioremap_nocache(hpa, 4096);
1000 1001 dino_dev->hba.lmmio_space_offset = 0; /* CPU addrs == bus addrs */
1001 1002 spin_lock_init(&dino_dev->dinosaur_pen);
1002 1003 dino_dev->hba.iommu = ccio_get_iommu(dev);
drivers/parisc/eisa.c
... ... @@ -366,7 +366,7 @@
366 366 eisa_dev.eeprom_addr = MIRAGE_EEPROM_BASE_ADDR;
367 367 }
368 368 }
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);
370 370 result = eisa_enumerator(eisa_dev.eeprom_addr, &eisa_dev.hba.io_space,
371 371 &eisa_dev.hba.lmmio_space);
372 372 init_eisa_pic();
drivers/parisc/iosapic.c
... ... @@ -879,7 +879,7 @@
879 879 return NULL;
880 880 }
881 881  
882   - isi->addr = ioremap(hpa, 4096);
  882 + isi->addr = ioremap_nocache(hpa, 4096);
883 883 isi->isi_hpa = hpa;
884 884 isi->isi_version = iosapic_rd_version(isi);
885 885 isi->isi_num_vectors = IOSAPIC_IRDT_MAX_ENTRY(isi->isi_version) + 1;
drivers/parisc/lba_pci.c
... ... @@ -1213,7 +1213,7 @@
1213 1213 ** Postable I/O port space is per PCI host adapter.
1214 1214 ** base of 64MB PIOP region
1215 1215 */
1216   - lba_dev->iop_base = ioremap(p->start, 64 * 1024 * 1024);
  1216 + lba_dev->iop_base = ioremap_nocache(p->start, 64 * 1024 * 1024);
1217 1217  
1218 1218 sprintf(lba_dev->hba.io_name, "PCI%02lx Ports",
1219 1219 lba_dev->hba.bus_num.start);
... ... @@ -1525,7 +1525,7 @@
1525 1525 u32 func_class;
1526 1526 void *tmp_obj;
1527 1527 char *version;
1528   - void __iomem *addr = ioremap(dev->hpa.start, 4096);
  1528 + void __iomem *addr = ioremap_nocache(dev->hpa.start, 4096);
1529 1529  
1530 1530 /* Read HW Rev First */
1531 1531 func_class = READ_REG32(addr + LBA_FCLASS);
... ... @@ -1619,7 +1619,7 @@
1619 1619 } else {
1620 1620 if (!astro_iop_base) {
1621 1621 /* 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);
1623 1623 pci_port = &lba_astro_port_ops;
1624 1624 }
1625 1625  
... ... @@ -1700,7 +1700,7 @@
1700 1700 */
1701 1701 void lba_set_iregs(struct parisc_device *lba, u32 ibase, u32 imask)
1702 1702 {
1703   - void __iomem * base_addr = ioremap(lba->hpa.start, 4096);
  1703 + void __iomem * base_addr = ioremap_nocache(lba->hpa.start, 4096);
1704 1704  
1705 1705 imask <<= 2; /* adjust for hints - 2 more bits */
1706 1706  
drivers/parisc/sba_iommu.c
... ... @@ -1642,9 +1642,9 @@
1642 1642 **
1643 1643 **************************************************************************/
1644 1644  
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)
1646 1646 {
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);
1648 1648 }
1649 1649  
1650 1650 static void sba_hw_init(struct sba_device *sba_dev)
... ... @@ -2040,7 +2040,7 @@
2040 2040 u32 func_class;
2041 2041 int i;
2042 2042 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);
2044 2044 struct proc_dir_entry *info_entry, *bitmap_entry, *root;
2045 2045  
2046 2046 sba_dump_ranges(sba_addr);
drivers/parisc/superio.c
... ... @@ -12,6 +12,7 @@
12 12 * (C) Copyright 2001 John Marvin <jsm fc hp com>
13 13 * (C) Copyright 2003 Grant Grundler <grundler parisc-linux org>
14 14 * (C) Copyright 2005 Kyle McMartin <kyle@parisc-linux.org>
  15 + * (C) Copyright 2006 Helge Deller <deller@gmx.de>
15 16 *
16 17 * This program is free software; you can redistribute it and/or
17 18 * modify it under the terms of the GNU General Public License as
18 19  
19 20  
20 21  
... ... @@ -388,43 +389,34 @@
388 389 return local_irq;
389 390 }
390 391  
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   -
408 392 static void __devinit superio_serial_init(void)
409 393 {
410 394 #ifdef CONFIG_SERIAL_8250
411 395 int retval;
412   -
413   - serial[0].iobase = sio_dev.sp1_base;
414   - serial[0].irq = SP1_IRQ;
415   - spin_lock_init(&serial[0].lock);
  396 + struct uart_port serial_port;
416 397  
417   - retval = early_serial_setup(&serial[0]);
  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);
418 410 if (retval < 0) {
419 411 printk(KERN_WARNING PFX "Register Serial #0 failed.\n");
420 412 return;
421 413 }
422 414  
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);
428 420 if (retval < 0)
429 421 printk(KERN_WARNING PFX "Register Serial #1 failed.\n");
430 422 #endif /* CONFIG_SERIAL_8250 */
drivers/scsi/lasi700.c
... ... @@ -112,7 +112,7 @@
112 112  
113 113 hostdata->dev = &dev->dev;
114 114 dma_set_mask(&dev->dev, DMA_32BIT_MASK);
115   - hostdata->base = ioremap(base, 0x100);
  115 + hostdata->base = ioremap_nocache(base, 0x100);
116 116 hostdata->differential = 0;
117 117  
118 118 if (dev->id.sversion == LASI_700_SVERSION) {
drivers/scsi/zalon.c
... ... @@ -88,7 +88,7 @@
88 88 struct gsc_irq gsc_irq;
89 89 u32 zalon_vers;
90 90 int error = -ENODEV;
91   - void __iomem *zalon = ioremap(dev->hpa.start, 4096);
  91 + void __iomem *zalon = ioremap_nocache(dev->hpa.start, 4096);
92 92 void __iomem *io_port = zalon + GSC_SCSI_ZALON_OFFSET;
93 93 static int unit = 0;
94 94 struct Scsi_Host *host;
drivers/serial/8250_gsc.c
... ... @@ -52,13 +52,14 @@
52 52 address += 0x800;
53 53 }
54 54  
55   - memset(&port, 0, sizeof(struct uart_port));
56   - port.mapbase = address;
57   - port.irq = dev->irq;
58   - port.iotype = UPIO_MEM;
59   - port.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF;
60   - port.uartclk = LASI_BASE_BAUD * 16;
61   - port.dev = &dev->dev;
  55 + memset(&port, 0, sizeof(port));
  56 + port.iotype = UPIO_MEM;
  57 + port.uartclk = LASI_BASE_BAUD * 16;
  58 + port.mapbase = address;
  59 + port.membase = ioremap_nocache(address, 16);
  60 + port.irq = dev->irq;
  61 + port.flags = UPF_BOOT_AUTOCONF;
  62 + port.dev = &dev->dev;
62 63  
63 64 err = serial8250_register_port(&port);
64 65 if (err < 0) {
drivers/serial/mux.c
... ... @@ -51,7 +51,7 @@
51 51 #define MUX_BREAK(status) ((status & 0xF000) == 0x2000)
52 52  
53 53 #define MUX_NR 256
54   -static unsigned int port_cnt = 0;
  54 +static unsigned int port_cnt __read_mostly;
55 55 static struct uart_port mux_ports[MUX_NR];
56 56  
57 57 static struct uart_driver mux_driver = {
... ... @@ -461,7 +461,7 @@
461 461 port->iobase = 0;
462 462 port->mapbase = dev->hpa.start + MUX_OFFSET +
463 463 (i * MUX_LINE_OFFSET);
464   - port->membase = ioremap(port->mapbase, MUX_LINE_OFFSET);
  464 + port->membase = ioremap_nocache(port->mapbase, MUX_LINE_OFFSET);
465 465 port->iotype = UPIO_MEM;
466 466 port->type = PORT_MUX;
467 467 port->irq = NO_IRQ;