提交 5076c158 编写于 作者: H Helge Deller 提交者: Kyle McMartin

[PARISC] I/O-Space must be ioremap_nocache()'d

Addresses in F-space must be accessed uncached on most parisc machines.
Signed-off-by: NHelge Deller <deller@parisc-linux.org>
Signed-off-by: NKyle McMartin <kyle@parisc-linux.org>
上级 94c3e87a
...@@ -805,7 +805,7 @@ static int perf_write_image(uint64_t *memaddr) ...@@ -805,7 +805,7 @@ static int perf_write_image(uint64_t *memaddr)
return -1; return -1;
} }
runway = ioremap(cpu_device->hpa.start, 4096); runway = ioremap_nocache(cpu_device->hpa.start, 4096);
/* Merge intrigue bits into Runway STATUS 0 */ /* Merge intrigue bits into Runway STATUS 0 */
tmp64 = __raw_readq(runway + RUNWAY_STATUS) & 0xffecfffffffffffful; tmp64 = __raw_readq(runway + RUNWAY_STATUS) & 0xffecfffffffffffful;
......
/* /*
* drivers/input/serio/gscps2.c * drivers/input/serio/gscps2.c
* *
* Copyright (c) 2004 Helge Deller <deller@gmx.de> * Copyright (c) 2004-2006 Helge Deller <deller@gmx.de>
* Copyright (c) 2002 Laurent Canet <canetl@esiee.fr> * Copyright (c) 2002 Laurent Canet <canetl@esiee.fr>
* Copyright (c) 2002 Thibaut Varene <varenet@parisc-linux.org> * Copyright (c) 2002 Thibaut Varene <varenet@parisc-linux.org>
* *
...@@ -354,7 +354,7 @@ static int __init gscps2_probe(struct parisc_device *dev) ...@@ -354,7 +354,7 @@ static int __init gscps2_probe(struct parisc_device *dev)
memset(serio, 0, sizeof(struct serio)); memset(serio, 0, sizeof(struct serio));
ps2port->port = serio; ps2port->port = serio;
ps2port->padev = dev; ps2port->padev = dev;
ps2port->addr = ioremap(hpa, GSC_STATUS + 4); ps2port->addr = ioremap_nocache(hpa, GSC_STATUS + 4);
spin_lock_init(&ps2port->lock); spin_lock_init(&ps2port->lock);
gscps2_reset(ps2port); gscps2_reset(ps2port);
......
...@@ -1560,7 +1560,7 @@ static int ccio_probe(struct parisc_device *dev) ...@@ -1560,7 +1560,7 @@ static int ccio_probe(struct parisc_device *dev)
*ioc_p = ioc; *ioc_p = ioc;
ioc->hw_path = dev->hw_path; ioc->hw_path = dev->hw_path;
ioc->ioc_regs = ioremap(dev->hpa.start, 4096); ioc->ioc_regs = ioremap_nocache(dev->hpa.start, 4096);
ccio_ioc_init(ioc); ccio_ioc_init(ioc);
ccio_init_resources(ioc); ccio_init_resources(ioc);
hppa_dma_ops = &ccio_ops; hppa_dma_ops = &ccio_ops;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
** (c) Copyright 1999 SuSE GmbH ** (c) Copyright 1999 SuSE GmbH
** (c) Copyright 1999,2000 Hewlett-Packard Company ** (c) Copyright 1999,2000 Hewlett-Packard Company
** (c) Copyright 2000 Grant Grundler ** (c) Copyright 2000 Grant Grundler
** (c) Copyright 2006 Helge Deller
** **
** This program is free software; you can redistribute it and/or modify ** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by ** 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) ...@@ -785,7 +786,7 @@ dino_bridge_init(struct dino_device *dino_dev, const char *name)
if((io_addr & (1 << i)) == 0) if((io_addr & (1 << i)) == 0)
continue; continue;
start = (unsigned long)(signed int)(0xf0000000 | (i << 23)); start = F_EXTEND(0xf0000000UL) | (i << 23);
end = start + 8 * 1024 * 1024 - 1; end = start + 8 * 1024 * 1024 - 1;
DBG("DINO RANGE %d is at 0x%lx-0x%lx\n", count, 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) ...@@ -996,7 +997,7 @@ static int __init dino_probe(struct parisc_device *dev)
} }
dino_dev->hba.dev = dev; dino_dev->hba.dev = dev;
dino_dev->hba.base_addr = ioremap(hpa, 4096); dino_dev->hba.base_addr = ioremap_nocache(hpa, 4096);
dino_dev->hba.lmmio_space_offset = 0; /* CPU addrs == bus addrs */ dino_dev->hba.lmmio_space_offset = 0; /* CPU addrs == bus addrs */
spin_lock_init(&dino_dev->dinosaur_pen); spin_lock_init(&dino_dev->dinosaur_pen);
dino_dev->hba.iommu = ccio_get_iommu(dev); dino_dev->hba.iommu = ccio_get_iommu(dev);
......
...@@ -366,7 +366,7 @@ static int __devinit eisa_probe(struct parisc_device *dev) ...@@ -366,7 +366,7 @@ static int __devinit eisa_probe(struct parisc_device *dev)
eisa_dev.eeprom_addr = MIRAGE_EEPROM_BASE_ADDR; eisa_dev.eeprom_addr = MIRAGE_EEPROM_BASE_ADDR;
} }
} }
eisa_eeprom_addr = ioremap(eisa_dev.eeprom_addr, HPEE_MAX_LENGTH); eisa_eeprom_addr = ioremap_nocache(eisa_dev.eeprom_addr, HPEE_MAX_LENGTH);
result = eisa_enumerator(eisa_dev.eeprom_addr, &eisa_dev.hba.io_space, result = eisa_enumerator(eisa_dev.eeprom_addr, &eisa_dev.hba.io_space,
&eisa_dev.hba.lmmio_space); &eisa_dev.hba.lmmio_space);
init_eisa_pic(); init_eisa_pic();
......
...@@ -879,7 +879,7 @@ void *iosapic_register(unsigned long hpa) ...@@ -879,7 +879,7 @@ void *iosapic_register(unsigned long hpa)
return NULL; return NULL;
} }
isi->addr = ioremap(hpa, 4096); isi->addr = ioremap_nocache(hpa, 4096);
isi->isi_hpa = hpa; isi->isi_hpa = hpa;
isi->isi_version = iosapic_rd_version(isi); isi->isi_version = iosapic_rd_version(isi);
isi->isi_num_vectors = IOSAPIC_IRDT_MAX_ENTRY(isi->isi_version) + 1; isi->isi_num_vectors = IOSAPIC_IRDT_MAX_ENTRY(isi->isi_version) + 1;
......
...@@ -1213,7 +1213,7 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev) ...@@ -1213,7 +1213,7 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
** Postable I/O port space is per PCI host adapter. ** Postable I/O port space is per PCI host adapter.
** base of 64MB PIOP region ** base of 64MB PIOP region
*/ */
lba_dev->iop_base = ioremap(p->start, 64 * 1024 * 1024); lba_dev->iop_base = ioremap_nocache(p->start, 64 * 1024 * 1024);
sprintf(lba_dev->hba.io_name, "PCI%02lx Ports", sprintf(lba_dev->hba.io_name, "PCI%02lx Ports",
lba_dev->hba.bus_num.start); lba_dev->hba.bus_num.start);
...@@ -1525,7 +1525,7 @@ lba_driver_probe(struct parisc_device *dev) ...@@ -1525,7 +1525,7 @@ lba_driver_probe(struct parisc_device *dev)
u32 func_class; u32 func_class;
void *tmp_obj; void *tmp_obj;
char *version; char *version;
void __iomem *addr = ioremap(dev->hpa.start, 4096); void __iomem *addr = ioremap_nocache(dev->hpa.start, 4096);
/* Read HW Rev First */ /* Read HW Rev First */
func_class = READ_REG32(addr + LBA_FCLASS); func_class = READ_REG32(addr + LBA_FCLASS);
...@@ -1619,7 +1619,7 @@ lba_driver_probe(struct parisc_device *dev) ...@@ -1619,7 +1619,7 @@ lba_driver_probe(struct parisc_device *dev)
} else { } else {
if (!astro_iop_base) { if (!astro_iop_base) {
/* Sprockets PDC uses NPIOP region */ /* Sprockets PDC uses NPIOP region */
astro_iop_base = ioremap(LBA_PORT_BASE, 64 * 1024); astro_iop_base = ioremap_nocache(LBA_PORT_BASE, 64 * 1024);
pci_port = &lba_astro_port_ops; pci_port = &lba_astro_port_ops;
} }
...@@ -1700,7 +1700,7 @@ void __init lba_init(void) ...@@ -1700,7 +1700,7 @@ void __init lba_init(void)
*/ */
void lba_set_iregs(struct parisc_device *lba, u32 ibase, u32 imask) void lba_set_iregs(struct parisc_device *lba, u32 ibase, u32 imask)
{ {
void __iomem * base_addr = ioremap(lba->hpa.start, 4096); void __iomem * base_addr = ioremap_nocache(lba->hpa.start, 4096);
imask <<= 2; /* adjust for hints - 2 more bits */ imask <<= 2; /* adjust for hints - 2 more bits */
......
...@@ -1642,9 +1642,9 @@ sba_ioc_init(struct parisc_device *sba, struct ioc *ioc, int ioc_num) ...@@ -1642,9 +1642,9 @@ sba_ioc_init(struct parisc_device *sba, struct ioc *ioc, int ioc_num)
** **
**************************************************************************/ **************************************************************************/
static void __iomem *ioc_remap(struct sba_device *sba_dev, int offset) static void __iomem *ioc_remap(struct sba_device *sba_dev, unsigned int offset)
{ {
return ioremap(sba_dev->dev->hpa.start + offset, SBA_FUNC_SIZE); return ioremap_nocache(sba_dev->dev->hpa.start + offset, SBA_FUNC_SIZE);
} }
static void sba_hw_init(struct sba_device *sba_dev) static void sba_hw_init(struct sba_device *sba_dev)
...@@ -2040,7 +2040,7 @@ sba_driver_callback(struct parisc_device *dev) ...@@ -2040,7 +2040,7 @@ sba_driver_callback(struct parisc_device *dev)
u32 func_class; u32 func_class;
int i; int i;
char *version; char *version;
void __iomem *sba_addr = ioremap(dev->hpa.start, SBA_FUNC_SIZE); void __iomem *sba_addr = ioremap_nocache(dev->hpa.start, SBA_FUNC_SIZE);
struct proc_dir_entry *info_entry, *bitmap_entry, *root; struct proc_dir_entry *info_entry, *bitmap_entry, *root;
sba_dump_ranges(sba_addr); sba_dump_ranges(sba_addr);
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
* (C) Copyright 2001 John Marvin <jsm fc hp com> * (C) Copyright 2001 John Marvin <jsm fc hp com>
* (C) Copyright 2003 Grant Grundler <grundler parisc-linux org> * (C) Copyright 2003 Grant Grundler <grundler parisc-linux org>
* (C) Copyright 2005 Kyle McMartin <kyle@parisc-linux.org> * (C) Copyright 2005 Kyle McMartin <kyle@parisc-linux.org>
* (C) Copyright 2006 Helge Deller <deller@gmx.de>
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
...@@ -388,43 +389,34 @@ int superio_fixup_irq(struct pci_dev *pcidev) ...@@ -388,43 +389,34 @@ int superio_fixup_irq(struct pci_dev *pcidev)
return local_irq; return local_irq;
} }
static struct uart_port serial[] = {
{
.iotype = UPIO_PORT,
.line = 0,
.type = PORT_16550A,
.uartclk = 115200*16,
.fifosize = 16,
},
{
.iotype = UPIO_PORT,
.line = 1,
.type = PORT_16550A,
.uartclk = 115200*16,
.fifosize = 16,
}
};
static void __devinit superio_serial_init(void) static void __devinit superio_serial_init(void)
{ {
#ifdef CONFIG_SERIAL_8250 #ifdef CONFIG_SERIAL_8250
int retval; int retval;
struct uart_port serial_port;
serial[0].iobase = sio_dev.sp1_base;
serial[0].irq = SP1_IRQ; memset(&serial_port, 0, sizeof(serial_port));
spin_lock_init(&serial[0].lock); serial_port.iotype = UPIO_PORT;
serial_port.type = PORT_16550A;
retval = early_serial_setup(&serial[0]); serial_port.uartclk = 115200*16;
serial_port.fifosize = 16;
spin_lock_init(&serial_port.lock);
/* serial port #1 */
serial_port.iobase = sio_dev.sp1_base;
serial_port.irq = SP1_IRQ;
serial_port.line = 0;
retval = early_serial_setup(&serial_port);
if (retval < 0) { if (retval < 0) {
printk(KERN_WARNING PFX "Register Serial #0 failed.\n"); printk(KERN_WARNING PFX "Register Serial #0 failed.\n");
return; return;
} }
serial[1].iobase = sio_dev.sp2_base; /* serial port #2 */
serial[1].irq = SP2_IRQ; serial_port.iobase = sio_dev.sp2_base;
spin_lock_init(&serial[1].lock); serial_port.irq = SP2_IRQ;
retval = early_serial_setup(&serial[1]); serial_port.line = 1;
retval = early_serial_setup(&serial_port);
if (retval < 0) if (retval < 0)
printk(KERN_WARNING PFX "Register Serial #1 failed.\n"); printk(KERN_WARNING PFX "Register Serial #1 failed.\n");
#endif /* CONFIG_SERIAL_8250 */ #endif /* CONFIG_SERIAL_8250 */
......
...@@ -112,7 +112,7 @@ lasi700_probe(struct parisc_device *dev) ...@@ -112,7 +112,7 @@ lasi700_probe(struct parisc_device *dev)
hostdata->dev = &dev->dev; hostdata->dev = &dev->dev;
dma_set_mask(&dev->dev, DMA_32BIT_MASK); dma_set_mask(&dev->dev, DMA_32BIT_MASK);
hostdata->base = ioremap(base, 0x100); hostdata->base = ioremap_nocache(base, 0x100);
hostdata->differential = 0; hostdata->differential = 0;
if (dev->id.sversion == LASI_700_SVERSION) { if (dev->id.sversion == LASI_700_SVERSION) {
......
...@@ -88,7 +88,7 @@ zalon_probe(struct parisc_device *dev) ...@@ -88,7 +88,7 @@ zalon_probe(struct parisc_device *dev)
struct gsc_irq gsc_irq; struct gsc_irq gsc_irq;
u32 zalon_vers; u32 zalon_vers;
int error = -ENODEV; int error = -ENODEV;
void __iomem *zalon = ioremap(dev->hpa.start, 4096); void __iomem *zalon = ioremap_nocache(dev->hpa.start, 4096);
void __iomem *io_port = zalon + GSC_SCSI_ZALON_OFFSET; void __iomem *io_port = zalon + GSC_SCSI_ZALON_OFFSET;
static int unit = 0; static int unit = 0;
struct Scsi_Host *host; struct Scsi_Host *host;
......
...@@ -52,13 +52,14 @@ serial_init_chip(struct parisc_device *dev) ...@@ -52,13 +52,14 @@ serial_init_chip(struct parisc_device *dev)
address += 0x800; address += 0x800;
} }
memset(&port, 0, sizeof(struct uart_port)); memset(&port, 0, sizeof(port));
port.mapbase = address; port.iotype = UPIO_MEM;
port.irq = dev->irq; port.uartclk = LASI_BASE_BAUD * 16;
port.iotype = UPIO_MEM; port.mapbase = address;
port.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF; port.membase = ioremap_nocache(address, 16);
port.uartclk = LASI_BASE_BAUD * 16; port.irq = dev->irq;
port.dev = &dev->dev; port.flags = UPF_BOOT_AUTOCONF;
port.dev = &dev->dev;
err = serial8250_register_port(&port); err = serial8250_register_port(&port);
if (err < 0) { if (err < 0) {
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
#define MUX_BREAK(status) ((status & 0xF000) == 0x2000) #define MUX_BREAK(status) ((status & 0xF000) == 0x2000)
#define MUX_NR 256 #define MUX_NR 256
static unsigned int port_cnt = 0; static unsigned int port_cnt __read_mostly;
static struct uart_port mux_ports[MUX_NR]; static struct uart_port mux_ports[MUX_NR];
static struct uart_driver mux_driver = { static struct uart_driver mux_driver = {
...@@ -461,7 +461,7 @@ static int __init mux_probe(struct parisc_device *dev) ...@@ -461,7 +461,7 @@ static int __init mux_probe(struct parisc_device *dev)
port->iobase = 0; port->iobase = 0;
port->mapbase = dev->hpa.start + MUX_OFFSET + port->mapbase = dev->hpa.start + MUX_OFFSET +
(i * MUX_LINE_OFFSET); (i * MUX_LINE_OFFSET);
port->membase = ioremap(port->mapbase, MUX_LINE_OFFSET); port->membase = ioremap_nocache(port->mapbase, MUX_LINE_OFFSET);
port->iotype = UPIO_MEM; port->iotype = UPIO_MEM;
port->type = PORT_MUX; port->type = PORT_MUX;
port->irq = NO_IRQ; port->irq = NO_IRQ;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册