eMMC boot help
#1
I am trying to get the [unsupported] armbian image to load from eMMC on my pine h64 model b.  The armbian image 

https://dl.armbian.com/pineh64/archive/A..._5.1.15.7z

seems to work like a charm on SD, but I'd like to get the os onto eMMC for faster io.  I have been able to get the Android eMMC and AOSC builds to boot from eMMC on this board, but I'd really prefer Armbian, just because it is a known and will be similar to the rock64 boards I have running Armbian.

However, flashing the image directly onto eMMC doesn't seem to work.  Trying to boot just gives me a black cursor on the serial console.  No activity at all, no u-boot or anything.  As far as I can tell, this should work.  The image seems to have the correct `eGON.BT0` header at the right offset in the image, so I presumed it would have/should have booted.  But no dice

I am new to u-boot, but took a stab at building and installing it onto the eMMC for the h6 anyway, using as a guide: 

http://linux-sunxi.org/Mainline_U-Boot

After following the instructions, building u-boot on a rock64 (targeting the h6), and writing it to the eMMC at the 8kb offset, I pop the card onto the h6.  

However on boot I end up with :
Quote:U-Boot SPL 2020.01-rc2-00035-g3ff1ff3ff7 (Nov 17 2019 - 10:16:56 +0000)
DRAM: 4096 MiB
Trying to boot from MMC2


and it just hangs there.  AFAICT MMC2 is the correct device.
Any pointers?  is there a different branch of u-boot I should be using for the pine64 H6-b ?



One of the complexities is that I can't seem to get the H6 to boot from SD and still be able to read/write to the eMMC device.  Any changes I want to make to the eMMC has to be done on the rock64 and then plugged back onto the H6.  If there is a way to get both SD and eMMC to play nicely on the H6 it would surely shorten the 'round trip' time for making changes.

Any help is greatly appreciated.  TIA
#2
While having inserted Armbian SDCard, did you tried to stop u-boot to get into prompt and then do "mmc list" and something like "ls mmc X" where "X" is the eMMC ?
#3
(11-18-2019, 10:54 AM)martinayotte Wrote: While having inserted Armbian SDCard, did you tried to stop u-boot to get into prompt and then do "mmc list" and something like "ls mmc X" where "X" is the eMMC ?

Pretty sure I tried that scenario, but I don't recall the outcome.  I will give that another try this evening.  Thx
#4
I can't help much since I don't have an H6, but does the Armbianimage include the emmc installer, or are you having to install using another computer?
#5
(11-18-2019, 02:51 PM)tophneal Wrote: I can't help much since I don't have an H6, but does the Armbianimage include the emmc installer, or are you having to install using another computer?
Of course, Armbian is providing "nand-sata-install" script ...
#6
(11-18-2019, 10:54 AM)martinayotte Wrote: While having inserted Armbian SDCard, did you tried to stop u-boot to get into prompt and then do "mmc list" and something like "ls mmc X" where "X" is the eMMC ?

mmc reads fine from u-boot, as long as u-boot image comes from the SD card:
Quote:=> mmc list
mmc@4020000: 0 (SD)
mmc@4022000: 1 (eMMC)
=>  mmc  info
Device: mmc@4022000
Manufacturer ID: 15
OEM: 100
Name: CJNB4
Bus Speed: 52000000
Mode : MMC High Speed (52MHz)
Rd Block Len: 512
MMC version 5.1
High Capacity: Yes
Capacity: 58.2 GiB
Bus Width: 1-bit
Erase Group Size: 512 KiB
HC WP Group Size: 8 MiB
User Capacity: 58.2 GiB WRREL
Boot Capacity: 4 MiB ENH
RPMB Capacity: 4 MiB ENH
=>  mmc part

Partition Map for MMC device 1  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     8192            2220032         795ac289-01     83
=> ls mmc 1
<DIR>       4096 .
<DIR>       4096 ..
<DIR>      16384 lost+found
<DIR>       4096 bin
<DIR>       4096 boot
<DIR>       4096 dev
<DIR>       4096 etc
<DIR>       4096 home
<DIR>       4096 lib
<DIR>       4096 media
<DIR>       4096 mnt
<DIR>       4096 opt
<DIR>       4096 proc
<DIR>       4096 root
<DIR>       4096 run
<DIR>       4096 sbin
<DIR>       4096 selinux
<DIR>       4096 srv
<DIR>       4096 sys
<DIR>       4096 tmp
<DIR>       4096 usr
<DIR>       4096 var
=>  ls mmc 1 /boot
<DIR>       4096 .
<DIR>       4096 ..
<SYM>         22 Image
<SYM>         18 dtb
<SYM>         22 uInitrd
<DIR>       4096 dtb-5.1.15-sunxi64
          230454 boot.bmp
               0 .next
            1536 armbian_first_run.txt.template
         3086376 System.map-5.1.15-sunxi64
             116 armbianEnv.txt
          154694 config-5.1.15-sunxi64
            4882 boot-desktop.png
            2970 boot.cmd
            3042 boot.scr
         8921657 initrd.img-5.1.15-sunxi64
         8921721 uInitrd-5.1.15-sunxi64
        14563336 vmlinuz-5.1.15-sunxi64
