From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (EUR01-DB5-obe.outbound.protection.outlook.com [40.107.15.44]) by mx.groups.io with SMTP id smtpd.web12.342.1592543749208455050 for ; Thu, 18 Jun 2020 22:15:55 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nxp1.onmicrosoft.com header.s=selector2-nxp1-onmicrosoft-com header.b=G8NAllKN; spf=pass (domain: oss.nxp.com, ip: 40.107.15.44, mailfrom: pankaj.bansal@oss.nxp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BoXQIZf7R8hWz0C/HJMHDOjJfiR6OgRh7Dfi6zN/LdwbUJ0P7NMa59ICG9KIqO7Hw3+R/GMz7uyEwl00JJGHSzijBtY8g18XcxoSpKpuIqB+P7a5PMlpFYBBabhQjOA5jx2e70wnTeXRqspos9oL8EVXDBx6JvUu/dOAdXqKMddCUN/KyygNyzSYpVaZiCW9hIYuHo7X/RF4BfoMCqBsUHHw8nn74/pQLTkD4L6pDMyeaykA84CQqSUiq11c5xsMDO6/T6gDyIGsPNB9RdQif8iio4dFupSbSmdpiHL2AK1VJ2LMMvOIby9eUSBWy6BpCV1FsL8M9pRk8OxkPyl2gw== 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=FAl9SsLusTEEyzzdHUYlt1Hp85+o6HPdSFrf0KIxV1k=; b=DDYQ/kDhw6oRycRMuKClijOZwZoPmEa4npuTOK9I+ikLlhiNSdngMreT8NVDnDknyBef0+RIOnm/3k6ZxQ7C0zxxn+k+JiEOtYvgw9QB9dfseywKfFwLPKSbm3yd8KXHX40il+q3k1rOp8dbX3z26+a63m7adYPPIvi6JtjHc0mmFw1gCGmqV2JA9Svuoz2h/BA9E5gTVpeqqOfEdRxdT1UWaQCwL3TUn91h0JteSywM6RBrgkQjCwDTr72OMn73Gz6WmY37T7rf6ouTOhvLFhH0eGfGk+EB1JjGRnv8h1g8UcHg59HhtHyRDglXrXXWJJtZvjQ2JPiTLpxz8Ccj6w== 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=FAl9SsLusTEEyzzdHUYlt1Hp85+o6HPdSFrf0KIxV1k=; b=G8NAllKNz53vpG4TDx2ie91QWjQSegqlooEr9Lxc0BSDHeOu35zhgjcA8vu2+ww2sedxoLrfh8VWtE3DbxyXFBdbbiIW1FNP4sRKUHNZf1PW6CQO5I0ojxN0PUvZXAGwJ47K4k/QlW6EAJTbn6eYRqe3Kxm+9qWeNIyFCnkq24s= Received: from VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) by VI1PR04MB5405.eurprd04.prod.outlook.com (2603:10a6:803:d6::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.21; Fri, 19 Jun 2020 05:15:46 +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.3109.021; Fri, 19 Jun 2020 05:15:45 +0000 From: "Pankaj Bansal" To: Leif Lindholm , "Pankaj Bansal (OSS)" CC: Meenakshi Aggarwal , Michael D Kinney , "devel@edk2.groups.io" , Varun Sethi , Samer El-Haj-Mahmoud , Augustine Philips , Ard Biesheuvel , Arokia Samy , kuldip dwivedi Subject: Re: [PATCH edk2-platforms 1/5] Silicon/NXP/LS1043A: Fix the Platform PLL calculation Thread-Topic: [PATCH edk2-platforms 1/5] Silicon/NXP/LS1043A: Fix the Platform PLL calculation Thread-Index: AQHWRfivy+XF4NNpFEKurF5KfWBwVw== Date: Fri, 19 Jun 2020 05:15:45 +0000 Message-ID: References: <20200602132503.27154-1-pankaj.bansal@oss.nxp.com> <20200602132503.27154-2-pankaj.bansal@oss.nxp.com> <20200605140028.GH28566@vanye> <20200608142224.GN28566@vanye> <20200612151114.GG28566@vanye> In-Reply-To: <20200612151114.GG28566@vanye> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nuviainc.com; dkim=none (message not signed) header.d=none;nuviainc.com; dmarc=none action=none header.from=oss.nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [157.39.231.225] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 82cd890c-262e-4bb6-be1b-08d8140fd265 x-ms-traffictypediagnostic: VI1PR04MB5405: 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:10000; x-forefront-prvs: 0439571D1D x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GS8wSSssLFrYTl62kSa+XGmekgYEBd8KaCYfLTaUkJtWL2rrko5+EL3fPd3W8Te/4lYQ7CS9pKsCHzw7F60uInaWxIyruqfnblZnbGN/nA+a4eqLRYyycLLuW7qFE7p7ZRh4YLSx2Zhpw4WPGghstmXfay7SpI1iiZrlfiX9ngX5gGbLReoXHtRfVZUZL2Bw50+N9xu3aVTE7IvrLRrje+JE+LO0YIghkKVj8m1s2MwBEyebuQO41WUto2KjJDHTZBr4AwyI2Pfs7N/Ogxl6RcQrExgPciakXHnXqojE9TZkEs4wFPq4OSuuCLV/Y9see3SsLnz27KLBdL6OcbZZUylcJhDl9W1qEu29fkfFJ1/kTA64Om1ffy8+FdmwxOHoAqqrKwNGiHFSF87ZsPgaLw== 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)(346002)(376002)(366004)(136003)(39860400002)(396003)(26005)(966005)(83380400001)(4326008)(71200400001)(6506007)(8936002)(478600001)(53546011)(316002)(52536014)(110136005)(54906003)(86362001)(7696005)(76116006)(66946007)(66476007)(66556008)(5660300002)(66446008)(64756008)(33656002)(2906002)(9686003)(186003)(55016002)(8676002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: WhboljcqNlJhD2RUlD9MkbnDTUTXyvAwEufFGwfIU7DEG7c6YpVL6yxEzdQNyd2eRrb7ocjughDKerGew55H3Gq9tYDlWBijwo8nWFWKHhpv73kTFXFgzbjYYP9Nst2g6ngK3z52w9Ne7XCNxG9TwTEN0jPLRV+iavOacJ5mUCzzrdj4AcgottLDAgR0dsYQxnyqvUCcHYxjP/8YZJtBvIaoNgjcVnWTL/wpkamPDhHQ2LkWxJ2NEA0tv865Kz8Af74Z1eSh6vG7t3MliOxXg0XIfY/uza1QICipyWFCfOSaL0nHw2kXkk/VYlI0N8BKgZThzCjhgUiYihUPFfeLFPmPpIoYk7h1sdhJZpKa8lvaIZMqU9cITn2jywSpqgRRAsjfWiauS7Dc49FL0TyCucSDSEscPzAJngPD0JP3Qm9Xchb+nHhBwX3NUMx6e3/wB+sxH1d5nKJLQyLHsbUCN9RG0FWBew3ERsQU8G7wvsbE0lGmiD1oXXpSoGpMDeZG MIME-Version: 1.0 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82cd890c-262e-4bb6-be1b-08d8140fd265 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jun 2020 05:15:45.8294 (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: wYYDXvCXL6WcOCMihnEZrF9rE+tzu3HTDL8huUM1Ud5lPK+lrQXfucwMYf14zy1rzdYUjCP4+R2HO7NHQc/AZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5405 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Leif, Sorry for late reply. Actually I had asked the design team to check this point. I am waiting for their reply. I will add comments in code based on their reply and send new version. Regards, Pankaj Bansal > -----Original Message----- > From: Leif Lindholm > Sent: Friday, June 12, 2020 8:41 PM > To: Pankaj Bansal (OSS) > Cc: Meenakshi Aggarwal ; Michael D Kinney > ; devel@edk2.groups.io; Varun Sethi > ; Samer El-Haj-Mahmoud Mahmoud@arm.com>; Augustine Philips ; Ard > Biesheuvel ; Arokia Samy > ; kuldip dwivedi > > Subject: Re: [PATCH edk2-platforms 1/5] Silicon/NXP/LS1043A: Fix the Plat= form > PLL calculation >=20 > Hi Pankaj, >=20 > Apologies for delay in responding, this message got lost from my inbox. > On a sidenote, I think this has something to do with the email > moderation. Could you possibly subscribe the @oss.nxp.com address to > the list? You can set it not to deliver email, under > https://edk2.groups.io/g/devel/editsub, but I can't whitelist > addresses that are not subscribed. >=20 > On Mon, Jun 08, 2020 at 19:56:35 +0000, Pankaj Bansal (OSS) wrote: > > > > > OK, now I'm confused. > > > > > DCFG is read using the DcfgRead32 function, which is supposed to > > > > > handle the endianness issue. > > > > > > > > > > Ls1043a builds with > > > > > gNxpQoriqLsTokenSpaceGuid.PcdDcfgBigEndian|TRUE > > > > > which means GetMmioOperations() returns the byte-swapping version= s. > > > > > > > > > > Please clarify. > > > > > > > > OK. so this might be little confusing, so bear with me. > > > > The reset configuration word (RCW) is 512 bits (1024 bits in LS2088 > > > > / LS2160) long and contains all necessary configuration information > > > > for the chip. RCW data is read from external memory (Nor flash or > > > > SD/eMMC card or I2c eeprom) and written to the RCW status registers > > > > (RCWSR) contained in the Device Configuration and Pin Control modul= e > > > > (DCSR), after which the device is configured as specified in the > > > > RCW. > > > > > > > > The PreBoot Loader (PBL) fetches RCW data from the source memory > > > > device and writes it to the RCW status registers. > > > > Now the PBL fetches the data from flash in little endian format and > > > > writes it to the DCSR registers in little endian format always. > > > > This steps is same for all SOCs (LX2160 / LS1043 / LS1046 / LS2088)= . > > > > > > This PBL is a ROM executing before the EDK2 code? > > > > Yes > > > > > > > > > Now in SOCs where DCSR space is big endian (LS1043 / LS1046), we > > > > read the RCWSR registers in big endian fashion. > > > > This causes the bit position to be reversed. > > > > > > I'm still not following. > > > > > > We've set up this elaborate Rube Goldberg machine to be able to *not* > > > have to carry separate header files for devices with individual > > > components with registers that may be big- or little-endian depending > > > on which SoC/version they are in. > > > > > > And now we have an implementation that states that its DcfgRead > > > operations need to happan as big-endian. And the *only* time the Dcfg > > > registers are accessed, we immediately need to change the header file > > > to treat it as little-endian? > > > > The RCW Status registers are a special case and a subset of DCFG > > address space. The whole DCFG address space is big endian itself, > > and should be read as such. >=20 > So the RCW status registers are in effect just temporary storage for > data, as opposed to having any effect on the hw? Whereas other parts > of DCFG *do* affect (and reflect) hw, and are big-endian? >=20 > If so, ok, I understand. And I think your platform designers owe me > (and you, if so inclined) a beer. >=20 > > if it makes more sense, then I can swap the RCW status registers > > after being read from DCFG space. > > And I can put the explanation I wrote above in the code where I swap > > RCW SR registers ? >=20 > Yes, I think manually swapping the words make more sense. This is a > *weird* thing - it helps to call it out explicitly rather than try to > make it look normal. >=20 > Please do that, and drop the .h change, and I'm happy with that. >=20 > > > What is the situation where Dcfg accesses *need* to be big-endian? > > > > Apart from RCWSR registers the DCFG space contains following > > registers as well, which we need to access in boot firmware: > > > > - SVR (SOC Version Register) > > - to retrieve Core and Cluster Information (which I plan to send shortl= y) > > - To set the ICID of DMA connected devices like USB, SATA, SD/EMMC > > - to retrieve the clock frequency of serial flash controller (qspi/flex= spi) >=20 > Understood - thanks! >=20 > / > Leif