From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.115]) by mx.groups.io with SMTP id smtpd.web10.4511.1634882190020992863 for ; Thu, 21 Oct 2021 22:56:31 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=fA34GNe0; spf=pass (domain: os.amperecomputing.com, ip: 40.107.237.115, mailfrom: vunguyen@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MSZw/B+LjeTDi4cJYA4Dv1qWp5jhk4DW/Fl0/nl6OaJjBvqyz/M0QKi9mB0gHIAIGOGAtB4Am5ZbSXcsNQH7YiQm+u6Uf3s5zw2KfcKDPGTP1Q4ho7K59d1kU/ecvUyrnBHYx0Bdkk+e4+JYmUtLfHSWktzHZfH0nQ1Kvm3FojHvxtV0mwqIsyfAYojrilIUyTeacLLDFCBTZIC/vP/PPM2WJra7UtYZnHRMZ3MoHYYdY9aNQrYrXWskIBC7IH3B5bEGmOyKwxyY/jl3BWdb574UQoWiuVl4xlGrHIqYnak6eoOJ0UtBkwAGDD4duLfi9SxMYtqXE27+Tzgigl9gqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yNoFVrPNlREg1ltGlH08oj3P+GHeHARgiVBY5GaRTXQ=; b=hD45Aq4yUD1Vs4tTiPIu+RT5cyxtCSzL0i12uqU9Z/UAEPlICCKOvHbS9Q0R5m7oZ3xsDP0Gmn7g94bnK7TJLV0O5tdcbQw3MUoeHrZMc40NubicjsqZmTj2eLwUGuSPCs4XMKZWqSjpAYdEFPlvph2ZSgCpoffQnk1xKHAUPK+y/LI6BeYyrJngIVdbBkQWduMX+GZVOZoKsnL8CNWeWWWJ5hE7IUqePQ/bsH7Z6RSBngoHXhtGSvAhr1Van4TFApOByxWlGC6w2G3XjPhpo7KkT6fC+5xFtLF8UBPmH0RqTLtMUDKpbOhd3r0f0nlQNJD1/VWho1AziPoCPlg+3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yNoFVrPNlREg1ltGlH08oj3P+GHeHARgiVBY5GaRTXQ=; b=fA34GNe0tuARiL/vUYyXdt5p8hvnpKtg2PaJXC/mO51CBEQe+zw/JKykoyVruCsMBYYXuKBxIgNzmqpgoPLS1D6+WIMZVgqhMTSBg+2iVpT/Z80q1nalUvT//S4c4j2ucYqIlVoFCxE0MQMuP3Xz4xvZ6AtgKEWBC+Re7Wss8DU= Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=os.amperecomputing.com; Received: from SJ0PR01MB7330.prod.exchangelabs.com (2603:10b6:a03:3f6::23) by BYAPR01MB5368.prod.exchangelabs.com (2603:10b6:a03:126::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.18; Fri, 22 Oct 2021 05:56:28 +0000 Received: from SJ0PR01MB7330.prod.exchangelabs.com ([fe80::c519:edc4:3d72:8b99]) by SJ0PR01MB7330.prod.exchangelabs.com ([fe80::c519:edc4:3d72:8b99%6]) with mapi id 15.20.4628.018; Fri, 22 Oct 2021 05:56:28 +0000 From: "Vu Nguyen" To: devel@edk2.groups.io Cc: patches@amperecomputing.com, Vu Nguyen , Thang Nguyen , Chuong Tran , Phong Vo , Leif Lindholm , Michael D Kinney , Ard Biesheuvel , Nate DeSimone Subject: [edk2-non-osi][PATCH v4 1/2] AmpereAltraBinPkg: Add PciePhyLib library Date: Fri, 22 Oct 2021 12:56:03 +0700 Message-Id: <20211022055604.19500-2-vunguyen@os.amperecomputing.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211022055604.19500-1-vunguyen@os.amperecomputing.com> References: <20211022055604.19500-1-vunguyen@os.amperecomputing.com> X-ClientProxiedBy: HK2PR02CA0169.apcprd02.prod.outlook.com (2603:1096:201:1f::29) To SJ0PR01MB7330.prod.exchangelabs.com (2603:10b6:a03:3f6::23) Return-Path: vunguyen@os.amperecomputing.com MIME-Version: 1.0 Received: from sw003.amperecomputing.com (118.69.219.201) by HK2PR02CA0169.apcprd02.prod.outlook.com (2603:1096:201:1f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16 via Frontend Transport; Fri, 22 Oct 2021 05:56:25 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a40bc405-67d6-4a21-451d-08d99520b060 X-MS-TrafficTypeDiagnostic: BYAPR01MB5368: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cVMTobMcT6qXrhzHyIf4xU4iEv91r7pmIBSb777DZXqsYC/PVB9fjVECUVsPBeQ/R4UBwAL//2cQKOg5iosAqt/EwfPUB3aKAlh5PoNGJNgMjX9mIxJEFTzc9VjwFvfPRhJtuw2EfcW4GdbHXxGcrbagWif5pvm9bocsogJy5N6ipFwVuls1JzITxcWzyIlBZ10+ohrbgF03VJjYZtXTEZrLFHd7Pm/D/1MiKMijyPURRZfkJirK+Pl02hhBFQ43IQLTcZQ2pDlKr9dKylRui71+13I1ZyTnZo1k/RUNIQhDUKV1Z22N3R6R0XLx0DtSRBEF4AIDvCdEk9XFcweqV55XdFUB61BZrKu7W94Cpt4UYXC8z+s02LLzmPBSYzBz2u7djNDNLQqSeohexg/oBZ9atHWE5KAoU03jwSFJYD2bGC1aIVVDt2evQDDoLyZkeyYnT8DjaOXyBgthPnBo4ZzRylxMumpqUu4dH+kbGyl9b0uhi6XEMWdg/ALIS/w7MJOIDQOsc+4GQm1ve+YAucdeG2F0zpJLiPjA/B4xJCRtgzrVOFSIpV7hSm+6mJyKuY5D7GJNl3meQMvnjPyYxvaTcYPzqO2I2I/OyEAtHKtV4jaGPhGN9QIDLAlHRr6eiyAoXbmm2X+mHFlek324yQhSFOZVDNzpCxD8r7dWx+QXIujbgCfu7fjlh71mFSsk/vFnfxGnIsl/4MNNtNA9Vg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR01MB7330.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(38100700002)(38350700002)(316002)(4326008)(66946007)(52116002)(86362001)(54906003)(66476007)(83380400001)(26005)(956004)(6916009)(6486002)(6666004)(2906002)(508600001)(1076003)(2616005)(6512007)(8936002)(5660300002)(8676002)(6506007)(66556008)(186003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?3Y503AOVyNpqqzUJ3cac4fhzGAX4fMapV5/ud2htomjKHzP1Bay94nY3RM7p?= =?us-ascii?Q?Dog88YmsckFlq2TuCSFAqY70VSbj1B9YUQcCRmYfCO6W+tnmTBE6be83WEzU?= =?us-ascii?Q?htxtbftNKlRg9+q87EW0+SaYm/EdwSfxecR5eU5o2Tlfv37anUi6xAmh4kpJ?= =?us-ascii?Q?I9U31PwUmoAWFxEYt5owP/BpT+y1QyLtKao+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FGnU/Z3sM+mMDzI01/3Mcr7KzqVaoJIpUTa0LgII29L4G3mkIXt8mb?= =?us-ascii?Q?d7ipK9ZzE5xo17kwHgxUbt9U+yt8jMUQf8fccj0JJPVOvKpUBsc5MOhc6ICL?= =?us-ascii?Q?hJr4ai+ecq6u31/TQH1Vx2CKOt27+9I5APyO3j4vy73+yGKtq+j9qZazyDbD?= =?us-ascii?Q?OtHlY3UjjQJT5IvkCI3hw+3WY2uXKaK/Ms0/cS0iv2TPGSqcwMljQitewaYL?= =?us-ascii?Q?IzNZzqny9UT0MfVJ6M9hpiQh?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: a40bc405-67d6-4a21-451d-08d99520b060 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR01MB7330.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2021 05:56:28.3273 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vunguyen@amperemail.onmicrosoft.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR01MB5368 Content-Type: text/plain Provide function to initialize the PCIe PHY on Ampere Altra processor. Cc: Thang Nguyen Cc: Chuong Tran Cc: Phong Vo Cc: Leif Lindholm Cc: Michael D Kinney Cc: Ard Biesheuvel Cc: Nate DeSimone Signed-off-by: Vu Nguyen --- Silicon/Ampere/License.txt | 25 ++++++++++++++++++++ Silicon/Ampere/AmpereAltraBinPkg/AmpereAltraBinPkg.dec | 16 +++++++++++++ Silicon/Ampere/AmpereAltraBinPkg/Library/PciePhyLib/PciePhyLib.inf | 23 ++++++++++++++++++ Silicon/Ampere/AmpereAltraBinPkg/Include/Library/PciePhyLib.h | 25 ++++++++++++++++++++ 4 files changed, 89 insertions(+) diff --git a/Silicon/Ampere/License.txt b/Silicon/Ampere/License.txt new file mode 100644 index 000000000000..27b640bf5ce2 --- /dev/null +++ b/Silicon/Ampere/License.txt @@ -0,0 +1,25 @@ +Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/Silicon/Ampere/AmpereAltraBinPkg/AmpereAltraBinPkg.dec b/Silicon/Ampere/AmpereAltraBinPkg/AmpereAltraBinPkg.dec new file mode 100644 index 000000000000..32fcd6f6b9d4 --- /dev/null +++ b/Silicon/Ampere/AmpereAltraBinPkg/AmpereAltraBinPkg.dec @@ -0,0 +1,16 @@ +## @file +# +# Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + DEC_SPECIFICATION = 0x0001001B + PACKAGE_NAME = AmpereAltraBinPkg + PACKAGE_GUID = 04F7CB64-0F97-4D05-86B8-34987F4E1B21 + PACKAGE_VERSION = 0.1 + +[Includes] + Include diff --git a/Silicon/Ampere/AmpereAltraBinPkg/Library/PciePhyLib/PciePhyLib.inf b/Silicon/Ampere/AmpereAltraBinPkg/Library/PciePhyLib/PciePhyLib.inf new file mode 100644 index 000000000000..a963b8910649 --- /dev/null +++ b/Silicon/Ampere/AmpereAltraBinPkg/Library/PciePhyLib/PciePhyLib.inf @@ -0,0 +1,23 @@ +## @file +# +# Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x0001001B + BASE_NAME = PciePhyLib + FILE_GUID = F2AD0AD0-D4B6-11E3-9C1A-0800200C9A66 + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = PciePhyLib + +[Binaries.AArch64] + LIB|PciePhyLib.lib|* + +[Packages] + MdePkg/MdePkg.dec + ArmPkg/ArmPkg.dec + ArmPlatformPkg/ArmPlatformPkg.dec diff --git a/Silicon/Ampere/AmpereAltraBinPkg/Include/Library/PciePhyLib.h b/Silicon/Ampere/AmpereAltraBinPkg/Include/Library/PciePhyLib.h new file mode 100644 index 000000000000..aead1ed68379 --- /dev/null +++ b/Silicon/Ampere/AmpereAltraBinPkg/Include/Library/PciePhyLib.h @@ -0,0 +1,25 @@ +/** @file + + Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef PCIE_PHY_LIB_H_ +#define PCIE_PHY_LIB_H_ + +/** + Initialize the PCIe PHY. + + @param[in] PhyBase Base address of the PCIe PHY. + + @retval RETURN_SUCCESS PCIe PHY has been initialized successfully. + @retval RETURN_DEVICE_ERROR Failed to initialize the PCIe PHY. +**/ +RETURN_STATUS +PciePhyInit ( + IN PHYSICAL_ADDRESS PhyBase + ); + +#endif /* PCIE_PHY_LIB_H_ */ -- 2.17.1