Fix the DMA setup.
This commit is contained in:
parent
1a9c6d05a3
commit
1939acdbd2
|
@ -26,7 +26,7 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: aha1542.c,v 1.32 1994/07/27 03:09:21 mycroft Exp $
|
||||
* $Id: aha1542.c,v 1.33 1994/07/27 13:10:33 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -316,8 +316,8 @@ struct aha_softc {
|
|||
struct aha_mbx aha_mbx; /* all the mailboxes */
|
||||
struct aha_ccb *aha_ccb_free; /* the next free CCB */
|
||||
struct aha_ccb aha_ccb[AHA_MBX_SIZE]; /* all the CCBs */
|
||||
int aha_int; /* our IRQ level */
|
||||
int aha_dma; /* our DMA req channel */
|
||||
u_short aha_int; /* our IRQ level */
|
||||
u_short aha_dma; /* our DMA req channel */
|
||||
int aha_scsi_dev; /* our SCSI bus address */
|
||||
struct scsi_link sc_link; /* prototype for subdevs */
|
||||
};
|
||||
|
@ -549,14 +549,14 @@ ahaprobe(parent, self, aux)
|
|||
* If it's there, put in it's interrupt vectors and dma channel
|
||||
*/
|
||||
if (ia->ia_irq != IRQUNK) {
|
||||
if (ia->ia_irq != (1 << aha->aha_int)) {
|
||||
if (ia->ia_irq != aha->aha_int) {
|
||||
printf("aha%d: irq mismatch; kernel configured %d != board configured %d\n",
|
||||
aha->sc_dev.dv_unit, ffs(ia->ia_irq) - 1,
|
||||
aha->aha_int);
|
||||
ffs(aha->aha_int) - 1);
|
||||
return 0;
|
||||
}
|
||||
} else
|
||||
ia->ia_irq = (1 << aha->aha_int);
|
||||
ia->ia_irq = aha->aha_int;
|
||||
|
||||
if (ia->ia_drq != DRQUNK) {
|
||||
if (ia->ia_drq != aha->aha_dma) {
|
||||
|
@ -588,6 +588,9 @@ ahaattach(parent, self, aux)
|
|||
struct isa_attach_args *ia = aux;
|
||||
struct aha_softc *aha = (void *)self;
|
||||
|
||||
if (ia->ia_drq != DRQUNK)
|
||||
isa_dmacascade(ia->ia_drq);
|
||||
|
||||
aha_init(aha);
|
||||
|
||||
/*
|
||||
|
@ -932,23 +935,15 @@ noinquire:
|
|||
aha_cmd(aha, 0, sizeof(conf), 0, &conf, AHA_CONF_GET);
|
||||
switch (conf.chan) {
|
||||
case CHAN0:
|
||||
outb(0x0b, 0x0c);
|
||||
outb(0x0a, 0x00);
|
||||
aha->aha_dma = 0;
|
||||
break;
|
||||
case CHAN5:
|
||||
outb(0xd6, 0xc1);
|
||||
outb(0xd4, 0x01);
|
||||
aha->aha_dma = 5;
|
||||
break;
|
||||
case CHAN6:
|
||||
outb(0xd6, 0xc2);
|
||||
outb(0xd4, 0x02);
|
||||
aha->aha_dma = 6;
|
||||
break;
|
||||
case CHAN7:
|
||||
outb(0xd6, 0xc3);
|
||||
outb(0xd4, 0x03);
|
||||
aha->aha_dma = 7;
|
||||
break;
|
||||
default:
|
||||
|
@ -958,22 +953,22 @@ noinquire:
|
|||
|
||||
switch (conf.intr) {
|
||||
case INT9:
|
||||
aha->aha_int = 9;
|
||||
aha->aha_int = IRQ9;
|
||||
break;
|
||||
case INT10:
|
||||
aha->aha_int = 10;
|
||||
aha->aha_int = IRQ10;
|
||||
break;
|
||||
case INT11:
|
||||
aha->aha_int = 11;
|
||||
aha->aha_int = IRQ11;
|
||||
break;
|
||||
case INT12:
|
||||
aha->aha_int = 12;
|
||||
aha->aha_int = IRQ12;
|
||||
break;
|
||||
case INT14:
|
||||
aha->aha_int = 14;
|
||||
aha->aha_int = IRQ14;
|
||||
break;
|
||||
case INT15:
|
||||
aha->aha_int = 15;
|
||||
aha->aha_int = IRQ15;
|
||||
break;
|
||||
default:
|
||||
printf("illegal int setting %x\n", conf.intr);
|
||||
|
@ -990,6 +985,7 @@ noinquire:
|
|||
aha_cmd(aha, 1, 0, 0, 0, AHA_BUS_OFF_TIME_SET, 4);
|
||||
|
||||
#ifdef TUNE_1542
|
||||
#error XXX Must deal with configuring the DRQ channel if we do this.
|
||||
/*
|
||||
* Initialize memory transfer speed
|
||||
* Not compiled in by default because it breaks some machines
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ultra14f.c,v 1.31 1994/07/27 02:34:54 mycroft Exp $
|
||||
* $Id: ultra14f.c,v 1.32 1994/07/27 13:10:36 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -299,9 +299,9 @@ struct uha_softc {
|
|||
|
||||
struct mscp *mscphash[MSCP_HASH_SIZE];
|
||||
struct mscp *free_mscp;
|
||||
int our_id; /* our scsi id */
|
||||
int vect;
|
||||
int dma;
|
||||
u_short uha_int;
|
||||
u_short uha_dma;
|
||||
int uha_scsi_dev; /* our scsi id */
|
||||
int nummscps;
|
||||
struct scsi_link sc_link;
|
||||
};
|
||||
|
@ -583,29 +583,29 @@ uhaprobe(parent, self, aux)
|
|||
|
||||
/*
|
||||
* Try initialise a unit at this location
|
||||
* sets up dma and bus speed, loads uha->vect
|
||||
* sets up dma and bus speed, loads uha->uha_int
|
||||
*/
|
||||
if (u24_find(uha, ia) != 0 && u14_find(uha, ia) != 0)
|
||||
return 0;
|
||||
|
||||
if (ia->ia_irq != IRQUNK) {
|
||||
if (ia->ia_irq != (1 << uha->vect)) {
|
||||
if (ia->ia_irq != uha->uha_int) {
|
||||
printf("uha%d: irq mismatch; kernel configured %d != board configured %d\n",
|
||||
uha->sc_dev.dv_unit, ffs(ia->ia_irq) - 1,
|
||||
uha->vect);
|
||||
ffs(uha->uha_int) - 1);
|
||||
return 0;
|
||||
}
|
||||
} else
|
||||
ia->ia_irq = (1 << uha->vect);
|
||||
ia->ia_irq = uha->uha_int;
|
||||
|
||||
if (ia->ia_drq != DRQUNK) {
|
||||
if (ia->ia_drq != uha->dma) {
|
||||
if (ia->ia_drq != uha->uha_dma) {
|
||||
printf("uha%d: drq mismatch; kernel configured %d != board configured %d\n",
|
||||
uha->sc_dev.dv_unit, ia->ia_drq, uha->dma);
|
||||
uha->sc_dev.dv_unit, ia->ia_drq, uha->uha_dma);
|
||||
return 0;
|
||||
}
|
||||
} else
|
||||
ia->ia_drq = uha->dma;
|
||||
ia->ia_drq = uha->uha_dma;
|
||||
|
||||
ia->ia_msize = 0;
|
||||
ia->ia_iosize = 4;
|
||||
|
@ -628,6 +628,9 @@ uhaattach(parent, self, aux)
|
|||
struct isa_attach_args *ia = aux;
|
||||
struct uha_softc *uha = (void *)self;
|
||||
|
||||
if (ia->ia_drq != DRQUNK)
|
||||
isa_dmacascade(ia->ia_drq);
|
||||
|
||||
(uha->init)(uha);
|
||||
|
||||
/*
|
||||
|
@ -975,13 +978,13 @@ u14_find(uha, ia)
|
|||
|
||||
switch (dma_ch) {
|
||||
case U14_DMA_CH5:
|
||||
uha->dma = 5;
|
||||
uha->uha_dma = 5;
|
||||
break;
|
||||
case U14_DMA_CH6:
|
||||
uha->dma = 6;
|
||||
uha->uha_dma = 6;
|
||||
break;
|
||||
case U14_DMA_CH7:
|
||||
uha->dma = 7;
|
||||
uha->uha_dma = 7;
|
||||
break;
|
||||
default:
|
||||
printf("illegal dma setting %x\n", dma_ch);
|
||||
|
@ -990,16 +993,16 @@ u14_find(uha, ia)
|
|||
|
||||
switch (irq_ch) {
|
||||
case U14_IRQ10:
|
||||
uha->vect = 10;
|
||||
uha->uha_int = IRQ10;
|
||||
break;
|
||||
case U14_IRQ11:
|
||||
uha->vect = 11;
|
||||
uha->uha_int = IRQ11;
|
||||
break;
|
||||
case U14_IRQ14:
|
||||
uha->vect = 14;
|
||||
uha->uha_int = IRQ14;
|
||||
break;
|
||||
case U14_IRQ15:
|
||||
uha->vect = 15;
|
||||
uha->uha_int = IRQ15;
|
||||
break;
|
||||
default:
|
||||
printf("illegal int setting %x\n", irq_ch);
|
||||
|
@ -1076,18 +1079,20 @@ u24_find(uha, ia)
|
|||
irq_ch = config0 & U24_IRQ_MASK;
|
||||
uha_id = config2 & U24_HOSTID_MASK;
|
||||
|
||||
uha->uha_dma = DRQUNK;
|
||||
|
||||
switch (irq_ch) {
|
||||
case U24_IRQ10:
|
||||
uha->vect = 10;
|
||||
uha->uha_int = IRQ10;
|
||||
break;
|
||||
case U24_IRQ11:
|
||||
uha->vect = 11;
|
||||
uha->uha_int = IRQ11;
|
||||
break;
|
||||
case U24_IRQ14:
|
||||
uha->vect = 14;
|
||||
uha->uha_int = IRQ14;
|
||||
break;
|
||||
case U24_IRQ15:
|
||||
uha->vect = 15;
|
||||
uha->uha_int = IRQ15;
|
||||
break;
|
||||
default:
|
||||
printf("illegal int setting %x\n", irq_ch);
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: aha1542.c,v 1.32 1994/07/27 03:09:21 mycroft Exp $
|
||||
* $Id: aha1542.c,v 1.33 1994/07/27 13:10:33 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -316,8 +316,8 @@ struct aha_softc {
|
|||
struct aha_mbx aha_mbx; /* all the mailboxes */
|
||||
struct aha_ccb *aha_ccb_free; /* the next free CCB */
|
||||
struct aha_ccb aha_ccb[AHA_MBX_SIZE]; /* all the CCBs */
|
||||
int aha_int; /* our IRQ level */
|
||||
int aha_dma; /* our DMA req channel */
|
||||
u_short aha_int; /* our IRQ level */
|
||||
u_short aha_dma; /* our DMA req channel */
|
||||
int aha_scsi_dev; /* our SCSI bus address */
|
||||
struct scsi_link sc_link; /* prototype for subdevs */
|
||||
};
|
||||
|
@ -549,14 +549,14 @@ ahaprobe(parent, self, aux)
|
|||
* If it's there, put in it's interrupt vectors and dma channel
|
||||
*/
|
||||
if (ia->ia_irq != IRQUNK) {
|
||||
if (ia->ia_irq != (1 << aha->aha_int)) {
|
||||
if (ia->ia_irq != aha->aha_int) {
|
||||
printf("aha%d: irq mismatch; kernel configured %d != board configured %d\n",
|
||||
aha->sc_dev.dv_unit, ffs(ia->ia_irq) - 1,
|
||||
aha->aha_int);
|
||||
ffs(aha->aha_int) - 1);
|
||||
return 0;
|
||||
}
|
||||
} else
|
||||
ia->ia_irq = (1 << aha->aha_int);
|
||||
ia->ia_irq = aha->aha_int;
|
||||
|
||||
if (ia->ia_drq != DRQUNK) {
|
||||
if (ia->ia_drq != aha->aha_dma) {
|
||||
|
@ -588,6 +588,9 @@ ahaattach(parent, self, aux)
|
|||
struct isa_attach_args *ia = aux;
|
||||
struct aha_softc *aha = (void *)self;
|
||||
|
||||
if (ia->ia_drq != DRQUNK)
|
||||
isa_dmacascade(ia->ia_drq);
|
||||
|
||||
aha_init(aha);
|
||||
|
||||
/*
|
||||
|
@ -932,23 +935,15 @@ noinquire:
|
|||
aha_cmd(aha, 0, sizeof(conf), 0, &conf, AHA_CONF_GET);
|
||||
switch (conf.chan) {
|
||||
case CHAN0:
|
||||
outb(0x0b, 0x0c);
|
||||
outb(0x0a, 0x00);
|
||||
aha->aha_dma = 0;
|
||||
break;
|
||||
case CHAN5:
|
||||
outb(0xd6, 0xc1);
|
||||
outb(0xd4, 0x01);
|
||||
aha->aha_dma = 5;
|
||||
break;
|
||||
case CHAN6:
|
||||
outb(0xd6, 0xc2);
|
||||
outb(0xd4, 0x02);
|
||||
aha->aha_dma = 6;
|
||||
break;
|
||||
case CHAN7:
|
||||
outb(0xd6, 0xc3);
|
||||
outb(0xd4, 0x03);
|
||||
aha->aha_dma = 7;
|
||||
break;
|
||||
default:
|
||||
|
@ -958,22 +953,22 @@ noinquire:
|
|||
|
||||
switch (conf.intr) {
|
||||
case INT9:
|
||||
aha->aha_int = 9;
|
||||
aha->aha_int = IRQ9;
|
||||
break;
|
||||
case INT10:
|
||||
aha->aha_int = 10;
|
||||
aha->aha_int = IRQ10;
|
||||
break;
|
||||
case INT11:
|
||||
aha->aha_int = 11;
|
||||
aha->aha_int = IRQ11;
|
||||
break;
|
||||
case INT12:
|
||||
aha->aha_int = 12;
|
||||
aha->aha_int = IRQ12;
|
||||
break;
|
||||
case INT14:
|
||||
aha->aha_int = 14;
|
||||
aha->aha_int = IRQ14;
|
||||
break;
|
||||
case INT15:
|
||||
aha->aha_int = 15;
|
||||
aha->aha_int = IRQ15;
|
||||
break;
|
||||
default:
|
||||
printf("illegal int setting %x\n", conf.intr);
|
||||
|
@ -990,6 +985,7 @@ noinquire:
|
|||
aha_cmd(aha, 1, 0, 0, 0, AHA_BUS_OFF_TIME_SET, 4);
|
||||
|
||||
#ifdef TUNE_1542
|
||||
#error XXX Must deal with configuring the DRQ channel if we do this.
|
||||
/*
|
||||
* Initialize memory transfer speed
|
||||
* Not compiled in by default because it breaks some machines
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ultra14f.c,v 1.31 1994/07/27 02:34:54 mycroft Exp $
|
||||
* $Id: ultra14f.c,v 1.32 1994/07/27 13:10:36 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -299,9 +299,9 @@ struct uha_softc {
|
|||
|
||||
struct mscp *mscphash[MSCP_HASH_SIZE];
|
||||
struct mscp *free_mscp;
|
||||
int our_id; /* our scsi id */
|
||||
int vect;
|
||||
int dma;
|
||||
u_short uha_int;
|
||||
u_short uha_dma;
|
||||
int uha_scsi_dev; /* our scsi id */
|
||||
int nummscps;
|
||||
struct scsi_link sc_link;
|
||||
};
|
||||
|
@ -583,29 +583,29 @@ uhaprobe(parent, self, aux)
|
|||
|
||||
/*
|
||||
* Try initialise a unit at this location
|
||||
* sets up dma and bus speed, loads uha->vect
|
||||
* sets up dma and bus speed, loads uha->uha_int
|
||||
*/
|
||||
if (u24_find(uha, ia) != 0 && u14_find(uha, ia) != 0)
|
||||
return 0;
|
||||
|
||||
if (ia->ia_irq != IRQUNK) {
|
||||
if (ia->ia_irq != (1 << uha->vect)) {
|
||||
if (ia->ia_irq != uha->uha_int) {
|
||||
printf("uha%d: irq mismatch; kernel configured %d != board configured %d\n",
|
||||
uha->sc_dev.dv_unit, ffs(ia->ia_irq) - 1,
|
||||
uha->vect);
|
||||
ffs(uha->uha_int) - 1);
|
||||
return 0;
|
||||
}
|
||||
} else
|
||||
ia->ia_irq = (1 << uha->vect);
|
||||
ia->ia_irq = uha->uha_int;
|
||||
|
||||
if (ia->ia_drq != DRQUNK) {
|
||||
if (ia->ia_drq != uha->dma) {
|
||||
if (ia->ia_drq != uha->uha_dma) {
|
||||
printf("uha%d: drq mismatch; kernel configured %d != board configured %d\n",
|
||||
uha->sc_dev.dv_unit, ia->ia_drq, uha->dma);
|
||||
uha->sc_dev.dv_unit, ia->ia_drq, uha->uha_dma);
|
||||
return 0;
|
||||
}
|
||||
} else
|
||||
ia->ia_drq = uha->dma;
|
||||
ia->ia_drq = uha->uha_dma;
|
||||
|
||||
ia->ia_msize = 0;
|
||||
ia->ia_iosize = 4;
|
||||
|
@ -628,6 +628,9 @@ uhaattach(parent, self, aux)
|
|||
struct isa_attach_args *ia = aux;
|
||||
struct uha_softc *uha = (void *)self;
|
||||
|
||||
if (ia->ia_drq != DRQUNK)
|
||||
isa_dmacascade(ia->ia_drq);
|
||||
|
||||
(uha->init)(uha);
|
||||
|
||||
/*
|
||||
|
@ -975,13 +978,13 @@ u14_find(uha, ia)
|
|||
|
||||
switch (dma_ch) {
|
||||
case U14_DMA_CH5:
|
||||
uha->dma = 5;
|
||||
uha->uha_dma = 5;
|
||||
break;
|
||||
case U14_DMA_CH6:
|
||||
uha->dma = 6;
|
||||
uha->uha_dma = 6;
|
||||
break;
|
||||
case U14_DMA_CH7:
|
||||
uha->dma = 7;
|
||||
uha->uha_dma = 7;
|
||||
break;
|
||||
default:
|
||||
printf("illegal dma setting %x\n", dma_ch);
|
||||
|
@ -990,16 +993,16 @@ u14_find(uha, ia)
|
|||
|
||||
switch (irq_ch) {
|
||||
case U14_IRQ10:
|
||||
uha->vect = 10;
|
||||
uha->uha_int = IRQ10;
|
||||
break;
|
||||
case U14_IRQ11:
|
||||
uha->vect = 11;
|
||||
uha->uha_int = IRQ11;
|
||||
break;
|
||||
case U14_IRQ14:
|
||||
uha->vect = 14;
|
||||
uha->uha_int = IRQ14;
|
||||
break;
|
||||
case U14_IRQ15:
|
||||
uha->vect = 15;
|
||||
uha->uha_int = IRQ15;
|
||||
break;
|
||||
default:
|
||||
printf("illegal int setting %x\n", irq_ch);
|
||||
|
@ -1076,18 +1079,20 @@ u24_find(uha, ia)
|
|||
irq_ch = config0 & U24_IRQ_MASK;
|
||||
uha_id = config2 & U24_HOSTID_MASK;
|
||||
|
||||
uha->uha_dma = DRQUNK;
|
||||
|
||||
switch (irq_ch) {
|
||||
case U24_IRQ10:
|
||||
uha->vect = 10;
|
||||
uha->uha_int = IRQ10;
|
||||
break;
|
||||
case U24_IRQ11:
|
||||
uha->vect = 11;
|
||||
uha->uha_int = IRQ11;
|
||||
break;
|
||||
case U24_IRQ14:
|
||||
uha->vect = 14;
|
||||
uha->uha_int = IRQ14;
|
||||
break;
|
||||
case U24_IRQ15:
|
||||
uha->vect = 15;
|
||||
uha->uha_int = IRQ15;
|
||||
break;
|
||||
default:
|
||||
printf("illegal int setting %x\n", irq_ch);
|
||||
|
|
Loading…
Reference in New Issue