From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.92.67.101; helo=eur02-am5-obe.outbound.protection.outlook.com; envelope-from=marvin.haeuser@outlook.com; receiver=edk2-devel@lists.01.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067101.outbound.protection.outlook.com [40.92.67.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1BD3722352287 for ; Tue, 27 Feb 2018 08:43:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=+TjPiVHhaEDNkZLZTk4ZuQzf/y0VQYjsGEQmCtkq6GU=; b=fZ+4o6+uF+4N9+nw9I+ykwk2iZTpg6wGTFv7Y1BocIDseYdYzS1B3QOHZyQgQje0VY+7xNho4S0evRD9zZvB7Wt/eSEEErvGFWIAFIshuRDMp8LpNL2U9H+47dsWOCWmYzPjIpX8ROBoPa2x/+RwY8xWm8j5FO0WkbDpX2onrvpAtOz2PKer240Sc2qo9I+DNkVerxer32mw/eo0T6r2UAfMUvqGcvkACcStPSB2M/O0jh53xBTx4xfOOMpOS3QD+dEdZTgq21udUDW321ovq7ndJqQ3kVFsvZY6OsQulSdicZLyeb0Fd8DG8WDsArF5YAArOFE2FqoqjkBAyR4r0g== Received: from VE1EUR02FT055.eop-EUR02.prod.protection.outlook.com (10.152.12.58) by VE1EUR02HT180.eop-EUR02.prod.protection.outlook.com (10.152.13.194) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.485.12; Tue, 27 Feb 2018 16:49:08 +0000 Received: from AM4PR06MB1491.eurprd06.prod.outlook.com (10.152.12.60) by VE1EUR02FT055.mail.protection.outlook.com (10.152.13.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.15 via Frontend Transport; Tue, 27 Feb 2018 16:49:08 +0000 Received: from AM4PR06MB1491.eurprd06.prod.outlook.com ([fe80::7d81:9d96:1051:d20d]) by AM4PR06MB1491.eurprd06.prod.outlook.com ([fe80::7d81:9d96:1051:d20d%14]) with mapi id 15.20.0527.021; Tue, 27 Feb 2018 16:49:08 +0000 From: =?iso-8859-1?Q?Marvin_H=E4user?= To: "edk2-devel@lists.01.org" CC: "michael.d.kinney@intel.com" , "liming.gao@intel.com" Thread-Topic: [PATCH 1/5] MdePkg/SPI: Change function definitions to match their descriptions. Thread-Index: AQHTr+ri4yU6uX2cBEWXaviTJcNtDg== Date: Tue, 27 Feb 2018 16:49:08 +0000 Message-ID: Accept-Language: de-DE, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:3612EDBE10A8486B6735277E08257EA317E1839233F5E4F25C6ECB3CE8887D67; UpperCasedChecksum:33C5335099E45E6AA2459315A7EB2EE4305145AD84ED6CD88544A304BE6D7FE6; SizeAsReceived:7154; Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [1Bikdq6u+FV0lS7+oh6TaxYNCKMnYbzt] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VE1EUR02HT180; 6:8AG7keLmqtSQYJWtr7IlRkZSpY5ZSwYYqadNHpAUIXksk1yK74OLm7JPcQtU9hcmOu7MQtHHwp2tY2uRJuMs77C4RvG4w/VvATi+dUTmPgP//gFXrHZpKOpiSV0+HUBEoikc5xQhSjbacSixfZ45e0r6sJTm8dFzdQozcj0FGBCPtJLT1GXN09SpJ2hbvEcBu2VI9Il2f8MGVWT1Tz8iJSm9d+myIIx4PD57MrEgbEVC3fIl6m7nwojH3XLO6DjdenNH91rTkXckbH2uoS7Qcm7mB/3cf6jL7JkExNYIpnrpfU2WlFg9N7YXpWzBrFSdCsdOUtkbwFdnbgZLpFJ8GKxq32SFVVSWIZZ/6Mx+7WA=; 5:ta4jNIYRKD/MDKYTUc84i+yIVv0Va+gJ7yXbEPUOdr8Vd8d225rcVa9B45NbEjHFUpdyFPHqiCh49WLFXp3L7YZyUlT/pD1iIIo4DOlMaqlZIpOJpKGOhYwBYHsQT4+hPtH/xlLjAtYN3ikGzagBy07IRhf/Tn6zqEtRcY5R7yM=; 24:CRGWstSiIIQiEhySqpaKQQ857FYM2TiKN+FPyqdFtvy4RiZhvwoz3yFLuXw0FgLHHQu1yGmHDP91fkzvUDGU0BfqOBXJfarAsil/TNQJV1I=; 7:9EA4y3MfdPdsCOzqx8414DlwMfl+IYDgZaolbDAjhAd3phgAMTsOL4vux+qAnHK7NP6HQZsSNGvc8LD/AH8r27AsBPxlBouSLxq/BjlSN8Ecfk155GpXM4NfHIz2CC1U2p96WIadXjGLWV9Ez65I4Xf2MOZIeUnO2XxW4MCmgigQkE6HuCfFSMOSvENtNxwYSVg2whE0S/YVuP9GKLmtvkfpPrO32CgkRvCv099ZLKRD5QSSVFVr/wTtr2TxMQKI x-incomingheadercount: 45 x-eopattributedmessage: 0 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1601125374)(1603101448)(1701031045); SRVR:VE1EUR02HT180; x-ms-traffictypediagnostic: VE1EUR02HT180: x-ms-office365-filtering-correlation-id: 0ee09daf-e0ed-4e4e-7d83-08d57e0204c7 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(444000031); SRVR:VE1EUR02HT180; BCL:0; PCL:0; RULEID:; SRVR:VE1EUR02HT180; x-forefront-prvs: 05961EBAFC x-forefront-antispam-report: SFV:NSPM; SFS:(7070007)(98901004); DIR:OUT; SFP:1901; SCL:1; SRVR:VE1EUR02HT180; H:AM4PR06MB1491.eurprd06.prod.outlook.com; FPR:; SPF:None; LANG:; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0ee09daf-e0ed-4e4e-7d83-08d57e0204c7 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Feb 2018 16:49:08.4104 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR02HT180 Subject: [PATCH 1/5] MdePkg/SPI: Change function definitions to match their descriptions. 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 16:43:08 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable The PI specification is not continuous with function headers and descriptions for the SPI protocols. Correct and comment these mistakes. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marvin Haeuser --- MdePkg/Include/Protocol/SpiConfiguration.h | 12 ++++++++---- MdePkg/Include/Protocol/SpiHc.h | 14 +++++++++----- MdePkg/Include/Protocol/SpiIo.h | 15 ++++++++++----- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/MdePkg/Include/Protocol/SpiConfiguration.h b/MdePkg/Include/Pr= otocol/SpiConfiguration.h index c0df183ec7f0..c36a809f4232 100644 --- a/MdePkg/Include/Protocol/SpiConfiguration.h +++ b/MdePkg/Include/Protocol/SpiConfiguration.h @@ -1,7 +1,7 @@ /** @file This file defines the SPI Configuration Protocol. =20 - Copyright (c) 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the licens= e may @@ -65,6 +65,10 @@ EFI_STATUS IN BOOLEAN PinValue ); =20 +// +// Note: In the PI specification, ClockHz is decorated as only 'IN', which= is +// not conforming to the parameter description. +// /** Set up the clock generator to produce the correct clock frequency, phase= and polarity for a SPI chip. @@ -78,7 +82,7 @@ EFI_STATUS ClockPhase and ClockPolarity fields. The routi= ne also has access to the names for the SPI bus a= nd chip which can be used during debugging. - @param[in] ClockHz Pointer to the requested clock frequency. The = clock + @param[in,out] ClockHz Pointer to the requested clock frequency. The = clock generator will choose a supported clock freque= ncy which is less then or equal to this value. Specify zero to turn the clock generator off. @@ -92,8 +96,8 @@ EFI_STATUS **/ typedef EFI_STATUS (EFIAPI *EFI_SPI_CLOCK) ( - IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral, - IN UINT32 *ClockHz + IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral, + IN OUT UINT32 *ClockHz ); =20 /// diff --git a/MdePkg/Include/Protocol/SpiHc.h b/MdePkg/Include/Protocol/SpiH= c.h index 12fe5d2dce0a..71c75431e4e8 100644 --- a/MdePkg/Include/Protocol/SpiHc.h +++ b/MdePkg/Include/Protocol/SpiHc.h @@ -1,7 +1,7 @@ /** @file This file defines the SPI Host Controller Protocol. =20 - Copyright (c) 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the licens= e may @@ -66,6 +66,10 @@ typedef EFI_STATUS IN BOOLEAN PinValue ); =20 +// +// Note: In the PI specification, ClockHz is decorated as only 'IN', which= is +// not conforming to the parameter description. +// /** Set up the clock generator to produce the correct clock frequency, phase= and polarity for a SPI chip. @@ -80,7 +84,7 @@ typedef EFI_STATUS ClockPhase and ClockPolarity fields. The routi= ne also has access to the names for the SPI bus a= nd chip which can be used during debugging. - @param[in] ClockHz Pointer to the requested clock frequency. The = SPI + @param[in,out] ClockHz Pointer to the requested clock frequency. The = SPI host controller will choose a supported clock frequency which is less then or equal to this value. Specify zero to turn the clock generato= r @@ -94,9 +98,9 @@ typedef EFI_STATUS **/ typedef EFI_STATUS (EFIAPI *EFI_SPI_HC_PROTOCOL_CLOCK) ( - IN CONST EFI_SPI_HC_PROTOCOL *This, - IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral, - IN UINT32 *ClockHz + IN CONST EFI_SPI_HC_PROTOCOL *This, + IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral, + IN OUT UINT32 *ClockHz ); =20 /** diff --git a/MdePkg/Include/Protocol/SpiIo.h b/MdePkg/Include/Protocol/SpiI= o.h index 43e804518f8b..8c5d96bb04b2 100644 --- a/MdePkg/Include/Protocol/SpiIo.h +++ b/MdePkg/Include/Protocol/SpiIo.h @@ -1,7 +1,7 @@ /** @file This file defines the SPI I/O Protocol. =20 - Copyright (c) 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the licens= e may @@ -144,6 +144,11 @@ EFI_STATUS OUT UINT8 *ReadBuffer ); =20 +// +// Note: In the PI specification, 'This' is decorated with 'IN' and 'CONST= '. +// However, 'This' needs to be updated in order to reflect the +// Peripheral update. +// /** Update the SPI peripheral associated with this SPI 10 instance. =20 @@ -152,8 +157,8 @@ EFI_STATUS SPI NOR flash parts, where the size and parameters change depending upon device is in the socket. =20 - @param[in] This Pointer to an EFI_SPI_IO_PROTOCOL structure. - @param[in] SpiPeripheral Pointer to an EFI_SPI_PERIPHERAL structure. + @param[in,out] This Pointer to an EFI_SPI_IO_PROTOCOL structur= e. + @param[in] SpiPeripheral Pointer to an EFI_SPI_PERIPHERAL structure= . =20 @retval EFI_SUCCESS The SPI peripheral was updated successful= ly @retval EFI_INVALID_PARAMETER The SpiPeripheral value is NULL, @@ -165,8 +170,8 @@ EFI_STATUS **/ typedef EFI_STATUS (EFIAPI *EFI_SPI_IO_PROTOCOL_UPDATE_SPI_PERIPHERAL) ( - IN CONST EFI_SPI_IO_PROTOCOL *This, - IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral + IN OUT EFI_SPI_IO_PROTOCOL *This, + IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral ); =20 /// --=20 2.16.0.windows.2