Key Learnings from EFI Framework Shipping Project

39
Key Learnings Key Learnings from EFI from EFI Framework Framework Shipping Shipping Project Project Daniel Lin Daniel Lin Marketing Director Marketing Director Genius Huang Genius Huang Senior Engineer Senior Engineer Insyde Software Insyde Software PFIS003 PFIS003

Transcript of Key Learnings from EFI Framework Shipping Project

Page 1: Key Learnings from EFI Framework Shipping Project

Key Learnings Key Learnings from EFI from EFI Framework Framework Shipping Shipping ProjectProject

Daniel LinDaniel LinMarketing DirectorMarketing Director

Genius HuangGenius HuangSenior EngineerSenior Engineer

Insyde SoftwareInsyde Software

PFIS003PFIS003

Page 2: Key Learnings from EFI Framework Shipping Project

2*Third party marks and brands are the property of their respective owners

AgendaAgenda Why EFI Framework from OEM’s viewpointsWhy EFI Framework from OEM’s viewpoints

Major differences in debugging methods between Major differences in debugging methods between Framework and Legacy BIOS.Framework and Legacy BIOS.

The power of using the Framework to speed up firmware The power of using the Framework to speed up firmware development for your new platforms. development for your new platforms. 

How NVRAM variables are used in the Framework and the How NVRAM variables are used in the Framework and the advantages over CMOS.advantages over CMOS.

Reduce your engineering effort by leveraging legacy BIOS Reduce your engineering effort by leveraging legacy BIOS experience while using the Framework experience while using the Framework

Page 3: Key Learnings from EFI Framework Shipping Project

3*Third party marks and brands are the property of their respective owners

AgendaAgenda Why EFI Framework from OEM’s viewpointWhy EFI Framework from OEM’s viewpoint

Major differences in debugging methods Major differences in debugging methods between Framework and Legacy BIOS.between Framework and Legacy BIOS.

The power of using the Framework to speed up The power of using the Framework to speed up firmware development for your new platforms. firmware development for your new platforms. 

How NVRAM variables are used in the How NVRAM variables are used in the Framework and the advantages over CMOS.Framework and the advantages over CMOS.

Reduce your engineering effort by leveraging Reduce your engineering effort by leveraging legacy BIOS experience while using the legacy BIOS experience while using the Framework Framework

Page 4: Key Learnings from EFI Framework Shipping Project

4*Third party marks and brands are the property of their respective owners

Why EFI Framework from OEM’s Why EFI Framework from OEM’s viewpointviewpoint

Multiple hardware's supportMultiple hardware's support Dual core CPU, 64 bit CPU Dual core CPU, 64 bit CPU

New FeaturesNew Features VT, LT and xxT.VT, LT and xxT.

Time-To-MarketTime-To-Market Easy to add and remove featuresEasy to add and remove features Easy to Reuse Code on future platformsEasy to Reuse Code on future platforms High Code QualityHigh Code Quality Good Development and Debug EnvironmentGood Development and Debug Environment Ability to Carve up the project and OutsourceAbility to Carve up the project and Outsource Fast Engineering Learning CurveFast Engineering Learning Curve

Page 5: Key Learnings from EFI Framework Shipping Project

5*Third party marks and brands are the property of their respective owners

Framework is technical trend for Framework is technical trend for OEM/ODMOEM/ODM

“ “C” CodeC” Code Code ReuseCode Reuse Driver ModelDriver Model Pre-boot Environment Pre-boot Environment

built-inbuilt-in Networking built in Networking built in

(eg: PXE Boot)(eg: PXE Boot) Backward compatible Backward compatible

with legacy BIOSwith legacy BIOS

legacy O

SL

oad

er

Hardware

Pre-EFI Modules

UEFI

UEFI

PEI FoundationFoundation

Co

mp

atibility S

up

po

rt M

od

ule

EFI OS Loader

Fram

ewo

rk Drivers

EF

I D

rivers

legacy O

ptio

n

RO

Ms

Driver E

xecutio

n E

nviro

nm

entArchitectural Protocols

Platfo

rm D

rivers

Page 6: Key Learnings from EFI Framework Shipping Project

6*Third party marks and brands are the property of their respective owners

Viewpoints from a sever maker Viewpoints from a sever maker “Egenera”“Egenera”

OS EFI Requirement OS EFI Requirement New Features New Features Easy to add and remove features Easy to add and remove features Easy to Reuse Code on future platforms Easy to Reuse Code on future platforms High Code QualityHigh Code Quality Good Development and Debug Environment Good Development and Debug Environment Ability to Carve up the project and Outsource Ability to Carve up the project and Outsource Fast Engineering Learning Curve Fast Engineering Learning Curve

Page 7: Key Learnings from EFI Framework Shipping Project

7*Third party marks and brands are the property of their respective owners

AgendaAgenda Why EFI framework from OEM’s viewpointWhy EFI framework from OEM’s viewpoint

Major differences in debugging methods between Major differences in debugging methods between Framework and Legacy BIOS.Framework and Legacy BIOS.

The power of using the Framework to speed up firmware The power of using the Framework to speed up firmware development for your new platforms. development for your new platforms. 

How NVRAM variables are used in the Framework and the How NVRAM variables are used in the Framework and the advantages over CMOS.advantages over CMOS.

Reduce your engineering effort by leveraging legacy BIOS Reduce your engineering effort by leveraging legacy BIOS experience while using the Frameworkexperience while using the Framework

Page 8: Key Learnings from EFI Framework Shipping Project

8*Third party marks and brands are the property of their respective owners

Debugging in legacy BIOSDebugging in legacy BIOS

Port 80 is traditional method for the BIOS Port 80 is traditional method for the BIOS debugdebug

Port 80 with digits output onlyPort 80 with digits output only Forces engineers to guess on execution Forces engineers to guess on execution

locationlocation Any advance debugging requires special Any advance debugging requires special

design, additional software efforts or design, additional software efforts or additional hardware. additional hardware.

Page 9: Key Learnings from EFI Framework Shipping Project

9*Third party marks and brands are the property of their respective owners

EFI Framework provides a powerful EFI Framework provides a powerful way of debuggingway of debugging

Built-in debugging mechanismBuilt-in debugging mechanism Debug messages output through serial Debug messages output through serial

portport Debug messages can be defined easily Debug messages can be defined easily

as detail as you need.as detail as you need. Any digits or wording can be transferred Any digits or wording can be transferred

to the debug console without any to the debug console without any additional programming efforts.additional programming efforts.

Symbolic debug message is supported.Symbolic debug message is supported.

Page 10: Key Learnings from EFI Framework Shipping Project

10*Third party marks and brands are the property of their respective owners

Insyde debug tools Insyde debug tools Debug even before memory sizingDebug even before memory sizing Set breakpoints in C language, showing Set breakpoints in C language, showing

converted disassembly codes converted disassembly codes simultaneouslysimultaneously

Pure software tool connected thru Pure software tool connected thru standard USB 2.0, parallel portstandard USB 2.0, parallel port

Update flash ROM thru debugger toolUpdate flash ROM thru debugger toolHost Target

USB2.0LPT

USB2.0LPT

H2ODDT

Hyper terminal

USB /LPT cable/COM

Early state debug support, Source codes level debug, Cost saving and easy to use Early state debug support, Source codes level debug, Cost saving and easy to use

Page 11: Key Learnings from EFI Framework Shipping Project

11*Third party marks and brands are the property of their respective owners

Using debug messages in code is Using debug messages in code is the same as “printf”the same as “printf”

Example of how to code output debug Example of how to code output debug message in PEI and DXE phasemessage in PEI and DXE phase–PEI phasePEI phase

– PEI_DEBUGPEI_DEBUG((PeiServices, EFI_D_INFO,”Messages”))((PeiServices, EFI_D_INFO,”Messages”))

–DXE/BDS phaseDXE/BDS phase– DEBUGDEBUG((EFI_D_ERROR,”Messages”))((EFI_D_ERROR,”Messages”))

Page 12: Key Learnings from EFI Framework Shipping Project

12*Third party marks and brands are the property of their respective owners

Easy to understand debug Easy to understand debug messagesmessages

