Difference between revisions of "APF6 EMMC"

From ArmadeusWiki
Jump to: navigation, search
(Boot0 partition layout)
(User Data partition layout)
 
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
[[Category: eMMC]]
 
= APF6 eMMC layout =
 
= APF6 eMMC layout =
  
Line 29: Line 30:
 
{| border="1" cellpadding="10" cellspacing="0" summary="APF6 eMMC partitions"
 
{| border="1" cellpadding="10" cellspacing="0" summary="APF6 eMMC partitions"
 
|----------------
 
|----------------
| style="width:50px;background:white;color:black;" align="center" | ...
+
| style="width:10px;background:white;color:black;" align="center" | .
| style="width:50px;background:orange;color:white;" align="center" | SPL
+
| style="width:40px;background:orange;color:white;" align="center" | SPL
| style="width:80px;background:orange;color:white;" align="center" | IMG
+
| style="width:150px;background:orange;color:white;" align="center" | IMG
 
| style="width:100px;background:white;color:black;" align="center" | ...
 
| style="width:100px;background:white;color:black;" align="center" | ...
| style="width:40px;background:orange;color:white;" align="center" | ENV1
+
| style="width:30px;background:orange;color:white;" align="center" | ENV1
 
| style="width:150px;background:white;color:black;" align="center" | ...
 
| style="width:150px;background:white;color:black;" align="center" | ...
| style="width:40px;background:orange;color:white;" align="center" | ENV2
+
| style="width:30px;background:orange;color:white;" align="center" | ENV2
 
| style="width:150px;background:white;color:black;" align="center" | ...
 
| style="width:150px;background:white;color:black;" align="center" | ...
 
|}
 
|}
Line 44: Line 45:
 
! Offset (blocks) || Offset (bytes) || Size (bytes) || Comment
 
! Offset (blocks) || Offset (bytes) || Size (bytes) || Comment
 
|----------------
 
|----------------
|0 || 0 || 1 KB (0x400) ||  
+
|0 || 0 || 1 KB (0x400) || Free
 
|----------------
 
|----------------
|0x02 || 1 KB (0x400)|| || U-Boot SPL (apf6-u-boot.spl)
+
|0x02 || 1 KB (0x400) || 68 KB || U-Boot SPL (apf6-u-boot.spl)
 
|----------------
 
|----------------
|0x8a || 69 KB || || U-Boot IMG (apf6-u-boot.img)
+
|0x8a || 69 KB (0x11400) || 512 KB || U-Boot IMG (apf6-u-boot.img)
 
|----------------
 
|----------------
||| 512 KB || ||  
+
||| || || Free
 
|----------------
 
|----------------
 
|0x800 (2048) || 1024 KB (0x100000) || 10 KB (0x2800) || U-Boot environment
 
|0x800 (2048) || 1024 KB (0x100000) || 10 KB (0x2800) || U-Boot environment
 +
|----------------
 +
||| || || Free
 
|----------------
 
|----------------
 
|0xc00 (3072) || 1536 KB (0x180000) || 10 KB (0x2800) || Redundant U-Boot environment
 
|0xc00 (3072) || 1536 KB (0x180000) || 10 KB (0x2800) || Redundant U-Boot environment
 +
|----------------
 +
||| || || Free
 
|----------------
 
|----------------
 
|}
 
|}
Line 63: Line 68:
 
