aboutsummaryrefslogtreecommitdiff
path: root/src/ata.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2010-05-23 10:20:04 -0400
committerKevin O'Connor <kevin@koconnor.net>2010-05-23 10:20:04 -0400
commit456479ed44702a234c55a66b63f923019d057a08 (patch)
tree6ebd6b9d6bdbf6ce6595caeb5f049750c7214ca4 /src/ata.c
parent2515a72267612bd644cadd9ef481230065dd2d2a (diff)
downloadseabios-hppa-456479ed44702a234c55a66b63f923019d057a08.zip
seabios-hppa-456479ed44702a234c55a66b63f923019d057a08.tar.gz
seabios-hppa-456479ed44702a234c55a66b63f923019d057a08.tar.bz2
Minor ata cleanups.
Eliminate process_atapi_op() code if CONFIG_ATA not set. Use PCI_BASE_ADDRESS_IO_MASK instead of hardcoding it.
Diffstat (limited to 'src/ata.c')
-rw-r--r--src/ata.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/ata.c b/src/ata.c
index 42bb691..346c340 100644
--- a/src/ata.c
+++ b/src/ata.c
@@ -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;