Skip to contentSkip to conversation

mmc: UHS Voltage switch and operating frequency question

DISCUSSION Jerome Brunet 2 participants 6 messages Jul 31, 2017 – Aug 2, 2017

Subsystems (2)
lore
Share & tools
lore

Jerome Brunet

author reviewer
#0 lore raw

Hi Ulf,

I am working on adding signal voltage switch callback to the meson mmc driver. While testing, I noticed that a few cards fail to exit the busy state after the voltage switch.

After tinkering with the driver a bit, I noticed that increasing the clock frequency from 400kHz to 1MHz solve the problem. Strange, isn't it ?

I'm don't know MMC that much but is it possible that some card require a minimum operating frequency to enter UHS mode ?

The simplified spec (Part 1 - Physical Layer) says that before CMD11, we should have had CMD41 (Init Command) . After CMD41, the card should be operating at Default Speed or SDR12.

I believe that in both case, the frequency is "up to 25Mhz" ? This would be the maximum, but is there a minimum ? 400kHz seems pretty low compared to 25Mhz ...

I hope you will able to shed light on this :)

Best Regards
jerome

#1 lore raw
Quoted 8 lines · Jerome Brunet

Hi Ulf,

I am working on adding signal voltage switch callback to the meson mmc driver. While testing, I noticed that a few cards fail to exit the busy state after the voltage switch.

After tinkering with the driver a bit, I noticed that increasing the clock frequency from 400kHz to 1MHz solve the problem. Strange, isn't it ?

AFAICT, most of the internal circuit of card is running against the input clock from host. So if you increase your clock, cards will finish thier logic switch faster. Note that the spec does state that 400KHz is the max freq for indentification mode. But the fact is that almost all cards could accept higher frequecncy.

For you issue, please try to hack mmc_set_uhs_voltage to increase the delay there to see if that could solve your problem.

Quoted 4 lines

I'm don't know MMC that much but is it possible that some card require a minimum operating frequency to enter UHS mode ?

We shoule never give a hypothesis beyond the scope of spec.

Quoted 7 lines

The simplified spec (Part 1 - Physical Layer) says that before CMD11, we should have had CMD41 (Init Command) . After CMD41, the card should be operating at Default Speed or SDR12.

I believe that in both case, the frequency is "up to 25Mhz" ? This would be the maximum, but is there a minimum ? 400kHz seems pretty low compared to 25Mhz ...

400KHz is good for work unless your IP has limitation for that.

Quoted 11 lines

I hope you will able to shed light on this :)

Best Regards
jerome
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

author reviewer
#2 lore raw
Quoted 12 lines · Shawn Lin
Quoted 10 lines · Jerome Brunet

Hi Ulf,

I am working on adding signal voltage switch callback to the meson mmc driver.
While testing, I noticed that a few cards fail to exit the busy state after the
voltage switch.

After tinkering with the driver a bit, I noticed that increasing the clock frequency from 400kHz to 1MHz solve the problem. Strange, isn't it ?

Thanks for your reply Shawn !

Quoted 3 lines

AFAICT, most of the internal circuit of card is running against the input clock from host. So if you increase your clock, cards will finish thier logic switch faster.

Yeah that would be my understanding as well

Quoted 3 lines

Note that the spec does state that 400KHz is
the max freq for indentification mode. But the fact is that almost all cards could accept higher frequecncy.

Agreed. but I'm not talking about the frequency used during identification. The step I'm referring to is after CMD41, during CMD11. After CMD11, the spec says that the frequency is up to "default speed or SDR12" so 25Mhz.

If id mode is limited to 400kHz, it is clearly a different stage.

Quoted 4 lines

For you issue, please try to hack mmc_set_uhs_voltage to increase the delay there to see if that could solve your problem.

Ohhh believe me, I did :) however these 2 cards are quite stubborn

Quoted 7 lines
Quoted 5 lines

I'm don't know MMC that much but is it possible that some card require a minimum
operating frequency to enter UHS mode ?

We shoule never give a hypothesis beyond the scope of spec.

I don't get what you mean ?

Quoted 6 lines
Quoted 6 lines

The simplified spec (Part 1 - Physical Layer) says that before CMD11, we should
have had CMD41 (Init Command) . After CMD41, the card should be operating at Default Speed or SDR12.