{| border="1" cellpadding="10" cellspacing="0" summary="APF6 eMMC partitions"
 
{| border="1" cellpadding="10" cellspacing="0" summary="APF6 eMMC partitions"
 
|----------------
 
|----------------
| style="width:50px;background:green;color:white;" align="center" | ...
+
| style="width:50px;background:white;color:black;" align="center" | ...
 
| style="width:100px;background:green;color:white;" align="center" | Boot
 
| style="width:100px;background:green;color:white;" align="center" | Boot
 
| style="width:600px;background:green;color:white;" align="center" | Rootfs
 
| style="width:600px;background:green;color:white;" align="center" | Rootfs
Line 71: Line 76:
 
{| border="1" cellpadding="5" cellspacing="0" summary="APF6 eMMC User data partitions details"
 
{| border="1" cellpadding="5" cellspacing="0" summary="APF6 eMMC User data partitions details"
 
|- style="background:#efefef;" align="center"
 
|- style="background:#efefef;" align="center"
!Name || U-Boot device  || Linux device || Offset (blocks) || Size || Comment
+
!Name || U-Boot device  || Linux device || Offset (bytes) || Offset (blocks) || Size || Comment
 
|----------------
 
|----------------
|... || NA || NA || 0 || 1 MBytes (2048 blocks) || Free
+
|MBR || NA || NA || 0 || 0 || 512 bytes (1 block) || Master Boot Record. (Don't touch it :-) )
 
|----------------
 
|----------------
|Boot || mmc 0:1 || /dev/mmcblk2p1 || 2048 (0x800) || 24 MBytes (49152 blocks) || The kernel and the device tree (inside a ''dtbs/'' directory) are on this partition (ext4 formatted)
+
|... || NA || NA || 512 || 1 || ~1 MBytes (2047 blocks) || Free
 
|----------------
 
|----------------
|Rootfs || mmc 0:2 || /dev/mmcblk2p2 || (0x18800) || Rest of space (<3816448 blocks) || the rootfs is on this partition (ext4 formatted)
+
|Boot || mmc 0:1 || /dev/mmcblk2p1 || 1M (0x100000) || 2048 (0x800) || 48 MBytes (98304 blocks) || The kernel and the device tree (inside a ''dtbs/'' directory) are on this partition (ext4 formatted)
 +
|----------------
 +
|Rootfs || mmc 0:2 || /dev/mmcblk2p2 || 49M (0x3100000)|| 100352 (0x18800) || Rest of space (< 7632896 blocks) || the rootfs is on this partition (ext4 formatted)
 
|----------------
 
|----------------
 
|}
 
|}
  
* By default rootfs is only occupying the size of the .ext4 image flashed with U-Boot. If you want to increase the rootfs available free space then, after Linux has booted, use the following command:
+
* By default, when flashed from U-Boot, rootfs and boot are only occupying the size of the .ext4 images used during flashing. If you want to increase the rootfs/boot size to all available free space then, after Linux has booted, use the following commands:
 
<pre class="apf">
 
<pre class="apf">
# resize2fs /dev/mmcblk2p2
+
# resize2fs /dev/mmcblk2p1        # for Boot
 +
# resize2fs /dev/mmcblk2p2       # for Rootfs
 +
## Or on current bsp:
 +
# resize2fs /dev/mmcblk1p1        # for Boot
 +
# resize2fs /dev/mmcblk1p2        # for Rootfs
 
</pre>
 
</pre>
Rootfs will then be extended to all the "Rootfs" eMMC partition space.
+
 
 +
* Or with apf-config command
 +
<pre class="apf">
 +
# apf-config
 +
</pre>
 +
* in menu:
 +
<pre class="config">
 +
|    1 Expand Filesystem(s)        OS can then use all eMMC/SD space        |
 +
</pre>
 +
 
 +
 
 +
Rootfs/Boot will then be extended to all the "Rootfs"/"Boot" eMMC partitions space.
  
 
==Links==
 
==Links==
 
* [http://fr.slideshare.net/linaroorg/intro-to-emmc http://fr.slideshare.net/linaroorg/intro-to-emmc]
 
* [http://fr.slideshare.net/linaroorg/intro-to-emmc http://fr.slideshare.net/linaroorg/intro-to-emmc]
 +
* https://fr.wikipedia.org/wiki/Master_boot_record ou http://poloastucien.free.fr/mbr_fat_secteurs_boot_h.html

Latest revision as of 11:30, 29 June 2020

APF6 eMMC layout

By default, the 4GB eMMC on APF6 board has 4 physical/hardware partitions:

Boot0 Boot1 RPMB User Data


Name U-Boot name Size Comment
boot0 mmc dev 0 1 2MBytes U-Boot is installed on this partition
boot1 mmc dev 0 2 2MBytes Not used
rpmb mmc dev 0 3 512KBytes Not used
User Data mmc dev 0 0 remaining space Kernel, device tree and rootfs

Boot0 partition layout

. SPL IMG ... ENV1 ... ENV2 ...
  • Linux device: /dev/mmcblk2boot0
Offset (blocks) Offset (bytes) Size (bytes) Comment
0 0 1 KB (0x400) Free
0x02 1 KB (0x400) 68 KB U-Boot SPL (apf6-u-boot.spl)
0x8a 69 KB (0x11400) 512 KB U-Boot IMG (apf6-u-boot.img)
Free
0x800 (2048) 1024 KB (0x100000) 10 KB (0x2800) U-Boot environment
Free
0xc00 (3072) 1536 KB (0x180000) 10 KB (0x2800) Redundant U-Boot environment
Free

User Data partition layout

There are two primary partitions on the "User Data" physical partition:

... Boot Rootfs


Name U-Boot device Linux device Offset (bytes) Offset (blocks) Size Comment
MBR NA NA 0 0 512 bytes (1 block) Master Boot Record. (Don't touch it :-) )
... NA NA 512 1 ~1 MBytes (2047 blocks) Free
Boot mmc 0:1 /dev/mmcblk2p1 1M (0x100000) 2048 (0x800) 48 MBytes (98304 blocks) The kernel and the device tree (inside a dtbs/ directory) are on this partition (ext4 formatted)
Rootfs mmc 0:2 /dev/mmcblk2p2 49M (0x3100000) 100352 (0x18800) Rest of space (< 7632896 blocks) the rootfs is on this partition (ext4 formatted)
  • By default, when flashed from U-Boot, rootfs and boot are only occupying the size of the .ext4 images used during flashing. If you want to increase the rootfs/boot size to all available free space then, after Linux has booted, use the following commands:
# resize2fs /dev/mmcblk2p1        # for Boot
# resize2fs /dev/mmcblk2p2        # for Rootfs
## Or on current bsp:
# resize2fs /dev/mmcblk1p1        # for Boot
# resize2fs /dev/mmcblk1p2        # for Rootfs
  • Or with apf-config command
# apf-config
  • in menu:
|     1 Expand Filesystem(s)         OS can then use all eMMC/SD space         |


Rootfs/Boot will then be extended to all the "Rootfs"/"Boot" eMMC partitions space.

Links