Page 13: Key Learnings from EFI Framework Shipping Project

13*Third party marks and brands are the property of their respective owners

What is the way of debugging for What is the way of debugging for EFI Framework?EFI Framework?

Rich debugging messages Rich debugging messages – Register valueRegister value

– MEM,I/O and CPUMEM,I/O and CPU

– Data structure variableData structure variable

– Full name procedureFull name procedure

– CommentsComments

Page 14: Key Learnings from EFI Framework Shipping Project

14*Third party marks and brands are the property of their respective owners

Various debug tools for EFI Various debug tools for EFI Framework developmentFramework development

Hardware DebuggingHardware Debugging– American AriumAmerican Arium

EFI Shell EFI Shell – Command Line ToolsCommand Line Tools

Debug flagsDebug flags– Thru Hyper terminal to show the debug messagesThru Hyper terminal to show the debug messages

DOS utilitiesDOS utilities– DEBUG.EXEDEBUG.EXE– E820.EXE E820.EXE – DMITOOL.EXE DMITOOL.EXE – PCICHK.EXE & PCIDUMP.EXEPCICHK.EXE & PCIDUMP.EXE

Page 15: Key Learnings from EFI Framework Shipping Project

15*Third party marks and brands are the property of their respective owners

AgendaAgenda Why EFI framework from OEM’s viewpointWhy EFI framework from OEM’s viewpoint

Major differences in debugging methods between Major differences in debugging methods between Framework and Legacy BIOS.Framework and Legacy BIOS.

The power of using the Framework to speed up The power of using the Framework to speed up firmware development for your new platforms. firmware development for your new platforms. 

How NVRAM variables are used in the Framework How NVRAM variables are used in the Framework and the advantages over CMOS.and the advantages over CMOS.

Reduce your engineering effort by leveraging Reduce your engineering effort by leveraging legacy BIOS experience while using the legacy BIOS experience while using the Framework Framework

Page 16: Key Learnings from EFI Framework Shipping Project

16*Third party marks and brands are the property of their respective owners

The power of using the Framework to The power of using the Framework to speed up firmware development for speed up firmware development for

your new platforms. your new platforms.  Modular code structureModular code structure

–Exchangeable CPU drivers. Exchangeable CPU drivers. Dothan vs. YonahDothan vs. Yonah

Highly reusable modules/driversHighly reusable modules/drivers–OEM features reusableOEM features reusable

EFI Framework tolerates failure EFI Framework tolerates failure components with event log to record the components with event log to record the debug messagesdebug messages

Page 17: Key Learnings from EFI Framework Shipping Project

17*Third party marks and brands are the property of their respective owners

Quick bring up works with EFI Quick bring up works with EFI FrameworkFramework

Create your own project folderCreate your own project folder–For your specific projectFor your specific project

Customize GPIO valueCustomize GPIO value– based on the schematicsbased on the schematics

Customize PCI routing tableCustomize PCI routing table–To assign correct resource for your projectTo assign correct resource for your project

Uses EMUVariable driverUses EMUVariable driver–To use RAM as Flash during bring-up stageTo use RAM as Flash during bring-up stage–To save time before flash driver readyTo save time before flash driver ready

Highly utilizing CRB platform source codesHighly utilizing CRB platform source codes

lfleishe
Assume your audience is engineers
Page 18: Key Learnings from EFI Framework Shipping Project

18*Third party marks and brands are the property of their respective owners

AgendaAgenda Why EFI framework from OEM’s viewpointWhy EFI framework from OEM’s viewpoint

Major differences in debugging methods between Major differences in debugging methods between Framework and Legacy BIOS.Framework and Legacy BIOS.

The power of using the Framework to speed up firmware The power of using the Framework to speed up firmware development for your new platforms. development for your new platforms. 

How NVRAM variables are used in the Framework and the How NVRAM variables are used in the Framework and the advantages over CMOS.advantages over CMOS.

Reduce your engineering effort by leveraging legacy BIOS Reduce your engineering effort by leveraging legacy BIOS experience while using the Frameworkexperience while using the Framework

Page 19: Key Learnings from EFI Framework Shipping Project

