Commit 93ef77fa authored by Linus Torvalds's avatar Linus Torvalds

Import 2.3.15pre2

parent f91c3404
...@@ -141,6 +141,21 @@ pci_set_master(struct pci_dev *dev) ...@@ -141,6 +141,21 @@ pci_set_master(struct pci_dev *dev)
} }
} }
/*
* Translate the low bits of the PCI base
* to the resource type
*/
static inline unsigned int pci_resource_flags(unsigned int flags)
{
if (flags & PCI_BASE_ADDRESS_SPACE_IO)
return IORESOURCE_IO | flags;
if (flags & PCI_BASE_ADDRESS_MEM_PREFETCH)
return IORESOURCE_MEM | IORESOURCE_PREFETCH;
return IORESOURCE_MEM;
}
void __init pci_read_bases(struct pci_dev *dev, unsigned int howmany) void __init pci_read_bases(struct pci_dev *dev, unsigned int howmany)
{ {
unsigned int reg; unsigned int reg;
...@@ -168,16 +183,16 @@ void __init pci_read_bases(struct pci_dev *dev, unsigned int howmany) ...@@ -168,16 +183,16 @@ void __init pci_read_bases(struct pci_dev *dev, unsigned int howmany)
continue; continue;
res->start = l & mask; res->start = l & mask;
res->flags = l & ~mask; l &= ~mask;
res->flags = l | pci_resource_flags(l);
size = 1; size = 1;
do { do {
size <<= 1; size <<= 1;
} while (!(size & newval)); } while (!(size & newval));
/* 64-bit memory? */ /* 64-bit decode? */
if ((l & (PCI_BASE_ADDRESS_SPACE | PCI_BASE_ADDRESS_MEM_TYPE_MASK)) if ((l & (PCI_BASE_ADDRESS_MEM_TYPE_MASK | PCI_BASE_ADDRESS_SPACE)) == PCI_BASE_ADDRESS_MEM_TYPE_64) {
== (PCI_BASE_ADDRESS_SPACE_MEMORY | PCI_BASE_ADDRESS_MEM_TYPE_64)) {
unsigned int high; unsigned int high;
reg++; reg++;
pci_read_config_dword(dev, PCI_BASE_ADDRESS_0 + (reg << 2), &high); pci_read_config_dword(dev, PCI_BASE_ADDRESS_0 + (reg << 2), &high);
......
This diff is collapsed.
...@@ -380,21 +380,21 @@ static void isapnp_print_mem(isapnp_info_buffer_t *buffer, char *space, struct i ...@@ -380,21 +380,21 @@ static void isapnp_print_mem(isapnp_info_buffer_t *buffer, char *space, struct i
isapnp_printf(buffer, "%sMemory 0x%x-0x%x, align 0x%x, size 0x%x", isapnp_printf(buffer, "%sMemory 0x%x-0x%x, align 0x%x, size 0x%x",
space, mem->min, mem->max, mem->align, mem->size); space, mem->min, mem->max, mem->align, mem->size);
if (mem->flags & DEVICE_IO_FLAG_WRITEABLE) if (mem->flags & ISAPNP_FLAG_WRITEABLE)
isapnp_printf(buffer, ", writeable"); isapnp_printf(buffer, ", writeable");
if (mem->flags & DEVICE_IO_FLAG_CACHEABLE) if (mem->flags & ISAPNP_FLAG_CACHEABLE)
isapnp_printf(buffer, ", cacheable"); isapnp_printf(buffer, ", cacheable");
if (mem->flags & DEVICE_IO_FLAG_RANGELENGTH) if (mem->flags & ISAPNP_FLAG_RANGELENGTH)
isapnp_printf(buffer, ", range-length"); isapnp_printf(buffer, ", range-length");
if (mem->flags & DEVICE_IO_FLAG_SHADOWABLE) if (mem->flags & ISAPNP_FLAG_SHADOWABLE)
isapnp_printf(buffer, ", shadowable"); isapnp_printf(buffer, ", shadowable");
if (mem->flags & DEVICE_IO_FLAG_EXPANSIONROM) if (mem->flags & ISAPNP_FLAG_EXPANSIONROM)
isapnp_printf(buffer, ", expansion ROM"); isapnp_printf(buffer, ", expansion ROM");
switch (mem->type) { switch (mem->type) {
case DEVICE_IO_TYPE_8BIT: case ISAPNP_TYPE_8BIT:
s = "8-bit"; s = "8-bit";
break; break;
case DEVICE_IO_TYPE_8AND16BIT: case ISAPNP_TYPE_8AND16BIT:
s = "8-bit&16-bit"; s = "8-bit&16-bit";
break; break;
default: default:
...@@ -734,9 +734,9 @@ static int isapnp_set_port(char *line) ...@@ -734,9 +734,9 @@ static int isapnp_set_port(char *line)
return 1; return 1;
} }
isapnp_write_word(ISAPNP_CFG_PORT + (idx << 1), port); isapnp_write_word(ISAPNP_CFG_PORT + (idx << 1), port);
if (isapnp_info_device->resource[idx].start == DEVICE_IO_NOTSET) if (isapnp_info_device->resource[idx].start == ISAPNP_NOTSET)
return 0; return 0;
if (isapnp_info_device->resource[idx].start == DEVICE_IO_AUTO) { if (isapnp_info_device->resource[idx].start == ISAPNP_AUTO) {
isapnp_info_device->resource[idx].start = port; isapnp_info_device->resource[idx].start = port;
isapnp_info_device->resource[idx].end += port - 1; isapnp_info_device->resource[idx].end += port - 1;
} else { } else {
...@@ -747,6 +747,12 @@ static int isapnp_set_port(char *line) ...@@ -747,6 +747,12 @@ static int isapnp_set_port(char *line)
return 0; return 0;
} }
static void isapnp_set_irqresource(struct resource *res, int irq)
{
res->start = res->end = irq;
res->flags = IORESOURCE_IRQ;
}
static int isapnp_set_irq(char *line) static int isapnp_set_irq(char *line)
{ {
int idx, irq; int idx, irq;
...@@ -767,18 +773,16 @@ static int isapnp_set_irq(char *line) ...@@ -767,18 +773,16 @@ static int isapnp_set_irq(char *line)
return 1; return 1;
} }
isapnp_write_byte(ISAPNP_CFG_IRQ + (idx << 1), irq); isapnp_write_byte(ISAPNP_CFG_IRQ + (idx << 1), irq);
if (idx == 0) { isapnp_set_irqresource(isapnp_info_device->irq_resource + idx, irq);
if (isapnp_info_device->irq == DEVICE_IRQ_NOTSET)
return 0;
isapnp_info_device->irq = irq;
} else {
if (isapnp_info_device->irq2 == DEVICE_IRQ_NOTSET)
return 0;
isapnp_info_device->irq2 = irq;
}
return 0; return 0;
} }
static void isapnp_set_dmaresource(struct resource *res, int dma)
{
res->start = res->end = dma;
res->flags = IORESOURCE_DMA;
}
static int isapnp_set_dma(char *line) static int isapnp_set_dma(char *line)
{ {
int idx, dma; int idx, dma;
...@@ -797,9 +801,7 @@ static int isapnp_set_dma(char *line) ...@@ -797,9 +801,7 @@ static int isapnp_set_dma(char *line)
return 1; return 1;
} }
isapnp_write_byte(ISAPNP_CFG_DMA + idx, dma); isapnp_write_byte(ISAPNP_CFG_DMA + idx, dma);
if (isapnp_info_device->dma[idx] == DEVICE_DMA_NOTSET) isapnp_set_dmaresource(isapnp_info_device->dma_resource + idx, dma);
return 0;
isapnp_info_device->dma[idx] = dma;
return 0; return 0;
} }
...@@ -819,9 +821,9 @@ static int isapnp_set_mem(char *line) ...@@ -819,9 +821,9 @@ static int isapnp_set_mem(char *line)
} }
mem >>= 8; mem >>= 8;
isapnp_write_word(ISAPNP_CFG_MEM + (idx<<2), mem & 0xffff); isapnp_write_word(ISAPNP_CFG_MEM + (idx<<2), mem & 0xffff);
if (isapnp_info_device->resource[idx + 8].start == DEVICE_IO_NOTSET) if (isapnp_info_device->resource[idx + 8].start == ISAPNP_NOTSET)
return 0; return 0;
if (isapnp_info_device->resource[idx + 8].start == DEVICE_IO_AUTO) { if (isapnp_info_device->resource[idx + 8].start == ISAPNP_AUTO) {
isapnp_info_device->resource[idx + 8].start = mem & ~0x00ffff00; isapnp_info_device->resource[idx + 8].start = mem & ~0x00ffff00;
isapnp_info_device->resource[idx + 8].end += (mem & ~0x00ffff00) - 1; isapnp_info_device->resource[idx + 8].end += (mem & ~0x00ffff00) - 1;
} else { } else {
......
...@@ -1951,11 +1951,11 @@ static int encode_fix(struct fb_fix_screeninfo *fix, ...@@ -1951,11 +1951,11 @@ static int encode_fix(struct fb_fix_screeninfo *fix,
fix->mmio_len = 0x400; fix->mmio_len = 0x400;
fix->accel = FB_ACCEL_ATI_MACH64CT; fix->accel = FB_ACCEL_ATI_MACH64CT;
} else if (Gx == VT_CHIP_ID || Gx == VU_CHIP_ID || Gx == VV_CHIP_ID) { } else if (Gx == VT_CHIP_ID || Gx == VU_CHIP_ID || Gx == VV_CHIP_ID) {
fix->mmio_start = info->ati_regbase_phys-0x400); fix->mmio_start = info->ati_regbase_phys-0x400;
fix->mmio_len = 0x800; fix->mmio_len = 0x800;
fix->accel = FB_ACCEL_ATI_MACH64VT; fix->accel = FB_ACCEL_ATI_MACH64VT;
} else { } else {
fix->mmio_start = info->ati_regbase_phys-0x400); fix->mmio_start = info->ati_regbase_phys-0x400;
fix->mmio_len = 0x800; fix->mmio_len = 0x800;
fix->accel = FB_ACCEL_ATI_MACH64GT; fix->accel = FB_ACCEL_ATI_MACH64GT;
} }
......
This diff is collapsed.
...@@ -8,19 +8,6 @@ ...@@ -8,19 +8,6 @@
#ifndef _LINUX_IOPORT_H #ifndef _LINUX_IOPORT_H
#define _LINUX_IOPORT_H #define _LINUX_IOPORT_H
#define DEVICE_IO_NOTSET (~0)
#define DEVICE_IO_AUTO ((~0)-1)
#define DEVICE_IO_FLAG_WRITEABLE (1<<0)
#define DEVICE_IO_FLAG_CACHEABLE (1<<1)
#define DEVICE_IO_FLAG_RANGELENGTH (1<<2)
#define DEVICE_IO_FLAG_SHADOWABLE (1<<4)
#define DEVICE_IO_FLAG_EXPANSIONROM (1<<5)
#define DEVICE_IO_TYPE_8BIT 0
#define DEVICE_IO_TYPE_16BIT 1
#define DEVICE_IO_TYPE_8AND16BIT 2
/* /*
* Resources are tree-like, allowing * Resources are tree-like, allowing
* nesting etc.. * nesting etc..
...@@ -29,22 +16,29 @@ struct resource { ...@@ -29,22 +16,29 @@ struct resource {
const char *name; const char *name;
unsigned long start, end; unsigned long start, end;
unsigned long flags; unsigned long flags;
unsigned char bits; /* decoded bits */
unsigned char fixed; /* fixed range */
unsigned short hw_flags; /* hardware flags */
unsigned short type; /* region type */
struct resource *parent, *sibling, *child; struct resource *parent, *sibling, *child;
}; };
/* /*
* PCI-like IO resources have these defined flags. * IO resources have these defined flags.
* The low four bits come directly from the PCI specs,
* the rest are extended sw flags..
*/ */
#define IORESOURCE_IOPORT 0x01 /* 0 - memory mapped, 1 - IO ports */ #define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */
#define IORESOURCE_MEMTYPE_MASK 0x06 /* PCI-specific mapping info */
#define IORESOURCE_PREFETCH 0x08 /* No side effects */ #define IORESOURCE_IO 0x00000100 /* Resource type */
#define IORESOURCE_BUSY 0x10 /* Driver uses this resource */ #define IORESOURCE_MEM 0x00000200
#define IORESOURCE_IRQ 0x00000400
#define IORESOURCE_DMA 0x00000800
#define IORESOURCE_PREFETCH 0x00001000 /* No side effects */
#define IORESOURCE_READONLY 0x00002000
#define IORESOURCE_CACHEABLE 0x00004000
#define IORESOURCE_RANGELENGTH 0x00008000
#define IORESOURCE_SHADOWABLE 0x00010000
#define IORESOURCE_UNSET 0x00020000
#define IORESOURCE_AUTO 0x00040000
#define IORESOURCE_BUSY 0x80000000 /* Driver has marked this resource busy */
/* PC/ISA/whatever - the normal PC address spaces: IO and memory */ /* PC/ISA/whatever - the normal PC address spaces: IO and memory */
extern struct resource ioport_resource; extern struct resource ioport_resource;
......
...@@ -24,6 +24,19 @@ ...@@ -24,6 +24,19 @@
#include <linux/config.h> #include <linux/config.h>
#define ISAPNP_NOTSET (~0)
#define ISAPNP_AUTO ((~0)-1)
#define ISAPNP_FLAG_WRITEABLE (1<<0)
#define ISAPNP_FLAG_CACHEABLE (1<<1)
#define ISAPNP_FLAG_RANGELENGTH (1<<2)
#define ISAPNP_FLAG_SHADOWABLE (1<<4)
#define ISAPNP_FLAG_EXPANSIONROM (1<<5)
#define ISAPNP_TYPE_8BIT 0
#define ISAPNP_TYPE_16BIT 1
#define ISAPNP_TYPE_8AND16BIT 2
/* /*
* Configuration registers (TODO: change by specification) * Configuration registers (TODO: change by specification)
*/ */
......
...@@ -1209,6 +1209,7 @@ ...@@ -1209,6 +1209,7 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#define DEVICE_COUNT_COMPATIBLE 4 #define DEVICE_COUNT_COMPATIBLE 4
#define DEVICE_COUNT_IRQ 2
#define DEVICE_COUNT_DMA 2 #define DEVICE_COUNT_DMA 2
#define DEVICE_COUNT_RESOURCE 12 #define DEVICE_COUNT_RESOURCE 12
...@@ -1276,19 +1277,15 @@ struct pci_dev { ...@@ -1276,19 +1277,15 @@ struct pci_dev {
* necessary. The field must not be 0 unless the device * necessary. The field must not be 0 unless the device
* cannot generate interrupts at all. * cannot generate interrupts at all.
*/ */
unsigned int irq; /* irq generated by this device */ unsigned int irq;
unsigned short irq_flags; /* irq type */
unsigned int irq2; /*
unsigned short irq2_flags; * Base registers for this device, can be adjusted by
unsigned char dma[DEVICE_COUNT_DMA];
unsigned char dma_type[DEVICE_COUNT_DMA];
unsigned char dma_flags[DEVICE_COUNT_DMA];
unsigned char dma_speed[DEVICE_COUNT_DMA];
/* Base registers for this device, can be adjusted by
* pcibios_fixup() as necessary. * pcibios_fixup() as necessary.
*/ */
struct resource resource[DEVICE_COUNT_RESOURCE]; struct resource resource[DEVICE_COUNT_RESOURCE];
struct resource dma_resource[DEVICE_COUNT_DMA];
struct resource irq_resource[DEVICE_COUNT_IRQ];
unsigned long rom_address; unsigned long rom_address;
int (*prepare)(struct pci_dev *dev); int (*prepare)(struct pci_dev *dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment