Re: Rock64 eMMC not working

From: Mark Millard <marklmi_at_yahoo.com>
Date: Sat, 30 Apr 2022 02:41:57 UTC
On 2022-Apr-29, at 15:47, Mark Millard <marklmi@yahoo.com> wrote:

> On 2022-Apr-29, at 14:30, John-Mark Gurney <jmg@funkthat.com> wrote:
> 
>> John-Mark Gurney wrote this message on Wed, Apr 06, 2022 at 21:08 -0700:
>> 
>> Bump?
>> 
>> Is no one working on/maintaining the Rock64 port?
>> 
>> Right now looking at getting the OTG port working on it, but it looks
>> like the dwcotg driver is completely broken in that it can't read data
>> accurately from the USB bus.
>> 
>>> I am trying to get the latest FreeBSD -current snapshot to boot/run off
>>> a Pine64 eMMC module on the Rock64, but I'm seeing an issue w/ mounting
>>> root:
>>> 
>>> FreeBSD 14.0-CURRENT #0 main-n254105-d53927b0bae: Thu Mar 31 09:26:31 UTC 2022
>>> [...]
>>> Trying to mount root from ufs:/dev/ufs/rootfs [rw]...
>>> mmcsd0: Error indicated: 4 Failed
>>> 
>>> I got similar messages when 13.1-RC1:
>>> 
>>> mmcsd0: 16GB <MMCHC M8B16G 2.8 SN D808D122 MFG 07/2018 by 136 0x0003> at mmc0 150.0MHz/8bit/1016-block
>>> mmcsd0boot0: 4MB partition 1 at mmcsd0
>>> mmcsd0boot1: 4MB partition 2 at mmcsd0
>>> mmcsd0rpmb: 4MB partition 3 at mmcsd0
>>> [...]
>>> GEOM: mmcsd0: the secondary GPT header is not in the last LBA.
>>> mmcsd0: Error indicated: 4 Failed
>>> rockchip_dwmmc1: Failed to update clk
>>> 
>>> 
>>> Are there any known issues w/ this?  A different image to try?
>>> 
>>> . . .
> 
> I'm in the middle of updating systems and the Rock64 is
> still back at:
> 
> # uname -apKU
> FreeBSD Rock64_RPi_4 14.0-CURRENT FreeBSD 14.0-CURRENT #28 main-n252475-e76c0108990b-dirty: Sat Jan 15 23:39:27 PST 2022     root@CA72_16Gp_ZFS:/usr/obj/BUILDs/main-CA53-nodbg-clang/usr/main-src/arm64.aarch64/sys/GENERIC-NODBG-CA53  arm64 aarch64 1400047 1400047
> 
> I normally only use the e.MMC during booting. The miscrsd card
> slot is left empty but I used it to manipulate microsd card
> content sometimes. The root file system is on a USB3 NVMe SSD.
> 
> # gpart show -p
> =>       63  244277185    mmcsd0  MBR  (116G)
>         63      32705            - free -  (16M)
>      32768     102312  mmcsd0s1  fat32lba  [active]  (50M)
>     135080      28760            - free -  (14M)
>     163840  241172480  mmcsd0s2  freebsd  (115G)
>  241336320    2940928            - free -  (1.4G)
> 
> =>        0  241172480   mmcsd0s2  BSD  (115G)
>          0  230686720  mmcsd0s2a  freebsd-ufs  (110G)
>  230686720   10485760             - free -  (5.0G)
> 
> =>        40  1953525088    da0  GPT  (932G)
>          40      532480  da0p1  efi  (260M)
>      532520        2008         - free -  (1.0M)
>      534528     7340032  da0p2  freebsd-swap  (3.5G)
>     7874560     1048576         - free -  (512M)
>     8923136    23068672  da0p3  freebsd-swap  (11G)
>    31991808     2097152         - free -  (1.0G)
>    34088960    33554432  da0p4  freebsd-swap  (16G)
>    67643392  1740636160  da0p5  freebsd-ufs  (830G)
>  1808279552     4194304  da0p6  freebsd-swap  (2.0G)
>  1812473856   141051272         - free -  (67G)
> 
> I can mount mmcsd0s1 (msdosfs) and/or mmcsd0s2a (UFS)
> and do I/O to them. (It is how I update the content.)
> 
> mmcsd0s2a has the copy of the FreeBSD kernel used to
> boot. This is because the FreeBSD kernel is the first
> stage to be able to deal with the USB3 port as far as
> I know. The e.MMC also is where the Rock64 gets U-Boot
> from and U-Boot gets the EFI from.
> 
> # mount -onoatime -tmsdosfs /dev/mmcsd0s1 /media
> # ls -Tld /media/*
> drwxr-xr-x  1 root  wheel  4096 Apr 13 07:24:32 2021 /media/EFI
> drwxr-xr-x  1 root  wheel  4096 Apr 13 08:15:48 2021 /media/dtb
> # ls -Tld /media/*/*/*
> -r-xr-xr-x  1 root  wheel  1243772 Jan 28 12:33:00 2022 /media/EFI/BOOT/bootaa64.efi
> -r-xr-xr-x  1 root  wheel    50618 Jan 28 12:32:28 2022 /media/dtb/rockchip/rk3328-rock64.dtb
> 
> As for the ufs content (boot not expanded):
> 
> # mount -onoatime /dev/mmcsd0s2a /mnt
> # ls -Tld /mnt/* /mnt/etc/*
> -r--r--r--   1 root  wheel   6170 Feb  1 04:48:34 2020 /mnt/COPYRIGHT
> drwxr-xr-x  23 root  wheel   1536 Jan 28 15:26:41 2022 /mnt/boot
> drwxr-xr-x   2 root  wheel    512 Apr 26 14:39:22 2020 /mnt/etc
> -rw-r--r--   1 root  wheel     37 Dec 31 16:00:18 2009 /mnt/etc/hostid
> drwx------   2 root  wheel  33280 Nov 27 09:46:08 2019 /mnt/lost+found
> 
> I've been experimenting with building and using
> U-Boot 2022.04 (not just on the Rock64) and that
> is what is currently in place, despite the FreeBSD
> vintage:
> 
> U-Boot TPL 2022.04 (Apr 23 2022 - 03:14:35)
> LPDDR3, 800MHz
> BW=32 Col=11 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=4096MB
> Trying to boot from BOOTROM
> Returning to boot ROM...
> 
> U-Boot SPL 2022.04 (Apr 23 2022 - 03:14:35 +0000)
> Trying to boot from MMC1
> Card did not respond to voltage select! : -110
> spl: mmc init failed with error: -95
> Trying to boot from MMC2
> NOTICE:  BL31: v2.5(release):
> NOTICE:  BL31: Built : 05:34:22, Dec  8 2021
> NOTICE:  BL31:Rockchip release version: v1.2
> 
> 
> U-Boot 2022.04 (Apr 23 2022 - 03:15:10 +0000)
> 
> Model: Pine64 Rock64
> DRAM:  4 GiB
> PMIC:  RK8050 (on=0x40, off=0x00)
> Core:  219 devices, 21 uclasses, devicetree: separate
> MMC:   mmc@ff500000: 1, mmc@ff520000: 0
> Loading Environment from MMC... Card did not respond to voltage select! : -110
> *** Warning - No block device, using default environment
> 
> In:    serial@ff130000
> Out:   serial@ff130000
> Err:   serial@ff130000
> Model: Pine64 Rock64
> Net:   eth0: ethernet@ff540000
> Hit any key to stop autoboot:  2  1  0 
> Card did not respond to voltage select! : -110
> switch to partitions #0, OK
> mmc0(part 0) is current device
> Scanning mmc 0:1...
> 50618 bytes read in 5 ms (9.7 MiB/s)
> . . . Card did not respond to voltage select! : -110
> Scanning disk mmc@ff500000.blk...
> Disk mmc@ff500000.blk not ready
> Scanning disk mmc@ff520000.blk...
> Found 3 disks
> No EFI system partition
> BootOrder not defined
> EFI boot manager: Cannot load any image
> Found EFI removable media binary efi/boot/bootaa64.efi
> 1243772 bytes read in 33 ms (35.9 MiB/s)
> Booting /efi\boot\bootaa64.efi
> . . .
> 
> I may discover that something breaks once I update
> FreeBSD, but the current status of my context seems
> to be working fine for the e.MMC .
> 
> I've no clue about the OTG port status. I've never
> tied to use it.
> 

I've got the Rock64 updated to:
(line split for better readability)

# uname -apKU
FreeBSD Rock64_RPi_4_3_2v1p2 14.0-CURRENT FreeBSD 14.0-CURRENT #32
main-n255108-9fb40baf6043-dirty: Thu Apr 28 22:57:05 PDT 2022
root@CA72_16Gp_ZFS:/usr/obj/BUILDs/main-CA53-nodbg-clang/usr/main-src/arm64.aarch64/sys/GENERIC-NODBG-CA53
arm64 aarch64 1400057 1400057

It still works the same as reported earlier. No
evidence of e.MMC related problems.


===
Mark Millard
marklmi at yahoo.com