From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.74]) by mx.groups.io with SMTP id smtpd.web10.13813.1584628633859979331 for ; Thu, 19 Mar 2020 07:37:14 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@nxp1.onmicrosoft.com header.s=selector2-nxp1-onmicrosoft-com header.b=UlY7ZwR+; spf=pass (domain: oss.nxp.com, ip: 40.107.7.74, mailfrom: pankaj.bansal@oss.nxp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DiRYXSg2bTsK0TAYtpW3KmMOFdOldvWEAHXYBOZRg/yWfM5vCzPkak7JfY6HJ/E/EaxDeet1m8PWLrVnrZtFQ8DHam/UVMGFf4Urbf4539adQEd1DUXpIqHcfN9OPQtd7enk9nSrXY/ctVjycyksbf69izURVzPHY/6sxeSwZ454NP6FevQp9DqBp4qs0RhfmLY6P6YcpnRcyyY2V0iK8v+MRYwPn2OTSjcDuCVGACryEo0MHP2zj1z95M3JHaqyKGk/ZUeRHTmJutbgdrmOusBSb7ys5388bZ/1l3OBr+/L7AV4c1zDOdp1MkthgaZzfbeLT32Crm5PGktMy692EQ== 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-SenderADCheck; bh=eF6RavytLy9FiyK8sQrb6tRpqatQNII0fjVIlkImbXA=; b=cz43rSUcQjLvqAcZxybSicP9KA6rT5HgaRGA43uKidBZLPM69YjN3c3QKSNg3Kqr7Zx4yG39KMDRPk6doc29fL6oxZQ5oGGQxI05dQPlCzQnPWIo8pOuQiuxsndleN3rM7rl1b0TkCenygHYXGb1KUGg2zW7S2Uei7Oivw429FTuEoZGEk204razROLnKBbkPTIVGSSEJEamRU8xZAw0cNRzQN1gGx5MoN1sMO8tCOkzgyPb56RLKsycycVc/Xu3b8YYU+2ZvH8EHZq+XBLVVEhunVlkFHrZ4n8f2VYKTXB6UYr+A3+T18XSF9fv/ItJiuaybNbGuIiwCU8HFUjgww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eF6RavytLy9FiyK8sQrb6tRpqatQNII0fjVIlkImbXA=; b=UlY7ZwR+oEih1hUXyrPajAODP2VZ5wNsNnhGn4nEYtFMnrbEo+6JfuRc/qDKy78gnlwTSDq1jJzBgU7x+SKDgToOy3Ju/epSa23mLLeGY/2UFy4GNlUbmJqOK+jTkGoU/K3YergLDdSbevBFzO9uXQWbbMnzn5SzIXGHXECBQ5E= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=pankaj.bansal@oss.nxp.com; Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2269.eurprd04.prod.outlook.com (10.169.134.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.18; Thu, 19 Mar 2020 14:37:11 +0000 Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:37:11 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [PATCH v2 17/28] Silicon/NXP: Use Clock retrieval PPI in modules Date: Fri, 20 Mar 2020 20:05:32 +0530 Message-ID: <20200320143543.18615-18-pankaj.bansal@oss.nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) Return-Path: pankaj.bansal@oss.nxp.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:37:08 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b5143a13-67f7-4531-f9c7-08d7cc13021b X-MS-TrafficTypeDiagnostic: VI1PR0401MB2269:|VI1PR0401MB2269: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-Forefront-PRVS: 0347410860 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(376002)(136003)(366004)(346002)(396003)(39860400002)(199004)(2906002)(26005)(186003)(16526019)(6666004)(478600001)(81166006)(86362001)(44832011)(8676002)(5660300002)(81156014)(6486002)(19627235002)(66476007)(66946007)(316002)(1076003)(6512007)(66556008)(6506007)(956004)(8936002)(2616005)(52116002)(110136005);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0401MB2269;H:VI1PR0401MB2496.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:0; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qD+t6o3PkjWrMmafzQwRJf89zATe0WrYDv6d3yZI5TSEMzyF/NYlrzmiZYfma9X994IU6KDAM6o8E7k+2jg7BgcixfBONNDCBKJl/ZdS7UgXPBIwXJL892HVqaPD/8XLhuz/10EVIBjhyq+OtfSppbEFu9Xg8rW5obEEllQm7lbQuvm8FzDuQOG4Vley25fF9aVrQ/i5FpoFLdZ3uEWmNYxY4q3/wyUuFIgby4Ld+rWqMGjCt6rXgMibp+O7gNq/Ufx9nX7zyfgCkyIjwZGXQZ91ce48who8j1oPttPuBlicmDnEqIUf0DTNYiAoXR+cotzYywoq7YKvXwOuhM2slkJy1ewW9OPAUp8FJH8K5zXVMABng3BEm4px0h7fBSjkxP48/oBbEDFNFotRFwV2EshJlrdr5B8bEeG+uf8SZ0z5+PWb8nM+CWWszqt2jDAE X-MS-Exchange-AntiSpam-MessageData: 2J4cE0kFf2l9w1AuA826kzZIAJCej365JhX7POqiVTUx6cyIoeIWCXM5RTyQ4v1q6X+O57q6lYrIq6MhBfFRao1G9KdJR2B4C0ne5IStA4RWVr995UkpI9EyHwl1Nl2d1oECy0tWan8ADgWXV+OmMw== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b5143a13-67f7-4531-f9c7-08d7cc13021b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:37:11.1025 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iJT3dE3ap41nW7ttnEm/dwezbbMCPI88rBFQD1xzNdTCzqmLccB/OxHhhuBsSLWAWzUR45HO5NV35YKWF4XodA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2269 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Pankaj Bansal Use NXP_PLATFORM_GET_CLOCK_PPI in various Layerscape IP modules. Signed-off-by: Pankaj Bansal --- Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc | 2 -- Silicon/NXP/Drivers/I2cDxe/I2cDxe.c | 3 +- Silicon/NXP/Drivers/I2cDxe/I2cDxe.h | 6 ---- Silicon/NXP/Drivers/I2cDxe/I2cDxe.inf | 2 +- Silicon/NXP/Include/Chassis2/NxpSoc.h | 9 ------ .../SerialUartClockLib/SerialUartClockLib.c | 9 ++---- .../SerialUartClockLib/SerialUartClockLib.inf | 2 +- Silicon/NXP/Library/SocLib/Chassis.c | 15 --------- Silicon/NXP/Library/SocLib/Chassis2/Soc.c | 31 ------------------- Silicon/NXP/Library/SocLib/LS1043aSocLib.inf | 1 - Silicon/NXP/NxpQoriqLs.dec | 5 --- 11 files changed, 6 insertions(+), 79 deletions(-) diff --git a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc b/Platform/NXP/LS= 1043aRdbPkg/LS1043aRdbPkg.dsc index e5383aaf0cc5..d486c9b36fab 100644 --- a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc +++ b/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc @@ -39,8 +39,6 @@ [PcdsFixedAtBuild.common] gArmTokenSpaceGuid.PcdSystemMemorySize|0x7BE00000 gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x02000000 =20 - gNxpQoriqLsTokenSpaceGuid.PcdPlatformFreqDiv|0x1 - # # RTC Pcds # diff --git a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.c b/Silicon/NXP/Drivers/I2cD= xe/I2cDxe.c index a5aba47b3ed4..30804450d2b7 100644 --- a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.c +++ b/Silicon/NXP/Drivers/I2cDxe/I2cDxe.c @@ -17,6 +17,7 @@ #include #include #include +#include =20 #include "I2cDxe.h" =20 @@ -51,7 +52,7 @@ SetBusFrequency ( =20 I2cBase =3D (UINTN)(I2c->Dev->Resources[0].AddrRangeMin); =20 - I2cClock =3D GetBusFrequency (); + I2cClock =3D gPlatformGetClockPpi.PlatformGetClock (NXP_I2C_CLOCK, 0); =20 I2cInitialize (I2cBase, I2cClock, *BusClockHertz); =20 diff --git a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.h b/Silicon/NXP/Drivers/I2cD= xe/I2cDxe.h index 88316f313380..7c4a306c16a0 100644 --- a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.h +++ b/Silicon/NXP/Drivers/I2cDxe/I2cDxe.h @@ -37,12 +37,6 @@ typedef struct { NON_DISCOVERABLE_DEVICE *Dev; } NXP_I2C_MASTER; =20 -extern -UINT64 -GetBusFrequency ( - VOID - ); - EFI_STATUS NxpI2cInit ( IN EFI_HANDLE DriverBindingHandle, diff --git a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.inf b/Silicon/NXP/Drivers/I2= cDxe/I2cDxe.inf index 867376044656..3bf7a8124fc6 100644 --- a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.inf +++ b/Silicon/NXP/Drivers/I2cDxe/I2cDxe.inf @@ -25,13 +25,13 @@ [Sources.common] =20 [LibraryClasses] ArmLib + ArmPlatformLib BaseMemoryLib DevicePathLib I2cLib IoLib MemoryAllocationLib PcdLib - SocLib TimerLib UefiBootServicesTableLib UefiDriverEntryPoint diff --git a/Silicon/NXP/Include/Chassis2/NxpSoc.h b/Silicon/NXP/Include/Ch= assis2/NxpSoc.h index 6812beafe447..3f00a2614131 100644 --- a/Silicon/NXP/Include/Chassis2/NxpSoc.h +++ b/Silicon/NXP/Include/Chassis2/NxpSoc.h @@ -27,10 +27,6 @@ #define SACR_PAGESIZE_MASK 0x00010000 #define IDR1_PAGESIZE_MASK 0x80000000 =20 -typedef struct { - UINTN FreqSystemBus; -} SYS_INFO; - /* Device Configuration and Pin Control */ typedef struct { UINT8 Res0[0x100-0x00]; @@ -39,11 +35,6 @@ typedef struct { #define CHASSIS2_RCWSR0_SYS_PLL_RAT_MASK 0x1f } CCSR_GUR; =20 -VOID -GetSysInfo ( - OUT SYS_INFO * - ); - UINT32 EFIAPI GurRead ( diff --git a/Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.c b/= Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.c index 9d49d7b4748b..eb29cf0373cc 100644 --- a/Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.c +++ b/Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.c @@ -7,12 +7,7 @@ **/ =20 #include - -extern -UINT64 -GetBusFrequency ( - VOID - ); +#include =20 /** Return clock in for Uart IP @@ -23,5 +18,5 @@ BaseSerialPortGetClock ( VOID ) { - return GetBusFrequency (); + return gPlatformGetClockPpi.PlatformGetClock (NXP_I2C_CLOCK, 0); } diff --git a/Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.inf = b/Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.inf index 9a3e80cf521d..c8840281763b 100644 --- a/Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.inf +++ b/Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.inf @@ -22,5 +22,5 @@ [Sources.common] SerialUartClockLib.c =20 [LibraryClasses] - SocLib + ArmPlatformLib =20 diff --git a/Silicon/NXP/Library/SocLib/Chassis.c b/Silicon/NXP/Library/Soc= Lib/Chassis.c index 1ef99e8de25f..90677f0f36ca 100644 --- a/Silicon/NXP/Library/SocLib/Chassis.c +++ b/Silicon/NXP/Library/SocLib/Chassis.c @@ -37,21 +37,6 @@ GurRead ( } } =20 -/* - * Return system bus frequency - */ -UINT64 -GetBusFrequency ( - VOID - ) -{ - SYS_INFO SocSysInfo; - - GetSysInfo (&SocSysInfo); - - return SocSysInfo.FreqSystemBus; -} - /* * Setup SMMU in bypass mode * and also set its pagesize diff --git a/Silicon/NXP/Library/SocLib/Chassis2/Soc.c b/Silicon/NXP/Librar= y/SocLib/Chassis2/Soc.c index 480d8d18fb9f..b14ada7f595d 100644 --- a/Silicon/NXP/Library/SocLib/Chassis2/Soc.c +++ b/Silicon/NXP/Library/SocLib/Chassis2/Soc.c @@ -21,37 +21,6 @@ #include #include =20 -/** - Calculate the frequency of various controllers and - populate the passed structure with frequuencies. - - @param PtrSysInfo Input structure to populate with - frequencies. -**/ -VOID -GetSysInfo ( - OUT SYS_INFO *PtrSysInfo - ) -{ - CCSR_GUR *GurBase; - UINTN SysClk; - - GurBase =3D (CCSR_GUR *)CHASSIS2_DCFG_ADDRESS; - SysClk =3D CLK_FREQ; - - SetMem (PtrSysInfo, sizeof (SYS_INFO), 0); - - PtrSysInfo->FreqSystemBus =3D SysClk; - - // - // selects the platform clock:SYSCLK ratio and calculate - // system frequency - // - PtrSysInfo->FreqSystemBus *=3D (GurRead ((UINTN)&GurBase->RcwSr[0]) >> - CHASSIS2_RCWSR0_SYS_PLL_RAT_SHIFT) & - CHASSIS2_RCWSR0_SYS_PLL_RAT_MASK; -} - /** Return the input clock frequency to an IP Module. This function reads the RCW bits and calculates the PLL multipler/divid= er diff --git a/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf b/Silicon/NXP/Lib= rary/SocLib/LS1043aSocLib.inf index 3d38a7e58b91..bb15e0a3d710 100644 --- a/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf +++ b/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf @@ -36,4 +36,3 @@ [BuildOptions] [FixedPcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gNxpQoriqLsTokenSpaceGuid.PcdGurBigEndian - gNxpQoriqLsTokenSpaceGuid.PcdPlatformFreqDiv diff --git a/Silicon/NXP/NxpQoriqLs.dec b/Silicon/NXP/NxpQoriqLs.dec index b478560450b3..2ac047a89274 100644 --- a/Silicon/NXP/NxpQoriqLs.dec +++ b/Silicon/NXP/NxpQoriqLs.dec @@ -22,11 +22,6 @@ [Guids.common] gNxpNonDiscoverableI2cMasterGuid =3D { 0x5f2c099c, 0x54a3, 0x4dd4, {0x9e= , 0xc5, 0xe9, 0x12, 0x8c, 0x36, 0x81, 0x6a}} =20 [PcdsFixedAtBuild.common] - # - # Platform PCDs - # - gNxpQoriqLsTokenSpaceGuid.PcdPlatformFreqDiv|0x0|UINT32|0x00000250 - # # Pcds to support Big Endian IPs # --=20 2.17.1