From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by mx.groups.io with SMTP id smtpd.web11.8358.1587743469992552086 for ; Fri, 24 Apr 2020 08:51:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=Dsv3mvV1; spf=pass (domain: nuviainc.com, ip: 209.85.221.67, mailfrom: leif@nuviainc.com) Received: by mail-wr1-f67.google.com with SMTP id d17so11433912wrg.11 for ; Fri, 24 Apr 2020 08:51:09 -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=ELeG9amtVgNSlO32BJOj3MxA50t3svA2rqrmWpWpRy0=; b=Dsv3mvV1lwBnMR8Rcx02VaKMFowROixmHnkpmlvfufTc/ITPkR7guk1QhHHUY5kwKY y4RfStcKLxktvHmBSGr7LkkxfWQwK8BbIp7EYZ0lT0u9oCWAzd8cfSCT6bN5AtUeWgir ERcnRMI0OOKILwWKS/8GO63v4x21J5PLHQoXoC1ba0JPTOgmTpSvEXAdBgodaX9vK4ye c5tolwQO1WLehFZWkHjl3IsbRvuYjBD5G6rcqnSXcnmJHIbKD1GBOnXJB/BDPtczi9+w 4iVJx+XLHErx47/JI4ZKlHwjyphw6zWkNjSu6V8DTVajWDsxBMiO5PCTCcMuPHEZCWKS K7+Q== 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=ELeG9amtVgNSlO32BJOj3MxA50t3svA2rqrmWpWpRy0=; b=TVKa2VmwHaDNqxNznOT9BbORJKUgWyNJb4haLskYL4yIq7B1szFQqQxb0kvrbmzh69 WLhF4NFlKzup7z23NBlShJbj6AbRq/Ohqq+lXr7F8Lv0Z+MbKoQv/GsFrZpC9PHGpcK4 QZJj9grQcjx/H9beBFO9m3Uxtc7dHSmkNLEskWXCTTV997gjIDsfGZFkIBA+Mzgz6iDU elmUmk1AVuD3KBk3Ed7f/g7Vr7F8kJbdCwALlO41EI4P96Cw7hXi3UwjrZ1YyJtk4vLQ tT7NtyWl+dxl2XC1PFyMODW0n0LxRktVmLXPybuk46EaR30eXU222VVp0qbhrGq0853m p+mQ== X-Gm-Message-State: AGi0PuahSarS1Aqy0l6lgfj2Q8uF3mjumzQ2enCOReHmuEpUb9NMqCFV hcbP6usDyLT5OFyRjFCoUJOVow== X-Google-Smtp-Source: APiQypJCc4+074pA3qtTJxOPJ7C1CUk0yT8OjfrOil8CvOblt7pfk3r5yHng3DCJudP3hMBElhypQQ== X-Received: by 2002:adf:ff84:: with SMTP id j4mr11497506wrr.305.1587743468577; Fri, 24 Apr 2020 08:51:08 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id k6sm3591446wma.19.2020.04.24.08.51.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Apr 2020 08:51:08 -0700 (PDT) Date: Fri, 24 Apr 2020 16:51:05 +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: <20200424155105.GN14075@vanye> References: <20200423102714.GW14075@vanye> <20200423115707.GB14075@vanye> <20200423120537.GC14075@vanye> <20200423141842.GF14075@vanye> <20200423152616.GG14075@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 Fri, Apr 24, 2020 at 02:42:13 +0000, Pankaj Bansal (OSS) wrote: > > > > 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. > > The only mechanism I know for passing a cached value between different modules > is either use PCDs or use HOBs. > We have already explored both in https://edk2.groups.io/g/devel/message/57254 > and https://edk2.groups.io/g/devel/message/56530 That was discussing what to do with regards to the generic 16550 driver. If we go with Laszlo's suggestion[1] for a separate SerialUartClockLib instead of adding a vendor GUID HOB *into the generic driver*, that does not preclude your using a HOB to cache the value in your platform code for later use in your own SerialUartClockLib implementation. [1] https://edk2.groups.io/g/devel/message/56767 > Moreover the compiler can optimize the PcdDcfgBigEndian evaluation. > So no overhead would be observed in evaluating PcdDcfgBigEndian in every call. I don't question that, but that was always going to be the case anyway - especially with LTO. The point is reducing code duplication - especially for weird and wacky hardware workarounds. / Leif