I was able to compile the correct
PciSioSerialDxe.efi driver for my PCIe SER5427A serial card
It is not important what library
BaseSerialPortLibNull.inf or
BaseSerialPortLib16550.inf is in
MdeModulePkg.dsc because the driver does not use any of them.
To make the driver work, all you need to configure the PCIe card in
MdeModulePkg.dec accordingly in
PcdPciSerialParameters:
Code: Select all
gEfiMdeModulePkgTokenSpaceGuid.PcdPciSerialParameters|{0xD4,0x1F, 0x99,0x19, 0x00,0x00,0xE1,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0xFF,0xFF}|VOID*|0x00010071
Code: Select all
--Vendor- --Device- -----ClockRate----- ----------------Offset----------------- -Bar Stde --RxFIFO- --TxFIFO- -Reserved Terminate
0xD4,0x1F, 0x99,0x19, 0x00,0x00,0xE1,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0xFF,0xFF
Vendor, Device and ClockRate must be given as little-endian:
Vendor Device 1FD4 1999 > D4 1F 99 19
ClockRate my card 14745600 Hz > E10000 > 00 00 E1
That's all
because my card have only I/O access address in BAR0
No need to configure PcdSerialRegisterBase, PcdSerialClockRate and PcdSerialPciDeviceInfo in MdeModulePkg.dec -defaults is 0x03F8, 1843200 and 0xFF because is not consumed by PciSioSerialDxe.inf - only consumed PcdPciSerialParameters:
Code: Select all
[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200 ## CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8 ## CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1 ## CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits|1 ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate|1843200 ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdPciSerialParameters ## CONSUMES
Code: Select all
PciSioSerialDxe_PCIe.efi
fs0:\> dh 155 -d
155: Image(\/PciSioSerialDxe_PCIe.efi) ImageDevPath (..)/\/PciSioSerialDxe_PCIe.efi)DriverBinding ComponentName
Driver Name : PCI SIO Serial Driver
Image Name : \/PciSioSerialDxe_PCIe.efi
Driver Version : 0000000A
Driver Type : BUS
Configuration : NO
Diagnostics : NO
Managing :
Ctrl[12B] : PciRoot(0x0)/Pci(0x1c,0x1)/Pci(0x0,0x0)/Pci(0x0,0x0)
Child[156] : PCI Serial Port #0
PCIe card:
fs0:\> dh 12b -d
12B: DevPath (..1)/Pci(0x0,0x0)/Pci(0x0,0x0))PciIo
Controller Name : <UNKNOWN>
Device Path : PciRoot(0x0)/Pci(0x1c,0x1)/Pci(0x0,0x0)/Pci(0x0,0x0)
Controller Type : BUS
Configuration : NO
Diagnostics : NO
Managed by :
Drv[155] : PCI SIO Serial Driver
Parent Controllers :
Parent[50] : PciRoot(0x0)
Child Controllers :
Child[156] : PCI Serial Port #0
fs0:\> sermode
156(7906D698) - (115200, N, 8, 1)
fs0:\> dh 156 -d
156: DevPath (..(0x0,0x0)/Uart(115200,8,N,1))SerialIo
Controller Name : PCI Serial Port #0
Device Path : PciRoot(0x0)/Pci(0x1c,0x1)/Pci(0x0,0x0)/Pci(0x0,0x0)/Uart(115200,8,N,1)
Controller Type : BUS
Configuration : NO
Diagnostics : NO
Managed by :
Drv[157] : Serial Terminal Driver
Parent Controllers :
Parent[12B] : PciRoot(0x0)/Pci(0x1c,0x1)/Pci(0x0,0x0)/Pci(0x0,0x0)
Child Controllers :
Child[158] : PC-ANSI Serial Console