Skip to content

Commit

Permalink
Revert "Fydetab Duo: fixes for SDcard"
Browse files Browse the repository at this point in the history
With current change, SD card no longer appears in UEFI Boot Manager. Looking at commit history, the problem is already described and workaround:
c02b333 (same as current change: bad)
416b2fa (actual solution)

The Fydetab Duo motherboard has SDMMC_DET inverted, which is against Rockchip design. This is a hardware mistake that prevents the RK3588 MaskROM to boot from SD card when tray is fully closed. No software fix is possible because MaskROM is read-only. Therefore, in order to boot UEFI firmware and OS from SD card, the tray has to be left ajar and UEFI firmware must not invert the state once again.

This allows UEFI firmware to detect the SD card no matter if tray is fully in or partially.
  • Loading branch information
runaway97 committed Sep 9, 2024
1 parent e98af13 commit a815fe8
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 10 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 @@ -51,8 +51,6 @@ SdmmcIoMux (
BUS_IOC->GPIO4D_IOMUX_SEL_L = (0xFFFFUL << 16) | (0x1111); //SDMMC_D0,SDMMC_D1,SDMMC_D2,SDMMC_D3
BUS_IOC->GPIO4D_IOMUX_SEL_H = (0x00FFUL << 16) | (0x0011); //SDMMC_CLK,SDMMC_CMD
PMU1_IOC->GPIO0A_IOMUX_SEL_H = (0x000FUL << 16) | (0x0001); //SDMMC_DET
GpioPinSetDirection (4, GPIO_PIN_PB4, GPIO_PIN_OUTPUT);
GpioPinWrite (4, GPIO_PIN_PB4, TRUE);
}

VOID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,7 @@ RkSdmmcCardDetect (
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 @@ -44,7 +44,6 @@
[Pcd]
gRockchipTokenSpaceGuid.PcdRkSdmmcBaseAddress
gRockchipTokenSpaceGuid.PcdRkSdmmcCardDetectBroken
gRockchipTokenSpaceGuid.PcdRkSdmmcCardDetectInverted

[Depex]
TRUE
1 change: 0 additions & 1 deletion edk2-rockchip/Silicon/Rockchip/RockchipPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@

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

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

0 comments on commit a815fe8

Please sign in to comment.