Hi,

On Tue, 6 Sep 2016 02:51:29 -0700 (PDT)
Ciprian Manea <[email protected]> wrote:

> Hi,
> 
>   I'm using the Sina33 dev board and as the wiki page says, it has a  4GB 
> eMMC (Toshiba THGBM5G5A1JBAIR). I'm trying to flash and boot  a custom made 
> debian based Linux image from the eMMC at the moment.
> I'm able to boot this image from the SD card, but no luck so far with 
> booting from the eMMC.
> 
> What I did and got so far is trying to 
> follow https://linux-sunxi.org/Bootable_SD_card  and flash the eMMC while 
> booted from the SD card:
> 
> 1. *# mkfs.ext4 /dev/mmcblk1*
> 
> 
> *root@sina33:~# cat /proc/partitions major minor  #blocks  name 179        
> 0   30183936 mmcblk0 179        1    8209408 mmcblk0p1 179        8    
> 3866624 mmcblk1 179       24       2048 mmcblk1boot1 179       16       
> 2048 mmcblk1boot0I don't understand why the boot partitions are not wiped.*

That's because boot partitions are separate block devices.

The whole idea of having boot partitions is that with eMMC you can have
your bootloader/firmware in its own special place, which is not sharing
the same block device with your primary storage media /dev/mmcblk1
So that it's more difficult to accidentally (or maliciously) corrupt
your fiwmware. And also you can have proper GPT partitioning without
the bootloader special areas getting in the way.


> 2. *# root@sina33:~# fdisk -l*
> 
> 
> *Disk /dev/mmcblk0: 28.8 GiB, 30908350464 bytes, 60367872 sectorsUnits: 
> sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 
> 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisklabel type: 
> dosDisk identifier: 0x6706f5d0Device         Boot Start      End  Sectors  
> Size Id Type/dev/mmcblk0p1       2048 16420863 16418816  7.8G 83 LinuxDisk 
> /dev/mmcblk1: 3.7 GiB, 3959422976 bytes, 7733248 sectorsUnits: sectors of 1 
> * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O 
> size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mmcblk1boot1: 2 MiB, 
> 2097152 bytes, 4096 sectorsUnits: sectors of 1 * 512 = 512 bytesSector size 
> (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 
> bytes / 512 bytesDisk /dev/mmcblk1boot0: 2 MiB, 2097152 bytes, 4096 
> sectorsUnits: sectors of 1 * 512 = 512 bytesSector size (logical/physical): 
> 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytes*
> 
> 
> 3. *# dd if=sdcard-sina33.img  of=/dev/mmcblk1 bs=1M*
> *( The SD-card bootable image)*
> 
> 
> 4.* # root@sina33:~# fdisk -l*
> 
> 
> *Disk /dev/mmcblk0: 28.8 GiB, 30908350464 bytes, 60367872 sectorsUnits: 
> sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 
> 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisklabel type: 
> dosDisk identifier: 0x6706f5d0Device         Boot Start      End  Sectors  
> Size Id Type/dev/mmcblk0p1       2048 16420863 16418816  7.8G 83 LinuxDisk 
> /dev/mmcblk1: 3.7 GiB, 3959422976 bytes, 7733248 sectorsUnits: sectors of 1 
> * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O 
> size (minimum/optimal): 512 bytes / 512 bytesDisklabel type: dosDisk 
> identifier: 0x6706f5d0Device         Boot Start     End Sectors Size Id 
> Type/dev/mmcblk1p1       2048 4194303 4192256   2G 83 LinuxDisk 
> /dev/mmcblk1boot1: 2 MiB, 2097152 bytes, 4096 sectorsUnits: sectors of 1 * 
> 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O 
> size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mmcblk1boot0: 2 MiB, 
> 2097152 bytes, 4096 sectorsUnits: sectors of 1 * 512 = 512 bytesSector size 
> (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 
> bytes / 512 bytes*
> 
> 
> 5. Trying to boot without an sdcard connected
> 
> 
> *�`  08x x �|> ������������� �HELLO! BOOT0 is starting!boot0 version : 
> 3.1.0reg_addr 0x01f00100 =0x00000000reg_addr 0x01f00104 =0x00000000reg_addr 
> 0x01f00108 =0x00000000reg_addr 0x01f0010c =0x00000000reg_addr 0x01f00110 
> =0x00000000reg_addr 0x01f00114 =0x00000000DRAM DRIVE INFO: V1.4DRAM CLK 
> =552 MHZDRAM simple test OK.dram size =1024card boot number = 2card no is 
> 2sdcard 2 line count 0[mmc]: mmc driver ver 2014-06-05 14:18[mmc]: ***Try 
> SD card 2***[mmc]: mmc 2 cmd 8 timeout, err 0x00000100[mmc]: mmc 2 cmd 8 
> err 0x00000100[mmc]: mmc 2 send if cond failed[mmc]: mmc 2 cmd 55 timeout, 
> err 0x00000100[mmc]: mmc 2 cmd 55 err 0x00000100[mmc]: mmc 2 send app cmd 
> failed[mmc]: ***Try MMC card 2***[mmc]: MMC ver 4.5[mmc]: SD/MMC Card: 
> 4bit, capacity: 3776MB[mmc]: vendor: Man 0x00110100 Snr 0x1094e248[mmc]: 
> product: 004G9[mmc]: revision: 3.0[mmc]: ***SD/MMC 2 init OK!!!***sdcard 2 
> init okERROR! NOT find the head of uboot.Ready to disable icache.Jump to 
> Fel.*
> 
> 
> *What am I missing here ? Why can't I wipe the 2 *boot partitions? Should I 
> write the U-Boot & U-Boot SPL to one of those ?*

If you want to use the eMMC in an sdcard-alike way and have your
bootloader on /dev/mmcblk1, then you can try to erase the content
of the boot partitions.

Or you can try to use eMMC boot partitions for your own bootloader.
The U-Boot bootloader is not quite ready for this though and may
need some fixes (it needs to differentiate booting from the eMMC
boot partitions and booting from the eMMC data area). There are
special magic codes for the boot media type returned by the boot
ROM: https://irclog.whitequark.org/linux-sunxi/2016-06-11#16717168;

-- 
Best regards,
Siarhei Siamashka

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to