Re: [edk2] Identify IDE devices and device information in UEFI

Subject: Re: [edk2] Identify IDE devices and device information in UEFI

From: Murali Selvaraj <Murali.Selvaraj@lntinfotech.com>

To: "Tian, Feng" <feng.tian@intel.com>, <edk2-devel@lists.sourceforge.net>

Date: 2013-09-23 00:48:06

EFI_DISK_INFO_PROTOCOL provides a data field called "Interface" (a GUID) that identifies the data format for the Inquiry(), Identify(), and
SenseData() functions that it also provides.

For IDE mode ,I couldn't find EFI_DISK_INFO_PROTOCOL implementation on my edk2 source code.If it is available for IDE please let me know the source path.

As I mentioned , I would like at least to print  device type,size of the device .

Do I need to include AtaAtapiPassThru protocol or not?

Is it possible to include EFI_DISK_INFO_PROTOCOL to my driver?

So far,my driver is able to detected controller mode as IDE mode.Please guide me how to proceed from this stage.

Thanks
Murali.S



________________________________________
From: Tian, Feng [feng.tian@intel.com]
Sent: Sunday, September 22, 2013 1:45 PM
To: Murali Selvaraj; edk2-devel@lists.sourceforge.net
Cc: Tian, Feng
Subject: RE: Identify IDE devices and device information  in UEFI

EDKII ATA stack was designed to support IDE & AHCI mode.

For your special requirement to get Model Name, Serial No and others, you just need locate EFI_DISK_INFO_PROTOCOL and call its Identify() API. For detail description of EFI_DISK_INFO_PROTOCOL, please refer to PI spec.

-----Original Message-----
From: Murali Selvaraj [mailto:Murali.Selvaraj@lntinfotech.com]
Sent: Sunday, September 22, 2013 15:17
To: edk2-devel@lists.sourceforge.net; Tian, Feng
Subject: RE: Identify IDE devices and device information in UEFI

Hi Feng,

Thanks for your detailed explanation.From my driver code I have confirmed that my controller detected  as a IDE mode using IDE controller PCI configuration space class code ( 0x0101xx ) If I installed the MdeModulePkg/Bus/Ata/AtaAtapiPassThr driver will work for my requirement ( I need to display device type and device model name,serial no and other details ) Or Do I need to customize that code as per my IDE controller?

Please clarify my doubts.

Thanks
Murali.S

________________________________________
From: Tian, Feng [feng.tian@intel.com]
Sent: Sunday, September 22, 2013 12:35 PM
To: Murali Selvaraj; edk2-devel@lists.sourceforge.net
Cc: Tian, Feng
Subject: RE: Identify IDE devices and device information  in UEFI

No. IdeBusDxe in IntelFrameworkModulePkg is not recommended for use. It is obsolete.

AtaBus & AtaAtapiPassThru in MdeModulePkg is the replacement of IdeBusDxe.

-----Original Message-----
From: Murali Selvaraj [mailto:Murali.Selvaraj@lntinfotech.com]
Sent: Sunday, September 22, 2013 14:51
To: edk2-devel@lists.sourceforge.net; Tian, Feng
Subject: RE: Identify IDE devices and device information in UEFI

Hi Feng,

Thanks for your information.

I have found one more similar kind of implementation to identify ATA/ATAPI devices in UEFI.

IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe

Ata.c
Atapi.c
ComponentName.c
ComponentName.h
DriverConfiguration.c
DriverDiagnostics.c
Ide.c
Ide.h
IdeBus.c
IdeBus.h
IdeBusDxe.inf
IdeData.h


Shall I use this driver for requirement?.Please let me know.

Regards,
Murali.S


________________________________________
From: edk2-devel-request@lists.sourceforge.net [edk2-devel-request@lists.sourceforge.net]
Sent: Sunday, September 22, 2013 10:40 AM
To: edk2-devel@lists.sourceforge.net
Subject: edk2-devel Digest, Vol 45, Issue 113

Send edk2-devel mailing list submissions to
        edk2-devel@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/edk2-devel
or, via email, send a message with subject or body 'help' to
        edk2-devel-request@lists.sourceforge.net

You can reach the person managing the list at
        edk2-devel-owner@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific than "Re: Contents of edk2-devel digest..."


Today's Topics:

   1. Re: Identify IDE devices and device information  in UEFI
      (Tian, Feng)
   2. Re: [PATCH] EdkShellPkg: Add Aarch64 support (Ni, Ruiyu)
   3. Re: BaseTools compilation error (Gao, Liming)


----------------------------------------------------------------------

