Re: [edk2] [PATCH 6/6] MdeModulePkg: AhciMode calls GetChannelInfo when enumerating

Subject: Re: [edk2] [PATCH 6/6] MdeModulePkg: AhciMode calls GetChannelInfo when enumerating

From: "Tian, Feng" <feng.tian@intel.com>

To: "edk2-devel@lists.sourceforge.net" <edk2-devel@lists.sourceforge.net>

Date: 2014-08-15 12:53:17

Hi, Reza

Do you see any impact with original code? Why we don't use IdeInit.GetChannelInfo() is because we can get the info by AHCI PI register.

Thanks
Feng

-----Original Message-----
From: reza.jelveh@tuhh.de [mailto:reza.jelveh@tuhh.de] 
Sent: Friday, August 15, 2014 08:20
To: edk2-devel@lists.sourceforge.net
Cc: agraf@suse.de
Subject: [edk2] [PATCH 6/6] MdeModulePkg: AhciMode calls GetChannelInfo when enumerating

From: Reza Jelveh 

GetChannelInfo is called to initialize the SataController when enumerating ports.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Reza Jelveh 
---
 MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
index 487f516..92af9e4 100644
--- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
+++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
@@ -2211,6 +2211,7 @@ AhciModeInitialization (
   EFI_PCI_IO_PROTOCOL              *PciIo;
   EFI_IDE_CONTROLLER_INIT_PROTOCOL *IdeInit;
   UINT32                           Capability;
+  BOOLEAN                          ChannelEnabled;
   UINT8                            MaxPortNumber;
   UINT32                           PortImplementBitMap;
 
@@ -2282,6 +2283,21 @@ AhciModeInitialization (
 
       IdeInit->NotifyPhase (IdeInit, EfiIdeBeforeChannelEnumeration, Port);
 
+      Status = IdeInit->GetChannelInfo (
+          IdeInit,
+          Port,
+          &ChannelEnabled,
+          &MaxPortNumber
+          );
+      if (EFI_ERROR (Status)) {
+        DEBUG ((EFI_D_ERROR, "[GetChannel, Status=%x]", Status));
+        continue;
+      }
+
+      if (!ChannelEnabled) {
+        continue;
+      }
+
       //
       // Initialize FIS Base Address Register and Command List Base Address Register for use.
       //
--
1.9.2


------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel