summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util/inteltool/ahci.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/util/inteltool/ahci.c b/util/inteltool/ahci.c
index 2080e3bab5..054c74fdb5 100644
--- a/util/inteltool/ahci.c
+++ b/util/inteltool/ahci.c
@@ -93,7 +93,7 @@ int print_ahci(struct pci_dev *ahci)
size_t ahci_registers_size = 0, i;
size_t ahci_cfg_registers_size = 0;
const io_register_t *ahci_cfg_registers;
- size_t ahci_sir_offset = 0;
+ size_t ahci_sir_index_offset = 0, ahci_sir_data_offset;
size_t ahci_sir_registers_size = 0;
const io_register_t *ahci_sir_registers;
@@ -107,7 +107,7 @@ int print_ahci(struct pci_dev *ahci)
case PCI_DEVICE_ID_INTEL_SUNRISEPOINT_SATA:
case PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_SATA:
ahci_registers_size = 0x800;
- ahci_sir_offset = 0xa0;
+ ahci_sir_index_offset = 0xa0;
ahci_cfg_registers = sunrise_ahci_cfg_registers;
ahci_cfg_registers_size = ARRAY_SIZE(sunrise_ahci_cfg_registers);
ahci_sir_registers = sunrise_ahci_sir_registers;
@@ -117,6 +117,8 @@ int print_ahci(struct pci_dev *ahci)
ahci_registers_size = 0x400;
}
+ ahci_sir_data_offset = ahci_sir_index_offset + 4;
+
printf("\n============= AHCI Configuration Registers ==============\n\n");
for (i = 0; i < ahci_cfg_registers_size; i++) {
switch (ahci_cfg_registers[i].size) {
@@ -143,24 +145,24 @@ int print_ahci(struct pci_dev *ahci)
printf("\n============= SATA Initialization Registers ==============\n\n");
for (i = 0; i < ahci_sir_registers_size; i++) {
- pci_write_byte(ahci, ahci_sir_offset, ahci_sir_registers[i].addr);
+ pci_write_byte(ahci, ahci_sir_index_offset, ahci_sir_registers[i].addr);
switch (ahci_sir_registers[i].size) {
case 4:
printf("0x%02x: 0x%08x (%s)\n",
ahci_sir_registers[i].addr,
- pci_read_long(ahci, ahci_sir_offset),
+ pci_read_long(ahci, ahci_sir_data_offset),
ahci_sir_registers[i].name);
break;
case 2:
printf("0x%02x: 0x%04x (%s)\n",
ahci_sir_registers[i].addr,
- pci_read_word(ahci, ahci_sir_offset),
+ pci_read_word(ahci, ahci_sir_data_offset),
ahci_sir_registers[i].name);
break;
case 1:
printf("0x%02x: 0x%02x (%s)\n",
ahci_sir_registers[i].addr,
- pci_read_byte(ahci, ahci_sir_offset),
+ pci_read_byte(ahci, ahci_sir_data_offset),
ahci_sir_registers[i].name);
break;
}