Skip to content

Commit

Permalink
Expose USB EHCI + OHCI controllers in ACPI
Browse files Browse the repository at this point in the history
- EHCI is exposed conditionally (via a user setting) and disabled by default due to Windows compatibility issues.
- OHCI is exposed at all times. Windows on Arm does not have a driver for it.
  • Loading branch information
mariobalanica committed Aug 5, 2023
1 parent e762111 commit d999a44
Show file tree
Hide file tree
Showing 39 changed files with 512 additions and 368 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions edk2-rockchip/Platform/Hinlink/H88K/AcpiTables/Dsdt.asl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions edk2-rockchip/Platform/Khadas/Edge2/AcpiTables/Dsdt.asl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions edk2-rockchip/Platform/Mekotronics/R58X/AcpiTables/Dsdt.asl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions edk2-rockchip/Platform/Mixtile/Blade3/AcpiTables/Dsdt.asl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions edk2-rockchip/Platform/Radxa/ROCK5A/AcpiTables/Dsdt.asl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions edk2-rockchip/Platform/Radxa/ROCK5B/AcpiTables/Dsdt.asl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
108 changes: 108 additions & 0 deletions edk2-rockchip/Silicon/Rockchip/RK3588/AcpiTables/Usb1Host.asl
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/** @file
*
* USB 1.1 (OHCI) controllers.
*
* Copyright (c) 2022, Rockchip Electronics Co., Ltd
* Copyright (c) 2023, Mario Bălănică <[email protected]>
*
* 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,
)
})
}
}
}
Loading

0 comments on commit d999a44

Please sign in to comment.