Fix breakage introduced to the tnt4882 driver in r202870. This PCI

frontend uses the same uPD7210 backend as the pcii ISA frontend, so
the backend has to cope with both situations.

Also, hide the first printf in pcii_probe (address mismatch) behind
bootverbose as the ISA bus parent tries to probe all configured ISA
devices against each driver, so a the console has been cluttered with
this message for a bunch of unrelated driver probes.

MFC after:	3 days
This commit is contained in:
Joerg Wunsch 2010-01-23 21:33:33 +00:00
parent 040a1eeab2
commit ce3853023f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=202898
4 changed files with 13 additions and 6 deletions

View File

@ -138,9 +138,10 @@ pcii_probe(device_t dev)
* 1989 Edition, National Instruments.)
*/
if ((start & 0x3ff) != 0x2e1) {
printf("pcii_probe: PCIIA base address 0x%lx not "
"0x2e1/0x22e1/0x42e1/0x62e1\n",
start);
if (bootverbose)
printf("pcii_probe: PCIIA base address 0x%lx not "
"0x2e1/0x22e1/0x42e1/0x62e1\n",
start);
return (ENXIO);
}
@ -234,6 +235,7 @@ pcii_attach(device_t dev)
for (rid = 0; rid < 8; rid++) {
sc->upd7210.reg_res[rid] = sc->res[2 + rid];
sc->upd7210.reg_offset[rid] = 0;
}
sc->upd7210.irq_clear_res = sc->res[10];

View File

@ -309,6 +309,9 @@ tnt_attach(device_t dev)
/* No DMA help */
sc->upd7210.dmachan = -1;
/* No "special interrupt handling" needed here. */
sc->upd7210.irq_clear_res = NULL;
upd7210attach(&sc->upd7210);
return (0);

View File

@ -72,7 +72,7 @@ upd7210_rd(struct upd7210 *u, enum upd7210_rreg reg)
{
u_int r;
r = bus_read_1(u->reg_res[reg], 0);
r = bus_read_1(u->reg_res[reg], u->reg_offset[reg]);
u->rreg[reg] = r;
return (r);
}
@ -81,7 +81,7 @@ void
upd7210_wr(struct upd7210 *u, enum upd7210_wreg reg, u_int val)
{
bus_write_1(u->reg_res[reg], 0, val);
bus_write_1(u->reg_res[reg], u->reg_offset[reg], val);
u->wreg[reg] = val;
if (reg == AUXMR)
u->wreg[8 + (val >> 5)] = val & 0x1f;
@ -125,7 +125,8 @@ upd7210intr(void *arg)
* Some clones apparently don't implement this
* feature, but National Instrument cards do.
*/
bus_write_1(u->irq_clear_res, 0, 42);
if (u->irq_clear_res != NULL)
bus_write_1(u->irq_clear_res, 0, 42);
}
mtx_unlock(&u->mutex);
}

View File

@ -50,6 +50,7 @@ typedef int upd7210_irq_t(struct upd7210 *, int);
struct upd7210 {
struct resource *reg_res[8];
struct resource *irq_clear_res;
u_int reg_offset[8];
int dmachan;
int unit;