mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 23:17:45 +00:00
Kernel: Don't reset AHCI ports during boot unless requested
Instead of blindly resetting every AHCI port, let's just reset only the controller by default. The user can still request to reset everything with a new kernel boot argument called ahci_reset_mode which is set by default to "controller", so the code will only invoke an HBA reset. This kernel boot argument can be set to 3 different values: 1. "controller" - reset the HBA and skip resetting AHCI ports 2. "none" - don't reset anything, so we rely on the firmware to initialize the AHCI HBA and ports for us. 3. "complete" - reset the AHCI HBA and ports.
This commit is contained in:
parent
a93dc8c8c9
commit
793d315994
6 changed files with 58 additions and 5 deletions
|
@ -78,9 +78,13 @@ public:
|
|||
RefPtr<StorageDevice> connected_device() const { return m_connected_device; }
|
||||
|
||||
bool reset();
|
||||
UNMAP_AFTER_INIT bool initialize_without_reset();
|
||||
void handle_interrupt();
|
||||
|
||||
private:
|
||||
bool is_phy_enabled() const { return (m_port_registers.ssts & 0xf) == 3; }
|
||||
bool initialize();
|
||||
|
||||
UNMAP_AFTER_INIT AHCIPort(const AHCIPortHandler&, volatile AHCI::PortRegisters&, u32 port_index);
|
||||
|
||||
ALWAYS_INLINE void clear_sata_error_register() const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue