From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web11.53622.1594023886952057063 for ; Mon, 06 Jul 2020 01:24:49 -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=iNgFq61k; spf=fail (domain: oss.nxp.com, ip: , mailfrom: pankaj.bansal@oss.nxp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OAOA0A0VvnKs0z16iY6yV2r8cpWCKHcC9DKyO1n9nry3K3PD/g7FwzDz5gBz/LlD3T4zgivg+EFonTDa0Us1cZ1VgVoymE4PMWGrkOUvyb76XHk9cBSPcx6jwyIPy5yPARoIPU8lbKodZQ5wUXOWlr7WfuBl4yruLUKJfcdbg1tlPqwqV0aLUlJgkJjN1AOkJpr082dN9IsbRglpef5z0a14jR3usCsKotUi7YtFXwy9v215j5SPYD8VRJpix/I02zJv8QTw8zrXfIq3rD9zKFUSpmpgSFAc+BW2JshgR2b246oNJbB0aK69bIfqo/6ahpZZLeHkVz5+eTnTyTjAHQ== 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=xB4FGUfHXTCCYAR+osN1XoKL9KlgMBqVLuLtxpn/WMs=; b=AxMPYIfLRSh2jeiFpueR/notEDm0G4vPfFzIBaMtLxx/h5nDG0nriBghcGqng5EoDXHhESdWZC1N+/Gfcw0lNgfapdQ2NkHy9sw4fxUnQbfk1cIdV7EeeRUjaypTX7O4u0mZ7zDLpFK4Nur0ZlZprmADlAizuuwa7Car19hjDIdrNg+XTVsm7+db70QIGCUCbSv40S/pOjkGOS0LHdL9T+1YvHmbik6a/0RtG81Hav7mE1Izv20Kwf1dnQa9/lb6Z6vFjiVWh/KPYz0GUiZ/Q7GQB4DzJREeDhJnht7yxB4kNeDbLt0rUZqt7HZ/j4AOzwbXj5TMISxa5MSM8bo8jg== 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=xB4FGUfHXTCCYAR+osN1XoKL9KlgMBqVLuLtxpn/WMs=; b=iNgFq61kUvnBvpnQttcH2Kd/Ubl6cMu3HGW6xsuq6Aa7Zl2ah2EIewEdNLnKZTjHbLgdDPrOoCLMmcuZNIEIqfXoHqcpwdLNJ4XD1PJQQSo3ssH+jdy9TlrPwK0FfPm6Vq95KiUWvIQqKJEjVEDr8UkappFtYmCaT3y6aEJTEV0= Authentication-Results: nuviainc.com; dkim=none (message not signed) header.d=none;nuviainc.com; dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) by VI1PR04MB6782.eurprd04.prod.outlook.com (2603:10a6:803:139::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Mon, 6 Jul 2020 08:24:47 +0000 Received: from VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::4521:b667:cf06:b79b]) by VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::4521:b667:cf06:b79b%7]) with mapi id 15.20.3153.029; Mon, 6 Jul 2020 08:24:47 +0000 From: "Pankaj Bansal" To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Augustine Philips , Ard Biesheuvel , Arokia Samy , Kuldip Dwivedi Subject: [PATCH edk2-platforms v2 1/6] Silicon/NXP: Add comments explaining RCW bits' parsing Date: Mon, 6 Jul 2020 03:24:16 -0500 Message-ID: <20200706082421.9139-2-pankaj.bansal@oss.nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706082421.9139-1-pankaj.bansal@oss.nxp.com> References: <20200706082421.9139-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: BYAPR08CA0035.namprd08.prod.outlook.com (2603:10b6:a03:100::48) To VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) Return-Path: pankaj.bansal@oss.nxp.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from TFTPTOUEFI.am.freescale.net (64.157.242.222) by BYAPR08CA0035.namprd08.prod.outlook.com (2603:10b6:a03:100::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22 via Frontend Transport; Mon, 6 Jul 2020 08:24:44 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [64.157.242.222] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 28d26084-1a54-4a01-5bc4-08d821860b5e X-MS-TrafficTypeDiagnostic: VI1PR04MB6782: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2276; X-Forefront-PRVS: 04569283F9 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MUeJdaN4YUZXEzzfvWuKnWuXRlIPIe9nZEdqr4xVWwZDDzVvvcK+rvezxAGK5zKG7R/VBQBRG98I5bzJM0KkOimwg6nnJ0+7tYcji7lNj92kROYpmOmAALILhEyMvFiMxfdLa5Kv5twdLi0+b/yK6UYiv/P2kgk0uwA4WkRWARvpHoeVcPTtRkM/MtmHXhE6o4I6yJ+Y5UsOQbf8FWEFv9Al5lRDH7hZOQEPm8tC3CvfZxU2ba0Ra3cQ6AuN3ree59HSs1JkIywJK4BE/z16ogSPlKEGH3+Hb26osmxh8gev+MkAgrqnGoB0Mbpovj+4Rk0dylOK2Cv3PzumyOlNz2ggefA5W/P1fqz+MTgJU/NX59CaJCcoZ6mPmscb/29v X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5933.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(396003)(136003)(366004)(346002)(39860400002)(376002)(1076003)(478600001)(52116002)(83380400001)(6506007)(66476007)(16526019)(186003)(5660300002)(316002)(110136005)(6512007)(956004)(2616005)(44832011)(8676002)(6486002)(19627235002)(66946007)(86362001)(66556008)(8936002)(2906002)(26005)(6666004)(921003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: qoHeCd7dWRW56SyUrXK9WF8qyOWbSexET+dcb6jBS0DkcM/vMuFlwiJ5RDoTZupLCAdJnW90rOtmd+GHG90yhSbY2uYxQ2J+tpwxnqDAwStwCShtlFMItLWGTgvPma8NzIiL8K0vhHfiSLH82I9KI0aYLTaRLkHv/Nv1HUfQ6+lUVN/LCluiYwNC9Iy8Rs40XpDQAWZYTw5WxOCr4NMO7nB9osLNLCyalE0ttQaFl+zQcrMQtI/mtw2sUy3pXHT/NKQyLwLQriHFPm5A1ztMHi3xmrYpbC6HHHAAellL8n44Tg4soKOIr0asMINKOfoOnDiyRNK257e/tTAfmS1WqVnuKGc5HPJI8HwaXw/gp2QtQCfhZTskLJf5/ItzfbcOBuVWxYgCrmlIBt6dFq6xEZeFbGP0EG8wNtAoJsRk5Q+vPTZdIVCtMLJFS3FqwcMHjs10PtAkMu9Tp32KfOEQwrgpK3P11delZ67rLUar/ZfdzHT1YVQ4qxvXVFIN8gcU X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 28d26084-1a54-4a01-5bc4-08d821860b5e X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5933.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2020 08:24:47.5881 (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: wxst9/ylU8lnhdXG66IW70ulUE8WLzLwQcV50q3H8ZnSYSnjk8ZQRi1FcM7BoMEC3lpqolTlkyLLX+HYqDiNcQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6782 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Pankaj Bansal RCW bits parsing and their interpretation varies between various SOCs. Add the comments that explain this parsing scheme. Based on this explanation, fix the comments for SYS_PLL_RAT parsing in LX2160A. Signed-off-by: Pankaj Bansal --- Silicon/NXP/LS1043A/Include/Soc.h | 27 +++++++++++++++++++ Silicon/NXP/LX2160A/Include/Soc.h | 28 +++++++++++++++++++- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/Silicon/NXP/LS1043A/Include/Soc.h b/Silicon/NXP/LS1043A/Includ= e/Soc.h index 21b0dafffe91..c694576ed18d 100644 --- a/Silicon/NXP/LS1043A/Include/Soc.h +++ b/Silicon/NXP/LS1043A/Include/Soc.h @@ -50,6 +50,33 @@ =20 /** Reset Control Word (RCW) Bits + + RCWSR contains the Reset Configuration Word (RCW) information written wi= th + values read from flash memory by the device at power-on reset and read-o= nly + upon exiting reset. + + RCW bits in RCWSR registers are mirror of bit position in Little Endian = (LE) + +RCW Bits | +in RCWSR | +(MSBit 0)| 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2= 4 25 26 27 28 29 30 31 +--------------------------------------------------------------------------= ---------------------- +LE | 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 = 10 9 8 7 6 5 4 3 2 1 0 +(LSBit 0)| + + Moreover the RCW bits are to be interpreted in below fasion + +Bit(s) | Field Name | Description | Notes/comments +---------------------------------------------------------------------- + 2-6 | SYS_PLL_RAT | System PLL Multiplier/Ratio | This field selects t= he platform + | | | clock:SYSCLK ratio. + | | | 0_0011 3:1 + | | | 0_0100 4:1 + | | | 0_1101 13:1 + | | | 0_1111 15:1 + | | | 1_0000 16:1 + + which is why the RCW bits in RCWSR registers are parsed this way **/ #define SYS_PLL_RAT(x) (((x) & 0x7c) >> 2) // Bits 2-6 =20 diff --git a/Silicon/NXP/LX2160A/Include/Soc.h b/Silicon/NXP/LX2160A/Includ= e/Soc.h index d62b8adcdbe7..e8198addc966 100644 --- a/Silicon/NXP/LX2160A/Include/Soc.h +++ b/Silicon/NXP/LX2160A/Include/Soc.h @@ -36,8 +36,34 @@ =20 /** Reset Control Word (RCW) Bits + + RCWSR contains the Reset Configuration Word (RCW) information written wi= th + values read from flash memory by the device at power-on reset and read-o= nly + upon exiting reset. + + RCW bits in RCWSR registers are same as bit position in Little Endian (L= E) + +RCW Bits | +in RCWSR | +(LSBit 0)| 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 = 10 9 8 7 6 5 4 3 2 1 0 +--------------------------------------------------------------------------= ---------------------- +LE | 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 = 10 9 8 7 6 5 4 3 2 1 0 +(LSBit 0)| + + Moreover the RCW bits are to be interpreted in below fasion + +Bit(s) | Field Name | Description | Notes/comments +---------------------------------------------------------------------- + 6-2 | SYS_PLL_RAT | System PLL Multiplier/Ratio | This field selects t= he platform + | | | clock:SYSCLK ratio. + | | | 0_0100 4:1 + | | | 0_0110 6:1 + | | | 0_1000 8:1 + | | | 0_1101 13:1 + | | | 0_1111 15:1 + **/ -#define SYS_PLL_RAT(x) (((x) & 0x7c) >> 2) // Bits 2-6 +#define SYS_PLL_RAT(x) (((x) & 0x7c) >> 2) // Bits 6-2 =20 typedef NXP_LAYERSCAPE_CHASSIS3V2_DEVICE_CONFIG LX2160A_DEVICE_CONFIG; =20 --=20 2.17.1