hardware prototyping using a windows-hosted uefi environment · 6/1/2011 · hardware prototyping...
TRANSCRIPT
![Page 1: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/1.jpg)
presented by
Hardware Prototyping Using a Windows-Hosted UEFI environment
UEFI Summer Plugfest – July 6-9, 2011Presented by Tim Lewis (Phoenix
Technologies Ltd.)
UEFI Plugfest – July 2011 www.uefi.org 1
Updated 2011-06-01
![Page 2: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/2.jpg)
Agenda
• Introduction
• SMBus and UEFI Overview
• Adding ASF, DASH & IPMI
• Debugging With Windows-Hosted Emulation
• Q & A
UEFI Plugfest – July 2011 www.uefi.org 2
![Page 3: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/3.jpg)
Introduction
• Problem: UEFI BIOS is a tough development environment.– Developed before hardware available. Often
have to code blind.– Tough to debug. How to log output, set
breakpoints.– Time consuming to debug. Long turn-around
time to update.– How to unit test corner cases? Touching
hardware crashes the system.
UEFI Plugfest – July 2011 www.uefi.org 3
![Page 4: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/4.jpg)
Introduction (2)
• Solution: Develop UEFI BIOS in an emulated hardware environment.– WinHost (Phoenix) or Nt32Pkg (TianoCore) offer an
emulated UEFI environment running under Windows operating systems.
– Provides UEFI abstractions for many Windows hardware resources (disk, serial, network)
– Quick-turn around and excellent debug support using Visual Studio.
• Real-Life Solution: How Phoenix used WinHost to develop ASF, DASH and IPMI using an emulated SMBus Host Controller.
UEFI Plugfest – July 2011 www.uefi.org 4
![Page 5: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/5.jpg)
What Is SMBus?
• SMBus is a low-power 2-wire multi-master bus built on top of I2C.
– Well-defined transport.
– Addressable.
– UDID gives vendor/device id similar to PCI.
• Used as the backbone of numerous platform management standards:
– ASF, DASH, IPMI
UEFI Plugfest – July 2011 www.uefi.org 5
CPU
SMBus Host Controller
Temperature
Sensor
Fan Motor
Voltage
Sensor
Managemen
t Controller
SMBus
PCIe Slot
![Page 6: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/6.jpg)
How Does UEFI Support SMBus?
• The UEFI PI Specification’s SMBus Host Controller protocol abstracts differences in hardware interface.
UEFI Plugfest – July 2011 www.uefi.org 6
typedef struct _EFI_SMBUS_HC_PROTOCOL {
EFI_SMBUS_HC_EXECUTE_OPERATION Execute;
EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE ArpDevice;
EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP GetArpMap;
EFI_SMBUS_HC_PROTOCOL_NOTIFY Notify;
} EFI_SMBUS_HC_PROTOCOL;
![Page 7: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/7.jpg)
What Was Missing?
• The UEFI Driver Model!
UEFI Plugfest – July 2011 www.uefi.org 7
![Page 8: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/8.jpg)
What Was Missing?
• The UEFI Driver Model!
UEFI Plugfest – July 2011 www.uefi.org 8
![Page 9: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/9.jpg)
What Was Missing?
• The UEFI Driver Model!
UEFI Plugfest – July 2011 www.uefi.org 9
![Page 10: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/10.jpg)
What Was Missing?
• The UEFI Driver Model!
UEFI Plugfest – July 2011 www.uefi.org 10
![Page 11: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/11.jpg)
What Was Missing?
• The UEFI Driver Model!
UEFI Plugfest – July 2011 www.uefi.org 11
![Page 12: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/12.jpg)
How To Integrate SMBus HostController Into UEFI Driver Model?
• Added Driver Binding Protocol.
• Added Device Path Protocol.
• Added Means To Connect Non-Boot Devices.
–By default, Boot Manager only connected console input, output and boot devices.
UEFI Plugfest – July 2011 www.uefi.org 12
![Page 13: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/13.jpg)
Adding ASF, DASH and IPMI
UEFI Plugfest – July 2011 www.uefi.org 13
• With SMBus in UEFI driver model, standards like ASF, DASH and IPMI fit in naturally.
ASD
OS
/
AP
PS
SY
ST
EM
SIL
ICO
NH
AR
DW
AR
ESMBus Host Controller
SMBus I/O
ASF Bus
ASF I/O
ASF & SMBus
Sensor
Drivers
BMCASF Sensors
SMBus
Sensor
Device Path
Driver Binding
HII Forms
SMBus Bus
SMBus Host Controller
ASF ASD
Driver
ASF ASD
HII
Database
Setup
![Page 14: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/14.jpg)
Emulate Host Controller
UEFI Plugfest – July 2011 www.uefi.org 14
• By emulating one driver, we could test and debug our ASF, DASH and IPMI stack w/o hardware.
• Easy to test setup pages, sensors, boot options, SMBIOS push and error conditions.
![Page 15: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/15.jpg)
SMBus Host Controller Driver Architecture
UEFI Plugfest – July 2011 www.uefi.org 15
![Page 16: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/16.jpg)
Common Unit Test Debug Scenarios
UEFI Plugfest – July 2011 www.uefi.org 16
• Device Enumeration for Devices That:–Are not enumerable (ARP)
–Don’t identify themselves well.
• Error Check For Devices That:–Return ill-formed packets.
–Don’t support specific commands.
• Return Different SMBIOS Tables, Boot Options and Other Items.
![Page 17: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/17.jpg)
Debug Using Messages or Breakpoints!
• Dump out enumeration information.
UEFI Plugfest – July 2011 www.uefi.org 17
![Page 18: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/18.jpg)
Debug Using Messages or Breakpoints!
• View how commands are translated from DASH to SMBus.
UEFI Plugfest – July 2011 www.uefi.org 18
![Page 19: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/19.jpg)
Debug Using Messages or Breakpoints!
• View how commands are translated from DASH to SMBus.
UEFI Plugfest – July 2011 www.uefi.org 19
![Page 20: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/20.jpg)
Conclusion
UEFI Plugfest – July 2011 www.uefi.org 20
• Device Emulation Speeds Development.
• Better debug & log capabilities.
• Better unit test case.
–Once a unique device found, model it in software for regression tests.
![Page 21: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/21.jpg)
Q & A
UEFI Plugfest – July 2011 www.uefi.org 21
![Page 22: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/22.jpg)
Thanks for attending the UEFI Summer Plugfest 2011
For more information on the Unified EFI Forum and UEFI Specifications, visit http://www.uefi.org
presented by
UEFI Plugfest – July 2011 www.uefi.org 22
![Page 23: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/23.jpg)
But wait, there’s more …
UEFI Plugfest – July 2011 www.uefi.org 23
Wed(July 6)
• UEFI State of the Union (10:30am, Intel)
• Implementing a Secure Boot Path with UEFI 2.3.1 (1:00pm, Insyde)
• UEFI SCT Overview (2:30pm, HP/Intel)
Thu(July 7)
• Replacing VGA: GOP Implementation in UEFI (10:30am, AMD)
• UEFI prototyping using a Windows-hosted UEFI environment (1:00pm, Phoenix)
• EFI Shell Lab (2:00-4:00pm, “Thunder”, Intel)
• GOP Enabling & Testing Lab (4:30—5:30pm, “Thunder”, Intel)
Fri(July 8)
• Best Practices for UEFI Option ROM Developers (10:30am, AMI)
Download presentations after the plugfest at www.uefi.org
![Page 24: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/24.jpg)
Backup
UEFI Plugfest – July 2011 www.uefi.org 24
![Page 25: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/25.jpg)
SMBus I/O Protocol
UEFI Plugfest – July 2011 www.uefi.org 25
extern EFI_GUID gSctSmbusIoProtocolGuid;
typedef struct _SCT_SMBUS_IO_PROTOCOL {
UINT32 Size;
EFI_SMBUS_ADDRESS Addr;
SCT_SMBUS_IO_IDENTIFY Identify;
SCT_SMBUS_IO_EXECUTE Execute;
} SCT_SMBUS_IO_PROTOCOL, *PSCT_SMBUS_IO_PROTOCOL;
![Page 26: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/26.jpg)
ASF I/O Protocol
UEFI Plugfest – July 2011 www.uefi.org 26
extern EFI_GUID gSctAsfIoProtocolGuid;
typedef struct _SCT_ASF_IO_PROTOCOL {
UINT32 Size;
SCT_ASF_IO_SEND_MSG SendMessage;
} SCT_ASF_IO_PROTOCOL, *PSCT_ASF_IO_PROTOCOL;
![Page 27: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/27.jpg)
DASH MCTP I/O Protocol
UEFI Plugfest – July 2011 www.uefi.org 27
extern EFI_GUID gSctMctpIoProtocolGuid;
typedef struct _SCT_MCTP_IO_PROTOCOL {
UINT32 Size;
MCTP_EID Eid;
MCTP_MEDIUM Medium;
SCT_MCTP_SEND_MSG SendMessage;
} SCT_MCTP_IO_PROTOCOL, *PSCT_MCTP_IO_PROTOCOL;
![Page 28: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/28.jpg)
IPMI I/O Protocol
UEFI Plugfest – July 2011 www.uefi.org 28
extern EFI_GUID gSctIpmiProtocolGuid;
typedef struct _SCT_IPMI_IO_PROTOCOL {
UINT32 Size;
SCT_IPMI_SEND_REQUEST SendRequest;
} SCT_IPMI_IO_PROTOCOL, *PSCT_IPMI_IO_PROTOCOL;
![Page 29: Hardware Prototyping Using a Windows-Hosted UEFI environment · 6/1/2011 · Hardware Prototyping Using a Windows-Hosted UEFI environment UEFI Summer Plugfest –July 6-9, 2011 Presented](https://reader034.vdocuments.site/reader034/viewer/2022042521/5f78c9a4e2ecf10a7e56e3e5/html5/thumbnails/29.jpg)
References
• System Management Bus (SMBus) Specification, Version 2.0, August 3, 2000
• UEFI Specification, Version 2.3.1, April 6, 2011
• Platform Initialization (PI) Specification, Volume 5, Version 1.2, May 13, 2009
UEFI Plugfest – July 2011 www.uefi.org 29