From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (EUR01-VE1-obe.outbound.protection.outlook.com [40.107.14.87]) by mx.groups.io with SMTP id smtpd.web12.4781.1587643339220794646 for ; Thu, 23 Apr 2020 05:02:19 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nxp1.onmicrosoft.com header.s=selector2-nxp1-onmicrosoft-com header.b=TE2ki6+v; spf=pass (domain: oss.nxp.com, ip: 40.107.14.87, mailfrom: pankaj.bansal@oss.nxp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NylkznOLBryzmoV3O/w+XJJ7npqe6mQI5u6d0sqAQFfwFy4Iw6sVaJfba3HbdmA9Ln3bCwKoVXor6S9+FY7I/h6/IKT84hu4Z7bgDfZqt6bjs3g+ulstzeYrKujE5YddsFur02hQnbobWPZMbnogEncScUXWceL5S3Di9qpLE3zyCZ3TTHRiZw9j+JXmol1MiLkoxJBR3nZQI7/bqqwDu1qHvrYHPjNQhHoTOZn80vM1ENXeBLVLVWe8elooj1wGEQEYz1wZG2tmBk9YFTkQI30t1VAGEupZ326gRmr914SCdGrOt/QACA7dPB45/VVn2RvxkHtL0jsVJRbtrtxqFg== 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=2PAaAlXTKb1qJiM69f3wtO1ITxFgNUKEzY9i5TKnBIk=; b=QX3qxzhqcVZVaVykXhJ6X7XKPlZMsKNuX22mpAdatmuvMWywtxAGKyXeehQB6QmEvQKoBreDKXKqkdlxiCq4VQbOlaK47DUhxDk7kDvy6Gk3hpj6iXiGVrikR7/fKOxFu/xx698XsALhxCoASetmmlcVT7fgio0D2XOWWKigH+DGQU3OcXKJOPwLlce6phkW3RtNCxnAaxnvDNaNwl08Nrtftc/Df96OIgP6AxHPYoV/+LjD5vOApXkELnCxfskEl2Qr0AH8DBMj4HyGzNBhJyKrhyOvRx9OfCvmILy9V84ju1SDwTmFGZBKH5f6ud1D1nL67J9Z5rQI4wbFsbnsDA== 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=2PAaAlXTKb1qJiM69f3wtO1ITxFgNUKEzY9i5TKnBIk=; b=TE2ki6+v2mnge343+vFboF4DQSagcLoxZUzvNlGq/VDRSycs+efKcjAihjmJvSjGkxk/f0MvEQU2rdPVZe36AKAtSHT9XMcsnxl2WcEHWd0a6dvnKXuuy5Nc7Ti2kSCRJSURaRrYIq6p/z+HlZFh3WFCiD3rA89sXN18Pvg6LDs= Received: from VI1PR04MB5135.eurprd04.prod.outlook.com (2603:10a6:803:62::11) by VI1PR04MB4848.eurprd04.prod.outlook.com (2603:10a6:803:55::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Thu, 23 Apr 2020 12:02:16 +0000 Received: from VI1PR04MB5135.eurprd04.prod.outlook.com ([fe80::e51b:b40c:9a6d:fbf]) by VI1PR04MB5135.eurprd04.prod.outlook.com ([fe80::e51b:b40c:9a6d:fbf%5]) with mapi id 15.20.2921.030; Thu, 23 Apr 2020 12:02:16 +0000 From: "Pankaj Bansal" To: Leif Lindholm CC: Meenakshi Aggarwal , Michael D Kinney , "devel@edk2.groups.io" , Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton , Ard Biesheuvel Subject: Re: [PATCH edk2-platforms v3 16/24] Silicon/NXP: Add Chassis2 Package Thread-Topic: [PATCH edk2-platforms v3 16/24] Silicon/NXP: Add Chassis2 Package Thread-Index: AQHWElZluN07dp8m8E+u4dCBzq4gzKiGjtUAgAAE4nCAABQ7gIAAAEbw Date: Thu, 23 Apr 2020 12:02:16 +0000 Message-ID: References: <20200415121342.9246-1-pankaj.bansal@oss.nxp.com> <20200415121342.9246-17-pankaj.bansal@oss.nxp.com> <20200423102714.GW14075@vanye> <20200423115707.GB14075@vanye> In-Reply-To: <20200423115707.GB14075@vanye> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=pankaj.bansal@oss.nxp.com; x-originating-ip: [49.36.135.81] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 5b4ea11e-7ded-4607-7045-08d7e77e2ab9 x-ms-traffictypediagnostic: VI1PR04MB4848:|VI1PR04MB4848: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 03827AF76E x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5135.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10009020)(4636009)(376002)(366004)(396003)(136003)(346002)(39860400002)(86362001)(9686003)(8676002)(26005)(55016002)(81156014)(8936002)(53546011)(7696005)(478600001)(6506007)(66476007)(33656002)(66556008)(71200400001)(66946007)(54906003)(966005)(76116006)(52536014)(6916009)(64756008)(5660300002)(4326008)(2906002)(186003)(316002)(66446008)(19627235002);DIR:OUT;SFP:1101; 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: /HN6IId1ZTjIEReMqANrFvk7lXgKJ98Jqypa9Po7N2ItT7z4AdhvmfmV0TgNrq20Mcbw4mDs30XBk0GNjOmB9/65C4KnAdD30RQeBXOoYyZF5tE/Z3OfFYt8Rg/Ua6x15RSH2/MfTK76A88cXQh6FFhHRfwQYiempkey0QgxyelEanwDiZJutrhJRvpvai0YiS4x+KBd35yCovHKn5dKVJ8OyunATw5rBIx/oQdvimOEnCqqvxpf6ZvvicehjQVOUfcqWOD8v47VnvdtW3vU738F8pdn5lVTntZ+2HqPWJXXAWkg45Yvvo+gJQn65MuYavRaELLjbGL8n8vRKwfbFEVasGkiYxCRDUgN/fQ7Uo6o2bH3F3uINAsNUjmwPxKfW4o7vfWXI/yjP1CdYIPCtrrqu5j+LD0PrDVea9uEnZBQtJu03Be56usMuGK6VcUhSnmzBSt380pbjCvvuQxDO1D5cm10aa6knM/HQZVoBabKxgCXZ+swBK5HIy+gZJTwI79YXB2IauJ/7d5KDTwwAw== x-ms-exchange-antispam-messagedata: CEVrtQFmYmcLUy1VRRy3ctrlLXltri44gsxensYpWxYLC4eVx1BJvNJny6jpZChaNq5OTCaL/0MAl76uRFWHdOk4c0pF5wtnXWPmVMfm6Kqu6rnsxGI1SDrHuCq8jE4iryJED7y+v+MgCO33H0N5+w== MIME-Version: 1.0 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b4ea11e-7ded-4607-7045-08d7e77e2ab9 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2020 12:02:16.3866 (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: fz5UAFXV7QVy+sSf/yyGAPrb2NWgNlHOY+hpBAIn37AiolF8j/XGX2i9AoRNTzsoRgVN8b27etHAeAb46il/ySLBOzsmiu1QkSxHD+h8YdJsqOhLSB3FvDSxWI8pcBHv X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4848 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Leif Lindholm > Sent: Thursday, April 23, 2020 5:27 PM > To: Pankaj Bansal (OSS) > Cc: Meenakshi Aggarwal ; Michael D Kinney > ; devel@edk2.groups.io; Varun Sethi > ; Samer El-Haj-Mahmoud Mahmoud@arm.com>; Jon Nettleton ; Ard Biesheuvel > > Subject: Re: [PATCH edk2-platforms v3 16/24] Silicon/NXP: Add Chassis2 > Package >=20 > On Thu, Apr 23, 2020 at 11:38:12 +0000, Pankaj Bansal (OSS) wrote: > > > > + > > > > + @return The value read. > > > > +**/ > > > > +UINT32 > > > > +EFIAPI > > > > +DcfgRead32 ( > > > > + IN UINTN Address > > > > + ) > > > > +{ > > > > + MMIO_OPERATIONS_32 *DcfgOps; > > > > + > > > > + DcfgOps =3D GetMmioOperations32 (FeaturePcdGet (PcdDcfgBigEndian= )); > > > > + > > > > + return DcfgOps->Read32 (Address); > > > > +} > > > > > > The intended usage model for IoAccessLib is to retrieve the function > > > pointer struct once and then always refer to it. Since this is a > > > library, we could have a CONSTRUCTOR function (specified in the .inf) > > > > I had thought of this, but decided against it because of this reason: > > The order of Library constructor call for a module cannot be guaran= teed. > > https://edk2.groups.io/g/devel/message/57254 is an good example of= this. > > BaseDebugLibSerialPortConstructor would need to depend on > ChassisLibConstructor, > > to retrieve the UART clock frequency. If the constructor calls are = not > guaranteed, BaseDebugLibSerialPortConstructor > > would fail and it would cause ASSERT due to ASSERT_RETURN_ERROR > (Status) >=20 > If this is a problem (and I recall Ard pointing out some shortcomings > in the dependency handling in the past), we can solve this with an > explicit initialisation call in the SoC or platform init code. You mean put ChassisLibConstructor() call in SerialPortInitialize () ? >=20 > / > Leif >=20 > > > > > and do something like: > > > > > > STATIC MMIO_OPERATIONS mDcfgOps; > > > > > > /** > > > Read Dcfg register > > > > > > @param Address The MMIO register to read. > > > > > > @return The value read. > > > **/ > > > UINT32 > > > EFIAPI > > > DcfgRead32 ( > > > IN UINTN Address > > > ) > > > { > > > return mDcfgOps->Read32 (Address); > > > } > > > > > > /** > > > Write Dcfg register > > > > > > @param Address The MMIO register to write. > > > @param Value The value to write to the MMIO register. > > > > > > @return Value. > > > > > > **/ > > > UINT32 > > > EFIAPI > > > DcfgWrite32 ( > > > IN UINTN Address, > > > IN UINT32 Value > > > ) > > > { > > > return mDcfgOps->Write32 (Address, Value); > > > } > > > > > > ... > > > > > > /** > > > The constructor function initializes the IoAccessLib > > > function pointer structure. > > > > > > @retval RETURN_SUCCESS The constructor always returns EFI_SUCCESS= . > > > > > > **/ > > > EFI_STATUS > > > EFIAPI > > > ChassisLibConstructor ( > > > VOID > > > ) > > > { > > > mDcfgOps =3D GetMmioOperations (FeaturePcdGet (PcdDcfgBigEndian)); > > > > > > return EFI_SUCCESS; > > > } > > > > > > / > > > Leif > > > > >