[SeaBIOS] [PATCH] Add AHCI Power ON + ICC_ACTIVE into port setup code

Andrej Kruták posted 1 patch 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/seabios tags/patchew/1531455205.6484.1704814463638@ox.sysgo.com
src/hw/ahci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[SeaBIOS] [PATCH] Add AHCI Power ON + ICC_ACTIVE into port setup code
Posted by Andrej Kruták 9 months ago
Windows appears to put the AHCI port into 'Partial power management state'
during reboot, the command puts it back into 'active state'.

AHCI/1: link down 0x00000231 (SCR STAT register)
 ->
AHCI/1: link up 0x00000133

Signed-off-by: Andrej Krutak andrej.krutak@sysgo.com
---
 src/hw/ahci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/hw/ahci.c b/src/hw/ahci.c
index 3fa845aa..4f0f640a 100644
--- a/src/hw/ahci.c
+++ b/src/hw/ahci.c
@@ -444,7 +444,8 @@ static int ahci_port_setup(struct ahci_port_s *port)
     ahci_port_writel(ctrl, pnr, PORT_CMD, cmd);
 
     /* spin up */
-    cmd |= PORT_CMD_SPIN_UP;
+    cmd &= ~PORT_CMD_ICC_MASK;
+    cmd |= PORT_CMD_SPIN_UP | PORT_CMD_POWER_ON | PORT_CMD_ICC_ACTIVE;
     ahci_port_writel(ctrl, pnr, PORT_CMD, cmd);
     u32 end = timer_calc(AHCI_LINK_TIMEOUT);
     for (;;) {
-- 
2.34.1
_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org
[SeaBIOS] Re: [PATCH] Add AHCI Power ON + ICC_ACTIVE into port setup code
Posted by Gerd Hoffmann 8 months, 2 weeks ago
On Tue, Jan 09, 2024 at 04:34:23PM +0100, Andrej Kruták wrote:
> Windows appears to put the AHCI port into 'Partial power management state'
> during reboot, the command puts it back into 'active state'.
> 
> AHCI/1: link down 0x00000231 (SCR STAT register)
>  ->
> AHCI/1: link up 0x00000133
> 
> Signed-off-by: Andrej Krutak andrej.krutak@sysgo.com
> ---
>  src/hw/ahci.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/hw/ahci.c b/src/hw/ahci.c
> index 3fa845aa..4f0f640a 100644
> --- a/src/hw/ahci.c
> +++ b/src/hw/ahci.c
> @@ -444,7 +444,8 @@ static int ahci_port_setup(struct ahci_port_s *port)
>      ahci_port_writel(ctrl, pnr, PORT_CMD, cmd);
>  
>      /* spin up */
> -    cmd |= PORT_CMD_SPIN_UP;
> +    cmd &= ~PORT_CMD_ICC_MASK;
> +    cmd |= PORT_CMD_SPIN_UP | PORT_CMD_POWER_ON | PORT_CMD_ICC_ACTIVE;
>      ahci_port_writel(ctrl, pnr, PORT_CMD, cmd);
>      u32 end = timer_calc(AHCI_LINK_TIMEOUT);
>      for (;;) {

Patch applied to master branch.

thanks,
  Gerd

_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org