From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.116]) by mx.groups.io with SMTP id smtpd.web09.8318.1633349034404931862 for ; Mon, 04 Oct 2021 05:03:54 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=I/XRNQp5; spf=pass (domain: os.amperecomputing.com, ip: 40.107.244.116, mailfrom: nhi@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RlBc9gaRSN93IqFUdh53M5J2tGSYkrpDNoaoVHLAQiLkXuFrsIxqT+wg+qamq9cjTZQjEE/EpCmCmRAztcvKl72OZG/PRxj2rqCz2QsIHa07efM4KonEYhNn8DCJn21S88omT/VnZtfn2YDuDRZx8RE/8aBfYrU2U0drT470mYnDg1SLPg5sa3vafI+hcUcXL4/gDWFiITQKytdvckYhTRitkc/1Dxw2uU0lr4Tj7V5USUgbkK4x0vfFXHI1Wo2lDwKSM0eVwh4IXF8fnTA9RU8e6msUvqOInFARGQHRaNjrBd3yDSFuEo/4MrYhFt+wuZF7wjkgfbWgiF5sFXfvHA== 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=Z1kCJUZyhGmsux1usayiRMZOpAi+h7tPLFBLIh8ywCM=; b=gnFGr4Fes4Cmt110mAdOMvuz20rvv6DErm72IBIMg/voiHSl89Dvha0buTL22U+42PeYDYWQzkIwDpCsDdEOHsUMKufsHlHcH1/MN/m4UiymXeQE7yPiWBV4GBrjTfpXj/J2o/u+nqku8o9zW1lwSSd2nZNMZNeI9dE1pGgfMjoQiEmGq7+GVIjNkmWl8iLxuapTAFJLeyYcrLk010kzez1Q/xnR2FwEvk3LgcBdRaopYpLRPXVvbLk2V9LrHNYjDhm0Pa7YFHywvZqRS9gAyoO+7JP0gVkO0QM9D45ZbFFv9FwF7+XmmLYjlP9nmXu5SAO4KQO909ycXLmgNlWNjw== 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=Z1kCJUZyhGmsux1usayiRMZOpAi+h7tPLFBLIh8ywCM=; b=I/XRNQp5cPNrU+3HELJGS4Cj5a8lctzI4f90q8ze+ZEAVXYxXnF6nE8G89ruDjcAvB64tvwwoq7isQBPMLbVwEJXoCr/i4101J3WJbwpM97nklwLdgk4zDGzzcAHzZS0zRRIz40bmEbuxIsVdgGycSQ2syoB82L4ELtE0MJkEFM= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) by PH0PR01MB7459.prod.exchangelabs.com (2603:10b6:510:f2::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15; Mon, 4 Oct 2021 12:03:53 +0000 Received: from PH0PR01MB7287.prod.exchangelabs.com ([fe80::c5cb:7b53:cd09:f0ad]) by PH0PR01MB7287.prod.exchangelabs.com ([fe80::c5cb:7b53:cd09:f0ad%7]) with mapi id 15.20.4566.022; Mon, 4 Oct 2021 12:03:53 +0000 Subject: Re: [PATCH v3 12/28] AmpereAltraPkg: Add Ac01PcieLib library instance To: Leif Lindholm Cc: devel@edk2.groups.io, patches@amperecomputing.com, vunguyen@os.amperecomputing.com, Thang Nguyen , Chuong Tran , Phong Vo , Michael D Kinney , Ard Biesheuvel , Nate DeSimone References: <20210915155527.8176-1-nhi@os.amperecomputing.com> <20210915155527.8176-13-nhi@os.amperecomputing.com> <20210923134931.gzxueebb4axflhdi@leviathan> From: "Nhi Pham" Message-ID: Date: Mon, 4 Oct 2021 19:03:40 +0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <20210923134931.gzxueebb4axflhdi@leviathan> X-ClientProxiedBy: SG2PR03CA0090.apcprd03.prod.outlook.com (2603:1096:4:7c::18) To PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) Return-Path: nhi@os.amperecomputing.com MIME-Version: 1.0 Received: from [IPv6:2405:4802:91b7:33b0:99c8:6251:eba7:9c35] (2405:4802:91b7:33b0:99c8:6251:eba7:9c35) by SG2PR03CA0090.apcprd03.prod.outlook.com (2603:1096:4:7c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.16 via Frontend Transport; Mon, 4 Oct 2021 12:03:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2bb83fa6-6d4b-4da6-8fcd-08d9872f088a X-MS-TrafficTypeDiagnostic: PH0PR01MB7459: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UVmyJj0QHPCMj5otxk+4/Dh/SQVgzstOhzpm1PLU4FcJqckxe6dXNtw3LfNBmIihG0J9su019sr3M0uHj2yavY3R+u6pEmyWddAvepr9lDW9YseP9Gk4FNrpwhcVE6liIPczCe/p98LqJ0y+VfJNBzgcZjgKBySlKMVTiXsrs7UEqIPDLoMdD6NS1Ed3/OSZSLWwUQXbMecoHBvJ4INW/9KTqjGTbHTUmOa/P/2TyUAPxlCRU5QrYdKYpBvtNYZxUSiUJilZ5R8lvNw2dXdlgsxFI2w4EhOFLbDosYX6wIIoA0AAL98WKSzHopO+fSRsbtM6Cw9PvRUqelIgE4jlehynKAkuXxkhWYuXRofR5VyIMgUzk6Fw/SrnrRfVm5aakIVMjbuxCsrTew7Qji9qEC2RSEspETRD9b5G1avpO1IlD2/I40pcaCFe5kXu8lb0KK0IFExnWKLIodmcHxwr+Nhl1wBpOg13zeDIletHBlOxX1ljb2kq78Oc5IfrAaMZpSza9XP0VIVMwYnaHDH01884bLITYt7YM3TiN1Lj2OT6+763HleXJ+7UnOJHKwCOa2/t2h0pqcoOmPKgZhysKIjHWVv4Hzv1vRMK/51UCuDHDn0SQrn2imCxvd8uq8DpT+JVK71BVSHIlg223QKI6I+kC8chGlHkbDNseYrusYCk1HMRWcqo/sjhPgl9Y6X0DfYNRNIzNqUw02IENrVXGd6rCS2vNX5ULppeQcGeZK/0cQDty3W3idlORE/cJn0Z X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB7287.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(86362001)(38100700002)(52116002)(8676002)(8936002)(66476007)(66556008)(4326008)(6486002)(66946007)(6916009)(6666004)(31696002)(186003)(19627235002)(508600001)(316002)(31686004)(5660300002)(2906002)(53546011)(54906003)(2616005)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NWg1RGc0aUZISWQvRGJIOWNsTzRBaGlhdVF2ZGo5N21vTzYvb3ZLc1VCKzNS?= =?utf-8?B?R3BmNy82TmNNZDFFQXI2OGkvNmFKQ0libzc3STZVNERmVlpQNEdOdEdNckNJ?= =?utf-8?B?NlhI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S-Exchange-CrossTenant-Network-Message-Id: 2bb83fa6-6d4b-4da6-8fcd-08d9872f088a X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2021 12:03:52.9104 (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: hRKUjWj0c6Uqs20YQOkjEQHyAEYykV7xluRDRknrrDY4sUXFCFuVl8vwlkIiE2vpE4871+WvfmUYy5cpS7mLKkJlqsqvlMb8oed6b3PXohI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB7459 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Hi Leif, There are two comments that I would like to clarify with you. On 23/09/2021 20:49, Leif Lindholm wrote: >> +VOID >> +Ac01PcieMmioWr ( >> + UINT64 Addr, >> + UINT32 Val >> + ) >> +{ >> + Ac01PcieCsrOut32Serdes ((VOID *)Addr, (UINT32)Val); >> +} >> + >> +VOID >> +Ac01PciePuts ( > Wait, what. We have *two* sets of output overlays in this patch? This function is consumed by PCIe PHY library (PHYLib). We are making this wrapper function to conform with the function prototype defined by PHYLib. We will reduce DEBUG_PCIE_PHY by using directly the DEBUG (). Does it look good to you? > >> + CONST CHAR8 *Msg >> + ) >> +{ >> + DEBUG_PCIE_PHY ("%a\n", __FUNCTION__); > Err, no, just a further level of abstraction, seemingly throwing away > the subsystem aspect when actually called here? > >> +} >> + >> +VOID >> +Ac01PciePutInt ( >> + UINT32 val >> + ) >> +{ >> + DEBUG_PCIE_PHY ("%a\n", __FUNCTION__); >> +} >> + >> +VOID >> +Ac01PciePutHex ( >> + UINT64 val >> + ) >> +{ >> + DEBUG_PCIE_PHY ("%a\n", __FUNCTION__); >> +} >> + >> +INT32 >> +Ac01PcieDebugPrint ( >> + CONST CHAR8 *fmt, >> + ... >> + ) >> +{ >> + DEBUG_PCIE_PHY ("%a\n", __FUNCTION__); >> + return 0; >> +} >> + >> +VOID >> +Ac01PcieDelay ( >> + UINT32 Val >> + ) >> +{ >> + MicroSecondDelay (Val); > No, use MicroSecondDelay directly. Seems above. This wrapper function is to conform with the function prototype consumed by PHYLib. It's hard to change it. Thanks, Nhi >