Message: 1
Date: Sun, 22 Sep 2013 02:00:26 +0000
From: "Tian, Feng" 
Subject: Re: [edk2] Identify IDE devices and device information  in
        UEFI
To: "edk2-devel@lists.sourceforge.net"
        
Message-ID:
        <7F1BAD85ADEA444D97065A60D2E97EE501A0A687@SHSMSX101.ccr.corp.intel.com>

Content-Type: text/plain; charset="us-ascii"

Selvaraj,

I don't think you need write such driver again as it has been existing for a long time.

Please refer MdeModulePkg/Bus/Ata/AtaAtapiPassThru driver.

Thanks
Feng

-----Original Message-----
From: Murali Selvaraj [mailto:Murali.Selvaraj@lntinfotech.com]
Sent: Saturday, September 21, 2013 11:46
To: edk2-devel@lists.sourceforge.net
Subject: [edk2] Identify IDE devices and device information in UEFI

Hi All,

I am developing UEFI driver which will identify ATA/ATAPI devices information on EFI shell.

Find the algorithm of my driver and share your suggestions and ideas.

1. AHCI mode & IDE mode
2. scan PCI devices for class code 0x010601 and 0x0101 3. if AHCI mode, get AHCI bar, and check Ports implement, use ATAPassThru protocol to send Identify cmd 4. if UEFI mode, get command ports and control ports by reading ide controller PCI configure offset 0x10~0x1F.


As of now, I have written my driver till this identification (AHCI or IDE mode).For me,IDE controller mode detected (DE controller class code = 0x0101xx).


The rest of algorithm to be implemented in my driver :

UEFI Mode:

Command and Control Block the access mode for the IO Space, there IO BARs, defined in the SATA / ATA PCI Configuration Space offset 0x10, 0x14, 0x18, 0x1c, as follows:
    -Offset 10h-Primary Command Block Base Address
    -Offset 14h-Primary Control Block Base Address
    -Offset 18h-Secondary Command Block Base Address
    -Offset 1Ch-Secondary Control Block Base Address


With the help of above registers how can I send IDENTIFY command and other ATA commands to get device present status as well as device information (serial No and Model No).


Query:


Do I need to use  ATAPassThru protocol for IDE mode to send ATA commands to the device?


>From SATA / ATA PCI Configuration Space offset 0x10, 0x14, 0x18, 0x1c, (IDE mode) Shall I send ATA command through this registers?


Is ATAPassThru protocol necessary for ide mode to send ATA commands?




Thanks
Murali.S

The contents of this e-mail and any attachment(s) may contain confidential or privileged information for the intended recipient(s). Unintended recipients are prohibited from taking action on the basis of information in this e-mail and  using or disseminating the information,  and must notify the sender and delete it from their system. L&T Infotech will not accept responsibility or liability for the accuracy or completeness of, or the presence of any virus or disabling code in this e-mail"
*************************************************************************
 This email and attachments have been scanned for  potential proprietary or sensitive information leakage.
 Websense Data Security, Protecting Your Information from the Inside Out.
 www.websense.com
 *************************************************************************

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13.
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel



------------------------------

Message: 2
Date: Sun, 22 Sep 2013 02:02:46 +0000
From: "Ni, Ruiyu" 
Subject: Re: [edk2] [PATCH] EdkShellPkg: Add Aarch64 support
To: Olivier Martin 
Cc: "edk2-devel@lists.sourceforge.net"
        
Message-ID:
        <734D49CCEBEEF84792F5B80ED585239D0A7F68FA@SHSMSX103.ccr.corp.intel.com>

Content-Type: text/plain; charset="us-ascii"

Olivier,

Reviewed-by: Ruiyu Ni 

Please remember to update the EdkShellPkg/ReadMe.txt when checking in.

Thanks,
Ray

From: Olivier Martin [mailto:olivier.martin@arm.com]
Sent: Friday, September 20, 2013 4:28 AM
To: Ni, Ruiyu
Cc: edk2-devel@lists.sourceforge.net
Subject: [PATCH] EdkShellPkg: Add Aarch64 support

Dear EdkSehllPkg maintainer,

Please find the attached patch that adds support for AArch64 (ARM 64bit architecture) to EdkShellPkg.

This patch:
* Updates the EFI Shell patch to use SVN rev 64 (was rev 61)
* Modifies the build system to enable AArch64 architecture
* Modifies patch to apply on EdkShell sources to add support for Aarch64.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin >

Best Regards,
Olivier
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 3
Date: Sun, 22 Sep 2013 05:09:49 +0000
From: "Gao, Liming" 
Subject: Re: [edk2] BaseTools compilation error
To: "edk2-devel@lists.sourceforge.net"
        
