From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::236; helo=mail-wm0-x236.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (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 86CBD21BADAB9 for ; Wed, 8 Aug 2018 02:43:07 -0700 (PDT) Received: by mail-wm0-x236.google.com with SMTP id n11-v6so2066801wmc.2 for ; Wed, 08 Aug 2018 02:43:07 -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=A0wdIMfYP5nbA6qxsnElvBpx2Yz1rddZLSCIZ1xhEGA=; b=Z/058dawKaI4RBnEET5n5dRGiYfwlV2K7F+iCg3NTD1yxjON7gbqLXW8j9Tb0ARMBq 8YxQExWnc8gGPLH0BJXauh9Mgd5efyOAXbI2OakzClYf+t1lnDfGx8JwBrn1CXXPVOqp 3DMXRT3PpBcTZ9qXuZ8GYgjVLEUAxLqa71S1w= 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=A0wdIMfYP5nbA6qxsnElvBpx2Yz1rddZLSCIZ1xhEGA=; b=bWtOEUfDDnIaCvkIB+2vimTIpG8+nc4z8uGgu+TKNJKFwRySFZr/jw+dSt1DLQ9LSX oa+jWalU60TknL4wB/CGJPrTypf0r2RDcaXxuvrALSUgANLxeLsw2PRoCuU9hXI+aP3z aQAtZGE2hfl/06AKGZ4PlwzF/T9bUWPmtrGXjYu9Z0UQ7U9JB3BukIGgKFyRYMF0hQ2X Xk6CXFkfIiuyoWSXLYJz67YAqeSiO9jkw/s6IM5lcU25nUOclSoJZq3QGzZsS/GNyHP3 sLPD39CqNDfPwpswstJMMF7wys3TF54aHb6ZsMBBBcbisHlyGbzj1+DFrGa5LsHOOkg9 qeyA== X-Gm-Message-State: AOUpUlFUYvbDFp2YRc/UVyR1cWoYXg8gkMmypOGZXkmxeKa67WR0WHsq O9sdtHJbS28qmRDtYvppX5BupQ== X-Google-Smtp-Source: AA+uWPwQiQoIDq+rqXkKDvY9hzNLdUO5HY3RzhC8yb8osovn34Kh4ZH+Q7rNghlIXmTA3dFugorVFA== X-Received: by 2002:a1c:1a02:: with SMTP id a2-v6mr1473053wma.52.1533721385738; Wed, 08 Aug 2018 02:43:05 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id b6-v6sm5248846wru.66.2018.08.08.02.43.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Aug 2018 02:43:04 -0700 (PDT) Date: Wed, 8 Aug 2018 10:43:02 +0100 From: Leif Lindholm To: Ming Cc: linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org, graeme.gregory@linaro.org, ard.biesheuvel@linaro.org, guoheyi@huawei.com, wanghuiqiang@huawei.com, huangming23@huawei.com, zhangjinsong2@huawei.com, huangdaode@hisilicon.com, john.garry@huawei.com, xinliang.liu@linaro.org, Heyi Guo Message-ID: <20180808094302.3p35cdaiyrluny7c@bivouac.eciton.net> References: <20180724070922.63362-1-ming.huang@linaro.org> <20180724070922.63362-7-ming.huang@linaro.org> <20180802172241.472liylnkoypx6se@bivouac.eciton.net> <4c257630-9358-c376-0f57-9693039758d5@linaro.org> MIME-Version: 1.0 In-Reply-To: <4c257630-9358-c376-0f57-9693039758d5@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH edk2-platforms v1 06/38] Hisilicon/D06: Add OemMiscLibD06 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 09:43:07 -0000 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Wed, Aug 08, 2018 at 11:49:41AM +0800, Ming wrote: > > 在 8/3/2018 1:22 AM, Leif Lindholm 写道: > > On Tue, Jul 24, 2018 at 03:08:50PM +0800, Ming Huang wrote: > >> This library include BoardFeatureD06.c and OemMiscLibD06.c c file, > >> use for several modules like PciHostBridgeLib and Smbios. > >> Enlarge macro PCIEDEVICE_REPORT_MAX for D06. > >> > >> Contributed-under: TianoCore Contribution Agreement 1.1 > >> Signed-off-by: Ming Huang > >> Signed-off-by: Heyi Guo > >> --- > >> Platform/Hisilicon/D06/D06.dsc | 1 + > >> Platform/Hisilicon/D06/Library/OemMiscLibD06/BoardFeatureD06.c | 432 ++++++++++++++++++++ > >> Platform/Hisilicon/D06/Library/OemMiscLibD06/BoardFeatureD06Strings.uni | Bin 0 -> 5204 bytes > > > > We appear to be permitting UTF-8 these days, which would be easier to > > review. Would you be able to convert this for the next revision? > > Yes. > Could you tell me how to convert the .uni to UTF8? iconv -f UCS2 -t UTF-8 -o At my end, I think this leaves the BOM in the file, which I don't think it a good thing. But it can easily be edited out. Doing that, I do however spot that there are inconsistent line endings in this file. Please convert them all to CRLF. > >> Platform/Hisilicon/D06/Library/OemMiscLibD06/OemMiscLibD06.c | 157 +++++++ > >> Platform/Hisilicon/D06/Library/OemMiscLibD06/OemMiscLibD06.inf | 47 +++ > >> Silicon/Hisilicon/Include/Library/OemMiscLib.h | 2 +- > >> 6 files changed, 638 insertions(+), 1 deletion(-) > >> > >> diff --git a/Platform/Hisilicon/D06/Library/OemMiscLibD06/BoardFeatureD06Strings.uni b/Platform/Hisilicon/D06/Library/OemMiscLibD06/BoardFeatureD06Strings.uni > >> new file mode 100644 > >> index 0000000000..f3994d9d4d > >> Binary files /dev/null and b/Platform/Hisilicon/D06/Library/OemMiscLibD06/BoardFeatureD06Strings.uni differ > >> diff --git a/Platform/Hisilicon/D06/Library/OemMiscLibD06/OemMiscLibD06.c b/Platform/Hisilicon/D06/Library/OemMiscLibD06/OemMiscLibD06.c > >> new file mode 100644 > >> index 0000000000..009a53b2c8 > >> --- /dev/null > >> +++ b/Platform/Hisilicon/D06/Library/OemMiscLibD06/OemMiscLibD06.c > >> @@ -0,0 +1,157 @@ > >> +/** @file > >> +* > >> +* Copyright (c) 2018, Hisilicon Limited. All rights reserved. > >> +* Copyright (c) 2018, Linaro Limited. 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 > >> + > >> +REPORT_PCIEDIDVID2BMC PcieDeviceToReport[PCIEDEVICE_REPORT_MAX] = { > >> + {67,0,0,0}, > >> + {225,0,0,3}, > >> + {0xFFFF,0xFFFF,0xFFFF,0xFFFF}, > >> + {0xFFFF,0xFFFF,0xFFFF,0xFFFF} > >> +}; > >> + > >> +// Right now we only support 1P > >> +BOOLEAN > >> +OemIsSocketPresent ( > >> + UINTN Socket > >> + ) > >> +{ > >> + UINT32 SocketMask = PcdGet32 (PcdSocketMask); > >> + return (BOOLEAN)((SocketMask & (1 << Socket)) ? TRUE : FALSE); > >> +} > >> + > >> + > >> +UINTN > >> +OemGetSocketNumber ( > >> + VOID > >> + ) > >> +{ > >> + if(!OemIsMpBoot ()) { > >> + return 1; > >> + } > >> + > >> + return 2; > > > > What is 2? > > (Guessing NUMBER_PROCESSOR_SOCKETS.) > > > > Exactly. > Modify 2 to MAX_SOCKET(defined in PlatformArch.h)? MAX_PROCESSOR_SOCKETS would be good. > >> +} > >> + > >> + > >> +UINTN > >> +OemGetDdrChannel ( > >> + VOID > >> + ) > >> +{ > >> + return 8; > > > > What is 8? > > (Guessing NUMBER_MEMORY_CHANNELS.) > > > > Exactly. > Modify 8 to MAX_CHANNEL(defined in PlatformArch.h)? MAX_MEMORY_CHANNELS would be good. > >> +} > >> + > >> + > >> +UINTN > >> +OemGetDimmSlot ( > >> + UINTN Socket, > >> + UINTN Channel > >> + ) > >> +{ > >> + return 2; > > > > What is 2? > > (Guessing SLOTS_PER_DDR_CHANNEL.) > > > > Yes. > Modify 8 to MAX_DIMM(defined in PlatformArch.h)? MAX_DIMM_PER_CHANNEL? > >> diff --git a/Silicon/Hisilicon/Include/Library/OemMiscLib.h b/Silicon/Hisilicon/Include/Library/OemMiscLib.h > >> index 6f18c0fa72..53e7a37a68 100644 > >> --- a/Silicon/Hisilicon/Include/Library/OemMiscLib.h > >> +++ b/Silicon/Hisilicon/Include/Library/OemMiscLib.h > >> @@ -22,7 +22,7 @@ > >> #include > >> #include > >> > >> -#define PCIEDEVICE_REPORT_MAX 4 > >> +#define PCIEDEVICE_REPORT_MAX 8 > > > > Does this have any impact on existing platforms? > > Boot-time? > > > > This have no impact on existing platform, just enlarge the > global array. This is used for SMBIOS. OK, that's fine then. / Leif