Skip to content

Commit

Permalink
FydetabDuo: Disable SD card detection
Browse files Browse the repository at this point in the history
There's a trick to boot from SD on this tablet: the card tray has to be
opened slightly, just enough so that the card detect pin is released
while the card itself still makes contact with the data pins.

Given that both states can mean "connected", UEFI should no longer
rely on this signal to detect card presence.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
  • Loading branch information
mariobalanica committed Jul 10, 2024
1 parent 915093f commit 416b2fa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
gRK3588TokenSpaceGuid.PcdI2S0Supported|TRUE

# SD card detect signal is inverted
gRockchipTokenSpaceGuid.PcdRkSdmmcCardDetectInverted|TRUE
gRockchipTokenSpaceGuid.PcdRkSdmmcCardDetectBroken|TRUE

################################################################################
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,12 @@ RkSdmmcCardDetect (

PresenceState = RkSdmmcGetCardPresenceState ();

if (PresenceState == RkSdmmcCardPresenceUnsupported) {
if ((PresenceState == RkSdmmcCardPresenceUnsupported) ||
FixedPcdGetBool (PcdRkSdmmcCardDetectBroken)) {
return TRUE; // let the driver do software detection
}

if (FixedPcdGetBool (PcdRkSdmmcCardDetectInverted)) {
return PresenceState != RkSdmmcCardPresent;
} else {
return PresenceState == RkSdmmcCardPresent;
}
return PresenceState == RkSdmmcCardPresent;
}

STATIC PLATFORM_DW_MMC_PROTOCOL mDwMmcDeviceProtocol = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

[Pcd]
gRockchipTokenSpaceGuid.PcdRkSdmmcBaseAddress
gRockchipTokenSpaceGuid.PcdRkSdmmcCardDetectInverted
gRockchipTokenSpaceGuid.PcdRkSdmmcCardDetectBroken

[Depex]
TRUE
2 changes: 1 addition & 1 deletion edk2-rockchip/Silicon/Rockchip/RockchipPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
gRockchipTokenSpaceGuid.PcdRtc8563Bus|0|UINT8|0x0200000E

gRockchipTokenSpaceGuid.PcdRkSdmmcBaseAddress|0x0|UINT32|0x40000030
gRockchipTokenSpaceGuid.PcdRkSdmmcCardDetectInverted|FALSE|BOOLEAN|0x40000031
gRockchipTokenSpaceGuid.PcdRkSdmmcCardDetectBroken|FALSE|BOOLEAN|0x40000031

gRockchipTokenSpaceGuid.PcdDwcSdhciBaseAddress|0x0|UINT32|0x40000035
gRockchipTokenSpaceGuid.PcdDwcSdhciForceHighSpeed|FALSE|BOOLEAN|0x40000036
Expand Down

0 comments on commit 416b2fa

Please sign in to comment.