/* Returns 0 on success. If a PIO fallback is required then 1 is returned.  */
static int scc_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
/* Returns 0 on success. If a PIO fallback is required then 1 is returned.  */
static int scc_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
{
	ide_hwif_t *hwif = drive->hwif;
	u32 rw = (cmd->tf_flags & IDE_TFLAG_WRITE) ? 0 : ATA_DMA_WR;
	u8 dma_stat;
	if (ide_build_dmatable(drive, cmd) == 0)
		return 1;
	out_be32((void __iomem *)(hwif->dma_base + 8), hwif->dmatable_dma);
	out_be32((void __iomem *)hwif->dma_base, rw);
	dma_stat = scc_dma_sff_read_status(hwif);
	out_be32((void __iomem *)(hwif->dma_base + 4), dma_stat | 6);
	return 0;
}