From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mx.groups.io with SMTP id smtpd.web10.822.1587655580665065066 for ; Thu, 23 Apr 2020 08:26:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=ruSsqm90; spf=pass (domain: nuviainc.com, ip: 209.85.221.65, mailfrom: leif@nuviainc.com) Received: by mail-wr1-f65.google.com with SMTP id t14so7303336wrw.12 for ; Thu, 23 Apr 2020 08:26:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GFxI5ImPgwkF8r/da8o0YqgEfoqH8X2mKJD1fszNYgA=; b=ruSsqm908nD1zMcDS3HbfoGuhvigHTxsnMJQ73bYaBj1nJZKWnA0TNhtNXCjHJlUJd 3HlAwOlnwQEnQ+wa/oi2Aj8XXsivk2baBjleiG7b4ll5OiIs4EEXqaeT3UtM067xkaad PuhsV8PkJsJN/fJMET5fX1r6tlTi8E88irtNucXVdmPEKiayRZQDIc68l2Ts33jh55+1 VcY/OgqHBTrIf9OEEzVMLZAxIHRTbyRV6o/2Js8GjOw2eWfJR1hByY7dAdTpBazadfeM jPzK2JXIstFpDO7mdYMisgfkizEZCc6vRzZ+0L2Y7ecrqOjY6GmSiceIQzyL8Nv8wbY3 Or/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GFxI5ImPgwkF8r/da8o0YqgEfoqH8X2mKJD1fszNYgA=; b=FZ2rZ7hKBUws2wTwnDaQJmjJMyOKOCTa74GXWmLxw57nUKKqSFex6apMLj1tMjXvuJ XYePMrmy20DkyQDGlQ+U+LXjUdbMGh58BgKEWljjdOQRKdidbwtSPxM2xvrNtlbiIJOm s6TpPbm7mHnhc1o34BIYejh2CFehTlD1692ClC2oedhNcD4fZ8phZU/+QnW19XmvFs5j D4TVU3dk9sjcgpTgZvgFxadW2k3JqFxKG9vrXEKY7GOsUYcpE9c0KiaXxpUsExwz5SX+ C2qu8Y0XlhDdJgC3pYNGQJDfhBBM4032e/Xu9kRVa7Otx7hwmlIPCR69FDKkQCZ5fUYE URsQ== X-Gm-Message-State: AGi0PuaNXA6sApNUsJdPK1wczdFRy7b5pu2tde1JX+FLTCcubtQIg4ql VxyavMQYySMqwJ2oKzb0MdiP0A== X-Google-Smtp-Source: APiQypIesMC3CCW+C78Ko4jhH5wgoWJ26SGta6xaYlA166kgaPcXH71SVfO+F18ZjvqC5PfPb7txVg== X-Received: by 2002:a5d:4f0d:: with SMTP id c13mr5358427wru.49.1587655579268; Thu, 23 Apr 2020 08:26:19 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id d133sm4744732wmc.27.2020.04.23.08.26.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Apr 2020 08:26:18 -0700 (PDT) Date: Thu, 23 Apr 2020 16:26:16 +0100 From: "Leif Lindholm" To: "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 Message-ID: <20200423152616.GG14075@vanye> 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> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Apr 23, 2020 at 14:45:03 +0000, Pankaj Bansal (OSS) wrote: > > > > > You mean put ChassisLibConstructor() call in SerialPortInitialize () ? > > > > > > > > Or before the call to SerialPortInitialize in ChassisInit. > > > > > > But SerialPortInitialize would be called from each module. > > > > 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. Sure, but the bit where ChassisLib returns the active clock configuration does not need to happen for each initialization. That value can be cached. > 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 have 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. Fair. / Leif