Lines Matching defs:unit
387 if (ATA_INL(ctlr->r_res1, 0x1c) & (ch->unit ? 0x00004000 : 0x00000400)) {
401 ATA_INB(ctlr->r_res1, 0x11) | (ch->unit ? 0x08 : 0x02));
402 ATA_OUTL(ctlr->r_res1, ch->unit ? 0x24 : 0x20,
425 ATA_INB(ctlr->r_res1, 0x11) & ~(ch->unit ? 0x08 : 0x02));
426 ATA_OUTL(ctlr->r_res1, ch->unit ? 0x24 : 0x20, 0);
453 int devno = (ch->unit << 1) + target;
479 (ch->unit ? 1 << 11 : 1 << 10))) {
498 (ch->unit << 7)) & 0x01000000)) {
548 ch->r_io[i].offset = offset + 0x0200 + (i << 2) + (ch->unit << 7);
551 ch->r_io[ATA_CONTROL].offset = offset + 0x0238 + (ch->unit << 7);
555 ((ctlr->chip->cfg2 & (PR_CMBO | PR_CMBO2)) && ch->unit < 2)) {
557 ch->r_io[ATA_SSTATUS].offset = 0x400 + (ch->unit << 8);
559 ch->r_io[ATA_SERROR].offset = 0x404 + (ch->unit << 8);
561 ch->r_io[ATA_SCONTROL].offset = 0x408 + (ch->unit << 8);
596 int unit;
607 for (unit = 0; unit < ctlr->channels; unit++) {
608 if ((ch = ctlr->interrupt[unit].argument))
609 ctlr->interrupt[unit].function(ch);
640 ATA_OUTL(ctlr->r_res2, stat_reg, status & (0x00000011 << ch->unit));
643 if (status & (0x00000001 << ch->unit)) {
650 if (status & (0x00000010 << ch->unit)) {
657 return (vector & (1 << (ch->unit + 1)));
668 ATA_OUTL(ctlr->r_res2, (ch->unit + 1) << 2, 0x00000001);
671 ((ctlr->chip->cfg2 == PR_CMBO2) && (ch->unit < 2))) {
673 ATA_OUTB(ctlr->r_res2, 0x4e8 + (ch->unit << 8), request->unit & 0x0f);
683 wordp[0] = htole32(0x04 | ((ch->unit + 1) << 16) | (0x00 << 24));
688 wordp[0] = htole32(0x00 | ((ch->unit + 1) << 16) | (0x00 << 24));
695 ATA_OUTL(ctlr->r_res2, 0x0240 + (ch->unit << 7), ch->dma.work_bus);
711 ATA_OUTL(ctlr->r_res2, 0xc0260 + (ch->unit << 7), ch->unit + 1);
713 ATA_OUTL(ctlr->r_res2, 0xc0260 + (ch->unit << 7),
714 (ATA_INL(ctlr->r_res2, 0xc0260 + (ch->unit << 7)) &
715 ~0x00003f9f) | (ch->unit + 1));
733 ((ctlr->chip->cfg2 == PR_CMBO) && (ch->unit < 2))) {
735 ATA_OUTL(ctlr->r_res2, 0x06c, (0x00110000 << ch->unit));
739 ATA_OUTL(ctlr->r_res2, 0x0260 + (ch->unit << 7), (1 << 11));
741 ATA_OUTL(ctlr->r_res2, 0x0260 + (ch->unit << 7),
742 (ATA_INL(ctlr->r_res2, 0x0260 + (ch->unit << 7)) &
743 ~0x00003f9f) | (ch->unit + 1));
746 ((ctlr->chip->cfg2 == PR_CMBO) && (ch->unit < 2))) {
753 ATA_OUTL(ctlr->r_res2, 0x06c, (0x00000011 << ch->unit));
762 ((ctlr->chip->cfg2 == PR_CMBO2) && (ch->unit < 2))) {
764 //ATA_OUTL(ctlr->r_res2, 0x4e8 + (ch->unit << 8), 0x0f);
767 ATA_OUTL(ctlr->r_res2, 0x060, (0x00110000 << ch->unit));
771 ATA_OUTL(ctlr->r_res2, 0x0260 + (ch->unit << 7), (1 << 11));
773 ATA_OUTL(ctlr->r_res2, 0x0260 + (ch->unit << 7),
774 (ATA_INL(ctlr->r_res2, 0x0260 + (ch->unit << 7)) &
775 ~0x00003f9f) | (ch->unit + 1));
778 ((ctlr->chip->cfg2 == PR_CMBO2) && (ch->unit < 2))) {
780 ATA_OUTL(ctlr->r_res2, 0x414 + (ch->unit << 8),
781 (ATA_INL(ctlr->r_res2, 0x414 + (ch->unit << 8)) &
815 ATA_OUTL(ctlr->r_res2, 0x060, (0x00000011 << ch->unit));
818 ATA_OUTL(ctlr->r_res2, 0x4e8 + (ch->unit << 8), 0x00);
853 ATA_OUTB(ctlr->r_res2, 0x4e8 + (ch->unit << 8), 0x0f);
904 ATA_OUTB(ctlr->r_res2, 0x4e8 + (ch->unit << 8), 0x0f);
937 ATA_OUTB(ctlr->r_res2, 0x4e8 + (ch->unit << 8), port & 0x0f);
1024 ((ctlr->chip->cfg2 == PR_CMBO) && (ch->unit < 2)) ||
1026 ((ctlr->chip->cfg2 == PR_CMBO2) && (ch->unit < 2)))
1040 ((ctlr->chip->cfg2 == PR_CMBO) && (ch->unit < 2)) ||
1042 ((ctlr->chip->cfg2 == PR_CMBO2) && (ch->unit < 2)))
1054 int unit;
1056 for (unit = 0; unit < ctlr->channels; unit++) {
1057 if (vector & (1 << (unit + 1)))
1058 if ((ch = ctlr->interrupt[unit].argument))
1059 ctlr->interrupt[unit].function(ch);
1060 if (vector & (1 << (unit + 5)))
1061 if ((ch = ctlr->interrupt[unit].argument))
1063 htole32((ch->unit * ATA_PDC_CHN_OFFSET) +
1065 if (vector & (1 << (unit + 9))) {
1067 if ((ch = ctlr->interrupt[unit].argument))
1068 ctlr->interrupt[unit].function(ch);
1070 if (vector & (1 << (unit + 13))) {
1072 if ((ch = ctlr->interrupt[unit].argument))
1073 ATA_OUTL(ctlr->r_res2, 0x000c0240 + (ch->unit << 7),
1074 htole32((ch->unit * ATA_PDC_CHN_OFFSET) +
1106 ATA_OUTL(ctlr->r_res2, 0x000c0400 + ((ch->unit + 1) << 2), 0x00000001);
1115 (window + (ch->unit * ATA_PDC_CHN_OFFSET) + ATA_PDC_APKT_OFFSET);
1116 wordp[0] = htole32(0x08 | ((ch->unit + 1)<<16) | (0x00 << 24));
1121 ATA_OUTL(ctlr->r_res2, 0x000c0400 + ((ch->unit + 1) << 2), 0x00000001);
1122 ATA_OUTL(ctlr->r_res2, 0x000c0240 + (ch->unit << 7),
1123 htole32((ch->unit * ATA_PDC_CHN_OFFSET)+ATA_PDC_APKT_OFFSET));
1132 (window + (ch->unit * ATA_PDC_CHN_OFFSET) + ATA_PDC_HSG_OFFSET);
1141 (window + (ch->unit * ATA_PDC_CHN_OFFSET) + ATA_PDC_LSG_OFFSET);
1142 wordp[0] = htole32((ch->unit * ATA_PDC_BUF_OFFSET) + ATA_PDC_BUF_BASE);
1146 (window + (ch->unit * ATA_PDC_CHN_OFFSET) + ATA_PDC_ASG_OFFSET);
1147 wordp[0] = htole32((ch->unit * ATA_PDC_BUF_OFFSET) + ATA_PDC_BUF_BASE);
1151 (window + (ch->unit * ATA_PDC_CHN_OFFSET) + ATA_PDC_HPKT_OFFSET);
1153 wordp[0] = htole32(0x14 | ((ch->unit+9)<<16) | ((ch->unit+5)<<24));
1155 wordp[0] = htole32(0x00 | ((ch->unit+13)<<16) | (0x00<<24));
1156 wordp[1] = htole32((ch->unit * ATA_PDC_CHN_OFFSET)+ATA_PDC_HSG_OFFSET);
1157 wordp[2] = htole32((ch->unit * ATA_PDC_CHN_OFFSET)+ATA_PDC_LSG_OFFSET);
1161 (window + (ch->unit * ATA_PDC_CHN_OFFSET) + ATA_PDC_APKT_OFFSET);
1163 wordp[0] = htole32(0x04 | ((ch->unit+5)<<16) | (0x00<<24));
1165 wordp[0] = htole32(0x10 | ((ch->unit+1)<<16) | ((ch->unit+13)<<24));
1166 wordp[1] = htole32((ch->unit * ATA_PDC_CHN_OFFSET)+ATA_PDC_ASG_OFFSET);
1172 ATA_OUTL(ctlr->r_res2, 0x000c0400 + ((ch->unit+5)<<2), 0x00000001);
1173 ATA_OUTL(ctlr->r_res2, 0x000c0400 + ((ch->unit+9)<<2), 0x00000001);
1174 ATA_OUTL(ctlr->r_res2, 0x000c0240 + (ch->unit << 7),
1175 htole32((ch->unit * ATA_PDC_CHN_OFFSET) + ATA_PDC_APKT_OFFSET));
1178 ATA_OUTL(ctlr->r_res2, 0x000c0400 + ((ch->unit+1)<<2), 0x00000001);
1179 ATA_OUTL(ctlr->r_res2, 0x000c0400 + ((ch->unit+13)<<2), 0x00000001);
1181 htole32((ch->unit * ATA_PDC_CHN_OFFSET) + ATA_PDC_HPKT_OFFSET));
1193 bytep[i++] = ATA_D_IBM | ATA_D_LBA | ATA_DEV(request->unit);
1214 bytep[i++] = ATA_D_LBA | ATA_DEV(request->unit);
1228 bytep[i++] = ATA_D_LBA | ATA_D_IBM | ATA_DEV(request->unit) |