Quoted 7 lines
Quoted 5 lines

I believe that in both case, the frequency is "up to 25Mhz" ? This would be the
maximum, but is there a minimum ? 400kHz seems pretty low compared to 25Mhz
...

400KHz is good for work unless your IP has limitation for that.

Ip seems to be fine at 400KHz with every other cards, including uhs ones. The 2 "annoying" cards switch to UHS mode fine on a laptop.

It the combination of the ip and the cards which seems broken, whatever the delays I put here and there.

For a reason I don't understand, increasing the minimal frequency from 400Khz to 1MHz make these cards work very nicely.

Quoted 14 lines
Quoted 12 lines

I hope you will able to shed light on this :)

Best Regards
jerome
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo at vger.kernel.org
More majordomo info at??http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 20 lines · Jerome Brunet
Quoted 12 lines · Shawn Lin
Quoted 10 lines · Jerome Brunet

Hi Ulf,

I am working on adding signal voltage switch callback to the meson mmc driver.
While testing, I noticed that a few cards fail to exit the busy state after the
voltage switch.

After tinkering with the driver a bit, I noticed that increasing the clock frequency from 400kHz to 1MHz solve the problem. Strange, isn't it ?

Thanks for your reply Shawn !

Quoted 3 lines

AFAICT, most of the internal circuit of card is running against the input clock from host. So if you increase your clock, cards will finish thier logic switch faster.

Quoted 8 lines

Yeah that would be my understanding as well

Quoted 3 lines

Note that the spec does state that 400KHz is
the max freq for indentification mode. But the fact is that almost all cards could accept higher frequecncy.

Agreed. but I'm not talking about the frequency used during identification. The step I'm referring to is after CMD41, during CMD11. After CMD11, the spec

I also notice you said "a few cards fail to exit teh busy state after the voltage switch". That implies that card didn't finish voltage switch at all, so it shouldn't argue for increasing the clk as the spec only say "cmd11 invlokes voltage switching squence. If it is *completed*, the card enters SDR12(default)." and "Completion of voltage switch sequence is checked by high level of DAT[3:0]"

So these two cards are probably still in id mode or some un-documented state, I guess. No hints for that per the spec but you should try to make sure the behaviour of your contrller follows the whole requirement of SD spec "4.2.4.2 Timing to Switch Signal Voltage".... especially to see if your 1.8v is stable within 5ms...

Quoted 59 lines

says that the frequency is up to "default speed or SDR12" so 25Mhz > If id mode is limited to 400kHz, it is clearly a different stage.

Quoted 4 lines

For you issue, please try to hack mmc_set_uhs_voltage to increase the delay there to see if that could solve your problem.

Ohhh believe me, I did :) however these 2 cards are quite stubborn

Quoted 7 lines
Quoted 5 lines

I'm don't know MMC that much but is it possible that some card require a minimum
operating frequency to enter UHS mode ?

We shoule never give a hypothesis beyond the scope of spec.

I don't get what you mean ?

Quoted 6 lines
Quoted 6 lines

The simplified spec (Part 1 - Physical Layer) says that before CMD11, we should
have had CMD41 (Init Command) . After CMD41, the card should be operating at Default Speed or SDR12.

Quoted 7 lines
Quoted 5 lines

I believe that in both case, the frequency is "up to 25Mhz" ? This would be the
maximum, but is there a minimum ? 400kHz seems pretty low compared to 25Mhz
...

400KHz is good for work unless your IP has limitation for that.

Ip seems to be fine at 400KHz with every other cards, including uhs ones. The 2 "annoying" cards switch to UHS mode fine on a laptop.

It the combination of the ip and the cards which seems broken, whatever the delays I put here and there.

For a reason I don't understand, increasing the minimal frequency from 400Khz to 1MHz make these cards work very nicely.

Quoted 14 lines
Quoted 12 lines

I hope you will able to shed light on this :)

Best Regards
jerome
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

author reviewer
#4 lore raw
Quoted 32 lines · Shawn Lin
Quoted 23 lines · Jerome Brunet
Quoted 10 lines · Shawn Lin
Quoted 9 lines · Jerome Brunet

Hi Ulf,

I am working on adding signal voltage switch callback to the meson mmc driver.
While testing, I noticed that a few cards fail to exit the busy state after
the
voltage switch.

