Discussion:
[edk2] custom USB Host controller driver using EDK-II emulator
praveen kumar
2010-02-26 05:55:00 UTC
Permalink
Dear Experts,



I am trying to develop my custom USB Host controller driver in Boot
environment. I am using EDK-II as the basis for this development.

Before going to the real hardware, I wanted to simulate my driver over EDK
emulator. I was able to build the EDK-II and start the emulator.

But my problem is, Emulator is not using the USB driver to get information
from Key board and Mouse. Still these devices are working without any issue.



Can anyone please let me know, How to test my driver using the EDK-II
emulator? Please let me now, If I am doing anything wrong.



Thanks and Regards,

Praveen.
Tian, Hot
2010-02-26 05:58:01 UTC
Permalink
Does your "EDK-II emulator" means NT32? You may try to use DUET for UEFI driver development.

Thanks,
Hot

From: praveen kumar [mailto:***@gmail.com]
Sent: Friday, February 26, 2010 1:55 PM
To: edk2-***@lists.sourceforge.net
Subject: [edk2] custom USB Host controller driver using EDK-II emulator

Dear Experts,

I am trying to develop my custom USB Host controller driver in Boot environment. I am using EDK-II as the basis for this development.
Before going to the real hardware, I wanted to simulate my driver over EDK emulator. I was able to build the EDK-II and start the emulator.
But my problem is, Emulator is not using the USB driver to get information from Key board and Mouse. Still these devices are working without any issue.

Can anyone please let me know, How to test my driver using the EDK-II emulator? Please let me now, If I am doing anything wrong.

Thanks and Regards,
Praveen.
Tian, Feng
2010-02-26 05:58:15 UTC
Permalink
Hi, Praveen
Which EDK-II emulator do you use? Duet or Nt32 or UnixPkg? Usb is only supported at Duet and others can not

Thanks
Tian Feng
________________________________
From: praveen kumar [mailto:***@gmail.com]
Sent: 2010Äê2ÔÂ26ÈÕ 13:55
To: edk2-***@lists.sourceforge.net
Subject: [edk2] custom USB Host controller driver using EDK-II emulator

Dear Experts,

I am trying to develop my custom USB Host controller driver in Boot environment. I am using EDK-II as the basis for this development.
Before going to the real hardware, I wanted to simulate my driver over EDK emulator. I was able to build the EDK-II and start the emulator.
But my problem is, Emulator is not using the USB driver to get information from Key board and Mouse. Still these devices are working without any issue.

Can anyone please let me know, How to test my driver using the EDK-II emulator? Please let me now, If I am doing anything wrong.

Thanks and Regards,
Praveen.
praveen kumar
2010-02-26 16:09:52 UTC
Permalink
Hi, Praveen
Post by Tian, Feng
Which EDK-II emulator do you use? Duet or Nt32 or UnixPkg? Usb is
only supported at Duet and others can not
Thanks for the useful information.



I was able to create a USB bootable image disc using DUET emulator. The
default boot code(Which is supplied by the vendor) is getting loaded, when I
connect this bootable USB disk to USB2.0 port and power up the system. Then
How can I use the image in the bootable USB drive to test and debug my
component.


Any documentation related to this will be greatly appreciated.



Thanks in advance,



Regards,

Praveen N
Tian, Hot
2010-02-27 00:10:37 UTC
Permalink
You may try boot from ISA floppy if it's not a legacy free system. You can also try boot from HD or CDROM, but DUET may not formally support this. I ever tried burn bootable CDROM using DUET bootable USB image.

Thanks,
Hot

From: praveen kumar [mailto:***@gmail.com]
Sent: Saturday, February 27, 2010 12:10 AM
To: edk2-***@lists.sourceforge.net; Tian, Feng; Tian, Hot
Subject: Re: [edk2] custom USB Host controller driver using EDK-II emulator


Hi, Praveen
Which EDK-II emulator do you use? Duet or Nt32 or UnixPkg? Usb is only supported at Duet and others can not
Thanks for the useful information.

