From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [])
 by mx.groups.io with SMTP id smtpd.web12.4460.1594184263262111873
 for <devel@edk2.groups.io>;
 Tue, 07 Jul 2020 21:57:45 -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=hMworPPp;
 spf=fail (domain: oss.nxp.com, ip: <nil>, mailfrom: pankaj.bansal@oss.nxp.com)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=YWG+FXkQYlAFdck2HgEBu59Gb1HMR6BkceufLaBb0ZMGDJcIUjwkDqhdjsYRbFg6RYgc0LhVqdmNWZZs+Kz2/6/b8/TZQo1Qsnty57b8d0+tTTfg/Mlmf5mO3i3ELSqjOBrzJOOiFEE8q40CZg7RZIW5IMZOuO8SjPdJBxfXbCsi/pEUUJrpF0vXfgHm3tgbzBkQZF2s96zuXJxyCXBDugvIJNILpj9C9+XxITJnM8QFtVJ25c0Zf5l2BWwZhQiE4t4Y07B4StSrGl01WAoDd14LKZ9velMhlPjTDOSV3HpO3oLFMpKN/W4/hmp3/KsHsAMAJto0yk+JPEai7bhuKg==
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=gKNnf7kwyGxUTXNgxwsN6OA+PcrUIzit3V636o2sMbc=;
 b=bHZpCya10EwnScXu/fwNpM05YLHHtXXFRBl/RttHsZeUwAb5sPcINwauvr0YUjnrM2UvOK5sR7LaGglgnNgCNRANyaA+HvUDKZ7ejxMneh2Jvz6yfKXraBeytWP6PmwMhQeuF3bBkWT825EwFvYpDElZLnLa7tY2FdDNHhnYBlLEIj/pxXJzyq4n4HBYkELWNZ+xtiN+eKpsTMNmJrW9qe+2jFCTz5TsYDNUgHMkb6fyCHLWWP3aJeFU9ilOWhdZpT51bjfEm5UiCZTpyLthf0EOtbvviOWhrtI/BJOJnF7OsZOEBSnd13xfhe3FEcDzXtPqrODtpc+KdgcQu+M1SA==
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=gKNnf7kwyGxUTXNgxwsN6OA+PcrUIzit3V636o2sMbc=;
 b=hMworPPpTZxuZFbeBkEvIhFHcCBIT69q3/VAXYAskXjfirqhuwdkLFjkpyLKNW0snSu2KFhaVKvm4/8eSmFq+5coltTE+vSxy/MkpKPEdgHMCJw7XtJybMk7oi93EdtDasgqJtOQSYHKJPeaQGm8ehHpzUcxziPdj6KOlEqkOko=
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 VI1PR04MB6781.eurprd04.prod.outlook.com (2603:10a6:803:13d::11) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21; Wed, 8 Jul
 2020 04:57:44 +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.3174.021; Wed, 8 Jul 2020
 04:57:44 +0000
From: "Pankaj Bansal" <pankaj.bansal@nxp.com>
To: Leif Lindholm <leif@nuviainc.com>,
	Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	devel@edk2.groups.io,
	Varun Sethi <V.Sethi@nxp.com>,
	Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>,
	Augustine Philips <Augustine.Philips@arm.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Arokia Samy <arokia.samy@puresoftware.com>,
	Kuldip Dwivedi <kuldip.dwivedi@puresoftware.com>
Subject: [PATCH edk2-platforms v3 1/5] Silicon/NXP: Add comments explaining RCW bits' parsing
Date: Tue,  7 Jul 2020 23:57:15 -0500
Message-ID: <20200708045719.2648-2-pankaj.bansal@oss.nxp.com>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20200708045719.2648-1-pankaj.bansal@oss.nxp.com>
References: <20200708045719.2648-1-pankaj.bansal@oss.nxp.com>
X-ClientProxiedBy: BY3PR05CA0001.namprd05.prod.outlook.com
 (2603:10b6:a03:254::6) 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 BY3PR05CA0001.namprd05.prod.outlook.com (2603:10b6:a03:254::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.12 via Frontend Transport; Wed, 8 Jul 2020 04:57:41 +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: f34e6963-4abc-4682-d04c-08d822fb7346
X-MS-TrafficTypeDiagnostic: VI1PR04MB6781:
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: <VI1PR04MB678142A0E3150AAFE73DCAAFB0670@VI1PR04MB6781.eurprd04.prod.outlook.com>
X-MS-Oob-TLC-OOBClassifiers: OLM:213;
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: KNze7coumzPT70u+sGNPBiJ+VS1ltS3Q3TOzHcJ4PXCmrDWNgyGxEUG1ttsf7lsyZOzmopaRZM49yjp+NSIVyqKx+Vp+dKgzkbELFjSZ5oZzr6dHZP/BlkBDLDaUpYSRuCns5qOO8vmErJJPr1CvecsgZfpcJroS4rMUhHgdIXJqz66+0Pi0E44v3pDhLhNlw+LRSttigZOInAcSvr1SRhinZhYKBA7esu6Xt7m6UkqXMX4jxht64ZzJtXpFUfkQqKGFI0+1FJyaX3mtDibFQ/JFho4wUiMuywKNkWiWvinliXKI99rrIeOQU+itksrLGxqb4xiaDAlzLjOWhrkNj0N9ySpEcDeRNlGatJCfkw2rqtTOHVWn2Soap7YzgCtl
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)(366004)(39860400002)(396003)(346002)(136003)(376002)(6512007)(52116002)(6666004)(83380400001)(66556008)(66476007)(5660300002)(6506007)(316002)(44832011)(66946007)(2906002)(19627235002)(16526019)(8936002)(110136005)(86362001)(186003)(8676002)(1076003)(478600001)(956004)(6486002)(26005)(2616005)(921003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData: xQy30cj/miAKI4wlwelY+HvKyY1fZtYfzmFWxK8EOQdrvT/0ygRLK/XoMblPXAW3gkiJUcKsPNNuenbyABIlx7WUCZD5XNsIin9aQohXszDxuhrcEvDUkWVJm9tyi7QdBTDkWRDT7UzEwccD0X6Bp7uXxeLrIOJmFyuU0yHO39xRKAEobbSnBBow6HHx8nwJFxK2QcFDB0DtugSMrlyTAprbxJGb7FB1ZFSHLj2ptqhBGNrKn2JUimtTPtKqYGG98I+7AaOpP03MUOv7abKBkB4DP+H3duuaraPIrHudhMVNu3vtEWudf7nkZkbc/BtNdyMrNQzaHFUqeQ+z9y5kIl3b11CUqBeStuvLWyhBtIjWXneKbfTg38eWBoR/V0myNzXLqzTSh7/IYh0HpPtsRnfeYcFWWRNygJ8ceIRH4WlkJVQh7OFrRXedqsK0j4LPLReT8D4xwQm/RrTbNbM6fDzxUxLaqFB1Fw7HVvrW6bF7rX3tXzXzSfrvxrCktS9I
X-OriginatorOrg: oss.nxp.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f34e6963-4abc-4682-d04c-08d822fb7346
X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5933.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2020 04:57:44.3948
 (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: LTxerDVefPK2ONN+JhsIZdVoASSAZfI1+YjpWxNouMJthAPUh0ja75m+4F95qbdgrl0vu99nrnbLZqqy/P9dAw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6781
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain

From: Pankaj Bansal <pankaj.bansal@nxp.com>

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 <pankaj.bansal@nxp.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
---

Notes:
    V3:
    - Added Reviewed-by: Leif Lindholm <leif@nuviainc.com>
   =20
    V2:
    - new commit

 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