19*Third party marks and brands are the property of their respective owners

Contents of Flash part for EFI Contents of Flash part for EFI FrameworkFramework

SEC,PEI and DXE (firmware volumes)SEC,PEI and DXE (firmware volumes)

– SEC initializes cache as RAMSEC initializes cache as RAM– Modules initial codes will be put into PEI phase Modules initial codes will be put into PEI phase – Device drivers will be put into DXE phaseDevice drivers will be put into DXE phase

EC ROMEC ROM– Normally we will treat ECROM as an individual firmware Normally we will treat ECROM as an individual firmware

volumevolume Option ROM /PXEOption ROM /PXE

– Put them into DXE firmware volumePut them into DXE firmware volume CMOS replacementCMOS replacement

– NVRAM Non Volatile RAMNVRAM Non Volatile RAM– Variable storageVariable storage

Page 20: Key Learnings from EFI Framework Shipping Project

20*Third party marks and brands are the property of their respective owners

A Firmware Volume is a logical container.A Firmware Volume is a logical container. A flash part may store one or more logical A flash part may store one or more logical

containers.containers. The files which are contained in a The files which are contained in a firmware volume must be accessed firmware volume must be accessed in:in:– Security (SEC) phase orSecurity (SEC) phase or

– Pre-EFI Initialization (PEI) phase or Pre-EFI Initialization (PEI) phase or

– Driver Execution Environment (DXE) phase.Driver Execution Environment (DXE) phase.

What is a Firmware Volume?What is a Firmware Volume?

Page 21: Key Learnings from EFI Framework Shipping Project

21*Third party marks and brands are the property of their respective owners

Rationale of Firmware VolumeRationale of Firmware Volume

Firmware Volume Architecture

Firmware Volume

Driver

Firmware Volume Block

Driver

Firmware Storage

Device

Low Level

Interface

Low Level

Interface

File Level

Interface

File Level

Interface

FvbServiceFvbService

Flash Memory Device

Flash Memory Device

Page 22: Key Learnings from EFI Framework Shipping Project

22*Third party marks and brands are the property of their respective owners

POST/ RunTime

Code

Boot Block

DXE Phase

Variable Storage

SEC/PEI Phase

VS.

Firmware Volume

Legacy BIOS H2O

Firmware Volume

Firmware Volume

Flash Rom Map – Comparison Flash Rom Map – Comparison between Legacy BIOS and EFI between Legacy BIOS and EFI

FrameworkFramework

Page 23: Key Learnings from EFI Framework Shipping Project

23*Third party marks and brands are the property of their respective owners

The advantages of using Variable The advantages of using Variable StorageStorage Flexible Variable Storage location in Flexible Variable Storage location in

flash deviceflash device CMOS replacementCMOS replacement All variables can be defined with any All variables can be defined with any

data types such as byte, words, any data types such as byte, words, any string length depends on the variable string length depends on the variable storage total size. storage total size.

Variables defragment- Two Variables defragment- Two Variable Variable StorageStorage areas for areas for Variable Variable defragment defragment and recovery.and recovery.

Page 24: Key Learnings from EFI Framework Shipping Project

24*Third party marks and brands are the property of their respective owners

Variable Storage process flow Variable Storage process flow diagramdiagram

NVRAM 0

NVRAM 1

System Boot

Store MEM to NVRAM1

and NVRAM 0 after

process Defragment

Memory

NVRAM 0 FullNVRAM 0 Full

Copy

Failed to boot

NVRAM 0

NVRAM 1

Memory

Copy

System Boot

Page 25: Key Learnings from EFI Framework Shipping Project

25*Third party marks and brands are the property of their respective owners

How to modify your Flash Rom Map How to modify your Flash Rom Map of EFI for a Mobile caseof EFI for a Mobile case

DXE PhaseDXE Phase

NVRAM / CPU micro codeNVRAM / CPU micro code

SEC/PEI PhaseSEC/PEI Phase

DXE PhaseDXE Phase

NVRAM/ CPU micro codeNVRAM/ CPU micro code

SEC/PEI PhaseSEC/PEI Phase

EC RomEC Rom

