Lines Matching defs:chp

55 static int  wdcprobe(struct wdc_channel *chp);
56 static int wdc_wait_for_ready(struct wdc_channel *chp);
58 static int __wdcwait_reset(struct wdc_channel *chp, int drv_mask);
64 __wdcwait_reset(struct wdc_channel *chp, int drv_mask)
71 WDC_WRITE_REG(chp, wd_sdh, WDSD_IBM); /* master */
73 st0 = WDC_READ_REG(chp, wd_status);
74 WDC_WRITE_REG(chp, wd_sdh, WDSD_IBM | 0x10); /* slave */
76 st1 = WDC_READ_REG(chp, wd_status);
122 wdcprobe(struct wdc_channel *chp)
131 WDC_WRITE_REG(chp, wd_sdh, WDSD_IBM);
133 st0 = WDC_READ_REG(chp, wd_status);
134 WDC_WRITE_REG(chp, wd_sdh, WDSD_IBM | 0x10);
136 st1 = WDC_READ_REG(chp, wd_status);
146 WDC_WRITE_REG(chp, wd_sdh, WDSD_IBM);
148 WDC_WRITE_CTLREG(chp, wd_aux_ctlr, WDCTL_RST | WDCTL_IDS);
150 WDC_WRITE_CTLREG(chp, wd_aux_ctlr, WDCTL_IDS);
152 (void) WDC_READ_REG(chp, wd_error);
153 WDC_WRITE_CTLREG(chp, wd_aux_ctlr, WDCTL_4BIT);
156 ret_value = __wdcwait_reset(chp, ret_value);
182 struct wdc_channel *chp = &sc->sc_channel;
198 chp->c_cmdbase = (uint8_t *)cmdreg;
199 chp->c_data = (uint16_t *)(cmdreg + wd_data);
201 chp->c_cmdreg[i] = chp->c_cmdbase + i;
203 chp->c_cmdreg[wd_status] = chp->c_cmdreg[wd_command];
204 chp->c_cmdreg[wd_features] = chp->c_cmdreg[wd_precomp];
206 chp->c_ctlbase = (uint8_t *)ctlreg;
217 wdc_wait_for_ready(struct wdc_channel *chp)
222 if ((WDC_READ_REG(chp, wd_status) & (WDCS_BSY | WDCS_DRDY))
237 struct wdc_channel *chp = &sc->sc_channel;
245 *ptr++ = WDC_READ_DATA(chp);
248 *ptr++ = WDC_READ_DATA_STREAM(chp);
259 struct wdc_channel *chp = &sc->sc_channel;
268 WDC_WRITE_REG(chp, wd_features, wd_c->r_features);
269 WDC_WRITE_REG(chp, wd_seccnt, wd_c->r_count);
270 WDC_WRITE_REG(chp, wd_sector, wd_c->r_sector);
271 WDC_WRITE_REG(chp, wd_cyl_lo, wd_c->r_cyl);
272 WDC_WRITE_REG(chp, wd_cyl_hi, wd_c->r_cyl >> 8);
273 WDC_WRITE_REG(chp, wd_sdh,
275 WDC_WRITE_REG(chp, wd_command, wd_c->r_command);
277 if (wdc_wait_for_ready(chp) != 0)
280 if (WDC_READ_REG(chp, wd_status) & WDCS_ERR) {
281 printf("wd%d: error %x\n", chp->compatchan,
282 WDC_READ_REG(chp, wd_error));
295 struct wdc_channel *chp = &wd->sc_channel;
304 WDC_WRITE_REG(chp, wd_sdh, (wd_c->drive << 4) | WDSD_LBA);
307 WDC_WRITE_REG(chp, wd_features, 0);
308 WDC_WRITE_REG(chp, wd_seccnt, wd_c->r_count >> 8);
309 WDC_WRITE_REG(chp, wd_lba_hi, wd_c->r_blkno >> 40);
310 WDC_WRITE_REG(chp, wd_lba_mi, wd_c->r_blkno >> 32);
311 WDC_WRITE_REG(chp, wd_lba_lo, wd_c->r_blkno >> 24);
314 WDC_WRITE_REG(chp, wd_features, 0);
315 WDC_WRITE_REG(chp, wd_seccnt, wd_c->r_count);
316 WDC_WRITE_REG(chp, wd_lba_hi, wd_c->r_blkno >> 16);
317 WDC_WRITE_REG(chp, wd_lba_mi, wd_c->r_blkno >> 8);
318 WDC_WRITE_REG(chp, wd_lba_lo, wd_c->r_blkno);
321 WDC_WRITE_REG(chp, wd_command, wd_c->r_command);
323 if (wdc_wait_for_ready(chp) != 0)
326 if (WDC_READ_REG(chp, wd_status) & WDCS_ERR) {
327 printf("wd%d: error %x\n", chp->compatchan,
328 WDC_READ_REG(chp, wd_error));