diff --git a/edk2-rockchip/Platform/Ameridroid/IndiedroidNova/AcpiTables/AcpiTables.inf b/edk2-rockchip/Platform/Ameridroid/IndiedroidNova/AcpiTables/AcpiTables.inf index 25e1bd08d..ce0383215 100644 --- a/edk2-rockchip/Platform/Ameridroid/IndiedroidNova/AcpiTables/AcpiTables.inf +++ b/edk2-rockchip/Platform/Ameridroid/IndiedroidNova/AcpiTables/AcpiTables.inf @@ -39,6 +39,7 @@ $(RK_COMMON_ACPI_DIR)/Sata0.asl $(RK_COMMON_ACPI_DIR)/Sata1.asl $(RK_COMMON_ACPI_DIR)/Sata2.asl + $(RK_COMMON_ACPI_DIR)/Usb2Host.asl [Packages] ArmPkg/ArmPkg.dec diff --git a/edk2-rockchip/Platform/Ameridroid/IndiedroidNova/AcpiTables/Dsdt.asl b/edk2-rockchip/Platform/Ameridroid/IndiedroidNova/AcpiTables/Dsdt.asl index 85f45d6cc..658ed7b31 100644 --- a/edk2-rockchip/Platform/Ameridroid/IndiedroidNova/AcpiTables/Dsdt.asl +++ b/edk2-rockchip/Platform/Ameridroid/IndiedroidNova/AcpiTables/Dsdt.asl @@ -27,9 +27,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RPIFDN", "RPI", 2) include ("Uart.asl") // include ("Spi.asl") - // won't work on Windows, will trigger bugcheck by usbehci - // include ("Usb2.asl") - + include ("Usb1Host.asl") include ("Usb3Host0.asl") include ("Usb3Host2.asl") } diff --git a/edk2-rockchip/Platform/Firefly/ROC-RK3588S-PC/AcpiTables/AcpiTables.inf b/edk2-rockchip/Platform/Firefly/ROC-RK3588S-PC/AcpiTables/AcpiTables.inf index 25e1bd08d..ce0383215 100644 --- a/edk2-rockchip/Platform/Firefly/ROC-RK3588S-PC/AcpiTables/AcpiTables.inf +++ b/edk2-rockchip/Platform/Firefly/ROC-RK3588S-PC/AcpiTables/AcpiTables.inf @@ -39,6 +39,7 @@ $(RK_COMMON_ACPI_DIR)/Sata0.asl $(RK_COMMON_ACPI_DIR)/Sata1.asl $(RK_COMMON_ACPI_DIR)/Sata2.asl + $(RK_COMMON_ACPI_DIR)/Usb2Host.asl [Packages] ArmPkg/ArmPkg.dec diff --git a/edk2-rockchip/Platform/Firefly/ROC-RK3588S-PC/AcpiTables/Dsdt.asl b/edk2-rockchip/Platform/Firefly/ROC-RK3588S-PC/AcpiTables/Dsdt.asl index 85f45d6cc..658ed7b31 100644 --- a/edk2-rockchip/Platform/Firefly/ROC-RK3588S-PC/AcpiTables/Dsdt.asl +++ b/edk2-rockchip/Platform/Firefly/ROC-RK3588S-PC/AcpiTables/Dsdt.asl @@ -27,9 +27,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RPIFDN", "RPI", 2) include ("Uart.asl") // include ("Spi.asl") - // won't work on Windows, will trigger bugcheck by usbehci - // include ("Usb2.asl") - + include ("Usb1Host.asl") include ("Usb3Host0.asl") include ("Usb3Host2.asl") } diff --git a/edk2-rockchip/Platform/FriendlyElec/NanoPC-T6/AcpiTables/AcpiTables.inf b/edk2-rockchip/Platform/FriendlyElec/NanoPC-T6/AcpiTables/AcpiTables.inf index 25e1bd08d..ce0383215 100644 --- a/edk2-rockchip/Platform/FriendlyElec/NanoPC-T6/AcpiTables/AcpiTables.inf +++ b/edk2-rockchip/Platform/FriendlyElec/NanoPC-T6/AcpiTables/AcpiTables.inf @@ -39,6 +39,7 @@ $(RK_COMMON_ACPI_DIR)/Sata0.asl $(RK_COMMON_ACPI_DIR)/Sata1.asl $(RK_COMMON_ACPI_DIR)/Sata2.asl + $(RK_COMMON_ACPI_DIR)/Usb2Host.asl [Packages] ArmPkg/ArmPkg.dec diff --git a/edk2-rockchip/Platform/FriendlyElec/NanoPC-T6/AcpiTables/Dsdt.asl b/edk2-rockchip/Platform/FriendlyElec/NanoPC-T6/AcpiTables/Dsdt.asl index b03cf0ffd..0f6242652 100755 --- a/edk2-rockchip/Platform/FriendlyElec/NanoPC-T6/AcpiTables/Dsdt.asl +++ b/edk2-rockchip/Platform/FriendlyElec/NanoPC-T6/AcpiTables/Dsdt.asl @@ -27,9 +27,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RPIFDN", "RPI", 2) include ("Uart.asl") // include ("Spi.asl") - // won't work on Windows, will trigger bugcheck by usbehci - // include ("Usb2.asl") - + include ("Usb1Host.asl") include ("Usb3Host0.asl") include ("Usb3Host1.asl") // include ("Usb3Host2.asl") diff --git a/edk2-rockchip/Platform/FriendlyElec/NanoPi-R6C/AcpiTables/AcpiTables.inf b/edk2-rockchip/Platform/FriendlyElec/NanoPi-R6C/AcpiTables/AcpiTables.inf index 1d0dc1110..dab41bb48 100644 --- a/edk2-rockchip/Platform/FriendlyElec/NanoPi-R6C/AcpiTables/AcpiTables.inf +++ b/edk2-rockchip/Platform/FriendlyElec/NanoPi-R6C/AcpiTables/AcpiTables.inf @@ -39,6 +39,7 @@ $(RK_COMMON_ACPI_DIR)/Sata0.asl $(RK_COMMON_ACPI_DIR)/Sata1.asl $(RK_COMMON_ACPI_DIR)/Sata2.asl + $(RK_COMMON_ACPI_DIR)/Usb2Host.asl [Packages] ArmPkg/ArmPkg.dec diff --git a/edk2-rockchip/Platform/FriendlyElec/NanoPi-R6C/AcpiTables/Dsdt.asl b/edk2-rockchip/Platform/FriendlyElec/NanoPi-R6C/AcpiTables/Dsdt.asl index 7a3b701ab..75fc81a60 100644 --- a/edk2-rockchip/Platform/FriendlyElec/NanoPi-R6C/AcpiTables/Dsdt.asl +++ b/edk2-rockchip/Platform/FriendlyElec/NanoPi-R6C/AcpiTables/Dsdt.asl @@ -27,9 +27,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RKCP ", "RK3588S", 2) include ("Uart.asl") //include ("Spi.asl") - // won't work on Windows, will trigger bugcheck by usbehci - //include ("Usb2Host.asl") - + include ("Usb1Host.asl") include ("Usb3Host0.asl") include ("Usb3Host1.asl") } diff --git a/edk2-rockchip/Platform/FriendlyElec/NanoPi-R6S/AcpiTables/AcpiTables.inf b/edk2-rockchip/Platform/FriendlyElec/NanoPi-R6S/AcpiTables/AcpiTables.inf index 25e1bd08d..ce0383215 100644 --- a/edk2-rockchip/Platform/FriendlyElec/NanoPi-R6S/AcpiTables/AcpiTables.inf +++ b/edk2-rockchip/Platform/FriendlyElec/NanoPi-R6S/AcpiTables/AcpiTables.inf @@ -39,6 +39,7 @@ $(RK_COMMON_ACPI_DIR)/Sata0.asl $(RK_COMMON_ACPI_DIR)/Sata1.asl $(RK_COMMON_ACPI_DIR)/Sata2.asl + $(RK_COMMON_ACPI_DIR)/Usb2Host.asl [Packages] ArmPkg/ArmPkg.dec diff --git a/edk2-rockchip/Platform/FriendlyElec/NanoPi-R6S/AcpiTables/Dsdt.asl b/edk2-rockchip/Platform/FriendlyElec/NanoPi-R6S/AcpiTables/Dsdt.asl index 85f45d6cc..658ed7b31 100755 --- a/edk2-rockchip/Platform/FriendlyElec/NanoPi-R6S/AcpiTables/Dsdt.asl +++ b/edk2-rockchip/Platform/FriendlyElec/NanoPi-R6S/AcpiTables/Dsdt.asl @@ -27,9 +27,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RPIFDN", "RPI", 2) include ("Uart.asl") // include ("Spi.asl") - // won't work on Windows, will trigger bugcheck by usbehci - // include ("Usb2.asl") - + include ("Usb1Host.asl") include ("Usb3Host0.asl") include ("Usb3Host2.asl") } diff --git a/edk2-rockchip/Platform/Hinlink/H88K/AcpiTables/AcpiTables.inf b/edk2-rockchip/Platform/Hinlink/H88K/AcpiTables/AcpiTables.inf index 25e1bd08d..ce0383215 100644 --- a/edk2-rockchip/Platform/Hinlink/H88K/AcpiTables/AcpiTables.inf +++ b/edk2-rockchip/Platform/Hinlink/H88K/AcpiTables/AcpiTables.inf @@ -39,6 +39,7 @@ $(RK_COMMON_ACPI_DIR)/Sata0.asl $(RK_COMMON_ACPI_DIR)/Sata1.asl $(RK_COMMON_ACPI_DIR)/Sata2.asl + $(RK_COMMON_ACPI_DIR)/Usb2Host.asl [Packages] ArmPkg/ArmPkg.dec diff --git a/edk2-rockchip/Platform/Hinlink/H88K/AcpiTables/Dsdt.asl b/edk2-rockchip/Platform/Hinlink/H88K/AcpiTables/Dsdt.asl index a48463eff..5071e698c 100755 --- a/edk2-rockchip/Platform/Hinlink/H88K/AcpiTables/Dsdt.asl +++ b/edk2-rockchip/Platform/Hinlink/H88K/AcpiTables/Dsdt.asl @@ -27,9 +27,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RPIFDN", "RPI", 2) include ("Uart.asl") // include ("Spi.asl") - // won't work on Windows, will trigger bugcheck by usbehci - // include ("Usb2.asl") - + include ("Usb1Host.asl") include ("Usb3Host0.asl") include ("Usb3Host1.asl") include ("Usb3Host2.asl") diff --git a/edk2-rockchip/Platform/Khadas/Edge2/AcpiTables/AcpiTables.inf b/edk2-rockchip/Platform/Khadas/Edge2/AcpiTables/AcpiTables.inf index 25e1bd08d..ce0383215 100644 --- a/edk2-rockchip/Platform/Khadas/Edge2/AcpiTables/AcpiTables.inf +++ b/edk2-rockchip/Platform/Khadas/Edge2/AcpiTables/AcpiTables.inf @@ -39,6 +39,7 @@ $(RK_COMMON_ACPI_DIR)/Sata0.asl $(RK_COMMON_ACPI_DIR)/Sata1.asl $(RK_COMMON_ACPI_DIR)/Sata2.asl + $(RK_COMMON_ACPI_DIR)/Usb2Host.asl [Packages] ArmPkg/ArmPkg.dec diff --git a/edk2-rockchip/Platform/Khadas/Edge2/AcpiTables/Dsdt.asl b/edk2-rockchip/Platform/Khadas/Edge2/AcpiTables/Dsdt.asl index 85f45d6cc..658ed7b31 100644 --- a/edk2-rockchip/Platform/Khadas/Edge2/AcpiTables/Dsdt.asl +++ b/edk2-rockchip/Platform/Khadas/Edge2/AcpiTables/Dsdt.asl @@ -27,9 +27,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RPIFDN", "RPI", 2) include ("Uart.asl") // include ("Spi.asl") - // won't work on Windows, will trigger bugcheck by usbehci - // include ("Usb2.asl") - + include ("Usb1Host.asl") include ("Usb3Host0.asl") include ("Usb3Host2.asl") } diff --git a/edk2-rockchip/Platform/Mekotronics/R58-Mini/AcpiTables/AcpiTables.inf b/edk2-rockchip/Platform/Mekotronics/R58-Mini/AcpiTables/AcpiTables.inf index 25e1bd08d..ce0383215 100644 --- a/edk2-rockchip/Platform/Mekotronics/R58-Mini/AcpiTables/AcpiTables.inf +++ b/edk2-rockchip/Platform/Mekotronics/R58-Mini/AcpiTables/AcpiTables.inf @@ -39,6 +39,7 @@ $(RK_COMMON_ACPI_DIR)/Sata0.asl $(RK_COMMON_ACPI_DIR)/Sata1.asl $(RK_COMMON_ACPI_DIR)/Sata2.asl + $(RK_COMMON_ACPI_DIR)/Usb2Host.asl [Packages] ArmPkg/ArmPkg.dec diff --git a/edk2-rockchip/Platform/Mekotronics/R58-Mini/AcpiTables/Dsdt.asl b/edk2-rockchip/Platform/Mekotronics/R58-Mini/AcpiTables/Dsdt.asl index a48463eff..5071e698c 100644 --- a/edk2-rockchip/Platform/Mekotronics/R58-Mini/AcpiTables/Dsdt.asl +++ b/edk2-rockchip/Platform/Mekotronics/R58-Mini/AcpiTables/Dsdt.asl @@ -27,9 +27,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RPIFDN", "RPI", 2) include ("Uart.asl") // include ("Spi.asl") - // won't work on Windows, will trigger bugcheck by usbehci - // include ("Usb2.asl") - + include ("Usb1Host.asl") include ("Usb3Host0.asl") include ("Usb3Host1.asl") include ("Usb3Host2.asl") diff --git a/edk2-rockchip/Platform/Mekotronics/R58X/AcpiTables/AcpiTables.inf b/edk2-rockchip/Platform/Mekotronics/R58X/AcpiTables/AcpiTables.inf index 25e1bd08d..ce0383215 100644 --- a/edk2-rockchip/Platform/Mekotronics/R58X/AcpiTables/AcpiTables.inf +++ b/edk2-rockchip/Platform/Mekotronics/R58X/AcpiTables/AcpiTables.inf @@ -39,6 +39,7 @@ $(RK_COMMON_ACPI_DIR)/Sata0.asl $(RK_COMMON_ACPI_DIR)/Sata1.asl $(RK_COMMON_ACPI_DIR)/Sata2.asl + $(RK_COMMON_ACPI_DIR)/Usb2Host.asl [Packages] ArmPkg/ArmPkg.dec diff --git a/edk2-rockchip/Platform/Mekotronics/R58X/AcpiTables/Dsdt.asl b/edk2-rockchip/Platform/Mekotronics/R58X/AcpiTables/Dsdt.asl index a48463eff..5071e698c 100644 --- a/edk2-rockchip/Platform/Mekotronics/R58X/AcpiTables/Dsdt.asl +++ b/edk2-rockchip/Platform/Mekotronics/R58X/AcpiTables/Dsdt.asl @@ -27,9 +27,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RPIFDN", "RPI", 2) include ("Uart.asl") // include ("Spi.asl") - // won't work on Windows, will trigger bugcheck by usbehci - // include ("Usb2.asl") - + include ("Usb1Host.asl") include ("Usb3Host0.asl") include ("Usb3Host1.asl") include ("Usb3Host2.asl") diff --git a/edk2-rockchip/Platform/Mixtile/Blade3/AcpiTables/AcpiTables.inf b/edk2-rockchip/Platform/Mixtile/Blade3/AcpiTables/AcpiTables.inf index 25e1bd08d..ce0383215 100644 --- a/edk2-rockchip/Platform/Mixtile/Blade3/AcpiTables/AcpiTables.inf +++ b/edk2-rockchip/Platform/Mixtile/Blade3/AcpiTables/AcpiTables.inf @@ -39,6 +39,7 @@ $(RK_COMMON_ACPI_DIR)/Sata0.asl $(RK_COMMON_ACPI_DIR)/Sata1.asl $(RK_COMMON_ACPI_DIR)/Sata2.asl + $(RK_COMMON_ACPI_DIR)/Usb2Host.asl [Packages] ArmPkg/ArmPkg.dec diff --git a/edk2-rockchip/Platform/Mixtile/Blade3/AcpiTables/Dsdt.asl b/edk2-rockchip/Platform/Mixtile/Blade3/AcpiTables/Dsdt.asl index a48463eff..5071e698c 100644 --- a/edk2-rockchip/Platform/Mixtile/Blade3/AcpiTables/Dsdt.asl +++ b/edk2-rockchip/Platform/Mixtile/Blade3/AcpiTables/Dsdt.asl @@ -27,9 +27,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RPIFDN", "RPI", 2) include ("Uart.asl") // include ("Spi.asl") - // won't work on Windows, will trigger bugcheck by usbehci - // include ("Usb2.asl") - + include ("Usb1Host.asl") include ("Usb3Host0.asl") include ("Usb3Host1.asl") include ("Usb3Host2.asl") diff --git a/edk2-rockchip/Platform/OrangePi/OrangePi5/AcpiTables/AcpiTables.inf b/edk2-rockchip/Platform/OrangePi/OrangePi5/AcpiTables/AcpiTables.inf index 25e1bd08d..ce0383215 100644 --- a/edk2-rockchip/Platform/OrangePi/OrangePi5/AcpiTables/AcpiTables.inf +++ b/edk2-rockchip/Platform/OrangePi/OrangePi5/AcpiTables/AcpiTables.inf @@ -39,6 +39,7 @@ $(RK_COMMON_ACPI_DIR)/Sata0.asl $(RK_COMMON_ACPI_DIR)/Sata1.asl $(RK_COMMON_ACPI_DIR)/Sata2.asl + $(RK_COMMON_ACPI_DIR)/Usb2Host.asl [Packages] ArmPkg/ArmPkg.dec diff --git a/edk2-rockchip/Platform/OrangePi/OrangePi5/AcpiTables/Dsdt.asl b/edk2-rockchip/Platform/OrangePi/OrangePi5/AcpiTables/Dsdt.asl index 67fcdf8bb..6edf9c0a7 100755 --- a/edk2-rockchip/Platform/OrangePi/OrangePi5/AcpiTables/Dsdt.asl +++ b/edk2-rockchip/Platform/OrangePi/OrangePi5/AcpiTables/Dsdt.asl @@ -27,9 +27,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RPIFDN", "RPI", 2) include ("Uart.asl") // include ("Spi.asl") - // won't work on Windows, will trigger bugcheck by usbehci - // include ("Usb2.asl") - + include ("Usb1Host.asl") include ("Usb3Host0.asl") include ("Usb3Host2.asl") } diff --git a/edk2-rockchip/Platform/OrangePi/OrangePi5Plus/AcpiTables/AcpiTables.inf b/edk2-rockchip/Platform/OrangePi/OrangePi5Plus/AcpiTables/AcpiTables.inf index 25e1bd08d..ce0383215 100644 --- a/edk2-rockchip/Platform/OrangePi/OrangePi5Plus/AcpiTables/AcpiTables.inf +++ b/edk2-rockchip/Platform/OrangePi/OrangePi5Plus/AcpiTables/AcpiTables.inf @@ -39,6 +39,7 @@ $(RK_COMMON_ACPI_DIR)/Sata0.asl $(RK_COMMON_ACPI_DIR)/Sata1.asl $(RK_COMMON_ACPI_DIR)/Sata2.asl + $(RK_COMMON_ACPI_DIR)/Usb2Host.asl [Packages] ArmPkg/ArmPkg.dec diff --git a/edk2-rockchip/Platform/OrangePi/OrangePi5Plus/AcpiTables/Dsdt.asl b/edk2-rockchip/Platform/OrangePi/OrangePi5Plus/AcpiTables/Dsdt.asl index 85f45d6cc..658ed7b31 100644 --- a/edk2-rockchip/Platform/OrangePi/OrangePi5Plus/AcpiTables/Dsdt.asl +++ b/edk2-rockchip/Platform/OrangePi/OrangePi5Plus/AcpiTables/Dsdt.asl @@ -27,9 +27,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RPIFDN", "RPI", 2) include ("Uart.asl") // include ("Spi.asl") - // won't work on Windows, will trigger bugcheck by usbehci - // include ("Usb2.asl") - + include ("Usb1Host.asl") include ("Usb3Host0.asl") include ("Usb3Host2.asl") } diff --git a/edk2-rockchip/Platform/Radxa/ROCK5A/AcpiTables/AcpiTables.inf b/edk2-rockchip/Platform/Radxa/ROCK5A/AcpiTables/AcpiTables.inf index 25e1bd08d..ce0383215 100644 --- a/edk2-rockchip/Platform/Radxa/ROCK5A/AcpiTables/AcpiTables.inf +++ b/edk2-rockchip/Platform/Radxa/ROCK5A/AcpiTables/AcpiTables.inf @@ -39,6 +39,7 @@ $(RK_COMMON_ACPI_DIR)/Sata0.asl $(RK_COMMON_ACPI_DIR)/Sata1.asl $(RK_COMMON_ACPI_DIR)/Sata2.asl + $(RK_COMMON_ACPI_DIR)/Usb2Host.asl [Packages] ArmPkg/ArmPkg.dec diff --git a/edk2-rockchip/Platform/Radxa/ROCK5A/AcpiTables/Dsdt.asl b/edk2-rockchip/Platform/Radxa/ROCK5A/AcpiTables/Dsdt.asl index 85f45d6cc..658ed7b31 100755 --- a/edk2-rockchip/Platform/Radxa/ROCK5A/AcpiTables/Dsdt.asl +++ b/edk2-rockchip/Platform/Radxa/ROCK5A/AcpiTables/Dsdt.asl @@ -27,9 +27,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RPIFDN", "RPI", 2) include ("Uart.asl") // include ("Spi.asl") - // won't work on Windows, will trigger bugcheck by usbehci - // include ("Usb2.asl") - + include ("Usb1Host.asl") include ("Usb3Host0.asl") include ("Usb3Host2.asl") } diff --git a/edk2-rockchip/Platform/Radxa/ROCK5B/AcpiTables/AcpiTables.inf b/edk2-rockchip/Platform/Radxa/ROCK5B/AcpiTables/AcpiTables.inf index 25e1bd08d..ce0383215 100644 --- a/edk2-rockchip/Platform/Radxa/ROCK5B/AcpiTables/AcpiTables.inf +++ b/edk2-rockchip/Platform/Radxa/ROCK5B/AcpiTables/AcpiTables.inf @@ -39,6 +39,7 @@ $(RK_COMMON_ACPI_DIR)/Sata0.asl $(RK_COMMON_ACPI_DIR)/Sata1.asl $(RK_COMMON_ACPI_DIR)/Sata2.asl + $(RK_COMMON_ACPI_DIR)/Usb2Host.asl [Packages] ArmPkg/ArmPkg.dec diff --git a/edk2-rockchip/Platform/Radxa/ROCK5B/AcpiTables/Dsdt.asl b/edk2-rockchip/Platform/Radxa/ROCK5B/AcpiTables/Dsdt.asl index a48463eff..5071e698c 100755 --- a/edk2-rockchip/Platform/Radxa/ROCK5B/AcpiTables/Dsdt.asl +++ b/edk2-rockchip/Platform/Radxa/ROCK5B/AcpiTables/Dsdt.asl @@ -27,9 +27,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RPIFDN", "RPI", 2) include ("Uart.asl") // include ("Spi.asl") - // won't work on Windows, will trigger bugcheck by usbehci - // include ("Usb2.asl") - + include ("Usb1Host.asl") include ("Usb3Host0.asl") include ("Usb3Host1.asl") include ("Usb3Host2.asl") diff --git a/edk2-rockchip/Silicon/Rockchip/RK3588/AcpiTables/Usb1Host.asl b/edk2-rockchip/Silicon/Rockchip/RK3588/AcpiTables/Usb1Host.asl new file mode 100644 index 000000000..1166be078 --- /dev/null +++ b/edk2-rockchip/Silicon/Rockchip/RK3588/AcpiTables/Usb1Host.asl @@ -0,0 +1,108 @@ +/** @file + * + * USB 1.1 (OHCI) controllers. + * + * Copyright (c) 2022, Rockchip Electronics Co., Ltd + * Copyright (c) 2023, Mario Bălănică + * + * SPDX-License-Identifier: BSD-2-Clause-Patent + * + **/ + +#include "AcpiTables.h" + +Device (OHC0) { + Name (_HID, "PRP0001") + Name (_CLS, Package() { 0x0c, 0x03, 0x10 }) + Name (_UID, Zero) + Name (_CCA, Zero) + + Name (_DSD, Package () { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { + Package () { "compatible", "generic-ohci" }, + } + }) + + Method (_CRS, 0x0, Serialized) { + Name (RBUF, ResourceTemplate() { + Memory32Fixed (ReadWrite, 0xFC840000, 0x40000) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 248 } + }) + Return (RBUF) + } + + Device (RHUB) { + Name (_ADR, 0) + Device (PRT1) { + Name (_ADR, 1) + Name (_UPC, Package() { + 0xFF, // Port is connectable + 0x00, // Connector type - Type 'A' + 0x00000000, // Reserved, must be zero + 0x00000000 // Reserved, must be zero + }) + Name (_PLD, Package (0x01) { + ToPLD ( + PLD_Revision = 0x2, + PLD_IgnoreColor = 0x1, + PLD_UserVisible = 0x1, + PLD_Panel = "UNKNOWN", + PLD_VerticalPosition = "UPPER", + PLD_HorizontalPosition = "LEFT", + PLD_Shape = "HORIZONTALRECTANGLE", + PLD_Ejectable = 0x1, + PLD_EjectRequired = 0x1, + ) + }) + } + } +} + +Device (OHC1) { + Name (_HID, "PRP0001") + Name (_CLS, Package() { 0x0c, 0x03, 0x10 }) + Name (_UID, One) + Name (_CCA, Zero) + + Name (_DSD, Package () { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { + Package () { "compatible", "generic-ohci" }, + } + }) + + Method (_CRS, 0x0, Serialized) { + Name (RBUF, ResourceTemplate() { + Memory32Fixed (ReadWrite, 0xFC8C0000, 0x40000) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 251 } + }) + Return (RBUF) + } + + Device (RHUB) { + Name (_ADR, 0) + Device (PRT1) { + Name (_ADR, 1) + Name (_UPC, Package() { + 0xFF, // Port is connectable + 0x00, // Connector type - Type 'A' + 0x00000000, // Reserved, must be zero + 0x00000000 // Reserved, must be zero + }) + Name (_PLD, Package (0x01) { + ToPLD ( + PLD_Revision = 0x2, + PLD_IgnoreColor = 0x1, + PLD_UserVisible = 0x1, + PLD_Panel = "UNKNOWN", + PLD_VerticalPosition = "LOWER", + PLD_HorizontalPosition = "LEFT", + PLD_Shape = "HORIZONTALRECTANGLE", + PLD_Ejectable = 0x1, + PLD_EjectRequired = 0x1, + ) + }) + } + } +} diff --git a/edk2-rockchip/Silicon/Rockchip/RK3588/AcpiTables/Usb2Host.asl b/edk2-rockchip/Silicon/Rockchip/RK3588/AcpiTables/Usb2Host.asl index 8468e3456..de93e89c9 100644 --- a/edk2-rockchip/Silicon/Rockchip/RK3588/AcpiTables/Usb2Host.asl +++ b/edk2-rockchip/Silicon/Rockchip/RK3588/AcpiTables/Usb2Host.asl @@ -1,189 +1,98 @@ /** @file -* USB2 devices. -* -* Copyright (c) 2022, Rockchip Electronics Co., Ltd -* -* SPDX-License-Identifier: BSD-2-Clause-Patent -**/ + * + * USB 2.0 (EHCI) controllers. + * + * Copyright (c) 2022, Rockchip Electronics Co., Ltd + * Copyright (c) 2023, Mario Bălănică + * + * SPDX-License-Identifier: BSD-2-Clause-Patent + * + **/ #include "AcpiTables.h" -// USB OHCI Host Controller -Device (OHC0) { - Name (_HID, "PRP0001") - Name (_CLS, Package() { 0x0c, 0x03, 0x10 }) - Name (_UID, Zero) - Name (_CCA, Zero) +DefinitionBlock (__FILE__, "SSDT", 5, "RKCP ", "USB2HOST", 2) +{ + Scope (\_SB_) + { + Device (EHC0) { + Name (_HID, "PNP0D20") + Name (_UID, Zero) + Name (_CCA, Zero) - Name (_DSD, Package () { - ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package () { - Package () { "compatible", "generic-ohci" }, - } - }) - - Method (_CRS, 0x0, Serialized) { + Method (_CRS, 0x0, Serialized) { Name (RBUF, ResourceTemplate() { - Memory32Fixed (ReadWrite, 0xFC840000, 0x40000) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 248 } + Memory32Fixed (ReadWrite, 0xFC800000, 0x40000) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 247 } }) Return (RBUF) - } + } - Device (RHUB) { + Device (RHUB) { Name (_ADR, 0) Device (PRT1) { - Name (_ADR, 1) - Name (_UPC, Package() { - 0xFF, // Port is connectable - 0x00, // Connector type - Type 'A' - 0x00000000, // Reserved, must be zero - 0x00000000 // Reserved, must be zero - }) - Name (_PLD, Package (0x01) { - ToPLD ( - PLD_Revision = 0x2, - PLD_IgnoreColor = 0x1, - PLD_UserVisible = 0x1, - PLD_Panel = "UNKNOWN", - PLD_VerticalPosition = "UPPER", - PLD_HorizontalPosition = "LEFT", - PLD_Shape = "HORIZONTALRECTANGLE", - PLD_Ejectable = 0x1, - PLD_EjectRequired = 0x1, - ) - }) - } - } -} - -// USB EHCI Host Controller -Device (EHC0) { - Name (_HID, "PNP0D20") - Name (_UID, Zero) - Name (_CCA, Zero) - - Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate() { - Memory32Fixed (ReadWrite, 0xFC800000, 0x40000) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 247 } - }) - Return (RBUF) - } - - Device (RHUB) { - Name (_ADR, 0) - Device (PRT1) { - Name (_ADR, 1) - Name (_UPC, Package() { + Name (_ADR, 1) + Name (_UPC, Package() { 0xFF, // Port is connectable 0x00, // Connector type - Type 'A' 0x00000000, // Reserved, must be zero 0x00000000 // Reserved, must be zero - }) - Name (_PLD, Package (0x01) { + }) + Name (_PLD, Package (0x01) { ToPLD ( - PLD_Revision = 0x2, - PLD_IgnoreColor = 0x1, - PLD_UserVisible = 0x1, - PLD_Panel = "UNKNOWN", - PLD_VerticalPosition = "UPPER", - PLD_HorizontalPosition = "LEFT", - PLD_Shape = "HORIZONTALRECTANGLE", - PLD_Ejectable = 0x1, - PLD_EjectRequired = 0x1, + PLD_Revision = 0x2, + PLD_IgnoreColor = 0x1, + PLD_UserVisible = 0x1, + PLD_Panel = "UNKNOWN", + PLD_VerticalPosition = "UPPER", + PLD_HorizontalPosition = "LEFT", + PLD_Shape = "HORIZONTALRECTANGLE", + PLD_Ejectable = 0x1, + PLD_EjectRequired = 0x1, ) - }) - } - } -} - -// USB OHCI Host Controller -Device (OHC1) { - Name (_HID, "PRP0001") - Name (_CLS, Package() { 0x0c, 0x03, 0x10 }) - Name (_UID, One) - Name (_CCA, Zero) - - Name (_DSD, Package () { - ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package () { - Package () { "compatible", "generic-ohci" }, + }) } - }) - - Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate() { - Memory32Fixed (ReadWrite, 0xFC8C0000, 0x40000) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 251 } - }) - Return (RBUF) + } } - Device (RHUB) { - Name (_ADR, 0) - Device (PRT1) { - Name (_ADR, 1) - Name (_UPC, Package() { - 0xFF, // Port is connectable - 0x00, // Connector type - Type 'A' - 0x00000000, // Reserved, must be zero - 0x00000000 // Reserved, must be zero - }) - Name (_PLD, Package (0x01) { - ToPLD ( - PLD_Revision = 0x2, - PLD_IgnoreColor = 0x1, - PLD_UserVisible = 0x1, - PLD_Panel = "UNKNOWN", - PLD_VerticalPosition = "LOWER", - PLD_HorizontalPosition = "LEFT", - PLD_Shape = "HORIZONTALRECTANGLE", - PLD_Ejectable = 0x1, - PLD_EjectRequired = 0x1, - ) - }) - } - } -} + Device (EHC1) { + Name (_HID, "PNP0D20") + Name (_UID, One) + Name (_CCA, Zero) -// USB EHCI Host Controller -Device (EHC1) { - Name (_HID, "PNP0D20") - Name (_UID, One) - Name (_CCA, Zero) - - Method (_CRS, 0x0, Serialized) { + Method (_CRS, 0x0, Serialized) { Name (RBUF, ResourceTemplate() { - Memory32Fixed (ReadWrite, 0xFC880000, 0x40000) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 250 } + Memory32Fixed (ReadWrite, 0xFC880000, 0x40000) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 250 } }) Return (RBUF) - } + } - Device (RHUB) { + Device (RHUB) { Name (_ADR, 0) Device (PRT1) { - Name (_ADR, 1) - Name (_UPC, Package() { - 0xFF, // Port is connectable - 0x00, // Connector type - Type 'A' - 0x00000000, // Reserved, must be zero - 0x00000000 // Reserved, must be zero - }) - Name (_PLD, Package (0x01) { - ToPLD ( - PLD_Revision = 0x2, - PLD_IgnoreColor = 0x1, - PLD_UserVisible = 0x1, - PLD_Panel = "UNKNOWN", - PLD_VerticalPosition = "LOWER", - PLD_HorizontalPosition = "LEFT", - PLD_Shape = "HORIZONTALRECTANGLE", - PLD_Ejectable = 0x1, - PLD_EjectRequired = 0x1, - ) - }) + Name (_ADR, 1) + Name (_UPC, Package() { + 0xFF, // Port is connectable + 0x00, // Connector type - Type 'A' + 0x00000000, // Reserved, must be zero + 0x00000000 // Reserved, must be zero + }) + Name (_PLD, Package (0x01) { + ToPLD ( + PLD_Revision = 0x2, + PLD_IgnoreColor = 0x1, + PLD_UserVisible = 0x1, + PLD_Panel = "UNKNOWN", + PLD_VerticalPosition = "LOWER", + PLD_HorizontalPosition = "LEFT", + PLD_Shape = "HORIZONTALRECTANGLE", + PLD_Ejectable = 0x1, + PLD_EjectRequired = 0x1, + ) + }) } + } } -} + } // Scope (\_SB_) +} // DefinitionBlock diff --git a/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/Acpi.c b/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/Acpi.c new file mode 100644 index 000000000..bd8dc7d64 --- /dev/null +++ b/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/Acpi.c @@ -0,0 +1,208 @@ +/** @file + * + * Copyright (c) 2020, Jeremy Linton + * Copyright (c) 2023, Mario Bălănică + * + * SPDX-License-Identifier: BSD-2-Clause-Patent + * + **/ + +#include +#include +#include +#include +#include + +#include "RK3588DxeFormSetGuid.h" +#include "Acpi.h" + +STATIC CONST EFI_GUID mAcpiTableFile = { + 0x7E374E25, 0x8E01, 0x4FEE, { 0x87, 0xf2, 0x39, 0x0C, 0x23, 0xC6, 0x06, 0xCD } +}; + +typedef struct { + CHAR8 Name[4]; + UINTN PcdToken; +} AML_NAME_OP_REPLACE; + +#define SSDT_PATTERN_LEN 5 +#define AML_NAMEOP_8 0x0A +#define AML_NAMEOP_16 0x0B +#define AML_NAMEOP_32 0x0C +#define AML_NAMEOP_STR 0x0D +// +// Scan the given namespace table (DSDT/SSDT) for AML NameOps +// listed in the NameOpReplace structure. If one is found then +// update the value in the table from the specified Pcd +// +// This allows us to have conditionals in AML controlled +// by options in the BDS or detected during firmware bootstrap. +// We could extend this concept for strings/etc but due to len +// variations its probably easier to encode the strings +// in the ASL and pick the correct one based off a variable. +// +STATIC +VOID +AcpiUpdateSdtNameOps ( + EFI_ACPI_DESCRIPTION_HEADER *AcpiTable, + CONST AML_NAME_OP_REPLACE *NameOpReplace + ) +{ + UINTN Idx; + UINTN Index; + CHAR8 Pattern[SSDT_PATTERN_LEN]; + UINTN PcdVal; + UINT8 *SdtPtr; + UINT32 SdtSize; + + SdtSize = AcpiTable->Length; + + if (SdtSize > 0) { + SdtPtr = (UINT8 *)AcpiTable; + + for (Idx = 0; NameOpReplace && NameOpReplace[Idx].PcdToken; Idx++) { + // + // Do a single NameOp variable replacement these are of the + // form 08 XXXX SIZE VAL, where SIZE is 0A=byte, 0B=word, 0C=dword + // and XXXX is the name and VAL is the value + // + Pattern[0] = 0x08; + Pattern[1] = NameOpReplace[Idx].Name[0]; + Pattern[2] = NameOpReplace[Idx].Name[1]; + Pattern[3] = NameOpReplace[Idx].Name[2]; + Pattern[4] = NameOpReplace[Idx].Name[3]; + + for (Index = 0; Index < (SdtSize - SSDT_PATTERN_LEN); Index++) { + if (CompareMem (SdtPtr + Index, Pattern, SSDT_PATTERN_LEN) == 0) { + PcdVal = LibPcdGet32 (NameOpReplace[Idx].PcdToken); + switch (SdtPtr[Index + SSDT_PATTERN_LEN]) { + case AML_NAMEOP_32: + SdtPtr[Index + SSDT_PATTERN_LEN + 4] = (PcdVal >> 24) & 0xFF; + SdtPtr[Index + SSDT_PATTERN_LEN + 3] = (PcdVal >> 16) & 0xFF; + // Fallthrough + case AML_NAMEOP_16: + SdtPtr[Index + SSDT_PATTERN_LEN + 2] = (PcdVal >> 8) & 0xFF; + // Fallthrough + case AML_NAMEOP_8: + SdtPtr[Index + SSDT_PATTERN_LEN + 1] = PcdVal & 0xFF; + break; + case 0: + case 1: + SdtPtr[Index + SSDT_PATTERN_LEN + 1] = !!PcdVal; + break; + case AML_NAMEOP_STR: + // + // If the string val is added to the NameOpReplace, we can + // dynamically update things like _HID too as long as the + // string length matches. + // + break; + } + break; + } + } + } + } +} + +STATIC +BOOLEAN +AcpiVerifyUpdateTable ( + IN EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader + ) +{ + BOOLEAN Result; + AML_NAME_OP_REPLACE *NameOpReplace; + + Result = TRUE; + NameOpReplace = NULL; + + switch (AcpiHeader->OemTableId) { + case SIGNATURE_64 ('P', 'C', 'I', 'E', '3', '4', 'L', '0'): + Result = FixedPcdGetBool (PcdPcie30Supported) + && PcdGet32 (PcdPcie30State) == PCIE30_STATE_ENABLED; + break; + case SIGNATURE_64 ('P', 'C', 'I', 'E', '3', '2', 'L', '0'): + Result = FALSE; // not supported yet + break; + case SIGNATURE_64 ('P', 'C', 'I', 'E', '2', '1', 'L', '0'): + Result = PcdGet32 (PcdComboPhy1Mode) == COMBO_PHY_MODE_PCIE; + break; + case SIGNATURE_64 ('P', 'C', 'I', 'E', '2', '1', 'L', '1'): + Result = PcdGet32 (PcdComboPhy2Mode) == COMBO_PHY_MODE_PCIE; + break; + case SIGNATURE_64 ('P', 'C', 'I', 'E', '2', '1', 'L', '2'): + Result = PcdGet32 (PcdComboPhy0Mode) == COMBO_PHY_MODE_PCIE; + break; + case SIGNATURE_64 ('A', 'H', 'C', 'S', 'A', 'T', 'A', '0'): + Result = PcdGet32 (PcdComboPhy0Mode) == COMBO_PHY_MODE_SATA; + break; + case SIGNATURE_64 ('A', 'H', 'C', 'S', 'A', 'T', 'A', '1'): + Result = PcdGet32 (PcdComboPhy1Mode) == COMBO_PHY_MODE_SATA; + break; + case SIGNATURE_64 ('A', 'H', 'C', 'S', 'A', 'T', 'A', '2'): + Result = PcdGet32 (PcdComboPhy2Mode) == COMBO_PHY_MODE_SATA; + break; + case SIGNATURE_64 ('U', 'S', 'B', '2', 'H', 'O', 'S', 'T'): + Result = PcdGet32 (PcdAcpiUsb2State) == ACPI_USB2_STATE_ENABLED; + break; + } + + if (Result && NameOpReplace) { + AcpiUpdateSdtNameOps (AcpiHeader, NameOpReplace); + } + + return Result; +} + +// +// Monitor the ACPI tables being installed and when +// a DSDT/SSDT is detected validate that we want to +// install it, and if so update any "NameOp" defined +// variables contained in the table from PCD values +// +STATIC +BOOLEAN +AcpiHandleDynamicNamespace ( + IN EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader + ) +{ + switch (AcpiHeader->Signature) { + case SIGNATURE_32 ('D', 'S', 'D', 'T'): + case SIGNATURE_32 ('S', 'S', 'D', 'T'): + return AcpiVerifyUpdateTable (AcpiHeader); + } + + return TRUE; +} + +VOID +EFIAPI +ApplyAcpiVariables ( + VOID + ) +{ + // TO-DO: Add a HII variable to let the user decide if they want ACPI (and/or DT). + LocateAndInstallAcpiFromFvConditional (&mAcpiTableFile, &AcpiHandleDynamicNamespace); +} + +VOID +EFIAPI +SetupAcpiVariables ( + VOID + ) +{ + UINTN Size; + UINT32 Var32; + EFI_STATUS Status; + + Size = sizeof (UINT32); + + Status = gRT->GetVariable (L"AcpiUsb2State", + &gRK3588DxeFormSetGuid, + NULL, &Size, &Var32); + if (EFI_ERROR (Status)) { + Status = PcdSet32S (PcdAcpiUsb2State, FixedPcdGet32 (PcdAcpiUsb2StateDefault)); + ASSERT_EFI_ERROR (Status); + } +} diff --git a/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/Acpi.h b/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/Acpi.h new file mode 100644 index 000000000..345c7577d --- /dev/null +++ b/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/Acpi.h @@ -0,0 +1,29 @@ +/** @file + * + * Copyright (c) 2023, Mario Bălănică + * + * SPDX-License-Identifier: BSD-2-Clause-Patent + * + **/ + +#ifndef __RK3588DXE_ACPI_H__ +#define __RK3588DXE_ACPI_H__ + +// +// Don't declare these in the VFR file. +// +#ifndef VFR_FILE_INCLUDE +VOID +EFIAPI +ApplyAcpiVariables ( + VOID + ); + +VOID +EFIAPI +SetupAcpiVariables ( + VOID + ); +#endif // VFR_FILE_INCLUDE + +#endif // __RK3588DXE_ACPI_H__ diff --git a/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/RK3588Dxe.c b/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/RK3588Dxe.c index cfffc45b4..38d0d0b1b 100644 --- a/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/RK3588Dxe.c +++ b/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/RK3588Dxe.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -34,6 +33,7 @@ #include "CpuPerformance.h" #include "ComboPhy.h" #include "PciExpress30.h" +#include "Acpi.h" extern UINT8 RK3588DxeHiiBin[]; extern UINT8 RK3588DxeStrings[]; @@ -110,163 +110,6 @@ InstallSataDevices ( } } -STATIC CONST EFI_GUID mAcpiTableFile = { - 0x7E374E25, 0x8E01, 0x4FEE, { 0x87, 0xf2, 0x39, 0x0C, 0x23, 0xC6, 0x06, 0xCD } -}; - -typedef struct { - CHAR8 Name[4]; - UINTN PcdToken; -} AML_NAME_OP_REPLACE; - -#define SSDT_PATTERN_LEN 5 -#define AML_NAMEOP_8 0x0A -#define AML_NAMEOP_16 0x0B -#define AML_NAMEOP_32 0x0C -#define AML_NAMEOP_STR 0x0D -// -// Scan the given namespace table (DSDT/SSDT) for AML NameOps -// listed in the NameOpReplace structure. If one is found then -// update the value in the table from the specified Pcd -// -// This allows us to have conditionals in AML controlled -// by options in the BDS or detected during firmware bootstrap. -// We could extend this concept for strings/etc but due to len -// variations its probably easier to encode the strings -// in the ASL and pick the correct one based off a variable. -// -STATIC -VOID -AcpiUpdateSdtNameOps ( - EFI_ACPI_DESCRIPTION_HEADER *AcpiTable, - CONST AML_NAME_OP_REPLACE *NameOpReplace - ) -{ - UINTN Idx; - UINTN Index; - CHAR8 Pattern[SSDT_PATTERN_LEN]; - UINTN PcdVal; - UINT8 *SdtPtr; - UINT32 SdtSize; - - SdtSize = AcpiTable->Length; - - if (SdtSize > 0) { - SdtPtr = (UINT8 *)AcpiTable; - - for (Idx = 0; NameOpReplace && NameOpReplace[Idx].PcdToken; Idx++) { - // - // Do a single NameOp variable replacement these are of the - // form 08 XXXX SIZE VAL, where SIZE is 0A=byte, 0B=word, 0C=dword - // and XXXX is the name and VAL is the value - // - Pattern[0] = 0x08; - Pattern[1] = NameOpReplace[Idx].Name[0]; - Pattern[2] = NameOpReplace[Idx].Name[1]; - Pattern[3] = NameOpReplace[Idx].Name[2]; - Pattern[4] = NameOpReplace[Idx].Name[3]; - - for (Index = 0; Index < (SdtSize - SSDT_PATTERN_LEN); Index++) { - if (CompareMem (SdtPtr + Index, Pattern, SSDT_PATTERN_LEN) == 0) { - PcdVal = LibPcdGet32 (NameOpReplace[Idx].PcdToken); - switch (SdtPtr[Index + SSDT_PATTERN_LEN]) { - case AML_NAMEOP_32: - SdtPtr[Index + SSDT_PATTERN_LEN + 4] = (PcdVal >> 24) & 0xFF; - SdtPtr[Index + SSDT_PATTERN_LEN + 3] = (PcdVal >> 16) & 0xFF; - // Fallthrough - case AML_NAMEOP_16: - SdtPtr[Index + SSDT_PATTERN_LEN + 2] = (PcdVal >> 8) & 0xFF; - // Fallthrough - case AML_NAMEOP_8: - SdtPtr[Index + SSDT_PATTERN_LEN + 1] = PcdVal & 0xFF; - break; - case 0: - case 1: - SdtPtr[Index + SSDT_PATTERN_LEN + 1] = !!PcdVal; - break; - case AML_NAMEOP_STR: - // - // If the string val is added to the NameOpReplace, we can - // dynamically update things like _HID too as long as the - // string length matches. - // - break; - } - break; - } - } - } - } -} - -STATIC -BOOLEAN -AcpiVerifyUpdateTable ( - IN EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader - ) -{ - BOOLEAN Result; - AML_NAME_OP_REPLACE *NameOpReplace; - - Result = TRUE; - NameOpReplace = NULL; - - switch (AcpiHeader->OemTableId) { - case SIGNATURE_64 ('P', 'C', 'I', 'E', '3', '4', 'L', '0'): - Result = FixedPcdGetBool (PcdPcie30Supported) - && PcdGet32 (PcdPcie30State) == PCIE30_STATE_ENABLED; - break; - case SIGNATURE_64 ('P', 'C', 'I', 'E', '3', '2', 'L', '0'): - Result = FALSE; // not supported yet - break; - case SIGNATURE_64 ('P', 'C', 'I', 'E', '2', '1', 'L', '0'): - Result = PcdGet32 (PcdComboPhy1Mode) == COMBO_PHY_MODE_PCIE; - break; - case SIGNATURE_64 ('P', 'C', 'I', 'E', '2', '1', 'L', '1'): - Result = PcdGet32 (PcdComboPhy2Mode) == COMBO_PHY_MODE_PCIE; - break; - case SIGNATURE_64 ('P', 'C', 'I', 'E', '2', '1', 'L', '2'): - Result = PcdGet32 (PcdComboPhy0Mode) == COMBO_PHY_MODE_PCIE; - break; - case SIGNATURE_64 ('A', 'H', 'C', 'S', 'A', 'T', 'A', '0'): - Result = PcdGet32 (PcdComboPhy0Mode) == COMBO_PHY_MODE_SATA; - break; - case SIGNATURE_64 ('A', 'H', 'C', 'S', 'A', 'T', 'A', '1'): - Result = PcdGet32 (PcdComboPhy1Mode) == COMBO_PHY_MODE_SATA; - break; - case SIGNATURE_64 ('A', 'H', 'C', 'S', 'A', 'T', 'A', '2'): - Result = PcdGet32 (PcdComboPhy2Mode) == COMBO_PHY_MODE_SATA; - break; - } - - if (Result && NameOpReplace) { - AcpiUpdateSdtNameOps (AcpiHeader, NameOpReplace); - } - - return Result; -} - -// -// Monitor the ACPI tables being installed and when -// a DSDT/SSDT is detected validate that we want to -// install it, and if so update any "NameOp" defined -// variables contained in the table from PCD values -// -STATIC -BOOLEAN -AcpiHandleDynamicNamespace ( - IN EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader - ) -{ - switch (AcpiHeader->Signature) { - case SIGNATURE_32 ('D', 'S', 'D', 'T'): - case SIGNATURE_32 ('S', 'S', 'D', 'T'): - return AcpiVerifyUpdateTable (AcpiHeader); - } - - return TRUE; -} - STATIC EFI_STATUS EFIAPI @@ -313,6 +156,7 @@ SetupVariables ( SetupCpuPerfVariables (); SetupComboPhyVariables (); SetupPcie30Variables (); + SetupAcpiVariables (); return EFI_SUCCESS; } @@ -325,9 +169,6 @@ AfterApplyVariablesInit ( ) { InstallSataDevices (); - - // TO-DO: Add a HII variable to let the user decide if they want ACPI (and/or DT). - LocateAndInstallAcpiFromFvConditional (&mAcpiTableFile, &AcpiHandleDynamicNamespace); } STATIC @@ -340,6 +181,7 @@ ApplyVariables ( ApplyCpuClockVariables (); ApplyComboPhyVariables (); ApplyPcie30Variables (); + ApplyAcpiVariables (); AfterApplyVariablesInit (); } diff --git a/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/RK3588Dxe.inf b/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/RK3588Dxe.inf index 70e137ff0..aeff5e014 100644 --- a/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/RK3588Dxe.inf +++ b/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/RK3588Dxe.inf @@ -18,6 +18,7 @@ CpuPerformance.c ComboPhy.c PciExpress30.c + Acpi.c RK3588DxeHii.uni RK3588DxeHii.vfr @@ -86,6 +87,9 @@ gRK3588TokenSpaceGuid.PcdPcie30Supported gRK3588TokenSpaceGuid.PcdPcie30State + gRK3588TokenSpaceGuid.PcdAcpiUsb2StateDefault + gRK3588TokenSpaceGuid.PcdAcpiUsb2State + [Guids] gRK3588DxeFormSetGuid gEfiEndOfDxeEventGroupGuid diff --git a/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/RK3588DxeHii.uni b/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/RK3588DxeHii.uni index fa04552ca..8f7a04934 100644 --- a/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/RK3588DxeHii.uni +++ b/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/RK3588DxeHii.uni @@ -14,6 +14,12 @@ #string STR_FORM_SET_TITLE_HELP #language en-US "Configure various platform settings." #string STR_FORM_SET_TITLE_SUBTITLE #language en-US "Configuration Options" +/* + * Common strings + */ +#string STR_DISABLED #language en-US "Disabled" +#string STR_ENABLED #language en-US "Enabled" + /* * CPU Performance configuration */ @@ -104,7 +110,13 @@ #string STR_PCIE30_FORM_HELP #language en-US "Configure the PCIe 3.0 operation modes." #string STR_PCIE30_STATE_PROMPT #language en-US "Support State" -#string STR_PCIE30_STATE_DISABLED #language en-US "Disabled" -#string STR_PCIE30_STATE_ENABLED #language en-US "Enabled" - #string STR_PCIE30_STATE_HELP #language en-US "Enable or disable PCIe 3.0 support." + +/* + * ACPI configuration + */ +#string STR_ACPI_FORM_TITLE #language en-US "ACPI" +#string STR_ACPI_FORM_HELP #language en-US "Configure the ACPI support." + +#string STR_ACPI_USB2_STATE_PROMPT #language en-US "USB 2.0 Support" +#string STR_ACPI_USB2_STATE_HELP #language en-US "Enable or disable the USB 2.0 (EHCI) controllers.\n\nThis option is disabled by default due to compatibility issues with Windows, but it can be enabled for other OSes." diff --git a/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/RK3588DxeHii.vfr b/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/RK3588DxeHii.vfr index b15d83114..fb2abf8f0 100644 --- a/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/RK3588DxeHii.vfr +++ b/edk2-rockchip/Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/RK3588DxeHii.vfr @@ -110,6 +110,11 @@ formset name = Pcie30State, guid = RK3588DXE_FORMSET_GUID; + efivarstore ACPI_USB2_STATE_VARSTORE_DATA, + attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE, + name = AcpiUsb2State, + guid = RK3588DXE_FORMSET_GUID; + form formid = 1, title = STRING_TOKEN(STR_FORM_SET_TITLE); subtitle text = STRING_TOKEN(STR_FORM_SET_TITLE_SUBTITLE); @@ -129,6 +134,10 @@ formset prompt = STRING_TOKEN(STR_PCIE30_FORM_TITLE), help = STRING_TOKEN(STR_PCIE30_FORM_HELP); #endif + + goto 0x1003, + prompt = STRING_TOKEN(STR_ACPI_FORM_TITLE), + help = STRING_TOKEN(STR_ACPI_FORM_HELP); endform; form formid = 0x1000, @@ -372,9 +381,22 @@ formset help = STRING_TOKEN(STR_PCIE30_STATE_HELP), flags = NUMERIC_SIZE_4 | INTERACTIVE | RESET_REQUIRED, default = PCIE30_STATE_ENABLED, - option text = STRING_TOKEN(STR_PCIE30_STATE_DISABLED), value = PCIE30_STATE_DISABLED, flags = 0; - option text = STRING_TOKEN(STR_PCIE30_STATE_ENABLED), value = PCIE30_STATE_ENABLED, flags = 0; + option text = STRING_TOKEN(STR_DISABLED), value = PCIE30_STATE_DISABLED, flags = 0; + option text = STRING_TOKEN(STR_ENABLED), value = PCIE30_STATE_ENABLED, flags = 0; endoneof; endform; #endif + + form formid = 0x1003, + title = STRING_TOKEN(STR_ACPI_FORM_TITLE); + + oneof varid = AcpiUsb2State.State, + prompt = STRING_TOKEN(STR_ACPI_USB2_STATE_PROMPT), + help = STRING_TOKEN(STR_ACPI_USB2_STATE_HELP), + flags = NUMERIC_SIZE_4 | INTERACTIVE | RESET_REQUIRED, + default = FixedPcdGet32 (PcdAcpiUsb2StateDefault), + option text = STRING_TOKEN(STR_DISABLED), value = ACPI_USB2_STATE_DISABLED, flags = 0; + option text = STRING_TOKEN(STR_ENABLED), value = ACPI_USB2_STATE_ENABLED, flags = 0; + endoneof; + endform; endformset; diff --git a/edk2-rockchip/Silicon/Rockchip/RK3588/Include/VarStoreData.h b/edk2-rockchip/Silicon/Rockchip/RK3588/Include/VarStoreData.h index 4caa2a793..694111597 100644 --- a/edk2-rockchip/Silicon/Rockchip/RK3588/Include/VarStoreData.h +++ b/edk2-rockchip/Silicon/Rockchip/RK3588/Include/VarStoreData.h @@ -45,4 +45,10 @@ typedef struct { UINT32 State; } PCIE30_STATE_VARSTORE_DATA; +#define ACPI_USB2_STATE_DISABLED 0 +#define ACPI_USB2_STATE_ENABLED 1 +typedef struct { + UINT32 State; +} ACPI_USB2_STATE_VARSTORE_DATA; + #endif // __VARSTORE_DATA_H__ diff --git a/edk2-rockchip/Silicon/Rockchip/RK3588/RK3588.dec b/edk2-rockchip/Silicon/Rockchip/RK3588/RK3588.dec index c25aa644e..67ac67d40 100644 --- a/edk2-rockchip/Silicon/Rockchip/RK3588/RK3588.dec +++ b/edk2-rockchip/Silicon/Rockchip/RK3588/RK3588.dec @@ -43,6 +43,8 @@ gRK3588TokenSpaceGuid.PcdPcie30Supported|FALSE|BOOLEAN|0x00010201 + gRK3588TokenSpaceGuid.PcdAcpiUsb2StateDefault|0|UINT32|0x00010301 + [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] gRK3588TokenSpaceGuid.PcdCPULClusterClockPreset|0|UINT32|0x00000001 gRK3588TokenSpaceGuid.PcdCPULClusterClockCustom|0|UINT32|0x00000002 @@ -62,3 +64,5 @@ gRK3588TokenSpaceGuid.PcdComboPhy2Mode|0|UINT32|0x00000103 gRK3588TokenSpaceGuid.PcdPcie30State|0|UINT32|0x00000201 + + gRK3588TokenSpaceGuid.PcdAcpiUsb2State|0|UINT32|0x00000301 diff --git a/edk2-rockchip/Silicon/Rockchip/RK3588/RK3588Base.dsc.inc b/edk2-rockchip/Silicon/Rockchip/RK3588/RK3588Base.dsc.inc index b05fd3110..6273d936d 100644 --- a/edk2-rockchip/Silicon/Rockchip/RK3588/RK3588Base.dsc.inc +++ b/edk2-rockchip/Silicon/Rockchip/RK3588/RK3588Base.dsc.inc @@ -35,6 +35,9 @@ DEFINE COMBO_PHY_MODE_SATA = 2 DEFINE COMBO_PHY_MODE_USB3 = 3 + DEFINE ACPI_USB2_STATE_DISABLED = 0 + DEFINE ACPI_USB2_STATE_ENABLED = 1 + # # Silicon/Rockchip/RK3588/Drivers/RK3588Dxe/CpuPerformance.h # @@ -231,6 +234,12 @@ # gRK3588TokenSpaceGuid.PcdPcie30Supported|FALSE + # + # ACPI support flags and default values + # + # EHCI disabled by default since it crashes Windows. + gRK3588TokenSpaceGuid.PcdAcpiUsb2StateDefault|$(ACPI_USB2_STATE_DISABLED) + [PcdsDynamicDefault.common] gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0x007C0000 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|0x007CF000 @@ -273,6 +282,11 @@ # gRK3588TokenSpaceGuid.PcdPcie30State|L"Pcie30State"|gRK3588DxeFormSetGuid|0x0|gRK3588TokenSpaceGuid.PcdPcie30Supported + # + # ACPI + # + gRK3588TokenSpaceGuid.PcdAcpiUsb2State|L"AcpiUsb2State"|gRK3588DxeFormSetGuid|0x0|gRK3588TokenSpaceGuid.PcdAcpiUsb2StateDefault + ################################################################################ # # Components Section - list of all common EDK II Modules needed by RK3588 platforms.