This series replaces the monolithic SataControllerDxe driver, which was copied from another platform and then expanded to add platform specific initialization routines and PCI I/O emulation, and instead switches to a simple platform SATA driver, which exposes the SATA IP blocks via a pair of UEFI driver model handles, and relegates all further handling to the generic platform PCI I/O driver, and the generic SATA driver.
This not only allows us to remove a fair chunk of (copied and unmaintained) code, it also makes it possible to easily use both SATA controllers at the same time. On Overdrive B1, all 14 SATA ports are available to UEFI and to the OS (with the caveat that the kernel fails to bring up the second controller in ACPI mode, but this looks like a kernel issue not a UEFI issue)
Patch #1 is an unrelated but useful patch that re-enables the descriptive names of drivers. It is unclear why this was disabled in the first place.
Patch #2 creates a new StyxSataPlatformDxe driver containing the existing SATA init code, and some simple calls to instantiate the device handles that identify the controllers as AHCI compatible and suitable for being driven by the PCI based generic driver
Patch #3 - #5 switch Overdrive, Cello and SoftIron 1000 to the new driver.
Patch #6 enables the second AHCI ACPI node if any ports are enabled on controller #2
Patch #7 enables the second AHCI DT node if any ports are enabled on controller #2
Patch #8 removes the old SataControllerDxe now that it is no longer used.
Note that this series relies on patches that are not yet in mainline Tianocore. Those patches can be found here:
https://git.linaro.org/people/ard.biesheuvel/uefi-next.git/log/?h=pciio-emu
Ard Biesheuvel (8): Platforms/AMD/Styx: don't disable component names and driver diagnostics Platforms/AMD/Styx: split off SATA init code into StyxSataPlatformDxe driver Platforms/AMD/Overdrive: switch to generic AHCI driver Platforms/AMD/Cello: switch to generic AHCI driver Platforms/AMD/Overdrive1000: switch to generic AHCI driver Platforms/AMD/Styx/AcpiTables: enable second SATA controller Platforms/AMD/Styx/FdtDxe: enable second SATA controller Platforms/AMD/Styx: remove SataControllerDxe
Platforms/AMD/Styx/AcpiTables/AcpiTables.inf | 1 + Platforms/AMD/Styx/AcpiTables/Dsdt.c | 9 +- Platforms/AMD/Styx/CelloBoard/CelloBoard.dsc | 16 +- Platforms/AMD/Styx/CelloBoard/CelloBoard.fdf | 4 +- Platforms/AMD/Styx/Drivers/FdtDxe/BdsLinuxFdt.c | 7 +- Platforms/AMD/Styx/Drivers/FdtDxe/FdtDxe.inf | 1 + Platforms/AMD/Styx/Drivers/SataControllerDxe/ComponentName.c | 178 ---- Platforms/AMD/Styx/Drivers/SataControllerDxe/InitController.c | 172 ---- Platforms/AMD/Styx/Drivers/SataControllerDxe/PciEmulation.c | 442 --------- Platforms/AMD/Styx/Drivers/SataControllerDxe/PciEmulation.h | 289 ------ Platforms/AMD/Styx/Drivers/SataControllerDxe/PciRootBridgeIo.c | 307 ------ Platforms/AMD/Styx/Drivers/SataControllerDxe/SataController.c | 1027 -------------------- Platforms/AMD/Styx/Drivers/SataControllerDxe/SataController.h | 555 ----------- Platforms/AMD/Styx/Drivers/StyxSataPlatformDxe/InitController.c | 181 ++++ Platforms/AMD/Styx/Drivers/{SataControllerDxe => StyxSataPlatformDxe}/SataRegisters.h | 0 Platforms/AMD/Styx/Drivers/{SataControllerDxe/SataControllerDxe.inf => StyxSataPlatformDxe/StyxSataPlatformDxe.inf} | 42 +- Platforms/AMD/Styx/Overdrive1000Board/Overdrive1000Board.dsc | 12 +- Platforms/AMD/Styx/Overdrive1000Board/Overdrive1000Board.fdf | 4 +- Platforms/AMD/Styx/OverdriveBoard/OverdriveBoard.dsc | 16 +- Platforms/AMD/Styx/OverdriveBoard/OverdriveBoard.fdf | 4 +- 20 files changed, 224 insertions(+), 3043 deletions(-) delete mode 100644 Platforms/AMD/Styx/Drivers/SataControllerDxe/ComponentName.c delete mode 100644 Platforms/AMD/Styx/Drivers/SataControllerDxe/InitController.c delete mode 100644 Platforms/AMD/Styx/Drivers/SataControllerDxe/PciEmulation.c delete mode 100644 Platforms/AMD/Styx/Drivers/SataControllerDxe/PciEmulation.h delete mode 100644 Platforms/AMD/Styx/Drivers/SataControllerDxe/PciRootBridgeIo.c delete mode 100644 Platforms/AMD/Styx/Drivers/SataControllerDxe/SataController.c delete mode 100644 Platforms/AMD/Styx/Drivers/SataControllerDxe/SataController.h create mode 100644 Platforms/AMD/Styx/Drivers/StyxSataPlatformDxe/InitController.c rename Platforms/AMD/Styx/Drivers/{SataControllerDxe => StyxSataPlatformDxe}/SataRegisters.h (100%) rename Platforms/AMD/Styx/Drivers/{SataControllerDxe/SataControllerDxe.inf => StyxSataPlatformDxe/StyxSataPlatformDxe.inf} (59%)