From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EEA37C77B75 for ; Tue, 16 May 2023 18:56:55 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 218E986657; Tue, 16 May 2023 20:56:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="am+SSsSC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C4B188665B; Tue, 16 May 2023 20:56:52 +0200 (CEST) Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2F0CF861A4 for ; Tue, 16 May 2023 20:56:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-yb1-xb35.google.com with SMTP id 3f1490d57ef6-ba76528fe31so5512565276.1 for ; Tue, 16 May 2023 11:56:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1684263409; x=1686855409; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=fra55wxX2Y9x6sC9XlB2TEjTPuYpp7FybCcLJW/5sOU=; b=am+SSsSCZBklRrNf2SugIIAULHe6Eb6Lvh8RrgfIRiW+tWY55uiLukUEg2APA6/vtn Jgm4pMLRRfpmQcPMbE2J+KvzbuJHL+UGTvEiIxtzFU13p7aM+mhj3VF8LShMceWk2S9+ RdWNXQ+YFhQ9XT3UceQt+MdsZs2s1v3DMPeBc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684263409; x=1686855409; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=fra55wxX2Y9x6sC9XlB2TEjTPuYpp7FybCcLJW/5sOU=; b=c3GDmnDBNB1eLvf/jlizWgTTHE6WybE7szfBCMlp5V91fBDlJNc82T566T0fQ4Ys2i U8EJ1ZAjzUhLGs68A+MdFMp7D0f7yObM31EkMJQs+mdCuYb6UEMOX+/ZQ0B5mlYQcioZ 6IKS7F0mh0Vevz/hvb8MW1dbUtMWrUBvYUDte8StiUZPn0mHXQ3n/zVH4BKup3bEy2eV cGFfI83KIQ/aKQeIpbRCyE13nzjgEWzOImT9ax7kg63k9LMLBggDSQ4/71/XjCSkeTvx odu0oIV1bhoRI2ykS/K/aKdKD88LbYYP8Xi1ACIinivBWwgVqrfJ0/E0EN8To56Wy75Y S2Tw== X-Gm-Message-State: AC+VfDy25Hwu1n73TcTK1ufNq4tNCzdOApcKtVa0cFeGMeyvwc7FVqnC xzghnsaMbdfFmRKo5wEwSfVgzg== X-Google-Smtp-Source: ACHHUZ4Pdnx+D9oWEdZSkoExPLMCUPLis+a5044GxcROFlwe5MG8UZrf9CfzyrxUxYzM5l3w9R0O6w== X-Received: by 2002:a0d:ca16:0:b0:561:8c00:a644 with SMTP id m22-20020a0dca16000000b005618c00a644mr2496868ywd.5.1684263408742; Tue, 16 May 2023 11:56:48 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-a2da-5788-2855-381d.res6.spectrum.com. [2603:6081:7b00:6400:a2da:5788:2855:381d]) by smtp.gmail.com with ESMTPSA id l81-20020a0de254000000b00559d1eabc3csm67757ywe.79.2023.05.16.11.56.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 11:56:48 -0700 (PDT) Date: Tue, 16 May 2023 14:56:46 -0400 From: Tom Rini To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Martin Rowe , Stefan Roese , U-Boot Mailing List Subject: Re: mmc: Read eMMC partition access bits before card reset Message-ID: <20230516185646.GL2398826@bill-the-cat> References: <20230505193710.n35h2ofq6fogk4bq@pali> <20230507135452.GZ293044@bill-the-cat> <20230507140104.7wuzf7ymdkznxl26@pali> <20230507144044.GA293044@bill-the-cat> <20230507145604.jxlxh42telwibq2o@pali> <20230507164511.GB293044@bill-the-cat> <20230507203616.a7ptbxfzvfqdtikz@pali> <20230516070427.elndxd63jbnat2px@pali> <20230516153620.GH2398826@bill-the-cat> <20230516185223.2vew4jqy36ytfyyc@pali> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="k5nBG3Bt9rD5pvG2" Content-Disposition: inline In-Reply-To: <20230516185223.2vew4jqy36ytfyyc@pali> X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean --k5nBG3Bt9rD5pvG2 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 16, 2023 at 08:52:23PM +0200, Pali Roh=E1r wrote: > On Tuesday 16 May 2023 11:36:20 Tom Rini wrote: > > On Tue, May 16, 2023 at 09:04:27AM +0200, Pali Roh=E1r wrote: > > > On Sunday 07 May 2023 22:36:16 Pali Roh=E1r wrote: > > > > On Sunday 07 May 2023 12:45:11 Tom Rini wrote: > > > > > On Sun, May 07, 2023 at 04:56:04PM +0200, Pali Roh=E1r wrote: > > > > > > On Sunday 07 May 2023 10:40:44 Tom Rini wrote: > > > > > > > On Sun, May 07, 2023 at 04:01:04PM +0200, Pali Roh=E1r wrote: > > > > > > > > On Sunday 07 May 2023 09:54:52 Tom Rini wrote: > > > > > > > > > On Fri, May 05, 2023 at 09:37:10PM +0200, Pali Roh=E1r wr= ote: > > > > > > > > > > On Wednesday 03 May 2023 13:14:56 Tom Rini wrote: > > > > > > > > > > > On Wed, May 03, 2023 at 11:18:39AM +0200, Stefan Roes= e wrote: > > > > > > > > > > >=20 > > > > > > > > > > > > Hi Tom, > > > > > > > > > > > >=20 > > > > > > > > > > > > please pull this next batch of mostly Marvell relat= ed patches: > > > > > > > > > > >=20 > > > > > > > > > > > NAK. With commit: > > > > > > > > > > > commit 461fa17970de418a93832f734a595031c0b72128 > > > > > > > > > > > Author: Pali Roh=E1r > > > > > > > > > > > Date: Thu Apr 13 22:57:48 2023 +0200 > > > > > > > > > > >=20 > > > > > > > > > > > mmc: Read eMMC partition access bits before card = reset > > > > > > > > > > > =20 > > > > > > > > > > > eMMC specification in section "Access partitions"= says that all reset > > > > > > > > > > > events will restore the access bits in PARTITION_= CONFIG CSD register to > > > > > > > > > > > default User Data Area value (0b000). > > > > > > > > > > > =20 > > > > > > > > > > > So read partition access bits from PARTITION_CONF= IG CSD register before > > > > > > > > > > > issuing card reset. This allows SPL/U-Boot to get= information which eMMC > > > > > > > > > > > partition was in use before SPL/U-Boot was booted= =2E For some platforms this > > > > > > > > > > > is the way how to determinate boot partition from= which BootROM loaded SPL. > > > > > > > > > > > =20 > > > > > > > > > > > Signed-off-by: Pali Roh=E1r > > > > > > > > > > >=20 > > > > > > > > > > > My am335x_evm now fails to boot with: > > > > > > > > > > >=20 > > > > > > > > > > > U-Boot SPL 2023.07-rc1-00021-g461fa17970de (May 03 20= 23 - 13:10:10 -0400) > > > > > > > > > > > Trying to boot from MMC1 > > > > > > > > > > > omap_hsmmc_send_cmd: timedout waiting on cmd inhibit = to clear > > > > > > > > > > > spl: mmc init failed with error: -110 > > > > > > > > > > > SPL: failed to boot from all boot devices > > > > > > > > > > > ### ERROR ### Please RESET the board ### > > > > > > > > > > >=20 > > > > > > > > > > > I can provide more details / test patches as needed. > > > > > > > > > > >=20 > > > > > > > > > > > --=20 > > > > > > > > > > > Tom > > > > > > > > > >=20 > > > > > > > > > > I do not know what to do with this... The only idea is = to hide this code > > > > > > > > > > behind CONFIG symbol and enable it only for mvebu. For = example by this: > > > > > > > > >=20 > > > > > > > > > Well, maybe the problem is we're trying this on uSD cards= ? The failure I > > > > > > > > > reported was uSD and not eMMC. > > > > > > > >=20 > > > > > > > > Maybe it is that reason. Problem is that at this stage we d= o not know if > > > > > > > > card is SD or MMC. > > > > > > > >=20 > > > > > > > > Martin, can you check if booting from SD card is working fi= ne on mvebu > > > > > > > > clearfog? > > > > > > > >=20 > > > > > > > > > I see a failure with this commit on > > > > > > > > > rpi_3_32b, also from uSD boot. This time it's: > > > > > > > > > Loading Environment from FAT... fsm 0, hsts 00000000 > > > > > > > > > fsm 0, hsts 00000000 > > > > > > > > > ... > > > > > > > > >=20 > > > > > > > > > once in U-Boot itself. Going to the commit prior to the = above one and > > > > > > > > > the board is fine again. > > > > > > > > >=20 > > > > > > > > > --=20 > > > > > > > > > Tom > > > > > > > >=20 > > > > > > > > Immediately after that "problematic code" is card reset fun= ction. So > > > > > > > > another reason for failure is that card reset functionality= does not > > > > > > > > work correctly on your board / platform. > > > > > > >=20 > > > > > > > Well, we're at two different platforms and controllers that t= his change > > > > > > > breaks things on, so I'm not sure where the fault is exactly.= My > > > > > > > mx6cuboxi is still fine booting from uSD. Another TI platfor= m from the > > > > > > > same general era as am335x fails the same way (not a surprise= ), amlogic > > > > > > > libretech-cc is fine, pine64_plus is fine, and my newer TI pl= atforms are > > > > > > > also fine with this. So maybe the Kconfig is fine, but we ju= st want > > > > > > > default y, default n if ARCH_OMAP2PLUS || ARCH_BCM283X (the T= I platforms > > > > > > > that work are not ARCH_OMAP2PLUS). > > > > > > >=20 > > > > > > > --=20 > > > > > > > Tom > > > > > >=20 > > > > > > And do you see this problem in SPL or in proper U-Boot? > > > > > >=20 > > > > > > If omap2plus is problematic then I can do tests on Nokia N900 o= r at its > > > > > > qemu emulated version (to which can be attached gdb). But Nokia= N900 is > > > > > > without SPL. > > > > >=20 > > > > >=20 > > > > > OK, so on am335x_evm mine is setup so I can X/Y modem boot it bef= ore it > > > > > tries uSD. In this case, full U-Boot also fails: > > > > > Loading Environment from FAT... omap_hsmmc_send_cmd: timedout wai= ting on > > > > > cmd inhibit to clear > > > > > ** Bad device specification mmc 0 ** > > > > >=20 > > > > > Note that N900 in QEMU passes, but I suspect that's a matter of t= he > > > > > emulator not being faithful to some undocumented bug/feature of t= he > > > > > chipset and that it would also fail like this on real HW or that = we > > > > > aren't relying on MMC in such a way that the QEMU tests actually = report > > > > > failure. When I booted the above, it was not a lock-up since we = can > > > > > continue on in this case, rather than failure to load U-Boot itse= lf. > > > > >=20 > > > > >=20 > > > > > --=20 > > > > > Tom > > > >=20 > > > > Ok, I have tested it on Nokia N900 HW and interesting is that SD ca= rd is > > > > also working fine. But its initialization is slower and prints warn= ing: > > > >=20 > > > > omap_hsmmc_send_cmd: timeout waiting on cmd inhibit to clear > > >=20 > > > Ok, so what with it? > >=20 > > Seems like this change is a real bad idea to introduce on ARCH_OMAP2PLUS > > platforms, and probably ARCH_BCM283X too, so rework with a Kconfig > > option that defaults to on except for the above as I suggested? > >=20 > > --=20 > > Tom >=20 > Ok, patch is on the list... I'm curious if patch stay here on the list > more than one year like some other... I mean, since I asked you to spin a new patch and you posted a patch on top of the previously rejected one, someone will need to pick it up and fold it together. I don't know how motivated Stefan is to clear out the original patch. --=20 Tom --k5nBG3Bt9rD5pvG2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmRj0e4ACgkQFHw5/5Y0 tyx62AwAjqN5KfdlbGdZuexEMY5Q3ET4uMGzQAGepYX1SZppQ5b37eWguV+q6MFj znfc+YgtlLvIxuZJyWyIx9AW6qR49m5VP5V3vlupSfnxepCpuuG/swxLR1bGlhLB xGu7D36sFjSaSCVs1Oe8L1/Ck1BjpPyjNpoyY2y2Q6CLPFwNGFILak7MvK6mEmGT TUYySzCyOUhVFV0FXTIT8jamZyyY/EtVd6jRvj83l6EnVujugkFpEX8Oa9uIk8sc UJMnNK+t7HjI2Tyrv7eLgnnFT0gzS7mGWVMlCgQnRTNoKv82LVcsJuwK05P9ECTw Lsjlh6lffYF4u7JrvnsNgR8Shown6HUSItKh5A1B2BBCiu6RvDcuT62YYCwJHuUI tsh+ciHFHogs/Mi1N8j6Yhye7eS3nxgcm/t/L0HGKQVZVUUiUebeZ43ItiD2k1y1 ZxWm7zAoKouYibqa2LY56hgzx26gWYfCEwMECIQOIOf1R3Y0wiuGpLn3BZik8IBR DRuLZwtC =f5a0 -----END PGP SIGNATURE----- --k5nBG3Bt9rD5pvG2--