reset sdhci device
"Kamal R. Prasad" <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.arm |
|---|---|
| Message-ID | <CAK=yUGKtUc7mT6Fpe_Hh+JPTpdTAtPmUOkv24A-AmiW0NpWjJw@mail.gmail.com> |
hello,
i am trying to reset sdhci device but i see interrupts are not
cleared. do i need to reset the bus too like they do in linux? here is
my code.
thanks
-kamal
static void
sdhci_resethw(struct sdhci_slot* slot)
{
uint32_t clock = slot->clock;
uint16_t hostctrl2 = RD2(slot, SDHCI_HOST_CONTROL2);
u_char hostctrl = slot->hostctrl;
u_char power = slot->power;
sdhci_set_power(slot, 0);
DELAY(10);
sdhci_init(slot);
sdhci_set_power(slot, power);
DELAY(10);
sdhci_set_clock(slot, clock);
slot->hostctrl = hostctrl;
WR1(slot, SDHCI_HOST_CONTROL, slot->hostctrl);
WR2(slot, SDHCI_HOST_CONTROL2, hostctrl2);
DELAY(10);