static int
ata_try_dma(struct disk_op_s *op, int iswrite, int blocksize)
{
+ if (! CONFIG_ATA_DMA)
+ return -1;
u32 dest = (u32)op->buf_fl;
if (dest & 1)
// Need minimum alignment of 1.
static int
ata_dma_transfer(struct disk_op_s *op)
{
+ if (! CONFIG_ATA_DMA)
+ return -1;
dprintf(16, "ata_dma_transfer id=%p buf=%p\n"
, op->drive_g, op->buf_fl);
static int
ata_dma_cmd_data(struct disk_op_s *op, struct ata_pio_command *cmd)
{
+ if (! CONFIG_ATA_DMA)
+ return -1;
int ret = send_cmd(op->drive_g, cmd);
if (ret)
return ret;
u8 pciirq = pci_config_readb(bdf, PCI_INTERRUPT_LINE);
u8 prog_if = pci_config_readb(bdf, PCI_CLASS_PROG);
int master = 0;
- if (prog_if & 0x80) {
+ if (CONFIG_ATA_DMA && prog_if & 0x80) {
// Check for bus-mastering.
u32 bar = pci_config_readl(bdf, PCI_BASE_ADDRESS_4);
if (bar & PCI_BASE_ADDRESS_SPACE_IO) {
#define CONFIG_PS2PORT 1
// Support for IDE disk code
#define CONFIG_ATA 1
+// Detect and try to use ATA bus mastering DMA controllers.
+#define CONFIG_ATA_DMA 0
// Use 32bit PIO accesses on ATA (minor optimization on PCI transfers)
#define CONFIG_ATA_PIO32 0
// Support for booting from a CD