Message-ID:
        <4A89E2EF3DFEDB4C8BFDE51014F606A11174E983@SHSMSX102.ccr.corp.intel.com>

Content-Type: text/plain; charset="us-ascii"

Hi,
  I don't find such issue on GCC44 and GCC45.

  Do you modify BaseTools Compiler option? Or you use the different GCC version?

Thanks
Liming
From: Sergey Isakov [mailto:isakov-sl@bk.ru]
Sent: Saturday, September 21, 2013 4:49 PM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] BaseTools compilation error

Next
--------------
g++ -c -DPCCTS_USE_NAMESPACE_STD -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/   VfrSyntax.cpp -o VfrSyntax.o
VfrSyntax.cpp:56:3: warning: control reaches end of non-void function [-Wreturn-type]
  }
  ^
VfrSyntax.cpp:3543:88: warning: expression result unused [-Wunused-value]
  ...) {zzfailed_pred("  mCompatibleMode",0 /* report */, { 0; /* no user action */ } );}
                                                            ^
Pccts/h/AParser.h:340:44: note: expanded from macro 'zzfailed_pred'
    zzfailed_pred_action(_p,_hasuseraction,_useraction) \
                                           ^
Pccts/h/AParser.h:351:27: note: expanded from macro 'zzfailed_pred_action'
    if (_hasuseraction) { _useraction } else { failedSemanticPredicate(_p); }
                          ^
VfrSyntax.cpp:3564:88: warning: expression result unused [-Wunused-value]
  ...) {zzfailed_pred("  mCompatibleMode",0 /* report */, { 0; /* no user action */ } );}
                                                            ^
Pccts/h/AParser.h:340:44: note: expanded from macro 'zzfailed_pred'
    zzfailed_pred_action(_p,_hasuseraction,_useraction) \
                                           ^
Pccts/h/AParser.h:351:27: note: expanded from macro 'zzfailed_pred_action'
    if (_hasuseraction) { _useraction } else { failedSemanticPredicate(_p); }
                          ^
3 warnings generated.
g++  -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/   -c -o VfrFormPkg.o VfrFormPkg.cpp
VfrFormPkg.cpp:98:13: error: addition of default argument on redeclaration makes this
      constructor a default constructor
  IN UINT32 BufferSize = 4096
            ^            ~~~~
./VfrFormPkg.h:127:3: note: previous declaration is here
  CFormPkg (IN UINT32 BufferSize);
  ^
1 error generated.
make[1]: *** [VfrFormPkg.o] Error 1
make: *** [VfrCompile] Error 2

---------------


On 21.09.2013, at 12:43, Sergey Isakov > wrote:


In addition, what to do here?
--------------
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -nostdlib -Wall -Werror -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  LzmaCompress.c -o LzmaCompress.o
LzmaCompress.c:46:48: error: explicitly assigning a variable of type 'void *' to itself
      [-Werror,-Wself-assign]
static void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }
                                             ~ ^ ~
LzmaCompress.c:47:48: error: explicitly assigning a variable of type 'void *' to itself
      [-Werror,-Wself-assign]
static void SzFree(void *p, void *address) { p = p; MyFree(address); }
                                             ~ ^ ~
2 errors generated.
make[1]: *** [LzmaCompress.o] Error 1
make: *** [LzmaCompress] Error 2

---------------

On 21.09.2013, at 12:38, Sergey Isakov > wrote:


Dear sirs,
Please consider
---------------------
make -C GenVtf
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -nostdlib -Wall -Werror -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  GenVtf.c -o GenVtf.o
GenVtf.c:1725:20: error: comparison of unsigned expression >= 0 is always true
      [-Werror,-Wtautological-compare]
  if ((BaseAddress >= 0) && (FwVolSize > 0x40) && ((BaseAddress + FwVolSize) % 8 == 0)) {
       ~~~~~~~~~~~ ^  ~
1 error generated.
make[1]: *** [GenVtf.o] Error 1

----------------------
May be (BaseAddress != 0) ?

Sergey
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13.
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13.
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13.
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk

------------------------------

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


End of edk2-devel Digest, Vol 45, Issue 113
******************************************************************************************************************** This email and attachments have been scanned for potential proprietary or sensitive information leakage. Websense Data Security, Protecting Your Information from the Inside Out. www.websense.com *************************************************************************
************************************************************************* This email and attachments have been scanned for potential proprietary or sensitive information leakage. Websense Data Security, Protecting Your Information from the Inside Out. www.websense.com *************************************************************************
*************************************************************************
 This email and attachments have been scanned for
 potential proprietary or sensitive information leakage.
 Websense Data Security, Protecting Your Information from the Inside Out.
 www.websense.com
 *************************************************************************

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel