Lines Matching refs:cfis
293 static int fsl_ata_exec_ata_cmd(struct fsl_sata *sata, struct sata_fis_h2d *cfis, in fsl_ata_exec_ata_cmd() argument
317 h2d = (sata_fis_h2d_t *)cmd_desc->cfis; in fsl_ata_exec_ata_cmd()
323 h2d->fis_type = cfis->fis_type; in fsl_ata_exec_ata_cmd()
324 h2d->pm_port_c = cfis->pm_port_c; in fsl_ata_exec_ata_cmd()
325 h2d->command = cfis->command; in fsl_ata_exec_ata_cmd()
327 h2d->features = cfis->features; in fsl_ata_exec_ata_cmd()
328 h2d->features_exp = cfis->features_exp; in fsl_ata_exec_ata_cmd()
330 h2d->lba_low = cfis->lba_low; in fsl_ata_exec_ata_cmd()
331 h2d->lba_mid = cfis->lba_mid; in fsl_ata_exec_ata_cmd()
332 h2d->lba_high = cfis->lba_high; in fsl_ata_exec_ata_cmd()
333 h2d->lba_low_exp = cfis->lba_low_exp; in fsl_ata_exec_ata_cmd()
334 h2d->lba_mid_exp = cfis->lba_mid_exp; in fsl_ata_exec_ata_cmd()
335 h2d->lba_high_exp = cfis->lba_high_exp; in fsl_ata_exec_ata_cmd()
338 h2d->sector_count = cfis->sector_count; in fsl_ata_exec_ata_cmd()
339 h2d->sector_count_exp = cfis->sector_count_exp; in fsl_ata_exec_ata_cmd()
344 h2d->device = cfis->device; in fsl_ata_exec_ata_cmd()
345 h2d->control = cfis->control; in fsl_ata_exec_ata_cmd()
444 static int fsl_ata_exec_reset_cmd(struct fsl_sata *sata, struct sata_fis_h2d *cfis, in fsl_ata_exec_reset_cmd() argument
450 static int fsl_sata_exec_cmd(struct fsl_sata *sata, struct sata_fis_h2d *cfis, in fsl_sata_exec_cmd() argument
462 rc = fsl_ata_exec_ata_cmd(sata, cfis, 0, tag, buffer, len); in fsl_sata_exec_cmd()
465 rc = fsl_ata_exec_reset_cmd(sata, cfis, tag, buffer, len); in fsl_sata_exec_cmd()
468 rc = fsl_ata_exec_ata_cmd(sata, cfis, 1, tag, buffer, len); in fsl_sata_exec_cmd()
485 struct sata_fis_h2d h2d, *cfis = &h2d; in fsl_sata_identify() local
487 memset(cfis, 0, sizeof(struct sata_fis_h2d)); in fsl_sata_identify()
489 cfis->fis_type = SATA_FIS_TYPE_REGISTER_H2D; in fsl_sata_identify()
490 cfis->pm_port_c = 0x80; /* is command */ in fsl_sata_identify()
491 cfis->command = ATA_CMD_ID_ATA; in fsl_sata_identify()
493 fsl_sata_exec_cmd(sata, cfis, CMD_ATA, 0, (u8 *)id, ATA_ID_WORDS * 2); in fsl_sata_identify()
510 struct sata_fis_h2d h2d, *cfis = &h2d; in fsl_sata_set_features() local
513 memset(cfis, 0, sizeof(struct sata_fis_h2d)); in fsl_sata_set_features()
515 cfis->fis_type = SATA_FIS_TYPE_REGISTER_H2D; in fsl_sata_set_features()
516 cfis->pm_port_c = 0x80; /* is command */ in fsl_sata_set_features()
517 cfis->command = ATA_CMD_SET_FEATURES; in fsl_sata_set_features()
518 cfis->features = SETFEATURES_XFER; in fsl_sata_set_features()
525 cfis->sector_count = XFER_UDMA_6; in fsl_sata_set_features()
527 cfis->sector_count = XFER_UDMA_5; in fsl_sata_set_features()
529 cfis->sector_count = XFER_UDMA_4; in fsl_sata_set_features()
531 cfis->sector_count = XFER_UDMA_3; in fsl_sata_set_features()
533 fsl_sata_exec_cmd(sata, cfis, CMD_ATA, 0, NULL, 0); in fsl_sata_set_features()
539 struct sata_fis_h2d h2d, *cfis = &h2d; in fsl_sata_rw_cmd() local
544 memset(cfis, 0, sizeof(struct sata_fis_h2d)); in fsl_sata_rw_cmd()
546 cfis->fis_type = SATA_FIS_TYPE_REGISTER_H2D; in fsl_sata_rw_cmd()
547 cfis->pm_port_c = 0x80; /* is command */ in fsl_sata_rw_cmd()
548 cfis->command = (is_write) ? ATA_CMD_WRITE : ATA_CMD_READ; in fsl_sata_rw_cmd()
549 cfis->device = ATA_LBA; in fsl_sata_rw_cmd()
551 cfis->device |= (block >> 24) & 0xf; in fsl_sata_rw_cmd()
552 cfis->lba_high = (block >> 16) & 0xff; in fsl_sata_rw_cmd()
553 cfis->lba_mid = (block >> 8) & 0xff; in fsl_sata_rw_cmd()
554 cfis->lba_low = block & 0xff; in fsl_sata_rw_cmd()
555 cfis->sector_count = (u8)(blkcnt & 0xff); in fsl_sata_rw_cmd()
557 fsl_sata_exec_cmd(sata, cfis, CMD_ATA, 0, buffer, ATA_SECT_SIZE * blkcnt); in fsl_sata_rw_cmd()
564 struct sata_fis_h2d h2d, *cfis = &h2d; in fsl_sata_flush_cache() local
566 memset(cfis, 0, sizeof(struct sata_fis_h2d)); in fsl_sata_flush_cache()
568 cfis->fis_type = SATA_FIS_TYPE_REGISTER_H2D; in fsl_sata_flush_cache()
569 cfis->pm_port_c = 0x80; /* is command */ in fsl_sata_flush_cache()
570 cfis->command = ATA_CMD_FLUSH; in fsl_sata_flush_cache()
572 fsl_sata_exec_cmd(sata, cfis, CMD_ATA, 0, NULL, 0); in fsl_sata_flush_cache()
578 struct sata_fis_h2d h2d, *cfis = &h2d; in fsl_sata_rw_cmd_ext() local
583 memset(cfis, 0, sizeof(struct sata_fis_h2d)); in fsl_sata_rw_cmd_ext()
585 cfis->fis_type = SATA_FIS_TYPE_REGISTER_H2D; in fsl_sata_rw_cmd_ext()
586 cfis->pm_port_c = 0x80; /* is command */ in fsl_sata_rw_cmd_ext()
588 cfis->command = (is_write) ? ATA_CMD_WRITE_EXT in fsl_sata_rw_cmd_ext()
591 cfis->lba_high_exp = (block >> 40) & 0xff; in fsl_sata_rw_cmd_ext()
592 cfis->lba_mid_exp = (block >> 32) & 0xff; in fsl_sata_rw_cmd_ext()
593 cfis->lba_low_exp = (block >> 24) & 0xff; in fsl_sata_rw_cmd_ext()
594 cfis->lba_high = (block >> 16) & 0xff; in fsl_sata_rw_cmd_ext()
595 cfis->lba_mid = (block >> 8) & 0xff; in fsl_sata_rw_cmd_ext()
596 cfis->lba_low = block & 0xff; in fsl_sata_rw_cmd_ext()
597 cfis->device = ATA_LBA; in fsl_sata_rw_cmd_ext()
598 cfis->sector_count_exp = (blkcnt >> 8) & 0xff; in fsl_sata_rw_cmd_ext()
599 cfis->sector_count = blkcnt & 0xff; in fsl_sata_rw_cmd_ext()
601 fsl_sata_exec_cmd(sata, cfis, CMD_ATA, 0, buffer, ATA_SECT_SIZE * blkcnt); in fsl_sata_rw_cmd_ext()
609 struct sata_fis_h2d h2d, *cfis = &h2d; in fsl_sata_rw_ncq_cmd() local
620 memset(cfis, 0, sizeof(struct sata_fis_h2d)); in fsl_sata_rw_ncq_cmd()
622 cfis->fis_type = SATA_FIS_TYPE_REGISTER_H2D; in fsl_sata_rw_ncq_cmd()
623 cfis->pm_port_c = 0x80; /* is command */ in fsl_sata_rw_ncq_cmd()
625 cfis->command = (is_write) ? ATA_CMD_FPDMA_WRITE in fsl_sata_rw_ncq_cmd()
628 cfis->lba_high_exp = (block >> 40) & 0xff; in fsl_sata_rw_ncq_cmd()
629 cfis->lba_mid_exp = (block >> 32) & 0xff; in fsl_sata_rw_ncq_cmd()
630 cfis->lba_low_exp = (block >> 24) & 0xff; in fsl_sata_rw_ncq_cmd()
631 cfis->lba_high = (block >> 16) & 0xff; in fsl_sata_rw_ncq_cmd()
632 cfis->lba_mid = (block >> 8) & 0xff; in fsl_sata_rw_ncq_cmd()
633 cfis->lba_low = block & 0xff; in fsl_sata_rw_ncq_cmd()
635 cfis->device = ATA_LBA; in fsl_sata_rw_ncq_cmd()
636 cfis->features_exp = (blkcnt >> 8) & 0xff; in fsl_sata_rw_ncq_cmd()
637 cfis->features = blkcnt & 0xff; in fsl_sata_rw_ncq_cmd()
645 fsl_sata_exec_cmd(sata, cfis, CMD_NCQ, ncq_channel, buffer, ATA_SECT_SIZE * blkcnt); in fsl_sata_rw_ncq_cmd()
652 struct sata_fis_h2d h2d, *cfis = &h2d; in fsl_sata_flush_cache_ext() local
654 memset(cfis, 0, sizeof(struct sata_fis_h2d)); in fsl_sata_flush_cache_ext()
656 cfis->fis_type = SATA_FIS_TYPE_REGISTER_H2D; in fsl_sata_flush_cache_ext()
657 cfis->pm_port_c = 0x80; /* is command */ in fsl_sata_flush_cache_ext()
658 cfis->command = ATA_CMD_FLUSH_EXT; in fsl_sata_flush_cache_ext()
660 fsl_sata_exec_cmd(sata, cfis, CMD_ATA, 0, NULL, 0); in fsl_sata_flush_cache_ext()