Home | History | Annotate | Download | only in ic

Lines Matching refs:wdr

181 wdc_init_shadow_regs(struct wdc_regs *wdr)
183 wdr->cmd_iohs[wd_status] = wdr->cmd_iohs[wd_command];
184 wdr->cmd_iohs[wd_features] = wdr->cmd_iohs[wd_error];
208 struct wdc_regs *wdr = CHAN_TO_WDC_REGS(chp);
219 switch (sata_reset_interface(chp, wdr->sata_iot, wdr->sata_control,
220 wdr->sata_status, AT_WAIT)) {
224 bus_space_write_1(wdr->cmd_iot,
225 wdr->cmd_iohs[wd_sdh], 0, WDSD_IBM);
227 st = bus_space_read_1(wdr->cmd_iot,
228 wdr->cmd_iohs[wd_status], 0);
236 sc = bus_space_read_1(wdr->cmd_iot,
237 wdr->cmd_iohs[wd_seccnt], 0);
238 sn = bus_space_read_1(wdr->cmd_iot,
239 wdr->cmd_iohs[wd_sector], 0);
240 cl = bus_space_read_1(wdr->cmd_iot,
241 wdr->cmd_iohs[wd_cyl_lo], 0);
242 ch = bus_space_read_1(wdr->cmd_iot,
243 wdr->cmd_iohs[wd_cyl_hi], 0);
298 struct wdc_regs *wdr = &wdc->regs[chp->ch_channel];
324 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh],
327 st1 = bus_space_read_1(wdr->cmd_iot,
328 wdr->cmd_iohs[wd_status], 0);
333 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh],
336 st0 = bus_space_read_1(wdr->cmd_iot,
337 wdr->cmd_iohs[wd_status], 0);
432 bus_space_write_1(wdr->cmd_iot,
433 wdr->cmd_iohs[wd_sdh], 0, WDSD_IBM | (i << 4));
435 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_error],
437 bus_space_write_1(wdr->cmd_iot,
438 wdr->cmd_iohs[wd_cyl_lo], 0, 0xa5);
439 if (bus_space_read_1(wdr->cmd_iot,
440 wdr->cmd_iohs[wd_error], 0) == 0x58 ||
441 bus_space_read_1(wdr->cmd_iot,
442 wdr->cmd_iohs[wd_cyl_lo], 0) != 0xa5) {
460 bus_space_write_1(wdr->cmd_iot,
461 wdr->cmd_iohs[wd_command], 0, WDCC_RECAL);
485 wdcprobe(struct wdc_regs *wdr)
488 return wdcprobe_with_reset(wdr, NULL);
492 wdcprobe_with_reset(struct wdc_regs *wdr,
504 wdc->regs = wdr;
525 struct wdc_regs *wdr = &wdc->regs[chp->ch_channel];
543 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh],
546 st0 = bus_space_read_1(wdr->cmd_iot,
547 wdr->cmd_iohs[wd_status], 0);
552 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh],
555 st1 = bus_space_read_1(wdr->cmd_iot,
556 wdr->cmd_iohs[wd_status], 0);
572 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh],
574 bus_space_write_1(wdr->cmd_iot,
575 wdr->cmd_iohs[wd_cyl_lo], 0, 0x02);
576 cl = bus_space_read_1(wdr->cmd_iot,
577 wdr->cmd_iohs[wd_cyl_lo], 0);
585 bus_space_write_1(wdr->cmd_iot,
586 wdr->cmd_iohs[wd_cyl_lo], 0, 0x01);
587 cl = bus_space_read_1(wdr->cmd_iot,
588 wdr->cmd_iohs[wd_cyl_lo], 0);
596 bus_space_write_1(wdr->cmd_iot,
597 wdr->cmd_iohs[wd_sector], 0, 0x01);
598 cl = bus_space_read_1(wdr->cmd_iot,
599 wdr->cmd_iohs[wd_sector], 0);
607 bus_space_write_1(wdr->cmd_iot,
608 wdr->cmd_iohs[wd_sector], 0, 0x02);
609 cl = bus_space_read_1(wdr->cmd_iot,
610 wdr->cmd_iohs[wd_sector], 0);
618 cl = bus_space_read_1(wdr->cmd_iot,
619 wdr->cmd_iohs[wd_cyl_lo], 0);
632 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh],
634 bus_space_write_1(wdr->cmd_iot,
635 wdr->cmd_iohs[wd_cyl_lo], 0, 0x02);
636 cl = bus_space_read_1(wdr->cmd_iot,
637 wdr->cmd_iohs[wd_cyl_lo], 0);
645 bus_space_write_1(wdr->cmd_iot,
646 wdr->cmd_iohs[wd_cyl_lo], 0, 0x01);
647 cl = bus_space_read_1(wdr->cmd_iot,
648 wdr->cmd_iohs[wd_cyl_lo], 0);
656 bus_space_write_1(wdr->cmd_iot,
657 wdr->cmd_iohs[wd_sector], 0, 0x01);
658 cl = bus_space_read_1(wdr->cmd_iot,
659 wdr->cmd_iohs[wd_sector], 0);
667 bus_space_write_1(wdr->cmd_iot,
668 wdr->cmd_iohs[wd_sector], 0, 0x02);
669 cl = bus_space_read_1(wdr->cmd_iot,
670 wdr->cmd_iohs[wd_sector], 0);
678 cl = bus_space_read_1(wdr->cmd_iot,
679 wdr->cmd_iohs[wd_cyl_lo], 0);
702 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh],
704 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_command], 0,
710 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh],
712 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_command], 0,
721 (void) bus_space_read_1(wdr->cmd_iot, wdr->cmd_iohs[wd_error], 0);
724 bus_space_write_1(wdr->ctl_iot, wdr->ctl_ioh, wd_aux_ctlr,
751 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh], 0,
755 sc = bus_space_read_1(wdr->cmd_iot,
756 wdr->cmd_iohs[wd_seccnt], 0);
757 sn = bus_space_read_1(wdr->cmd_iot,
758 wdr->cmd_iohs[wd_sector], 0);
759 cl = bus_space_read_1(wdr->cmd_iot,
760 wdr->cmd_iohs[wd_cyl_lo], 0);
761 ch = bus_space_read_1(wdr->cmd_iot,
762 wdr->cmd_iohs[wd_cyl_hi], 0);
784 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh], 0,
786 (void)bus_space_read_1(wdr->cmd_iot,
787 wdr->cmd_iohs[wd_status], 0);
887 struct wdc_regs *wdr = &wdc->regs[chp->ch_channel];
905 (void)bus_space_read_1(wdr->cmd_iot,
906 wdr->cmd_iohs[wd_status], 0);
1031 struct wdc_regs *wdr = &wdc->regs[chp->ch_channel];
1058 bus_space_write_1(wdr->ctl_iot, wdr->ctl_ioh, wd_aux_ctlr,
1068 struct wdc_regs *wdr = &wdc->regs[chp->ch_channel];
1076 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh], 0, WDSD_IBM);
1080 bus_space_write_1(wdr->ctl_iot, wdr->ctl_ioh, wd_aux_ctlr,
1084 (void) bus_space_read_1(wdr->cmd_iot, wdr->cmd_iohs[wd_error], 0);
1086 bus_space_write_1(wdr->ctl_iot, wdr->ctl_ioh, wd_aux_ctlr,
1101 struct wdc_regs *wdr = &wdc->regs[chp->ch_channel];
1118 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh],
1121 st0 = bus_space_read_1(wdr->cmd_iot,
1122 wdr->cmd_iohs[wd_status], 0);
1124 sc0 = bus_space_read_1(wdr->cmd_iot,
1125 wdr->cmd_iohs[wd_seccnt], 0);
1126 sn0 = bus_space_read_1(wdr->cmd_iot,
1127 wdr->cmd_iohs[wd_sector], 0);
1128 cl0 = bus_space_read_1(wdr->cmd_iot,
1129 wdr->cmd_iohs[wd_cyl_lo], 0);
1130 ch0 = bus_space_read_1(wdr->cmd_iot,
1131 wdr->cmd_iohs[wd_cyl_hi], 0);
1137 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh],
1140 st1 = bus_space_read_1(wdr->cmd_iot,
1141 wdr->cmd_iohs[wd_status], 0);
1143 sc1 = bus_space_read_1(wdr->cmd_iot,
1144 wdr->cmd_iohs[wd_seccnt], 0);
1145 sn1 = bus_space_read_1(wdr->cmd_iot,
1146 wdr->cmd_iohs[wd_sector], 0);
1147 cl1 = bus_space_read_1(wdr->cmd_iot,
1148 wdr->cmd_iohs[wd_cyl_lo], 0);
1149 ch1 = bus_space_read_1(wdr->cmd_iot,
1150 wdr->cmd_iohs[wd_cyl_hi], 0);
1208 struct wdc_regs *wdr = &wdc->regs[chp->ch_channel];
1222 bus_space_read_1(wdr->cmd_iot, wdr->cmd_iohs[wd_status], 0);
1229 bus_space_read_1(wdr->cmd_iot,
1230 wdr->cmd_iohs[wd_error], 0), mask, bits),
1242 error = bus_space_read_1(wdr->cmd_iot,
1243 wdr->cmd_iohs[wd_error], 0);
1430 struct wdc_regs *wdr = &wdc->regs[chp->ch_channel];
1442 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh], 0,
1457 bus_space_write_1(wdr->ctl_iot, wdr->ctl_ioh,
1501 struct wdc_regs *wdr = &wdc->regs[chp->ch_channel];
1550 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh], 0,
1628 struct wdc_regs *wdr = &wdc->regs[chp->ch_channel];
1644 ata_c->r_status = bus_space_read_1(wdr->cmd_iot,
1645 wdr->cmd_iohs[wd_status], 0);
1646 ata_c->r_error = bus_space_read_1(wdr->cmd_iot,
1647 wdr->cmd_iohs[wd_error], 0);
1648 ata_c->r_count = bus_space_read_1(wdr->cmd_iot,
1649 wdr->cmd_iohs[wd_seccnt], 0);
1650 ata_c->r_lba = (uint64_t)bus_space_read_1(wdr->cmd_iot,
1651 wdr->cmd_iohs[wd_sector], 0) << 0;
1652 ata_c->r_lba |= (uint64_t)bus_space_read_1(wdr->cmd_iot,
1653 wdr->cmd_iohs[wd_cyl_lo], 0) << 8;
1654 ata_c->r_lba |= (uint64_t)bus_space_read_1(wdr->cmd_iot,
1655 wdr->cmd_iohs[wd_cyl_hi], 0) << 16;
1656 ata_c->r_device = bus_space_read_1(wdr->cmd_iot,
1657 wdr->cmd_iohs[wd_sdh], 0);
1662 bus_space_write_1(wdr->ctl_iot,
1663 wdr->ctl_ioh, wd_aux_ctlr,
1666 bus_space_write_1(wdr->ctl_iot,
1667 wdr->ctl_ioh, wd_aux_ctlr,
1670 ata_c->r_count |= bus_space_read_1(wdr->cmd_iot,
1671 wdr->cmd_iohs[wd_seccnt], 0) << 8;
1672 ata_c->r_lba |= (uint64_t)bus_space_read_1(wdr->cmd_iot,
1673 wdr->cmd_iohs[wd_sector], 0) << 24;
1674 ata_c->r_lba |= (uint64_t)bus_space_read_1(wdr->cmd_iot,
1675 wdr->cmd_iohs[wd_cyl_lo], 0) << 32;
1676 ata_c->r_lba |= (uint64_t)bus_space_read_1(wdr->cmd_iot,
1677 wdr->cmd_iohs[wd_cyl_hi], 0) << 40;
1680 bus_space_write_1(wdr->ctl_iot,
1681 wdr->ctl_ioh, wd_aux_ctlr,
1684 bus_space_write_1(wdr->ctl_iot,
1685 wdr
1703 bus_space_write_1(wdr->ctl_iot, wdr->ctl_ioh,
1759 struct wdc_regs *wdr = &wdc->regs[chp->ch_channel];
1770 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh], 0,
1773 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_features], 0,
1775 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_seccnt], 0, count);
1776 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sector], 0, sector);
1777 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_cyl_lo], 0, cylin);
1778 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_cyl_hi],
1782 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_command], 0, command);
1795 struct wdc_regs *wdr = &wdc->regs[chp->ch_channel];
1809 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh], 0,
1813 bus_space_write_2(wdr->cmd_iot, wdr->cmd_iohs[wd_features],
1815 bus_space_write_2(wdr->cmd_iot, wdr->cmd_iohs[wd_seccnt],
1817 bus_space_write_2(wdr->cmd_iot, wdr->cmd_iohs[wd_lba_lo],
1819 bus_space_write_2(wdr->cmd_iot, wdr->cmd_iohs[wd_lba_mi],
1821 bus_space_write_2(wdr->cmd_iot, wdr->cmd_iohs[wd_lba_hi],
1825 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_features],
1827 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_seccnt],
1829 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_lba_lo],
1831 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_lba_mi],
1833 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_lba_hi],
1837 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_features],
1839 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_seccnt],
1841 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_lba_lo],
1843 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_lba_mi],
1845 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_lba_hi],
1850 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_command], 0, command);
1862 struct wdc_regs *wdr = &wdc->regs[chp->ch_channel];
1872 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh], 0,
1875 bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_command], 0, command);
1898 struct wdc_regs *wdr = CHAN_TO_WDC_REGS(chp);
1901 (void)bus_space_read_2(wdr->cmd_iot, wdr->cmd_iohs[wd_data], 0);
1903 (void)bus_space_read_1(wdr->cmd_iot, wdr->cmd_iohs[wd_data], 0);
1909 struct wdc_regs *wdr = CHAN_TO_WDC_REGS(chp);
1920 bus_space_read_multi_4(wdr->data32iot,
1921 wdr->data32ioh, 0, bf, len >> 2);
1926 bus_space_read_multi_2(wdr->cmd_iot,
1927 wdr->cmd_iohs[wd_data], 0, bf, len >> 1);
1933 bus_space_read_multi_stream_4(wdr->data32iot,
1934 wdr->data32ioh, 0, bf, len >> 2);
1939 bus_space_read_multi_stream_2(wdr->cmd_iot,
1940 wdr->cmd_iohs[wd_data], 0, bf, len >> 1);
1946 *((uint8_t *)bf) = bus_space_read_1(wdr->cmd_iot,
1947 wdr->cmd_iohs[wd_data], 0);
1957 val = bus_space_read_4(wdr->data32iot,
1958 wdr->data32ioh, 0);
1967 val = bus_space_read_2(wdr->cmd_iot,
1968 wdr->cmd_iohs[wd_data], 0);
1978 val = bus_space_read_stream_4(wdr->data32iot,
1979 wdr->data32ioh, 0);
1988 val = bus_space_read_stream_2(wdr->cmd_iot,
1989 wdr->cmd_iohs[wd_data], 0);
2001 struct wdc_regs *wdr = CHAN_TO_WDC_REGS(chp);
2012 bus_space_write_multi_4(wdr->data32iot,
2013 wdr->data32ioh, 0, bf, len >> 2);
2018 bus_space_write_multi_2(wdr->cmd_iot,
2019 wdr->cmd_iohs[wd_data], 0, bf, len >> 1);
2023 bus_space_write_multi_stream_4(wdr->data32iot,
2024 wdr->data32ioh, 0, bf, len >> 2);
2029 bus_space_write_multi_stream_2(wdr->cmd_iot,
2030 wdr->cmd_iohs[wd_data], 0, bf, len >> 1);
2043 bus_space_write_4(wdr->data32iot,
2044 wdr->data32ioh, 0, val);
2053 bus_space_write_2(wdr->cmd_iot,
2054 wdr->cmd_iohs[wd_data], 0, val);
2064 bus_space_write_stream_4(wdr->data32iot,
2065 wdr->data32ioh, 0, val);
2074 bus_space_write_stream_2(wdr->cmd_iot,
2075 wdr->cmd_iohs[wd_data], 0, val);