diff options
author | Ian Moffett <ian@osmora.org> | 2025-02-20 10:33:34 -0500 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-02-20 10:33:34 -0500 |
commit | d20d25df529f6e8949fd12afe281dea65b22f17f (patch) | |
tree | 591382e89e1c930ba20efec4496c2c67ccb85c0e | |
parent | fb48b27ede2c403f18495aa2d3784565f7b84f13 (diff) | |
parent | 6018ed09c35b35343cf64133529850ddc8071138 (diff) |
Merge branch 'expt'
-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 d713a0e..f41233c 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; } |