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 7DAC0C77B7F for ; Tue, 16 May 2023 15:36:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A99EB8469B; Tue, 16 May 2023 17:36:28 +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="p8kc55e1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EB5B78467E; Tue, 16 May 2023 17:36:26 +0200 (CEST) Received: from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com [IPv6:2607:f8b0:4864:20::112c]) (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 A3B4184762 for ; Tue, 16 May 2023 17:36:23 +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-yw1-x112c.google.com with SMTP id 00721157ae682-56187339d6eso14672117b3.2 for ; Tue, 16 May 2023 08:36:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1684251382; x=1686843382; 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=aifZbgY6rfKqVk7WpYwKBQaa6O78cU5gGW4XhF25KIo=; b=p8kc55e1AnISrM01ppijmV+60FNt5DZW/0Xq34+xPwh/pukCWEaY8aSbKl/wVTM7+D D8OqCH9fkT6RkqNG36lDOnutE5s8P2QsDiL7pawbs0DfP3oX1SvS4m4vOKl1/3nu+SUl faEEzVkcnVlQxa8wDwpY1HM5bSBTbJL2T1r3o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684251382; x=1686843382; 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=aifZbgY6rfKqVk7WpYwKBQaa6O78cU5gGW4XhF25KIo=; b=ZTMQL6rQ3PRHh0KJraJPB0ebPCf8W7zkXM8mIEF2l5HCi3eiryvuKl5JWqTTDrBX2y 1xyVwmdp1sKzl4GVgHJGE4d5AvXMrRLKRkQFZ4F04TTREfKH4PCIFeg07I4GevUscv8z SPGuiIW54lkH35PYfjfJoNddjMQ7H/6CRhivDPnd9Ey8uDBISvKwbOvB7HKyTXQXO3ju z78uJN4RQzb5hHTnMGzWZiK2g6rQAfYw6A8SpOdgyuF7UMG0EVEO4ZeL92wWxUCmmBDn 2VhqMWYk3xSI5zoUriIEX9S2CHGlXEmg70p3vvssLcdM6nRB9ISwuKWgX282vMff321V tqbw== X-Gm-Message-State: AC+VfDwSGSIc7+Su1183bp9hsHZS8GyoDcfRtoojXroJ86wt0X+WogMZ rFfXSWoATw939f/6Z1uz7GY1gJSLU3Rr9oAYVRggtA== X-Google-Smtp-Source: ACHHUZ7IWPX1PBfA5qRyeMVhQkGH1cnqOA7CHG6EACPaXECpEXD8ZxrN80WRJj2fGCk9sZV1+ldyjg== X-Received: by 2002:a0d:f583:0:b0:561:5168:43f with SMTP id e125-20020a0df583000000b005615168043fmr7444404ywf.46.1684251382369; Tue, 16 May 2023 08:36:22 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-b213-426d-36fe-d1f1.res6.spectrum.com. [2603:6081:7b00:6400:b213:426d:36fe:d1f1]) by smtp.gmail.com with ESMTPSA id x9-20020a814a09000000b00545c373f7c0sm655999ywa.139.2023.05.16.08.36.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 08:36:21 -0700 (PDT) Date: Tue, 16 May 2023 11:36:20 -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: <20230516153620.GH2398826@bill-the-cat> References: <54f170af-4f8f-2481-6419-7098f27dc037@denx.de> <20230503171456.GF1134230@bill-the-cat> <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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="JSykprM3KSoGdv5d" Content-Disposition: inline In-Reply-To: <20230516070427.elndxd63jbnat2px@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 --JSykprM3KSoGdv5d Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 wrote: > > > > > > > > On Wednesday 03 May 2023 13:14:56 Tom Rini wrote: > > > > > > > > > On Wed, May 03, 2023 at 11:18:39AM +0200, Stefan Roese wr= ote: > > > > > > > > >=20 > > > > > > > > > > Hi Tom, > > > > > > > > > >=20 > > > > > > > > > > please pull this next batch of mostly Marvell related p= atches: > > > > > > > > >=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" say= s that all reset > > > > > > > > > events will restore the access bits in PARTITION_CONF= IG CSD register to > > > > > > > > > default User Data Area value (0b000). > > > > > > > > > =20 > > > > > > > > > So read partition access bits from PARTITION_CONFIG C= SD register before > > > > > > > > > issuing card reset. This allows SPL/U-Boot to get inf= ormation which eMMC > > > > > > > > > partition was in use before SPL/U-Boot was booted. Fo= r some platforms this > > > > > > > > > is the way how to determinate boot partition from whi= ch 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 2023 -= 13:10:10 -0400) > > > > > > > > > Trying to boot from MMC1 > > > > > > > > > omap_hsmmc_send_cmd: timedout waiting on cmd inhibit to c= lear > > > > > > > > > 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 h= ide this code > > > > > > > > behind CONFIG symbol and enable it only for mvebu. For exam= ple by this: > > > > > > >=20 > > > > > > > Well, maybe the problem is we're trying this on uSD cards? Th= e failure I > > > > > > > reported was uSD and not eMMC. > > > > > >=20 > > > > > > Maybe it is that reason. Problem is that at this stage we do no= t know if > > > > > > card is SD or MMC. > > > > > >=20 > > > > > > Martin, can you check if booting from SD card is working fine o= n 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 abov= e one and > > > > > > > the board is fine again. > > > > > > >=20 > > > > > > > --=20 > > > > > > > Tom > > > > > >=20 > > > > > > Immediately after that "problematic code" is card reset functio= n. So > > > > > > another reason for failure is that card reset functionality doe= s not > > > > > > work correctly on your board / platform. > > > > >=20 > > > > > Well, we're at two different platforms and controllers that this = change > > > > > breaks things on, so I'm not sure where the fault is exactly. My > > > > > mx6cuboxi is still fine booting from uSD. Another TI platform fr= om the > > > > > same general era as am335x fails the same way (not a surprise), a= mlogic > > > > > libretech-cc is fine, pine64_plus is fine, and my newer TI platfo= rms are > > > > > also fine with this. So maybe the Kconfig is fine, but we just w= ant > > > > > default y, default n if ARCH_OMAP2PLUS || ARCH_BCM283X (the TI pl= atforms > > > > > 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 or at= its > > > > qemu emulated version (to which can be attached gdb). But Nokia N90= 0 is > > > > without SPL. > > >=20 > > >=20 > > > OK, so on am335x_evm mine is setup so I can X/Y modem boot it before = it > > > tries uSD. In this case, full U-Boot also fails: > > > Loading Environment from FAT... omap_hsmmc_send_cmd: timedout waiting= 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 the > > > emulator not being faithful to some undocumented bug/feature of the > > > 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 repo= rt > > > 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 itself. > > >=20 > > >=20 > > > --=20 > > > Tom > >=20 > > Ok, I have tested it on Nokia N900 HW and interesting is that SD card is > > also working fine. But its initialization is slower and prints warning: > >=20 > > omap_hsmmc_send_cmd: timeout waiting on cmd inhibit to clear >=20 > Ok, so what with it? 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 Tom --JSykprM3KSoGdv5d Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmRjovQACgkQFHw5/5Y0 tyyd8gv/QJ/HfDcn09ZD4C6oVHZowCmGxamQc1k4jccm5AZyYbZdgjX/mqVxeaKR +ceR/mqt9fzJiEV4FQY5zYRNCQL/gQw6FoGBIlO1fvDRycrNMhXWRwwOHKjzSrHF xIAkXFQF8emzUCY6aCxmtdculcyr7pMlAKIifFpcIVa7toRoEUAfE56K55+YlKfs 5jGe86Bc54RaA3Pgr3MMA6Cf6P5zB5lDMLz5YDCD4xRkVblOeo7mgcaIPL/8zxNt LF70qJ7tvqkcS/i7K6utUMr+3vYISwNipSTvfWCGEXy+/nfKZn95J6lDryiKWvz1 2/+Zs3I757z9jlcHSnqDxCt6RfldWQTWF7w+sLiBlezrSLIFWsgIT6S7wIsZ0E7g h2xeUfHTviNNofh+w5q0ywngc9HnJhjG6t/mc5tMvm7vJIYEPjR2YyEMEGsvJlgI xFCtQvMRaBzjr2cq7k4xht6/9o5Rzf44S0DmkfQfJlwd7PlKcmCoLBupYKeAcyDp N0q/du/d =Z9ni -----END PGP SIGNATURE----- --JSykprM3KSoGdv5d--