I was able to create a USB bootable image disc using DUET emulator. The default boot code(Which is supplied by the vendor) is getting loaded, when I connect this bootable USB disk to USB2.0 port and power up the system. Then How can I use the image in the bootable USB drive to test and debug my component.

Any documentation related to this will be greatly appreciated.

Thanks in advance,

Regards,
Praveen N
Tian, Hot
2010-02-27 00:33:09 UTC
Permalink
More options:
You may possible to boot DUET from USB without EDKII native USB controller drivers (as the boot is using legacy USB support). You can add your USB controller driver or load your USB controller driver from HD.
If your USB controller is managed by EDKII USB controller driver, you can also disconnect EDKII USB controller driver and connect your controller driver (may need store your driver on HD or other media). You can also have higher version num for you USB controller driver. This will need knowledge about UEFI driver model. You can refer the details on UEFI spec. And you can also refer the details of shell command usage (e.g. dh, drivers, devices etc.)
Using DUET, you also need disable legacy USB to avoid the impact to native USB drivers. There is such sample in EDKII EHCI driver (PcdTurnOffUsbLegacySupport).

Thanks,
Hot

From: Tian, Hot
Sent: Saturday, February 27, 2010 8:11 AM
To: 'praveen kumar'; edk2-***@lists.sourceforge.net; Tian, Feng
Subject: RE: [edk2] custom USB Host controller driver using EDK-II emulator

You may try boot from ISA floppy if it's not a legacy free system. You can also try boot from HD or CDROM, but DUET may not formally support this. I ever tried burn bootable CDROM using DUET bootable USB image.

Thanks,
Hot

From: praveen kumar [mailto:***@gmail.com]
Sent: Saturday, February 27, 2010 12:10 AM
To: edk2-***@lists.sourceforge.net; Tian, Feng; Tian, Hot
Subject: Re: [edk2] custom USB Host controller driver using EDK-II emulator


Hi, Praveen
Which EDK-II emulator do you use? Duet or Nt32 or UnixPkg? Usb is only supported at Duet and others can not
Thanks for the useful information.

I was able to create a USB bootable image disc using DUET emulator. The default boot code(Which is supplied by the vendor) is getting loaded, when I connect this bootable USB disk to USB2.0 port and power up the system. Then How can I use the image in the bootable USB drive to test and debug my component.

Any documentation related to this will be greatly appreciated.

Thanks in advance,

Regards,
Praveen N
praveen kumar
2010-03-01 16:01:22 UTC
Permalink
Thanks for the help.
I was able to create a bootable image on USB drive and able to boot the
system using this image.



I found the following script in the bottom of “DuetPkg.dsc”, which is in
“\DuetPkg” folder.

#

# Sample Application

#

MdeModulePkg/Application/HelloWorld/HelloWorld.inf



With this I understand that “Hello World” app should run with this image.
But no sign of “Hello World” output on the display.



Also I found the following script in “CreateBootDisk.bat” batch file.

:CreateBootFileForIA32

copy %WORKSPACE%\EdkShellBinPkg\MinimumShell\IA32\Shell.efi
%EFI_BOOT_DISK%\efi\boot\bootia32.efi /y



With this script, I expected the shell prompt should appear on my system.
Unfortunately, I didn’t found any such thing.



The only screens I am getting over my display are,



1st Screen "ABCE


WELCOME TO EFI WORLD"



2nd Screen " TianoCore Logo




Start Boot Options

Progress
bar "



3rd Screen "Boot Failed. EFI DVD/CDROM"



I followed the procedure that mentioned in the Readme.txt, which is in
“DuetPkg” folder to generate the bootable image using Windows XP system.



Please let me know, if I am missing anything or if my understanding about
the scripts were wrong ?



Thanks and Regards,

Praveen.
Post by Tian, Hot
You may possible to boot DUET from USB without EDKII native USB controller
drivers (as the boot is using legacy USB support). You can add your USB
controller driver or load your USB controller driver from HD.
Lu, Ken
2010-03-01 16:43:18 UTC
Permalink
Hi, kumar:

Seems, CDROM is your first boot option and your boot failure, but *not* the shell.efi in usb disk.

