From nobody Fri Dec 10 20:59:04 2021 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E413618CF4CD for ; Fri, 10 Dec 2021 21:00:16 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic304-25.consmr.mail.gq1.yahoo.com (sonic304-25.consmr.mail.gq1.yahoo.com [98.137.68.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4J9jwJ3zllz4m5n for ; Fri, 10 Dec 2021 21:00:16 +0000 (UTC) (envelope-from marklmi@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1639170009; bh=Fvv2+2AulA67sy7Jgv4xhbBkRisCuWBBtblVf/K3RSM=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=Ujmuh+wrXonJZaHfVWcEXRreHZOsr0oGmfHwH2qZkJxXhKjErX72gqjngKXyuQGvURPm/QGSJ8ucacSqvqPErZUN5/VMLpKZvht3iL8TvQ5JuPgvBEALjXj5V5t83/IAH//fZ7MmuxcQC7CoSftnVs4XqzevQZfdf16TTekwDjNEZa5s4F+9LMPnt9AXZ1sYfpjfVzclGQ5/EhBN03TCtpUnpduF/TlyJsH281zW9kqzyCLmAyNbdWlJrp0IFNqvH5+/jF8AGNLHwsiFzn9HFlpsep3TFH5nKH8baXb9dGajpUMqo5ryClJ/KUy6ib89nilwYZb20VIp6PajFh89Rg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1639170009; bh=gE5uetAxIytZDemk/C4mDex5NuKEWWrBFbKKUAJY6lf=; h=X-Sonic-MF:Subject:From:Date:To:From:Subject; b=ofTPsQ86uyOOgZipKZz3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RD1PAjP..IH1 6.FEdvkjl_p80CqWm2scIwDq2pwQbo189jZa5hynMxkgOWJJfUwLJvdy24SNkWlFfNSlws4.5LBl lPQfZ5rhxoivTbXxqYPuomthYmRI6HsVHubuoe6zq._nThPhK5UOI4U80u.b5VubYAu55zEFS5Yx z8Klk8APUocyClbKHPSv.EaiY0NI8OC7N7c0AS0dXC637ItNjdkH8h76sK.XbDkuTp6q4_LL5vWH LaLw68dJYeuEo3pCWQ8leJAd5GpsAWjvZyUo1xwB16g1N37FE1rEre1Lq6iGvbSCPj9sS8zqa7EW gbW1HLcTgyuRyTP8FxJPM93RTS95kF4pyMzoJj3YdR3zcBVFBzsqOH7ZgkqR6ILYzEtajWMY.ZNx hTx.YiG5t7XkivvWvvyp_8_jFCMRFO2Hn15ZzAShr6ewAhpM47xoL66wqQDIz9H4dH.K1QR7wx49 vAZOluSpDva0uH7lGH1qwh1rcYyoiT2pZuaJxKJH2D5i6P02mVF4m.YgnSc8H1v.L8gzBTFpX47S IoQphcNllrd3n5kM0kg6SVyMXiQ-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.gq1.yahoo.com with HTTP; Fri, 10 Dec 2021 21:00:09 +0000 Received: by kubenode529.mail-prod1.omega.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 272e5b15e8ef8c86b07a2d25ce83737b; Fri, 10 Dec 2021 20:59:10 +0000 (UTC) Content-Type: text/plain; charset=utf-8 List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: Rock64 configuration fails to boot for main 22c4ab6cb015 but worked for main 06bd74e1e39c (Nov 21): e.MMC mishandled? In-Reply-To: Date: Fri, 10 Dec 2021 12:59:04 -0800 Cc: Emmanuel Vadot , Peter Jeremy , Andriy Gapon , Free BSD , "wma@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <21B0478B-340F-4BB2-9189-B5A6AE458134@yahoo.com> References: <243CBFC7-DFB5-4F8B-A8A3-CFF78455148D.ref@yahoo.com> <243CBFC7-DFB5-4F8B-A8A3-CFF78455148D@yahoo.com> <20211209081930.7970b6995a8f7c5f7466227d@bidouilliste.com> <053617FD-AA34-4A3F-853A-4D2E44F8254B@yahoo.com> <43901D57-9C39-4FAC-A2BE-CCE642791705@yahoo.com> <8DAA50A1-3CF0-4AFA-9977-58FE15D4F171@yahoo.com> To: =?utf-8?Q?Kornel_Dul=C4=99ba?= X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4J9jwJ3zllz4m5n X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Reply-To: marklmi@yahoo.com From: Mark Millard via freebsd-arm X-Original-From: Mark Millard X-ThisMailContainsUnwantedMimeParts: N On 2021-Dec-10, at 01:51, Kornel Dul=C4=99ba = wrote: > On Thu, Dec 9, 2021 at 11:54 PM Mark Millard = wrote: >>=20 . . . [History deleted] . . . >> Well, I've tried Armbian 21.08 (Linux 5.10.60-rockchip64) and its = first >> boot reports the sequence ended up using HS200 at 150 MHz: >>=20 >> # dmesg | grep mmc >> [ 3.195642] vcc18_emmc: supplied by vcc_io >> [ 3.227180] dwmmc_rockchip ff520000.mmc: IDMAC supports 32-bit = address mode. >> [ 3.227187] dwmmc_rockchip ff500000.mmc: IDMAC supports 32-bit = address mode. >> [ 3.227225] dwmmc_rockchip ff520000.mmc: Using internal DMA = controller. >> [ 3.227234] dwmmc_rockchip ff500000.mmc: Using internal DMA = controller. >> [ 3.227244] dwmmc_rockchip ff520000.mmc: Version ID is 270a >> [ 3.227259] dwmmc_rockchip ff500000.mmc: Version ID is 270a >> [ 3.227342] dwmmc_rockchip ff520000.mmc: DW MMC controller at irq = 42,32 bit host data width,256 deep fifo >> [ 3.227390] dwmmc_rockchip ff500000.mmc: DW MMC controller at irq = 41,32 bit host data width,256 deep fifo >> [ 3.229762] mmc_host mmc0: card is non-removable. >> [ 3.241627] mmc_host mmc1: Bus speed (slot 0) =3D 400000Hz (slot = req 400000Hz, actual 400000HZ div =3D 0) >> [ 3.241860] mmc_host mmc0: Bus speed (slot 0) =3D 400000Hz (slot = req 400000Hz, actual 400000HZ div =3D 0) >>=20 >> Note the below 3 lines: >=20 >>=20 >> [ 3.327640] mmc_host mmc0: Bus speed (slot 0) =3D 150000000Hz = (slot req 150000000Hz, actual 150000000HZ div =3D 0) >> [ 3.730166] dwmmc_rockchip ff520000.mmc: Successfully tuned phase = to 245 >> [ 3.730397] mmc0: new HS200 MMC card at address 0001 >>=20 >> Note the "tuned phase to 245" as part of that. >=20 > Yep, it looks like in Linux they're doing some custom tuning logic > specific to this controller. > FreeBSD only executes generic tuning code, which apparently is not = enough. Based on this and some more exchanges with Andriy off list, I went looking in Linux source, something I'd been avoiding. Sure enough: dw_mci_rk3288_execute_tuning explores, looking for the widest range of phase settings that work and picking the middle of the range as the value to leave in place. That code is what generates the "Successfully tuned phase to" notice that Linux was reporting. (There is a default used if all settings work.) The code for doing this uses CMD21 to evaluate the phase settings. If this sort of thing is (sometimes?) normal (to have some context-specific implicit parameter assignment involved for the CMD21 use), I've not yet noticed how FreeBSD allows for getting to device-specific code that establishes the assignment.=20 But, clearly, I'm far from knowledgable about how things work/fit. I've just been reading understand some about the problem. >>=20 >> [ 3.732538] mmcblk0: mmc0:0001 DJNB4R 116 GiB >> [ 3.733510] mmcblk0boot0: mmc0:0001 DJNB4R partition 1 4.00 MiB >> [ 3.734513] mmcblk0boot1: mmc0:0001 DJNB4R partition 2 4.00 MiB >> [ 3.734917] mmcblk0rpmb: mmc0:0001 DJNB4R partition 3 4.00 MiB, = chardev (243:0) >> [ 3.746005] mmcblk0: p1 >> [ 4.880861] EXT4-fs (mmcblk0p1): mounted filesystem with writeback = data mode. Opts: (null) >> [ 6.686795] EXT4-fs (mmcblk0p1): re-mounted. Opts: = commit=3D600,errors=3Dremount-ro >> [ 12.767622] EXT4-fs (mmcblk0p1): resizing filesystem from 479232 = to 30224384 blocks >> [ 22.791358] EXT4-fs (mmcblk0p1): resized to 16252928 blocks >> [ 31.531320] EXT4-fs (mmcblk0p1): resized filesystem to 30224384 >>=20 >> So, as far as I can tell, if FreeBSD wants to support HS200 at 150 = MHz >> on the Rock64, it can be done, voltage changing and tuning apparently >> involved. >>=20 >> That is not to say that any FreeBSD developer wants to be supporting = such. >> Sticking to 52 MHz and possibly 3V for the Rock 64 eMMC use would = again >> make things operational. >=20 > Yes, imho marking HS200 in this controller as broken is the right > choice, unless someone(TM) writes the missing code. Seems appropriate to me. >> I'll note that Armbian's U-Boot reports itself as: >>=20 >> U-Boot 2020.10-armbian (Aug 08 2021 - 18:02:43 +0200) >>=20 >> I'll also note that rebooting swapped which was mmc0 vs. mmc1: >>=20 >> # dmesg | grep mmc >> [ 3.198267] vcc18_emmc: supplied by vcc_io >> [ 3.229498] dwmmc_rockchip ff500000.mmc: IDMAC supports 32-bit = address mode. >> [ 3.229547] dwmmc_rockchip ff500000.mmc: Using internal DMA = controller. >> [ 3.229566] dwmmc_rockchip ff500000.mmc: Version ID is 270a >> [ 3.229665] dwmmc_rockchip ff500000.mmc: DW MMC controller at irq = 41,32 bit host data width,256 deep fifo >> [ 3.229762] dwmmc_rockchip ff520000.mmc: IDMAC supports 32-bit = address mode. >> [ 3.229799] dwmmc_rockchip ff520000.mmc: Using internal DMA = controller. >> [ 3.229817] dwmmc_rockchip ff520000.mmc: Version ID is 270a >> [ 3.229896] dwmmc_rockchip ff520000.mmc: DW MMC controller at irq = 42,32 bit host data width,256 deep fifo >> [ 3.231547] mmc_host mmc1: card is non-removable. >> [ 3.243883] mmc_host mmc0: Bus speed (slot 0) =3D 400000Hz (slot = req 400000Hz, actual 400000HZ div =3D 0) >> [ 3.244767] mmc_host mmc1: Bus speed (slot 0) =3D 400000Hz (slot = req 400000Hz, actual 400000HZ div =3D 0) >> [ 3.327505] mmc_host mmc1: Bus speed (slot 0) =3D 150000000Hz = (slot req 150000000Hz, actual 150000000HZ div =3D 0) >> [ 3.834347] dwmmc_rockchip ff520000.mmc: Successfully tuned phase = to 251 >> [ 3.834477] mmc1: new HS200 MMC card at address 0001 >> [ 3.836188] mmcblk1: mmc1:0001 DJNB4R 116 GiB >> [ 3.837140] mmcblk1boot0: mmc1:0001 DJNB4R partition 1 4.00 MiB >> [ 3.838155] mmcblk1boot1: mmc1:0001 DJNB4R partition 2 4.00 MiB >> [ 3.838599] mmcblk1rpmb: mmc1:0001 DJNB4R partition 3 4.00 MiB, = chardev (243:0) >> [ 3.841290] mmcblk1: p1 >> [ 4.876902] EXT4-fs (mmcblk1p1): mounted filesystem with writeback = data mode. Opts: (null) >> [ 6.614516] EXT4-fs (mmcblk1p1): re-mounted. Opts: = commit=3D600,errors=3Dremount-ro >>=20 >=20 =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)