Quoted 3 lines
Quoted 3 lines

After tinkering with the driver a bit, I noticed that increasing the clock
frequency from 400kHz to 1MHz solve the problem. Strange, isn't it ?

Thanks for your reply Shawn !

Quoted 3 lines

AFAICT, most of the internal circuit of card is running against the input clock from host. So if you increase your clock, cards will finish thier logic switch faster.

Yeah that would be my understanding as well

Quoted 7 lines
Quoted 3 lines

? Note that the spec does state that 400KHz is
the max freq for indentification mode. But the fact is that almost all cards could accept higher frequecncy.

Agreed. but I'm not talking about the frequency used during identification. The step I'm referring to is after CMD41, during CMD11. After CMD11, the spec

Quoted 6 lines

I also notice you said "a few cards fail to exit teh busy state after the voltage switch". That implies that card didn't finish voltage switch at all, so it shouldn't argue for increasing the clk as the spec only say "cmd11 invlokes voltage switching squence. If it is *completed*, the card enters SDR12(default)." and "Completion of voltage switch sequence is checked by high level of DAT[3:0]"

I understand increasing the frequency does not make much sense, but it makes it works. I'm trying to understand why ... hopefully it will lead to a real solution.

Quoted 6 lines

So these two cards are probably still in id mode or some un-documented state, I guess. No hints for that per the spec but you should try to make sure the behaviour of your contrller follows the whole requirement of SD spec "4.2.4.2 Timing to Switch Signal Voltage".... especially to see if your 1.8v is stable within 5ms...

Unfortunately section "4.2.4.2 Timing to Switch Signal Voltage" is blank in the simplified (freely available) spec. I could not get my hands on the full spec yet.

Unsettled regulator was one of my first guesses. The regulator setup on my board needs some time to settle when switch from 3.3v to 1.8v, around 70ms. I made sure to delay the return of the host voltage_switch callback until the voltage is stable at 1.8v.

This probably is a bit long but, at this stage, the clock is gated so the card should?not see the difference, right ?

So on return of "mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180)", the voltage should be stable at 1.8v and we will the get the 10ms (even if spec says 5ms apparently) before re-enabling the clock.

Again, Thanks for helping out Shawn !
Cheers
Jerome

Quoted 69 lines
Quoted 67 lines

says that the frequency is up to "default speed or SDR12" so 25Mhz > If id mode is limited to 400kHz, it is clearly a different stage.

Quoted 4 lines

For you issue, please try to hack mmc_set_uhs_voltage to increase the delay there to see if that could solve your problem.

Ohhh believe me, I did :) however these 2 cards are quite stubborn

Quoted 7 lines
Quoted 5 lines

I'm don't know MMC that much but is it possible that some card require a minimum
operating frequency to enter UHS mode ?

We shoule never give a hypothesis beyond the scope of spec.

I don't get what you mean ?

Quoted 15 lines
Quoted 7 lines

The simplified spec (Part 1 - Physical Layer) says that before CMD11, we should
have had CMD41 (Init Command) . After CMD41, the card should be operating at
Default Speed or SDR12.

Quoted 7 lines

I believe that in both case, the frequency is "up to 25Mhz" ? This would be
the
maximum, but is there a minimum ? 400kHz seems pretty low compared to 25Mhz
...

Quoted 1 line

400KHz is good for work unless your IP has limitation for that.

Ip seems to be fine at 400KHz with every other cards, including uhs ones. The 2 "annoying" cards switch to UHS mode fine on a laptop.

It the combination of the ip and the cards which seems broken, whatever the delays I put here and there.

For a reason I don't understand, increasing the minimal frequency from 400Khz to
1MHz make these cards work very nicely.

Quoted 14 lines
Quoted 12 lines

I hope you will able to shed light on this :)

Best Regards
jerome
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo at vger.kernel.org
More majordomo info at??http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 51 lines · Jerome Brunet
Quoted 32 lines · Shawn Lin
Quoted 23 lines · Jerome Brunet
Quoted 10 lines · Shawn Lin
Quoted 9 lines · Jerome Brunet

Hi Ulf,

I am working on adding signal voltage switch callback to the meson mmc driver.
While testing, I noticed that a few cards fail to exit the busy state after
the
voltage switch.