=>


what is the nand-sata-install script?

EDIT: it looks like the `nand-sata-install` script requires the ability to read eMMC and SD at the same time - which so far I have not been able to do. The eMMC device shows up when I boot from SD, but as soon as I attempt to read it, the app hangs (fdisk, mount, etc)

TIA
#7
update, it appears that using the rock64 as an eMMC writer is a strategy that only works for other rock64 devices.  A USB eMMC writer showed up today and I used it and etcher to write the armbian pine h64  image to the eMMC card.  

Now it at least *tries* to boot.  It gets all the way to the point where it does: 

Quote:...
[/sbin/fsck.ext4 (1) -- /dev/mmcblk2p1] fsck.ext4 -a -C0 /dev/mmcblk2p1
/dev/mmcblk2p1: clean, 35969/69408 files, 237306/277504 blocks


but just hangs at the point I'd expect it to load the kernel and/or mount the root fs.

I modified armbianEnv.txt to point the root fs to /dev/mmcblk2p1 and ran mkimage to generate a new boot.scr.  To no avail however.

Very much closer at this point. I get the same behavior if I pause the bootloader from the SD card and specify the eMMC device to boot.
#8
(11-18-2019, 09:48 PM)SuburbanDad Wrote: The eMMC device shows up when I boot from SD, but as soon as I attempt to read it, the app hangs (fdisk, mount, etc)
If booting SD allows you to see /dev/mmcblk2, but you are unable to do "fdisk /dev/mmcblk2", there is maybe an hardware issue.
What do you see doing "dmesg | grep mmc" ?
#9
Is there maybe one of the two supply voltages for eMMC missing?
Come have a chat in the Pine IRC channel >>
#10
(11-19-2019, 10:49 AM)martinayotte Wrote: If booting SD allows you to see /dev/mmcblk2, but you are unable to do "fdisk /dev/mmcblk2", there is maybe an hardware issue.
What do you see doing "dmesg | grep mmc" ?

Quote:# dmesg |grep mmc
dmesg |grep mmc
[ 2.600060] sunxi-mmc 4020000.mmc: Got CD GPIO
[ 2.625463] sunxi-mmc 4020000.mmc: initialized, max. request size: 16384 KB, uses new timings mode
[ 2.626861] sunxi-mmc 4021000.mmc: allocated mmc-pwrseq
[ 2.661362] mmc0: host does not support reading read-only switch, assuming write-enable
[ 2.663300] mmc0: new high speed SDXC card at address 0007
[ 2.664391] mmcblk0: mmc0:0007 SD64G 58.2 GiB
[ 2.665690] mmcblk0: p1
[ 2.856778] sunxi-mmc 4021000.mmc: initialized, max. request size: 16384 KB, uses new timings mode
[ 2.875136] mmc1: new high speed SDIO card at address 0001
[ 2.883469] sunxi-mmc 4022000.mmc: initialized, max. request size: 2048 KB, uses new timings mode
[ 3.364311] mmc2: new DDR MMC card at address 0001
[ 3.365596] mmcblk2: mmc2:0001 CJNB4R 58.2 GiB
[ 3.366487] mmcblk2boot0: mmc2:0001 CJNB4R partition 1 4.00 MiB
[ 3.367339] mmcblk2boot1: mmc2:0001 CJNB4R partition 2 4.00 MiB
[ 3.368442] mmcblk2: p1
[ 3.650870] EXT4-fs (mmcblk0p1): mounted filesystem with writeback data mode. Opts: (null)
[ 4.951199] EXT4-fs (mmcblk0p1): re-mounted. Opts: commit=600,errors=remount-ro
[ 76.012041] sunxi-mmc 4022000.mmc: data error, sending stop command
[ 77.008200] sunxi-mmc 4022000.mmc: send stop command failed

The data error stop command were emitted when I tried to access the eMMC device.

(11-19-2019, 03:29 PM)xalius Wrote: Is there maybe one of the two supply voltages for eMMC missing?

How would I check for that? Is a missing supply voltage something that would allow for partial function? It is worth noting that the android eMMC and the aosc images linked on the pine64 wiki boot fine from eMMC. So I have been operating under the assumption this was a software only problem.


Possibly Related Threads…
Thread Author Replies Views Last Post
  PINE H64 u-boot and kernel shinymetal 2 6,594 02-28-2018, 02:05 PM
Last Post: shinymetal

Forum Jump:


Users browsing this thread: 3 Guest(s)