From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 31A2C20955F2B for ; Mon, 26 Feb 2018 21:18:56 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Feb 2018 21:25:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,398,1515484800"; d="scan'208";a="33082174" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga004.fm.intel.com with ESMTP; 26 Feb 2018 21:25:02 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 26 Feb 2018 21:25:02 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.125]) by shsmsx102.ccr.corp.intel.com ([169.254.2.124]) with mapi id 14.03.0319.002; Tue, 27 Feb 2018 13:25:00 +0800 From: "Ni, Ruiyu" To: Ming Huang , "leif.lindholm@linaro.org" , "linaro-uefi@lists.linaro.org" , "edk2-devel@lists.01.org" , "graeme.gregory@linaro.org" , "Zeng, Star" , "Dong, Eric" CC: "huangming23@huawei.com" , "ard.biesheuvel@linaro.org" , "Gao, Liming" , "mengfanrong@huawei.com" , "guoheyi@huawei.com" , "zhangjinsong2@huawei.com" , "Kinney, Michael D" , "waip23@126.com" , "wanghuiqiang@huawei.com" , "huangdaode@hisilicon.com" Thread-Topic: [edk2] [RFC v1 1/1] MdeModulePkg/Usb: Use Pcd for UsbBootIoBlocks Thread-Index: AQHTrVIVa0Fxc8yeOkKjANLutBVdZqO3u/HA Date: Tue, 27 Feb 2018 05:25:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BBC26C6@SHSMSX104.ccr.corp.intel.com> References: <1519464575-38109-1-git-send-email-ming.huang@linaro.org> <1519464575-38109-2-git-send-email-ming.huang@linaro.org> In-Reply-To: <1519464575-38109-2-git-send-email-ming.huang@linaro.org> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [RFC v1 1/1] MdeModulePkg/Usb: Use Pcd for UsbBootIoBlocks X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 05:18:57 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I don't prefer to add PCD, unless we cannot find: 1. spec content to describe the max/min blocks 2. error handling when the blocks number is bigger than HW expects. Thanks/Ray > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Ming Huang > Sent: Saturday, February 24, 2018 5:30 PM > To: leif.lindholm@linaro.org; linaro-uefi@lists.linaro.org; edk2- > devel@lists.01.org; graeme.gregory@linaro.org; Zeng, Star > ; Dong, Eric > Cc: huangming23@huawei.com; ard.biesheuvel@linaro.org; Ming Huang > ; Gao, Liming ; > mengfanrong@huawei.com; guoheyi@huawei.com; > zhangjinsong2@huawei.com; Kinney, Michael D > ; waip23@126.com; > wanghuiqiang@huawei.com; huangdaode@hisilicon.com > Subject: [edk2] [RFC v1 1/1] MdeModulePkg/Usb: Use Pcd for > UsbBootIoBlocks >=20 > Booting from USB may fail while the macro USB_BOOT_IO_BLOCKS set to 128 > because 128 blocks is exceeded the maximun blocks of some USB > devices,like some virtual CD-ROM from BMC. So, give a chance to set the > value of USB_BOOT_IO_BLOCKS by adding a Pcd. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ming Huang > --- > MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h | 7 > +++++-- > MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf | 4 > ++++ > MdeModulePkg/MdeModulePkg.dec | 4 ++++ > MdeModulePkg/MdeModulePkg.uni | 4 ++++ > 4 files changed, 17 insertions(+), 2 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h > b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h > index 5ee50ac52a21..ca9240adbd5f 100644 > --- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h > +++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h > @@ -16,6 +16,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY > KIND, EITHER EXPRESS OR IMPLIED. > #ifndef _EFI_USB_MASS_BOOT_H_ > #define _EFI_USB_MASS_BOOT_H_ >=20 > +#include > + > // > // The opcodes of various USB boot commands: > // INQUIRY/REQUEST_SENSE are "No Timeout Commands" as specified @@ > -66,9 +68,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY > KIND, EITHER EXPRESS OR IMPLIED. > #define USB_PDT_SIMPLE_DIRECT 0x0E ///< Simplified direc= t access > device >=20 > // > -// Other parameters, Max carried size is 512B * 128 =3D 64KB > +// Other parameters, Max carried size is depanded on Pcd. > +// The default of PcdUsbBootIoBlocks is 128. 512B * 128 =3D 64KB > // > -#define USB_BOOT_IO_BLOCKS 128 > +#define USB_BOOT_IO_BLOCKS (FixedPcdGet32 > (PcdUsbBootIoBlocks)) >=20 > // > // Retry mass command times, set by experience diff --git > a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf > b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf > index 26d15c7679bf..40426512f884 100644 > --- > a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf > +++ > b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf > @@ -60,6 +60,7 @@ [Sources] > UsbMassDiskInfo.c >=20 > [Packages] > + MdeModulePkg/MdeModulePkg.dec > MdePkg/MdePkg.dec >=20 > [LibraryClasses] > @@ -83,5 +84,8 @@ [Protocols] > # EVENT_TYPE_RELATIVE_TIMER ## CONSUMES > # >=20 > +[FixedPcd] > + gEfiMdeModulePkgTokenSpaceGuid.PcdUsbBootIoBlocks > + > [UserExtensions.TianoCore."ExtraFiles"] > UsbMassStorageDxeExtra.uni > diff --git a/MdeModulePkg/MdeModulePkg.dec > b/MdeModulePkg/MdeModulePkg.dec index 455979386e3f..fc40745315a0 > 100644 > --- a/MdeModulePkg/MdeModulePkg.dec > +++ b/MdeModulePkg/MdeModulePkg.dec > @@ -999,6 +999,10 @@ [PcdsFixedAtBuild] > # @Prompt Enable UEFI Stack Guard. >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard|FALSE|BOOLEAN|0 > x30001055 >=20 > +## The Max blocks of usb transfer. The default is 128. > +# @Prompt The Max blocks of usb transfer > +gEfiMdeModulePkgTokenSpaceGuid.PcdUsbBootIoBlocks|128|UINT32|0x0 > 000010B > + > [PcdsFixedAtBuild, PcdsPatchableInModule] > ## Dynamic type PCD can be registered callback function for Pcd settin= g > action. > # PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum > number of callback function diff --git a/MdeModulePkg/MdeModulePkg.uni > b/MdeModulePkg/MdeModulePkg.uni index f3fa616438b0..c996d6b4ebe0 > 100644 > --- a/MdeModulePkg/MdeModulePkg.uni > +++ b/MdeModulePkg/MdeModulePkg.uni > @@ -1243,3 +1243,7 @@ > #string > STR_gEfiMdeModulePkgTokenSpaceGuid_PcdEdkiiFpdtStringRecordEnableO > nly_HELP #language en-US "Control which FPDT record format will be use= d > to store the performance entry.\n" > = "On TRUE, the string FPDT > record will be used to store every performance entry.\n" > = "On FALSE, the different > FPDT record will be used to store the different performance entries." > + > +#string > STR_gEfiMdeModulePkgTokenSpaceGuid_PcdUsbBootIoBlocks_PROMPT > #language en-US "The Max blocks of usb transfer." > + > +#string > STR_gEfiMdeModulePkgTokenSpaceGuid_PcdUsbBootIoBlocks_HELP > #language en-US "The Max blocks of usb transfer. The default is 128." > -- > 1.9.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel