From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by mx.groups.io with SMTP id smtpd.web10.1352.1571042590832198950 for ; Mon, 14 Oct 2019 01:43:11 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=myoIWbMF; spf=pass (domain: linaro.org, ip: 209.85.128.66, mailfrom: leif.lindholm@linaro.org) Received: by mail-wm1-f66.google.com with SMTP id 5so16310310wmg.0 for ; Mon, 14 Oct 2019 01:43:10 -0700 (PDT) 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:content-transfer-encoding:in-reply-to :user-agent; bh=0QoBBfTwX/JiQNEvNnySTKQBru5A52PMJiKrMw0MlGc=; b=myoIWbMFXFt56lehqmFU0xsYWkMW1BfSme3zlQDJ8vqJ6I/ui1I0NPbmL+O6Q8PPXN lQYhG2jyIOxflCMlXA+Oejab4g2X4U3mOqvA8L/o780YD9jXaDYZNwXaLQ2GQBR0GqiI 2gmqDNd5FKB0x0rb7z1biI3WX9duZoYSzzTLBRdIRlvpNOXlZ8e50xJGjM0V1JvgjGqm NOIkXDmn3sZ/aYvM1ZtQ0dYkEv7Aov3gqOUMg9grKMHECVGPjkJ3z3av5HW5IuIHFl40 BtJ3WlkNlvhw01B9XigmWvCNGdGjRFVdHlZbn1IkQeaLydprBkIM6EKZyLdGPZeNPqbj PA0w== 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:content-transfer-encoding :in-reply-to:user-agent; bh=0QoBBfTwX/JiQNEvNnySTKQBru5A52PMJiKrMw0MlGc=; b=q7PeC027ykn5C362FZHu8v6voF9465z+Zi8oH/dnJzHa2ju7eGTJECZ568d9ejCxKM h4i25fOXjPRTKD8QgIQZKa0NekIZd/0gRCWyOH2CkNDdyBKlg4cMb/v2QGfZnN+bqQcr SHAx/uPEQuYdbO63tE9FoS1xQCdjoR+WddiHZlMCHj2loTYDt+sR4orxabJOd3FKtYyr PZymkkKcP4+gCs/4+hvLfKtWTvhlGW5ohfLIhI0xQRJWmD3SIp8ajbJ2L9IK95TKu5ey uIiWDFNTPkz21bZg/tZYsk+IjT8K5WOFdNCGxRsFxfEvwIvyW8FqQwRCcTDr6ZsTEnvD btew== X-Gm-Message-State: APjAAAWr3yddd2ppen4QqPb+Y067eqYyYoDnIyB/HqFKySktWfYfhvvM JC26vGeeQC1JmGm+Fka3nSmzXg== X-Google-Smtp-Source: APXvYqyGfV8f4KPBHYaP40z9k+Zhd78sXooHhlkQrBE+RRaTlBGFZAUSarFyvj8coJjebUi1pXQRng== X-Received: by 2002:a1c:e48a:: with SMTP id b132mr14581913wmh.13.1571042589173; Mon, 14 Oct 2019 01:43:09 -0700 (PDT) Return-Path: Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id y3sm32292144wmg.2.2019.10.14.01.43.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2019 01:43:08 -0700 (PDT) Date: Mon, 14 Oct 2019 09:43:07 +0100 From: "Leif Lindholm" To: Marcin Wojtas Cc: devel@edk2.groups.io, ard.biesheuvel@linaro.org, jsd@semihalf.com, jaz@semihalf.com, kostap@marvell.com, Patryk Duda Subject: Re: [edk2-platforms: PATCH v4 8/9] Marvell/Drivers: SmbiosPlatformDxe: Load SMBIOS strings from PCD Message-ID: <20191014084306.GA25504@bivouac.eciton.net> References: <1570807231-4155-1-git-send-email-mw@semihalf.com> <1570807231-4155-9-git-send-email-mw@semihalf.com> MIME-Version: 1.0 In-Reply-To: <1570807231-4155-9-git-send-email-mw@semihalf.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Fri, Oct 11, 2019 at 05:20:30PM +0200, Marcin Wojtas wrote: > 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), These really ought to be (CONST CHAR8 *), as the compiler informs you if dropping the cast altogether: pointer targets in initialization of ‘const CHAR8 *’ {aka ‘const char *’} from ‘const UINT8 *’ {aka ‘const unsigned char *’} differ in signedness The build error without the cast is related to the type the pointer is pointing to (UINT8), not the const attribute. This would fail if we started building with clang -Weverything, or ecplicitly with -Wcast-qual: error: cast from 'const unsigned char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual] Could you resubmit a version of this patch addressing only this concern, throughout? Best Regards, Leif > 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 >