Skip to content

Commit

Permalink
Silicon/Rockchip: RkSdmmcDxe: Set base clock rate
Browse files Browse the repository at this point in the history
If a card was plugged in after boot, it wouldn't respond.
Turns out we need to increase the base clock from the default 400 KHz. Set it to
52 MHz like the earlier stages do when a card is present at boot.

Weirdly enough this arised only after I globally enabled the DEBUG_INFO logging
level.
  • Loading branch information
mariobalanica committed Aug 20, 2023
1 parent 05daac0 commit d8039ee
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ STATIC DW_MMC_HC_SLOT_CAP mDwMmcCapability = {
.SlotType = RemovableSlot,
.CardType = SdCardType,
.Voltage30 = 1,
.BaseClkFreq = 3200
.BaseClkFreq = 52000
};

STATIC
Expand Down Expand Up @@ -147,6 +147,8 @@ RkSdmmcDxeInitialize (

RkSdmmcSetIoMux ();

RkSdmmcSetClockRate (mDwMmcCapability.BaseClkFreq * 1000);

Status = gBS->InstallMultipleProtocolInterfaces(&mDwMmcCapability.Controller,
&gEfiDevicePathProtocolGuid, &mDwMmcDevice.DevicePath,
&gEdkiiNonDiscoverableDeviceProtocolGuid, &mDwMmcDevice.Device,
Expand Down

0 comments on commit d8039ee

Please sign in to comment.