On 22/08/14 06:13, Tian, Feng wrote: > Hi, Reza > > If no this patch, is there any real impact? I ever mentioned, AhciMode.c will > use PortImplement register to know which port should be enumerated. > This is not really necessary. I.e. IdeInit controller can stub this out. It just gives the controller an opportunity to do optimizations after the Ahci mode has been initialized properly. I'm all up for suggestions on this.
For example SataController allocates a structure to store for example Identify data inside. This can't be done on start, unless you're willing to allocate the size of max channels( which for ahci might not be a good idea). > Thanks > Feng > > -----Original Message----- > From: reza.jel...@tuhh.de [mailto:reza.jel...@tuhh.de] > Sent: Thursday, August 21, 2014 17:56 > To: edk2-devel@lists.sourceforge.net > Cc: ag...@suse.de > Subject: [edk2] [PATCH v2 5/6] MdeModulePkg: AhciMode calls GetChannelInfo > when enumerating > > From: Reza Jelveh <reza.jel...@tuhh.de> > > GetChannelInfo is called to initialize the SataController when enumerating > ports. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Reza Jelveh <reza.jel...@tuhh.de> > --- > 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 > > > ------------------------------------------------------------------------------ > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/ > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/edk2-devel > > ------------------------------------------------------------------------------ > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/ > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/edk2-devel -- Reza Jelveh | @rjzzleep | reza.jelveh.me ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel