From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::443; helo=mail-wr1-x443.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E056921197379 for ; Fri, 14 Dec 2018 15:07:22 -0800 (PST) Received: by mail-wr1-x443.google.com with SMTP id t6so6740718wrr.12 for ; Fri, 14 Dec 2018 15:07:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wlHPe6R1ndS19dHL2pzaFuiFLVoywTI7BdhVAra8TIU=; b=R8dQTM4jfvOYbvSM0U7KHy3jDri1lwOWsZfhWqM96oc/EDFuhqxcZb+I5lMNOjcnsB vMU1rst3CoeicoDXNW1am80yWRyuLJaoA1tuzOCTvMGwy5dMy/91aV3lf20oR2D5tzjG Z1wm3jPxY6DXCkRWIiaKsuo4n+TeK2mX0xr24= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=wlHPe6R1ndS19dHL2pzaFuiFLVoywTI7BdhVAra8TIU=; b=Pd+wgbDKQUr7aeRJ0Yq+6O5pXoXOuUQTmr2IDO51LWWhuu3JuhrmsrCyBeNVTflhga eQ/SkH3DH4l8Ac00r+Ldsvhd5AbBlYdJHpbFt5F1IRbPGQarzzw7be08GUAEr29Luj2H z7h2dno7RY6v3Ss3Bgfkctp4OYk4oapOWCMCS9TZIMj+IOQmZKC/IKfr1zGkyhyP3v8u NmjcW+oawcRrMHL1feOFrHS5v4Go/uTA763E3iEmHg27ZRHGG1Ce01TbVac6wuR8TQj5 sabBCu0zzB092aop0JWTpLspVdiYxu4+Cmifi6uFN8qCq27x6EZSFR2fiF1yzOYyq9dQ YtIw== X-Gm-Message-State: AA+aEWbmVqCdfcchRkk4nTu5QONXnzJ+l3qpFgTrJDSUCipJibfBmcYe uNMGmVCfDnKuXhv0VbDVU7fRK5A6FlE= X-Google-Smtp-Source: AFSGD/WRUlJisgPKkXbyLogAMBwbVL3ichJPwPG4m5/AK5XxMV9FgpJzB6BQTZsziff/OWOvK79XOg== X-Received: by 2002:adf:f3c6:: with SMTP id g6mr3945451wrp.111.1544828840966; Fri, 14 Dec 2018 15:07:20 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id h62sm4532709wmf.11.2018.12.14.15.07.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Dec 2018 15:07:19 -0800 (PST) Date: Fri, 14 Dec 2018 23:07:18 +0000 From: Leif Lindholm To: Chris Co Cc: "edk2-devel@lists.01.org" , Ard Biesheuvel , Michael D Kinney Message-ID: <20181214230718.ghokwf7r6a5yvjm7@bivouac.eciton.net> References: <20180921082542.35768-1-christopher.co@microsoft.com> <20180921082542.35768-24-christopher.co@microsoft.com> MIME-Version: 1.0 In-Reply-To: <20180921082542.35768-24-christopher.co@microsoft.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH edk2-platforms 23/27] Silicon/NXP: Add i.MX6 Smbios Driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2018 23:07:23 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Sep 21, 2018 at 08:26:15AM +0000, Chris Co wrote: > This adds support populating the SMBIOS tables on an i.MX6 SoC. > Platforms just need to define the relevant PCDs in their dsc file and > this driver will fill out the SMBIOS table structures. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Christopher Co > Cc: Ard Biesheuvel > Cc: Leif Lindholm > Cc: Michael D Kinney > --- > Silicon/NXP/iMX6Pkg/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c | 1774 ++++++++++++++++++++ > Silicon/NXP/iMX6Pkg/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.h | 44 + > Silicon/NXP/iMX6Pkg/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf | 84 + > 3 files changed, 1902 insertions(+) > > diff --git a/Silicon/NXP/iMX6Pkg/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c b/Silicon/NXP/iMX6Pkg/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c > new file mode 100644 > index 000000000000..93c56dec254b > --- /dev/null > +++ b/Silicon/NXP/iMX6Pkg/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c > @@ -0,0 +1,1774 @@ > +/** @file > + > + Static SMBIOS Table for the SolidRun HummingBoard-Edge iMX6 Quad platform > + Derived from EmulatorPkg package > + > + Note SMBIOS 2.7.1 Required structures: > + BIOS Information (Type 0) > + System Information (Type 1) > + Board Information (Type 2) > + System Enclosure (Type 3) > + Processor Information (Type 4) - CPU Driver > + Cache Information (Type 7) - For cache that is external to processor > + Physical Memory Array (Type 16) > + Memory Device (Type 17) - For each socketed system-memory Device > + Memory Array Mapped Address (Type 19) - One per contiguous block per Physical Memroy Array > + System Boot Information (Type 32) > + > + Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
> + Copyright (c) 2012, Apple Inc. All rights reserved.
> + Copyright (c) 2015, Linaro Limited. All rights reserved.
> + Copyright (c) 2015, Hisilicon Limited. All rights reserved.
> + Copyright (c) 2015, ARM Limited. All rights reserved. > + Copyright (c) 2018 Microsoft Corporation. All rights reserved. > + > + This program and the accompanying materials > + are licensed and made available under the terms and conditions of the BSD License > + which accompanies this distribution. The full text of the license may be found at > + http://opensource.org/licenses/bsd-license.php > + > + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. > + > +**/ > + > +#include > + > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#include "PlatformSmbiosDxe.h" > + > +// Default SMBIOS Tables for i.MX6 > +SMBIOS_TABLE_TYPE0 mBiosInfoType0 = { > + { > + EFI_SMBIOS_TYPE_BIOS_INFORMATION, > + sizeof (SMBIOS_TABLE_TYPE0), > + SMBIOS_HANDLE_PI_RESERVED > + }, > + 1, // Vendor String > + 2, // BiosVersion String > + 0xE000, // BiosSegment > + 3, // BiosReleaseDate String > + (FixedPcdGet32 (PcdFdSize) - 1) / SIZE_64KB, // BiosSize > + { // BiosCharacteristics > + 0, // Reserved :2; > + 0, // Unknown :1; > + 0, // BiosCharacteristicsNotSupported :1; > + 0, // IsaIsSupported :1; > + 0, // McaIsSupported :1; > + 0, // EisaIsSupported :1; > + 1, // PciIsSupported :1; > + 0, // PcmciaIsSupported :1; > + 0, // PlugAndPlayIsSupported :1; > + 0, // ApmIsSupported :1; > + 1, // BiosIsUpgradable :1; > + 0, // BiosShadowingAllowed :1; > + 0, // VlVesaIsSupported :1; > + 0, // EscdSupportIsAvailable :1; > + 0, // BootFromCdIsSupported :1; > + 1, // SelectableBootIsSupported :1; > + 0, // RomBiosIsSocketed :1; > + 0, // BootFromPcmciaIsSupported :1; > + 0, // EDDSpecificationIsSupported :1; > + 0, // JapaneseNecFloppyIsSupported :1; > + 0, // JapaneseToshibaFloppyIsSupported :1; > + 0, // Floppy525_360IsSupported :1; > + 0, // Floppy525_12IsSupported :1; > + 0, // Floppy35_720IsSupported :1; > + 0, // Floppy35_288IsSupported :1; > + 0, // PrintScreenIsSupported :1; > + 0, // Keyboard8042IsSupported :1; > + 0, // SerialIsSupported :1; > + 0, // PrinterIsSupported :1; > + 0, // CgaMonoIsSupported :1; > + 0, // NecPc98 :1; > + 0 // ReservedForVendor :32; > + }, > + { // BIOSCharacteristicsExtensionBytes[] > + 0x01, // AcpiIsSupported :1; > + // UsbLegacyIsSupported :1; > + // AgpIsSupported :1; > + // I2OBootIsSupported :1; > + // Ls120BootIsSupported :1; > + // AtapiZipDriveBootIsSupported :1; > + // Boot1394IsSupported :1; > + // SmartBatteryIsSupported :1; > + 0x0C, // BiosBootSpecIsSupported :1; > + // FunctionKeyNetworkBootIsSupported :1; > + // TargetContentDistributionEnabled :1; > + // UefiSpecificationSupported :1; > + // VirtualMachineSupported :1; > + // ExtensionByte2Reserved :3; > + }, > + FixedPcdGet32 (PcdFirmwareRevision) >> 16, // SystemBiosMajorRelease > + FixedPcdGet32 (PcdFirmwareRevision) & 0xff, // SystemBiosMinorRelease > + 0xFF, // EmbeddedControllerFirmwareMajorRelease > + 0xFF, // EmbeddedControllerFirmwareMinorRelease > +}; > + > +SMBIOS_TABLE_TYPE1 mSysInfoType1 = { > + { > + EFI_SMBIOS_TYPE_SYSTEM_INFORMATION, > + sizeof (SMBIOS_TABLE_TYPE1), > + SMBIOS_HANDLE_PI_RESERVED > + }, > + 1, // Manufacturer String > + 2, // ProductName String > + 3, // Version String > + 4, // SerialNumber String > + { 0xFFFFFFFF, 0xFFFF, 0xFFFF, { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } }, > + SystemWakeupTypePowerSwitch, // WakeUp Type > + 5, // SKUNumber String > + 6, // Family String > +}; > + > +SMBIOS_TABLE_TYPE2 mBoardInfoType2 = { > + { > + EFI_SMBIOS_TYPE_BASEBOARD_INFORMATION, > + sizeof (SMBIOS_TABLE_TYPE2), > + SMBIOS_HANDLE_BOARD > + }, > + 1, // Manufacturer String > + 2, // ProductName String > + 3, // Version String > + 4, // SerialNumber String > + 5, // AssetTag String > + { // FeatureFlag > + 1, // Motherboard :1; > + 0, // RequiresDaughterCard :1; > + 0, // Removable :1; > + 0, // Replaceable :1; > + 0, // HotSwappable :1; > + 0, // Reserved :3; > + }, > + 6, // LocationInChassis String > + SMBIOS_HANDLE_CHASSIS, // ChassisHandle; > + BaseBoardTypeMotherBoard, // BoardType; > + 1, // NumberOfContainedObjectHandles; > + { SMBIOS_HANDLE_PROCESSOR } // ContainedObjectHandles[1]; > +}; > + > +SMBIOS_TABLE_TYPE3 mEnclosureInfoType3 = { > + { > + EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE, > + sizeof (SMBIOS_TABLE_TYPE3), > + SMBIOS_HANDLE_CHASSIS > + }, > + 1, // Manufacturer String > + MiscChassisTypeOther, // Type; > + 2, // Version String > + 3, // SerialNumber String > + 4, // AssetTag String > + ChassisStateSafe, // BootupState; > + ChassisStateSafe, // PowerSupplyState; > + ChassisStateSafe, // ThermalState; > + ChassisSecurityStatusNone, // SecurityStatus; > + { 0, 0, 0, 0 }, // OemDefined[4]; > + 0, // Height; > + 0, // NumberofPowerCords; > + 0, // ContainedElementCount; > + 0, // ContainedElementRecordLength; > + { { 0 } }, // ContainedElements[1]; > +}; > + > +SMBIOS_TABLE_TYPE4 mProcessorInfoType4 = { > + { > + EFI_SMBIOS_TYPE_PROCESSOR_INFORMATION, > + sizeof (SMBIOS_TABLE_TYPE4), > + SMBIOS_HANDLE_PROCESSOR > + }, > + 1, // Socket String; > + CentralProcessor, // ProcessorType; > + ProcessorFamilyIndicatorFamily2, // ProcessorFamily; > + 2, // ProcessorManufacture String; > + {{0,},{0.}}, // ProcessorId; > + 3, // ProcessorVersion String; > + { // Voltage; > + 1, // ProcessorVoltageCapability5V :1; > + 1, // ProcessorVoltageCapability3_3V :1; > + 1, // ProcessorVoltageCapability2_9V :1; > + 0, // ProcessorVoltageCapabilityReserved :1; > + 0, // ProcessorVoltageReserved :3; > + 0 // ProcessorVoltageIndicateLegacy :1; > + }, > + 0, // ExternalClock; > + 0, // MaxSpeed; > + 0, // CurrentSpeed; > + 0x41, // Status; > + ProcessorUpgradeOther, // ProcessorUpgrade; > + SMBIOS_HANDLE_L1I, // L1CacheHandle; > + SMBIOS_HANDLE_L2U, // L2CacheHandle; > + 0xFFFF, // L3CacheHandle; > + 4, // SerialNumber; > + 5, // AssetTag; > + 6, // PartNumber; > + 0, // CoreCount; > + 0, // EnabledCoreCount; > + 0, // ThreadCount; > + 0, // ProcessorCharacteristics; > + ProcessorFamilyARMv7, // ProcessorFamily2; > +}; > + > +SMBIOS_TABLE_TYPE7 mCacheInfoType7L1I = { > + { > + EFI_SMBIOS_TYPE_CACHE_INFORMATION, > + sizeof (SMBIOS_TABLE_TYPE7), > + SMBIOS_HANDLE_L1I > + }, > + 1, // SocketDesignation String > + 0x0180, // Cache Configuration > + 0x0020, // Maximum Size 32k > + 0x0020, // Install Size 32k > + { // Supported SRAM Type > + 0, //Other :1 > + 0, //Unknown :1 > + 0, //NonBurst :1 > + 1, //Burst :1 > + 0, //PiplelineBurst :1 > + 1, //Synchronous :1 > + 0, //Asynchronous :1 > + 0 //Reserved :9 > + }, > + { // Current SRAM Type > + 0, //Other :1 > + 0, //Unknown :1 > + 0, //NonBurst :1 > + 1, //Burst :1 > + 0, //PiplelineBurst :1 > + 1, //Synchronous :1 > + 0, //Asynchronous :1 > + 0 //Reserved :9 > + }, > + 0, // Cache Speed unknown > + CacheErrorMultiBit, // Error Correction Multi > + CacheTypeInstruction, // System Cache Type > + CacheAssociativity2Way // Associativity > +}; > + > +SMBIOS_TABLE_TYPE7 mCacheInfoType7L1D = { > + { > + EFI_SMBIOS_TYPE_CACHE_INFORMATION, > + sizeof (SMBIOS_TABLE_TYPE7), > + SMBIOS_HANDLE_L1D > + }, > + 1, // SocketDesignation String > + 0x0180, // Cache Configuration > + 0x0020, // Maximum Size 32k > + 0x0020, // Install Size 32k > + { // Supported SRAM Type > + 0, //Other :1 > + 0, //Unknown :1 > + 0, //NonBurst :1 > + 1, //Burst :1 > + 0, //PiplelineBurst :1 > + 1, //Synchronous :1 > + 0, //Asynchronous :1 > + 0 //Reserved :9 > + }, > + { // Current SRAM Type > + 0, //Other :1 > + 0, //Unknown :1 > + 0, //NonBurst :1 > + 1, //Burst :1 > + 0, //PiplelineBurst :1 > + 1, //Synchronous :1 > + 0, //Asynchronous :1 > + 0 //Reserved :9 > + }, > + 0, // Cache Speed unknown > + CacheErrorMultiBit, // Error Correction Multi > + CacheTypeData, // System Cache Type > + CacheAssociativity2Way // Associativity > +}; > + > +SMBIOS_TABLE_TYPE7 mCacheInfoType7L2U = { > + { > + EFI_SMBIOS_TYPE_CACHE_INFORMATION, > + sizeof (SMBIOS_TABLE_TYPE7), > + SMBIOS_HANDLE_L2U > + }, > + 1, // SocketDesignation String > + 0x0181, // Cache Configuration > + 0, // Maximum Size > + 0, // Install Size > + { // Supported SRAM Type > + 0, //Other :1 > + 0, //Unknown :1 > + 0, //NonBurst :1 > + 1, //Burst :1 > + 0, //PiplelineBurst :1 > + 1, //Synchronous :1 > + 0, //Asynchronous :1 > + 0 //Reserved :9 > + }, > + { // Current SRAM Type > + 0, //Other :1 > + 0, //Unknown :1 > + 0, //NonBurst :1 > + 1, //Burst :1 > + 0, //PiplelineBurst :1 > + 1, //Synchronous :1 > + 0, //Asynchronous :1 > + 0 //Reserved :9 > + }, > + 0, // Cache Speed unknown > + CacheErrorMultiBit, // Error Correction Multi > + CacheTypeUnified, // System Cache Type > + CacheAssociativity2Way // Associativity > +}; > + > +SMBIOS_TABLE_TYPE16 mPhysicalMemoryArrayInfoType16 = { > + { > + EFI_SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY, > + sizeof (SMBIOS_TABLE_TYPE16), > + SMBIOS_HANDLE_MEMORY_ARRAY > + }, > + MemoryArrayLocationSystemBoard, // Location; > + MemoryArrayUseSystemMemory, // Use; > + MemoryErrorCorrectionNone, // MemoryErrorCorrection; > + 0x80000000, // MaximumCapacity > + 0xFFFE, // MemoryErrorInformationHandle; > + 1, // NumberOfMemoryDevices; > + 0x80000000ULL, // ExtendedMaximumCapacity > +}; > + > +SMBIOS_TABLE_TYPE17 mMemoryDeviceInfoType17 = { > + { > + EFI_SMBIOS_TYPE_MEMORY_DEVICE, > + sizeof (SMBIOS_TABLE_TYPE17), > + SMBIOS_HANDLE_MEMORY_DEVICE > + }, > + SMBIOS_HANDLE_MEMORY_ARRAY, // MemoryArrayHandle; > + 0xFFFE, // MemoryErrorInformationHandle; > + 0xFFFF, // TotalWidth; > + 0xFFFF, // DataWidth; > + 0xFFFF, // Size; When bit 15 is 0: Size in MB > + // When bit 15 is 1: Size in KB, and continues in ExtendedSize > + MemoryFormFactorRowOfChips, // FormFactor; > + 0, // DeviceSet; > + 1, // DeviceLocator String > + 2, // BankLocator String > + MemoryTypeDdr3, // MemoryType; > + { // TypeDetail; > + 0, // Reserved :1; > + 0, // Other :1; > + 0, // Unknown :1; > + 0, // FastPaged :1; > + 0, // StaticColumn :1; > + 0, // PseudoStatic :1; > + 0, // Rambus :1; > + 0, // Synchronous :1; > + 0, // Cmos :1; > + 0, // Edo :1; > + 0, // WindowDram :1; > + 0, // CacheDram :1; > + 0, // Nonvolatile :1; > + 0, // Registered :1; > + 1, // Unbuffered :1; > + 0, // Reserved1 :1; > + }, > + 0, // Speed; > + 0, // Manufacturer String > + 0, // SerialNumber String > + 0, // AssetTag String > + 0, // PartNumber String > + 0, // Attributes; > + 0, // ExtendedSize; > + 0, // ConfiguredMemoryClockSpeed; > +}; > + > +SMBIOS_TABLE_TYPE19 mMemoryArrayMappedInfoType19 = { > + { > + EFI_SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS, > + sizeof (SMBIOS_TABLE_TYPE19), > + SMBIOS_HANDLE_PI_RESERVED > + }, > + 0xFFFFFFFF, // StartingAddress; > + 0xFFFFFFFF, // EndingAddress; > + SMBIOS_HANDLE_MEMORY_ARRAY, // MemoryArrayHandle; > + 1, // PartitionWidth; > + 0xFFFFFFFF, // ExtendedStartingAddress; > + 0xFFFFFFFF, // ExtendedEndingAddress; > +}; > + > +SMBIOS_TABLE_TYPE32 mBootInfoType32 = { > + { > + EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION, > + sizeof (SMBIOS_TABLE_TYPE32), > + SMBIOS_HANDLE_PI_RESERVED > + }, > + { 0, 0, 0, 0, 0, 0 }, // Reserved[6]; > + BootInformationStatusNoError // BootStatus > +}; > + > +struct MonthDescription { > + CONST CHAR8* MonthStr; > + UINT32 MonthInt; > +} gMonthDescription[] = { > + { "Jan", 1 }, > + { "Feb", 2 }, > + { "Mar", 3 }, > + { "Apr", 4 }, > + { "May", 5 }, > + { "Jun", 6 }, > + { "Jul", 7 }, > + { "Aug", 8 }, > + { "Sep", 9 }, > + { "Oct", 10 }, > + { "Nov", 11 }, > + { "Dec", 12 }, > + { "???", 1 }, // Use 1 as default month > +}; > + > +EFI_STATUS > +LogSmbiosData ( > + IN UINT8 *Buffer, > + IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle > + ) > +{ > + EFI_STATUS Status; > + EFI_SMBIOS_PROTOCOL *Smbios; > + > + *SmbiosHandle = ((EFI_SMBIOS_TABLE_HEADER *)Buffer)->Handle; > + Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID **)&Smbios); > + if (EFI_ERROR (Status)) { > + return Status; > + } > + > + Status = Smbios->Add ( > + Smbios, > + NULL, > + SmbiosHandle, > + (EFI_SMBIOS_TABLE_HEADER *)Buffer > + ); > + > + return Status; > +} > + > +VOID > +GetReleaseTime ( > + EFI_TIME *Time > + ) > +{ > + CONST CHAR8 *ReleaseDate = __DATE__; > + CONST CHAR8 *ReleaseTime = __TIME__; > + UINTN i; > + > + for (i = 0; i < 12; i++) { > + if (0 == AsciiStrnCmp (ReleaseDate, gMonthDescription[i].MonthStr, 3)) { No Jeopardy comparisons, please. > + break; > + } > + } > + Time->Month = gMonthDescription[i].MonthInt; > + Time->Day = AsciiStrDecimalToUintn (ReleaseDate + 4); > + Time->Year = AsciiStrDecimalToUintn (ReleaseDate + 7); > + Time->Hour = AsciiStrDecimalToUintn (ReleaseTime); > + Time->Minute = AsciiStrDecimalToUintn (ReleaseTime + 3); > + Time->Second = AsciiStrDecimalToUintn (ReleaseTime + 6); I'm also not generally a fan of the fixed-position string parsing. Can you add some comments so it's clear which values are being extracted? > + > + return; > +} > + > +UINT64 > +GetImx6SerialNumber ( > + VOID > + ) > +{ > + UINT64 ProcessorSerialNumber; > + > + ProcessorSerialNumber = ((UINT64)MmioRead32 (OCOTP_BANK_0_WORD_2)) << 32; > + ProcessorSerialNumber |=(UINT64)MmioRead32 (OCOTP_BANK_0_WORD_1); Space after =. > + > + DEBUG ((DEBUG_INFO, "iMX6 Serial Number %08X%08Xh \r\n", > + (UINT32) (ProcessorSerialNumber >> 32), (UINT32)ProcessorSerialNumber)); > + return ProcessorSerialNumber; > +} On the whole, another patch that's hard to review manually. Have you run the https://wiki.ubuntu.com/FirmwareTestSuite/ smbios tests? / Leif