aboutsummaryrefslogtreecommitdiff
path: root/src/ata.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2010-01-17 12:58:47 -0500
committerKevin O'Connor <kevin@koconnor.net>2010-01-17 12:58:47 -0500
commit4d07902b0c0caf12523718d90bd26b579b8e1648 (patch)
tree6c4cba13e7231ee0045adefbe2bda1f98192957c /src/ata.c
parent3012af189e0f89bd33df1c0711a46f098053e9a7 (diff)
downloadseabios-hppa-4d07902b0c0caf12523718d90bd26b579b8e1648.zip
seabios-hppa-4d07902b0c0caf12523718d90bd26b579b8e1648.tar.gz
seabios-hppa-4d07902b0c0caf12523718d90bd26b579b8e1648.tar.bz2
Add CONFIG_ATA_DMA option; default to off for now.
Allow compile option to disable ATA DMA support. Turn it off by default for now - some coreboot users are seeing issues with it.
Diffstat (limited to 'src/ata.c')
-rw-r--r--src/ata.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ata.c b/src/ata.c
index add1d67..a2a670b 100644
--- a/src/ata.c
+++ b/src/ata.c
@@ -381,6 +381,8 @@ struct sff_dma_prd {
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.
@@ -434,6 +436,8 @@ ata_try_dma(struct disk_op_s *op, int iswrite, int blocksize)
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);
@@ -513,6 +517,8 @@ fail:
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;
@@ -1005,7 +1011,7 @@ ata_init(void)
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) {