You could follow following clues to find your issue:
1) Due to window xp do some cache, so you need use two steps to create a usb disk:
a) Step 1: CreateBootDisk usb e: FAT32 (assume your usb disk is e: )
b) Plug off usb from your windows and plug-in again. <== very important
c) Step 2: CreateBootDisk usb e: FAT32 step2 <== this step is to copy shell.efi to your boot disk as startup boot loader.

After above steps, you could make sure shell.efi is under <bootdisk>\efi\boot\bootia32.efi

2) If you problem still exists with above steps, that mean USB stack related modules does not work in your duet. The reason could:
a) Please make sure following modules are included in your DuetPkg\Duet.fdf file
# Usb Support
INF MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf
INF MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf
INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf

b) When you see the ¡°Tiano Logo¡± and progress bar, you could press any key to interrupt it. And you will get into boot ¡°front page¡± as following choise:
i. ¡°Continue¡±
ii. ¡°Language¡±
iii. ¡°Boot manager¡±
iv. ¡°Device manager¡±
v. ¡°Boot maintain manager¡±

You could enter ¡°Boot maintain manager¡± menu and find submenu ¡°Load from file¡±, and enter.
When you enter this menu, BIOS will enumerate all discovered disk for you including your usb disk, you can select the boot loader file from file explorer.

If you can not see your usb disk listed in file explorer, the reason maybe Duet do not recognize your usb disk, it maybe the issue of incompatible usb device.
So you can try floppy boot or change a usb disk and try again.

Thanks.



Best Regard
K
---------------------------
hear and you forget; see and you remember; do and you understand

________________________________
From: praveen kumar [mailto:***@gmail.com]
Sent: 2010Äê3ÔÂ2ÈÕ 0:01
To: Tian, Hot
Cc: edk2-***@lists.sourceforge.net
Subject: Re: [edk2] custom USB Host controller driver using EDK-II emulator

Thanks for the help.
I was able to create a bootable image on USB drive and able to boot the system using this image.

I found the following script in the bottom of ¡°DuetPkg.dsc¡±, which is in ¡°\DuetPkg¡± folder.
#
# Sample Application
#
MdeModulePkg/Application/HelloWorld/HelloWorld.inf

With this I understand that ¡°Hello World¡± app should run with this image. But no sign of ¡°Hello World¡± output on the display.

Also I found the following script in ¡°CreateBootDisk.bat¡± batch file.
:CreateBootFileForIA32
copy %WORKSPACE%\EdkShellBinPkg\MinimumShell\IA32\Shell.efi %EFI_BOOT_DISK%\efi\boot\bootia32.efi /y

With this script, I expected the shell prompt should appear on my system. Unfortunately, I didn¡¯t found any such thing.

The only screens I am getting over my display are,

1st Screen "ABCE
WELCOME TO EFI WORLD"

2nd Screen " TianoCore Logo

Start Boot Options
Progress bar "

3rd Screen "Boot Failed. EFI DVD/CDROM"

I followed the procedure that mentioned in the Readme.txt, which is in ¡°DuetPkg¡± folder to generate the bootable image using Windows XP system.

Please let me know, if I am missing anything or if my understanding about the scripts were wrong ?

Thanks and Regards,
Praveen.

On Sat, Feb 27, 2010 at 6:03 AM, Tian, Hot <***@intel.com<mailto:***@intel.com>> wrote:
More options:
You may possible to boot DUET from USB without EDKII native USB controller drivers (as the boot is using legacy USB support). You can add your USB controller driver or load your USB controller driver from HD.
Tian, Feng
2010-03-03 01:09:48 UTC
Permalink
Hi, Andrew
Could you help to verify the latest revision of edk2 ehci driver at BeagleBoard?
We construct a non 1:1 mapping page table to build an emulation env in which the host address is not identical to pci master address.
It can identify the usb-2.0 disk now.
If BeagleBoard still has problem, please let me know.
And in EhcInitHC() you ever comment a line (line 561) to avoid breaking boot, could we restore it now?

Thanks
Tian Feng

Loading...