pci_bus_write_config_byte (ibmphp_pci_bus, devfn, PCI_CACHE_LINE_SIZE, CACHE);
pci_bus_write_config_byte (ibmphp_pci_bus, devfn, PCI_LATENCY_TIMER, LATENCY);
- pci_bus_write_config_word (ibmphp_pci_bus, devfn, PCI_ROM_ADDRESS, 0x00L);
+ pci_bus_write_config_dword (ibmphp_pci_bus, devfn, PCI_ROM_ADDRESS, 0x00L);
pci_bus_write_config_word (ibmphp_pci_bus, devfn, PCI_COMMAND, DEVICEENABLE);
return 0;
debug ("io 32\n");
need_io_upper = TRUE;
}
- if ((io_base & PCI_PREF_RANGE_TYPE_MASK) == PCI_PREF_RANGE_TYPE_64) {
+ if ((pfmem_base & PCI_PREF_RANGE_TYPE_MASK) == PCI_PREF_RANGE_TYPE_64) {
debug ("pfmem 64\n");
need_pfmem_upper = TRUE;
}
/* This is Memory */
if (start_address & PCI_BASE_ADDRESS_MEM_PREFETCH) {
/* pfmem */
- start_address &= PCI_BASE_ADDRESS_MEM_MASK;
debug ("start address of pfmem is %x\n", start_address);
+ start_address &= PCI_BASE_ADDRESS_MEM_MASK;
if (ibmphp_find_resource (bus, start_address, &pfmem, PFMEM) < 0) {
err ("cannot find corresponding PFMEM resource to remove\n");
return -EIO;
}
- if (pfmem)
+ if (pfmem) {
debug ("pfmem->start = %x\n", pfmem->start);
- ibmphp_remove_resource (pfmem);
-
- if (tmp_address & PCI_BASE_ADDRESS_MEM_TYPE_64) {
- /* takes up another dword */
- count += 1;
+ ibmphp_remove_resource(pfmem);
}
-
} else {
/* regular memory */
- start_address &= PCI_BASE_ADDRESS_MEM_MASK;
debug ("start address of mem is %x\n", start_address);
+ start_address &= PCI_BASE_ADDRESS_MEM_MASK;
+
if (ibmphp_find_resource (bus, start_address, &mem, MEM) < 0) {
err ("cannot find corresponding MEM resource to remove\n");
return -EIO;
}
- if (mem)
+ if (mem) {
debug ("mem->start = %x\n", mem->start);
- ibmphp_remove_resource (mem);
-
- if (tmp_address & PCI_BASE_ADDRESS_MEM_TYPE_64) {
- /* takes up another dword */
- count += 1;
+ ibmphp_remove_resource(mem);
}
}
+ if (tmp_address & PCI_BASE_ADDRESS_MEM_TYPE_64) {
+ /* takes up another dword */
+ count += 1;
+ }
} /* end of mem */
} /* end of for */
return -EINVAL;
}
- pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_SECONDARY_BUS, &sec_number);
- sec_no = (int) sec_no;
-
pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_SUBORDINATE_BUS, &sub_number);
sub_no = (int) sub_number;
debug ("sub_no is %d, sec_no is %d\n", sub_no, sec_no);
err ("cannot find corresponding PFMEM resource to remove\n");
return -EINVAL;
}
- if (pfmem)
+ if (pfmem) {
debug ("pfmem->start = %x\n", pfmem->start);
- ibmphp_remove_resource (pfmem);
-
- if (tmp_address & PCI_BASE_ADDRESS_MEM_TYPE_64) {
- /* takes up another dword */
- count += 1;
+ ibmphp_remove_resource(pfmem);
}
-
} else {
/* regular memory */
start_address &= PCI_BASE_ADDRESS_MEM_MASK;
err ("cannot find corresponding MEM resource to remove\n");
return -EINVAL;
}
- if (mem)
+ if (mem) {
debug ("mem->start = %x\n", mem->start);
- ibmphp_remove_resource (mem);
-
- if (tmp_address & PCI_BASE_ADDRESS_MEM_TYPE_64) {
- /* takes up another dword */
- count += 1;
+ ibmphp_remove_resource(mem);
}
}
+ if (tmp_address & PCI_BASE_ADDRESS_MEM_TYPE_64) {
+ /* takes up another dword */
+ count += 1;
+ }
} /* end of mem */
} /* end of for */
debug ("%s - exiting, returning success\n", __FUNCTION__);