From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) by mx.groups.io with SMTP id smtpd.web11.1674.1570807284679336639 for ; Fri, 11 Oct 2019 08:21:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=fSBaUA+C; spf=none, err=SPF record not found (domain: semihalf.com, ip: 209.85.208.180, mailfrom: mw@semihalf.com) Received: by mail-lj1-f180.google.com with SMTP id y23so10184766lje.9 for ; Fri, 11 Oct 2019 08:21:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IuXDs6J1t+125t7T3ZSvXIb4ShaNqXAFmE1IhX0LPpg=; b=fSBaUA+CfrIJdsrgOa6IKpa+DLSig7M2pyjBoYdZXcIhWRvlJ+M7TGtJS5wo56/u1g zF8ShD+FwQ+JPiAxWXeFUytklj4HQWsTSUnaI5/xAVIeriaGWipw8Id4KcWF6P2ib7ij 9Ri8beRcAN/kaHkkFc1UtiZASw9LmkDvlSGagWN1YCAw6NDYCIr1hOsEMrb+8CeChsYI hOPkOofML04r9dAsyWY1JT2s0vB7+BhxY95YK/5/pNSHDr95NMLirAJzYafqWPrXXYYB w4cbrqNiUzzCGGbrh/VmlwQ7ufrAZ1tEk4H69pSSIxV6MtVPthXcQC161ci2xKWFPU9k +qjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IuXDs6J1t+125t7T3ZSvXIb4ShaNqXAFmE1IhX0LPpg=; b=iywHXrz8HaveJqH8j3LI3yyqdj+9JpLi0prxlJaehlMd56s/lGVIh8SnMHmt4nZMhL BlmgUziMHPMQvWm8S/3uJlkjwo1Dyyvk7ryVeaRxeb6l8mInJaQfkQGN44Td4rIagUxT P6hul0Y/+LREE3rSPEdN41zVuO91LeBmQifJTYKKDw+dvQpa/YeZ5h9yCGpPED8I6uZc zk1rrIx6UwYMhoJTjrwA5BNRuGGMAyUgDA1C8Z0O7dpzOpjFv9QGcqVJD41t7Axt/l4j MHebxpXnjmX+PScNXPUh6NHSHQRNZ0OiLhNldzvOZkHAn7Pzevlv9zB6u2+PwWTMpQdo J8Lw== X-Gm-Message-State: APjAAAWzcaBzJ9eRRP4q/E39qg6CReYJ03AY6QVaK2oz4ARQlrHGOb1O WmN+WzrlyNQw4Y++FqArU+GItWA4ZcOKiA== X-Google-Smtp-Source: APXvYqxc4JL1S1auzsVK2pDxQj2q9+JGEAuCaP/TD3Eyck3ubTdyDR+Sup7n9hiQuMtsPhvGJlCytw== X-Received: by 2002:a2e:6e18:: with SMTP id j24mr3024106ljc.57.1570807282608; Fri, 11 Oct 2019 08:21:22 -0700 (PDT) Return-Path: Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id y4sm2058939ljd.82.2019.10.11.08.21.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Oct 2019 08:21:21 -0700 (PDT) From: "Marcin Wojtas" To: devel@edk2.groups.io Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, mw@semihalf.com, jsd@semihalf.com, jaz@semihalf.com, kostap@marvell.com, Patryk Duda Subject: [edk2-platforms: PATCH v4 8/9] Marvell/Drivers: SmbiosPlatformDxe: Load SMBIOS strings from PCD Date: Fri, 11 Oct 2019 17:20:30 +0200 Message-Id: <1570807231-4155-9-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1570807231-4155-1-git-send-email-mw@semihalf.com> References: <1570807231-4155-1-git-send-email-mw@semihalf.com> From: Patryk Duda This patch implements convenient way of changing strings included in SMBIOS Table1, Table2, Table3. Strings can be altered by defining following PCDs: gMarvellTokenSpaceGuid.PcdProductManufacturer gMarvellTokenSpaceGuid.PcdProductPlatformName gMarvellTokenSpaceGuid.PcdProductSerial gMarvellTokenSpaceGuid.PcdProductVersion Signed-off-by: Patryk Duda --- Silicon/Marvell/Marvell.dec | 6 ++++++ Silicon/Marvell/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf | 4 ++++ Silicon/Marvell/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c | 22 ++++++++++---------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Silicon/Marvell/Marvell.dec b/Silicon/Marvell/Marvell.dec index d337d3e..cdf8154 100644 --- a/Silicon/Marvell/Marvell.dec +++ b/Silicon/Marvell/Marvell.dec @@ -169,6 +169,12 @@ gMarvellTokenSpaceGuid.PcdPciEAhci|{ 0x0 }|VOID*|0x3000034 gMarvellTokenSpaceGuid.PcdPciESdhci|{ 0x0 }|VOID*|0x3000035 +#Platform description + gMarvellTokenSpaceGuid.PcdProductManufacturer|"Marvell"|VOID*|0x50000100 + gMarvellTokenSpaceGuid.PcdProductPlatformName|"Marvell Development Board"|VOID*|0x50000101 + gMarvellTokenSpaceGuid.PcdProductSerial|"Serial Not Set"|VOID*|0x50000103 + gMarvellTokenSpaceGuid.PcdProductVersion|"Revision unknown"|VOID*|0x50000102 + #RTC gMarvellTokenSpaceGuid.PcdRtcBaseAddress|0x0|UINT64|0x40000052 diff --git a/Silicon/Marvell/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf b/Silicon/Marvell/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf index 8b4586c..7722146 100644 --- a/Silicon/Marvell/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf +++ b/Silicon/Marvell/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf @@ -36,6 +36,10 @@ [FixedPcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision + gMarvellTokenSpaceGuid.PcdProductManufacturer + gMarvellTokenSpaceGuid.PcdProductPlatformName + gMarvellTokenSpaceGuid.PcdProductSerial + gMarvellTokenSpaceGuid.PcdProductVersion [Protocols] gEfiSmbiosProtocolGuid # PROTOCOL ALWAYS_CONSUMED diff --git a/Silicon/Marvell/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c b/Silicon/Marvell/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c index 08f4fa7..d29478c 100644 --- a/Silicon/Marvell/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c +++ b/Silicon/Marvell/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c @@ -101,10 +101,10 @@ STATIC SMBIOS_TABLE_TYPE1 mArmadaDefaultType1 = { }; STATIC CHAR8 CONST *mArmadaDefaultType1Strings[] = { - "Marvell \0",/* Manufacturer */ - "Armada 7k/8k Family Board \0",/* Product Name placeholder*/ - "Revision unknown \0",/* Version placeholder */ - " \0",/* 32 character buffer */ + (CHAR8 *)PcdGetPtr (PcdProductManufacturer), + (CHAR8 *)PcdGetPtr (PcdProductPlatformName), + (CHAR8 *)PcdGetPtr (PcdProductVersion), + (CHAR8 *)PcdGetPtr (PcdProductSerial), NULL }; @@ -129,10 +129,10 @@ STATIC SMBIOS_TABLE_TYPE2 mArmadaDefaultType2 = { }; STATIC CHAR8 CONST *mArmadaDefaultType2Strings[] = { - "Marvell \0",/* Manufacturer */ - "Armada 7k/8k Family Board \0",/* Product Name placeholder*/ - "Revision unknown \0",/* Version placeholder */ - "Serial Not Set \0",/* Serial */ + (CHAR8 *)PcdGetPtr (PcdProductManufacturer), + (CHAR8 *)PcdGetPtr (PcdProductPlatformName), + (CHAR8 *)PcdGetPtr (PcdProductVersion), + (CHAR8 *)PcdGetPtr (PcdProductSerial), "Base of Chassis \0",/* Board location */ NULL }; @@ -160,9 +160,9 @@ STATIC SMBIOS_TABLE_TYPE3 mArmadaDefaultType3 = { }; STATIC CHAR8 CONST *mArmadaDefaultType3Strings[] = { - "Marvell \0",/* Manufacturer placeholder */ - "Revision unknown \0",/* Version placeholder */ - "Serial Not Set \0",/* Serial placeholder */ + (CHAR8 *)PcdGetPtr (PcdProductManufacturer), + (CHAR8 *)PcdGetPtr (PcdProductVersion), + (CHAR8 *)PcdGetPtr (PcdProductSerial), NULL }; -- 2.7.4