-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ACPI: Prepare SD controller support for Windows
Signed-off-by: Mario Bălănică <[email protected]>
- Loading branch information
1 parent
dd0b22f
commit 053cf71
Showing
3 changed files
with
191 additions
and
11 deletions.
There are no files selected for viewing
50 changes: 40 additions & 10 deletions
50
edk2-rockchip/Silicon/Rockchip/RK3588/AcpiTables/Sdhc.asl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,61 @@ | ||
/** @file | ||
* | ||
* Copyright (c) 2021, ARM Limited. All rights reserved. | ||
* Copyright (c) 2024, Mario Bălănică <[email protected]> | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause-Patent | ||
* | ||
**/ | ||
|
||
#include "AcpiTables.h" | ||
|
||
Scope (\_SB_) { | ||
Name (SDRM, 1) // SD slot is removable | ||
|
||
Device (SDHC) | ||
{ | ||
Device (SDHC) { | ||
Name (_HID, "RKCPFE2C") | ||
Name (_UID, 0x1) | ||
Name (_UID, 0x0) | ||
Name (_CCA, 0x0) | ||
Name (_S1D, 0x1) | ||
Name (_S2D, 0x1) | ||
Name (_S3D, 0x1) | ||
Name (_S4D, 0x1) | ||
Method (_STA) | ||
{ | ||
Return(0xf) | ||
} | ||
Name (_STA, 0xf) | ||
|
||
Method (_CRS, 0x0, Serialized) { | ||
Name (RBUF, ResourceTemplate() { | ||
Name (RBUF, ResourceTemplate () { | ||
Memory32Fixed (ReadWrite, 0xfe2c0000, 0x4000) | ||
Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 235 } | ||
|
||
// SDMMC_DET | ||
GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB.GPI0") { GPIO_PIN_PA4 } | ||
GpioInt (Edge, ActiveBoth, Shared, PullUp, 0, "\\_SB.GPI0") { GPIO_PIN_PA4 } | ||
}) | ||
Return (RBUF) | ||
} | ||
} //SDHC | ||
|
||
Name (_DSD, Package () { | ||
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), | ||
Package () { | ||
Package () { "compatible", Package () { "rockchip,rk3588-dw-mshc", "rockchip,rk3288-dw-mshc" } }, | ||
Package () { "fifo-depth", 0x100 }, | ||
Package () { "max-frequency", 200000000 }, | ||
Package () { "bus-width", 4 }, | ||
Package () { "cap-sd-highspeed", 1 }, | ||
Package () { "sd-uhs-ddr50", 1 }, | ||
Package () { "sd-uhs-sdr50", 1 }, | ||
Package () { "sd-uhs-sdr104", 1 }, | ||
} | ||
}) | ||
|
||
// | ||
// A child device that represents the SD card. | ||
// | ||
Device (SDMM) { | ||
Name (_ADR, 0x0) | ||
|
||
Method (_RMV) { | ||
Return (SDRM) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# | ||
# ACPI platform driver | ||
# | ||
# Copyright (c) 2023, Mario Bălănică <[email protected]> | ||
# Copyright (c) 2024, Mario Bălănică <[email protected]> | ||
# | ||
# SPDX-License-Identifier: BSD-2-Clause-Patent | ||
# | ||
|
@@ -31,15 +31,21 @@ | |
BaseLib | ||
BaseMemoryLib | ||
DebugLib | ||
DevicePathLib | ||
MemoryAllocationLib | ||
PeCoffGetEntryPointLib | ||
UefiBootServicesTableLib | ||
UefiLib | ||
UefiDriverEntryPoint | ||
|
||
[Guids] | ||
gEfiEndOfDxeEventGroupGuid | ||
gEfiEventReadyToBootGuid | ||
|
||
[Protocols] | ||
gEdkiiNonDiscoverableDeviceProtocolGuid | ||
gEfiAcpiSdtProtocolGuid | ||
gEfiLoadedImageProtocolGuid | ||
|
||
[Pcd] | ||
gRK3588TokenSpaceGuid.PcdConfigTableMode | ||
|
@@ -50,6 +56,7 @@ | |
gRK3588TokenSpaceGuid.PcdPcie30Supported | ||
gRK3588TokenSpaceGuid.PcdPcie30State | ||
gRK3588TokenSpaceGuid.PcdPcieEcamCompliantSegmentsMask | ||
gRockchipTokenSpaceGuid.PcdRkSdmmcBaseAddress | ||
|
||
[Depex] | ||
gRockchipPlatformConfigAppliedProtocolGuid |