From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.42]) by mx.groups.io with SMTP id smtpd.web10.5332.1587696136688490059 for ; Thu, 23 Apr 2020 19:42:17 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nxp1.onmicrosoft.com header.s=selector2-nxp1-onmicrosoft-com header.b=exsB7fp6; spf=pass (domain: oss.nxp.com, ip: 40.107.21.42, mailfrom: pankaj.bansal@oss.nxp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Cc18kz3lxUvu9CngPEf3R1p1LdYIDl5qrHyKVPVIVUK++E77JBU7F9dzw/ZD4i3NYA6V2d30kBAMheaHFZbPjtkZsFm+sI0Cr/bm3sqrb1mP/k5yHo75c3zOic0QoN8KIgmeQX6kAP0KqOExuZWbyhVFgy/CW/jfRpSNaoVmdhu0WJCqYo5+tZUkEF/0pReDNij4/JkQdGOKRxKXj4Hog6cqjreSG4nm7nRzuB+9inbkD6PmAQhVc0GpLX+06UhslXme514phh05JIb0hcR7htLY7DBejV+97WfEBv6WDKIRfL+GhBt0zg/MILpJaMHVbYWRR9KFzSYDl2toht/qdA== 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=yESESSDf5My7/C7BVlc59x02nwTJs2drIkcgJ3bm2og=; b=lhXZjX+ydRUPRDhTTrXuSpl+pQYMuyndavYsOE2xQtVncrxb8KwQHeHb57FurJ8tKXaKXY+MqsJakdJiRHjJ80XMEG/31mDdwHqoQ8XC3frz2xXohTgrArldSxz/f1cj01feFGsu3klWvcx9s7+1JGqaadiN4IyFGyYKndRf9KAjUq5ao9Mivl4yUATImfkZmgtyN7I+dllyludY2v3/Tru/tpqhfkZSrnrbnZ1wPoSrmBEHD+PgT7XbRP4ATJGA7UIaV9z9egooWSHerohsvYLF5SWEMbk/dx4cuxWKbDNRaRUjcjJ5RtPe8OOk82kL+qt1ij9bqSYuikw5uIyrIA== 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=yESESSDf5My7/C7BVlc59x02nwTJs2drIkcgJ3bm2og=; b=exsB7fp6vFqHbCLparo2qKB8TuFg9eVRLPll5RCR9jhfF1CbrT04VbBwqLHl1HIlepHgUSmX/3fw+PnUsE712Eqly6Z/DQTxuHz8aSt/BKf5gV2eoiXWh1l+twODtJyX5r+RC1MxMWsjpinyoYlW/JzRu6s/foUbDluMSIaaoYU= Received: from VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) by VI1PR04MB3086.eurprd04.prod.outlook.com (2603:10a6:802:9::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Fri, 24 Apr 2020 02:42:13 +0000 Received: from VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::45c4:8846:5327:9513]) by VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::45c4:8846:5327:9513%7]) with mapi id 15.20.2921.032; Fri, 24 Apr 2020 02:42:13 +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 , 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: AQHWGeH1yIoSSjsPlk+BhFH3EOFIBw== Date: Fri, 24 Apr 2020 02:42:13 +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> <20200423120537.GC14075@vanye> <20200423141842.GF14075@vanye> <20200423152616.GG14075@vanye> In-Reply-To: <20200423152616.GG14075@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-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [49.36.135.81] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 759128ea-5b32-4ff6-8330-08d7e7f9185c x-ms-traffictypediagnostic: VI1PR04MB3086:|VI1PR04MB3086: x-ms-exchange-sharedmailbox-routingagent-processed: True x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 03838E948C 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)(136003)(376002)(396003)(346002)(54906003)(110136005)(26005)(55016002)(316002)(71200400001)(6506007)(7696005)(5660300002)(19627235002)(966005)(81156014)(8936002)(52536014)(76116006)(66946007)(2906002)(66476007)(66446008)(4326008)(8676002)(9686003)(186003)(478600001)(66556008)(33656002)(64756008)(86362001);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: cjS729VvEyjoay7KR/N1lD/IG9qBXutq/3pt+j4+LWCpFsat4DXPY7kK+KU/240kP6cH6o7O+J2pY5+qKLHEBKVUivr0/jy+p7BBw2zwh4R9LugmsreCUfmp2E/gqEz1c980hte5v4bVPCrJsdvTfsizzGDIAA/uBKjumZ9BcfN0KK1Ed921q+oxwyFZNZyBOjC8uRMIfCiOIZ/tfocazkb7bhQSkyjG/8AAoSSozSgt80hF7iIxaw3d5kWFpJNJ00GtRmmc1l4E2rWR4dkn8ZycMjiSmhvSymoGQleHqJeij9AI4BiFJO2vsZG6C7mc7kOI1c14Wg3gIRWU/ANuZm+5+8m+U3YRMOez23T2H+xZcVBLftIbNFSnWLgEgHohfEbuBvxwCs41tAJ4+Z23N9Bo+UoLuwBXYpoahcKUKGmnbRFsT9YJ1+ABAmJtqs1hk5ZzGIWuiUN1Cdrsu2RHlpdNQcuGDq4uB28gt2gNbvC685T7rgyr4FYFgDSIrEX3eHeAerZqR245fAqVXuA+kg== x-ms-exchange-antispam-messagedata: w4xeUTgbMcMSzKn1+FB8NZYOpAErZcwUgwjpJenLDJ7X2TA1Qx6VlChFrZx9j/OxCd4Lqp37VPF2H2erH4XFMTgMo1fT3OJNtOYaQKmrirs5JGVMG+x+Ns66Tsb3sBXVfM0okDUcmdfmMdbuZVEPqA== MIME-Version: 1.0 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 759128ea-5b32-4ff6-8330-08d7e7f9185c X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Apr 2020 02:42:13.6454 (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: aVl9Lo4sS2jKsbbJ1VMZDTBlF6AjzlLavdrFZ6GEUO2OS5J+cqBAt1naKBUQ3++zWbfy67D3zHatB6L7Nl2+SQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3086 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > > > > > > Why would multiple modules need to initialize the serial port? > > > > That's how the DebugLib has been designed. > > DebugLib is used by all modules to print info on console. > > BaseDebugLibSerialPortConstructor calls SerialPortInitialize. > > So SerialPortInitialize is called by all the modules. >=20 > Sure, but the bit where ChassisLib returns the active clock > configuration does not need to happen for each initialization. > That value can be cached. The only mechanism I know for passing a cached value between different modu= les is either use PCDs or use HOBs. We have already explored both in https://edk2.groups.io/g/devel/message/572= 54 and https://edk2.groups.io/g/devel/message/56530=20 Moreover the compiler can optimize the PcdDcfgBigEndian evaluation. So no overhead would be observed in evaluating PcdDcfgBigEndian in every ca= ll. >=20 > > Which is the reason when I forked the BaseSerialPortLib16550, > > I removed SerialPortInitalize functionality. > > https://edk2.groups.io/g/devel/message/54011 > > > > > > > > > Each module that has SerialPort and ChassiLib linked to it would ha= ve a > > > > local copy of mDcfgOps, which needs to be initialized. > > > > > > On the surface it makes more sense for the function that initializes > > > mmio accessors for chassis to be in the chassis initialization > > > function. > > > > > > In the current tree I can only see one user of SerialPortLib and one > > > of ChassisLib - but you are suggesting there will be several per > > > platform? If so, A better splution may ne to consider wrapping > > > DcfgRead32/DcfgWrite32 in a protocol instead of depending on the > > > ChassisLib. > > > > The protocol would not be available in SEC and PEI phase. >=20 > Fair. >=20 > / > Leif