Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp372651pxu; Wed, 14 Oct 2020 03:43:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzg6O5bSbM1de0qGieoclWKlZoz21HKoH8Gq847ZOetO8igukDHh3hYOF3223xquS3iDPEi X-Received: by 2002:a17:906:8519:: with SMTP id i25mr4597083ejx.76.1602672209014; Wed, 14 Oct 2020 03:43:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602672209; cv=none; d=google.com; s=arc-20160816; b=Z2EkdO7saBqWisnZRgdHj4r3Wo+Ww1RuqS6gnnP7SG2us7oYqg6s1gaTZqdsR4Ipgc zlnQxEsxcjHsJpby5KUfcbqxPNHxxSysgZvdSUUFc+KDmS0/ZgaZri8mN5dJVYS8bv30 xR3JKdoGJPXKtrsggT+SyywgHwG96hmiPNGbnbHv6JUC9n8G/rL/SWkPEPkhF/87vxV1 /gAm8KZP7zmgGWiT98dHnFu1XCDD3YuDVpH1rRqQqbIvuDSpSgud30uT4T1kvNlx7aWl 1XlhZJrWEw1nt0vseSHyFNqeUHVeVIJwXcABsPj8M/BavPQIUlKBnjjJLsIM9LuLyGtK l1UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=jI2Cx2vRi4vXr0XmyC6iVVR7TZJrwrRvJsZXzfl90S0=; b=norRrCCoAPFI7K5XpTlJigLZZ7SRqsxg+7rhvln3O1lo4cC/8gH/fNRtWf5WZerpbw qPEp9xam7gGWAZOH+MWGoqDhoRjs7hgjd2ochD3HpRsWqqflmH5OUdVVmctQbcpAVUVR w3K+sXUIXMiYyeAppdvRuEkBcfAi6k5Zt4WT/ZcX+BRyG6FsJlN8acf8F8uevzCsFLc9 6aZPR0PxSjg4fyS8lM+wY0uhKydDIYDy/HBoFA17XjCinElnu9eCyn115mFaO3qwzSIA Nb7RtR+0rFU5dviw637k/euCYyDmZwwHz69fUSKIKgvJ1O9RPzEthOujDWXe1l5gKrgf jPnw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=siol.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n9si1863622edy.248.2020.10.14.03.43.06; Wed, 14 Oct 2020 03:43:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=siol.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728035AbgJMVWY convert rfc822-to-8bit (ORCPT + 99 others); Tue, 13 Oct 2020 17:22:24 -0400 Received: from mailoutvs18.siol.net ([185.57.226.209]:40435 "EHLO mail.siol.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726652AbgJMVWX (ORCPT ); Tue, 13 Oct 2020 17:22:23 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTP id CF05C526150; Tue, 13 Oct 2020 23:22:18 +0200 (CEST) X-Virus-Scanned: amavisd-new at psrvmta11.zcs-production.pri Received: from mail.siol.net ([127.0.0.1]) by localhost (psrvmta11.zcs-production.pri [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id prebWZDhw8fy; Tue, 13 Oct 2020 23:22:18 +0200 (CEST) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTPS id EABF2526102; Tue, 13 Oct 2020 23:22:17 +0200 (CEST) Received: from kista.localnet (cpe1-5-97.cable.triera.net [213.161.5.97]) (Authenticated sender: jernej.skrabec@siol.net) by mail.siol.net (Postfix) with ESMTPA id 2179552615A; Tue, 13 Oct 2020 23:22:16 +0200 (CEST) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: =?ISO-8859-1?Q?Cl=E9ment_P=E9ron?= , Maxime Ripard Cc: Rob Herring , Chen-Yu Tsai , devicetree , linux-arm-kernel , linux-kernel , linux-sunxi Subject: Re: Re: [PATCH v2] arm64: dts: allwinner: h6: add eMMC voltage property for Beelink GS1 Date: Tue, 13 Oct 2020 23:27:33 +0200 Message-ID: <2745255.UFgyrzHpml@kista> In-Reply-To: <20201009073651.izvvjpqiqiivhknl@gilmour.lan> References: <20201003092001.405238-1-peron.clem@gmail.com> <20201009073651.izvvjpqiqiivhknl@gilmour.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dne petek, 09. oktober 2020 ob 09:36:51 CEST je Maxime Ripard napisal(a): > On Thu, Oct 08, 2020 at 10:00:06PM +0200, Cl?ment P?ron wrote: > > Hi Maxime, > > > > Adding linux-sunxi and Jernej Skrabec to this discussion. > > > > On Thu, 8 Oct 2020 at 17:10, Maxime Ripard wrote: > > > > > > Hi Cl?ment, > > > > > > On Mon, Oct 05, 2020 at 08:47:19PM +0200, Cl?ment P?ron wrote: > > > > On Mon, 5 Oct 2020 at 11:21, Maxime Ripard wrote: > > > > > > > > > > Hi Cl?ment, > > > > > > > > > > On Sat, Oct 03, 2020 at 11:20:01AM +0200, Cl?ment P?ron wrote: > > > > > > Sunxi MMC driver can't distinguish at runtime what's the I/O voltage > > > > > > for HS200 mode. > > > > > > > > > > Unfortunately, that's not true (or at least, that's not related to your patch). > > > > > > > > > > > Add a property in the device-tree to notify MMC core about this > > > > > > configuration. > > > > > > > > > > > > Fixes: 089bee8dd119 ("arm64: dts: allwinner: h6: Introduce Beelink GS1 board") > > > > > > Signed-off-by: Cl?ment P?ron > > > > > > --- > > > > > > arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts | 1 + > > > > > > 1 file changed, 1 insertion(+) > > > > > > > > > > > > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink- gs1.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts > > > > > > index 049c21718846..3f20d2c9bbbb 100644 > > > > > > --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts > > > > > > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts > > > > > > @@ -145,6 +145,7 @@ &mmc2 { > > > > > > vqmmc-supply = <®_bldo2>; > > > > > > non-removable; > > > > > > cap-mmc-hw-reset; > > > > > > + mmc-hs200-1_8v; > > > > > > bus-width = <8>; > > > > > > status = "okay"; > > > > > > }; > > > > > > > > > > I'm not really sure what you're trying to fix here, but as far as MMC > > > > > goes, eMMC's can support io voltage of 3.3, 1.8 and 1.2V. Modes up until > > > > > HS DDR (50MHz in DDR) will use an IO voltage of 3.3V, higher speed modes > > > > > (HS200 and HS400) supporting 1.8V and 1.2V. > > > > > > > > Some users report that the eMMC is not working properly on their > > > > Beelink GS1 boards. > > > > > > > > > The mmc-hs200-1_8v property states that the MMC controller supports the > > > > > HS200 mode at 1.8V. Now, I can only assume that since BLDO2 is set up at > > > > > 1.8V then otherwise, the MMC core will rightfully decide to use the > > > > > highest supported mode. In this case, since the driver sets it, it would > > > > > be HS-DDR at 3.3V, which won't work with that fixed regulator. > > > > > > > > > > I can only assume that enabling HS200 at 1.8V only fixes the issue you > > > > > have because otherwise it would use HS-DDR at 3.3V, ie not actually > > > > > fixing the issue but sweeping it under the rug. > > > > > > > > > > Trying to add mmc-ddr-1_8v would be a good idea > > > > > > > > Thanks for the explanation, this is indeed the correct one. > > > > So It looks like the SDIO controller has an issue on some boards when > > > > using HS-DDR mode. > > > > > > > > Is this patch acceptable with the proper commit log? > > > > > > If HS-DDR works, yes, but I assume it doesn't? > > > > After discussing with Jernej about this issue, I understood that: > > - Automatic delay calibration is not implemented > > - We also miss some handling of DDR related bits in control register > > > > So none of H5/H6 boards should actually work. > > (Some 'lucky' boards seem to work enough to switch to HS200 mode...) > > > > To "fix" this the H5 disable the HS-DDR mode in sunxi mmc driver : > > https://github.com/torvalds/linux/blob/master/drivers/mmc/host/sunxi-mmc.c#L1409 > > I find it suspicious that some boards would have traces not good enough > for HS-DDR (50MHz in DDR) but would work fine in HS200 (200MHz in SDR). > If there's some mismatch on the traces, it will only be worse in HS200. FYI, similar situation is also with Tanix TX6 board. Mine works well in HS-DDR mode, but some people reported that it doesn't work for them. The only possible difference could be different eMMC IC. I'll try to confirm that. Anyway, I did some tests on OrangePi 3 board which also have eMMC. Both modes (HS-DDR and HS200) are supported and work well. Interesting observation is that speed test (hdparm -t) reported 80.58 MB/sec for HS-DDR mode and 43.40 MB/sec for HS200. As it can be seen here, HS-DDR is quicker by a factor of 2, but it should be the other way around. Reason for this is that both modes use same base clock and thus HS-DDR produces higher speed. If I change f_max to 150 MHz (max. per datasheet for SDR @ 1.8 V) then naturally HS200 mode is faster (124.63 MB/sec) as HS-DDR as it should be. This would be actually correct test for problematic boards but unfortunately I don't have it. I also hacked in support for HS400 (~143 MB/s) and this mode is the only one which really needs calibration on my board. Two observations from BSP driver: 1. Module clock is disabled before adjusting DDR bit and afterwards it's re- enabled . That could fix some kind of glitches. 2. SDMMC peripheral runs on higher clock than on mainline. > > And for the delay calibration, iirc, that's only necessary for HS400 > that we don't support? According to BSP driver and its DT, HS200 also needs calibration. However, it seems that using it on lower speed it isn't needed. Best regards, Jernej > > > I'm not sure about A64 but it looks like the property "mmc-hs200-1_8v" > > for the PineBook shows the same issue. > > > > The proper way would of course be to implement the missing feature > > mentioned above. > > But this could take some time and as the eMMC driver is actually > > broken wouldn't it be better to disable the HS-DDR for H6 in the mmc > > driver like it's done for H5 ? > > Have you tested with only the mmc-ddr-1_8v property? > > Maxime >