lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <C2F065E7-10C5-4701-A6F7-6B5A6198F0DF@goldelico.com>
Date:   Tue, 9 Nov 2021 11:58:38 +0100
From:   "H. Nikolaus Schaller" <hns@...delico.com>
To:     Ulf Hansson <ulf.hansson@...aro.org>
Cc:     Jérôme Pouiller <Jerome.Pouiller@...abs.com>,
        Avri Altman <avri.altman@....com>,
        Shawn Lin <shawn.lin@...k-chips.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Tony Lindgren <tony@...mide.com>,
        Bean Huo <beanhuo@...ron.com>,
        Gražvydas Ignotas <notasas@...il.com>,
        linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org,
        letux-kernel@...nphoenux.org, kernel@...a-handheld.com
Subject: Re: [RFC v4 5/6] mmc: core: transplant ti,wl1251 quirks from to be
 retired omap_hsmmc

Hi Ulf,

> Am 08.11.2021 um 16:33 schrieb Ulf Hansson <ulf.hansson@...aro.org>:
> 
> On Fri, 5 Nov 2021 at 10:06, H. Nikolaus Schaller <hns@...delico.com> wrote:
>> 
>> +       card->quirks |= MMC_QUIRK_NONSTD_SDIO;
>> +       card->cccr.wide_bus = 1;
>> +       card->cis.vendor = 0x104c;
>> +       card->cis.device = 0x9066;
>> +       card->cis.blksize = 512;
>> +       card->cis.max_dtr = 24000000;
>> +       card->ocr = 0x80;
> 
> In the past, we discussed a bit around why card->ocr needs to be set here.
> 
> The reason could very well be that the DTS file is specifying the
> vmmc-supply with 1.8V fixed regulator, which seems wrong to me.

I have checked with the schematics but the wlan_en regulator-fixed is just a GPIO
controlling some pin of the wifi chip.

I guess it enables some regulator or power switch inside the wifi module which
has unknown voltage.

We can interpret this as two sequential power-switches. The first one controlled
by the gpio-register bit and switches gpio power to the gpio pad of the SoC. The second
one switches the battery voltage to the internal circuits of the wifi module.

The GPIO itself is on 1.8V VIO level which seems to be the reason for the min/max.

Now it is a little arbitrary what the DTS describes: the gpio voltage or the unknown
internal voltage of the second switch.

So from hardware perspective the min/max values are irrelevant.

> 
> I would be very interested to know if we would change
> "regulator-min|max-microvolt" of the regulator in the DTS, into
> somewhere in between 2700000-3600000 (2.7-3.6V)

Ok, if the mmc driver does something with these values it may have indeed an influence.

> - and see if that
> allows us to drop the assignment of "card->ocr =  0x80;" above. Would
> you mind doing some tests for this?

Well, with min/max=3.3V and no ocr I get:

[    2.765136] omap_hsmmc 480ad000.mmc: card claims to support voltages below defined range
[    2.776367] omap_hsmmc 480ad000.mmc: found wl1251
[    2.782287] mmc2: new SDIO card at address 0001
[   10.874237] omap_hsmmc 480ad000.mmc: could not set regulator OCR (-22)
[   10.945373] wl1251_sdio: probe of mmc2:0001:1 failed with error -16

Adding back card->ocr = 0x80 (and keeping 3.3V for min/max) shows exactly the same.

Only min/max 1.8V + OCR works:

[    2.824188] mmc2: new SDIO card at address 0001
[    2.806518] omap_hsmmc 480ad000.mmc: card claims to support voltages below defined range
[    2.815979] omap_hsmmc 480ad000.mmc: found wl1251
[   10.981018] omap_hsmmc 480ad000.mmc: found wl1251
[   11.018280] wl1251: using dedicated interrupt line
[   11.321136] wl1251: loaded
[   11.378601] wl1251: initialized
[   14.521759] omap_hsmmc 480ad000.mmc: found wl1251
[   38.680725] omap_hsmmc 480ad000.mmc: found wl1251
[   39.646942] wl1251: 151 tx blocks at 0x3b788, 35 rx blocks at 0x3a780
[   39.654785] wl1251: firmware booted (Rev 4.0.4.3.7)

Therefore I also tried the 4th combination: min/max 1.8V and no ocr quirk and it fails again.

Finally I tried setting min to 2.7V and max to 3.6V. This ends up in

[    0.402648] reg-fixed-voltage fixed-regulator-wg7210_en: Fixed regulator specified with variable voltages

So it seems that we need both: min/max = 1.8V and OCR. A little unexpected since I had expected
that min/max is completely irrelevant.

> If that works, we should add some comments about it above, I think.

So at the moment no change for [PATCH v1] which I can now send out.

BR and thanks,
Nikolaus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