[edk2-devel] [PATCH edk2-platforms v3 16/24] Silicon/NXP: Add Chassis2 Package

Pankaj Bansal pankaj.bansal at nxp.com
Thu Apr 23 14:45:03 UTC 2020


> > > > 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.

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.

> 
> /
>     Leif

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#57977): https://edk2.groups.io/g/devel/message/57977
Mute This Topic: https://groups.io/mt/73008827/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list