diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2010-05-23 10:20:04 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2010-05-23 10:20:04 -0400 |
commit | 456479ed44702a234c55a66b63f923019d057a08 (patch) | |
tree | 6ebd6b9d6bdbf6ce6595caeb5f049750c7214ca4 | |
parent | 2515a72267612bd644cadd9ef481230065dd2d2a (diff) | |
download | seabios-456479ed44702a234c55a66b63f923019d057a08.tar.gz |
Minor ata cleanups.
Eliminate process_atapi_op() code if CONFIG_ATA not set.
Use PCI_BASE_ADDRESS_IO_MASK instead of hardcoding it.
-rw-r--r-- | src/ata.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -662,6 +662,8 @@ fail: int process_atapi_op(struct disk_op_s *op) { + if (!CONFIG_ATA) + return 0; switch (op->command) { case CMD_READ: return cdb_read(op); @@ -984,8 +986,10 @@ ata_init(void) u32 port1, port2, irq; if (prog_if & 1) { - port1 = pci_config_readl(bdf, PCI_BASE_ADDRESS_0) & ~3; - port2 = pci_config_readl(bdf, PCI_BASE_ADDRESS_1) & ~3; + port1 = (pci_config_readl(bdf, PCI_BASE_ADDRESS_0) + & PCI_BASE_ADDRESS_IO_MASK); + port2 = (pci_config_readl(bdf, PCI_BASE_ADDRESS_1) + & PCI_BASE_ADDRESS_IO_MASK); irq = pciirq; } else { port1 = PORT_ATA1_CMD_BASE; @@ -996,8 +1000,10 @@ ata_init(void) count++; if (prog_if & 4) { - port1 = pci_config_readl(bdf, PCI_BASE_ADDRESS_2) & ~3; - port2 = pci_config_readl(bdf, PCI_BASE_ADDRESS_3) & ~3; + port1 = (pci_config_readl(bdf, PCI_BASE_ADDRESS_2) + & PCI_BASE_ADDRESS_IO_MASK); + port2 = (pci_config_readl(bdf, PCI_BASE_ADDRESS_3) + & PCI_BASE_ADDRESS_IO_MASK); irq = pciirq; } else { port1 = PORT_ATA2_CMD_BASE; |