SMBIOS support and test in UEFI & Kernel

1.Preparation:

  • 1.1 UEFI with SMBIOS patch from [git://git.linaro.org/arm/uefi/uefi-next.git ] branch [lce-2013]
    1.2 Kernel with SMBIOS patch from [git://git.linaro.org/people/leiflindholm/linux-uefi-runtime-services.git] branch [lce_2013]
    1.3 Grub from [lp:~leif-lindholm/linaro-grub/arm-uefi]
    1.4 MMC image [create by linaro-media-create]
    1.5 Dmidecode from [http://download.savannah.gnu.org/releases/dmidecode/dmidecode-2.12.tar.bz2]

2.Process:

  • 2.1 Build the UEFI image, generate RTSM_VE_CORTEX-A15_MPCORE_EFI.fd
    • /uefi-build -b RELEASE rtsm_a15mpcore
    2.2 Build the grub image using cross-compile method

                bzr branch lp:~leif-lindholm/linaro-grub/arm-uefi
                cd arm-uefi
                ./autogen.sh
                ./configure --prefix=/home/liyi/work/LCE2013/smbios/arm-uefi \
                            --with-platform=efi \
                            --disable-werror \
                            --build=x86_64-linux-gnu \
                            --target=arm-linux-gnueabi \
                            --host=x86_64-linux-gnu
                make
                make install
                ./grub-mkimage -o grub.efi -O arm-efi -p "" part_gpt \
                               part_msdos ntfs ntfscomp hfsplus fat \
                               ext2 normal chain boot configfile linux
  • 2.3 Create the grub menu grub.cfg
  •             # This is a comment
                echo "Hello from grub.cfg"
    
                menuentry 'Boot From MMC' {
                           devicetree /rtsm_ve-ca15x2.dtb
                           initrd /uInitrd
                           linux /zImage memblock=debug uefi_debug early_ioremap_debug earlyprintk console=ttyAMA0,38400n8 rootwait root=/dev/mmcblk0p2 ext4 ro
                           }
    • 2.4 Build the kernel zImage
      • Pay attention to two key options for kernel:

                2.4.1 CONFIG_VMSPLIT_2G=y
                2.4.2 # CONFIG_STRICT_DEVMEM is not set
  • Then build the kernel ,and generate the zImage.
  • 2.5 Copy the RTSM_VE_CORTEX-A15_MPCORE_EFI.fd / grub.efi / grub.cfg /rtsm_ve-ca15x2.dtb / zImage /dmidecode-2.12.tar.bz2 into /boot partition of MMC image.

3.Validation:

  • 3.1 Run the fast model ,in the end of UEFI ,we choose b to enter Shell

The default boot selection will start in   4 seconds
[1] Linaro image on SD card
        - VenHw(09831032-6FA3-4484-AF4F-0A000A8D3A82)/HD(1,MBR,0x00000000,0x3F,0x19FC0)/uImage
        - Initrd: VenHw(09831032-6FA3-4484-AF4F-0A000A8D3A82)/HD(1,MBR,0x00000000,0x3F,0x19FC0)/uInitrd
        - Arguments: console=ttyAMA0,38400n8 root=/dev/mmcblk0p2 rootwait ro androidboot.console=ttyAMA0 mmci.fmax=12000000
        - FDT: VenHw(09831032-6FA3-4484-AF4F-0A000A8D3A82)/HD(1,MBR,0x00000000,0x3F,0x19FC0)/rtsm\rtsm_ve-ca15x1.dtb
        - LoaderType: Linux kernel with Local FDT
-----------------------
Global FDT Config
        - VenHw(09831032-6FA3-4484-AF4F-0A000A8D3A82)/HD(1,MBR,0x00000000,0x3F,0x19FC0)/rtsm\rtsm_ve-ca15x1.dtb
-----------------------
[a] Boot Manager
[b] Shell
[c] Reboot
[d] Shutdown
Start:
  • 3.2 Start the grub.efi to load the kernel

                Shell> fs0:
                FS0:\> grub.efi
  • choose Boot From MMC
  • 3.3 In the host linux, we decompress dmidecode source, and build it

                tar jxvf dmidecode-2.12.tar.bz2
                cd dmidecode-2.12
                make
  • 3.4 Run the dmidecode to get the SMBIOS data

./dmidecode
# dmidecode 2.12
# SMBIOS entry point at 0xb71df000
SMBIOS 2.7 present.
12 structures occupying 680 bytes.
Table at 0xB71DE000.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
        Vendor: edk2.sourceforge.net
        Version: 20:51:47
        Release Date: Jul 11 2013
        Address: 0xE0000
        Runtime Size: 128 kB
        ROM Size: 8192 kB
        Characteristics:
                PCI is supported
                BIOS is upgradeable
                BIOS shadowing is allowed
                Selectable boot is supported
                ACPI is supported
                Smart battery is supported
                Function key-initiated network boot is supported
                UEFI is supported
        BIOS Revision: 0.1

Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: edk2.sourceforge.net
        Product Name: EmulatorPkg
        Version: 1.0
        Serial Number: System Serial#
        UUID: 25EF0280-EC82-42B0-8FB6-10ADCCC67C02
        Wake-up Type: Power Switch
        SKU Number: System SKU#
        Family: edk2

Handle 0x0002, DMI type 2, 17 bytes
Base Board Information
        Manufacturer: edk2.sourceforge.net
        Product Name: EmulatorPkg
        Version: 1.0
        Serial Number: Base Board Serial#
        Asset Tag: Base Board Asset Tag#
        Features:
                Board is a hosting board
        Location In Chassis: Part Component
        Chassis Handle: 0x0000
        Type: Motherboard
        Contained Object Handles: 0

Handle 0x0003, DMI type 3, 24 bytes
Chassis Information
        Manufacturer: edk2.sourceforge.net
        Type: Laptop
        Lock: Not Present
        Version: EmulatorPkg
        Serial Number: Chassis Board Serial#
        Asset Tag: Chassis Board Asset Tag#
        Boot-up State: Safe
        Power Supply State: Safe
        Thermal State: Safe
        Security Status: None
        OEM Information: 0x00000000
        Height: Unspecified
        Number Of Power Cords: Unspecified
        Contained Elements: 0
        SKU Number: Not Specified

Handle 0x0004, DMI type 4, 42 bytes
Processor Information
        Socket Designation: Socket
        Type: Other
        Family: Other
        Manufacturer: edk2.svn.sourceforge.net
        ID: 00 00 00 00 00 00 00 00
        Version: Emulated Processor
        Voltage: 5.0 V 3.3 V 2.9 V
        External Clock: Unknown
        Max Speed: Unknown
        Current Speed: Unknown
        Status: Populated, Enabled
        Upgrade: Other
        L1 Cache Handle: 0x0000
        L2 Cache Handle: 0x0000
        L3 Cache Handle: 0x0000
        Serial Number: 1.0
        Asset Tag: 1.0
        Part Number: 1.0
        Core Count: 2
        Core Enabled: 2
        Thread Count: 2
        Characteristics: None

Handle 0x0005, DMI type 7, 19 bytes
Cache Information
        Socket Designation: Cache1
        Configuration: Enabled, Socketed, Level 3
        Operational Mode: Write Back
        Location: Internal
        Installed Size: 255 kB
        Maximum Size: 255 kB
        Supported SRAM Types:
                Burst
                Synchronous
        Installed SRAM Type: Burst Synchronous
        Speed: Unknown
        Error Correction Type: Multi-bit ECC
        System Type: Unknown
        Associativity: 2-way Set-associative

Handle 0x0006, DMI type 9, 17 bytes
System Slot Information
        Designation: SD Card
        Type: Other
        Current Usage: Available
        Length: Other
        Characteristics: Unknown
        Bus Address: 0000:00:00.0

Handle 0x0007, DMI type 16, 23 bytes
Physical Memory Array
        Location: System Board Or Motherboard
        Use: System Memory
        Error Correction Type: Unknown
        Maximum Capacity: 4095 PB
        Error Information Handle: Not Provided
        Number Of Devices: 1

Handle 0x0008, DMI type 17, 34 bytes
Memory Device
        Array Handle: 0x0000
        Error Information Handle: Not Provided
        Total Width: Unknown
        Data Width: Unknown
        Size: Unknown
        Form Factor: Unknown
        Set: Unknown
        Locator: OS Virtual Memory
        Bank Locator: malloc
        Type: DRAM
        Type Detail: Unknown
        Speed: Unknown
        Manufacturer: OSV
        Serial Number: Not Specified
        Asset Tag: Not Specified
        Part Number: Not Specified
        Rank: Unknown
        Configured Clock Speed: Unknown

Handle 0x0009, DMI type 19, 31 bytes
Memory Array Mapped Address
        Starting Address: 0x20000000000
        Ending Address: 0x2FFFFFFFFFF
        Range Size: 1 TB
        Physical Array Handle: 0x0000
        Partition Width: 1

Handle 0x000A, DMI type 32, 11 bytes
System Boot Information
        Status: No errors detected

Handle 0xFEFF, DMI type 127, 4 bytes
End Of Table

ARM/UEFI/SMBIOS (last modified 2013-07-23 18:08:07)