Page 26: Key Learnings from EFI Framework Shipping Project

26*Third party marks and brands are the property of their respective owners

AgendaAgenda Why EFI framework from OEM’s viewpointWhy EFI framework from OEM’s viewpoint

Major differences in debugging methods between Major differences in debugging methods between Framework and Legacy BIOS.Framework and Legacy BIOS.

The power of using the Framework to speed up firmware The power of using the Framework to speed up firmware development for your new platforms. development for your new platforms. 

How NVRAM variables are used in the Framework and the How NVRAM variables are used in the Framework and the advantages over CMOS.advantages over CMOS.

Reduce your engineering effort by leveraging legacy BIOS Reduce your engineering effort by leveraging legacy BIOS experience while using the Frameworkexperience while using the Framework

Page 27: Key Learnings from EFI Framework Shipping Project

27*Third party marks and brands are the property of their respective owners

Reduce your engineering effort by Reduce your engineering effort by leveraging legacy BIOS experience leveraging legacy BIOS experience

while using the Frameworkwhile using the Framework To reuse OEM drivers which were used To reuse OEM drivers which were used

in previous projectsin previous projects Any drivers can be packaged as binary Any drivers can be packaged as binary

files since all implementations are using files since all implementations are using driver model.driver model.

Simultaneous co-development model- Simultaneous co-development model- Different projects can be shared with the Different projects can be shared with the same feature in binary file format without same feature in binary file format without source codes doing the re-compile.source codes doing the re-compile.

Page 28: Key Learnings from EFI Framework Shipping Project

28*Third party marks and brands are the property of their respective owners

Example: How to add /remove an Example: How to add /remove an Application or drivers with simple Application or drivers with simple wayway#

# Drivers necessary to use the debugger# These are placed here so they will load early if they are desired.# NOTE:# Including these in the FV will take over use of the COM port.#Edk\Sample\Universal\Debugger\Debugport\Dxe\DebugPort.inf FV=NULLEdk\Sample\Cpu\DebugSupport\Dxe\DebugSupport.inf FV=NULL

## Following are the DXE drivers (alphabetical order)#

Bus\Isa\IsaBus\Dxe\IsaBus.infBus\Isa\IsaFloppy\Dxe\IsaFloppy.inf

$(SHELL_INF)\Shell.inf# $(SHELL_INF)\Shell.inf

Page 29: Key Learnings from EFI Framework Shipping Project

29*Third party marks and brands are the property of their respective owners

Life demo for a debug Life demo for a debug demonstrationdemonstration Debug tool to show how Framework Debug tool to show how Framework

works with first initial PEI codes before works with first initial PEI codes before memory sizingmemory sizing

Debug tool to show modules loading Debug tool to show modules loading sequence sequence

To show how to trace the source EFI To show how to trace the source EFI Framework with Debug toolsFramework with Debug tools

Page 30: Key Learnings from EFI Framework Shipping Project

30*Third party marks and brands are the property of their respective owners

SummarySummary Time to MarketTime to Market

– Various platformVarious platform supportssupports with unified EFI with unified EFI Framework is very beneficial for customersFramework is very beneficial for customers

Easy for debugging Easy for debugging – EFI Framework embedded powerful debugging EFI Framework embedded powerful debugging

mechanism mechanism

Easy for developmentEasy for development– Modularity provides flexibility for parallel Modularity provides flexibility for parallel

developmentsdevelopments

Reusable engineering effortsReusable engineering efforts– New features for reuse for different platformsNew features for reuse for different platforms

Page 31: Key Learnings from EFI Framework Shipping Project

31*Third party marks and brands are the property of their respective owners

Additional EFI /Framework Additional EFI /Framework Sessions Sessions

DateDate SessionSession IDID CompanyCompany TimeTime

Oct. 27Oct. 27 ““Unified EFI” Industry Unified EFI” Industry Group introduction and the Group introduction and the Firmware Bridge to the Firmware Bridge to the IntelIntel®® EM64T and Microsoft EM64T and Microsoft Vista*Vista*

PFIS001PFIS001 Intel, HPIntel, HP DoneDone