Quoted 3 lines
Quoted 3 lines

After tinkering with the driver a bit, I noticed that increasing the clock
frequency from 400kHz to 1MHz solve the problem. Strange, isn't it ?

Thanks for your reply Shawn !

Quoted 3 lines

AFAICT, most of the internal circuit of card is running against the input clock from host. So if you increase your clock, cards will finish thier logic switch faster.

Yeah that would be my understanding as well

Quoted 7 lines
Quoted 3 lines

Note that the spec does state that 400KHz is
the max freq for indentification mode. But the fact is that almost all cards could accept higher frequecncy.

Agreed. but I'm not talking about the frequency used during identification. The step I'm referring to is after CMD41, during CMD11. After CMD11, the spec

Quoted 6 lines

I also notice you said "a few cards fail to exit teh busy state after the voltage switch". That implies that card didn't finish voltage switch at all, so it shouldn't argue for increasing the clk as the spec only say "cmd11 invlokes voltage switching squence. If it is *completed*, the card enters SDR12(default)." and "Completion of voltage switch sequence is checked by high level of DAT[3:0]"

I understand increasing the frequency does not make much sense, but it makes it works. I'm trying to understand why ... hopefully it will lead to a real solution.

Quoted 6 lines

So these two cards are probably still in id mode or some un-documented state, I guess. No hints for that per the spec but you should try to make sure the behaviour of your contrller follows the whole requirement of SD spec "4.2.4.2 Timing to Switch Signal Voltage".... especially to see if your 1.8v is stable within 5ms...

Quoted 4 lines

Unfortunately section "4.2.4.2 Timing to Switch Signal Voltage" is blank in the simplified (freely available) spec. I could not get my hands on the full spec yet.

okay, the full spec seems confidential for SD association members.

Quoted 8 lines

Unsettled regulator was one of my first guesses. The regulator setup on my board needs some time to settle when switch from 3.3v to 1.8v, around 70ms. I made sure to delay the return of the host voltage_switch callback until the voltage is stable at 1.8v.

This probably is a bit long but, at this stage, the clock is gated so the card should not see the difference, right ?

No. I saw some failure cases for that, so that's why I asked you to check this.

I can't share the full spec, but I think I could paste some bits.

Per section, 4.2.4.2:

"1.8v output of voltage regulator in card shall be stable within 5ms. Host keeps SDCLK low at least 5ms. This means that 5ms is the maximum for the card and the minimum for the host. "

So that is mandatory for HW behaviour, not software relevant....

Quoted 82 lines

So on return of "mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180)", the voltage should be stable at 1.8v and we will the get the 10ms (even if spec says 5ms apparently) before re-enabling the clock.

Again, Thanks for helping out Shawn !
Cheers
Jerome

Quoted 69 lines
Quoted 67 lines

says that the frequency is up to "default speed or SDR12" so 25Mhz > If id mode is limited to 400kHz, it is clearly a different stage.

Quoted 4 lines

For you issue, please try to hack mmc_set_uhs_voltage to increase the delay there to see if that could solve your problem.

Ohhh believe me, I did :) however these 2 cards are quite stubborn

Quoted 7 lines
Quoted 5 lines

I'm don't know MMC that much but is it possible that some card require a minimum
operating frequency to enter UHS mode ?

We shoule never give a hypothesis beyond the scope of spec.

I don't get what you mean ?

Quoted 15 lines
Quoted 7 lines

The simplified spec (Part 1 - Physical Layer) says that before CMD11, we should
have had CMD41 (Init Command) . After CMD41, the card should be operating at
Default Speed or SDR12.

Quoted 7 lines

I believe that in both case, the frequency is "up to 25Mhz" ? This would be
the
maximum, but is there a minimum ? 400kHz seems pretty low compared to 25Mhz
...

Quoted 1 line

400KHz is good for work unless your IP has limitation for that.

Ip seems to be fine at 400KHz with every other cards, including uhs ones. The 2 "annoying" cards switch to UHS mode fine on a laptop.

It the combination of the ip and the cards which seems broken, whatever the delays I put here and there.

For a reason I don't understand, increasing the minimal frequency from 400Khz to
1MHz make these cards work very nicely.

Quoted 14 lines
Quoted 12 lines

I hope you will able to shed light on this :)

Best Regards
jerome
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html