Ali M5229 IDE controllers: tweak the rigth 0x79 register (the one from the
pci/isa bridge, not the one from the IDE controller).
This commit is contained in:
parent
349f0e356b
commit
92aaf348cf
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pciide.c,v 1.128 2001/08/23 10:02:25 tsutsui Exp $ */
|
||||
/* $NetBSD: pciide.c,v 1.129 2001/09/24 20:03:47 bouyer Exp $ */
|
||||
|
||||
|
||||
/*
|
||||
|
@ -184,6 +184,7 @@ void sis_setup_channel __P((struct channel_softc*));
|
|||
void acer_chip_map __P((struct pciide_softc*, struct pci_attach_args*));
|
||||
void acer_setup_channel __P((struct channel_softc*));
|
||||
int acer_pci_intr __P((void *));
|
||||
int acer_isabr_match __P(( struct pci_attach_args *));
|
||||
|
||||
void pdc202xx_chip_map __P((struct pciide_softc*, struct pci_attach_args*));
|
||||
void pdc202xx_setup_channel __P((struct channel_softc*));
|
||||
|
@ -2887,11 +2888,23 @@ pio: sis_tim |= sis_pio_act[drvp->PIO_mode] <<
|
|||
pciide_print_modes(cp);
|
||||
}
|
||||
|
||||
int
|
||||
acer_isabr_match(pa)
|
||||
struct pci_attach_args *pa;
|
||||
{
|
||||
if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_ALI &&
|
||||
PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ALI_M1543)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
acer_chip_map(sc, pa)
|
||||
struct pciide_softc *sc;
|
||||
struct pci_attach_args *pa;
|
||||
{
|
||||
struct pci_attach_args isa_pa;
|
||||
struct pciide_channel *cp;
|
||||
int channel;
|
||||
pcireg_t cr, interface;
|
||||
|
@ -2953,16 +2966,26 @@ acer_chip_map(sc, pa)
|
|||
pciide_pci_read(sc->sc_pc, sc->sc_tag, ACER_0x4B)
|
||||
| ACER_0x4B_CDETECT);
|
||||
/* set south-bridge's enable bit, m1533, 0x79 */
|
||||
if (rev == 0xC2)
|
||||
/* 1543C-B0 (m1533, 0x79, bit 2) */
|
||||
pciide_pci_write(sc->sc_pc, sc->sc_tag, ACER_0x79,
|
||||
pciide_pci_read(sc->sc_pc, sc->sc_tag, ACER_0x79)
|
||||
| ACER_0x79_REVC2_EN);
|
||||
else
|
||||
/* 1553/1535 (m1533, 0x79, bit 1) */
|
||||
pciide_pci_write(sc->sc_pc, sc->sc_tag, ACER_0x79,
|
||||
pciide_pci_read(sc->sc_pc, sc->sc_tag, ACER_0x79)
|
||||
| ACER_0x79_EN);
|
||||
if (pci_find_device(&isa_pa, acer_isabr_match) == 0) {
|
||||
printf("%s: can't find PCI/ISA bridge, downgrading "
|
||||
"to Ultra/33\n", sc->sc_wdcdev.sc_dev.dv_xname);
|
||||
sc->sc_wdcdev.UDMA_cap = 2;
|
||||
} else {
|
||||
if (rev == 0xC2)
|
||||
/* 1543C-B0 (m1533, 0x79, bit 2) */
|
||||
pciide_pci_write(isa_pa.pa_pc, isa_pa.pa_tag,
|
||||
ACER_0x79,
|
||||
pciide_pci_read(isa_pa.pa_pc, isa_pa.pa_tag,
|
||||
ACER_0x79)
|
||||
| ACER_0x79_REVC2_EN);
|
||||
else
|
||||
/* 1553/1535 (m1533, 0x79, bit 1) */
|
||||
pciide_pci_write(isa_pa.pa_pc, isa_pa.pa_tag,
|
||||
ACER_0x79,
|
||||
pciide_pci_read(isa_pa.pa_pc, isa_pa.pa_tag,
|
||||
ACER_0x79)
|
||||
| ACER_0x79_EN);
|
||||
}
|
||||
}
|
||||
|
||||
for (channel = 0; channel < sc->sc_wdcdev.nchannels; channel++) {
|
||||
|
|
Loading…
Reference in New Issue