Commit 50a8fdd6 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://linux-acpi.bkbits.net/26-latest-release

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents a068ea13 928a40a4
......@@ -142,7 +142,7 @@ static void __init pcibios_allocate_resources(int pass)
DBG("PCI: Resource %08lx-%08lx (f=%lx, d=%d, p=%d)\n",
r->start, r->end, r->flags, disabled, pass);
pr = pci_find_parent_resource(dev, r);
if (!pr || insert_resource(pr, r) < 0) {
if (!pr || request_resource(pr, r) < 0) {
printk(KERN_ERR "PCI: Cannot allocate resource region %d of device %s\n", idx, pci_name(dev));
/* We'll assign a new address later */
r->end -= r->start;
......@@ -164,7 +164,7 @@ static void __init pcibios_allocate_resources(int pass)
}
}
static void __init pcibios_assign_resources(void)
static int __init pcibios_assign_resources(void)
{
struct pci_dev *dev = NULL;
int idx;
......@@ -204,6 +204,7 @@ static void __init pcibios_assign_resources(void)
pci_assign_resource(dev, PCI_ROM_RESOURCE);
}
}
return 0;
}
void __init pcibios_resource_survey(void)
......@@ -212,9 +213,14 @@ void __init pcibios_resource_survey(void)
pcibios_allocate_bus_resources(&pci_root_buses);
pcibios_allocate_resources(0);
pcibios_allocate_resources(1);
pcibios_assign_resources();
}
/**
* called in fs_initcall (one below subsys_initcall),
* give a chance for motherboard reserve resources
*/
fs_initcall(pcibios_assign_resources);
int pcibios_enable_resources(struct pci_dev *dev, int mask)
{
u16 cmd, old_cmd;
......
......@@ -170,4 +170,8 @@ static int __init acpi_motherboard_init(void)
return 0;
}
subsys_initcall(acpi_motherboard_init);
/**
* Reserve motherboard resources after PCI claim BARs,
* but before PCI assign resources for uninitialized PCI devices
*/
fs_initcall(acpi_motherboard_init);
......@@ -407,10 +407,6 @@ static int config_drive_for_dma (ide_drive_t *drive)
ide_hwif_t *hwif = HWIF(drive);
if ((id->capability & 1) && hwif->autodma) {
/* Consult the list of known "bad" drives */
if (__ide_dma_bad_drive(drive))
return __ide_dma_off(drive);
/*
* Enable DMA on any drive that has
* UltraDMA (mode 0/1/2/3/4/5/6) enabled
......@@ -564,6 +560,10 @@ EXPORT_SYMBOL(__ide_dma_host_on);
int __ide_dma_on (ide_drive_t *drive)
{
/* consult the list of known "bad" drives */
if (__ide_dma_bad_drive(drive))
return 1;
drive->using_dma = 1;
ide_toggle_bounce(drive, 1);
......
......@@ -611,19 +611,6 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
case TASKFILE_IN_DMA:
err = ide_diag_taskfile(drive, &args, taskin, inbuf);
break;
case TASKFILE_IN_OUT:
#if 0
args.prehandler = &pre_task_out_intr;
args.handler = &task_out_intr;
err = ide_diag_taskfile(drive, &args, taskout, outbuf);
args.prehandler = NULL;
args.handler = &task_in_intr;
err = ide_diag_taskfile(drive, &args, taskin, inbuf);
break;
#else
err = -EFAULT;
goto abort;
#endif
case TASKFILE_MULTI_OUT:
if (!drive->mult_count) {
/* (hs): give up if multcount is not set */
......
......@@ -38,8 +38,6 @@ static u8 cmd64x_proc = 0;
static struct pci_dev *cmd_devs[CMD_MAX_DEVS];
static int n_cmd_devs;
#undef DEBUG_CMD_REGS
static char * print_cmd64x_get_info (char *buf, struct pci_dev *dev, int index)
{
char *p = buf;
......@@ -49,9 +47,6 @@ static char * print_cmd64x_get_info (char *buf, struct pci_dev *dev, int index)
u8 reg72 = 0, reg73 = 0; /* primary */
u8 reg7a = 0, reg7b = 0; /* secondary */
u8 reg50 = 0, reg71 = 0; /* extra */
#ifdef DEBUG_CMD_REGS
u8 hi_byte = 0, lo_byte = 0;
#endif /* DEBUG_CMD_REGS */
p += sprintf(p, "\nController: %d\n", index);
p += sprintf(p, "CMD%x Chipset.\n", dev->device);
......@@ -127,18 +122,6 @@ static char * print_cmd64x_get_info (char *buf, struct pci_dev *dev, int index)
(reg71 & MRDMODE_BLK_CH0) ? "blocked" : "enabled",
(reg71 & MRDMODE_BLK_CH1) ? "blocked" : "enabled");
#ifdef DEBUG_CMD_REGS
SPLIT_BYTE(reg50, hi_byte, lo_byte);
p += sprintf(p, "CFR = 0x%02x, HI = 0x%02x, "
"LOW = 0x%02x\n", reg50, hi_byte, lo_byte);
SPLIT_BYTE(reg57, hi_byte, lo_byte);
p += sprintf(p, "ARTTIM23 = 0x%02x, HI = 0x%02x, "
"LOW = 0x%02x\n", reg57, hi_byte, lo_byte);
SPLIT_BYTE(reg71, hi_byte, lo_byte);
p += sprintf(p, "MRDMODE = 0x%02x, HI = 0x%02x, "
"LOW = 0x%02x\n", reg71, hi_byte, lo_byte);
#endif /* DEBUG_CMD_REGS */
return (char *)p;
}
......
......@@ -15,10 +15,6 @@
#define cmdprintk(x...)
#endif
#ifndef SPLIT_BYTE
#define SPLIT_BYTE(B,H,L) ((H)=(B>>4), (L)=(B-((B>>4)<<4)))
#endif
/*
* CMD64x specific registers definition.
*/
......
......@@ -314,17 +314,6 @@ static int pdc202xx_tune_chipset (ide_drive_t *drive, u8 xferspeed)
pci_write_config_byte(dev, (drive_pci)|0x02, CP|TC);
}
#if PDC202XX_DECODE_REGISTER_INFO
pci_read_config_byte(dev, (drive_pci), &AP);
pci_read_config_byte(dev, (drive_pci)|0x01, &BP);
pci_read_config_byte(dev, (drive_pci)|0x02, &CP);
pci_read_config_byte(dev, (drive_pci)|0x03, &DP);
decode_registers(REG_A, AP);
decode_registers(REG_B, BP);
decode_registers(REG_C, CP);
decode_registers(REG_D, DP);
#endif /* PDC202XX_DECODE_REGISTER_INFO */
#if PDC202XX_DEBUG_DRIVE_INFO
printk(KERN_DEBUG "%s: %s drive%d 0x%08x ",
drive->name, ide_xfer_verbose(speed),
......
......@@ -10,7 +10,6 @@
#endif
#define PDC202XX_DEBUG_DRIVE_INFO 0
#define PDC202XX_DECODE_REGISTER_INFO 0
static const char *pdc_quirk_drives[] = {
"QUANTUM FIREBALLlct08 08",
......@@ -99,76 +98,6 @@ static inline u8 *pdc202xx_ultra_verbose (u32 drive_pci, u16 slow_cable)
#define MC1 0x02 /* DMA"C" timing */
#define MC0 0x01 /* DMA"C" timing */
#if PDC202XX_DECODE_REGISTER_INFO
#define REG_A 0x01
#define REG_B 0x02
#define REG_C 0x04
#define REG_D 0x08
static void decode_registers (u8 registers, u8 value)
{
u8 bit = 0, bit1 = 0, bit2 = 0;
switch(registers) {
case REG_A:
bit2 = 0;
printk("A Register ");
if (value & 0x80) printk("SYNC_IN ");
if (value & 0x40) printk("ERRDY_EN ");
if (value & 0x20) printk("IORDY_EN ");
if (value & 0x10) printk("PREFETCH_EN ");
if (value & 0x08) { printk("PA3 ");bit2 |= 0x08; }
if (value & 0x04) { printk("PA2 ");bit2 |= 0x04; }
if (value & 0x02) { printk("PA1 ");bit2 |= 0x02; }
if (value & 0x01) { printk("PA0 ");bit2 |= 0x01; }
printk("PIO(A) = %d ", bit2);
break;
case REG_B:
bit1 = 0;bit2 = 0;
printk("B Register ");
if (value & 0x80) { printk("MB2 ");bit1 |= 0x80; }
if (value & 0x40) { printk("MB1 ");bit1 |= 0x40; }
if (value & 0x20) { printk("MB0 ");bit1 |= 0x20; }
printk("DMA(B) = %d ", bit1 >> 5);
if (value & 0x10) printk("PIO_FORCED/PB4 ");
if (value & 0x08) { printk("PB3 ");bit2 |= 0x08; }
if (value & 0x04) { printk("PB2 ");bit2 |= 0x04; }
if (value & 0x02) { printk("PB1 ");bit2 |= 0x02; }
if (value & 0x01) { printk("PB0 ");bit2 |= 0x01; }
printk("PIO(B) = %d ", bit2);
break;
case REG_C:
bit2 = 0;
printk("C Register ");
if (value & 0x80) printk("DMARQp ");
if (value & 0x40) printk("IORDYp ");
if (value & 0x20) printk("DMAR_EN ");
if (value & 0x10) printk("DMAW_EN ");
if (value & 0x08) { printk("MC3 ");bit2 |= 0x08; }
if (value & 0x04) { printk("MC2 ");bit2 |= 0x04; }
if (value & 0x02) { printk("MC1 ");bit2 |= 0x02; }
if (value & 0x01) { printk("MC0 ");bit2 |= 0x01; }
printk("DMA(C) = %d ", bit2);
break;
case REG_D:
printk("D Register ");
break;
default:
return;
}
printk("\n %s ", (registers & REG_D) ? "DP" :
(registers & REG_C) ? "CP" :
(registers & REG_B) ? "BP" :
(registers & REG_A) ? "AP" : "ERROR");
for (bit=128;bit>0;bit/=2)
printk("%s", (value & bit) ? "1" : "0");
printk("\n");
}
#endif /* PDC202XX_DECODE_REGISTER_INFO */
#define DISPLAY_PDC202XX_TIMINGS
static void init_setup_pdc202ata4(struct pci_dev *dev, ide_pci_device_t *d);
......
......@@ -88,6 +88,9 @@ static resource_map_t io_db = {
};
static DECLARE_MUTEX(rsrc_sem);
static unsigned int rsrc_mem_probe;
#define MEM_PROBE_LOW (1 << 0)
#define MEM_PROBE_HIGH (1 << 1)
#ifdef CONFIG_PCMCIA_PROBE
......@@ -451,24 +454,22 @@ static u_long inv_probe(resource_map_t *m, struct pcmcia_socket *s)
return do_mem_probe(m->base, m->num, s);
}
static void validate_mem(struct pcmcia_socket *s)
static void validate_mem(struct pcmcia_socket *s, unsigned int probe_mask)
{
resource_map_t *m, mm;
static u_char order[] = { 0xd0, 0xe0, 0xc0, 0xf0 };
static int hi = 0, lo = 0;
u_long b, i, ok = 0;
int force_low = !(s->features & SS_CAP_PAGE_REGS);
down(&rsrc_sem);
/* We do up to four passes through the list */
if (!force_low) {
if (hi++ || (inv_probe(mem_db.next, s) > 0))
goto out;
if (probe_mask & MEM_PROBE_HIGH) {
if (inv_probe(mem_db.next, s) > 0)
return;
printk(KERN_NOTICE "cs: warning: no high memory space "
"available!\n");
}
if (lo++)
goto out;
if ((probe_mask & MEM_PROBE_LOW) == 0)
return;
for (m = mem_db.next; m != &mem_db; m = mm.next) {
mm = *m;
/* Only probe < 1 MB */
......@@ -488,38 +489,51 @@ static void validate_mem(struct pcmcia_socket *s)
}
}
}
out:
up(&rsrc_sem);
}
#else /* CONFIG_PCMCIA_PROBE */
static void validate_mem(struct pcmcia_socket *s)
static void validate_mem(struct pcmcia_socket *s, unsigned int probe_mask)
{
resource_map_t *m, mm;
static int done = 0;
resource_map_t *m, mm;
if (done++ == 0) {
down(&rsrc_sem);
for (m = mem_db.next; m != &mem_db; m = mm.next) {
mm = *m;
if (do_mem_probe(mm.base, mm.num, s))
break;
mm = *m;
if (do_mem_probe(mm.base, mm.num, s))
break;
}
up(&rsrc_sem);
}
}
#endif /* CONFIG_PCMCIA_PROBE */
/*
* Locking note: this is the only place where we take
* both rsrc_sem and skt_sem.
*/
void pcmcia_validate_mem(struct pcmcia_socket *s)
{
down(&s->skt_sem);
if (probe_mem) {
unsigned int probe_mask;
down(&rsrc_sem);
probe_mask = MEM_PROBE_LOW;
if (s->features & SS_CAP_PAGE_REGS)
probe_mask = MEM_PROBE_HIGH;
if (probe_mask & ~rsrc_mem_probe) {
rsrc_mem_probe |= probe_mask;
if (probe_mem && s->state & SOCKET_PRESENT)
validate_mem(s);
down(&s->skt_sem);
up(&s->skt_sem);
if (s->state & SOCKET_PRESENT)
validate_mem(s, probe_mask);
up(&s->skt_sem);
}
up(&rsrc_sem);
}
}
EXPORT_SYMBOL(pcmcia_validate_mem);
......
......@@ -104,4 +104,8 @@ static int __init pnp_system_init(void)
return pnp_register_driver(&system_pnp_driver);
}
subsys_initcall(pnp_system_init);
/**
* Reserve motherboard resources after PCI claim BARs,
* but before PCI assign resources for uninitialized PCI devices
*/
fs_initcall(pnp_system_init);
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