[edk2-devel] [PATCH edk2-platforms 0/5] Platform/RaspberryPi: fix serialportlib dependency hell

Ard Biesheuvel posted 5 patches 3 years, 10 months ago
Failed in applying to current master (apply log)
Platform/RaspberryPi/RPi3/RPi3.dsc            |  16 +-
Platform/RaspberryPi/RPi4/RPi4.dsc            |  14 +-
.../DebugDualSerialPortLib.inf                |  46 ++++
...alPortLib.inf => DualSerialPortDxeLib.inf} |  30 ++-
.../DualSerialPortLib/DualSerialPortLib.inf   |   5 +-
.../DualSerialPortLib/DualSerialPortLib.h     |  82 ++++++
.../DebugDualSerialPortLib.c                  |  28 ++
.../DualSerialPortLib/DualSerialPortLib.c     | 243 +-----------------
.../DualSerialPortLibCommon.c                 | 218 ++++++++++++++++
.../DualSerialPortLibConstructor.c            |  40 +++
.../PlatformLib/AArch64/RaspberryPiHelper.S   |  25 +-
11 files changed, 494 insertions(+), 253 deletions(-)
create mode 100644 Platform/RaspberryPi/Library/DualSerialPortLib/DebugDualSerialPortLib.inf
copy Platform/RaspberryPi/Library/DualSerialPortLib/{DualSerialPortLib.inf => DualSerialPortDxeLib.inf} (69%)
create mode 100644 Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortLib.h
create mode 100644 Platform/RaspberryPi/Library/DualSerialPortLib/DebugDualSerialPortLib.c
create mode 100644 Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortLibCommon.c
create mode 100644 Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortLibConstructor.c
[edk2-devel] [PATCH edk2-platforms 0/5] Platform/RaspberryPi: fix serialportlib dependency hell
Posted by Ard Biesheuvel 3 years, 10 months ago
This proposes an alternative approach to the issue described in
https://github.com/raspberrypi/firmware/issues/1376.

Instead of fiddling with HobLib internals and relying on headers being
included in the correct order, this replaces all DEBUG uses of SerialPortLib
with an implementation that doesn't reprogram the UART at all (and so does
not need to know the value of the base clock), and updates the two remaining
users to query the firmware for the correct value before touching the h/w.

NOTE: build tested only.

Ard Biesheuvel (5):
  Platform/RaspberryPi/DualSerialPortLib: split up to ease reuse
  Platform/RaspberryPi: introduce DebugDualSerialPortLib
  Platform/RaspberryPi: fix 16550 divisor calculation logic
  Platform/RaspberryPi3: query firmware for 16550 input clock at boot
  Platform/RaspberryPi: create DXE phase SerialPortLib version for RPi3

 Platform/RaspberryPi/RPi3/RPi3.dsc            |  16 +-
 Platform/RaspberryPi/RPi4/RPi4.dsc            |  14 +-
 .../DebugDualSerialPortLib.inf                |  46 ++++
 ...alPortLib.inf => DualSerialPortDxeLib.inf} |  30 ++-
 .../DualSerialPortLib/DualSerialPortLib.inf   |   5 +-
 .../DualSerialPortLib/DualSerialPortLib.h     |  82 ++++++
 .../DebugDualSerialPortLib.c                  |  28 ++
 .../DualSerialPortLib/DualSerialPortLib.c     | 243 +-----------------
 .../DualSerialPortLibCommon.c                 | 218 ++++++++++++++++
 .../DualSerialPortLibConstructor.c            |  40 +++
 .../PlatformLib/AArch64/RaspberryPiHelper.S   |  25 +-
 11 files changed, 494 insertions(+), 253 deletions(-)
 create mode 100644 Platform/RaspberryPi/Library/DualSerialPortLib/DebugDualSerialPortLib.inf
 copy Platform/RaspberryPi/Library/DualSerialPortLib/{DualSerialPortLib.inf => DualSerialPortDxeLib.inf} (69%)
 create mode 100644 Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortLib.h
 create mode 100644 Platform/RaspberryPi/Library/DualSerialPortLib/DebugDualSerialPortLib.c
 create mode 100644 Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortLibCommon.c
 create mode 100644 Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortLibConstructor.c

-- 
2.17.1


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

View/Reply Online (#58629): https://edk2.groups.io/g/devel/message/58629
Mute This Topic: https://groups.io/mt/73999452/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH edk2-platforms 0/5] Platform/RaspberryPi: fix serialportlib dependency hell
Posted by Ard Biesheuvel 3 years, 10 months ago
On 5/5/20 4:50 PM, Ard Biesheuvel wrote:
> This proposes an alternative approach to the issue described in
> https://github.com/raspberrypi/firmware/issues/1376.
> 
> Instead of fiddling with HobLib internals and relying on headers being
> included in the correct order, this replaces all DEBUG uses of SerialPortLib
> with an implementation that doesn't reprogram the UART at all (and so does
> not need to know the value of the base clock), and updates the two remaining
> users to query the firmware for the correct value before touching the h/w.
> 
> NOTE: build tested only.
> 
> Ard Biesheuvel (5):
>    Platform/RaspberryPi/DualSerialPortLib: split up to ease reuse
>    Platform/RaspberryPi: introduce DebugDualSerialPortLib
>    Platform/RaspberryPi: fix 16550 divisor calculation logic
>    Platform/RaspberryPi3: query firmware for 16550 input clock at boot
>    Platform/RaspberryPi: create DXE phase SerialPortLib version for RPi3
> 

I have pushed this as 11189124fbc2..644e223bb371 with Pete's ack, after 
making the changes as discussed in the individual replies.


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

View/Reply Online (#58717): https://edk2.groups.io/g/devel/message/58717
Mute This Topic: https://groups.io/mt/73999452/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-