From 63f9ffef37555f2178c9d1fd95dcfd0862ab01bd Mon Sep 17 00:00:00 2001 From: Marcus Overhagen Date: Wed, 26 Sep 2007 18:09:42 +0000 Subject: [PATCH] make sure PCI command register is setup correctly git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22321 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/busses/scsi/ahci/ahci_controller.cpp | 6 ++++++ src/add-ons/kernel/busses/scsi/ahci/ahci_defs.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/add-ons/kernel/busses/scsi/ahci/ahci_controller.cpp b/src/add-ons/kernel/busses/scsi/ahci/ahci_controller.cpp index daca9f0ff9..ee1ccbf9ba 100644 --- a/src/add-ons/kernel/busses/scsi/ahci/ahci_controller.cpp +++ b/src/add-ons/kernel/busses/scsi/ahci/ahci_controller.cpp @@ -80,6 +80,12 @@ AHCIController::Init() TRACE("satacr0 = 0x%08lx, satacr1 = 0x%08lx\n", satacr0, satacr1); } + uint16 pcicmd = gPCI->read_pci_config(fPCIDevice, PCI_command, 2); + TRACE("pcicmd old 0x%04x\n", pcicmd); + pcicmd = PCI_PCICMD_BME | PCI_PCICMD_MSE | (pcicmd & ~PCI_PCICMD_IOS); + TRACE("pcicmd new 0x%04x\n", pcicmd); + gPCI->write_pci_config(fPCIDevice, PCI_command, 2, pcicmd); + void *addr = (void *)pciInfo.u.h0.base_registers[5]; size_t size = pciInfo.u.h0.base_register_sizes[5]; diff --git a/src/add-ons/kernel/busses/scsi/ahci/ahci_defs.h b/src/add-ons/kernel/busses/scsi/ahci/ahci_defs.h index 45b51f952e..fe8768e233 100644 --- a/src/add-ons/kernel/busses/scsi/ahci/ahci_defs.h +++ b/src/add-ons/kernel/busses/scsi/ahci/ahci_defs.h @@ -219,6 +219,10 @@ extern scsi_for_sim_interface *gSCSI; #define HI32(val) (((uint64)(val)) >> 32) #define ASSERT(expr) if (expr) {} else panic(#expr) +#define PCI_PCICMD_IOS 0x01 +#define PCI_PCICMD_MSE 0x02 +#define PCI_PCICMD_BME 0x04 + #ifdef __cplusplus template