diff options
author | Ian Moffett <ian@osmora.org> | 2025-02-20 10:33:00 -0500 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-02-20 10:33:00 -0500 |
commit | 6018ed09c35b35343cf64133529850ddc8071138 (patch) | |
tree | 5444309f08d049df47bf4781db305f67f029ee6f /sys/dev/ic | |
parent | 6ba33d4705896501fb0b042c8986742fb4ed7ae7 (diff) |
kernel: ahci: Ensure HBA is AHCI aware
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/ahci.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/dev/ic/ahci.c b/sys/dev/ic/ahci.c index 027ad66..ec7e68a 100644 --- a/sys/dev/ic/ahci.c +++ b/sys/dev/ic/ahci.c @@ -117,7 +117,9 @@ ahci_hba_reset(struct ahci_hba *hba) static int ahci_hba_init(struct ahci_hba *hba) { + struct hba_memspace *abar = hba->io; int error; + uint32_t tmp; /* * God knows what state the HBA is in by the time @@ -130,6 +132,16 @@ ahci_hba_init(struct ahci_hba *hba) } pr_trace("Successfully performed a hard reset.\n"); + + /* + * The HBA provides backwards compatibility with + * legacy ATA mechanisms (e.g., SFF-8038i), therefore + * in order for this driver to work we need to ensure + * the HBA is AHCI aware. + */ + tmp = mmio_read32(&abar->ghc); + tmp |= AHCI_GHC_AE; + mmio_write32(&abar->ghc, tmp); return 0; } |