mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
PcAtChipsetPkg/SerialIoLib: Allow configurable UART IO Port Base Address
Today's implementation used a hardcoded value for the I/O Port Base Address. This creates a problem for platform configurability. If a platform needs to use a different I/O port address, then it requires modification of a source file. Create gPcAtChipsetPkgTokenSpaceGuid.PcdUartIoPortBaseAddress as a FixedAtBuild pcd scoped to PcAtChipsetPkg, with default value for 0x3f8 to match existing value, and update code to use PCD. Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
This commit is contained in:
parent
99afb1ffb0
commit
2d43dcfc6c
3 changed files with 9 additions and 1 deletions
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
PcAtChipsetPkg/PcAtChipsetPkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
BaseLib
|
||||
|
|
@ -25,3 +26,5 @@
|
|||
[Sources]
|
||||
SerialPortLib.c
|
||||
|
||||
[Pcd]
|
||||
gPcAtChipsetPkgTokenSpaceGuid.PcdUartIoPortBaseAddress
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
// ---------------------------------------------
|
||||
// UART Settings
|
||||
// ---------------------------------------------
|
||||
UINT16 gUartBase = 0x3F8;
|
||||
UINT16 gUartBase = FixedPcdGet16 (PcdUartIoPortBaseAddress);
|
||||
UINTN gBps = 115200;
|
||||
UINT8 gData = 8;
|
||||
UINT8 gStop = 1;
|
||||
|
|
|
|||
|
|
@ -164,5 +164,10 @@
|
|||
# @Prompt RTC Update Timeout Value.
|
||||
gPcAtChipsetPkgTokenSpaceGuid.PcdRealTimeClockUpdateTimeout|100000|UINT32|0x00000020
|
||||
|
||||
[PcdsFixedAtBuild]
|
||||
## Defines the UART base address.
|
||||
# @Prompt UART IO Port Base Address
|
||||
gPcAtChipsetPkgTokenSpaceGuid.PcdUartIoPortBaseAddress|0x3F8|UINT16|0x00000024
|
||||
|
||||
[UserExtensions.TianoCore."ExtraFiles"]
|
||||
PcAtChipsetPkgExtra.uni
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue