Add support for Acard ATP865/A Ultra100 IDE Controllers. From Tsubai Masanari.

This commit is contained in:
tsutsui 2003-10-24 15:50:02 +00:00
parent 723afbe9db
commit 6c2bb73613
2 changed files with 28 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: acardide.c,v 1.4 2003/10/24 15:47:49 tsutsui Exp $ */ /* $NetBSD: acardide.c,v 1.5 2003/10/24 15:50:02 tsutsui Exp $ */
/* /*
* Copyright (c) 2001 Izumi Tsutsui. * Copyright (c) 2001 Izumi Tsutsui.
@ -63,6 +63,16 @@ static const struct pciide_product_desc pciide_acard_products[] = {
"Acard ATP860-A Ultra66 IDE Controller", "Acard ATP860-A Ultra66 IDE Controller",
acard_chip_map, acard_chip_map,
}, },
{ PCI_PRODUCT_ACARD_ATP865,
0,
"Acard ATP865 Ultra100 IDE Controller",
acard_chip_map,
},
{ PCI_PRODUCT_ACARD_ATP865A,
0,
"Acard ATP865-A Ultra100 IDE Controller",
acard_chip_map,
},
{ 0, { 0,
0, 0,
NULL, NULL,
@ -132,7 +142,19 @@ acard_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
} }
sc->sc_wdcdev.PIO_cap = 4; sc->sc_wdcdev.PIO_cap = 4;
sc->sc_wdcdev.DMA_cap = 2; sc->sc_wdcdev.DMA_cap = 2;
sc->sc_wdcdev.UDMA_cap = ACARD_IS_850(sc) ? 2 : 4; switch (sc->sc_pp->ide_product) {
case PCI_PRODUCT_ACARD_ATP860:
case PCI_PRODUCT_ACARD_ATP860A:
sc->sc_wdcdev.UDMA_cap = 4;
break;
case PCI_PRODUCT_ACARD_ATP865:
case PCI_PRODUCT_ACARD_ATP865A:
sc->sc_wdcdev.UDMA_cap = 5;
break;
default:
sc->sc_wdcdev.UDMA_cap = 2;
break;
}
sc->sc_wdcdev.set_modes = acard_setup_channel; sc->sc_wdcdev.set_modes = acard_setup_channel;
sc->sc_wdcdev.channels = sc->wdc_chanarray; sc->sc_wdcdev.channels = sc->wdc_chanarray;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pciide_acard_reg.h,v 1.2 2001/10/21 18:49:19 thorpej Exp $ */ /* $NetBSD: pciide_acard_reg.h,v 1.3 2003/10/24 15:50:02 tsutsui Exp $ */
/* /*
* Copyright (c) 2001 Izumi Tsutsui. * Copyright (c) 2001 Izumi Tsutsui.
@ -37,8 +37,8 @@
((channel) * 16 + (drive) * 8)) ((channel) * 16 + (drive) * 8))
#define ATP860_SETTIME_MASK(channel) (0xffff << ((channel) * 16)) #define ATP860_SETTIME_MASK(channel) (0xffff << ((channel) * 16))
static const u_int8_t acard_act_udma[] = {0x3, 0x3, 0x3, 0x3, 0x3}; static const u_int8_t acard_act_udma[] = {0x3, 0x3, 0x3, 0x3, 0x3, 0x3};
static const u_int8_t acard_rec_udma[] = {0x1, 0x1, 0x1, 0x1, 0x1}; static const u_int8_t acard_rec_udma[] = {0x1, 0x1, 0x1, 0x1, 0x1, 0x1};
static const u_int8_t acard_act_dma[] = {0x0, 0x3, 0x3}; static const u_int8_t acard_act_dma[] = {0x0, 0x3, 0x3};
static const u_int8_t acard_rec_dma[] = {0xa, 0x3, 0x1}; static const u_int8_t acard_rec_dma[] = {0xa, 0x3, 0x1};
static const u_int8_t acard_act_pio[] = {0x0, 0x0, 0x0, 0x3, 0x3}; static const u_int8_t acard_act_pio[] = {0x0, 0x0, 0x0, 0x3, 0x3};
@ -55,7 +55,7 @@ static const u_int8_t acard_rec_pio[] = {0x0, 0xa, 0x8, 0x3, 0x1};
#define ATP860_UDMA_MASK(channel) (0xff << ((channel) * 8)) #define ATP860_UDMA_MASK(channel) (0xff << ((channel) * 8))
static const u_int8_t acard_udma_conf[] __attribute__((__unused__)) = static const u_int8_t acard_udma_conf[] __attribute__((__unused__)) =
{0x1, 0x2, 0x3, 0x4, 0x5}; {0x1, 0x2, 0x3, 0x4, 0x5, 0x6};
#define ATP8x0_CTRL 0x48 #define ATP8x0_CTRL 0x48
#define ATP8x0_CTRL_EN(chan) (0x00020000 << (chan)) #define ATP8x0_CTRL_EN(chan) (0x00020000 << (chan))