Implementing Implementing Manageable Server Manageable Server Platforms using EFI & Platforms using EFI & The FrameworkThe Framework

PFIS002PFIS002 AMIAMI DoneDone

Key Learnings from EFI Key Learnings from EFI Framework Shipping Framework Shipping ProjectProject

PFIS003PFIS003 InsydeInsyde DoneDone

Implementing the PEI Implementing the PEI and DXE Within and DXE Within Phoenix TrustedCore*Phoenix TrustedCore*

PFIS004PFIS004 PhoenixPhoenix 16:50 - 17:4016:50 - 17:40

Oct. 28Oct. 28 Implementing the Implementing the Framework on non-Framework on non-Intel ChipsetsIntel Chipsets

PSSS006PSSS006 HPHP 11:45 - 12:2511:45 - 12:25

Page 32: Key Learnings from EFI Framework Shipping Project

32*Third party marks and brands are the property of their respective owners

Additional Resources for this Additional Resources for this SessionSession

Complete US IDF presentation can be downloaded from Complete US IDF presentation can be downloaded from the IDF web site – when prompted enter:the IDF web site – when prompted enter:

– Username: idfUsername: idf– Password: fall2005Password: fall2005

More web based info:More web based info:http://www.uefi.org

http://www.intel.com/technology/framework http://www.intel.com/technology/efi

http://www.tianocore.org

Page 33: Key Learnings from EFI Framework Shipping Project

33*Third party marks and brands are the property of their respective owners

Please fill out the Please fill out the Session Evaluation Session Evaluation Form.Form.

Thank You!Thank You!

Page 34: Key Learnings from EFI Framework Shipping Project

34*Third party marks and brands are the property of their respective owners

Backup SlidesBackup Slides

Page 35: Key Learnings from EFI Framework Shipping Project

35*Third party marks and brands are the property of their respective owners

Q&AQ&A

Page 36: Key Learnings from EFI Framework Shipping Project

36*Third party marks and brands are the property of their respective owners

Demonstration procedure-1Demonstration procedure-1

Hardware configuration Hardware configuration –Host machineHost machine–Target MachineTarget Machine– Insyde USB cableInsyde USB cable–Serial port cableSerial port cable

Software configurationSoftware configuration–Hyper terminalHyper terminal–H2ODDTH2ODDT– Insyde USB driverInsyde USB driver

Page 37: Key Learnings from EFI Framework Shipping Project

37*Third party marks and brands are the property of their respective owners

Demonstration scenario-IDemonstration scenario-I Remove RAM from RAM slotRemove RAM from RAM slot Show two windows for Hyper terminal and Insyde Show two windows for Hyper terminal and Insyde

H2ODDTH2ODDT Show break two break points when memory sizing–PEI Show break two break points when memory sizing–PEI

memory init and error handle procedurememory init and error handle procedure We also Show No memory detected at Hyper terminal We also Show No memory detected at Hyper terminal

side when detected no memory in RAM slotside when detected no memory in RAM slot Show source codes at DDT side- MC detect memoryShow source codes at DDT side- MC detect memory Show the exact source code line when it hangs on Show the exact source code line when it hangs on

both hyper terminal and DDTboth hyper terminal and DDT

Page 38: Key Learnings from EFI Framework Shipping Project

38*Third party marks and brands are the property of their respective owners

Demonstration scenario- IIDemonstration scenario- II

Install RAM into RAM slotInstall RAM into RAM slot Show the memory init without stopShow the memory init without stop Show the drivers loading sequence via Show the drivers loading sequence via

command line windowcommand line window

Page 39: Key Learnings from EFI Framework Shipping Project

39*Third party marks and brands are the property of their respective owners

Demonstration scenario- IIIDemonstration scenario- III

Show host bridge bus0/device 1f /function 0Show host bridge bus0/device 1f /function 0 Show the platform driver how to modify PCI Show the platform driver how to modify PCI

register values- register values- – show the original register values-show the original register values-

– Show platform driver is modifying a GPI rout Show platform driver is modifying a GPI rout registerregister

– Then we can see the change from PCI register Then we can see the change from PCI register dump windows dump windows

PCI E registers dumpPCI E registers dump